models.ExpiringDownload

class ExpiringDownload(json: Dict, **kwargs)[source]

Expiring Download class.

Init function.

Parameters

json (dict) – the json response to construct the ExpiringDownload from

save_as(target_dir: Optional[str] = None) None[source]

Save the Expiring Download content.

Parameters

target_dir (str) – the target directory where the file will be stored

delete() None[source]

Delete this expiring download.

Raises

APIError – if delete was not successful.

edit(expires_at: ~typing.Optional[~datetime.datetime] = <pykechain.utils.Empty object>, expires_in: ~typing.Optional[int] = <pykechain.utils.Empty object>, **kwargs) None[source]

Edit Expiring Download details.

Parameters
  • expires_at (datetime.datetime) – The moment at which the ExpiringDownload will expire

  • expires_in (int) – The amount of time (in seconds) in which the ExpiringDownload will expire

upload(content_path)[source]

Upload a file to the Expiring Download.

New in version 3.10.0.

Parameters

content_path (basestring) – path to the file to upload.

Raises
  • APIError – if the file could not be uploaded.

  • OSError – if the file could not be located on disk.