-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathassets.py
More file actions
93 lines (80 loc) · 2.26 KB
/
assets.py
File metadata and controls
93 lines (80 loc) · 2.26 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
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 Asset(Model):
"""Asset resource.
Attributes:
name: Asset name.
status: Asset status.
external_ids: External identifiers.
price: Price information.
template: Reference to the template.
parameters: Asset parameters.
terms: Reference to terms and conditions.
agreement: Reference to the agreement.
product: Reference to the product.
price_list: Reference to the price list.
listing: Reference to the listing.
licensee: Reference to the licensee.
lines: List of asset lines.
audit: Audit information.
"""
name: str | None
status: str | None
external_ids: BaseModel | None
price: BaseModel | None
template: BaseModel | None
parameters: BaseModel | None # noqa: WPS110
terms: BaseModel | None
agreement: BaseModel | None
product: BaseModel | None
price_list: BaseModel | None
listing: BaseModel | None
licensee: BaseModel | None
lines: list[BaseModel] | None
audit: BaseModel | None
class AssetTemplate(Model):
"""Asset template resource."""
class AssetServiceConfig:
"""Assets service config."""
_endpoint = "/public/v1/commerce/assets"
_model_class = Asset
_collection_key = "data"
class AssetService(
CreateMixin[Asset],
UpdateMixin[Asset],
GetMixin[Asset],
TerminateMixin[Asset],
RenderMixin[Asset],
CollectionMixin[Asset],
Service[Asset],
AssetServiceConfig,
):
"""Assets service."""
class AsyncAssetService(
AsyncCreateMixin[Asset],
AsyncUpdateMixin[Asset],
AsyncGetMixin[Asset],
AsyncTerminateMixin[Asset],
AsyncRenderMixin[Asset],
AsyncCollectionMixin[Asset],
AsyncService[Asset],
AssetServiceConfig,
):
"""Asynchronous Assets service."""