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.

Files changed (73) hide show
  1. robosystems_client/api/auth/register_user.py +36 -8
  2. robosystems_client/api/billing/__init__.py +1 -0
  3. robosystems_client/api/billing/cancel_org_subscription.py +198 -0
  4. robosystems_client/api/billing/create_checkout_session.py +238 -0
  5. robosystems_client/api/billing/get_checkout_status.py +221 -0
  6. robosystems_client/api/billing/get_org_billing_customer.py +189 -0
  7. robosystems_client/api/billing/get_org_subscription.py +190 -0
  8. robosystems_client/api/billing/get_org_upcoming_invoice.py +203 -0
  9. robosystems_client/api/billing/list_org_invoices.py +210 -0
  10. robosystems_client/api/billing/list_org_subscriptions.py +194 -0
  11. robosystems_client/api/billing/update_org_payment_method.py +207 -0
  12. robosystems_client/api/org/__init__.py +1 -0
  13. robosystems_client/api/org/create_org.py +174 -0
  14. robosystems_client/api/org/get_org.py +165 -0
  15. robosystems_client/api/org/list_org_graphs.py +170 -0
  16. robosystems_client/api/{user/get_user_limits.py → org/list_user_orgs.py} +21 -25
  17. robosystems_client/api/org/update_org.py +187 -0
  18. robosystems_client/api/org_members/__init__.py +1 -0
  19. robosystems_client/api/org_members/invite_org_member.py +207 -0
  20. robosystems_client/api/org_members/list_org_members.py +165 -0
  21. robosystems_client/api/org_members/remove_org_member.py +176 -0
  22. robosystems_client/api/org_members/update_org_member_role.py +200 -0
  23. robosystems_client/api/org_usage/__init__.py +1 -0
  24. robosystems_client/api/org_usage/get_org_limits.py +165 -0
  25. robosystems_client/api/org_usage/get_org_usage.py +186 -0
  26. robosystems_client/api/service_offerings/get_service_offerings.py +32 -8
  27. robosystems_client/api/usage/get_graph_usage_analytics.py +4 -4
  28. robosystems_client/models/__init__.py +68 -6
  29. robosystems_client/models/auth_response.py +35 -0
  30. robosystems_client/models/{user_usage_response_graphs.py → auth_response_org_type_0.py} +6 -6
  31. robosystems_client/models/billing_customer.py +128 -0
  32. robosystems_client/models/checkout_response.py +130 -0
  33. robosystems_client/models/checkout_status_response.py +130 -0
  34. robosystems_client/models/create_checkout_request.py +88 -0
  35. robosystems_client/models/create_checkout_request_resource_config.py +44 -0
  36. robosystems_client/models/create_org_request.py +79 -0
  37. robosystems_client/models/graph_subscription_tier.py +40 -48
  38. robosystems_client/models/graph_subscriptions.py +17 -5
  39. robosystems_client/models/invite_member_request.py +93 -0
  40. robosystems_client/models/invoice.py +244 -0
  41. robosystems_client/models/invoice_line_item.py +118 -0
  42. robosystems_client/models/invoices_response.py +90 -0
  43. robosystems_client/models/list_org_graphs_response_200_item.py +44 -0
  44. robosystems_client/models/org_detail_response.py +174 -0
  45. robosystems_client/models/org_detail_response_graphs_item.py +44 -0
  46. robosystems_client/models/org_detail_response_limits_type_0.py +44 -0
  47. robosystems_client/models/org_detail_response_members_item.py +44 -0
  48. robosystems_client/models/org_limits_response.py +98 -0
  49. robosystems_client/models/org_limits_response_current_usage.py +44 -0
  50. robosystems_client/models/org_list_response.py +82 -0
  51. robosystems_client/models/org_member_list_response.py +90 -0
  52. robosystems_client/models/org_member_response.py +104 -0
  53. robosystems_client/models/org_response.py +121 -0
  54. robosystems_client/models/org_role.py +10 -0
  55. robosystems_client/models/org_type.py +10 -0
  56. robosystems_client/models/org_usage_response.py +146 -0
  57. robosystems_client/models/org_usage_response_daily_trend_item.py +44 -0
  58. robosystems_client/models/org_usage_response_graph_details_item.py +44 -0
  59. robosystems_client/models/org_usage_summary.py +158 -0
  60. robosystems_client/models/payment_method.py +158 -0
  61. robosystems_client/models/repository_subscriptions.py +15 -4
  62. robosystems_client/models/service_offerings_response.py +15 -0
  63. robosystems_client/models/upcoming_invoice.py +128 -0
  64. robosystems_client/models/update_member_role_request.py +62 -0
  65. robosystems_client/models/update_org_request.py +103 -0
  66. robosystems_client/models/update_payment_method_request.py +60 -0
  67. robosystems_client/models/update_payment_method_response.py +74 -0
  68. {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.12.dist-info}/METADATA +1 -1
  69. {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.12.dist-info}/RECORD +71 -17
  70. robosystems_client/models/user_limits_response.py +0 -95
  71. robosystems_client/models/user_usage_response.py +0 -90
  72. {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.12.dist-info}/WHEEL +0 -0
  73. {robosystems_client-0.2.10.dist-info → robosystems_client-0.2.12.dist-info}/licenses/LICENSE +0 -0
