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
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.checkout_status_response import CheckoutStatusResponse
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
session_id: str,
|
|
15
|
+
) -> dict[str, Any]:
|
|
16
|
+
_kwargs: dict[str, Any] = {
|
|
17
|
+
"method": "get",
|
|
18
|
+
"url": f"/v1/billing/checkout/{session_id}/status",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return _kwargs
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _parse_response(
|
|
25
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
26
|
+
) -> Optional[Union[CheckoutStatusResponse, HTTPValidationError]]:
|
|
27
|
+
if response.status_code == 200:
|
|
28
|
+
response_200 = CheckoutStatusResponse.from_dict(response.json())
|
|
29
|
+
|
|
30
|
+
return response_200
|
|
31
|
+
|
|
32
|
+
if response.status_code == 422:
|
|
33
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
34
|
+
|
|
35
|
+
return response_422
|
|
36
|
+
|
|
37
|
+
if client.raise_on_unexpected_status:
|
|
38
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
39
|
+
else:
|
|
40
|
+
return None
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _build_response(
|
|
44
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
45
|
+
) -> Response[Union[CheckoutStatusResponse, HTTPValidationError]]:
|
|
46
|
+
return Response(
|
|
47
|
+
status_code=HTTPStatus(response.status_code),
|
|
48
|
+
content=response.content,
|
|
49
|
+
headers=response.headers,
|
|
50
|
+
parsed=_parse_response(client=client, response=response),
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def sync_detailed(
|
|
55
|
+
session_id: str,
|
|
56
|
+
*,
|
|
57
|
+
client: AuthenticatedClient,
|
|
58
|
+
) -> Response[Union[CheckoutStatusResponse, HTTPValidationError]]:
|
|
59
|
+
"""Get Checkout Session Status
|
|
60
|
+
|
|
61
|
+
Poll the status of a checkout session.
|
|
62
|
+
|
|
63
|
+
Frontend should poll this endpoint after user returns from Stripe Checkout
|
|
64
|
+
to determine when the resource is ready.
|
|
65
|
+
|
|
66
|
+
**Status Values:**
|
|
67
|
+
- `pending_payment`: Waiting for payment to complete
|
|
68
|
+
- `provisioning`: Payment confirmed, resource being created
|
|
69
|
+
- `completed`: Resource is ready (resource_id will be set)
|
|
70
|
+
- `failed`: Something went wrong (error field will be set)
|
|
71
|
+
|
|
72
|
+
**When status is 'completed':**
|
|
73
|
+
- For graphs: `resource_id` will be the graph_id, and `operation_id` can be used to monitor SSE
|
|
74
|
+
progress
|
|
75
|
+
- For repositories: `resource_id` will be the repository name and access is immediately available
|
|
76
|
+
|
|
77
|
+
Args:
|
|
78
|
+
session_id (str):
|
|
79
|
+
|
|
80
|
+
Raises:
|
|
81
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
82
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
83
|
+
|
|
84
|
+
Returns:
|
|
85
|
+
Response[Union[CheckoutStatusResponse, HTTPValidationError]]
|
|
86
|
+
"""
|
|
87
|
+
|
|
88
|
+
kwargs = _get_kwargs(
|
|
89
|
+
session_id=session_id,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
response = client.get_httpx_client().request(
|
|
93
|
+
**kwargs,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
return _build_response(client=client, response=response)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
def sync(
|
|
100
|
+
session_id: str,
|
|
101
|
+
*,
|
|
102
|
+
client: AuthenticatedClient,
|
|
103
|
+
) -> Optional[Union[CheckoutStatusResponse, HTTPValidationError]]:
|
|
104
|
+
"""Get Checkout Session Status
|
|
105
|
+
|
|
106
|
+
Poll the status of a checkout session.
|
|
107
|
+
|
|
108
|
+
Frontend should poll this endpoint after user returns from Stripe Checkout
|
|
109
|
+
to determine when the resource is ready.
|
|
110
|
+
|
|
111
|
+
**Status Values:**
|
|
112
|
+
- `pending_payment`: Waiting for payment to complete
|
|
113
|
+
- `provisioning`: Payment confirmed, resource being created
|
|
114
|
+
- `completed`: Resource is ready (resource_id will be set)
|
|
115
|
+
- `failed`: Something went wrong (error field will be set)
|
|
116
|
+
|
|
117
|
+
**When status is 'completed':**
|
|
118
|
+
- For graphs: `resource_id` will be the graph_id, and `operation_id` can be used to monitor SSE
|
|
119
|
+
progress
|
|
120
|
+
- For repositories: `resource_id` will be the repository name and access is immediately available
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
session_id (str):
|
|
124
|
+
|
|
125
|
+
Raises:
|
|
126
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
127
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
128
|
+
|
|
129
|
+
Returns:
|
|
130
|
+
Union[CheckoutStatusResponse, HTTPValidationError]
|
|
131
|
+
"""
|
|
132
|
+
|
|
133
|
+
return sync_detailed(
|
|
134
|
+
session_id=session_id,
|
|
135
|
+
client=client,
|
|
136
|
+
).parsed
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
async def asyncio_detailed(
|
|
140
|
+
session_id: str,
|
|
141
|
+
*,
|
|
142
|
+
client: AuthenticatedClient,
|
|
143
|
+
) -> Response[Union[CheckoutStatusResponse, HTTPValidationError]]:
|
|
144
|
+
"""Get Checkout Session Status
|
|
145
|
+
|
|
146
|
+
Poll the status of a checkout session.
|
|
147
|
+
|
|
148
|
+
Frontend should poll this endpoint after user returns from Stripe Checkout
|
|
149
|
+
to determine when the resource is ready.
|
|
150
|
+
|
|
151
|
+
**Status Values:**
|
|
152
|
+
- `pending_payment`: Waiting for payment to complete
|
|
153
|
+
- `provisioning`: Payment confirmed, resource being created
|
|
154
|
+
- `completed`: Resource is ready (resource_id will be set)
|
|
155
|
+
- `failed`: Something went wrong (error field will be set)
|
|
156
|
+
|
|
157
|
+
**When status is 'completed':**
|
|
158
|
+
- For graphs: `resource_id` will be the graph_id, and `operation_id` can be used to monitor SSE
|
|
159
|
+
progress
|
|
160
|
+
- For repositories: `resource_id` will be the repository name and access is immediately available
|
|
161
|
+
|
|
162
|
+
Args:
|
|
163
|
+
session_id (str):
|
|
164
|
+
|
|
165
|
+
Raises:
|
|
166
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
167
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
168
|
+
|
|
169
|
+
Returns:
|
|
170
|
+
Response[Union[CheckoutStatusResponse, HTTPValidationError]]
|
|
171
|
+
"""
|
|
172
|
+
|
|
173
|
+
kwargs = _get_kwargs(
|
|
174
|
+
session_id=session_id,
|
|
175
|
+
)
|
|
176
|
+
|
|
177
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
178
|
+
|
|
179
|
+
return _build_response(client=client, response=response)
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
async def asyncio(
|
|
183
|
+
session_id: str,
|
|
184
|
+
*,
|
|
185
|
+
client: AuthenticatedClient,
|
|
186
|
+
) -> Optional[Union[CheckoutStatusResponse, HTTPValidationError]]:
|
|
187
|
+
"""Get Checkout Session Status
|
|
188
|
+
|
|
189
|
+
Poll the status of a checkout session.
|
|
190
|
+
|
|
191
|
+
Frontend should poll this endpoint after user returns from Stripe Checkout
|
|
192
|
+
to determine when the resource is ready.
|
|
193
|
+
|
|
194
|
+
**Status Values:**
|
|
195
|
+
- `pending_payment`: Waiting for payment to complete
|
|
196
|
+
- `provisioning`: Payment confirmed, resource being created
|
|
197
|
+
- `completed`: Resource is ready (resource_id will be set)
|
|
198
|
+
- `failed`: Something went wrong (error field will be set)
|
|
199
|
+
|
|
200
|
+
**When status is 'completed':**
|
|
201
|
+
- For graphs: `resource_id` will be the graph_id, and `operation_id` can be used to monitor SSE
|
|
202
|
+
progress
|
|
203
|
+
- For repositories: `resource_id` will be the repository name and access is immediately available
|
|
204
|
+
|
|
205
|
+
Args:
|
|
206
|
+
session_id (str):
|
|
207
|
+
|
|
208
|
+
Raises:
|
|
209
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
210
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
211
|
+
|
|
212
|
+
Returns:
|
|
213
|
+
Union[CheckoutStatusResponse, HTTPValidationError]
|
|
214
|
+
"""
|
|
215
|
+
|
|
216
|
+
return (
|
|
217
|
+
await asyncio_detailed(
|
|
218
|
+
session_id=session_id,
|
|
219
|
+
client=client,
|
|
220
|
+
)
|
|
221
|
+
).parsed
|
robosystems_client/api/{user_subscriptions/get_repository_credits.py → billing/get_subscription.py}
RENAMED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
from http import HTTPStatus
|
|
2
|
-
from typing import Any, Optional, Union
|
|
2
|
+
from typing import Any, Optional, Union
|
|
3
3
|
|
|
4
4
|
import httpx
|
|
5
5
|
|
|
6
6
|
from ... import errors
|
|
7
7
|
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.graph_subscription_response import GraphSubscriptionResponse
|
|
8
9
|
from ...models.http_validation_error import HTTPValidationError
|
|
9
|
-
from ...models.repository_credits_response import RepositoryCreditsResponse
|
|
10
10
|
from ...types import Response
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def _get_kwargs(
|
|
14
|
-
|
|
14
|
+
subscription_id: str,
|
|
15
15
|
) -> dict[str, Any]:
|
|
16
16
|
_kwargs: dict[str, Any] = {
|
|
17
17
|
"method": "get",
|
|
18
|
-
"url": f"/v1/
|
|
18
|
+
"url": f"/v1/billing/subscriptions/{subscription_id}",
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
return _kwargs
|
|
@@ -23,25 +23,17 @@ def _get_kwargs(
|
|
|
23
23
|
|
|
24
24
|
def _parse_response(
|
|
25
25
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
26
|
-
) -> Optional[Union[
|
|
26
|
+
) -> Optional[Union[GraphSubscriptionResponse, HTTPValidationError]]:
|
|
27
27
|
if response.status_code == 200:
|
|
28
|
-
response_200 =
|
|
28
|
+
response_200 = GraphSubscriptionResponse.from_dict(response.json())
|
|
29
29
|
|
|
30
30
|
return response_200
|
|
31
31
|
|
|
32
|
-
if response.status_code == 401:
|
|
33
|
-
response_401 = cast(Any, None)
|
|
34
|
-
return response_401
|
|
35
|
-
|
|
36
32
|
if response.status_code == 422:
|
|
37
33
|
response_422 = HTTPValidationError.from_dict(response.json())
|
|
38
34
|
|
|
39
35
|
return response_422
|
|
40
36
|
|
|
41
|
-
if response.status_code == 500:
|
|
42
|
-
response_500 = cast(Any, None)
|
|
43
|
-
return response_500
|
|
44
|
-
|
|
45
37
|
if client.raise_on_unexpected_status:
|
|
46
38
|
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
47
39
|
else:
|
|
@@ -50,7 +42,7 @@ def _parse_response(
|
|
|
50
42
|
|
|
51
43
|
def _build_response(
|
|
52
44
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
53
|
-
) -> Response[Union[
|
|
45
|
+
) -> Response[Union[GraphSubscriptionResponse, HTTPValidationError]]:
|
|
54
46
|
return Response(
|
|
55
47
|
status_code=HTTPStatus(response.status_code),
|
|
56
48
|
content=response.content,
|
|
@@ -60,27 +52,27 @@ def _build_response(
|
|
|
60
52
|
|
|
61
53
|
|
|
62
54
|
def sync_detailed(
|
|
63
|
-
|
|
55
|
+
subscription_id: str,
|
|
64
56
|
*,
|
|
65
57
|
client: AuthenticatedClient,
|
|
66
|
-
) -> Response[Union[
|
|
67
|
-
"""Get
|
|
58
|
+
) -> Response[Union[GraphSubscriptionResponse, HTTPValidationError]]:
|
|
59
|
+
"""Get Subscription Details
|
|
68
60
|
|
|
69
|
-
Get
|
|
61
|
+
Get detailed information about a specific subscription.
|
|
70
62
|
|
|
71
63
|
Args:
|
|
72
|
-
|
|
64
|
+
subscription_id (str):
|
|
73
65
|
|
|
74
66
|
Raises:
|
|
75
67
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
76
68
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
77
69
|
|
|
78
70
|
Returns:
|
|
79
|
-
Response[Union[
|
|
71
|
+
Response[Union[GraphSubscriptionResponse, HTTPValidationError]]
|
|
80
72
|
"""
|
|
81
73
|
|
|
82
74
|
kwargs = _get_kwargs(
|
|
83
|
-
|
|
75
|
+
subscription_id=subscription_id,
|
|
84
76
|
)
|
|
85
77
|
|
|
86
78
|
response = client.get_httpx_client().request(
|
|
@@ -91,53 +83,53 @@ def sync_detailed(
|
|
|
91
83
|
|
|
92
84
|
|
|
93
85
|
def sync(
|
|
94
|
-
|
|
86
|
+
subscription_id: str,
|
|
95
87
|
*,
|
|
96
88
|
client: AuthenticatedClient,
|
|
97
|
-
) -> Optional[Union[
|
|
98
|
-
"""Get
|
|
89
|
+
) -> Optional[Union[GraphSubscriptionResponse, HTTPValidationError]]:
|
|
90
|
+
"""Get Subscription Details
|
|
99
91
|
|
|
100
|
-
Get
|
|
92
|
+
Get detailed information about a specific subscription.
|
|
101
93
|
|
|
102
94
|
Args:
|
|
103
|
-
|
|
95
|
+
subscription_id (str):
|
|
104
96
|
|
|
105
97
|
Raises:
|
|
106
98
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
107
99
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
108
100
|
|
|
109
101
|
Returns:
|
|
110
|
-
Union[
|
|
102
|
+
Union[GraphSubscriptionResponse, HTTPValidationError]
|
|
111
103
|
"""
|
|
112
104
|
|
|
113
105
|
return sync_detailed(
|
|
114
|
-
|
|
106
|
+
subscription_id=subscription_id,
|
|
115
107
|
client=client,
|
|
116
108
|
).parsed
|
|
117
109
|
|
|
118
110
|
|
|
119
111
|
async def asyncio_detailed(
|
|
120
|
-
|
|
112
|
+
subscription_id: str,
|
|
121
113
|
*,
|
|
122
114
|
client: AuthenticatedClient,
|
|
123
|
-
) -> Response[Union[
|
|
124
|
-
"""Get
|
|
115
|
+
) -> Response[Union[GraphSubscriptionResponse, HTTPValidationError]]:
|
|
116
|
+
"""Get Subscription Details
|
|
125
117
|
|
|
126
|
-
Get
|
|
118
|
+
Get detailed information about a specific subscription.
|
|
127
119
|
|
|
128
120
|
Args:
|
|
129
|
-
|
|
121
|
+
subscription_id (str):
|
|
130
122
|
|
|
131
123
|
Raises:
|
|
132
124
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
133
125
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
134
126
|
|
|
135
127
|
Returns:
|
|
136
|
-
Response[Union[
|
|
128
|
+
Response[Union[GraphSubscriptionResponse, HTTPValidationError]]
|
|
137
129
|
"""
|
|
138
130
|
|
|
139
131
|
kwargs = _get_kwargs(
|
|
140
|
-
|
|
132
|
+
subscription_id=subscription_id,
|
|
141
133
|
)
|
|
142
134
|
|
|
143
135
|
response = await client.get_async_httpx_client().request(**kwargs)
|
|
@@ -146,28 +138,28 @@ async def asyncio_detailed(
|
|
|
146
138
|
|
|
147
139
|
|
|
148
140
|
async def asyncio(
|
|
149
|
-
|
|
141
|
+
subscription_id: str,
|
|
150
142
|
*,
|
|
151
143
|
client: AuthenticatedClient,
|
|
152
|
-
) -> Optional[Union[
|
|
153
|
-
"""Get
|
|
144
|
+
) -> Optional[Union[GraphSubscriptionResponse, HTTPValidationError]]:
|
|
145
|
+
"""Get Subscription Details
|
|
154
146
|
|
|
155
|
-
Get
|
|
147
|
+
Get detailed information about a specific subscription.
|
|
156
148
|
|
|
157
149
|
Args:
|
|
158
|
-
|
|
150
|
+
subscription_id (str):
|
|
159
151
|
|
|
160
152
|
Raises:
|
|
161
153
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
162
154
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
163
155
|
|
|
164
156
|
Returns:
|
|
165
|
-
Union[
|
|
157
|
+
Union[GraphSubscriptionResponse, HTTPValidationError]
|
|
166
158
|
"""
|
|
167
159
|
|
|
168
160
|
return (
|
|
169
161
|
await asyncio_detailed(
|
|
170
|
-
|
|
162
|
+
subscription_id=subscription_id,
|
|
171
163
|
client=client,
|
|
172
164
|
)
|
|
173
165
|
).parsed
|
|
@@ -5,14 +5,14 @@ import httpx
|
|
|
5
5
|
|
|
6
6
|
from ... import errors
|
|
7
7
|
from ...client import AuthenticatedClient, Client
|
|
8
|
-
from ...models.
|
|
8
|
+
from ...models.upcoming_invoice import UpcomingInvoice
|
|
9
9
|
from ...types import Response
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
def _get_kwargs() -> dict[str, Any]:
|
|
13
13
|
_kwargs: dict[str, Any] = {
|
|
14
14
|
"method": "get",
|
|
15
|
-
"url": "/v1/
|
|
15
|
+
"url": "/v1/billing/invoices/upcoming",
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
return _kwargs
|
|
@@ -20,19 +20,25 @@ def _get_kwargs() -> dict[str, Any]:
|
|
|
20
20
|
|
|
21
21
|
def _parse_response(
|
|
22
22
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
23
|
-
) -> Optional[Union[
|
|
23
|
+
) -> Optional[Union["UpcomingInvoice", None]]:
|
|
24
24
|
if response.status_code == 200:
|
|
25
|
-
response_200 = CreditsSummaryResponse.from_dict(response.json())
|
|
26
25
|
|
|
27
|
-
|
|
26
|
+
def _parse_response_200(data: object) -> Union["UpcomingInvoice", None]:
|
|
27
|
+
if data is None:
|
|
28
|
+
return data
|
|
29
|
+
try:
|
|
30
|
+
if not isinstance(data, dict):
|
|
31
|
+
raise TypeError()
|
|
32
|
+
response_200_type_0 = UpcomingInvoice.from_dict(data)
|
|
33
|
+
|
|
34
|
+
return response_200_type_0
|
|
35
|
+
except: # noqa: E722
|
|
36
|
+
pass
|
|
37
|
+
return cast(Union["UpcomingInvoice", None], data)
|
|
28
38
|
|
|
29
|
-
|
|
30
|
-
response_401 = cast(Any, None)
|
|
31
|
-
return response_401
|
|
39
|
+
response_200 = _parse_response_200(response.json())
|
|
32
40
|
|
|
33
|
-
|
|
34
|
-
response_500 = cast(Any, None)
|
|
35
|
-
return response_500
|
|
41
|
+
return response_200
|
|
36
42
|
|
|
37
43
|
if client.raise_on_unexpected_status:
|
|
38
44
|
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
@@ -42,7 +48,7 @@ def _parse_response(
|
|
|
42
48
|
|
|
43
49
|
def _build_response(
|
|
44
50
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
45
|
-
) -> Response[Union[
|
|
51
|
+
) -> Response[Union["UpcomingInvoice", None]]:
|
|
46
52
|
return Response(
|
|
47
53
|
status_code=HTTPStatus(response.status_code),
|
|
48
54
|
content=response.content,
|
|
@@ -54,17 +60,19 @@ def _build_response(
|
|
|
54
60
|
def sync_detailed(
|
|
55
61
|
*,
|
|
56
62
|
client: AuthenticatedClient,
|
|
57
|
-
) -> Response[Union[
|
|
58
|
-
"""Get
|
|
63
|
+
) -> Response[Union["UpcomingInvoice", None]]:
|
|
64
|
+
"""Get Upcoming Invoice
|
|
65
|
+
|
|
66
|
+
Get preview of the next invoice.
|
|
59
67
|
|
|
60
|
-
|
|
68
|
+
Returns estimated charges for the next billing period.
|
|
61
69
|
|
|
62
70
|
Raises:
|
|
63
71
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
64
72
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
65
73
|
|
|
66
74
|
Returns:
|
|
67
|
-
Response[Union[
|
|
75
|
+
Response[Union['UpcomingInvoice', None]]
|
|
68
76
|
"""
|
|
69
77
|
|
|
70
78
|
kwargs = _get_kwargs()
|
|
@@ -79,17 +87,19 @@ def sync_detailed(
|
|
|
79
87
|
def sync(
|
|
80
88
|
*,
|
|
81
89
|
client: AuthenticatedClient,
|
|
82
|
-
) -> Optional[Union[
|
|
83
|
-
"""Get
|
|
90
|
+
) -> Optional[Union["UpcomingInvoice", None]]:
|
|
91
|
+
"""Get Upcoming Invoice
|
|
84
92
|
|
|
85
|
-
|
|
93
|
+
Get preview of the next invoice.
|
|
94
|
+
|
|
95
|
+
Returns estimated charges for the next billing period.
|
|
86
96
|
|
|
87
97
|
Raises:
|
|
88
98
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
89
99
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
90
100
|
|
|
91
101
|
Returns:
|
|
92
|
-
Union[
|
|
102
|
+
Union['UpcomingInvoice', None]
|
|
93
103
|
"""
|
|
94
104
|
|
|
95
105
|
return sync_detailed(
|
|
@@ -100,17 +110,19 @@ def sync(
|
|
|
100
110
|
async def asyncio_detailed(
|
|
101
111
|
*,
|
|
102
112
|
client: AuthenticatedClient,
|
|
103
|
-
) -> Response[Union[
|
|
104
|
-
"""Get
|
|
113
|
+
) -> Response[Union["UpcomingInvoice", None]]:
|
|
114
|
+
"""Get Upcoming Invoice
|
|
115
|
+
|
|
116
|
+
Get preview of the next invoice.
|
|
105
117
|
|
|
106
|
-
|
|
118
|
+
Returns estimated charges for the next billing period.
|
|
107
119
|
|
|
108
120
|
Raises:
|
|
109
121
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
110
122
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
111
123
|
|
|
112
124
|
Returns:
|
|
113
|
-
Response[Union[
|
|
125
|
+
Response[Union['UpcomingInvoice', None]]
|
|
114
126
|
"""
|
|
115
127
|
|
|
116
128
|
kwargs = _get_kwargs()
|
|
@@ -123,17 +135,19 @@ async def asyncio_detailed(
|
|
|
123
135
|
async def asyncio(
|
|
124
136
|
*,
|
|
125
137
|
client: AuthenticatedClient,
|
|
126
|
-
) -> Optional[Union[
|
|
127
|
-
"""Get
|
|
138
|
+
) -> Optional[Union["UpcomingInvoice", None]]:
|
|
139
|
+
"""Get Upcoming Invoice
|
|
140
|
+
|
|
141
|
+
Get preview of the next invoice.
|
|
128
142
|
|
|
129
|
-
|
|
143
|
+
Returns estimated charges for the next billing period.
|
|
130
144
|
|
|
131
145
|
Raises:
|
|
132
146
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
133
147
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
134
148
|
|
|
135
149
|
Returns:
|
|
136
|
-
Union[
|
|
150
|
+
Union['UpcomingInvoice', None]
|
|
137
151
|
"""
|
|
138
152
|
|
|
139
153
|
return (
|