robosystems-client 0.2.10__py3-none-any.whl → 0.2.12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of robosystems-client might be problematic. Click here for more details.
- robosystems_client/api/auth/register_user.py +36 -8
- robosystems_client/api/billing/__init__.py +1 -0
- robosystems_client/api/billing/cancel_org_subscription.py +198 -0
- robosystems_client/api/billing/create_checkout_session.py +238 -0
- robosystems_client/api/billing/get_checkout_status.py +221 -0
- robosystems_client/api/billing/get_org_billing_customer.py +189 -0
- robosystems_client/api/billing/get_org_subscription.py +190 -0
- robosystems_client/api/billing/get_org_upcoming_invoice.py +203 -0
- robosystems_client/api/billing/list_org_invoices.py +210 -0
- robosystems_client/api/billing/list_org_subscriptions.py +194 -0
- robosystems_client/api/billing/update_org_payment_method.py +207 -0
- robosystems_client/api/org/__init__.py +1 -0
- robosystems_client/api/org/create_org.py +174 -0
- robosystems_client/api/org/get_org.py +165 -0
- robosystems_client/api/org/list_org_graphs.py +170 -0
- robosystems_client/api/{user/get_user_limits.py → org/list_user_orgs.py} +21 -25
- robosystems_client/api/org/update_org.py +187 -0
- robosystems_client/api/org_members/__init__.py +1 -0
- robosystems_client/api/org_members/invite_org_member.py +207 -0
- robosystems_client/api/org_members/list_org_members.py +165 -0
- robosystems_client/api/org_members/remove_org_member.py +176 -0
- robosystems_client/api/org_members/update_org_member_role.py +200 -0
- robosystems_client/api/org_usage/__init__.py +1 -0
- robosystems_client/api/org_usage/get_org_limits.py +165 -0
- robosystems_client/api/org_usage/get_org_usage.py +186 -0
- robosystems_client/api/service_offerings/get_service_offerings.py +32 -8
- robosystems_client/api/usage/get_graph_usage_analytics.py +4 -4
- robosystems_client/models/__init__.py +68 -6
- robosystems_client/models/auth_response.py +35 -0
- robosystems_client/models/{user_usage_response_graphs.py → auth_response_org_type_0.py} +6 -6
- robosystems_client/models/billing_customer.py +128 -0
- robosystems_client/models/checkout_response.py +130 -0
- robosystems_client/models/checkout_status_response.py +130 -0
- robosystems_client/models/create_checkout_request.py +88 -0
- robosystems_client/models/create_checkout_request_resource_config.py +44 -0
- robosystems_client/models/create_org_request.py +79 -0
- robosystems_client/models/graph_subscription_tier.py +40 -48
- robosystems_client/models/graph_subscriptions.py +17 -5
- robosystems_client/models/invite_member_request.py +93 -0
- robosystems_client/models/invoice.py +244 -0
- robosystems_client/models/invoice_line_item.py +118 -0
- robosystems_client/models/invoices_response.py +90 -0
- robosystems_client/models/list_org_graphs_response_200_item.py +44 -0
- robosystems_client/models/org_detail_response.py +174 -0
- robosystems_client/models/org_detail_response_graphs_item.py +44 -0
- robosystems_client/models/org_detail_response_limits_type_0.py +44 -0
- robosystems_client/models/org_detail_response_members_item.py +44 -0
- robosystems_client/models/org_limits_response.py +98 -0
- robosystems_client/models/org_limits_response_current_usage.py +44 -0
- robosystems_client/models/org_list_response.py +82 -0
- robosystems_client/models/org_member_list_response.py +90 -0
- robosystems_client/models/org_member_response.py +104 -0
- robosystems_client/models/org_response.py +121 -0
- robosystems_client/models/org_role.py +10 -0
- robosystems_client/models/org_type.py +10 -0
- robosystems_client/models/org_usage_response.py +146 -0
- robosystems_client/models/org_usage_response_daily_trend_item.py +44 -0
- robosystems_client/models/org_usage_response_graph_details_item.py +44 -0
- robosystems_client/models/org_usage_summary.py +158 -0
- robosystems_client/models/payment_method.py +158 -0
- robosystems_client/models/repository_subscriptions.py +15 -4
- robosystems_client/models/service_offerings_response.py +15 -0
- robosystems_client/models/upcoming_invoice.py +128 -0
- robosystems_client/models/update_member_role_request.py +62 -0
- robosystems_client/models/update_org_request.py +103 -0
- robosystems_client/models/update_payment_method_request.py +60 -0
- robosystems_client/models/update_payment_method_response.py +74 -0
- {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.12.dist-info}/METADATA +1 -1
- {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.12.dist-info}/RECORD +71 -17
- robosystems_client/models/user_limits_response.py +0 -95
- robosystems_client/models/user_usage_response.py +0 -90
- {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.12.dist-info}/WHEEL +0 -0
- {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.12.dist-info}/licenses/LICENSE +0 -0
|
@@ -11,42 +11,45 @@ T = TypeVar("T", bound="GraphSubscriptionTier")
|
|
|
11
11
|
|
|
12
12
|
@_attrs_define
|
|
13
13
|
class GraphSubscriptionTier:
|
|
14
|
-
"""Information about a graph
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
14
|
+
"""Information about a graph infrastructure tier.
|
|
15
|
+
|
|
16
|
+
Each tier represents a per-graph subscription option with specific
|
|
17
|
+
infrastructure, performance, and pricing characteristics.
|
|
18
|
+
|
|
19
|
+
Attributes:
|
|
20
|
+
name (str): Infrastructure tier identifier (e.g., kuzu-standard)
|
|
21
|
+
display_name (str): Display name for UI
|
|
22
|
+
description (str): Tier description
|
|
23
|
+
monthly_price_per_graph (float): Monthly price in USD per graph
|
|
24
|
+
monthly_credits_per_graph (int): Monthly AI credits per graph
|
|
25
|
+
storage_included_gb (int): Storage included in GB
|
|
26
|
+
storage_overage_per_gb (float): Overage cost per GB per month
|
|
27
|
+
infrastructure (str): Infrastructure description
|
|
28
|
+
features (list[str]): List of features
|
|
29
|
+
backup_retention_days (int): Backup retention in days
|
|
30
|
+
priority_support (bool): Whether priority support is included
|
|
31
|
+
api_rate_multiplier (float): API rate multiplier
|
|
32
|
+
backend (str): Database backend (kuzu or neo4j)
|
|
33
|
+
max_queries_per_hour (Union[None, Unset, int]): Maximum queries per hour
|
|
34
|
+
max_subgraphs (Union[Unset, int]): Maximum subgraphs supported Default: 0.
|
|
35
|
+
instance_type (Union[None, Unset, str]): Instance type
|
|
33
36
|
"""
|
|
34
37
|
|
|
35
38
|
name: str
|
|
36
39
|
display_name: str
|
|
37
40
|
description: str
|
|
38
|
-
|
|
39
|
-
|
|
41
|
+
monthly_price_per_graph: float
|
|
42
|
+
monthly_credits_per_graph: int
|
|
40
43
|
storage_included_gb: int
|
|
41
44
|
storage_overage_per_gb: float
|
|
42
|
-
|
|
45
|
+
infrastructure: str
|
|
43
46
|
features: list[str]
|
|
44
47
|
backup_retention_days: int
|
|
45
48
|
priority_support: bool
|
|
46
49
|
api_rate_multiplier: float
|
|
47
50
|
backend: str
|
|
48
51
|
max_queries_per_hour: Union[None, Unset, int] = UNSET
|
|
49
|
-
max_subgraphs: Union[
|
|
52
|
+
max_subgraphs: Union[Unset, int] = 0
|
|
50
53
|
instance_type: Union[None, Unset, str] = UNSET
|
|
51
54
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
52
55
|
|
|
@@ -57,15 +60,15 @@ class GraphSubscriptionTier:
|
|
|
57
60
|
|
|
58
61
|
description = self.description
|
|
59
62
|
|
|
60
|
-
|
|
63
|
+
monthly_price_per_graph = self.monthly_price_per_graph
|
|
61
64
|
|
|
62
|
-
|
|
65
|
+
monthly_credits_per_graph = self.monthly_credits_per_graph
|
|
63
66
|
|
|
64
67
|
storage_included_gb = self.storage_included_gb
|
|
65
68
|
|
|
66
69
|
storage_overage_per_gb = self.storage_overage_per_gb
|
|
67
70
|
|
|
68
|
-
|
|
71
|
+
infrastructure = self.infrastructure
|
|
69
72
|
|
|
70
73
|
features = self.features
|
|
71
74
|
|
|
@@ -83,11 +86,7 @@ class GraphSubscriptionTier:
|
|
|
83
86
|
else:
|
|
84
87
|
max_queries_per_hour = self.max_queries_per_hour
|
|
85
88
|
|
|
86
|
-
max_subgraphs
|
|
87
|
-
if isinstance(self.max_subgraphs, Unset):
|
|
88
|
-
max_subgraphs = UNSET
|
|
89
|
-
else:
|
|
90
|
-
max_subgraphs = self.max_subgraphs
|
|
89
|
+
max_subgraphs = self.max_subgraphs
|
|
91
90
|
|
|
92
91
|
instance_type: Union[None, Unset, str]
|
|
93
92
|
if isinstance(self.instance_type, Unset):
|
|
@@ -102,11 +101,11 @@ class GraphSubscriptionTier:
|
|
|
102
101
|
"name": name,
|
|
103
102
|
"display_name": display_name,
|
|
104
103
|
"description": description,
|
|
105
|
-
"
|
|
106
|
-
"
|
|
104
|
+
"monthly_price_per_graph": monthly_price_per_graph,
|
|
105
|
+
"monthly_credits_per_graph": monthly_credits_per_graph,
|
|
107
106
|
"storage_included_gb": storage_included_gb,
|
|
108
107
|
"storage_overage_per_gb": storage_overage_per_gb,
|
|
109
|
-
"
|
|
108
|
+
"infrastructure": infrastructure,
|
|
110
109
|
"features": features,
|
|
111
110
|
"backup_retention_days": backup_retention_days,
|
|
112
111
|
"priority_support": priority_support,
|
|
@@ -132,15 +131,15 @@ class GraphSubscriptionTier:
|
|
|
132
131
|
|
|
133
132
|
description = d.pop("description")
|
|
134
133
|
|
|
135
|
-
|
|
134
|
+
monthly_price_per_graph = d.pop("monthly_price_per_graph")
|
|
136
135
|
|
|
137
|
-
|
|
136
|
+
monthly_credits_per_graph = d.pop("monthly_credits_per_graph")
|
|
138
137
|
|
|
139
138
|
storage_included_gb = d.pop("storage_included_gb")
|
|
140
139
|
|
|
141
140
|
storage_overage_per_gb = d.pop("storage_overage_per_gb")
|
|
142
141
|
|
|
143
|
-
|
|
142
|
+
infrastructure = d.pop("infrastructure")
|
|
144
143
|
|
|
145
144
|
features = cast(list[str], d.pop("features"))
|
|
146
145
|
|
|
@@ -163,14 +162,7 @@ class GraphSubscriptionTier:
|
|
|
163
162
|
d.pop("max_queries_per_hour", UNSET)
|
|
164
163
|
)
|
|
165
164
|
|
|
166
|
-
|
|
167
|
-
if data is None:
|
|
168
|
-
return data
|
|
169
|
-
if isinstance(data, Unset):
|
|
170
|
-
return data
|
|
171
|
-
return cast(Union[None, Unset, int], data)
|
|
172
|
-
|
|
173
|
-
max_subgraphs = _parse_max_subgraphs(d.pop("max_subgraphs", UNSET))
|
|
165
|
+
max_subgraphs = d.pop("max_subgraphs", UNSET)
|
|
174
166
|
|
|
175
167
|
def _parse_instance_type(data: object) -> Union[None, Unset, str]:
|
|
176
168
|
if data is None:
|
|
@@ -185,11 +177,11 @@ class GraphSubscriptionTier:
|
|
|
185
177
|
name=name,
|
|
186
178
|
display_name=display_name,
|
|
187
179
|
description=description,
|
|
188
|
-
|
|
189
|
-
|
|
180
|
+
monthly_price_per_graph=monthly_price_per_graph,
|
|
181
|
+
monthly_credits_per_graph=monthly_credits_per_graph,
|
|
190
182
|
storage_included_gb=storage_included_gb,
|
|
191
183
|
storage_overage_per_gb=storage_overage_per_gb,
|
|
192
|
-
|
|
184
|
+
infrastructure=infrastructure,
|
|
193
185
|
features=features,
|
|
194
186
|
backup_retention_days=backup_retention_days,
|
|
195
187
|
priority_support=priority_support,
|
|
@@ -16,14 +16,20 @@ T = TypeVar("T", bound="GraphSubscriptions")
|
|
|
16
16
|
class GraphSubscriptions:
|
|
17
17
|
"""Graph subscription offerings.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
Graph subscriptions are per-graph, not per-organization. Each graph
|
|
20
|
+
created by an organization has its own subscription with its own
|
|
21
|
+
infrastructure tier, pricing, and credit allocation.
|
|
22
|
+
|
|
23
|
+
Attributes:
|
|
24
|
+
description (str): Description of graph subscriptions
|
|
25
|
+
pricing_model (str): Pricing model type (per_graph or per_organization)
|
|
26
|
+
tiers (list['GraphSubscriptionTier']): Available infrastructure tiers
|
|
27
|
+
storage (StorageInfo): Storage pricing information.
|
|
28
|
+
notes (list[str]): Important notes
|
|
24
29
|
"""
|
|
25
30
|
|
|
26
31
|
description: str
|
|
32
|
+
pricing_model: str
|
|
27
33
|
tiers: list["GraphSubscriptionTier"]
|
|
28
34
|
storage: "StorageInfo"
|
|
29
35
|
notes: list[str]
|
|
@@ -32,6 +38,8 @@ class GraphSubscriptions:
|
|
|
32
38
|
def to_dict(self) -> dict[str, Any]:
|
|
33
39
|
description = self.description
|
|
34
40
|
|
|
41
|
+
pricing_model = self.pricing_model
|
|
42
|
+
|
|
35
43
|
tiers = []
|
|
36
44
|
for tiers_item_data in self.tiers:
|
|
37
45
|
tiers_item = tiers_item_data.to_dict()
|
|
@@ -46,6 +54,7 @@ class GraphSubscriptions:
|
|
|
46
54
|
field_dict.update(
|
|
47
55
|
{
|
|
48
56
|
"description": description,
|
|
57
|
+
"pricing_model": pricing_model,
|
|
49
58
|
"tiers": tiers,
|
|
50
59
|
"storage": storage,
|
|
51
60
|
"notes": notes,
|
|
@@ -62,6 +71,8 @@ class GraphSubscriptions:
|
|
|
62
71
|
d = dict(src_dict)
|
|
63
72
|
description = d.pop("description")
|
|
64
73
|
|
|
74
|
+
pricing_model = d.pop("pricing_model")
|
|
75
|
+
|
|
65
76
|
tiers = []
|
|
66
77
|
_tiers = d.pop("tiers")
|
|
67
78
|
for tiers_item_data in _tiers:
|
|
@@ -75,6 +86,7 @@ class GraphSubscriptions:
|
|
|
75
86
|
|
|
76
87
|
graph_subscriptions = cls(
|
|
77
88
|
description=description,
|
|
89
|
+
pricing_model=pricing_model,
|
|
78
90
|
tiers=tiers,
|
|
79
91
|
storage=storage,
|
|
80
92
|
notes=notes,
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Union, cast
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..models.org_role import OrgRole
|
|
8
|
+
from ..types import UNSET, Unset
|
|
9
|
+
|
|
10
|
+
T = TypeVar("T", bound="InviteMemberRequest")
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
@_attrs_define
|
|
14
|
+
class InviteMemberRequest:
|
|
15
|
+
"""Request to invite a member to an organization.
|
|
16
|
+
|
|
17
|
+
Attributes:
|
|
18
|
+
email (str):
|
|
19
|
+
role (Union[None, OrgRole, Unset]): Default: OrgRole.MEMBER.
|
|
20
|
+
"""
|
|
21
|
+
|
|
22
|
+
email: str
|
|
23
|
+
role: Union[None, OrgRole, Unset] = OrgRole.MEMBER
|
|
24
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
25
|
+
|
|
26
|
+
def to_dict(self) -> dict[str, Any]:
|
|
27
|
+
email = self.email
|
|
28
|
+
|
|
29
|
+
role: Union[None, Unset, str]
|
|
30
|
+
if isinstance(self.role, Unset):
|
|
31
|
+
role = UNSET
|
|
32
|
+
elif isinstance(self.role, OrgRole):
|
|
33
|
+
role = self.role.value
|
|
34
|
+
else:
|
|
35
|
+
role = self.role
|
|
36
|
+
|
|
37
|
+
field_dict: dict[str, Any] = {}
|
|
38
|
+
field_dict.update(self.additional_properties)
|
|
39
|
+
field_dict.update(
|
|
40
|
+
{
|
|
41
|
+
"email": email,
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
if role is not UNSET:
|
|
45
|
+
field_dict["role"] = role
|
|
46
|
+
|
|
47
|
+
return field_dict
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
51
|
+
d = dict(src_dict)
|
|
52
|
+
email = d.pop("email")
|
|
53
|
+
|
|
54
|
+
def _parse_role(data: object) -> Union[None, OrgRole, Unset]:
|
|
55
|
+
if data is None:
|
|
56
|
+
return data
|
|
57
|
+
if isinstance(data, Unset):
|
|
58
|
+
return data
|
|
59
|
+
try:
|
|
60
|
+
if not isinstance(data, str):
|
|
61
|
+
raise TypeError()
|
|
62
|
+
role_type_0 = OrgRole(data)
|
|
63
|
+
|
|
64
|
+
return role_type_0
|
|
65
|
+
except: # noqa: E722
|
|
66
|
+
pass
|
|
67
|
+
return cast(Union[None, OrgRole, Unset], data)
|
|
68
|
+
|
|
69
|
+
role = _parse_role(d.pop("role", UNSET))
|
|
70
|
+
|
|
71
|
+
invite_member_request = cls(
|
|
72
|
+
email=email,
|
|
73
|
+
role=role,
|
|
74
|
+
)
|
|
75
|
+
|
|
76
|
+
invite_member_request.additional_properties = d
|
|
77
|
+
return invite_member_request
|
|
78
|
+
|
|
79
|
+
@property
|
|
80
|
+
def additional_keys(self) -> list[str]:
|
|
81
|
+
return list(self.additional_properties.keys())
|
|
82
|
+
|
|
83
|
+
def __getitem__(self, key: str) -> Any:
|
|
84
|
+
return self.additional_properties[key]
|
|
85
|
+
|
|
86
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
87
|
+
self.additional_properties[key] = value
|
|
88
|
+
|
|
89
|
+
def __delitem__(self, key: str) -> None:
|
|
90
|
+
del self.additional_properties[key]
|
|
91
|
+
|
|
92
|
+
def __contains__(self, key: str) -> bool:
|
|
93
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..types import UNSET, Unset
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
from ..models.invoice_line_item import InvoiceLineItem
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
T = TypeVar("T", bound="Invoice")
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@_attrs_define
|
|
17
|
+
class Invoice:
|
|
18
|
+
"""Invoice information.
|
|
19
|
+
|
|
20
|
+
Attributes:
|
|
21
|
+
id (str): Invoice ID
|
|
22
|
+
status (str): Invoice status (paid, open, void, uncollectible)
|
|
23
|
+
amount_due (int): Amount due in cents
|
|
24
|
+
amount_paid (int): Amount paid in cents
|
|
25
|
+
currency (str): Currency code (usd)
|
|
26
|
+
created (str): Invoice creation date (ISO format)
|
|
27
|
+
line_items (list['InvoiceLineItem']): Invoice line items
|
|
28
|
+
number (Union[None, Unset, str]): Invoice number
|
|
29
|
+
due_date (Union[None, Unset, str]): Invoice due date (ISO format)
|
|
30
|
+
paid_at (Union[None, Unset, str]): Payment date (ISO format)
|
|
31
|
+
invoice_pdf (Union[None, Unset, str]): PDF download URL
|
|
32
|
+
hosted_invoice_url (Union[None, Unset, str]): Hosted invoice URL
|
|
33
|
+
subscription_id (Union[None, Unset, str]): Associated subscription ID
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
id: str
|
|
37
|
+
status: str
|
|
38
|
+
amount_due: int
|
|
39
|
+
amount_paid: int
|
|
40
|
+
currency: str
|
|
41
|
+
created: str
|
|
42
|
+
line_items: list["InvoiceLineItem"]
|
|
43
|
+
number: Union[None, Unset, str] = UNSET
|
|
44
|
+
due_date: Union[None, Unset, str] = UNSET
|
|
45
|
+
paid_at: Union[None, Unset, str] = UNSET
|
|
46
|
+
invoice_pdf: Union[None, Unset, str] = UNSET
|
|
47
|
+
hosted_invoice_url: Union[None, Unset, str] = UNSET
|
|
48
|
+
subscription_id: Union[None, Unset, str] = UNSET
|
|
49
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
50
|
+
|
|
51
|
+
def to_dict(self) -> dict[str, Any]:
|
|
52
|
+
id = self.id
|
|
53
|
+
|
|
54
|
+
status = self.status
|
|
55
|
+
|
|
56
|
+
amount_due = self.amount_due
|
|
57
|
+
|
|
58
|
+
amount_paid = self.amount_paid
|
|
59
|
+
|
|
60
|
+
currency = self.currency
|
|
61
|
+
|
|
62
|
+
created = self.created
|
|
63
|
+
|
|
64
|
+
line_items = []
|
|
65
|
+
for line_items_item_data in self.line_items:
|
|
66
|
+
line_items_item = line_items_item_data.to_dict()
|
|
67
|
+
line_items.append(line_items_item)
|
|
68
|
+
|
|
69
|
+
number: Union[None, Unset, str]
|
|
70
|
+
if isinstance(self.number, Unset):
|
|
71
|
+
number = UNSET
|
|
72
|
+
else:
|
|
73
|
+
number = self.number
|
|
74
|
+
|
|
75
|
+
due_date: Union[None, Unset, str]
|
|
76
|
+
if isinstance(self.due_date, Unset):
|
|
77
|
+
due_date = UNSET
|
|
78
|
+
else:
|
|
79
|
+
due_date = self.due_date
|
|
80
|
+
|
|
81
|
+
paid_at: Union[None, Unset, str]
|
|
82
|
+
if isinstance(self.paid_at, Unset):
|
|
83
|
+
paid_at = UNSET
|
|
84
|
+
else:
|
|
85
|
+
paid_at = self.paid_at
|
|
86
|
+
|
|
87
|
+
invoice_pdf: Union[None, Unset, str]
|
|
88
|
+
if isinstance(self.invoice_pdf, Unset):
|
|
89
|
+
invoice_pdf = UNSET
|
|
90
|
+
else:
|
|
91
|
+
invoice_pdf = self.invoice_pdf
|
|
92
|
+
|
|
93
|
+
hosted_invoice_url: Union[None, Unset, str]
|
|
94
|
+
if isinstance(self.hosted_invoice_url, Unset):
|
|
95
|
+
hosted_invoice_url = UNSET
|
|
96
|
+
else:
|
|
97
|
+
hosted_invoice_url = self.hosted_invoice_url
|
|
98
|
+
|
|
99
|
+
subscription_id: Union[None, Unset, str]
|
|
100
|
+
if isinstance(self.subscription_id, Unset):
|
|
101
|
+
subscription_id = UNSET
|
|
102
|
+
else:
|
|
103
|
+
subscription_id = self.subscription_id
|
|
104
|
+
|
|
105
|
+
field_dict: dict[str, Any] = {}
|
|
106
|
+
field_dict.update(self.additional_properties)
|
|
107
|
+
field_dict.update(
|
|
108
|
+
{
|
|
109
|
+
"id": id,
|
|
110
|
+
"status": status,
|
|
111
|
+
"amount_due": amount_due,
|
|
112
|
+
"amount_paid": amount_paid,
|
|
113
|
+
"currency": currency,
|
|
114
|
+
"created": created,
|
|
115
|
+
"line_items": line_items,
|
|
116
|
+
}
|
|
117
|
+
)
|
|
118
|
+
if number is not UNSET:
|
|
119
|
+
field_dict["number"] = number
|
|
120
|
+
if due_date is not UNSET:
|
|
121
|
+
field_dict["due_date"] = due_date
|
|
122
|
+
if paid_at is not UNSET:
|
|
123
|
+
field_dict["paid_at"] = paid_at
|
|
124
|
+
if invoice_pdf is not UNSET:
|
|
125
|
+
field_dict["invoice_pdf"] = invoice_pdf
|
|
126
|
+
if hosted_invoice_url is not UNSET:
|
|
127
|
+
field_dict["hosted_invoice_url"] = hosted_invoice_url
|
|
128
|
+
if subscription_id is not UNSET:
|
|
129
|
+
field_dict["subscription_id"] = subscription_id
|
|
130
|
+
|
|
131
|
+
return field_dict
|
|
132
|
+
|
|
133
|
+
@classmethod
|
|
134
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
135
|
+
from ..models.invoice_line_item import InvoiceLineItem
|
|
136
|
+
|
|
137
|
+
d = dict(src_dict)
|
|
138
|
+
id = d.pop("id")
|
|
139
|
+
|
|
140
|
+
status = d.pop("status")
|
|
141
|
+
|
|
142
|
+
amount_due = d.pop("amount_due")
|
|
143
|
+
|
|
144
|
+
amount_paid = d.pop("amount_paid")
|
|
145
|
+
|
|
146
|
+
currency = d.pop("currency")
|
|
147
|
+
|
|
148
|
+
created = d.pop("created")
|
|
149
|
+
|
|
150
|
+
line_items = []
|
|
151
|
+
_line_items = d.pop("line_items")
|
|
152
|
+
for line_items_item_data in _line_items:
|
|
153
|
+
line_items_item = InvoiceLineItem.from_dict(line_items_item_data)
|
|
154
|
+
|
|
155
|
+
line_items.append(line_items_item)
|
|
156
|
+
|
|
157
|
+
def _parse_number(data: object) -> Union[None, Unset, str]:
|
|
158
|
+
if data is None:
|
|
159
|
+
return data
|
|
160
|
+
if isinstance(data, Unset):
|
|
161
|
+
return data
|
|
162
|
+
return cast(Union[None, Unset, str], data)
|
|
163
|
+
|
|
164
|
+
number = _parse_number(d.pop("number", UNSET))
|
|
165
|
+
|
|
166
|
+
def _parse_due_date(data: object) -> Union[None, Unset, str]:
|
|
167
|
+
if data is None:
|
|
168
|
+
return data
|
|
169
|
+
if isinstance(data, Unset):
|
|
170
|
+
return data
|
|
171
|
+
return cast(Union[None, Unset, str], data)
|
|
172
|
+
|
|
173
|
+
due_date = _parse_due_date(d.pop("due_date", UNSET))
|
|
174
|
+
|
|
175
|
+
def _parse_paid_at(data: object) -> Union[None, Unset, str]:
|
|
176
|
+
if data is None:
|
|
177
|
+
return data
|
|
178
|
+
if isinstance(data, Unset):
|
|
179
|
+
return data
|
|
180
|
+
return cast(Union[None, Unset, str], data)
|
|
181
|
+
|
|
182
|
+
paid_at = _parse_paid_at(d.pop("paid_at", UNSET))
|
|
183
|
+
|
|
184
|
+
def _parse_invoice_pdf(data: object) -> Union[None, Unset, str]:
|
|
185
|
+
if data is None:
|
|
186
|
+
return data
|
|
187
|
+
if isinstance(data, Unset):
|
|
188
|
+
return data
|
|
189
|
+
return cast(Union[None, Unset, str], data)
|
|
190
|
+
|
|
191
|
+
invoice_pdf = _parse_invoice_pdf(d.pop("invoice_pdf", UNSET))
|
|
192
|
+
|
|
193
|
+
def _parse_hosted_invoice_url(data: object) -> Union[None, Unset, str]:
|
|
194
|
+
if data is None:
|
|
195
|
+
return data
|
|
196
|
+
if isinstance(data, Unset):
|
|
197
|
+
return data
|
|
198
|
+
return cast(Union[None, Unset, str], data)
|
|
199
|
+
|
|
200
|
+
hosted_invoice_url = _parse_hosted_invoice_url(d.pop("hosted_invoice_url", UNSET))
|
|
201
|
+
|
|
202
|
+
def _parse_subscription_id(data: object) -> Union[None, Unset, str]:
|
|
203
|
+
if data is None:
|
|
204
|
+
return data
|
|
205
|
+
if isinstance(data, Unset):
|
|
206
|
+
return data
|
|
207
|
+
return cast(Union[None, Unset, str], data)
|
|
208
|
+
|
|
209
|
+
subscription_id = _parse_subscription_id(d.pop("subscription_id", UNSET))
|
|
210
|
+
|
|
211
|
+
invoice = cls(
|
|
212
|
+
id=id,
|
|
213
|
+
status=status,
|
|
214
|
+
amount_due=amount_due,
|
|
215
|
+
amount_paid=amount_paid,
|
|
216
|
+
currency=currency,
|
|
217
|
+
created=created,
|
|
218
|
+
line_items=line_items,
|
|
219
|
+
number=number,
|
|
220
|
+
due_date=due_date,
|
|
221
|
+
paid_at=paid_at,
|
|
222
|
+
invoice_pdf=invoice_pdf,
|
|
223
|
+
hosted_invoice_url=hosted_invoice_url,
|
|
224
|
+
subscription_id=subscription_id,
|
|
225
|
+
)
|
|
226
|
+
|
|
227
|
+
invoice.additional_properties = d
|
|
228
|
+
return invoice
|
|
229
|
+
|
|
230
|
+
@property
|
|
231
|
+
def additional_keys(self) -> list[str]:
|
|
232
|
+
return list(self.additional_properties.keys())
|
|
233
|
+
|
|
234
|
+
def __getitem__(self, key: str) -> Any:
|
|
235
|
+
return self.additional_properties[key]
|
|
236
|
+
|
|
237
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
238
|
+
self.additional_properties[key] = value
|
|
239
|
+
|
|
240
|
+
def __delitem__(self, key: str) -> None:
|
|
241
|
+
del self.additional_properties[key]
|
|
242
|
+
|
|
243
|
+
def __contains__(self, key: str) -> bool:
|
|
244
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
from typing import Any, TypeVar, Union, cast
|
|
3
|
+
|
|
4
|
+
from attrs import define as _attrs_define
|
|
5
|
+
from attrs import field as _attrs_field
|
|
6
|
+
|
|
7
|
+
from ..types import UNSET, Unset
|
|
8
|
+
|
|
9
|
+
T = TypeVar("T", bound="InvoiceLineItem")
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
@_attrs_define
|
|
13
|
+
class InvoiceLineItem:
|
|
14
|
+
"""Invoice line item.
|
|
15
|
+
|
|
16
|
+
Attributes:
|
|
17
|
+
description (str): Line item description
|
|
18
|
+
amount (int): Amount in cents
|
|
19
|
+
quantity (int): Quantity
|
|
20
|
+
period_start (Union[None, Unset, str]): Billing period start
|
|
21
|
+
period_end (Union[None, Unset, str]): Billing period end
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
description: str
|
|
25
|
+
amount: int
|
|
26
|
+
quantity: int
|
|
27
|
+
period_start: Union[None, Unset, str] = UNSET
|
|
28
|
+
period_end: Union[None, Unset, str] = UNSET
|
|
29
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
30
|
+
|
|
31
|
+
def to_dict(self) -> dict[str, Any]:
|
|
32
|
+
description = self.description
|
|
33
|
+
|
|
34
|
+
amount = self.amount
|
|
35
|
+
|
|
36
|
+
quantity = self.quantity
|
|
37
|
+
|
|
38
|
+
period_start: Union[None, Unset, str]
|
|
39
|
+
if isinstance(self.period_start, Unset):
|
|
40
|
+
period_start = UNSET
|
|
41
|
+
else:
|
|
42
|
+
period_start = self.period_start
|
|
43
|
+
|
|
44
|
+
period_end: Union[None, Unset, str]
|
|
45
|
+
if isinstance(self.period_end, Unset):
|
|
46
|
+
period_end = UNSET
|
|
47
|
+
else:
|
|
48
|
+
period_end = self.period_end
|
|
49
|
+
|
|
50
|
+
field_dict: dict[str, Any] = {}
|
|
51
|
+
field_dict.update(self.additional_properties)
|
|
52
|
+
field_dict.update(
|
|
53
|
+
{
|
|
54
|
+
"description": description,
|
|
55
|
+
"amount": amount,
|
|
56
|
+
"quantity": quantity,
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
if period_start is not UNSET:
|
|
60
|
+
field_dict["period_start"] = period_start
|
|
61
|
+
if period_end is not UNSET:
|
|
62
|
+
field_dict["period_end"] = period_end
|
|
63
|
+
|
|
64
|
+
return field_dict
|
|
65
|
+
|
|
66
|
+
@classmethod
|
|
67
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
68
|
+
d = dict(src_dict)
|
|
69
|
+
description = d.pop("description")
|
|
70
|
+
|
|
71
|
+
amount = d.pop("amount")
|
|
72
|
+
|
|
73
|
+
quantity = d.pop("quantity")
|
|
74
|
+
|
|
75
|
+
def _parse_period_start(data: object) -> Union[None, Unset, str]:
|
|
76
|
+
if data is None:
|
|
77
|
+
return data
|
|
78
|
+
if isinstance(data, Unset):
|
|
79
|
+
return data
|
|
80
|
+
return cast(Union[None, Unset, str], data)
|
|
81
|
+
|
|
82
|
+
period_start = _parse_period_start(d.pop("period_start", UNSET))
|
|
83
|
+
|
|
84
|
+
def _parse_period_end(data: object) -> Union[None, Unset, str]:
|
|
85
|
+
if data is None:
|
|
86
|
+
return data
|
|
87
|
+
if isinstance(data, Unset):
|
|
88
|
+
return data
|
|
89
|
+
return cast(Union[None, Unset, str], data)
|
|
90
|
+
|
|
91
|
+
period_end = _parse_period_end(d.pop("period_end", UNSET))
|
|
92
|
+
|
|
93
|
+
invoice_line_item = cls(
|
|
94
|
+
description=description,
|
|
95
|
+
amount=amount,
|
|
96
|
+
quantity=quantity,
|
|
97
|
+
period_start=period_start,
|
|
98
|
+
period_end=period_end,
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
invoice_line_item.additional_properties = d
|
|
102
|
+
return invoice_line_item
|
|
103
|
+
|
|
104
|
+
@property
|
|
105
|
+
def additional_keys(self) -> list[str]:
|
|
106
|
+
return list(self.additional_properties.keys())
|
|
107
|
+
|
|
108
|
+
def __getitem__(self, key: str) -> Any:
|
|
109
|
+
return self.additional_properties[key]
|
|
110
|
+
|
|
111
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
112
|
+
self.additional_properties[key] = value
|
|
113
|
+
|
|
114
|
+
def __delitem__(self, key: str) -> None:
|
|
115
|
+
del self.additional_properties[key]
|
|
116
|
+
|
|
117
|
+
def __contains__(self, key: str) -> bool:
|
|
118
|
+
return key in self.additional_properties
|