@@ -5,14 +5,14 @@ import httpx
5
5
 
6
6
  from ... import errors
7
7
  from ...client import AuthenticatedClient, Client
8
- from ...models.user_usage_response import UserUsageResponse
8
+ from ...models.org_list_response import OrgListResponse
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/user/limits",
15
+ "url": "/v1/orgs",
16
16
  }
17
17
 
18
18
  return _kwargs
@@ -20,9 +20,9 @@ def _get_kwargs() -> dict[str, Any]:
20
20
 
21
21
  def _parse_response(
22
22
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
23
- ) -> Optional[UserUsageResponse]:
23
+ ) -> Optional[OrgListResponse]:
24
24
  if response.status_code == 200:
25
- response_200 = UserUsageResponse.from_dict(response.json())
25
+ response_200 = OrgListResponse.from_dict(response.json())
26
26
 
27
27
  return response_200
28
28
 
@@ -34,7 +34,7 @@ def _parse_response(
34
34
 
35
35
  def _build_response(
36
36
  *, client: Union[AuthenticatedClient, Client], response: httpx.Response
37
- ) -> Response[UserUsageResponse]:
37
+ ) -> Response[OrgListResponse]:
38
38
  return Response(
39
39
  status_code=HTTPStatus(response.status_code),
40
40
  content=response.content,
@@ -46,18 +46,17 @@ def _build_response(
46
46
  def sync_detailed(
47
47
  *,
48
48
  client: AuthenticatedClient,
49
- ) -> Response[UserUsageResponse]:
50
- """Get user limits and usage
49
+ ) -> Response[OrgListResponse]:
50
+ """List User's Organizations
51
51
 
52
- Retrieve current limits and usage statistics for the authenticated user (simple safety valve for
53
- graph creation)
52
+ Get all organizations the current user belongs to, with their role in each.
54
53
 
55
54
  Raises:
56
55
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
57
56
  httpx.TimeoutException: If the request takes longer than Client.timeout.
58
57
 
59
58
  Returns:
60
- Response[UserUsageResponse]
59
+ Response[OrgListResponse]
61
60
  """
62
61
 
63
62
  kwargs = _get_kwargs()
@@ -72,18 +71,17 @@ def sync_detailed(
72
71
  def sync(
73
72
  *,
74
73
  client: AuthenticatedClient,
75
- ) -> Optional[UserUsageResponse]:
76
- """Get user limits and usage
74
+ ) -> Optional[OrgListResponse]:
75
+ """List User's Organizations
77
76
 
78
- Retrieve current limits and usage statistics for the authenticated user (simple safety valve for
79
- graph creation)
77
+ Get all organizations the current user belongs to, with their role in each.
80
78
 
81
79
  Raises:
82
80
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
83
81
  httpx.TimeoutException: If the request takes longer than Client.timeout.
84
82
 
85
83
  Returns:
86
- UserUsageResponse
84
+ OrgListResponse
87
85
  """
88
86
 
89
87
  return sync_detailed(
@@ -94,18 +92,17 @@ def sync(
94
92
  async def asyncio_detailed(
95
93
  *,
96
94
  client: AuthenticatedClient,
97
- ) -> Response[UserUsageResponse]:
98
- """Get user limits and usage
95
+ ) -> Response[OrgListResponse]:
96
+ """List User's Organizations
99
97
 
100
- Retrieve current limits and usage statistics for the authenticated user (simple safety valve for
101
- graph creation)
98
+ Get all organizations the current user belongs to, with their role in each.
102
99
 
103
100
  Raises:
104
101
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
105
102
  httpx.TimeoutException: If the request takes longer than Client.timeout.
106
103
 
107
104
  Returns:
108
- Response[UserUsageResponse]
105
+ Response[OrgListResponse]
109
106
  """
110
107
 
111
108
  kwargs = _get_kwargs()
@@ -118,18 +115,17 @@ async def asyncio_detailed(
118
115
  async def asyncio(
119
116
  *,
120
117
  client: AuthenticatedClient,
121
- ) -> Optional[UserUsageResponse]:
122
- """Get user limits and usage
118
+ ) -> Optional[OrgListResponse]:
119
+ """List User's Organizations
123
120
 
124
- Retrieve current limits and usage statistics for the authenticated user (simple safety valve for
125
- graph creation)
121
+ Get all organizations the current user belongs to, with their role in each.
126
122
 
127
123
  Raises:
128
124
  errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
129
125
  httpx.TimeoutException: If the request takes longer than Client.timeout.
130
126
 
131
127
  Returns:
132
- UserUsageResponse
128
+ OrgListResponse
133
129
  """
134
130
 
135
131
  return (
@@ -0,0 +1,187 @@
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 ...models.update_org_request import UpdateOrgRequest
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ org_id: str,
16
+ *,
17
+ body: UpdateOrgRequest,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "put",
23
+ "url": f"/v1/orgs/{org_id}",
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, OrgDetailResponse]]:
37
+ if response.status_code == 200:
38
+ response_200 = OrgDetailResponse.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, OrgDetailResponse]]:
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: UpdateOrgRequest,
69
+ ) -> Response[Union[HTTPValidationError, OrgDetailResponse]]:
70
+ """Update Organization
71
+
72
+ Update organization information. Requires admin or owner role.
73
+
74
+ Args:
75
+ org_id (str):
76
+ body (UpdateOrgRequest): Request to update organization details.
77
+
78
+ Raises:
79
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
80
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
81
+
82
+ Returns:
83
+ Response[Union[HTTPValidationError, OrgDetailResponse]]
84
+ """
85
+
86
+ kwargs = _get_kwargs(
87
+ org_id=org_id,
88
+ body=body,
89
+ )
90
+
91
+ response = client.get_httpx_client().request(
92
+ **kwargs,
93
+ )
94
+
95
+ return _build_response(client=client, response=response)
96
+
97
+
98
+ def sync(
99
+ org_id: str,
100
+ *,
101
+ client: AuthenticatedClient,
102
+ body: UpdateOrgRequest,
103
+ ) -> Optional[Union[HTTPValidationError, OrgDetailResponse]]:
104
+ """Update Organization
105
+
106
+ Update organization information. Requires admin or owner role.
107
+
108
+ Args:
109
+ org_id (str):
110
+ body (UpdateOrgRequest): Request to update organization details.
111
+
112
+ Raises:
113
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
114
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
115
+
116
+ Returns:
117
+ Union[HTTPValidationError, OrgDetailResponse]
118
+ """
119
+
120
+ return sync_detailed(
121
+ org_id=org_id,
122
+ client=client,
123
+ body=body,
124
+ ).parsed
125
+
126
+
127
+ async def asyncio_detailed(
128
+ org_id: str,
129
+ *,
130
+ client: AuthenticatedClient,
131
+ body: UpdateOrgRequest,
132
+ ) -> Response[Union[HTTPValidationError, OrgDetailResponse]]:
133
+ """Update Organization
134
+
135
+ Update organization information. Requires admin or owner role.
136
+
137
+ Args:
138
+ org_id (str):
139
+ body (UpdateOrgRequest): Request to update organization details.
140
+
141
+ Raises:
142
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
143
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
144
+
145
+ Returns:
146
+ Response[Union[HTTPValidationError, OrgDetailResponse]]
147
+ """
148
+
149
+ kwargs = _get_kwargs(
150
+ org_id=org_id,
151
+ body=body,
152
+ )
153
+
154
+ response = await client.get_async_httpx_client().request(**kwargs)
155
+
156
+ return _build_response(client=client, response=response)
157
+
158
+
159
+ async def asyncio(
160
+ org_id: str,
161
+ *,
162
+ client: AuthenticatedClient,
163
+ body: UpdateOrgRequest,
164
+ ) -> Optional[Union[HTTPValidationError, OrgDetailResponse]]:
165
+ """Update Organization
166
+
167
+ Update organization information. Requires admin or owner role.
168
+
169
+ Args:
170
+ org_id (str):
171
+ body (UpdateOrgRequest): Request to update organization details.
172
+
173
+ Raises:
174
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
175
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
176
+
177
+ Returns:
178
+ Union[HTTPValidationError, OrgDetailResponse]
179
+ """
180
+
181
+ return (
182
+ await asyncio_detailed(
183
+ org_id=org_id,
184
+ client=client,
185
+ body=body,
186
+ )
187
+ ).parsed
@@ -0,0 +1 @@
1
+ """Contains endpoint functions for accessing the API"""
@@ -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.invite_member_request import InviteMemberRequest
10
+ from ...models.org_member_response import OrgMemberResponse
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ org_id: str,
16
+ *,
17
+ body: InviteMemberRequest,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "post",
23
+ "url": f"/v1/orgs/{org_id}/members",
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, OrgMemberResponse]]:
37
+ if response.status_code == 201:
38
+ response_201 = OrgMemberResponse.from_dict(response.json())
39
+
40
+ return response_201
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, OrgMemberResponse]]:
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: InviteMemberRequest,
69
+ ) -> Response[Union[HTTPValidationError, OrgMemberResponse]]:
70
+ """Invite Member
71
+
72
+ Invite a user to join the organization. Requires admin or owner role.
73
+
74
+ **⚠️ FEATURE NOT READY**: This endpoint is disabled by default
75
+ (ORG_MEMBER_INVITATIONS_ENABLED=false).
76
+ Returns 501 NOT IMPLEMENTED when disabled. See endpoint implementation for TODO list before
77
+ enabling.
78
+
79
+ Args:
80
+ org_id (str):
81
+ body (InviteMemberRequest): Request to invite a member to an organization.
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, OrgMemberResponse]]
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: InviteMemberRequest,
108
+ ) -> Optional[Union[HTTPValidationError, OrgMemberResponse]]:
109
+ """Invite Member
110
+
111
+ Invite a user to join the organization. Requires admin or owner role.
112
+
113
+ **⚠️ FEATURE NOT READY**: This endpoint is disabled by default
114
+ (ORG_MEMBER_INVITATIONS_ENABLED=false).
115
+ Returns 501 NOT IMPLEMENTED when disabled. See endpoint implementation for TODO list before
116
+ enabling.
117
+
118
+ Args:
119
+ org_id (str):
120
+ body (InviteMemberRequest): Request to invite a member to an organization.
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, OrgMemberResponse]
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: InviteMemberRequest,
142
+ ) -> Response[Union[HTTPValidationError, OrgMemberResponse]]:
143
+ """Invite Member
144
+
145
+ Invite a user to join the organization. Requires admin or owner role.
146
+
147
+ **⚠️ FEATURE NOT READY**: This endpoint is disabled by default
148
+ (ORG_MEMBER_INVITATIONS_ENABLED=false).
149
+ Returns 501 NOT IMPLEMENTED when disabled. See endpoint implementation for TODO list before
150
+ enabling.
151
+
152
+ Args:
153
+ org_id (str):
154
+ body (InviteMemberRequest): Request to invite a member to an organization.
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, OrgMemberResponse]]
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: InviteMemberRequest,
179
+ ) -> Optional[Union[HTTPValidationError, OrgMemberResponse]]:
180
+ """Invite Member
181
+
182
+ Invite a user to join the organization. Requires admin or owner role.
183
+
184
+ **⚠️ FEATURE NOT READY**: This endpoint is disabled by default
185
+ (ORG_MEMBER_INVITATIONS_ENABLED=false).
186
+ Returns 501 NOT IMPLEMENTED when disabled. See endpoint implementation for TODO list before
187
+ enabling.
188
+
189
+ Args:
190
+ org_id (str):
191
+ body (InviteMemberRequest): Request to invite a member to an organization.
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, OrgMemberResponse]
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,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_member_list_response import OrgMemberListResponse
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}/members",
19
+ }
20
+
21
+ return _kwargs
22
+
23
+
24
+ def _parse_response(
25
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
26
+ ) -> Optional[Union[HTTPValidationError, OrgMemberListResponse]]:
27
+ if response.status_code == 200:
28
+ response_200 = OrgMemberListResponse.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, OrgMemberListResponse]]:
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, OrgMemberListResponse]]:
59
+ """List Organization Members
60
+
61
+ Get all members of an organization with their roles.
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, OrgMemberListResponse]]
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, OrgMemberListResponse]]:
90
+ """List Organization Members
91
+
92
+ Get all members of an organization with their roles.
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, OrgMemberListResponse]
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, OrgMemberListResponse]]:
116
+ """List Organization Members
117
+
118
+ Get all members of an organization with their roles.
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, OrgMemberListResponse]]
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, OrgMemberListResponse]]:
145
+ """List Organization Members
146
+
147
+ Get all members of an organization with their roles.
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, OrgMemberListResponse]
158
+ """
159
+
160
+ return (
161
+ await asyncio_detailed(
162
+ org_id=org_id,
163
+ client=client,
164
+ )
165
+ ).parsed