swimlane.core.resources.attachment module

class swimlane.core.resources.attachment.Attachment(*args, **kwargs)[source]

Bases: APIResource

Abstraction of an attachment from an AttachmentsField

file_id

Full file ID used in download request URL

Type:

str

filename

Attachment filename

Type:

str

upload_date

Pendulum datetime when attachment was uploaded

Type:

pendulum.DateTime

record_id

Associated record ID used in download request URL

Type:

str

field_id

Assocated field ID used in download request URL

Type:

str

download(chunk_size=1024)[source]

Download attachment

Parameters:

chunk_size (int) – Byte-size of chunked download request stream

Returns:

Stream ready for reading containing the attachment file contents

Return type:

BytesIO

for_json()[source]

Return metadata for JSON-compatible representation