-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsubscriptions.py
More file actions
104 lines (93 loc) · 2.89 KB
/
subscriptions.py
File metadata and controls
104 lines (93 loc) · 2.89 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
from mpt_api_client.http import (
AsyncService,
Service,
)
from mpt_api_client.http.mixins import (
AsyncCollectionMixin,
AsyncCreateMixin,
AsyncGetMixin,
AsyncUpdateMixin,
CollectionMixin,
CreateMixin,
GetMixin,
UpdateMixin,
)
from mpt_api_client.models import Model
from mpt_api_client.models.model import BaseModel
from mpt_api_client.resources.commerce.mixins import (
AsyncRenderMixin,
AsyncTerminateMixin,
RenderMixin,
TerminateMixin,
)
class Subscription(Model):
"""Subscription resource.
Attributes:
name: Subscription name.
status: Subscription status.
start_date: Subscription start date.
termination_date: Subscription termination date.
commitment_date: Subscription commitment date.
split_status: Split billing status.
auto_renew: Whether the subscription auto-renews.
external_ids: External identifiers.
terms: Reference to terms and conditions.
product: Reference to the product.
price: Price information.
parameters: Subscription parameters.
agreement: Reference to the agreement.
buyer: Reference to the buyer.
licensee: Reference to the licensee.
seller: Reference to the seller.
split: Split billing information.
template: Reference to the template.
lines: List of subscription lines.
audit: Audit information.
"""
name: str | None
status: str | None
start_date: str | None
termination_date: str | None
commitment_date: str | None
split_status: str | None
auto_renew: bool | None
external_ids: BaseModel | None
terms: BaseModel | None
product: BaseModel | None
price: BaseModel | None
parameters: BaseModel | None # noqa: WPS110
agreement: BaseModel | None
buyer: BaseModel | None
licensee: BaseModel | None
seller: BaseModel | None
split: BaseModel | None
template: BaseModel | None
lines: list[BaseModel] | None
audit: BaseModel | None
class SubscriptionsServiceConfig:
"""Subscription service config."""
_endpoint = "/public/v1/commerce/subscriptions"
_model_class = Subscription
_collection_key = "data"
class SubscriptionsService( # noqa: WPS215
CreateMixin[Subscription],
UpdateMixin[Subscription],
GetMixin[Subscription],
CollectionMixin[Subscription],
TerminateMixin[Subscription],
RenderMixin[Subscription],
Service[Subscription],
SubscriptionsServiceConfig,
):
"""Subscription service."""
class AsyncSubscriptionsService( # noqa: WPS215
AsyncCreateMixin[Subscription],
AsyncUpdateMixin[Subscription],
AsyncGetMixin[Subscription],
AsyncCollectionMixin[Subscription],
AsyncTerminateMixin[Subscription],
AsyncRenderMixin[Subscription],
AsyncService[Subscription],
SubscriptionsServiceConfig,
):
"""Async Subscription service."""