-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagreements_attachments.py
More file actions
65 lines (54 loc) · 1.72 KB
/
agreements_attachments.py
File metadata and controls
65 lines (54 loc) · 1.72 KB
1
2
3
4
5
6
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
from mpt_api_client.http import AsyncService, Service
from mpt_api_client.http.mixins import ( # noqa: WPS235
AsyncCollectionMixin,
AsyncCreateFileMixin,
AsyncDeleteMixin,
AsyncDownloadFileMixin,
AsyncGetMixin,
AsyncUpdateMixin,
CollectionMixin,
CreateFileMixin,
DeleteMixin,
DownloadFileMixin,
GetMixin,
UpdateMixin,
)
from mpt_api_client.models import Model
from mpt_api_client.models.model import BaseModel
class AgreementAttachment(Model):
"""Agreement attachment resource.
Attributes:
attachment: Attachment metadata.
file: File reference or URL.
"""
attachment: BaseModel | None
file: str | None # noqa: WPS110
class AgreementsAttachmentServiceConfig:
"""Orders service config."""
_endpoint = "/public/v1/commerce/agreements/{agreement_id}/attachments"
_model_class = AgreementAttachment
_collection_key = "data"
_upload_file_key = "file"
_upload_data_key = "attachment"
class AgreementsAttachmentService(
CreateFileMixin[AgreementAttachment],
UpdateMixin[AgreementAttachment],
DownloadFileMixin[AgreementAttachment],
DeleteMixin,
GetMixin[AgreementAttachment],
CollectionMixin[AgreementAttachment],
Service[AgreementAttachment],
AgreementsAttachmentServiceConfig,
):
"""Attachments service."""
class AsyncAgreementsAttachmentService(
AsyncCreateFileMixin[AgreementAttachment],
AsyncUpdateMixin[AgreementAttachment],
AsyncDownloadFileMixin[AgreementAttachment],
AsyncDeleteMixin,
AsyncGetMixin[AgreementAttachment],
AsyncCollectionMixin[AgreementAttachment],
AsyncService[AgreementAttachment],
AgreementsAttachmentServiceConfig,
):
"""Attachments service."""