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,28 +1,28 @@
|
|
|
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
8
|
from ...models.http_validation_error import HTTPValidationError
|
|
9
|
-
from ...models.
|
|
9
|
+
from ...models.invoices_response import InvoicesResponse
|
|
10
10
|
from ...types import UNSET, Response, Unset
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
def _get_kwargs(
|
|
14
14
|
*,
|
|
15
|
-
|
|
15
|
+
limit: Union[Unset, int] = 10,
|
|
16
16
|
) -> dict[str, Any]:
|
|
17
17
|
params: dict[str, Any] = {}
|
|
18
18
|
|
|
19
|
-
params["
|
|
19
|
+
params["limit"] = limit
|
|
20
20
|
|
|
21
21
|
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
22
22
|
|
|
23
23
|
_kwargs: dict[str, Any] = {
|
|
24
24
|
"method": "get",
|
|
25
|
-
"url": "/v1/
|
|
25
|
+
"url": "/v1/billing/invoices",
|
|
26
26
|
"params": params,
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -31,25 +31,17 @@ def _get_kwargs(
|
|
|
31
31
|
|
|
32
32
|
def _parse_response(
|
|
33
33
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
34
|
-
) -> Optional[Union[
|
|
34
|
+
) -> Optional[Union[HTTPValidationError, InvoicesResponse]]:
|
|
35
35
|
if response.status_code == 200:
|
|
36
|
-
response_200 =
|
|
36
|
+
response_200 = InvoicesResponse.from_dict(response.json())
|
|
37
37
|
|
|
38
38
|
return response_200
|
|
39
39
|
|
|
40
|
-
if response.status_code == 401:
|
|
41
|
-
response_401 = cast(Any, None)
|
|
42
|
-
return response_401
|
|
43
|
-
|
|
44
40
|
if response.status_code == 422:
|
|
45
41
|
response_422 = HTTPValidationError.from_dict(response.json())
|
|
46
42
|
|
|
47
43
|
return response_422
|
|
48
44
|
|
|
49
|
-
if response.status_code == 500:
|
|
50
|
-
response_500 = cast(Any, None)
|
|
51
|
-
return response_500
|
|
52
|
-
|
|
53
45
|
if client.raise_on_unexpected_status:
|
|
54
46
|
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
55
47
|
else:
|
|
@@ -58,7 +50,7 @@ def _parse_response(
|
|
|
58
50
|
|
|
59
51
|
def _build_response(
|
|
60
52
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
61
|
-
) -> Response[Union[
|
|
53
|
+
) -> Response[Union[HTTPValidationError, InvoicesResponse]]:
|
|
62
54
|
return Response(
|
|
63
55
|
status_code=HTTPStatus(response.status_code),
|
|
64
56
|
content=response.content,
|
|
@@ -70,25 +62,27 @@ def _build_response(
|
|
|
70
62
|
def sync_detailed(
|
|
71
63
|
*,
|
|
72
64
|
client: AuthenticatedClient,
|
|
73
|
-
|
|
74
|
-
) -> Response[Union[
|
|
75
|
-
"""
|
|
65
|
+
limit: Union[Unset, int] = 10,
|
|
66
|
+
) -> Response[Union[HTTPValidationError, InvoicesResponse]]:
|
|
67
|
+
"""List Invoices
|
|
68
|
+
|
|
69
|
+
List payment history and invoices.
|
|
76
70
|
|
|
77
|
-
|
|
71
|
+
Returns past invoices with payment status, amounts, and line items.
|
|
78
72
|
|
|
79
73
|
Args:
|
|
80
|
-
|
|
74
|
+
limit (Union[Unset, int]): Number of invoices to return Default: 10.
|
|
81
75
|
|
|
82
76
|
Raises:
|
|
83
77
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
84
78
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
85
79
|
|
|
86
80
|
Returns:
|
|
87
|
-
Response[Union[
|
|
81
|
+
Response[Union[HTTPValidationError, InvoicesResponse]]
|
|
88
82
|
"""
|
|
89
83
|
|
|
90
84
|
kwargs = _get_kwargs(
|
|
91
|
-
|
|
85
|
+
limit=limit,
|
|
92
86
|
)
|
|
93
87
|
|
|
94
88
|
response = client.get_httpx_client().request(
|
|
@@ -101,51 +95,55 @@ def sync_detailed(
|
|
|
101
95
|
def sync(
|
|
102
96
|
*,
|
|
103
97
|
client: AuthenticatedClient,
|
|
104
|
-
|
|
105
|
-
) -> Optional[Union[
|
|
106
|
-
"""
|
|
98
|
+
limit: Union[Unset, int] = 10,
|
|
99
|
+
) -> Optional[Union[HTTPValidationError, InvoicesResponse]]:
|
|
100
|
+
"""List Invoices
|
|
107
101
|
|
|
108
|
-
|
|
102
|
+
List payment history and invoices.
|
|
103
|
+
|
|
104
|
+
Returns past invoices with payment status, amounts, and line items.
|
|
109
105
|
|
|
110
106
|
Args:
|
|
111
|
-
|
|
107
|
+
limit (Union[Unset, int]): Number of invoices to return Default: 10.
|
|
112
108
|
|
|
113
109
|
Raises:
|
|
114
110
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
115
111
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
116
112
|
|
|
117
113
|
Returns:
|
|
118
|
-
Union[
|
|
114
|
+
Union[HTTPValidationError, InvoicesResponse]
|
|
119
115
|
"""
|
|
120
116
|
|
|
121
117
|
return sync_detailed(
|
|
122
118
|
client=client,
|
|
123
|
-
|
|
119
|
+
limit=limit,
|
|
124
120
|
).parsed
|
|
125
121
|
|
|
126
122
|
|
|
127
123
|
async def asyncio_detailed(
|
|
128
124
|
*,
|
|
129
125
|
client: AuthenticatedClient,
|
|
130
|
-
|
|
131
|
-
) -> Response[Union[
|
|
132
|
-
"""
|
|
126
|
+
limit: Union[Unset, int] = 10,
|
|
127
|
+
) -> Response[Union[HTTPValidationError, InvoicesResponse]]:
|
|
128
|
+
"""List Invoices
|
|
129
|
+
|
|
130
|
+
List payment history and invoices.
|
|
133
131
|
|
|
134
|
-
|
|
132
|
+
Returns past invoices with payment status, amounts, and line items.
|
|
135
133
|
|
|
136
134
|
Args:
|
|
137
|
-
|
|
135
|
+
limit (Union[Unset, int]): Number of invoices to return Default: 10.
|
|
138
136
|
|
|
139
137
|
Raises:
|
|
140
138
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
141
139
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
142
140
|
|
|
143
141
|
Returns:
|
|
144
|
-
Response[Union[
|
|
142
|
+
Response[Union[HTTPValidationError, InvoicesResponse]]
|
|
145
143
|
"""
|
|
146
144
|
|
|
147
145
|
kwargs = _get_kwargs(
|
|
148
|
-
|
|
146
|
+
limit=limit,
|
|
149
147
|
)
|
|
150
148
|
|
|
151
149
|
response = await client.get_async_httpx_client().request(**kwargs)
|
|
@@ -156,26 +154,28 @@ async def asyncio_detailed(
|
|
|
156
154
|
async def asyncio(
|
|
157
155
|
*,
|
|
158
156
|
client: AuthenticatedClient,
|
|
159
|
-
|
|
160
|
-
) -> Optional[Union[
|
|
161
|
-
"""
|
|
157
|
+
limit: Union[Unset, int] = 10,
|
|
158
|
+
) -> Optional[Union[HTTPValidationError, InvoicesResponse]]:
|
|
159
|
+
"""List Invoices
|
|
160
|
+
|
|
161
|
+
List payment history and invoices.
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
Returns past invoices with payment status, amounts, and line items.
|
|
164
164
|
|
|
165
165
|
Args:
|
|
166
|
-
|
|
166
|
+
limit (Union[Unset, int]): Number of invoices to return Default: 10.
|
|
167
167
|
|
|
168
168
|
Raises:
|
|
169
169
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
170
170
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
171
171
|
|
|
172
172
|
Returns:
|
|
173
|
-
Union[
|
|
173
|
+
Union[HTTPValidationError, InvoicesResponse]
|
|
174
174
|
"""
|
|
175
175
|
|
|
176
176
|
return (
|
|
177
177
|
await asyncio_detailed(
|
|
178
178
|
client=client,
|
|
179
|
-
|
|
179
|
+
limit=limit,
|
|
180
180
|
)
|
|
181
181
|
).parsed
|
|
@@ -5,16 +5,14 @@ import httpx
|
|
|
5
5
|
|
|
6
6
|
from ... import errors
|
|
7
7
|
from ...client import AuthenticatedClient, Client
|
|
8
|
-
from ...models.
|
|
9
|
-
GetAllSharedRepositoryLimitsResponseGetallsharedrepositorylimits,
|
|
10
|
-
)
|
|
8
|
+
from ...models.graph_subscription_response import GraphSubscriptionResponse
|
|
11
9
|
from ...types import Response
|
|
12
10
|
|
|
13
11
|
|
|
14
12
|
def _get_kwargs() -> dict[str, Any]:
|
|
15
13
|
_kwargs: dict[str, Any] = {
|
|
16
14
|
"method": "get",
|
|
17
|
-
"url": "/v1/
|
|
15
|
+
"url": "/v1/billing/subscriptions",
|
|
18
16
|
}
|
|
19
17
|
|
|
20
18
|
return _kwargs
|
|
@@ -22,13 +20,14 @@ def _get_kwargs() -> dict[str, Any]:
|
|
|
22
20
|
|
|
23
21
|
def _parse_response(
|
|
24
22
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
25
|
-
) -> Optional[
|
|
23
|
+
) -> Optional[list["GraphSubscriptionResponse"]]:
|
|
26
24
|
if response.status_code == 200:
|
|
27
|
-
response_200 =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
)
|
|
31
|
-
|
|
25
|
+
response_200 = []
|
|
26
|
+
_response_200 = response.json()
|
|
27
|
+
for response_200_item_data in _response_200:
|
|
28
|
+
response_200_item = GraphSubscriptionResponse.from_dict(response_200_item_data)
|
|
29
|
+
|
|
30
|
+
response_200.append(response_200_item)
|
|
32
31
|
|
|
33
32
|
return response_200
|
|
34
33
|
|
|
@@ -40,7 +39,7 @@ def _parse_response(
|
|
|
40
39
|
|
|
41
40
|
def _build_response(
|
|
42
41
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
43
|
-
) -> Response[
|
|
42
|
+
) -> Response[list["GraphSubscriptionResponse"]]:
|
|
44
43
|
return Response(
|
|
45
44
|
status_code=HTTPStatus(response.status_code),
|
|
46
45
|
content=response.content,
|
|
@@ -52,17 +51,20 @@ def _build_response(
|
|
|
52
51
|
def sync_detailed(
|
|
53
52
|
*,
|
|
54
53
|
client: AuthenticatedClient,
|
|
55
|
-
) -> Response[
|
|
56
|
-
"""
|
|
54
|
+
) -> Response[list["GraphSubscriptionResponse"]]:
|
|
55
|
+
"""List All Subscriptions
|
|
56
|
+
|
|
57
|
+
List all active and past subscriptions for the user.
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
Includes both graph and repository subscriptions with their status, pricing, and billing
|
|
60
|
+
information.
|
|
59
61
|
|
|
60
62
|
Raises:
|
|
61
63
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
62
64
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
63
65
|
|
|
64
66
|
Returns:
|
|
65
|
-
Response[
|
|
67
|
+
Response[list['GraphSubscriptionResponse']]
|
|
66
68
|
"""
|
|
67
69
|
|
|
68
70
|
kwargs = _get_kwargs()
|
|
@@ -77,17 +79,20 @@ def sync_detailed(
|
|
|
77
79
|
def sync(
|
|
78
80
|
*,
|
|
79
81
|
client: AuthenticatedClient,
|
|
80
|
-
) -> Optional[
|
|
81
|
-
"""
|
|
82
|
+
) -> Optional[list["GraphSubscriptionResponse"]]:
|
|
83
|
+
"""List All Subscriptions
|
|
82
84
|
|
|
83
|
-
|
|
85
|
+
List all active and past subscriptions for the user.
|
|
86
|
+
|
|
87
|
+
Includes both graph and repository subscriptions with their status, pricing, and billing
|
|
88
|
+
information.
|
|
84
89
|
|
|
85
90
|
Raises:
|
|
86
91
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
87
92
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
88
93
|
|
|
89
94
|
Returns:
|
|
90
|
-
|
|
95
|
+
list['GraphSubscriptionResponse']
|
|
91
96
|
"""
|
|
92
97
|
|
|
93
98
|
return sync_detailed(
|
|
@@ -98,17 +103,20 @@ def sync(
|
|
|
98
103
|
async def asyncio_detailed(
|
|
99
104
|
*,
|
|
100
105
|
client: AuthenticatedClient,
|
|
101
|
-
) -> Response[
|
|
102
|
-
"""
|
|
106
|
+
) -> Response[list["GraphSubscriptionResponse"]]:
|
|
107
|
+
"""List All Subscriptions
|
|
108
|
+
|
|
109
|
+
List all active and past subscriptions for the user.
|
|
103
110
|
|
|
104
|
-
|
|
111
|
+
Includes both graph and repository subscriptions with their status, pricing, and billing
|
|
112
|
+
information.
|
|
105
113
|
|
|
106
114
|
Raises:
|
|
107
115
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
108
116
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
109
117
|
|
|
110
118
|
Returns:
|
|
111
|
-
Response[
|
|
119
|
+
Response[list['GraphSubscriptionResponse']]
|
|
112
120
|
"""
|
|
113
121
|
|
|
114
122
|
kwargs = _get_kwargs()
|
|
@@ -121,17 +129,20 @@ async def asyncio_detailed(
|
|
|
121
129
|
async def asyncio(
|
|
122
130
|
*,
|
|
123
131
|
client: AuthenticatedClient,
|
|
124
|
-
) -> Optional[
|
|
125
|
-
"""
|
|
132
|
+
) -> Optional[list["GraphSubscriptionResponse"]]:
|
|
133
|
+
"""List All Subscriptions
|
|
134
|
+
|
|
135
|
+
List all active and past subscriptions for the user.
|
|
126
136
|
|
|
127
|
-
|
|
137
|
+
Includes both graph and repository subscriptions with their status, pricing, and billing
|
|
138
|
+
information.
|
|
128
139
|
|
|
129
140
|
Raises:
|
|
130
141
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
131
142
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
132
143
|
|
|
133
144
|
Returns:
|
|
134
|
-
|
|
145
|
+
list['GraphSubscriptionResponse']
|
|
135
146
|
"""
|
|
136
147
|
|
|
137
148
|
return (
|
|
@@ -1,25 +1,25 @@
|
|
|
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
8
|
from ...models.http_validation_error import HTTPValidationError
|
|
9
|
-
from ...models.
|
|
10
|
-
from ...models.
|
|
9
|
+
from ...models.update_payment_method_request import UpdatePaymentMethodRequest
|
|
10
|
+
from ...models.update_payment_method_response import UpdatePaymentMethodResponse
|
|
11
11
|
from ...types import Response
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
def _get_kwargs(
|
|
15
15
|
*,
|
|
16
|
-
body:
|
|
16
|
+
body: UpdatePaymentMethodRequest,
|
|
17
17
|
) -> dict[str, Any]:
|
|
18
18
|
headers: dict[str, Any] = {}
|
|
19
19
|
|
|
20
20
|
_kwargs: dict[str, Any] = {
|
|
21
21
|
"method": "post",
|
|
22
|
-
"url": "/v1/
|
|
22
|
+
"url": "/v1/billing/customer/payment-method",
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
_kwargs["json"] = body.to_dict()
|
|
@@ -32,29 +32,17 @@ def _get_kwargs(
|
|
|
32
32
|
|
|
33
33
|
def _parse_response(
|
|
34
34
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
35
|
-
) -> Optional[Union[
|
|
36
|
-
if response.status_code ==
|
|
37
|
-
|
|
35
|
+
) -> Optional[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
|
|
36
|
+
if response.status_code == 200:
|
|
37
|
+
response_200 = UpdatePaymentMethodResponse.from_dict(response.json())
|
|
38
38
|
|
|
39
|
-
return
|
|
40
|
-
|
|
41
|
-
if response.status_code == 400:
|
|
42
|
-
response_400 = cast(Any, None)
|
|
43
|
-
return response_400
|
|
44
|
-
|
|
45
|
-
if response.status_code == 401:
|
|
46
|
-
response_401 = cast(Any, None)
|
|
47
|
-
return response_401
|
|
39
|
+
return response_200
|
|
48
40
|
|
|
49
41
|
if response.status_code == 422:
|
|
50
42
|
response_422 = HTTPValidationError.from_dict(response.json())
|
|
51
43
|
|
|
52
44
|
return response_422
|
|
53
45
|
|
|
54
|
-
if response.status_code == 500:
|
|
55
|
-
response_500 = cast(Any, None)
|
|
56
|
-
return response_500
|
|
57
|
-
|
|
58
46
|
if client.raise_on_unexpected_status:
|
|
59
47
|
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
60
48
|
else:
|
|
@@ -63,7 +51,7 @@ def _parse_response(
|
|
|
63
51
|
|
|
64
52
|
def _build_response(
|
|
65
53
|
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
66
|
-
) -> Response[Union[
|
|
54
|
+
) -> Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
|
|
67
55
|
return Response(
|
|
68
56
|
status_code=HTTPStatus(response.status_code),
|
|
69
57
|
content=response.content,
|
|
@@ -75,21 +63,23 @@ def _build_response(
|
|
|
75
63
|
def sync_detailed(
|
|
76
64
|
*,
|
|
77
65
|
client: AuthenticatedClient,
|
|
78
|
-
body:
|
|
79
|
-
) -> Response[Union[
|
|
80
|
-
"""
|
|
66
|
+
body: UpdatePaymentMethodRequest,
|
|
67
|
+
) -> Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
|
|
68
|
+
"""Update Default Payment Method
|
|
69
|
+
|
|
70
|
+
Update the default payment method for the customer.
|
|
81
71
|
|
|
82
|
-
|
|
72
|
+
This changes which payment method will be used for future subscription charges.
|
|
83
73
|
|
|
84
74
|
Args:
|
|
85
|
-
body (
|
|
75
|
+
body (UpdatePaymentMethodRequest): Request to update default payment method.
|
|
86
76
|
|
|
87
77
|
Raises:
|
|
88
78
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
89
79
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
90
80
|
|
|
91
81
|
Returns:
|
|
92
|
-
Response[Union[
|
|
82
|
+
Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]
|
|
93
83
|
"""
|
|
94
84
|
|
|
95
85
|
kwargs = _get_kwargs(
|
|
@@ -106,21 +96,23 @@ def sync_detailed(
|
|
|
106
96
|
def sync(
|
|
107
97
|
*,
|
|
108
98
|
client: AuthenticatedClient,
|
|
109
|
-
body:
|
|
110
|
-
) -> Optional[Union[
|
|
111
|
-
"""
|
|
99
|
+
body: UpdatePaymentMethodRequest,
|
|
100
|
+
) -> Optional[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
|
|
101
|
+
"""Update Default Payment Method
|
|
112
102
|
|
|
113
|
-
|
|
103
|
+
Update the default payment method for the customer.
|
|
104
|
+
|
|
105
|
+
This changes which payment method will be used for future subscription charges.
|
|
114
106
|
|
|
115
107
|
Args:
|
|
116
|
-
body (
|
|
108
|
+
body (UpdatePaymentMethodRequest): Request to update default payment method.
|
|
117
109
|
|
|
118
110
|
Raises:
|
|
119
111
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
120
112
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
121
113
|
|
|
122
114
|
Returns:
|
|
123
|
-
Union[
|
|
115
|
+
Union[HTTPValidationError, UpdatePaymentMethodResponse]
|
|
124
116
|
"""
|
|
125
117
|
|
|
126
118
|
return sync_detailed(
|
|
@@ -132,21 +124,23 @@ def sync(
|
|
|
132
124
|
async def asyncio_detailed(
|
|
133
125
|
*,
|
|
134
126
|
client: AuthenticatedClient,
|
|
135
|
-
body:
|
|
136
|
-
) -> Response[Union[
|
|
137
|
-
"""
|
|
127
|
+
body: UpdatePaymentMethodRequest,
|
|
128
|
+
) -> Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
|
|
129
|
+
"""Update Default Payment Method
|
|
130
|
+
|
|
131
|
+
Update the default payment method for the customer.
|
|
138
132
|
|
|
139
|
-
|
|
133
|
+
This changes which payment method will be used for future subscription charges.
|
|
140
134
|
|
|
141
135
|
Args:
|
|
142
|
-
body (
|
|
136
|
+
body (UpdatePaymentMethodRequest): Request to update default payment method.
|
|
143
137
|
|
|
144
138
|
Raises:
|
|
145
139
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
146
140
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
147
141
|
|
|
148
142
|
Returns:
|
|
149
|
-
Response[Union[
|
|
143
|
+
Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]
|
|
150
144
|
"""
|
|
151
145
|
|
|
152
146
|
kwargs = _get_kwargs(
|
|
@@ -161,21 +155,23 @@ async def asyncio_detailed(
|
|
|
161
155
|
async def asyncio(
|
|
162
156
|
*,
|
|
163
157
|
client: AuthenticatedClient,
|
|
164
|
-
body:
|
|
165
|
-
) -> Optional[Union[
|
|
166
|
-
"""
|
|
158
|
+
body: UpdatePaymentMethodRequest,
|
|
159
|
+
) -> Optional[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
|
|
160
|
+
"""Update Default Payment Method
|
|
161
|
+
|
|
162
|
+
Update the default payment method for the customer.
|
|
167
163
|
|
|
168
|
-
|
|
164
|
+
This changes which payment method will be used for future subscription charges.
|
|
169
165
|
|
|
170
166
|
Args:
|
|
171
|
-
body (
|
|
167
|
+
body (UpdatePaymentMethodRequest): Request to update default payment method.
|
|
172
168
|
|
|
173
169
|
Raises:
|
|
174
170
|
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
175
171
|
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
176
172
|
|
|
177
173
|
Returns:
|
|
178
|
-
Union[
|
|
174
|
+
Union[HTTPValidationError, UpdatePaymentMethodResponse]
|
|
179
175
|
"""
|
|
180
176
|
|
|
181
177
|
return (
|