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,207 @@
|
|
|
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.update_payment_method_request import UpdatePaymentMethodRequest
|
|
10
|
+
from ...models.update_payment_method_response import UpdatePaymentMethodResponse
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
org_id: str,
|
|
16
|
+
*,
|
|
17
|
+
body: UpdatePaymentMethodRequest,
|
|
18
|
+
) -> dict[str, Any]:
|
|
19
|
+
headers: dict[str, Any] = {}
|
|
20
|
+
|
|
21
|
+
_kwargs: dict[str, Any] = {
|
|
22
|
+
"method": "post",
|
|
23
|
+
"url": f"/v1/billing/customer/{org_id}/payment-method",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
_kwargs["json"] = body.to_dict()
|
|
27
|
+
|
|
28
|
+
headers["Content-Type"] = "application/json"
|
|
29
|
+
|
|
30
|
+
_kwargs["headers"] = headers
|
|
31
|
+
return _kwargs
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def _parse_response(
|
|
35
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
36
|
+
) -> Optional[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
|
|
37
|
+
if response.status_code == 200:
|
|
38
|
+
response_200 = UpdatePaymentMethodResponse.from_dict(response.json())
|
|
39
|
+
|
|
40
|
+
return response_200
|
|
41
|
+
|
|
42
|
+
if response.status_code == 422:
|
|
43
|
+
response_422 = HTTPValidationError.from_dict(response.json())
|
|
44
|
+
|
|
45
|
+
return response_422
|
|
46
|
+
|
|
47
|
+
if client.raise_on_unexpected_status:
|
|
48
|
+
raise errors.UnexpectedStatus(response.status_code, response.content)
|
|
49
|
+
else:
|
|
50
|
+
return None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def _build_response(
|
|
54
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
55
|
+
) -> Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
|
|
56
|
+
return Response(
|
|
57
|
+
status_code=HTTPStatus(response.status_code),
|
|
58
|
+
content=response.content,
|
|
59
|
+
headers=response.headers,
|
|
60
|
+
parsed=_parse_response(client=client, response=response),
|
|
61
|
+
)
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
def sync_detailed(
|
|
65
|
+
org_id: str,
|
|
66
|
+
*,
|
|
67
|
+
client: AuthenticatedClient,
|
|
68
|
+
body: UpdatePaymentMethodRequest,
|
|
69
|
+
) -> Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
|
|
70
|
+
"""Update Organization Default Payment Method
|
|
71
|
+
|
|
72
|
+
Update the default payment method for the organization.
|
|
73
|
+
|
|
74
|
+
This changes which payment method will be used for future subscription charges.
|
|
75
|
+
|
|
76
|
+
**Requirements:**
|
|
77
|
+
- User must be an OWNER of the organization
|
|
78
|
+
|
|
79
|
+
Args:
|
|
80
|
+
org_id (str):
|
|
81
|
+
body (UpdatePaymentMethodRequest): Request to update default payment method.
|
|
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, UpdatePaymentMethodResponse]]
|
|
89
|
+
"""
|
|
90
|
+
|
|
91
|
+
kwargs = _get_kwargs(
|
|
92
|
+
org_id=org_id,
|
|
93
|
+
body=body,
|
|
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
|
+
body: UpdatePaymentMethodRequest,
|
|
108
|
+
) -> Optional[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
|
|
109
|
+
"""Update Organization Default Payment Method
|
|
110
|
+
|
|
111
|
+
Update the default payment method for the organization.
|
|
112
|
+
|
|
113
|
+
This changes which payment method will be used for future subscription charges.
|
|
114
|
+
|
|
115
|
+
**Requirements:**
|
|
116
|
+
- User must be an OWNER of the organization
|
|
117
|
+
|
|
118
|
+
Args:
|
|
119
|
+
org_id (str):
|
|
120
|
+
body (UpdatePaymentMethodRequest): Request to update default payment method.
|
|
121
|
+
|
|
122
|
+
Raises:
|
|
123
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
124
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
Union[HTTPValidationError, UpdatePaymentMethodResponse]
|
|
128
|
+
"""
|
|
129
|
+
|
|
130
|
+
return sync_detailed(
|
|
131
|
+
org_id=org_id,
|
|
132
|
+
client=client,
|
|
133
|
+
body=body,
|
|
134
|
+
).parsed
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
async def asyncio_detailed(
|
|
138
|
+
org_id: str,
|
|
139
|
+
*,
|
|
140
|
+
client: AuthenticatedClient,
|
|
141
|
+
body: UpdatePaymentMethodRequest,
|
|
142
|
+
) -> Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
|
|
143
|
+
"""Update Organization Default Payment Method
|
|
144
|
+
|
|
145
|
+
Update the default payment method for the organization.
|
|
146
|
+
|
|
147
|
+
This changes which payment method will be used for future subscription charges.
|
|
148
|
+
|
|
149
|
+
**Requirements:**
|
|
150
|
+
- User must be an OWNER of the organization
|
|
151
|
+
|
|
152
|
+
Args:
|
|
153
|
+
org_id (str):
|
|
154
|
+
body (UpdatePaymentMethodRequest): Request to update default payment method.
|
|
155
|
+
|
|
156
|
+
Raises:
|
|
157
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
158
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
159
|
+
|
|
160
|
+
Returns:
|
|
161
|
+
Response[Union[HTTPValidationError, UpdatePaymentMethodResponse]]
|
|
162
|
+
"""
|
|
163
|
+
|
|
164
|
+
kwargs = _get_kwargs(
|
|
165
|
+
org_id=org_id,
|
|
166
|
+
body=body,
|
|
167
|
+
)
|
|
168
|
+
|
|
169
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
170
|
+
|
|
171
|
+
return _build_response(client=client, response=response)
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
async def asyncio(
|
|
175
|
+
org_id: str,
|
|
176
|
+
*,
|
|
177
|
+
client: AuthenticatedClient,
|
|
178
|
+
body: UpdatePaymentMethodRequest,
|
|
179
|
+
) -> Optional[Union[HTTPValidationError, UpdatePaymentMethodResponse]]:
|
|
180
|
+
"""Update Organization Default Payment Method
|
|
181
|
+
|
|
182
|
+
Update the default payment method for the organization.
|
|
183
|
+
|
|
184
|
+
This changes which payment method will be used for future subscription charges.
|
|
185
|
+
|
|
186
|
+
**Requirements:**
|
|
187
|
+
- User must be an OWNER of the organization
|
|
188
|
+
|
|
189
|
+
Args:
|
|
190
|
+
org_id (str):
|
|
191
|
+
body (UpdatePaymentMethodRequest): Request to update default payment method.
|
|
192
|
+
|
|
193
|
+
Raises:
|
|
194
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
195
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
196
|
+
|
|
197
|
+
Returns:
|
|
198
|
+
Union[HTTPValidationError, UpdatePaymentMethodResponse]
|
|
199
|
+
"""
|
|
200
|
+
|
|
201
|
+
return (
|
|
202
|
+
await asyncio_detailed(
|
|
203
|
+
org_id=org_id,
|
|
204
|
+
client=client,
|
|
205
|
+
body=body,
|
|
206
|
+
)
|
|
207
|
+
).parsed
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Contains endpoint functions for accessing the API"""
|
|
@@ -0,0 +1,174 @@
|
|
|
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.create_org_request import CreateOrgRequest
|
|
9
|
+
from ...models.http_validation_error import HTTPValidationError
|
|
10
|
+
from ...models.org_detail_response import OrgDetailResponse
|
|
11
|
+
from ...types import Response
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def _get_kwargs(
|
|
15
|
+
*,
|
|
16
|
+
body: CreateOrgRequest,
|
|
17
|
+
) -> dict[str, Any]:
|
|
18
|
+
headers: dict[str, Any] = {}
|
|
19
|
+
|
|
20
|
+
_kwargs: dict[str, Any] = {
|
|
21
|
+
"method": "post",
|
|
22
|
+
"url": "/v1/orgs",
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
_kwargs["json"] = body.to_dict()
|
|
26
|
+
|
|
27
|
+
headers["Content-Type"] = "application/json"
|
|
28
|
+
|
|
29
|
+
_kwargs["headers"] = headers
|
|
30
|
+
return _kwargs
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def _parse_response(
|
|
34
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
35
|
+
) -> Optional[Union[HTTPValidationError, OrgDetailResponse]]:
|
|
36
|
+
if response.status_code == 201:
|
|
37
|
+
response_201 = OrgDetailResponse.from_dict(response.json())
|
|
38
|
+
|
|
39
|
+
return response_201
|
|
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, OrgDetailResponse]]:
|
|
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
|
+
*,
|
|
65
|
+
client: AuthenticatedClient,
|
|
66
|
+
body: CreateOrgRequest,
|
|
67
|
+
) -> Response[Union[HTTPValidationError, OrgDetailResponse]]:
|
|
68
|
+
"""Create Organization
|
|
69
|
+
|
|
70
|
+
Create a new organization. The creating user becomes the owner.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
body (CreateOrgRequest): Request to create an organization.
|
|
74
|
+
|
|
75
|
+
Raises:
|
|
76
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
77
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
78
|
+
|
|
79
|
+
Returns:
|
|
80
|
+
Response[Union[HTTPValidationError, OrgDetailResponse]]
|
|
81
|
+
"""
|
|
82
|
+
|
|
83
|
+
kwargs = _get_kwargs(
|
|
84
|
+
body=body,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
response = client.get_httpx_client().request(
|
|
88
|
+
**kwargs,
|
|
89
|
+
)
|
|
90
|
+
|
|
91
|
+
return _build_response(client=client, response=response)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
def sync(
|
|
95
|
+
*,
|
|
96
|
+
client: AuthenticatedClient,
|
|
97
|
+
body: CreateOrgRequest,
|
|
98
|
+
) -> Optional[Union[HTTPValidationError, OrgDetailResponse]]:
|
|
99
|
+
"""Create Organization
|
|
100
|
+
|
|
101
|
+
Create a new organization. The creating user becomes the owner.
|
|
102
|
+
|
|
103
|
+
Args:
|
|
104
|
+
body (CreateOrgRequest): Request to create an organization.
|
|
105
|
+
|
|
106
|
+
Raises:
|
|
107
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
108
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
109
|
+
|
|
110
|
+
Returns:
|
|
111
|
+
Union[HTTPValidationError, OrgDetailResponse]
|
|
112
|
+
"""
|
|
113
|
+
|
|
114
|
+
return sync_detailed(
|
|
115
|
+
client=client,
|
|
116
|
+
body=body,
|
|
117
|
+
).parsed
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
async def asyncio_detailed(
|
|
121
|
+
*,
|
|
122
|
+
client: AuthenticatedClient,
|
|
123
|
+
body: CreateOrgRequest,
|
|
124
|
+
) -> Response[Union[HTTPValidationError, OrgDetailResponse]]:
|
|
125
|
+
"""Create Organization
|
|
126
|
+
|
|
127
|
+
Create a new organization. The creating user becomes the owner.
|
|
128
|
+
|
|
129
|
+
Args:
|
|
130
|
+
body (CreateOrgRequest): Request to create an organization.
|
|
131
|
+
|
|
132
|
+
Raises:
|
|
133
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
134
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
135
|
+
|
|
136
|
+
Returns:
|
|
137
|
+
Response[Union[HTTPValidationError, OrgDetailResponse]]
|
|
138
|
+
"""
|
|
139
|
+
|
|
140
|
+
kwargs = _get_kwargs(
|
|
141
|
+
body=body,
|
|
142
|
+
)
|
|
143
|
+
|
|
144
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
145
|
+
|
|
146
|
+
return _build_response(client=client, response=response)
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
async def asyncio(
|
|
150
|
+
*,
|
|
151
|
+
client: AuthenticatedClient,
|
|
152
|
+
body: CreateOrgRequest,
|
|
153
|
+
) -> Optional[Union[HTTPValidationError, OrgDetailResponse]]:
|
|
154
|
+
"""Create Organization
|
|
155
|
+
|
|
156
|
+
Create a new organization. The creating user becomes the owner.
|
|
157
|
+
|
|
158
|
+
Args:
|
|
159
|
+
body (CreateOrgRequest): Request to create an organization.
|
|
160
|
+
|
|
161
|
+
Raises:
|
|
162
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
163
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
164
|
+
|
|
165
|
+
Returns:
|
|
166
|
+
Union[HTTPValidationError, OrgDetailResponse]
|
|
167
|
+
"""
|
|
168
|
+
|
|
169
|
+
return (
|
|
170
|
+
await asyncio_detailed(
|
|
171
|
+
client=client,
|
|
172
|
+
body=body,
|
|
173
|
+
)
|
|
174
|
+
).parsed
|
|
@@ -0,0 +1,165 @@
|
|
|
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.org_detail_response import OrgDetailResponse
|
|
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/orgs/{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, OrgDetailResponse]]:
|
|
27
|
+
if response.status_code == 200:
|
|
28
|
+
response_200 = OrgDetailResponse.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[HTTPValidationError, OrgDetailResponse]]:
|
|
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
|
+
org_id: str,
|
|
56
|
+
*,
|
|
57
|
+
client: AuthenticatedClient,
|
|
58
|
+
) -> Response[Union[HTTPValidationError, OrgDetailResponse]]:
|
|
59
|
+
"""Get Organization
|
|
60
|
+
|
|
61
|
+
Get detailed information about an organization.
|
|
62
|
+
|
|
63
|
+
Args:
|
|
64
|
+
org_id (str):
|
|
65
|
+
|
|
66
|
+
Raises:
|
|
67
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
68
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
69
|
+
|
|
70
|
+
Returns:
|
|
71
|
+
Response[Union[HTTPValidationError, OrgDetailResponse]]
|
|
72
|
+
"""
|
|
73
|
+
|
|
74
|
+
kwargs = _get_kwargs(
|
|
75
|
+
org_id=org_id,
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
response = client.get_httpx_client().request(
|
|
79
|
+
**kwargs,
|
|
80
|
+
)
|
|
81
|
+
|
|
82
|
+
return _build_response(client=client, response=response)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def sync(
|
|
86
|
+
org_id: str,
|
|
87
|
+
*,
|
|
88
|
+
client: AuthenticatedClient,
|
|
89
|
+
) -> Optional[Union[HTTPValidationError, OrgDetailResponse]]:
|
|
90
|
+
"""Get Organization
|
|
91
|
+
|
|
92
|
+
Get detailed information about an organization.
|
|
93
|
+
|
|
94
|
+
Args:
|
|
95
|
+
org_id (str):
|
|
96
|
+
|
|
97
|
+
Raises:
|
|
98
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
99
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
100
|
+
|
|
101
|
+
Returns:
|
|
102
|
+
Union[HTTPValidationError, OrgDetailResponse]
|
|
103
|
+
"""
|
|
104
|
+
|
|
105
|
+
return sync_detailed(
|
|
106
|
+
org_id=org_id,
|
|
107
|
+
client=client,
|
|
108
|
+
).parsed
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
async def asyncio_detailed(
|
|
112
|
+
org_id: str,
|
|
113
|
+
*,
|
|
114
|
+
client: AuthenticatedClient,
|
|
115
|
+
) -> Response[Union[HTTPValidationError, OrgDetailResponse]]:
|
|
116
|
+
"""Get Organization
|
|
117
|
+
|
|
118
|
+
Get detailed information about an organization.
|
|
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
|
+
Response[Union[HTTPValidationError, OrgDetailResponse]]
|
|
129
|
+
"""
|
|
130
|
+
|
|
131
|
+
kwargs = _get_kwargs(
|
|
132
|
+
org_id=org_id,
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
136
|
+
|
|
137
|
+
return _build_response(client=client, response=response)
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
async def asyncio(
|
|
141
|
+
org_id: str,
|
|
142
|
+
*,
|
|
143
|
+
client: AuthenticatedClient,
|
|
144
|
+
) -> Optional[Union[HTTPValidationError, OrgDetailResponse]]:
|
|
145
|
+
"""Get Organization
|
|
146
|
+
|
|
147
|
+
Get detailed information about an organization.
|
|
148
|
+
|
|
149
|
+
Args:
|
|
150
|
+
org_id (str):
|
|
151
|
+
|
|
152
|
+
Raises:
|
|
153
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
154
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
155
|
+
|
|
156
|
+
Returns:
|
|
157
|
+
Union[HTTPValidationError, OrgDetailResponse]
|
|
158
|
+
"""
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
await asyncio_detailed(
|
|
162
|
+
org_id=org_id,
|
|
163
|
+
client=client,
|
|
164
|
+
)
|
|
165
|
+
).parsed
|
|
@@ -0,0 +1,170 @@
|
|
|
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.list_org_graphs_response_200_item import ListOrgGraphsResponse200Item
|
|
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/orgs/{org_id}/graphs",
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
return _kwargs
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
def _parse_response(
|
|
25
|
+
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
|
26
|
+
) -> Optional[Union[HTTPValidationError, list["ListOrgGraphsResponse200Item"]]]:
|
|
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 = ListOrgGraphsResponse200Item.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["ListOrgGraphsResponse200Item"]]]:
|
|
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["ListOrgGraphsResponse200Item"]]]:
|
|
64
|
+
"""List Organization Graphs
|
|
65
|
+
|
|
66
|
+
Get all graphs belonging to an organization.
|
|
67
|
+
|
|
68
|
+
Args:
|
|
69
|
+
org_id (str):
|
|
70
|
+
|
|
71
|
+
Raises:
|
|
72
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
73
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
74
|
+
|
|
75
|
+
Returns:
|
|
76
|
+
Response[Union[HTTPValidationError, list['ListOrgGraphsResponse200Item']]]
|
|
77
|
+
"""
|
|
78
|
+
|
|
79
|
+
kwargs = _get_kwargs(
|
|
80
|
+
org_id=org_id,
|
|
81
|
+
)
|
|
82
|
+
|
|
83
|
+
response = client.get_httpx_client().request(
|
|
84
|
+
**kwargs,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
return _build_response(client=client, response=response)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
def sync(
|
|
91
|
+
org_id: str,
|
|
92
|
+
*,
|
|
93
|
+
client: AuthenticatedClient,
|
|
94
|
+
) -> Optional[Union[HTTPValidationError, list["ListOrgGraphsResponse200Item"]]]:
|
|
95
|
+
"""List Organization Graphs
|
|
96
|
+
|
|
97
|
+
Get all graphs belonging to an organization.
|
|
98
|
+
|
|
99
|
+
Args:
|
|
100
|
+
org_id (str):
|
|
101
|
+
|
|
102
|
+
Raises:
|
|
103
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
104
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
105
|
+
|
|
106
|
+
Returns:
|
|
107
|
+
Union[HTTPValidationError, list['ListOrgGraphsResponse200Item']]
|
|
108
|
+
"""
|
|
109
|
+
|
|
110
|
+
return sync_detailed(
|
|
111
|
+
org_id=org_id,
|
|
112
|
+
client=client,
|
|
113
|
+
).parsed
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
async def asyncio_detailed(
|
|
117
|
+
org_id: str,
|
|
118
|
+
*,
|
|
119
|
+
client: AuthenticatedClient,
|
|
120
|
+
) -> Response[Union[HTTPValidationError, list["ListOrgGraphsResponse200Item"]]]:
|
|
121
|
+
"""List Organization Graphs
|
|
122
|
+
|
|
123
|
+
Get all graphs belonging to an organization.
|
|
124
|
+
|
|
125
|
+
Args:
|
|
126
|
+
org_id (str):
|
|
127
|
+
|
|
128
|
+
Raises:
|
|
129
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
130
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
131
|
+
|
|
132
|
+
Returns:
|
|
133
|
+
Response[Union[HTTPValidationError, list['ListOrgGraphsResponse200Item']]]
|
|
134
|
+
"""
|
|
135
|
+
|
|
136
|
+
kwargs = _get_kwargs(
|
|
137
|
+
org_id=org_id,
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
response = await client.get_async_httpx_client().request(**kwargs)
|
|
141
|
+
|
|
142
|
+
return _build_response(client=client, response=response)
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
async def asyncio(
|
|
146
|
+
org_id: str,
|
|
147
|
+
*,
|
|
148
|
+
client: AuthenticatedClient,
|
|
149
|
+
) -> Optional[Union[HTTPValidationError, list["ListOrgGraphsResponse200Item"]]]:
|
|
150
|
+
"""List Organization Graphs
|
|
151
|
+
|
|
152
|
+
Get all graphs belonging to an organization.
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
org_id (str):
|
|
156
|
+
|
|
157
|
+
Raises:
|
|
158
|
+
errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
|
|
159
|
+
httpx.TimeoutException: If the request takes longer than Client.timeout.
|
|
160
|
+
|
|
161
|
+
Returns:
|
|
162
|
+
Union[HTTPValidationError, list['ListOrgGraphsResponse200Item']]
|
|
163
|
+
"""
|
|
164
|
+
|
|
165
|
+
return (
|
|
166
|
+
await asyncio_detailed(
|
|
167
|
+
org_id=org_id,
|
|
168
|
+
client=client,
|
|
169
|
+
)
|
|
170
|
+
).parsed
|