here.platform.artifact module
here.platform.artifact module
HERE platform Artifact abstraction.
class here.platform.artifact.Artifact(hrn: str, configuration: ArtifactConfiguration, platform: Platform)
Bases: object
HERE platform Artifact abstraction.
delete_file(file_name: str) bool
Delete file from the artifact. for the given HRN
Parameters:
file_name – The path to artifact file
Returns:
response from the API.
get_file(file_name: str) bytes
Return the binary data of file linked to artifact.
Parameters:
file_name – The path to artifact file
Returns:
response from the API.
get_file_from_archive(archive_file: str, file_in_archive: str) bytes
Returns the binary data of a file stored in archive.
Parameters:
-
archive_file – The name of artifact archive. Supported archive types are zip and jar
-
file_in_archive – Relative path of file in archive
Returns:
response from the API.
put_file(file_name: str, body: bytes) bool
Upload the file and linked to artifact. Requires permission to ‘modifyResource’ for the given HRN.
Parameters:
-
body – Data to be uploaded
-
file_name – The path to artifact file
Returns:
response from the API.
update_permission(body: dict) bool
READ grants ‘readResource’, MODIFY grants ‘modifyResource’, SHARE grants ‘shareResource’. :param body: a dictionary with permissions. :return: response from the API.
class here.platform.artifact.ArtifactConfiguration(json_dict: Dict[str, Any])
Bases: JsonDictDocument
A JSON document for artifact configuration used in APIs loaded into a Dict.
property artifact_id: str | None
Artifact ID in the artifact response
property created: str | None
Created date in the artifact response
property files: str | None
Files in the artifact response
property group_id: str | None
Group ID in the artifact response
property updated: str | None
Updated date in the artifact response
property version: str | None
Version in the artifact response