alchemy-python 0.1.0__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.
Files changed (172) hide show
  1. alchemy/.fern/metadata.json +18 -0
  2. alchemy/CONTRIBUTING.md +125 -0
  3. alchemy/__init__.py +380 -0
  4. alchemy/_default_clients.py +30 -0
  5. alchemy/auth/__init__.py +4 -0
  6. alchemy/auth/client.py +767 -0
  7. alchemy/auth/raw_client.py +866 -0
  8. alchemy/client.py +717 -0
  9. alchemy/core/__init__.py +127 -0
  10. alchemy/core/api_error.py +23 -0
  11. alchemy/core/client_wrapper.py +155 -0
  12. alchemy/core/datetime_utils.py +70 -0
  13. alchemy/core/file.py +67 -0
  14. alchemy/core/force_multipart.py +18 -0
  15. alchemy/core/http_client.py +940 -0
  16. alchemy/core/http_response.py +63 -0
  17. alchemy/core/http_sse/__init__.py +42 -0
  18. alchemy/core/http_sse/_api.py +455 -0
  19. alchemy/core/http_sse/_decoders.py +74 -0
  20. alchemy/core/http_sse/_exceptions.py +7 -0
  21. alchemy/core/http_sse/_models.py +17 -0
  22. alchemy/core/jsonable_encoder.py +133 -0
  23. alchemy/core/logging.py +107 -0
  24. alchemy/core/oauth_token_provider.py +73 -0
  25. alchemy/core/parse_error.py +36 -0
  26. alchemy/core/pydantic_utilities.py +486 -0
  27. alchemy/core/query_encoder.py +58 -0
  28. alchemy/core/remove_none_from_dict.py +11 -0
  29. alchemy/core/request_options.py +40 -0
  30. alchemy/core/serialization.py +347 -0
  31. alchemy/environment.py +7 -0
  32. alchemy/function/__init__.py +34 -0
  33. alchemy/function/client.py +808 -0
  34. alchemy/function/raw_client.py +903 -0
  35. alchemy/function/version/__init__.py +4 -0
  36. alchemy/function/version/client.py +364 -0
  37. alchemy/function/version/raw_client.py +410 -0
  38. alchemy/host/__init__.py +4 -0
  39. alchemy/host/client.py +227 -0
  40. alchemy/host/raw_client.py +242 -0
  41. alchemy/instance/__init__.py +4 -0
  42. alchemy/instance/client.py +136 -0
  43. alchemy/instance/raw_client.py +141 -0
  44. alchemy/invocation/__init__.py +4 -0
  45. alchemy/invocation/client.py +570 -0
  46. alchemy/invocation/raw_client.py +636 -0
  47. alchemy/member/__init__.py +4 -0
  48. alchemy/member/client.py +441 -0
  49. alchemy/member/raw_client.py +504 -0
  50. alchemy/metrics/__init__.py +4 -0
  51. alchemy/metrics/client.py +428 -0
  52. alchemy/metrics/raw_client.py +478 -0
  53. alchemy/py.typed +0 -0
  54. alchemy/raw_client.py +138 -0
  55. alchemy/reference.md +3300 -0
  56. alchemy/runtime/__init__.py +4 -0
  57. alchemy/runtime/client.py +141 -0
  58. alchemy/runtime/raw_client.py +140 -0
  59. alchemy/service_account/__init__.py +4 -0
  60. alchemy/service_account/client.py +429 -0
  61. alchemy/service_account/raw_client.py +490 -0
  62. alchemy/template/__init__.py +4 -0
  63. alchemy/template/client.py +141 -0
  64. alchemy/template/raw_client.py +140 -0
  65. alchemy/types/__init__.py +344 -0
  66. alchemy/types/auth_v1accept_invite_response.py +5 -0
  67. alchemy/types/auth_v1create_service_account_response.py +34 -0
  68. alchemy/types/auth_v1get_auth_config_request.py +5 -0
  69. alchemy/types/auth_v1get_auth_config_response.py +53 -0
  70. alchemy/types/auth_v1get_session_request.py +9 -0
  71. alchemy/types/auth_v1get_session_response.py +28 -0
  72. alchemy/types/auth_v1get_token_response.py +29 -0
  73. alchemy/types/auth_v1invite_member_response.py +29 -0
  74. alchemy/types/auth_v1list_members_request.py +5 -0
  75. alchemy/types/auth_v1list_members_response.py +34 -0
  76. alchemy/types/auth_v1list_service_accounts_request.py +5 -0
  77. alchemy/types/auth_v1list_service_accounts_response.py +29 -0
  78. alchemy/types/auth_v1login_response.py +5 -0
  79. alchemy/types/auth_v1logout_request.py +8 -0
  80. alchemy/types/auth_v1logout_response.py +5 -0
  81. alchemy/types/auth_v1member.py +31 -0
  82. alchemy/types/auth_v1register_response.py +23 -0
  83. alchemy/types/auth_v1remove_member_response.py +5 -0
  84. alchemy/types/auth_v1remove_service_account_response.py +5 -0
  85. alchemy/types/auth_v1role.py +5 -0
  86. alchemy/types/auth_v1rotate_service_account_secret_response.py +31 -0
  87. alchemy/types/auth_v1service_account.py +35 -0
  88. alchemy/types/auth_v1set_member_role_response.py +5 -0
  89. alchemy/types/connect_error.py +38 -0
  90. alchemy/types/connect_error_code.py +25 -0
  91. alchemy/types/connect_error_details_any.py +36 -0
  92. alchemy/types/connect_protocol_version.py +5 -0
  93. alchemy/types/connect_timeout_header.py +6 -0
  94. alchemy/types/functions_v1arrow_contract.py +50 -0
  95. alchemy/types/functions_v1contract.py +8 -0
  96. alchemy/types/functions_v1contract_arrow.py +20 -0
  97. alchemy/types/functions_v1contract_json_schema.py +26 -0
  98. alchemy/types/functions_v1contract_violation.py +32 -0
  99. alchemy/types/functions_v1create_function_response.py +22 -0
  100. alchemy/types/functions_v1create_function_version_response.py +20 -0
  101. alchemy/types/functions_v1delete_function_response.py +5 -0
  102. alchemy/types/functions_v1function.py +100 -0
  103. alchemy/types/functions_v1function_error.py +30 -0
  104. alchemy/types/functions_v1function_error_kind.py +15 -0
  105. alchemy/types/functions_v1function_spec.py +58 -0
  106. alchemy/types/functions_v1function_version.py +81 -0
  107. alchemy/types/functions_v1function_version_status.py +13 -0
  108. alchemy/types/functions_v1get_function_response.py +20 -0
  109. alchemy/types/functions_v1get_function_version_response.py +20 -0
  110. alchemy/types/functions_v1get_host_request.py +5 -0
  111. alchemy/types/functions_v1get_host_response.py +20 -0
  112. alchemy/types/functions_v1get_invocation_logs_request.py +31 -0
  113. alchemy/types/functions_v1get_invocation_logs_response.py +24 -0
  114. alchemy/types/functions_v1get_invocation_response.py +20 -0
  115. alchemy/types/functions_v1get_version_request.py +5 -0
  116. alchemy/types/functions_v1get_version_response.py +25 -0
  117. alchemy/types/functions_v1host.py +58 -0
  118. alchemy/types/functions_v1instance.py +54 -0
  119. alchemy/types/functions_v1instance_status.py +14 -0
  120. alchemy/types/functions_v1invocation.py +106 -0
  121. alchemy/types/functions_v1invocation_protocol.py +8 -0
  122. alchemy/types/functions_v1invocation_stats.py +41 -0
  123. alchemy/types/functions_v1invocation_status.py +18 -0
  124. alchemy/types/functions_v1invoke_async_response.py +34 -0
  125. alchemy/types/functions_v1invoke_response.py +8 -0
  126. alchemy/types/functions_v1invoke_response_error.py +20 -0
  127. alchemy/types/functions_v1invoke_response_output.py +19 -0
  128. alchemy/types/functions_v1json_schema_contract.py +28 -0
  129. alchemy/types/functions_v1list_function_versions_response.py +22 -0
  130. alchemy/types/functions_v1list_functions_response.py +22 -0
  131. alchemy/types/functions_v1list_hosts_request.py +5 -0
  132. alchemy/types/functions_v1list_hosts_response.py +23 -0
  133. alchemy/types/functions_v1list_instances_response.py +20 -0
  134. alchemy/types/functions_v1list_invocations_response.py +22 -0
  135. alchemy/types/functions_v1list_runtimes_request.py +5 -0
  136. alchemy/types/functions_v1list_runtimes_response.py +22 -0
  137. alchemy/types/functions_v1list_templates_request.py +5 -0
  138. alchemy/types/functions_v1list_templates_response.py +20 -0
  139. alchemy/types/functions_v1network.py +5 -0
  140. alchemy/types/functions_v1pagination_request.py +31 -0
  141. alchemy/types/functions_v1pagination_response.py +33 -0
  142. alchemy/types/functions_v1resources.py +28 -0
  143. alchemy/types/functions_v1runtime.py +59 -0
  144. alchemy/types/functions_v1runtime_starters.py +29 -0
  145. alchemy/types/functions_v1source.py +31 -0
  146. alchemy/types/functions_v1source_file.py +28 -0
  147. alchemy/types/functions_v1source_layer.py +27 -0
  148. alchemy/types/functions_v1source_limits.py +30 -0
  149. alchemy/types/functions_v1start_kind.py +8 -0
  150. alchemy/types/functions_v1tail_invocations_request.py +32 -0
  151. alchemy/types/functions_v1tail_invocations_response.py +34 -0
  152. alchemy/types/functions_v1template.py +94 -0
  153. alchemy/types/functions_v1template_source.py +27 -0
  154. alchemy/types/functions_v1update_function_response.py +20 -0
  155. alchemy/types/google_protobuf_list_value.py +10 -0
  156. alchemy/types/google_protobuf_null_value.py +5 -0
  157. alchemy/types/google_protobuf_struct.py +10 -0
  158. alchemy/types/google_protobuf_value.py +5 -0
  159. alchemy/types/metrics_v1aggregate_row.py +24 -0
  160. alchemy/types/metrics_v1get_queue_response.py +25 -0
  161. alchemy/types/metrics_v1metric.py +16 -0
  162. alchemy/types/metrics_v1metric_dimension.py +14 -0
  163. alchemy/types/metrics_v1metric_filter.py +26 -0
  164. alchemy/types/metrics_v1metric_granularity.py +13 -0
  165. alchemy/types/metrics_v1query_aggregate_response.py +20 -0
  166. alchemy/types/metrics_v1query_timeseries_response.py +20 -0
  167. alchemy/types/metrics_v1timeseries.py +28 -0
  168. alchemy/types/metrics_v1timeseries_point.py +28 -0
  169. alchemy_python-0.1.0.dist-info/METADATA +196 -0
  170. alchemy_python-0.1.0.dist-info/RECORD +172 -0
  171. alchemy_python-0.1.0.dist-info/WHEEL +4 -0
  172. alchemy_python-0.1.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,504 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ import typing
