-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagreements.py
More file actions
135 lines (118 loc) · 3.96 KB
/
agreements.py
File metadata and controls
135 lines (118 loc) · 3.96 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
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
from mpt_api_client.http import AsyncService, Service
from mpt_api_client.http.mixins import (
AsyncCollectionMixin,
AsyncManagedResourceMixin,
CollectionMixin,
ManagedResourceMixin,
)
from mpt_api_client.models import Model
from mpt_api_client.models.model import BaseModel
from mpt_api_client.resources.commerce.agreements_attachments import (
AgreementsAttachmentService,
AsyncAgreementsAttachmentService,
)
from mpt_api_client.resources.commerce.mixins import (
AsyncRenderMixin,
AsyncTemplateMixin,
RenderMixin,
TemplateMixin,
)
class Agreement(Model):
"""Agreement resource.
Attributes:
icon: URL or identifier for the agreement icon.
status: Agreement status.
name: Agreement name.
start_date: Agreement start date.
end_date: Agreement end date.
listing: Reference to the listing.
authorization: Reference to the authorization.
vendor: Reference to the vendor account.
client: Reference to the client account.
price: Price information.
template: Reference to the template.
error: Error information.
lines: List of agreement lines.
assets: List of assets.
subscriptions: List of subscriptions.
parameters: Agreement parameters.
licensee: Reference to the licensee.
buyer: Reference to the buyer.
seller: Reference to the seller.
product: Reference to the product.
external_ids: External identifiers.
split: Split billing information.
terms_and_conditions: List of terms and conditions.
certificates: List of certificates.
audit: Audit information.
"""
icon: str | None
status: str | None
name: str | None
start_date: str | None
end_date: str | None
listing: BaseModel | None
authorization: BaseModel | None
vendor: BaseModel | None
client: BaseModel | None
price: BaseModel | None
template: BaseModel | None
error: BaseModel | None
lines: list[BaseModel] | None
assets: list[BaseModel] | None
subscriptions: list[BaseModel] | None
parameters: BaseModel | None # noqa: WPS110
licensee: BaseModel | None
buyer: BaseModel | None
seller: BaseModel | None
product: BaseModel | None
external_ids: BaseModel | None
split: BaseModel | None
terms_and_conditions: list[BaseModel] | None
certificates: list[BaseModel] | None
audit: BaseModel | None
class AgreementsServiceConfig:
"""Orders service config."""
_endpoint = "/public/v1/commerce/agreements"
_model_class = Agreement
_collection_key = "data"
class AgreementsService(
RenderMixin[Agreement],
TemplateMixin[Agreement],
ManagedResourceMixin[Agreement],
CollectionMixin[Agreement],
Service[Agreement],
AgreementsServiceConfig,
):
"""Agreements service."""
def attachments(self, agreement_id: str) -> AgreementsAttachmentService:
"""Get the attachments service for the given Agreement id.
Args:
agreement_id: Agreement ID.
Returns:
Agreements Attachment service.
"""
return AgreementsAttachmentService(
http_client=self.http_client,
endpoint_params={"agreement_id": agreement_id},
)
class AsyncAgreementsService(
AsyncRenderMixin[Agreement],
AsyncTemplateMixin[Agreement],
AsyncManagedResourceMixin[Agreement],
AsyncCollectionMixin[Agreement],
AsyncService[Agreement],
AgreementsServiceConfig,
):
"""Agreements service."""
def attachments(self, agreement_id: str) -> AsyncAgreementsAttachmentService:
"""Get the attachments service for the given Agreement id.
Args:
agreement_id: Agreement ID.
Returns:
Agreements Attachment service.
"""
return AsyncAgreementsAttachmentService(
http_client=self.http_client,
endpoint_params={"agreement_id": agreement_id},
)