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
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
from http import HTTPStatus
|
|
2
|
+
from typing import Any, Optional, Union, cast
|
|
3
|
+
|
|
4
|
+
import httpx
|
|
5
|
+
|
|
6
|
+
from ... import errors
|
|
7
|
+
from ...client import AuthenticatedClient, Client
|
|
8
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
9
|
+
from ...models.upcoming_invoice import UpcomingInvoice
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
org_id: str,
|
|
15
|
+
) -> dict[str, Any]:
|
|
16
|
+
_kwargs: dict[str, Any] = {
|
|
17
|
+
"method": "get",
|
|
18
|
+
"url": f"/v1/billing/invoices/{org_id}/upcoming",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return _kwargs
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _parse_response(
|
|
25
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
26
|
+
) -> Optional[Union[HTTPValidationError, Union["UpcomingInvoice", None]]]:
|
|
27
|
+
if response.status_code == 200:
|
|
28
|
+
|
|
29
|
+
def _parse_response_200(data: object) -> Union["UpcomingInvoice", None]:
|
|
30
|
+
if data is None:
|
|
31
|
+
return data
|
|
32
|
+
try:
|
|
33
|
+
if not isinstance(data, dict):
|
|
34
|
+
raise TypeError()
|
|
35
|
+
response_200_type_0 = UpcomingInvoice.from_dict(data)
|
|
36
|
+
|
|
37
|
+
return response_200_type_0
|
|
38
|
+
except: # noqa: E722
|
|
39
|
+
pass
|
|
40
|
+
return cast(Union["UpcomingInvoice", None], data)
|
|
41
|
+
|
|
42
|
+
response_200 = _parse_response_200(response.json())
|
|
43
|
+
|
|
44
|
+
return response_200
|
|
45
|
+
|
|
46
|
+
if response.status_code == 422:
|
|
47
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
48
|
+
|
|
49
|
+
return response_422
|
|
50
|
+
|
|
51
|
+
if client.raise_on_unexpected_status:
|
|
52
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
53
|
+
else:
|
|
54
|
+
return None
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
def _build_response(
|
|
58
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
59
|
+
) -> Response[Union[HTTPValidationError, Union["UpcomingInvoice", None]]]:
|
|
60
|
+
return Response(
|
|
61
|
+
status_code=HTTPStatus(response.status_code),
|
|
62
|
+
content=response.content,
|
|
63
|
+
headers=response.headers,
|
|
64
|
+
parsed=_parse_response(client=client, response=response),
|
|
65
|
+
)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
def sync_detailed(
|
|
69
|
+
org_id: str,
|
|
70
|
+
*,
|
|
71
|
+
client: AuthenticatedClient,
|
|
72
|
+
) -> Response[Union[HTTPValidationError, Union["UpcomingInvoice", None]]]:
|
|
73
|
+
"""Get Organization Upcoming Invoice
|
|
74
|
+
|
|
75
|
+
Get preview of the next invoice for an organization.
|
|
76
|
+
|
|
77
|
+
Returns estimated charges for the next billing period.
|
|
78
|
+
|
|
79
|
+
**Requirements:**
|
|
80
|
+
- User must be a member of the organization
|
|
81
|
+
- Full invoice details are only visible to owners and admins
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
org_id (str):
|
|
85
|
+
|
|
86
|
+
Raises:
|
|
87
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
88
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
89
|
+
|
|
90
|
+
Returns:
|
|
91
|
+
Response[Union[HTTPValidationError, Union['UpcomingInvoice', None]]]
|
|
92
|
+
"""
|
|
93
|
+
|
|
94
|
+
kwargs = _get_kwargs(
|
|
95
|
+
org_id=org_id,
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
response = client.get_httpx_client().request(
|
|
99
|
+
**kwargs,
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
return _build_response(client=client, response=response)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def sync(
|
|
106
|
+
org_id: str,
|
|
107
|
+
*,
|
|
108
|
+
client: AuthenticatedClient,
|
|
109
|
+
) -> Optional[Union[HTTPValidationError, Union["UpcomingInvoice", None]]]:
|
|
110
|
+
"""Get Organization Upcoming Invoice
|
|
111
|
+
|
|
112
|
+
Get preview of the next invoice for an organization.
|
|
113
|
+
|
|
114
|
+
Returns estimated charges for the next billing period.
|
|
115
|
+
|
|
116
|
+
**Requirements:**
|
|
117
|
+
- User must be a member of the organization
|
|
118
|
+
- Full invoice details are only visible to owners and admins
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
org_id (str):
|
|
122
|
+
|
|
123
|
+
Raises:
|
|
124
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
125
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
126
|
+
|
|
127
|
+
Returns:
|
|
128
|
+
Union[HTTPValidationError, Union['UpcomingInvoice', None]]
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
return sync_detailed(
|
|
132
|
+
org_id=org_id,
|
|
133
|
+
client=client,
|
|
134
|
+
).parsed
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
async def asyncio_detailed(
|
|
138
|
+
org_id: str,
|
|
139
|
+
*,
|
|
140
|
+
client: AuthenticatedClient,
|
|
141
|
+
) -> Response[Union[HTTPValidationError, Union["UpcomingInvoice", None]]]:
|
|
142
|
+
"""Get Organization Upcoming Invoice
|
|
143
|
+
|
|
144
|
+
Get preview of the next invoice for an organization.
|
|
145
|
+
|
|
146
|
+
Returns estimated charges for the next billing period.
|
|
147
|
+
|
|
148
|
+
**Requirements:**
|
|
149
|
+
- User must be a member of the organization
|
|
150
|
+
- Full invoice details are only visible to owners and admins
|
|
151
|
+
|
|
152
|
+
Args:
|
|
153
|
+
org_id (str):
|
|
154
|
+
|
|
155
|
+
Raises:
|
|
156
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
157
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
158
|
+
|
|
159
|
+
Returns:
|
|
160
|
+
Response[Union[HTTPValidationError, Union['UpcomingInvoice', None]]]
|
|
161
|
+
"""
|
|
162
|
+
|
|
163
|
+
kwargs = _get_kwargs(
|
|
164
|
+
org_id=org_id,
|
|
165
|
+
)
|
|
166
|
+
|
|
167
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
168
|
+
|
|
169
|
+
return _build_response(client=client, response=response)
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
async def asyncio(
|
|
173
|
+
org_id: str,
|
|
174
|
+
*,
|
|
175
|
+
client: AuthenticatedClient,
|
|
176
|
+
) -> Optional[Union[HTTPValidationError, Union["UpcomingInvoice", None]]]:
|
|
177
|
+
"""Get Organization Upcoming Invoice
|
|
178
|
+
|
|
179
|
+
Get preview of the next invoice for an organization.
|
|
180
|
+
|
|
181
|
+
Returns estimated charges for the next billing period.
|
|
182
|
+
|
|
183
|
+
**Requirements:**
|
|
184
|
+
- User must be a member of the organization
|
|
185
|
+
- Full invoice details are only visible to owners and admins
|
|
186
|
+
|
|
187
|
+
Args:
|
|
188
|
+
org_id (str):
|
|
189
|
+
|
|
190
|
+
Raises:
|
|
191
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
192
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
193
|
+
|
|
194
|
+
Returns:
|
|
195
|
+
Union[HTTPValidationError, Union['UpcomingInvoice', None]]
|
|
196
|
+
"""
|
|
197
|
+
|
|
198
|
+
return (
|
|
199
|
+
await asyncio_detailed(
|
|
200
|
+
org_id=org_id,
|
|
201
|
+
client=client,
|
|
202
|
+
)
|
|
203
|
+
).parsed
|
|
@@ -0,0 +1,210 @@
|
|
|
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.http_validation_error import HTTPValidationError
|
|
9
|
+
from ...models.invoices_response import InvoicesResponse
|
|
10
|
+
from ...types import UNSET, Response, Unset
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
org_id: str,
|
|
15
|
+
*,
|
|
16
|
+
limit: Union[Unset, int] = 10,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
params: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
params["limit"] = limit
|
|
21
|
+
|
|
22
|
+
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
|
23
|
+
|
|
24
|
+
_kwargs: dict[str, Any] = {
|
|
25
|
+
"method": "get",
|
|
26
|
+
"url": f"/v1/billing/invoices/{org_id}",
|
|
27
|
+
"params": params,
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return _kwargs
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(
|
|
34
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
35
|
+
) -> Optional[Union[HTTPValidationError, InvoicesResponse]]:
|
|
36
|
+
if response.status_code == 200:
|
|
37
|
+
response_200 = InvoicesResponse.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_200
|
|
40
|
+
|
|
41
|
+
if response.status_code == 422:
|
|
42
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
43
|
+
|
|
44
|
+
return response_422
|
|
45
|
+
|
|
46
|
+
if client.raise_on_unexpected_status:
|
|
47
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
48
|
+
else:
|
|
49
|
+
return None
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def _build_response(
|
|
53
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
54
|
+
) -> Response[Union[HTTPValidationError, InvoicesResponse]]:
|
|
55
|
+
return Response(
|
|
56
|
+
status_code=HTTPStatus(response.status_code),
|
|
57
|
+
content=response.content,
|
|
58
|
+
headers=response.headers,
|
|
59
|
+
parsed=_parse_response(client=client, response=response),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def sync_detailed(
|
|
64
|
+
org_id: str,
|
|
65
|
+
*,
|
|
66
|
+
client: AuthenticatedClient,
|
|
67
|
+
limit: Union[Unset, int] = 10,
|
|
68
|
+
) -> Response[Union[HTTPValidationError, InvoicesResponse]]:
|
|
69
|
+
"""List Organization Invoices
|
|
70
|
+
|
|
71
|
+
List payment history and invoices for an organization.
|
|
72
|
+
|
|
73
|
+
Returns past invoices with payment status, amounts, and line items.
|
|
74
|
+
|
|
75
|
+
**Requirements:**
|
|
76
|
+
- User must be a member of the organization
|
|
77
|
+
- Full invoice details are only visible to owners and admins
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
org_id (str):
|
|
81
|
+
limit (Union[Unset, int]): Number of invoices to return Default: 10.
|
|
82
|
+
|
|
83
|
+
Raises:
|
|
84
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
85
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
Response[Union[HTTPValidationError, InvoicesResponse]]
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
kwargs = _get_kwargs(
|
|
92
|
+
org_id=org_id,
|
|
93
|
+
limit=limit,
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
response = client.get_httpx_client().request(
|
|
97
|
+
**kwargs,
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
return _build_response(client=client, response=response)
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
def sync(
|
|
104
|
+
org_id: str,
|
|
105
|
+
*,
|
|
106
|
+
client: AuthenticatedClient,
|
|
107
|
+
limit: Union[Unset, int] = 10,
|
|
108
|
+
) -> Optional[Union[HTTPValidationError, InvoicesResponse]]:
|
|
109
|
+
"""List Organization Invoices
|
|
110
|
+
|
|
111
|
+
List payment history and invoices for an organization.
|
|
112
|
+
|
|
113
|
+
Returns past invoices with payment status, amounts, and line items.
|
|
114
|
+
|
|
115
|
+
**Requirements:**
|
|
116
|
+
- User must be a member of the organization
|
|
117
|
+
- Full invoice details are only visible to owners and admins
|
|
118
|
+
|
|
119
|
+
Args:
|
|
120
|
+
org_id (str):
|
|
121
|
+
limit (Union[Unset, int]): Number of invoices to return Default: 10.
|
|
122
|
+
|
|
123
|
+
Raises:
|
|
124
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
125
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
126
|
+
|
|
127
|
+
Returns:
|
|
128
|
+
Union[HTTPValidationError, InvoicesResponse]
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
return sync_detailed(
|
|
132
|
+
org_id=org_id,
|
|
133
|
+
client=client,
|
|
134
|
+
limit=limit,
|
|
135
|
+
).parsed
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
async def asyncio_detailed(
|
|
139
|
+
org_id: str,
|
|
140
|
+
*,
|
|
141
|
+
client: AuthenticatedClient,
|
|
142
|
+
limit: Union[Unset, int] = 10,
|
|
143
|
+
) -> Response[Union[HTTPValidationError, InvoicesResponse]]:
|
|
144
|
+
"""List Organization Invoices
|
|
145
|
+
|
|
146
|
+
List payment history and invoices for an organization.
|
|
147
|
+
|
|
148
|
+
Returns past invoices with payment status, amounts, and line items.
|
|
149
|
+
|
|
150
|
+
**Requirements:**
|
|
151
|
+
- User must be a member of the organization
|
|
152
|
+
- Full invoice details are only visible to owners and admins
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
org_id (str):
|
|
156
|
+
limit (Union[Unset, int]): Number of invoices to return Default: 10.
|
|
157
|
+
|
|
158
|
+
Raises:
|
|
159
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
160
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
161
|
+
|
|
162
|
+
Returns:
|
|
163
|
+
Response[Union[HTTPValidationError, InvoicesResponse]]
|
|
164
|
+
"""
|
|
165
|
+
|
|
166
|
+
kwargs = _get_kwargs(
|
|
167
|
+
org_id=org_id,
|
|
168
|
+
limit=limit,
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
172
|
+
|
|
173
|
+
return _build_response(client=client, response=response)
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
async def asyncio(
|
|
177
|
+
org_id: str,
|
|
178
|
+
*,
|
|
179
|
+
client: AuthenticatedClient,
|
|
180
|
+
limit: Union[Unset, int] = 10,
|
|
181
|
+
) -> Optional[Union[HTTPValidationError, InvoicesResponse]]:
|
|
182
|
+
"""List Organization Invoices
|
|
183
|
+
|
|
184
|
+
List payment history and invoices for an organization.
|
|
185
|
+
|
|
186
|
+
Returns past invoices with payment status, amounts, and line items.
|
|
187
|
+
|
|
188
|
+
**Requirements:**
|
|
189
|
+
- User must be a member of the organization
|
|
190
|
+
- Full invoice details are only visible to owners and admins
|
|
191
|
+
|
|
192
|
+
Args:
|
|
193
|
+
org_id (str):
|
|
194
|
+
limit (Union[Unset, int]): Number of invoices to return Default: 10.
|
|
195
|
+
|
|
196
|
+
Raises:
|
|
197
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
198
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
199
|
+
|
|
200
|
+
Returns:
|
|
201
|
+
Union[HTTPValidationError, InvoicesResponse]
|
|
202
|
+
"""
|
|
203
|
+
|
|
204
|
+
return (
|
|
205
|
+
await asyncio_detailed(
|
|
206
|
+
org_id=org_id,
|
|
207
|
+
client=client,
|
|
208
|
+
limit=limit,
|
|
209
|
+
)
|
|
210
|
+
).parsed
|
|
@@ -0,0 +1,194 @@
|
|
|
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.graph_subscription_response import GraphSubscriptionResponse
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...types import Response
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def _get_kwargs(
|
|
14
|
+
org_id: str,
|
|
15
|
+
) -> dict[str, Any]:
|
|
16
|
+
_kwargs: dict[str, Any] = {
|
|
17
|
+
"method": "get",
|
|
18
|
+
"url": f"/v1/billing/subscriptions/{org_id}",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return _kwargs
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _parse_response(
|
|
25
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
26
|
+
) -> Optional[Union[HTTPValidationError, list["GraphSubscriptionResponse"]]]:
|
|
27
|
+
if response.status_code == 200:
|
|
28
|
+
response_200 = []
|
|
29
|
+
_response_200 = response.json()
|
|
30
|
+
for response_200_item_data in _response_200:
|
|
31
|
+
response_200_item = GraphSubscriptionResponse.from_dict(response_200_item_data)
|
|
32
|
+
|
|
33
|
+
response_200.append(response_200_item)
|
|
34
|
+
|
|
35
|
+
return response_200
|
|
36
|
+
|
|
37
|
+
if response.status_code == 422:
|
|
38
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_422
|
|
41
|
+
|
|
42
|
+
if client.raise_on_unexpected_status:
|
|
43
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
44
|
+
else:
|
|
45
|
+
return None
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _build_response(
|
|
49
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
50
|
+
) -> Response[Union[HTTPValidationError, list["GraphSubscriptionResponse"]]]:
|
|
51
|
+
return Response(
|
|
52
|
+
status_code=HTTPStatus(response.status_code),
|
|
53
|
+
content=response.content,
|
|
54
|
+
headers=response.headers,
|
|
55
|
+
parsed=_parse_response(client=client, response=response),
|
|
56
|
+
)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
def sync_detailed(
|
|
60
|
+
org_id: str,
|
|
61
|
+
*,
|
|
62
|
+
client: AuthenticatedClient,
|
|
63
|
+
) -> Response[Union[HTTPValidationError, list["GraphSubscriptionResponse"]]]:
|
|
64
|
+
"""List Organization Subscriptions
|
|
65
|
+
|
|
66
|
+
List all active and past subscriptions for an organization.
|
|
67
|
+
|
|
68
|
+
Includes both graph and repository subscriptions with their status, pricing, and billing
|
|
69
|
+
information.
|
|
70
|
+
|
|
71
|
+
**Requirements:**
|
|
72
|
+
- User must be a member of the organization
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
org_id (str):
|
|
76
|
+
|
|
77
|
+
Raises:
|
|
78
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
79
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
80
|
+
|
|
81
|
+
Returns:
|
|
82
|
+
Response[Union[HTTPValidationError, list['GraphSubscriptionResponse']]]
|
|
83
|
+
"""
|
|
84
|
+
|
|
85
|
+
kwargs = _get_kwargs(
|
|
86
|
+
org_id=org_id,
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
response = client.get_httpx_client().request(
|
|
90
|
+
**kwargs,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
return _build_response(client=client, response=response)
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def sync(
|
|
97
|
+
org_id: str,
|
|
98
|
+
*,
|
|
99
|
+
client: AuthenticatedClient,
|
|
100
|
+
) -> Optional[Union[HTTPValidationError, list["GraphSubscriptionResponse"]]]:
|
|
101
|
+
"""List Organization Subscriptions
|
|
102
|
+
|
|
103
|
+
List all active and past subscriptions for an organization.
|
|
104
|
+
|
|
105
|
+
Includes both graph and repository subscriptions with their status, pricing, and billing
|
|
106
|
+
information.
|
|
107
|
+
|
|
108
|
+
**Requirements:**
|
|
109
|
+
- User must be a member of the organization
|
|
110
|
+
|
|
111
|
+
Args:
|
|
112
|
+
org_id (str):
|
|
113
|
+
|
|
114
|
+
Raises:
|
|
115
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
116
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
117
|
+
|
|
118
|
+
Returns:
|
|
119
|
+
Union[HTTPValidationError, list['GraphSubscriptionResponse']]
|
|
120
|
+
"""
|
|
121
|
+
|
|
122
|
+
return sync_detailed(
|
|
123
|
+
org_id=org_id,
|
|
124
|
+
client=client,
|
|
125
|
+
).parsed
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
async def asyncio_detailed(
|
|
129
|
+
org_id: str,
|
|
130
|
+
*,
|
|
131
|
+
client: AuthenticatedClient,
|
|
132
|
+
) -> Response[Union[HTTPValidationError, list["GraphSubscriptionResponse"]]]:
|
|
133
|
+
"""List Organization Subscriptions
|
|
134
|
+
|
|
135
|
+
List all active and past subscriptions for an organization.
|
|
136
|
+
|
|
137
|
+
Includes both graph and repository subscriptions with their status, pricing, and billing
|
|
138
|
+
information.
|
|
139
|
+
|
|
140
|
+
**Requirements:**
|
|
141
|
+
- User must be a member of the organization
|
|
142
|
+
|
|
143
|
+
Args:
|
|
144
|
+
org_id (str):
|
|
145
|
+
|
|
146
|
+
Raises:
|
|
147
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
148
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
149
|
+
|
|
150
|
+
Returns:
|
|
151
|
+
Response[Union[HTTPValidationError, list['GraphSubscriptionResponse']]]
|
|
152
|
+
"""
|
|
153
|
+
|
|
154
|
+
kwargs = _get_kwargs(
|
|
155
|
+
org_id=org_id,
|
|
156
|
+
)
|
|
157
|
+
|
|
158
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
159
|
+
|
|
160
|
+
return _build_response(client=client, response=response)
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
async def asyncio(
|
|
164
|
+
org_id: str,
|
|
165
|
+
*,
|
|
166
|
+
client: AuthenticatedClient,
|
|
167
|
+
) -> Optional[Union[HTTPValidationError, list["GraphSubscriptionResponse"]]]:
|
|
168
|
+
"""List Organization Subscriptions
|
|
169
|
+
|
|
170
|
+
List all active and past subscriptions for an organization.
|
|
171
|
+
|
|
172
|
+
Includes both graph and repository subscriptions with their status, pricing, and billing
|
|
173
|
+
information.
|
|
174
|
+
|
|
175
|
+
**Requirements:**
|
|
176
|
+
- User must be a member of the organization
|
|
177
|
+
|
|
178
|
+
Args:
|
|
179
|
+
org_id (str):
|
|
180
|
+
|
|
181
|
+
Raises:
|
|
182
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
183
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
184
|
+
|
|
185
|
+
Returns:
|
|
186
|
+
Union[HTTPValidationError, list['GraphSubscriptionResponse']]
|
|
187
|
+
"""
|
|
188
|
+
|
|
189
|
+
return (
|
|
190
|
+
await asyncio_detailed(
|
|
191
|
+
org_id=org_id,
|
|
192
|
+
client=client,
|
|
193
|
+
)
|
|
194
|
+
).parsed
|