4
+ from json.decoder import JSONDecodeError
5
+
6
+ from ..core.api_error import ApiError
7
+ from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
+ from ..core.http_response import AsyncHttpResponse, HttpResponse
9
+ from ..core.parse_error import ParsingError
10
+ from ..core.pydantic_utilities import parse_obj_as
11
+ from ..core.request_options import RequestOptions
12
+ from ..types.auth_v1invite_member_response import AuthV1InviteMemberResponse
13
+ from ..types.auth_v1list_members_request import AuthV1ListMembersRequest
14
+ from ..types.auth_v1list_members_response import AuthV1ListMembersResponse
15
+ from ..types.auth_v1remove_member_response import AuthV1RemoveMemberResponse
16
+ from ..types.auth_v1role import AuthV1Role
17
+ from ..types.auth_v1set_member_role_response import AuthV1SetMemberRoleResponse
18
+ from ..types.connect_timeout_header import ConnectTimeoutHeader
19
+ from pydantic import ValidationError
20
+
21
+ # this is used as the default value for optional parameters
22
+ OMIT = typing.cast(typing.Any, ...)
23
+
24
+
25
+ class RawMemberClient:
26
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
27
+ self._client_wrapper = client_wrapper
28
+
29
+ def invite(
30
+ self,
31
+ *,
32
+ connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
33
+ email: typing.Optional[str] = OMIT,
34
+ given_name: typing.Optional[str] = OMIT,
35
+ family_name: typing.Optional[str] = OMIT,
36
+ role: typing.Optional[AuthV1Role] = OMIT,
37
+ request_options: typing.Optional[RequestOptions] = None,
38
+ ) -> HttpResponse[AuthV1InviteMemberResponse]:
39
+ """
40
+ Parameters
41
+ ----------
42
+ connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
43
+ Define the timeout, in ms
44
+
45
+ email : typing.Optional[str]
46
+
47
+ given_name : typing.Optional[str]
48
+
49
+ family_name : typing.Optional[str]
50
+
51
+ role : typing.Optional[AuthV1Role]
52
+
53
+ request_options : typing.Optional[RequestOptions]
54
+ Request-specific configuration.
55
+
56
+ Returns
57
+ -------
58
+ HttpResponse[AuthV1InviteMemberResponse]
59
+ Success
60
+ """
61
+ _response = self._client_wrapper.httpx_client.request(
62
+ "auth.v1.AuthService/InviteMember",
63
+ method="POST",
64
+ json={
65
+ "email": email,
66
+ "givenName": given_name,
67
+ "familyName": family_name,
68
+ "role": role,
69
+ },
70
+ headers={
71
+ "content-type": "application/json",
72
+ "Connect-Timeout-Ms": str(connect_timeout_ms) if connect_timeout_ms is not None else None,
73
+ },
74
+ request_options=request_options,
75
+ omit=OMIT,
76
+ )
77
+ try:
78
+ if 200 <= _response.status_code < 300:
79
+ _data = typing.cast(
80
+ AuthV1InviteMemberResponse,
81
+ parse_obj_as(
82
+ type_=AuthV1InviteMemberResponse, # type: ignore
83
+ object_=_response.json(),
84
+ ),
85
+ )
86
+ return HttpResponse(response=_response, data=_data)
87
+ _response_json = _response.json()
88
+ except JSONDecodeError:
89
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
90
+ except ValidationError as e:
91
+ raise ParsingError(
92
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
93
+ )
94
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
95
+
96
+ def list(
97
+ self,
98
+ *,
99
+ request: AuthV1ListMembersRequest,
100
+ connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
101
+ request_options: typing.Optional[RequestOptions] = None,
102
+ ) -> HttpResponse[AuthV1ListMembersResponse]:
103
+ """
104
+ Members; authenticated tenant administration.
105
+
106
+ Parameters
107
+ ----------
108
+ request : AuthV1ListMembersRequest
109
+
110
+ connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
111
+ Define the timeout, in ms
112
+
113
+ request_options : typing.Optional[RequestOptions]
114
+ Request-specific configuration.
115
+
116
+ Returns
117
+ -------
118
+ HttpResponse[AuthV1ListMembersResponse]
119
+ Success
120
+ """
121
+ _response = self._client_wrapper.httpx_client.request(
122
+ "auth.v1.AuthService/ListMembers",
123
+ method="POST",
124
+ json=request,
125
+ headers={
126
+ "content-type": "application/json",
127
+ "Connect-Timeout-Ms": str(connect_timeout_ms) if connect_timeout_ms is not None else None,
128
+ },
129
+ request_options=request_options,
130
+ omit=OMIT,
131
+ )
132
+ try:
133
+ if 200 <= _response.status_code < 300:
134
+ _data = typing.cast(
135
+ AuthV1ListMembersResponse,
136
+ parse_obj_as(
137
+ type_=AuthV1ListMembersResponse, # type: ignore
138
+ object_=_response.json(),
139
+ ),
140
+ )
141
+ return HttpResponse(response=_response, data=_data)
142
+ _response_json = _response.json()
143
+ except JSONDecodeError:
144
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
145
+ except ValidationError as e:
146
+ raise ParsingError(
147
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
148
+ )
149
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
150
+
151
+ def remove(
152
+ self,
153
+ *,
154
+ connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
155
+ user_id: typing.Optional[str] = OMIT,
156
+ request_options: typing.Optional[RequestOptions] = None,
157
+ ) -> HttpResponse[AuthV1RemoveMemberResponse]:
158
+ """
159
+ Parameters
160
+ ----------
161
+ connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
162
+ Define the timeout, in ms
163
+
164
+ user_id : typing.Optional[str]
165
+
166
+ request_options : typing.Optional[RequestOptions]
167
+ Request-specific configuration.
168
+
169
+ Returns
170
+ -------
171
+ HttpResponse[AuthV1RemoveMemberResponse]
172
+ Success
173
+ """
174
+ _response = self._client_wrapper.httpx_client.request(
175
+ "auth.v1.AuthService/RemoveMember",
176
+ method="POST",
177
+ json={
178
+ "userId": user_id,
179
+ },
180
+ headers={
181
+ "content-type": "application/json",
182
+ "Connect-Timeout-Ms": str(connect_timeout_ms) if connect_timeout_ms is not None else None,
183
+ },
184
+ request_options=request_options,
185
+ omit=OMIT,
186
+ )
187
+ try:
188
+ if 200 <= _response.status_code < 300:
189
+ _data = typing.cast(
190
+ AuthV1RemoveMemberResponse,
191
+ parse_obj_as(
192
+ type_=AuthV1RemoveMemberResponse, # type: ignore
193
+ object_=_response.json(),
194
+ ),
195
+ )
196
+ return HttpResponse(response=_response, data=_data)
197
+ _response_json = _response.json()
198
+ except JSONDecodeError:
199
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
200
+ except ValidationError as e:
201
+ raise ParsingError(
202
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
203
+ )
204
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
205
+
206
+ def set_role(
207
+ self,
208
+ *,
209
+ connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
210
+ user_id: typing.Optional[str] = OMIT,
211
+ role: typing.Optional[AuthV1Role] = OMIT,
212
+ request_options: typing.Optional[RequestOptions] = None,
213
+ ) -> HttpResponse[AuthV1SetMemberRoleResponse]:
214
+ """
215
+ Parameters
216
+ ----------
217
+ connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
218
+ Define the timeout, in ms
219
+
220
+ user_id : typing.Optional[str]
221
+
222
+ role : typing.Optional[AuthV1Role]
223
+
224
+ request_options : typing.Optional[RequestOptions]
225
+ Request-specific configuration.
226
+
227
+ Returns
228
+ -------
229
+ HttpResponse[AuthV1SetMemberRoleResponse]
230
+ Success
231
+ """
232
+ _response = self._client_wrapper.httpx_client.request(
233
+ "auth.v1.AuthService/SetMemberRole",
234
+ method="POST",
235
+ json={
236
+ "userId": user_id,
237
+ "role": role,
238
+ },
239
+ headers={
240
+ "content-type": "application/json",
241
+ "Connect-Timeout-Ms": str(connect_timeout_ms) if connect_timeout_ms is not None else None,
242
+ },
243
+ request_options=request_options,
244
+ omit=OMIT,
245
+ )
246
+ try:
247
+ if 200 <= _response.status_code < 300:
248
+ _data = typing.cast(
249
+ AuthV1SetMemberRoleResponse,
250
+ parse_obj_as(
251
+ type_=AuthV1SetMemberRoleResponse, # type: ignore
252
+ object_=_response.json(),
253
+ ),
254
+ )
255
+ return HttpResponse(response=_response, data=_data)
256
+ _response_json = _response.json()
257
+ except JSONDecodeError:
258
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
259
+ except ValidationError as e:
260
+ raise ParsingError(
261
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
262
+ )
263
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
264
+
265
+
266
+ class AsyncRawMemberClient:
267
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
268
+ self._client_wrapper = client_wrapper
269
+
270
+ async def invite(
271
+ self,
272
+ *,
273
+ connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
274
+ email: typing.Optional[str] = OMIT,
275
+ given_name: typing.Optional[str] = OMIT,
276
+ family_name: typing.Optional[str] = OMIT,
277
+ role: typing.Optional[AuthV1Role] = OMIT,
278
+ request_options: typing.Optional[RequestOptions] = None,
279
+ ) -> AsyncHttpResponse[AuthV1InviteMemberResponse]:
280
+ """
281
+ Parameters
282
+ ----------
283
+ connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
284
+ Define the timeout, in ms
285
+
286
+ email : typing.Optional[str]
287
+
288
+ given_name : typing.Optional[str]
289
+
290
+ family_name : typing.Optional[str]
291
+
292
+ role : typing.Optional[AuthV1Role]
293
+
294
+ request_options : typing.Optional[RequestOptions]
295
+ Request-specific configuration.
296
+
297
+ Returns
298
+ -------
299
+ AsyncHttpResponse[AuthV1InviteMemberResponse]
300
+ Success
301
+ """
302
+ _response = await self._client_wrapper.httpx_client.request(
303
+ "auth.v1.AuthService/InviteMember",
304
+ method="POST",
305
+ json={
306
+ "email": email,
307
+ "givenName": given_name,
308
+ "familyName": family_name,
309
+ "role": role,
310
+ },
311
+ headers={
312
+ "content-type": "application/json",
313
+ "Connect-Timeout-Ms": str(connect_timeout_ms) if connect_timeout_ms is not None else None,
314
+ },
315
+ request_options=request_options,
316
+ omit=OMIT,
317
+ )
318
+ try:
319
+ if 200 <= _response.status_code < 300:
320
+ _data = typing.cast(
321
+ AuthV1InviteMemberResponse,
322
+ parse_obj_as(
323
+ type_=AuthV1InviteMemberResponse, # type: ignore
324
+ object_=_response.json(),
325
+ ),
326
+ )
327
+ return AsyncHttpResponse(response=_response, data=_data)
328
+ _response_json = _response.json()
329
+ except JSONDecodeError:
330
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
331
+ except ValidationError as e:
332
+ raise ParsingError(
333
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
334
+ )
335
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
336
+
337
+ async def list(
338
+ self,
339
+ *,
340
+ request: AuthV1ListMembersRequest,
341
+ connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
342
+ request_options: typing.Optional[RequestOptions] = None,
343
+ ) -> AsyncHttpResponse[AuthV1ListMembersResponse]:
344
+ """
345
+ Members; authenticated tenant administration.
346
+
347
+ Parameters
348
+ ----------
349
+ request : AuthV1ListMembersRequest
350
+
351
+ connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
352
+ Define the timeout, in ms
353
+
354
+ request_options : typing.Optional[RequestOptions]
355
+ Request-specific configuration.
356
+
357
+ Returns
358
+ -------
359
+ AsyncHttpResponse[AuthV1ListMembersResponse]
360
+ Success
361
+ """
362
+ _response = await self._client_wrapper.httpx_client.request(
363
+ "auth.v1.AuthService/ListMembers",
364
+ method="POST",
365
+ json=request,
366
+ headers={
367
+ "content-type": "application/json",
368
+ "Connect-Timeout-Ms": str(connect_timeout_ms) if connect_timeout_ms is not None else None,
369
+ },
370
+ request_options=request_options,
371
+ omit=OMIT,
372
+ )
373
+ try:
374
+ if 200 <= _response.status_code < 300:
375
+ _data = typing.cast(
376
+ AuthV1ListMembersResponse,
377
+ parse_obj_as(
378
+ type_=AuthV1ListMembersResponse, # type: ignore
379
+ object_=_response.json(),
380
+ ),
381
+ )
382
+ return AsyncHttpResponse(response=_response, data=_data)
383
+ _response_json = _response.json()
384
+ except JSONDecodeError:
385
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
386
+ except ValidationError as e:
387
+ raise ParsingError(
388
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
389
+ )
390
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
391
+
392
+ async def remove(
393
+ self,
394
+ *,
395
+ connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
396
+ user_id: typing.Optional[str] = OMIT,
397
+ request_options: typing.Optional[RequestOptions] = None,
398
+ ) -> AsyncHttpResponse[AuthV1RemoveMemberResponse]:
399
+ """
400
+ Parameters
401
+ ----------
402
+ connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
403
+ Define the timeout, in ms
404
+
405
+ user_id : typing.Optional[str]
406
+
407
+ request_options : typing.Optional[RequestOptions]
408
+ Request-specific configuration.
409
+
410
+ Returns
411
+ -------
412
+ AsyncHttpResponse[AuthV1RemoveMemberResponse]
413
+ Success
414
+ """
415
+ _response = await self._client_wrapper.httpx_client.request(
416
+ "auth.v1.AuthService/RemoveMember",
417
+ method="POST",
418
+ json={
419
+ "userId": user_id,
420
+ },
421
+ headers={
422
+ "content-type": "application/json",
423
+ "Connect-Timeout-Ms": str(connect_timeout_ms) if connect_timeout_ms is not None else None,
424
+ },
425
+ request_options=request_options,
426
+ omit=OMIT,
427
+ )
428
+ try:
429
+ if 200 <= _response.status_code < 300:
430
+ _data = typing.cast(
431
+ AuthV1RemoveMemberResponse,
432
+ parse_obj_as(
433
+ type_=AuthV1RemoveMemberResponse, # type: ignore
434
+ object_=_response.json(),
435
+ ),
436
+ )
437
+ return AsyncHttpResponse(response=_response, data=_data)
438
+ _response_json = _response.json()
439
+ except JSONDecodeError:
440
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
441
+ except ValidationError as e:
442
+ raise ParsingError(
443
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
444
+ )
445
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
446
+
447
+ async def set_role(
448
+ self,
449
+ *,
450
+ connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
451
+ user_id: typing.Optional[str] = OMIT,
452
+ role: typing.Optional[AuthV1Role] = OMIT,
453
+ request_options: typing.Optional[RequestOptions] = None,
454
+ ) -> AsyncHttpResponse[AuthV1SetMemberRoleResponse]:
455
+ """
456
+ Parameters
457
+ ----------
458
+ connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
459
+ Define the timeout, in ms
460
+
461
+ user_id : typing.Optional[str]
462
+
463
+ role : typing.Optional[AuthV1Role]
464
+
465
+ request_options : typing.Optional[RequestOptions]
466
+ Request-specific configuration.
467
+
468
+ Returns
469
+ -------
470
+ AsyncHttpResponse[AuthV1SetMemberRoleResponse]
471
+ Success
472
+ """
473
+ _response = await self._client_wrapper.httpx_client.request(
474
+ "auth.v1.AuthService/SetMemberRole",
475
+ method="POST",
476
+ json={
477
+ "userId": user_id,
478
+ "role": role,
479
+ },
480
+ headers={
481
+ "content-type": "application/json",
482
+ "Connect-Timeout-Ms": str(connect_timeout_ms) if connect_timeout_ms is not None else None,
483
+ },
484
+ request_options=request_options,
485
+ omit=OMIT,
486
+ )
487
+ try:
488
+ if 200 <= _response.status_code < 300:
489
+ _data = typing.cast(
490
+ AuthV1SetMemberRoleResponse,
491
+ parse_obj_as(
492
+ type_=AuthV1SetMemberRoleResponse, # type: ignore
493
+ object_=_response.json(),
494
+ ),
495
+ )
496
+ return AsyncHttpResponse(response=_response, data=_data)
497
+ _response_json = _response.json()
498
+ except JSONDecodeError:
499
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
500
+ except ValidationError as e:
501
+ raise ParsingError(
502
+ status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
503
+ )
504
+ raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
@@ -0,0 +1,4 @@
1
+ # This file was auto-generated by Fern from our API Definition.
2
+
3
+ # isort: skip_file
4
+