robosystems-client 0.2.9__py3-none-any.whl → 0.2.11__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.
- robosystems_client/api/{user_subscriptions/upgrade_shared_repository_subscription.py → billing/cancel_subscription.py} +32 -60
- robosystems_client/api/billing/create_checkout_session.py +230 -0
- robosystems_client/api/{user_analytics/get_user_usage_overview.py → billing/get_billing_customer.py} +29 -21
- robosystems_client/api/billing/get_checkout_status.py +221 -0
- robosystems_client/api/{user_subscriptions/get_repository_credits.py → billing/get_subscription.py} +35 -43
- robosystems_client/api/{user_subscriptions/get_shared_repository_credits.py → billing/get_upcoming_invoice.py} +42 -28
- robosystems_client/api/{user_subscriptions/get_user_shared_subscriptions.py → billing/list_invoices.py} +44 -44
- robosystems_client/api/{user_limits/get_all_shared_repository_limits.py → billing/list_subscriptions.py} +38 -27
- robosystems_client/api/{user_subscriptions/subscribe_to_shared_repository.py → billing/update_payment_method.py} +42 -46
- robosystems_client/api/{user_subscriptions/cancel_shared_repository_subscription.py → subscriptions/cancel_subscription.py} +41 -25
- robosystems_client/api/subscriptions/create_repository_subscription.py +217 -0
- robosystems_client/api/subscriptions/get_graph_subscription.py +197 -0
- robosystems_client/api/subscriptions/upgrade_subscription.py +203 -0
- robosystems_client/api/usage/get_graph_usage_analytics.py +377 -0
- robosystems_client/api/{user_limits/get_user_usage.py → user/get_user_limits.py} +13 -9
- robosystems_client/models/__init__.py +42 -82
- robosystems_client/models/billing_customer.py +128 -0
- robosystems_client/models/checkout_response.py +87 -0
- robosystems_client/models/checkout_status_response.py +130 -0
- robosystems_client/models/create_checkout_request.py +88 -0
- robosystems_client/models/{graph_usage_response_query_statistics.py → create_checkout_request_resource_config.py} +6 -6
- robosystems_client/models/{credits_summary_response_credits_by_addon_type_0_item.py → create_repository_subscription_request.py} +22 -6
- robosystems_client/models/credit_summary.py +55 -89
- robosystems_client/models/{graph_usage_response_storage_usage.py → credit_summary_operation_breakdown.py} +6 -6
- robosystems_client/models/graph_subscription_response.py +200 -0
- robosystems_client/models/graph_usage_response.py +136 -39
- robosystems_client/models/{user_analytics_response_limits.py → graph_usage_response_recent_events_item.py} +6 -6
- 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/payment_method.py +158 -0
- robosystems_client/models/performance_insights.py +120 -0
- robosystems_client/models/{graph_usage_response_recent_activity.py → performance_insights_operation_stats.py} +6 -6
- robosystems_client/models/{user_analytics_response_api_usage.py → performance_insights_slow_queries_item.py} +6 -6
- robosystems_client/models/storage_summary.py +100 -0
- robosystems_client/models/upcoming_invoice.py +128 -0
- robosystems_client/models/{get_graph_usage_details_response_getgraphusagedetails.py → update_payment_method_request.py} +22 -6
- robosystems_client/models/{subscription_response.py → update_payment_method_response.py} +14 -14
- robosystems_client/models/{tier_upgrade_request.py → upgrade_subscription_request.py} +12 -14
- {robosystems_client-0.2.9.dist-info → robosystems_client-0.2.11.dist-info}/METADATA +1 -1
- {robosystems_client-0.2.9.dist-info → robosystems_client-0.2.11.dist-info}/RECORD +53 -68
- robosystems_client/api/graph_analytics/get_graph_usage_stats.py +0 -289
- robosystems_client/api/graph_billing/get_current_graph_bill.py +0 -253
- robosystems_client/api/graph_billing/get_graph_billing_history.py +0 -298
- robosystems_client/api/graph_billing/get_graph_monthly_bill.py +0 -284
- robosystems_client/api/graph_billing/get_graph_usage_details.py +0 -320
- robosystems_client/api/user/get_all_credit_summaries.py +0 -169
- robosystems_client/api/user_analytics/get_detailed_user_analytics.py +0 -188
- robosystems_client/api/user_limits/__init__.py +0 -1
- robosystems_client/api/user_limits/get_shared_repository_limits.py +0 -213
- robosystems_client/api/user_limits/get_user_limits.py +0 -139
- robosystems_client/api/user_subscriptions/__init__.py +0 -1
- robosystems_client/models/add_on_credit_info.py +0 -119
- robosystems_client/models/credits_summary_response.py +0 -148
- robosystems_client/models/get_all_credit_summaries_response_getallcreditsummaries.py +0 -44
- robosystems_client/models/get_all_shared_repository_limits_response_getallsharedrepositorylimits.py +0 -46
- robosystems_client/models/get_current_graph_bill_response_getcurrentgraphbill.py +0 -44
- robosystems_client/models/get_graph_billing_history_response_getgraphbillinghistory.py +0 -44
- robosystems_client/models/get_graph_monthly_bill_response_getgraphmonthlybill.py +0 -44
- robosystems_client/models/get_shared_repository_limits_response_getsharedrepositorylimits.py +0 -44
- robosystems_client/models/repository_credits_response.py +0 -128
- robosystems_client/models/repository_plan.py +0 -10
- robosystems_client/models/repository_type.py +0 -10
- robosystems_client/models/subscription_info.py +0 -152
- robosystems_client/models/subscription_info_metadata.py +0 -44
- robosystems_client/models/subscription_request.py +0 -80
- robosystems_client/models/user_analytics_response.py +0 -132
- robosystems_client/models/user_analytics_response_graph_usage.py +0 -44
- robosystems_client/models/user_analytics_response_recent_activity_item.py +0 -44
- robosystems_client/models/user_analytics_response_user_info.py +0 -44
- robosystems_client/models/user_graph_summary.py +0 -134
- robosystems_client/models/user_subscriptions_response.py +0 -90
- robosystems_client/models/user_usage_summary_response.py +0 -130
- robosystems_client/models/user_usage_summary_response_usage_vs_limits.py +0 -44
- /robosystems_client/api/{graph_analytics → billing}/__init__.py +0 -0
- /robosystems_client/api/{graph_billing → credits_}/__init__.py +0 -0
- /robosystems_client/api/{graph_credits → credits_}/check_credit_balance.py +0 -0
- /robosystems_client/api/{graph_credits → credits_}/check_storage_limits.py +0 -0
- /robosystems_client/api/{graph_credits → credits_}/get_credit_summary.py +0 -0
- /robosystems_client/api/{graph_credits → credits_}/get_storage_usage.py +0 -0
- /robosystems_client/api/{graph_credits → credits_}/list_credit_transactions.py +0 -0
- /robosystems_client/api/{graph_credits → subscriptions}/__init__.py +0 -0
- /robosystems_client/api/{user_analytics → usage}/__init__.py +0 -0
- /robosystems_client/api/{graph_analytics → usage}/get_graph_metrics.py +0 -0
- {robosystems_client-0.2.9.dist-info → robosystems_client-0.2.11.dist-info}/WHEEL +0 -0
- {robosystems_client-0.2.9.dist-info → robosystems_client-0.2.11.dist-info}/licenses/LICENSE +0 -0
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
from collections.abc import Mapping
|
|
2
|
-
from typing import TYPE_CHECKING, Any, TypeVar
|
|
2
|
+
from typing import TYPE_CHECKING, Any, TypeVar, Union, cast
|
|
3
3
|
|
|
4
4
|
from attrs import define as _attrs_define
|
|
5
5
|
from attrs import field as _attrs_field
|
|
6
6
|
|
|
7
|
+
from ..types import UNSET, Unset
|
|
8
|
+
|
|
7
9
|
if TYPE_CHECKING:
|
|
8
|
-
from ..models.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
from ..models.graph_usage_response_recent_activity import (
|
|
12
|
-
GraphUsageResponseRecentActivity,
|
|
10
|
+
from ..models.credit_summary import CreditSummary
|
|
11
|
+
from ..models.graph_usage_response_recent_events_item import (
|
|
12
|
+
GraphUsageResponseRecentEventsItem,
|
|
13
13
|
)
|
|
14
|
-
from ..models.
|
|
14
|
+
from ..models.performance_insights import PerformanceInsights
|
|
15
|
+
from ..models.storage_summary import StorageSummary
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
T = TypeVar("T", bound="GraphUsageResponse")
|
|
@@ -23,77 +24,173 @@ class GraphUsageResponse:
|
|
|
23
24
|
|
|
24
25
|
Attributes:
|
|
25
26
|
graph_id (str): Graph database identifier
|
|
26
|
-
|
|
27
|
-
query_statistics (GraphUsageResponseQueryStatistics): Query statistics
|
|
28
|
-
recent_activity (GraphUsageResponseRecentActivity): Recent activity summary
|
|
27
|
+
time_range (str): Time range for usage data
|
|
29
28
|
timestamp (str): Usage collection timestamp
|
|
29
|
+
storage_summary (Union['StorageSummary', None, Unset]): Storage usage summary
|
|
30
|
+
credit_summary (Union['CreditSummary', None, Unset]): Credit consumption summary
|
|
31
|
+
performance_insights (Union['PerformanceInsights', None, Unset]): Performance analytics
|
|
32
|
+
recent_events (Union[Unset, list['GraphUsageResponseRecentEventsItem']]): Recent usage events
|
|
30
33
|
"""
|
|
31
34
|
|
|
32
35
|
graph_id: str
|
|
33
|
-
|
|
34
|
-
query_statistics: "GraphUsageResponseQueryStatistics"
|
|
35
|
-
recent_activity: "GraphUsageResponseRecentActivity"
|
|
36
|
+
time_range: str
|
|
36
37
|
timestamp: str
|
|
38
|
+
storage_summary: Union["StorageSummary", None, Unset] = UNSET
|
|
39
|
+
credit_summary: Union["CreditSummary", None, Unset] = UNSET
|
|
40
|
+
performance_insights: Union["PerformanceInsights", None, Unset] = UNSET
|
|
41
|
+
recent_events: Union[Unset, list["GraphUsageResponseRecentEventsItem"]] = UNSET
|
|
37
42
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
38
43
|
|
|
39
44
|
def to_dict(self) -> dict[str, Any]:
|
|
40
|
-
|
|
45
|
+
from ..models.credit_summary import CreditSummary
|
|
46
|
+
from ..models.performance_insights import PerformanceInsights
|
|
47
|
+
from ..models.storage_summary import StorageSummary
|
|
41
48
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
query_statistics = self.query_statistics.to_dict()
|
|
49
|
+
graph_id = self.graph_id
|
|
45
50
|
|
|
46
|
-
|
|
51
|
+
time_range = self.time_range
|
|
47
52
|
|
|
48
53
|
timestamp = self.timestamp
|
|
49
54
|
|
|
55
|
+
storage_summary: Union[None, Unset, dict[str, Any]]
|
|
56
|
+
if isinstance(self.storage_summary, Unset):
|
|
57
|
+
storage_summary = UNSET
|
|
58
|
+
elif isinstance(self.storage_summary, StorageSummary):
|
|
59
|
+
storage_summary = self.storage_summary.to_dict()
|
|
60
|
+
else:
|
|
61
|
+
storage_summary = self.storage_summary
|
|
62
|
+
|
|
63
|
+
credit_summary: Union[None, Unset, dict[str, Any]]
|
|
64
|
+
if isinstance(self.credit_summary, Unset):
|
|
65
|
+
credit_summary = UNSET
|
|
66
|
+
elif isinstance(self.credit_summary, CreditSummary):
|
|
67
|
+
credit_summary = self.credit_summary.to_dict()
|
|
68
|
+
else:
|
|
69
|
+
credit_summary = self.credit_summary
|
|
70
|
+
|
|
71
|
+
performance_insights: Union[None, Unset, dict[str, Any]]
|
|
72
|
+
if isinstance(self.performance_insights, Unset):
|
|
73
|
+
performance_insights = UNSET
|
|
74
|
+
elif isinstance(self.performance_insights, PerformanceInsights):
|
|
75
|
+
performance_insights = self.performance_insights.to_dict()
|
|
76
|
+
else:
|
|
77
|
+
performance_insights = self.performance_insights
|
|
78
|
+
|
|
79
|
+
recent_events: Union[Unset, list[dict[str, Any]]] = UNSET
|
|
80
|
+
if not isinstance(self.recent_events, Unset):
|
|
81
|
+
recent_events = []
|
|
82
|
+
for recent_events_item_data in self.recent_events:
|
|
83
|
+
recent_events_item = recent_events_item_data.to_dict()
|
|
84
|
+
recent_events.append(recent_events_item)
|
|
85
|
+
|
|
50
86
|
field_dict: dict[str, Any] = {}
|
|
51
87
|
field_dict.update(self.additional_properties)
|
|
52
88
|
field_dict.update(
|
|
53
89
|
{
|
|
54
90
|
"graph_id": graph_id,
|
|
55
|
-
"
|
|
56
|
-
"query_statistics": query_statistics,
|
|
57
|
-
"recent_activity": recent_activity,
|
|
91
|
+
"time_range": time_range,
|
|
58
92
|
"timestamp": timestamp,
|
|
59
93
|
}
|
|
60
94
|
)
|
|
95
|
+
if storage_summary is not UNSET:
|
|
96
|
+
field_dict["storage_summary"] = storage_summary
|
|
97
|
+
if credit_summary is not UNSET:
|
|
98
|
+
field_dict["credit_summary"] = credit_summary
|
|
99
|
+
if performance_insights is not UNSET:
|
|
100
|
+
field_dict["performance_insights"] = performance_insights
|
|
101
|
+
if recent_events is not UNSET:
|
|
102
|
+
field_dict["recent_events"] = recent_events
|
|
61
103
|
|
|
62
104
|
return field_dict
|
|
63
105
|
|
|
64
106
|
@classmethod
|
|
65
107
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
66
|
-
from ..models.
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
from ..models.graph_usage_response_recent_activity import (
|
|
70
|
-
GraphUsageResponseRecentActivity,
|
|
71
|
-
)
|
|
72
|
-
from ..models.graph_usage_response_storage_usage import (
|
|
73
|
-
GraphUsageResponseStorageUsage,
|
|
108
|
+
from ..models.credit_summary import CreditSummary
|
|
109
|
+
from ..models.graph_usage_response_recent_events_item import (
|
|
110
|
+
GraphUsageResponseRecentEventsItem,
|
|
74
111
|
)
|
|
112
|
+
from ..models.performance_insights import PerformanceInsights
|
|
113
|
+
from ..models.storage_summary import StorageSummary
|
|
75
114
|
|
|
76
115
|
d = dict(src_dict)
|
|
77
116
|
graph_id = d.pop("graph_id")
|
|
78
117
|
|
|
79
|
-
|
|
118
|
+
time_range = d.pop("time_range")
|
|
80
119
|
|
|
81
|
-
|
|
82
|
-
d.pop("query_statistics")
|
|
83
|
-
)
|
|
120
|
+
timestamp = d.pop("timestamp")
|
|
84
121
|
|
|
85
|
-
|
|
86
|
-
|
|
122
|
+
def _parse_storage_summary(data: object) -> Union["StorageSummary", None, Unset]:
|
|
123
|
+
if data is None:
|
|
124
|
+
return data
|
|
125
|
+
if isinstance(data, Unset):
|
|
126
|
+
return data
|
|
127
|
+
try:
|
|
128
|
+
if not isinstance(data, dict):
|
|
129
|
+
raise TypeError()
|
|
130
|
+
storage_summary_type_0 = StorageSummary.from_dict(data)
|
|
131
|
+
|
|
132
|
+
return storage_summary_type_0
|
|
133
|
+
except: # noqa: E722
|
|
134
|
+
pass
|
|
135
|
+
return cast(Union["StorageSummary", None, Unset], data)
|
|
136
|
+
|
|
137
|
+
storage_summary = _parse_storage_summary(d.pop("storage_summary", UNSET))
|
|
138
|
+
|
|
139
|
+
def _parse_credit_summary(data: object) -> Union["CreditSummary", None, Unset]:
|
|
140
|
+
if data is None:
|
|
141
|
+
return data
|
|
142
|
+
if isinstance(data, Unset):
|
|
143
|
+
return data
|
|
144
|
+
try:
|
|
145
|
+
if not isinstance(data, dict):
|
|
146
|
+
raise TypeError()
|
|
147
|
+
credit_summary_type_0 = CreditSummary.from_dict(data)
|
|
148
|
+
|
|
149
|
+
return credit_summary_type_0
|
|
150
|
+
except: # noqa: E722
|
|
151
|
+
pass
|
|
152
|
+
return cast(Union["CreditSummary", None, Unset], data)
|
|
153
|
+
|
|
154
|
+
credit_summary = _parse_credit_summary(d.pop("credit_summary", UNSET))
|
|
155
|
+
|
|
156
|
+
def _parse_performance_insights(
|
|
157
|
+
data: object,
|
|
158
|
+
) -> Union["PerformanceInsights", None, Unset]:
|
|
159
|
+
if data is None:
|
|
160
|
+
return data
|
|
161
|
+
if isinstance(data, Unset):
|
|
162
|
+
return data
|
|
163
|
+
try:
|
|
164
|
+
if not isinstance(data, dict):
|
|
165
|
+
raise TypeError()
|
|
166
|
+
performance_insights_type_0 = PerformanceInsights.from_dict(data)
|
|
167
|
+
|
|
168
|
+
return performance_insights_type_0
|
|
169
|
+
except: # noqa: E722
|
|
170
|
+
pass
|
|
171
|
+
return cast(Union["PerformanceInsights", None, Unset], data)
|
|
172
|
+
|
|
173
|
+
performance_insights = _parse_performance_insights(
|
|
174
|
+
d.pop("performance_insights", UNSET)
|
|
87
175
|
)
|
|
88
176
|
|
|
89
|
-
|
|
177
|
+
recent_events = []
|
|
178
|
+
_recent_events = d.pop("recent_events", UNSET)
|
|
179
|
+
for recent_events_item_data in _recent_events or []:
|
|
180
|
+
recent_events_item = GraphUsageResponseRecentEventsItem.from_dict(
|
|
181
|
+
recent_events_item_data
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
recent_events.append(recent_events_item)
|
|
90
185
|
|
|
91
186
|
graph_usage_response = cls(
|
|
92
187
|
graph_id=graph_id,
|
|
93
|
-
|
|
94
|
-
query_statistics=query_statistics,
|
|
95
|
-
recent_activity=recent_activity,
|
|
188
|
+
time_range=time_range,
|
|
96
189
|
timestamp=timestamp,
|
|
190
|
+
storage_summary=storage_summary,
|
|
191
|
+
credit_summary=credit_summary,
|
|
192
|
+
performance_insights=performance_insights,
|
|
193
|
+
recent_events=recent_events,
|
|
97
194
|
)
|
|
98
195
|
|
|
99
196
|
graph_usage_response.additional_properties = d
|
|
@@ -4,12 +4,12 @@ from typing import Any, TypeVar
|
|
|
4
4
|
from attrs import define as _attrs_define
|
|
5
5
|
from attrs import field as _attrs_field
|
|
6
6
|
|
|
7
|
-
T = TypeVar("T", bound="
|
|
7
|
+
T = TypeVar("T", bound="GraphUsageResponseRecentEventsItem")
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
@_attrs_define
|
|
11
|
-
class
|
|
12
|
-
"""
|
|
11
|
+
class GraphUsageResponseRecentEventsItem:
|
|
12
|
+
""" """
|
|
13
13
|
|
|
14
14
|
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
15
15
|
|
|
@@ -22,10 +22,10 @@ class UserAnalyticsResponseLimits:
|
|
|
22
22
|
@classmethod
|
|
23
23
|
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
24
24
|
d = dict(src_dict)
|
|
25
|
-
|
|
25
|
+
graph_usage_response_recent_events_item = cls()
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
return
|
|
27
|
+
graph_usage_response_recent_events_item.additional_properties = d
|
|
28
|
+
return graph_usage_response_recent_events_item
|
|
29
29
|
|
|
30
30
|
@property
|
|
31
31
|
def additional_keys(self) -> list[str]:
|
|
@@ -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
|