resources
Monzo API 'attachments' resource.
AttachmentsResource
dataclass
Bases: BaseResource
Monzo API 'attachments' resource.
Note
Monzo API docs: https://docs.monzo.com/#attachments
Source code in pymonzo/attachments/resources.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
deregister(attachment_id)
Deregister an attachment.
Note
Monzo API docs: https://docs.monzo.com/#deregister-attachment
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
attachment_id |
str
|
The ID of the attachment to deregister. |
required |
Returns:
| Type | Description |
|---|---|
dict
|
API response. |
Source code in pymonzo/attachments/resources.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 | |
register(transaction_id, *, file_url, file_type)
Register uploaded image to an attachment.
Note
Monzo API docs: https://docs.monzo.com/#register-attachment
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
transaction_id |
str
|
The ID of the transaction to associate the attachment with. |
required |
file_url |
str
|
The URL of the uploaded attachment. |
required |
file_type |
str
|
The content type of the attachment. |
required |
Returns:
| Type | Description |
|---|---|
MonzoAttachment
|
A Monzo attachment. |
Source code in pymonzo/attachments/resources.py
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | |
upload(*, file_name, file_type, content_length)
Upload an attachment.
The response will include a file_url which will be the URL of the resulting
file, and an upload_url to which the file should be uploaded to.
Note
Monzo API docs: https://docs.monzo.com/#upload-attachment
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
file_name |
str
|
The name of the file to be uploaded. |
required |
file_type |
str
|
The content type of the file. |
required |
content_length |
int
|
The HTTP Content-Length of the upload request body, in bytes. |
required |
Returns:
| Type | Description |
|---|---|
MonzoAttachmentResponse
|
Response with |
MonzoAttachmentResponse
|
and an |
Source code in pymonzo/attachments/resources.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | |