-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathorders_subscription.py
More file actions
73 lines (62 loc) · 2.19 KB
/
orders_subscription.py
File metadata and controls
73 lines (62 loc) · 2.19 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
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
class OrderSubscription(Model):
"""Order Subscription resource.
Attributes:
name: Subscription name.
status: Subscription status.
start_date: Subscription start date.
termination_date: Subscription termination date.
commitment_date: Subscription commitment date.
auto_renew: Whether the subscription auto-renews.
external_ids: External identifiers.
terms: Reference to terms and conditions.
product: Reference to the product.
parameters: Subscription parameters.
agreement: Reference to the agreement.
price: Price 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
auto_renew: bool | None
external_ids: BaseModel | None
terms: BaseModel | None
product: BaseModel | None
parameters: BaseModel | None # noqa: WPS110
agreement: BaseModel | None
price: BaseModel | None
template: BaseModel | None
lines: list[BaseModel] | None
audit: BaseModel | None
class OrderSubscriptionsServiceConfig:
"""Orders service config."""
_endpoint = "/public/v1/commerce/orders/{order_id}/subscriptions"
_model_class = OrderSubscription
_collection_key = "data"
class OrderSubscriptionsService( # noqa: WPS215
ManagedResourceMixin[OrderSubscription],
CollectionMixin[OrderSubscription],
Service[OrderSubscription],
OrderSubscriptionsServiceConfig,
):
"""Orders Subscription service."""
class AsyncOrderSubscriptionsService( # noqa: WPS215
AsyncManagedResourceMixin[OrderSubscription],
AsyncCollectionMixin[OrderSubscription],
AsyncService[OrderSubscription],
OrderSubscriptionsServiceConfig,
):
"""Async Orders Subscription service."""