syllable-sdk 0.38.22__py3-none-any.whl → 0.40.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.
- syllable_sdk/_version.py +3 -3
- syllable_sdk/directory.py +1323 -0
- syllable_sdk/models/__init__.py +99 -0
- syllable_sdk/models/agentvoicedisplayname.py +32 -0
- syllable_sdk/models/agentvoicevarname.py +40 -0
- syllable_sdk/models/body_directory_member_bulk_load.py +44 -0
- syllable_sdk/models/directory_member_deleteop.py +16 -0
- syllable_sdk/models/directory_member_get_by_idop.py +16 -0
- syllable_sdk/models/directory_member_listop.py +140 -0
- syllable_sdk/models/directory_member_updateop.py +23 -0
- syllable_sdk/models/directoryextension.py +62 -0
- syllable_sdk/models/directorymember.py +103 -0
- syllable_sdk/models/directorymembercreate.py +96 -0
- syllable_sdk/models/directorymemberproperties.py +13 -0
- syllable_sdk/models/languagecode.py +3 -0
- syllable_sdk/models/listresponse_directorymember_.py +74 -0
- syllable_sdk/sdk.py +4 -0
- {syllable_sdk-0.38.22.dist-info → syllable_sdk-0.40.0.dist-info}/METADATA +11 -1
- {syllable_sdk-0.38.22.dist-info → syllable_sdk-0.40.0.dist-info}/RECORD +20 -9
- {syllable_sdk-0.38.22.dist-info → syllable_sdk-0.40.0.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,1323 @@
|
|
|
1
|
+
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
+
|
|
3
|
+
from .basesdk import BaseSDK
|
|
4
|
+
from syllable_sdk import errors, models, utils
|
|
5
|
+
from syllable_sdk._hooks import HookContext
|
|
6
|
+
from syllable_sdk.types import BaseModel, OptionalNullable, UNSET
|
|
7
|
+
from syllable_sdk.utils import get_security_from_env
|
|
8
|
+
from syllable_sdk.utils.unmarshal_json_response import unmarshal_json_response
|
|
9
|
+
from typing import Any, List, Mapping, Optional, Union, cast
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class Directory(BaseSDK):
|
|
13
|
+
r"""Operations related to directory"""
|
|
14
|
+
|
|
15
|
+
def list(
|
|
16
|
+
self,
|
|
17
|
+
*,
|
|
18
|
+
page: OptionalNullable[int] = UNSET,
|
|
19
|
+
limit: Optional[int] = 25,
|
|
20
|
+
search_fields: Optional[List[models.DirectoryMemberProperties]] = None,
|
|
21
|
+
search_field_values: Optional[List[str]] = None,
|
|
22
|
+
order_by: OptionalNullable[models.DirectoryMemberProperties] = UNSET,
|
|
23
|
+
order_by_direction: OptionalNullable[models.OrderByDirection] = UNSET,
|
|
24
|
+
fields: OptionalNullable[List[models.DirectoryMemberProperties]] = UNSET,
|
|
25
|
+
start_datetime: OptionalNullable[str] = UNSET,
|
|
26
|
+
end_datetime: OptionalNullable[str] = UNSET,
|
|
27
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
28
|
+
server_url: Optional[str] = None,
|
|
29
|
+
timeout_ms: Optional[int] = None,
|
|
30
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
31
|
+
) -> models.ListResponseDirectoryMember:
|
|
32
|
+
r"""Directory Member List
|
|
33
|
+
|
|
34
|
+
List the existing directory_members
|
|
35
|
+
|
|
36
|
+
:param page: The page number from which to start (0-based)
|
|
37
|
+
:param limit: The maximum number of items to return
|
|
38
|
+
:param search_fields: String names of fields to search. Correspond by index to search field values
|
|
39
|
+
:param search_field_values: Values of fields to search. Correspond by index to search fields. Unless field name contains \"list\", an individual search field value cannot be a list
|
|
40
|
+
:param order_by: The field whose value should be used to order the results
|
|
41
|
+
:param order_by_direction: The direction in which to order the results
|
|
42
|
+
:param fields: The fields to include in the response
|
|
43
|
+
:param start_datetime: The start datetime for filtering results
|
|
44
|
+
:param end_datetime: The end datetime for filtering results
|
|
45
|
+
:param retries: Override the default retry configuration for this method
|
|
46
|
+
:param server_url: Override the default server URL for this method
|
|
47
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
48
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
49
|
+
"""
|
|
50
|
+
base_url = None
|
|
51
|
+
url_variables = None
|
|
52
|
+
if timeout_ms is None:
|
|
53
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
54
|
+
|
|
55
|
+
if server_url is not None:
|
|
56
|
+
base_url = server_url
|
|
57
|
+
else:
|
|
58
|
+
base_url = self._get_url(base_url, url_variables)
|
|
59
|
+
|
|
60
|
+
request = models.DirectoryMemberListRequest(
|
|
61
|
+
page=page,
|
|
62
|
+
limit=limit,
|
|
63
|
+
search_fields=search_fields,
|
|
64
|
+
search_field_values=search_field_values,
|
|
65
|
+
order_by=order_by,
|
|
66
|
+
order_by_direction=order_by_direction,
|
|
67
|
+
fields=fields,
|
|
68
|
+
start_datetime=start_datetime,
|
|
69
|
+
end_datetime=end_datetime,
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
req = self._build_request(
|
|
73
|
+
method="GET",
|
|
74
|
+
path="/api/v1/directory_members/",
|
|
75
|
+
base_url=base_url,
|
|
76
|
+
url_variables=url_variables,
|
|
77
|
+
request=request,
|
|
78
|
+
request_body_required=False,
|
|
79
|
+
request_has_path_params=False,
|
|
80
|
+
request_has_query_params=True,
|
|
81
|
+
user_agent_header="user-agent",
|
|
82
|
+
accept_header_value="application/json",
|
|
83
|
+
http_headers=http_headers,
|
|
84
|
+
security=self.sdk_configuration.security,
|
|
85
|
+
timeout_ms=timeout_ms,
|
|
86
|
+
)
|
|
87
|
+
|
|
88
|
+
if retries == UNSET:
|
|
89
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
90
|
+
retries = self.sdk_configuration.retry_config
|
|
91
|
+
|
|
92
|
+
retry_config = None
|
|
93
|
+
if isinstance(retries, utils.RetryConfig):
|
|
94
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
95
|
+
|
|
96
|
+
http_res = self.do_request(
|
|
97
|
+
hook_ctx=HookContext(
|
|
98
|
+
config=self.sdk_configuration,
|
|
99
|
+
base_url=base_url or "",
|
|
100
|
+
operation_id="directory_member_list",
|
|
101
|
+
oauth2_scopes=None,
|
|
102
|
+
security_source=get_security_from_env(
|
|
103
|
+
self.sdk_configuration.security, models.Security
|
|
104
|
+
),
|
|
105
|
+
),
|
|
106
|
+
request=req,
|
|
107
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
108
|
+
retry_config=retry_config,
|
|
109
|
+
)
|
|
110
|
+
|
|
111
|
+
response_data: Any = None
|
|
112
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
113
|
+
return unmarshal_json_response(models.ListResponseDirectoryMember, http_res)
|
|
114
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
115
|
+
response_data = unmarshal_json_response(
|
|
116
|
+
errors.HTTPValidationErrorData, http_res
|
|
117
|
+
)
|
|
118
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
119
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
120
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
121
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
122
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
123
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
124
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
125
|
+
|
|
126
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
127
|
+
|
|
128
|
+
async def list_async(
|
|
129
|
+
self,
|
|
130
|
+
*,
|
|
131
|
+
page: OptionalNullable[int] = UNSET,
|
|
132
|
+
limit: Optional[int] = 25,
|
|
133
|
+
search_fields: Optional[List[models.DirectoryMemberProperties]] = None,
|
|
134
|
+
search_field_values: Optional[List[str]] = None,
|
|
135
|
+
order_by: OptionalNullable[models.DirectoryMemberProperties] = UNSET,
|
|
136
|
+
order_by_direction: OptionalNullable[models.OrderByDirection] = UNSET,
|
|
137
|
+
fields: OptionalNullable[List[models.DirectoryMemberProperties]] = UNSET,
|
|
138
|
+
start_datetime: OptionalNullable[str] = UNSET,
|
|
139
|
+
end_datetime: OptionalNullable[str] = UNSET,
|
|
140
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
141
|
+
server_url: Optional[str] = None,
|
|
142
|
+
timeout_ms: Optional[int] = None,
|
|
143
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
144
|
+
) -> models.ListResponseDirectoryMember:
|
|
145
|
+
r"""Directory Member List
|
|
146
|
+
|
|
147
|
+
List the existing directory_members
|
|
148
|
+
|
|
149
|
+
:param page: The page number from which to start (0-based)
|
|
150
|
+
:param limit: The maximum number of items to return
|
|
151
|
+
:param search_fields: String names of fields to search. Correspond by index to search field values
|
|
152
|
+
:param search_field_values: Values of fields to search. Correspond by index to search fields. Unless field name contains \"list\", an individual search field value cannot be a list
|
|
153
|
+
:param order_by: The field whose value should be used to order the results
|
|
154
|
+
:param order_by_direction: The direction in which to order the results
|
|
155
|
+
:param fields: The fields to include in the response
|
|
156
|
+
:param start_datetime: The start datetime for filtering results
|
|
157
|
+
:param end_datetime: The end datetime for filtering results
|
|
158
|
+
:param retries: Override the default retry configuration for this method
|
|
159
|
+
:param server_url: Override the default server URL for this method
|
|
160
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
161
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
162
|
+
"""
|
|
163
|
+
base_url = None
|
|
164
|
+
url_variables = None
|
|
165
|
+
if timeout_ms is None:
|
|
166
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
167
|
+
|
|
168
|
+
if server_url is not None:
|
|
169
|
+
base_url = server_url
|
|
170
|
+
else:
|
|
171
|
+
base_url = self._get_url(base_url, url_variables)
|
|
172
|
+
|
|
173
|
+
request = models.DirectoryMemberListRequest(
|
|
174
|
+
page=page,
|
|
175
|
+
limit=limit,
|
|
176
|
+
search_fields=search_fields,
|
|
177
|
+
search_field_values=search_field_values,
|
|
178
|
+
order_by=order_by,
|
|
179
|
+
order_by_direction=order_by_direction,
|
|
180
|
+
fields=fields,
|
|
181
|
+
start_datetime=start_datetime,
|
|
182
|
+
end_datetime=end_datetime,
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
req = self._build_request_async(
|
|
186
|
+
method="GET",
|
|
187
|
+
path="/api/v1/directory_members/",
|
|
188
|
+
base_url=base_url,
|
|
189
|
+
url_variables=url_variables,
|
|
190
|
+
request=request,
|
|
191
|
+
request_body_required=False,
|
|
192
|
+
request_has_path_params=False,
|
|
193
|
+
request_has_query_params=True,
|
|
194
|
+
user_agent_header="user-agent",
|
|
195
|
+
accept_header_value="application/json",
|
|
196
|
+
http_headers=http_headers,
|
|
197
|
+
security=self.sdk_configuration.security,
|
|
198
|
+
timeout_ms=timeout_ms,
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
if retries == UNSET:
|
|
202
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
203
|
+
retries = self.sdk_configuration.retry_config
|
|
204
|
+
|
|
205
|
+
retry_config = None
|
|
206
|
+
if isinstance(retries, utils.RetryConfig):
|
|
207
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
208
|
+
|
|
209
|
+
http_res = await self.do_request_async(
|
|
210
|
+
hook_ctx=HookContext(
|
|
211
|
+
config=self.sdk_configuration,
|
|
212
|
+
base_url=base_url or "",
|
|
213
|
+
operation_id="directory_member_list",
|
|
214
|
+
oauth2_scopes=None,
|
|
215
|
+
security_source=get_security_from_env(
|
|
216
|
+
self.sdk_configuration.security, models.Security
|
|
217
|
+
),
|
|
218
|
+
),
|
|
219
|
+
request=req,
|
|
220
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
221
|
+
retry_config=retry_config,
|
|
222
|
+
)
|
|
223
|
+
|
|
224
|
+
response_data: Any = None
|
|
225
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
226
|
+
return unmarshal_json_response(models.ListResponseDirectoryMember, http_res)
|
|
227
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
228
|
+
response_data = unmarshal_json_response(
|
|
229
|
+
errors.HTTPValidationErrorData, http_res
|
|
230
|
+
)
|
|
231
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
232
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
233
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
234
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
235
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
236
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
237
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
238
|
+
|
|
239
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
240
|
+
|
|
241
|
+
def create(
|
|
242
|
+
self,
|
|
243
|
+
*,
|
|
244
|
+
request: Union[
|
|
245
|
+
models.DirectoryMemberCreate, models.DirectoryMemberCreateTypedDict
|
|
246
|
+
],
|
|
247
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
248
|
+
server_url: Optional[str] = None,
|
|
249
|
+
timeout_ms: Optional[int] = None,
|
|
250
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
251
|
+
) -> models.DirectoryMember:
|
|
252
|
+
r"""Create Directory Member
|
|
253
|
+
|
|
254
|
+
Create a new member in the directory
|
|
255
|
+
|
|
256
|
+
:param request: The request object to send.
|
|
257
|
+
:param retries: Override the default retry configuration for this method
|
|
258
|
+
:param server_url: Override the default server URL for this method
|
|
259
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
260
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
261
|
+
"""
|
|
262
|
+
base_url = None
|
|
263
|
+
url_variables = None
|
|
264
|
+
if timeout_ms is None:
|
|
265
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
266
|
+
|
|
267
|
+
if server_url is not None:
|
|
268
|
+
base_url = server_url
|
|
269
|
+
else:
|
|
270
|
+
base_url = self._get_url(base_url, url_variables)
|
|
271
|
+
|
|
272
|
+
if not isinstance(request, BaseModel):
|
|
273
|
+
request = utils.unmarshal(request, models.DirectoryMemberCreate)
|
|
274
|
+
request = cast(models.DirectoryMemberCreate, request)
|
|
275
|
+
|
|
276
|
+
req = self._build_request(
|
|
277
|
+
method="POST",
|
|
278
|
+
path="/api/v1/directory_members/",
|
|
279
|
+
base_url=base_url,
|
|
280
|
+
url_variables=url_variables,
|
|
281
|
+
request=request,
|
|
282
|
+
request_body_required=True,
|
|
283
|
+
request_has_path_params=False,
|
|
284
|
+
request_has_query_params=True,
|
|
285
|
+
user_agent_header="user-agent",
|
|
286
|
+
accept_header_value="application/json",
|
|
287
|
+
http_headers=http_headers,
|
|
288
|
+
security=self.sdk_configuration.security,
|
|
289
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
290
|
+
request, False, False, "json", models.DirectoryMemberCreate
|
|
291
|
+
),
|
|
292
|
+
timeout_ms=timeout_ms,
|
|
293
|
+
)
|
|
294
|
+
|
|
295
|
+
if retries == UNSET:
|
|
296
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
297
|
+
retries = self.sdk_configuration.retry_config
|
|
298
|
+
|
|
299
|
+
retry_config = None
|
|
300
|
+
if isinstance(retries, utils.RetryConfig):
|
|
301
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
302
|
+
|
|
303
|
+
http_res = self.do_request(
|
|
304
|
+
hook_ctx=HookContext(
|
|
305
|
+
config=self.sdk_configuration,
|
|
306
|
+
base_url=base_url or "",
|
|
307
|
+
operation_id="directory_member_create",
|
|
308
|
+
oauth2_scopes=None,
|
|
309
|
+
security_source=get_security_from_env(
|
|
310
|
+
self.sdk_configuration.security, models.Security
|
|
311
|
+
),
|
|
312
|
+
),
|
|
313
|
+
request=req,
|
|
314
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
315
|
+
retry_config=retry_config,
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
response_data: Any = None
|
|
319
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
320
|
+
return unmarshal_json_response(models.DirectoryMember, http_res)
|
|
321
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
322
|
+
response_data = unmarshal_json_response(
|
|
323
|
+
errors.HTTPValidationErrorData, http_res
|
|
324
|
+
)
|
|
325
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
326
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
327
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
328
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
329
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
330
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
331
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
332
|
+
|
|
333
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
334
|
+
|
|
335
|
+
async def create_async(
|
|
336
|
+
self,
|
|
337
|
+
*,
|
|
338
|
+
request: Union[
|
|
339
|
+
models.DirectoryMemberCreate, models.DirectoryMemberCreateTypedDict
|
|
340
|
+
],
|
|
341
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
342
|
+
server_url: Optional[str] = None,
|
|
343
|
+
timeout_ms: Optional[int] = None,
|
|
344
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
345
|
+
) -> models.DirectoryMember:
|
|
346
|
+
r"""Create Directory Member
|
|
347
|
+
|
|
348
|
+
Create a new member in the directory
|
|
349
|
+
|
|
350
|
+
:param request: The request object to send.
|
|
351
|
+
:param retries: Override the default retry configuration for this method
|
|
352
|
+
:param server_url: Override the default server URL for this method
|
|
353
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
354
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
355
|
+
"""
|
|
356
|
+
base_url = None
|
|
357
|
+
url_variables = None
|
|
358
|
+
if timeout_ms is None:
|
|
359
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
360
|
+
|
|
361
|
+
if server_url is not None:
|
|
362
|
+
base_url = server_url
|
|
363
|
+
else:
|
|
364
|
+
base_url = self._get_url(base_url, url_variables)
|
|
365
|
+
|
|
366
|
+
if not isinstance(request, BaseModel):
|
|
367
|
+
request = utils.unmarshal(request, models.DirectoryMemberCreate)
|
|
368
|
+
request = cast(models.DirectoryMemberCreate, request)
|
|
369
|
+
|
|
370
|
+
req = self._build_request_async(
|
|
371
|
+
method="POST",
|
|
372
|
+
path="/api/v1/directory_members/",
|
|
373
|
+
base_url=base_url,
|
|
374
|
+
url_variables=url_variables,
|
|
375
|
+
request=request,
|
|
376
|
+
request_body_required=True,
|
|
377
|
+
request_has_path_params=False,
|
|
378
|
+
request_has_query_params=True,
|
|
379
|
+
user_agent_header="user-agent",
|
|
380
|
+
accept_header_value="application/json",
|
|
381
|
+
http_headers=http_headers,
|
|
382
|
+
security=self.sdk_configuration.security,
|
|
383
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
384
|
+
request, False, False, "json", models.DirectoryMemberCreate
|
|
385
|
+
),
|
|
386
|
+
timeout_ms=timeout_ms,
|
|
387
|
+
)
|
|
388
|
+
|
|
389
|
+
if retries == UNSET:
|
|
390
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
391
|
+
retries = self.sdk_configuration.retry_config
|
|
392
|
+
|
|
393
|
+
retry_config = None
|
|
394
|
+
if isinstance(retries, utils.RetryConfig):
|
|
395
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
396
|
+
|
|
397
|
+
http_res = await self.do_request_async(
|
|
398
|
+
hook_ctx=HookContext(
|
|
399
|
+
config=self.sdk_configuration,
|
|
400
|
+
base_url=base_url or "",
|
|
401
|
+
operation_id="directory_member_create",
|
|
402
|
+
oauth2_scopes=None,
|
|
403
|
+
security_source=get_security_from_env(
|
|
404
|
+
self.sdk_configuration.security, models.Security
|
|
405
|
+
),
|
|
406
|
+
),
|
|
407
|
+
request=req,
|
|
408
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
409
|
+
retry_config=retry_config,
|
|
410
|
+
)
|
|
411
|
+
|
|
412
|
+
response_data: Any = None
|
|
413
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
414
|
+
return unmarshal_json_response(models.DirectoryMember, http_res)
|
|
415
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
416
|
+
response_data = unmarshal_json_response(
|
|
417
|
+
errors.HTTPValidationErrorData, http_res
|
|
418
|
+
)
|
|
419
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
420
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
421
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
422
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
423
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
424
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
425
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
426
|
+
|
|
427
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
428
|
+
|
|
429
|
+
def get_by_id(
|
|
430
|
+
self,
|
|
431
|
+
*,
|
|
432
|
+
member_id: int,
|
|
433
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
434
|
+
server_url: Optional[str] = None,
|
|
435
|
+
timeout_ms: Optional[int] = None,
|
|
436
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
437
|
+
) -> models.DirectoryMember:
|
|
438
|
+
r"""Get Directory Member By Id
|
|
439
|
+
|
|
440
|
+
Get a DirectoryMember by ID.
|
|
441
|
+
|
|
442
|
+
:param member_id:
|
|
443
|
+
:param retries: Override the default retry configuration for this method
|
|
444
|
+
:param server_url: Override the default server URL for this method
|
|
445
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
446
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
447
|
+
"""
|
|
448
|
+
base_url = None
|
|
449
|
+
url_variables = None
|
|
450
|
+
if timeout_ms is None:
|
|
451
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
452
|
+
|
|
453
|
+
if server_url is not None:
|
|
454
|
+
base_url = server_url
|
|
455
|
+
else:
|
|
456
|
+
base_url = self._get_url(base_url, url_variables)
|
|
457
|
+
|
|
458
|
+
request = models.DirectoryMemberGetByIDRequest(
|
|
459
|
+
member_id=member_id,
|
|
460
|
+
)
|
|
461
|
+
|
|
462
|
+
req = self._build_request(
|
|
463
|
+
method="GET",
|
|
464
|
+
path="/api/v1/directory_members/{member_id}",
|
|
465
|
+
base_url=base_url,
|
|
466
|
+
url_variables=url_variables,
|
|
467
|
+
request=request,
|
|
468
|
+
request_body_required=False,
|
|
469
|
+
request_has_path_params=True,
|
|
470
|
+
request_has_query_params=True,
|
|
471
|
+
user_agent_header="user-agent",
|
|
472
|
+
accept_header_value="application/json",
|
|
473
|
+
http_headers=http_headers,
|
|
474
|
+
security=self.sdk_configuration.security,
|
|
475
|
+
timeout_ms=timeout_ms,
|
|
476
|
+
)
|
|
477
|
+
|
|
478
|
+
if retries == UNSET:
|
|
479
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
480
|
+
retries = self.sdk_configuration.retry_config
|
|
481
|
+
|
|
482
|
+
retry_config = None
|
|
483
|
+
if isinstance(retries, utils.RetryConfig):
|
|
484
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
485
|
+
|
|
486
|
+
http_res = self.do_request(
|
|
487
|
+
hook_ctx=HookContext(
|
|
488
|
+
config=self.sdk_configuration,
|
|
489
|
+
base_url=base_url or "",
|
|
490
|
+
operation_id="directory_member_get_by_id",
|
|
491
|
+
oauth2_scopes=None,
|
|
492
|
+
security_source=get_security_from_env(
|
|
493
|
+
self.sdk_configuration.security, models.Security
|
|
494
|
+
),
|
|
495
|
+
),
|
|
496
|
+
request=req,
|
|
497
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
498
|
+
retry_config=retry_config,
|
|
499
|
+
)
|
|
500
|
+
|
|
501
|
+
response_data: Any = None
|
|
502
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
503
|
+
return unmarshal_json_response(models.DirectoryMember, http_res)
|
|
504
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
505
|
+
response_data = unmarshal_json_response(
|
|
506
|
+
errors.HTTPValidationErrorData, http_res
|
|
507
|
+
)
|
|
508
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
509
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
510
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
511
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
512
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
513
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
514
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
515
|
+
|
|
516
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
517
|
+
|
|
518
|
+
async def get_by_id_async(
|
|
519
|
+
self,
|
|
520
|
+
*,
|
|
521
|
+
member_id: int,
|
|
522
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
523
|
+
server_url: Optional[str] = None,
|
|
524
|
+
timeout_ms: Optional[int] = None,
|
|
525
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
526
|
+
) -> models.DirectoryMember:
|
|
527
|
+
r"""Get Directory Member By Id
|
|
528
|
+
|
|
529
|
+
Get a DirectoryMember by ID.
|
|
530
|
+
|
|
531
|
+
:param member_id:
|
|
532
|
+
:param retries: Override the default retry configuration for this method
|
|
533
|
+
:param server_url: Override the default server URL for this method
|
|
534
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
535
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
536
|
+
"""
|
|
537
|
+
base_url = None
|
|
538
|
+
url_variables = None
|
|
539
|
+
if timeout_ms is None:
|
|
540
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
541
|
+
|
|
542
|
+
if server_url is not None:
|
|
543
|
+
base_url = server_url
|
|
544
|
+
else:
|
|
545
|
+
base_url = self._get_url(base_url, url_variables)
|
|
546
|
+
|
|
547
|
+
request = models.DirectoryMemberGetByIDRequest(
|
|
548
|
+
member_id=member_id,
|
|
549
|
+
)
|
|
550
|
+
|
|
551
|
+
req = self._build_request_async(
|
|
552
|
+
method="GET",
|
|
553
|
+
path="/api/v1/directory_members/{member_id}",
|
|
554
|
+
base_url=base_url,
|
|
555
|
+
url_variables=url_variables,
|
|
556
|
+
request=request,
|
|
557
|
+
request_body_required=False,
|
|
558
|
+
request_has_path_params=True,
|
|
559
|
+
request_has_query_params=True,
|
|
560
|
+
user_agent_header="user-agent",
|
|
561
|
+
accept_header_value="application/json",
|
|
562
|
+
http_headers=http_headers,
|
|
563
|
+
security=self.sdk_configuration.security,
|
|
564
|
+
timeout_ms=timeout_ms,
|
|
565
|
+
)
|
|
566
|
+
|
|
567
|
+
if retries == UNSET:
|
|
568
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
569
|
+
retries = self.sdk_configuration.retry_config
|
|
570
|
+
|
|
571
|
+
retry_config = None
|
|
572
|
+
if isinstance(retries, utils.RetryConfig):
|
|
573
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
574
|
+
|
|
575
|
+
http_res = await self.do_request_async(
|
|
576
|
+
hook_ctx=HookContext(
|
|
577
|
+
config=self.sdk_configuration,
|
|
578
|
+
base_url=base_url or "",
|
|
579
|
+
operation_id="directory_member_get_by_id",
|
|
580
|
+
oauth2_scopes=None,
|
|
581
|
+
security_source=get_security_from_env(
|
|
582
|
+
self.sdk_configuration.security, models.Security
|
|
583
|
+
),
|
|
584
|
+
),
|
|
585
|
+
request=req,
|
|
586
|
+
error_status_codes=["422", "4XX", "5XX"],
|
|
587
|
+
retry_config=retry_config,
|
|
588
|
+
)
|
|
589
|
+
|
|
590
|
+
response_data: Any = None
|
|
591
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
592
|
+
return unmarshal_json_response(models.DirectoryMember, http_res)
|
|
593
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
594
|
+
response_data = unmarshal_json_response(
|
|
595
|
+
errors.HTTPValidationErrorData, http_res
|
|
596
|
+
)
|
|
597
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
598
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
599
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
600
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
601
|
+
if utils.match_response(http_res, "5XX", "*"):
|
|
602
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
603
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
604
|
+
|
|
605
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
606
|
+
|
|
607
|
+
def update(
|
|
608
|
+
self,
|
|
609
|
+
*,
|
|
610
|
+
member_id: int,
|
|
611
|
+
directory_member: Union[
|
|
612
|
+
models.DirectoryMember, models.DirectoryMemberTypedDict
|
|
613
|
+
],
|
|
614
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
615
|
+
server_url: Optional[str] = None,
|
|
616
|
+
timeout_ms: Optional[int] = None,
|
|
617
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
618
|
+
) -> models.DirectoryMember:
|
|
619
|
+
r"""Update Directory Member
|
|
620
|
+
|
|
621
|
+
Update a DirectoryMember.
|
|
622
|
+
|
|
623
|
+
:param member_id:
|
|
624
|
+
:param directory_member:
|
|
625
|
+
:param retries: Override the default retry configuration for this method
|
|
626
|
+
:param server_url: Override the default server URL for this method
|
|
627
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
628
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
629
|
+
"""
|
|
630
|
+
base_url = None
|
|
631
|
+
url_variables = None
|
|
632
|
+
if timeout_ms is None:
|
|
633
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
634
|
+
|
|
635
|
+
if server_url is not None:
|
|
636
|
+
base_url = server_url
|
|
637
|
+
else:
|
|
638
|
+
base_url = self._get_url(base_url, url_variables)
|
|
639
|
+
|
|
640
|
+
request = models.DirectoryMemberUpdateRequest(
|
|
641
|
+
member_id=member_id,
|
|
642
|
+
directory_member=utils.get_pydantic_model(
|
|
643
|
+
directory_member, models.DirectoryMember
|
|
644
|
+
),
|
|
645
|
+
)
|
|
646
|
+
|
|
647
|
+
req = self._build_request(
|
|
648
|
+
method="PUT",
|
|
649
|
+
path="/api/v1/directory_members/{member_id}",
|
|
650
|
+
base_url=base_url,
|
|
651
|
+
url_variables=url_variables,
|
|
652
|
+
request=request,
|
|
653
|
+
request_body_required=True,
|
|
654
|
+
request_has_path_params=True,
|
|
655
|
+
request_has_query_params=True,
|
|
656
|
+
user_agent_header="user-agent",
|
|
657
|
+
accept_header_value="application/json",
|
|
658
|
+
http_headers=http_headers,
|
|
659
|
+
security=self.sdk_configuration.security,
|
|
660
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
661
|
+
request.directory_member, False, False, "json", models.DirectoryMember
|
|
662
|
+
),
|
|
663
|
+
timeout_ms=timeout_ms,
|
|
664
|
+
)
|
|
665
|
+
|
|
666
|
+
if retries == UNSET:
|
|
667
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
668
|
+
retries = self.sdk_configuration.retry_config
|
|
669
|
+
|
|
670
|
+
retry_config = None
|
|
671
|
+
if isinstance(retries, utils.RetryConfig):
|
|
672
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
673
|
+
|
|
674
|
+
http_res = self.do_request(
|
|
675
|
+
hook_ctx=HookContext(
|
|
676
|
+
config=self.sdk_configuration,
|
|
677
|
+
base_url=base_url or "",
|
|
678
|
+
operation_id="directory_member_update",
|
|
679
|
+
oauth2_scopes=None,
|
|
680
|
+
security_source=get_security_from_env(
|
|
681
|
+
self.sdk_configuration.security, models.Security
|
|
682
|
+
),
|
|
683
|
+
),
|
|
684
|
+
request=req,
|
|
685
|
+
error_status_codes=["400", "404", "412", "422", "4XX", "500", "5XX"],
|
|
686
|
+
retry_config=retry_config,
|
|
687
|
+
)
|
|
688
|
+
|
|
689
|
+
response_data: Any = None
|
|
690
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
691
|
+
return unmarshal_json_response(models.DirectoryMember, http_res)
|
|
692
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
693
|
+
response_data = unmarshal_json_response(
|
|
694
|
+
errors.HTTPValidationErrorData, http_res
|
|
695
|
+
)
|
|
696
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
697
|
+
if utils.match_response(http_res, ["400", "404", "412", "4XX"], "*"):
|
|
698
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
699
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
700
|
+
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
701
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
702
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
703
|
+
|
|
704
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
705
|
+
|
|
706
|
+
async def update_async(
|
|
707
|
+
self,
|
|
708
|
+
*,
|
|
709
|
+
member_id: int,
|
|
710
|
+
directory_member: Union[
|
|
711
|
+
models.DirectoryMember, models.DirectoryMemberTypedDict
|
|
712
|
+
],
|
|
713
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
714
|
+
server_url: Optional[str] = None,
|
|
715
|
+
timeout_ms: Optional[int] = None,
|
|
716
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
717
|
+
) -> models.DirectoryMember:
|
|
718
|
+
r"""Update Directory Member
|
|
719
|
+
|
|
720
|
+
Update a DirectoryMember.
|
|
721
|
+
|
|
722
|
+
:param member_id:
|
|
723
|
+
:param directory_member:
|
|
724
|
+
:param retries: Override the default retry configuration for this method
|
|
725
|
+
:param server_url: Override the default server URL for this method
|
|
726
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
727
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
728
|
+
"""
|
|
729
|
+
base_url = None
|
|
730
|
+
url_variables = None
|
|
731
|
+
if timeout_ms is None:
|
|
732
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
733
|
+
|
|
734
|
+
if server_url is not None:
|
|
735
|
+
base_url = server_url
|
|
736
|
+
else:
|
|
737
|
+
base_url = self._get_url(base_url, url_variables)
|
|
738
|
+
|
|
739
|
+
request = models.DirectoryMemberUpdateRequest(
|
|
740
|
+
member_id=member_id,
|
|
741
|
+
directory_member=utils.get_pydantic_model(
|
|
742
|
+
directory_member, models.DirectoryMember
|
|
743
|
+
),
|
|
744
|
+
)
|
|
745
|
+
|
|
746
|
+
req = self._build_request_async(
|
|
747
|
+
method="PUT",
|
|
748
|
+
path="/api/v1/directory_members/{member_id}",
|
|
749
|
+
base_url=base_url,
|
|
750
|
+
url_variables=url_variables,
|
|
751
|
+
request=request,
|
|
752
|
+
request_body_required=True,
|
|
753
|
+
request_has_path_params=True,
|
|
754
|
+
request_has_query_params=True,
|
|
755
|
+
user_agent_header="user-agent",
|
|
756
|
+
accept_header_value="application/json",
|
|
757
|
+
http_headers=http_headers,
|
|
758
|
+
security=self.sdk_configuration.security,
|
|
759
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
760
|
+
request.directory_member, False, False, "json", models.DirectoryMember
|
|
761
|
+
),
|
|
762
|
+
timeout_ms=timeout_ms,
|
|
763
|
+
)
|
|
764
|
+
|
|
765
|
+
if retries == UNSET:
|
|
766
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
767
|
+
retries = self.sdk_configuration.retry_config
|
|
768
|
+
|
|
769
|
+
retry_config = None
|
|
770
|
+
if isinstance(retries, utils.RetryConfig):
|
|
771
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
772
|
+
|
|
773
|
+
http_res = await self.do_request_async(
|
|
774
|
+
hook_ctx=HookContext(
|
|
775
|
+
config=self.sdk_configuration,
|
|
776
|
+
base_url=base_url or "",
|
|
777
|
+
operation_id="directory_member_update",
|
|
778
|
+
oauth2_scopes=None,
|
|
779
|
+
security_source=get_security_from_env(
|
|
780
|
+
self.sdk_configuration.security, models.Security
|
|
781
|
+
),
|
|
782
|
+
),
|
|
783
|
+
request=req,
|
|
784
|
+
error_status_codes=["400", "404", "412", "422", "4XX", "500", "5XX"],
|
|
785
|
+
retry_config=retry_config,
|
|
786
|
+
)
|
|
787
|
+
|
|
788
|
+
response_data: Any = None
|
|
789
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
790
|
+
return unmarshal_json_response(models.DirectoryMember, http_res)
|
|
791
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
792
|
+
response_data = unmarshal_json_response(
|
|
793
|
+
errors.HTTPValidationErrorData, http_res
|
|
794
|
+
)
|
|
795
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
796
|
+
if utils.match_response(http_res, ["400", "404", "412", "4XX"], "*"):
|
|
797
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
798
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
799
|
+
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
800
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
801
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
802
|
+
|
|
803
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
804
|
+
|
|
805
|
+
def delete(
|
|
806
|
+
self,
|
|
807
|
+
*,
|
|
808
|
+
member_id: int,
|
|
809
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
810
|
+
server_url: Optional[str] = None,
|
|
811
|
+
timeout_ms: Optional[int] = None,
|
|
812
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
813
|
+
) -> Any:
|
|
814
|
+
r"""Delete Directory Member
|
|
815
|
+
|
|
816
|
+
Delete a DirectoryMember.
|
|
817
|
+
|
|
818
|
+
:param member_id:
|
|
819
|
+
:param retries: Override the default retry configuration for this method
|
|
820
|
+
:param server_url: Override the default server URL for this method
|
|
821
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
822
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
823
|
+
"""
|
|
824
|
+
base_url = None
|
|
825
|
+
url_variables = None
|
|
826
|
+
if timeout_ms is None:
|
|
827
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
828
|
+
|
|
829
|
+
if server_url is not None:
|
|
830
|
+
base_url = server_url
|
|
831
|
+
else:
|
|
832
|
+
base_url = self._get_url(base_url, url_variables)
|
|
833
|
+
|
|
834
|
+
request = models.DirectoryMemberDeleteRequest(
|
|
835
|
+
member_id=member_id,
|
|
836
|
+
)
|
|
837
|
+
|
|
838
|
+
req = self._build_request(
|
|
839
|
+
method="DELETE",
|
|
840
|
+
path="/api/v1/directory_members/{member_id}",
|
|
841
|
+
base_url=base_url,
|
|
842
|
+
url_variables=url_variables,
|
|
843
|
+
request=request,
|
|
844
|
+
request_body_required=False,
|
|
845
|
+
request_has_path_params=True,
|
|
846
|
+
request_has_query_params=True,
|
|
847
|
+
user_agent_header="user-agent",
|
|
848
|
+
accept_header_value="application/json",
|
|
849
|
+
http_headers=http_headers,
|
|
850
|
+
security=self.sdk_configuration.security,
|
|
851
|
+
timeout_ms=timeout_ms,
|
|
852
|
+
)
|
|
853
|
+
|
|
854
|
+
if retries == UNSET:
|
|
855
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
856
|
+
retries = self.sdk_configuration.retry_config
|
|
857
|
+
|
|
858
|
+
retry_config = None
|
|
859
|
+
if isinstance(retries, utils.RetryConfig):
|
|
860
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
861
|
+
|
|
862
|
+
http_res = self.do_request(
|
|
863
|
+
hook_ctx=HookContext(
|
|
864
|
+
config=self.sdk_configuration,
|
|
865
|
+
base_url=base_url or "",
|
|
866
|
+
operation_id="directory_member_delete",
|
|
867
|
+
oauth2_scopes=None,
|
|
868
|
+
security_source=get_security_from_env(
|
|
869
|
+
self.sdk_configuration.security, models.Security
|
|
870
|
+
),
|
|
871
|
+
),
|
|
872
|
+
request=req,
|
|
873
|
+
error_status_codes=["400", "404", "422", "4XX", "500", "5XX"],
|
|
874
|
+
retry_config=retry_config,
|
|
875
|
+
)
|
|
876
|
+
|
|
877
|
+
response_data: Any = None
|
|
878
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
879
|
+
return unmarshal_json_response(Any, http_res)
|
|
880
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
881
|
+
response_data = unmarshal_json_response(
|
|
882
|
+
errors.HTTPValidationErrorData, http_res
|
|
883
|
+
)
|
|
884
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
885
|
+
if utils.match_response(http_res, ["400", "404", "4XX"], "*"):
|
|
886
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
887
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
888
|
+
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
889
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
890
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
891
|
+
|
|
892
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
893
|
+
|
|
894
|
+
async def delete_async(
|
|
895
|
+
self,
|
|
896
|
+
*,
|
|
897
|
+
member_id: int,
|
|
898
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
899
|
+
server_url: Optional[str] = None,
|
|
900
|
+
timeout_ms: Optional[int] = None,
|
|
901
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
902
|
+
) -> Any:
|
|
903
|
+
r"""Delete Directory Member
|
|
904
|
+
|
|
905
|
+
Delete a DirectoryMember.
|
|
906
|
+
|
|
907
|
+
:param member_id:
|
|
908
|
+
:param retries: Override the default retry configuration for this method
|
|
909
|
+
:param server_url: Override the default server URL for this method
|
|
910
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
911
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
912
|
+
"""
|
|
913
|
+
base_url = None
|
|
914
|
+
url_variables = None
|
|
915
|
+
if timeout_ms is None:
|
|
916
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
917
|
+
|
|
918
|
+
if server_url is not None:
|
|
919
|
+
base_url = server_url
|
|
920
|
+
else:
|
|
921
|
+
base_url = self._get_url(base_url, url_variables)
|
|
922
|
+
|
|
923
|
+
request = models.DirectoryMemberDeleteRequest(
|
|
924
|
+
member_id=member_id,
|
|
925
|
+
)
|
|
926
|
+
|
|
927
|
+
req = self._build_request_async(
|
|
928
|
+
method="DELETE",
|
|
929
|
+
path="/api/v1/directory_members/{member_id}",
|
|
930
|
+
base_url=base_url,
|
|
931
|
+
url_variables=url_variables,
|
|
932
|
+
request=request,
|
|
933
|
+
request_body_required=False,
|
|
934
|
+
request_has_path_params=True,
|
|
935
|
+
request_has_query_params=True,
|
|
936
|
+
user_agent_header="user-agent",
|
|
937
|
+
accept_header_value="application/json",
|
|
938
|
+
http_headers=http_headers,
|
|
939
|
+
security=self.sdk_configuration.security,
|
|
940
|
+
timeout_ms=timeout_ms,
|
|
941
|
+
)
|
|
942
|
+
|
|
943
|
+
if retries == UNSET:
|
|
944
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
945
|
+
retries = self.sdk_configuration.retry_config
|
|
946
|
+
|
|
947
|
+
retry_config = None
|
|
948
|
+
if isinstance(retries, utils.RetryConfig):
|
|
949
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
950
|
+
|
|
951
|
+
http_res = await self.do_request_async(
|
|
952
|
+
hook_ctx=HookContext(
|
|
953
|
+
config=self.sdk_configuration,
|
|
954
|
+
base_url=base_url or "",
|
|
955
|
+
operation_id="directory_member_delete",
|
|
956
|
+
oauth2_scopes=None,
|
|
957
|
+
security_source=get_security_from_env(
|
|
958
|
+
self.sdk_configuration.security, models.Security
|
|
959
|
+
),
|
|
960
|
+
),
|
|
961
|
+
request=req,
|
|
962
|
+
error_status_codes=["400", "404", "422", "4XX", "500", "5XX"],
|
|
963
|
+
retry_config=retry_config,
|
|
964
|
+
)
|
|
965
|
+
|
|
966
|
+
response_data: Any = None
|
|
967
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
968
|
+
return unmarshal_json_response(Any, http_res)
|
|
969
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
970
|
+
response_data = unmarshal_json_response(
|
|
971
|
+
errors.HTTPValidationErrorData, http_res
|
|
972
|
+
)
|
|
973
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
974
|
+
if utils.match_response(http_res, ["400", "404", "4XX"], "*"):
|
|
975
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
976
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
977
|
+
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
978
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
979
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
980
|
+
|
|
981
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
982
|
+
|
|
983
|
+
def directory_member_bulk_load(
|
|
984
|
+
self,
|
|
985
|
+
*,
|
|
986
|
+
request: Union[
|
|
987
|
+
models.BodyDirectoryMemberBulkLoad,
|
|
988
|
+
models.BodyDirectoryMemberBulkLoadTypedDict,
|
|
989
|
+
],
|
|
990
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
991
|
+
server_url: Optional[str] = None,
|
|
992
|
+
timeout_ms: Optional[int] = None,
|
|
993
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
994
|
+
) -> Any:
|
|
995
|
+
r"""Bulk Load Directory Members
|
|
996
|
+
|
|
997
|
+
Update Directory Members in chunks of 100.
|
|
998
|
+
|
|
999
|
+
:param request: The request object to send.
|
|
1000
|
+
:param retries: Override the default retry configuration for this method
|
|
1001
|
+
:param server_url: Override the default server URL for this method
|
|
1002
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1003
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1004
|
+
"""
|
|
1005
|
+
base_url = None
|
|
1006
|
+
url_variables = None
|
|
1007
|
+
if timeout_ms is None:
|
|
1008
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1009
|
+
|
|
1010
|
+
if server_url is not None:
|
|
1011
|
+
base_url = server_url
|
|
1012
|
+
else:
|
|
1013
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1014
|
+
|
|
1015
|
+
if not isinstance(request, BaseModel):
|
|
1016
|
+
request = utils.unmarshal(request, models.BodyDirectoryMemberBulkLoad)
|
|
1017
|
+
request = cast(models.BodyDirectoryMemberBulkLoad, request)
|
|
1018
|
+
|
|
1019
|
+
req = self._build_request(
|
|
1020
|
+
method="PUT",
|
|
1021
|
+
path="/api/v1/directory_members/upload/",
|
|
1022
|
+
base_url=base_url,
|
|
1023
|
+
url_variables=url_variables,
|
|
1024
|
+
request=request,
|
|
1025
|
+
request_body_required=True,
|
|
1026
|
+
request_has_path_params=False,
|
|
1027
|
+
request_has_query_params=True,
|
|
1028
|
+
user_agent_header="user-agent",
|
|
1029
|
+
accept_header_value="application/json",
|
|
1030
|
+
http_headers=http_headers,
|
|
1031
|
+
security=self.sdk_configuration.security,
|
|
1032
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1033
|
+
request, False, False, "multipart", models.BodyDirectoryMemberBulkLoad
|
|
1034
|
+
),
|
|
1035
|
+
timeout_ms=timeout_ms,
|
|
1036
|
+
)
|
|
1037
|
+
|
|
1038
|
+
if retries == UNSET:
|
|
1039
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1040
|
+
retries = self.sdk_configuration.retry_config
|
|
1041
|
+
|
|
1042
|
+
retry_config = None
|
|
1043
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1044
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1045
|
+
|
|
1046
|
+
http_res = self.do_request(
|
|
1047
|
+
hook_ctx=HookContext(
|
|
1048
|
+
config=self.sdk_configuration,
|
|
1049
|
+
base_url=base_url or "",
|
|
1050
|
+
operation_id="directory_member_bulk_load",
|
|
1051
|
+
oauth2_scopes=None,
|
|
1052
|
+
security_source=get_security_from_env(
|
|
1053
|
+
self.sdk_configuration.security, models.Security
|
|
1054
|
+
),
|
|
1055
|
+
),
|
|
1056
|
+
request=req,
|
|
1057
|
+
error_status_codes=["400", "404", "412", "422", "4XX", "500", "5XX"],
|
|
1058
|
+
retry_config=retry_config,
|
|
1059
|
+
)
|
|
1060
|
+
|
|
1061
|
+
response_data: Any = None
|
|
1062
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1063
|
+
return unmarshal_json_response(Any, http_res)
|
|
1064
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1065
|
+
response_data = unmarshal_json_response(
|
|
1066
|
+
errors.HTTPValidationErrorData, http_res
|
|
1067
|
+
)
|
|
1068
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1069
|
+
if utils.match_response(http_res, ["400", "404", "412", "4XX"], "*"):
|
|
1070
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1071
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1072
|
+
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
1073
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1074
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1075
|
+
|
|
1076
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1077
|
+
|
|
1078
|
+
async def directory_member_bulk_load_async(
|
|
1079
|
+
self,
|
|
1080
|
+
*,
|
|
1081
|
+
request: Union[
|
|
1082
|
+
models.BodyDirectoryMemberBulkLoad,
|
|
1083
|
+
models.BodyDirectoryMemberBulkLoadTypedDict,
|
|
1084
|
+
],
|
|
1085
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1086
|
+
server_url: Optional[str] = None,
|
|
1087
|
+
timeout_ms: Optional[int] = None,
|
|
1088
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1089
|
+
) -> Any:
|
|
1090
|
+
r"""Bulk Load Directory Members
|
|
1091
|
+
|
|
1092
|
+
Update Directory Members in chunks of 100.
|
|
1093
|
+
|
|
1094
|
+
:param request: The request object to send.
|
|
1095
|
+
:param retries: Override the default retry configuration for this method
|
|
1096
|
+
:param server_url: Override the default server URL for this method
|
|
1097
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1098
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1099
|
+
"""
|
|
1100
|
+
base_url = None
|
|
1101
|
+
url_variables = None
|
|
1102
|
+
if timeout_ms is None:
|
|
1103
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1104
|
+
|
|
1105
|
+
if server_url is not None:
|
|
1106
|
+
base_url = server_url
|
|
1107
|
+
else:
|
|
1108
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1109
|
+
|
|
1110
|
+
if not isinstance(request, BaseModel):
|
|
1111
|
+
request = utils.unmarshal(request, models.BodyDirectoryMemberBulkLoad)
|
|
1112
|
+
request = cast(models.BodyDirectoryMemberBulkLoad, request)
|
|
1113
|
+
|
|
1114
|
+
req = self._build_request_async(
|
|
1115
|
+
method="PUT",
|
|
1116
|
+
path="/api/v1/directory_members/upload/",
|
|
1117
|
+
base_url=base_url,
|
|
1118
|
+
url_variables=url_variables,
|
|
1119
|
+
request=request,
|
|
1120
|
+
request_body_required=True,
|
|
1121
|
+
request_has_path_params=False,
|
|
1122
|
+
request_has_query_params=True,
|
|
1123
|
+
user_agent_header="user-agent",
|
|
1124
|
+
accept_header_value="application/json",
|
|
1125
|
+
http_headers=http_headers,
|
|
1126
|
+
security=self.sdk_configuration.security,
|
|
1127
|
+
get_serialized_body=lambda: utils.serialize_request_body(
|
|
1128
|
+
request, False, False, "multipart", models.BodyDirectoryMemberBulkLoad
|
|
1129
|
+
),
|
|
1130
|
+
timeout_ms=timeout_ms,
|
|
1131
|
+
)
|
|
1132
|
+
|
|
1133
|
+
if retries == UNSET:
|
|
1134
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1135
|
+
retries = self.sdk_configuration.retry_config
|
|
1136
|
+
|
|
1137
|
+
retry_config = None
|
|
1138
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1139
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1140
|
+
|
|
1141
|
+
http_res = await self.do_request_async(
|
|
1142
|
+
hook_ctx=HookContext(
|
|
1143
|
+
config=self.sdk_configuration,
|
|
1144
|
+
base_url=base_url or "",
|
|
1145
|
+
operation_id="directory_member_bulk_load",
|
|
1146
|
+
oauth2_scopes=None,
|
|
1147
|
+
security_source=get_security_from_env(
|
|
1148
|
+
self.sdk_configuration.security, models.Security
|
|
1149
|
+
),
|
|
1150
|
+
),
|
|
1151
|
+
request=req,
|
|
1152
|
+
error_status_codes=["400", "404", "412", "422", "4XX", "500", "5XX"],
|
|
1153
|
+
retry_config=retry_config,
|
|
1154
|
+
)
|
|
1155
|
+
|
|
1156
|
+
response_data: Any = None
|
|
1157
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1158
|
+
return unmarshal_json_response(Any, http_res)
|
|
1159
|
+
if utils.match_response(http_res, "422", "application/json"):
|
|
1160
|
+
response_data = unmarshal_json_response(
|
|
1161
|
+
errors.HTTPValidationErrorData, http_res
|
|
1162
|
+
)
|
|
1163
|
+
raise errors.HTTPValidationError(response_data, http_res)
|
|
1164
|
+
if utils.match_response(http_res, ["400", "404", "412", "4XX"], "*"):
|
|
1165
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1166
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1167
|
+
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
1168
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1169
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1170
|
+
|
|
1171
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1172
|
+
|
|
1173
|
+
def directory_member_download(
|
|
1174
|
+
self,
|
|
1175
|
+
*,
|
|
1176
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1177
|
+
server_url: Optional[str] = None,
|
|
1178
|
+
timeout_ms: Optional[int] = None,
|
|
1179
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1180
|
+
) -> Any:
|
|
1181
|
+
r"""Download Directory Members
|
|
1182
|
+
|
|
1183
|
+
Download the entire directory as a JSON file.
|
|
1184
|
+
|
|
1185
|
+
:param retries: Override the default retry configuration for this method
|
|
1186
|
+
:param server_url: Override the default server URL for this method
|
|
1187
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1188
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1189
|
+
"""
|
|
1190
|
+
base_url = None
|
|
1191
|
+
url_variables = None
|
|
1192
|
+
if timeout_ms is None:
|
|
1193
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1194
|
+
|
|
1195
|
+
if server_url is not None:
|
|
1196
|
+
base_url = server_url
|
|
1197
|
+
else:
|
|
1198
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1199
|
+
req = self._build_request(
|
|
1200
|
+
method="GET",
|
|
1201
|
+
path="/api/v1/directory_members/download/",
|
|
1202
|
+
base_url=base_url,
|
|
1203
|
+
url_variables=url_variables,
|
|
1204
|
+
request=None,
|
|
1205
|
+
request_body_required=False,
|
|
1206
|
+
request_has_path_params=False,
|
|
1207
|
+
request_has_query_params=True,
|
|
1208
|
+
user_agent_header="user-agent",
|
|
1209
|
+
accept_header_value="application/json",
|
|
1210
|
+
http_headers=http_headers,
|
|
1211
|
+
security=self.sdk_configuration.security,
|
|
1212
|
+
timeout_ms=timeout_ms,
|
|
1213
|
+
)
|
|
1214
|
+
|
|
1215
|
+
if retries == UNSET:
|
|
1216
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1217
|
+
retries = self.sdk_configuration.retry_config
|
|
1218
|
+
|
|
1219
|
+
retry_config = None
|
|
1220
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1221
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1222
|
+
|
|
1223
|
+
http_res = self.do_request(
|
|
1224
|
+
hook_ctx=HookContext(
|
|
1225
|
+
config=self.sdk_configuration,
|
|
1226
|
+
base_url=base_url or "",
|
|
1227
|
+
operation_id="directory_member_download",
|
|
1228
|
+
oauth2_scopes=None,
|
|
1229
|
+
security_source=get_security_from_env(
|
|
1230
|
+
self.sdk_configuration.security, models.Security
|
|
1231
|
+
),
|
|
1232
|
+
),
|
|
1233
|
+
request=req,
|
|
1234
|
+
error_status_codes=["4XX", "500", "5XX"],
|
|
1235
|
+
retry_config=retry_config,
|
|
1236
|
+
)
|
|
1237
|
+
|
|
1238
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1239
|
+
return unmarshal_json_response(Any, http_res)
|
|
1240
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1241
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1242
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1243
|
+
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
1244
|
+
http_res_text = utils.stream_to_text(http_res)
|
|
1245
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1246
|
+
|
|
1247
|
+
raise errors.APIError("Unexpected response received", http_res)
|
|
1248
|
+
|
|
1249
|
+
async def directory_member_download_async(
|
|
1250
|
+
self,
|
|
1251
|
+
*,
|
|
1252
|
+
retries: OptionalNullable[utils.RetryConfig] = UNSET,
|
|
1253
|
+
server_url: Optional[str] = None,
|
|
1254
|
+
timeout_ms: Optional[int] = None,
|
|
1255
|
+
http_headers: Optional[Mapping[str, str]] = None,
|
|
1256
|
+
) -> Any:
|
|
1257
|
+
r"""Download Directory Members
|
|
1258
|
+
|
|
1259
|
+
Download the entire directory as a JSON file.
|
|
1260
|
+
|
|
1261
|
+
:param retries: Override the default retry configuration for this method
|
|
1262
|
+
:param server_url: Override the default server URL for this method
|
|
1263
|
+
:param timeout_ms: Override the default request timeout configuration for this method in milliseconds
|
|
1264
|
+
:param http_headers: Additional headers to set or replace on requests.
|
|
1265
|
+
"""
|
|
1266
|
+
base_url = None
|
|
1267
|
+
url_variables = None
|
|
1268
|
+
if timeout_ms is None:
|
|
1269
|
+
timeout_ms = self.sdk_configuration.timeout_ms
|
|
1270
|
+
|
|
1271
|
+
if server_url is not None:
|
|
1272
|
+
base_url = server_url
|
|
1273
|
+
else:
|
|
1274
|
+
base_url = self._get_url(base_url, url_variables)
|
|
1275
|
+
req = self._build_request_async(
|
|
1276
|
+
method="GET",
|
|
1277
|
+
path="/api/v1/directory_members/download/",
|
|
1278
|
+
base_url=base_url,
|
|
1279
|
+
url_variables=url_variables,
|
|
1280
|
+
request=None,
|
|
1281
|
+
request_body_required=False,
|
|
1282
|
+
request_has_path_params=False,
|
|
1283
|
+
request_has_query_params=True,
|
|
1284
|
+
user_agent_header="user-agent",
|
|
1285
|
+
accept_header_value="application/json",
|
|
1286
|
+
http_headers=http_headers,
|
|
1287
|
+
security=self.sdk_configuration.security,
|
|
1288
|
+
timeout_ms=timeout_ms,
|
|
1289
|
+
)
|
|
1290
|
+
|
|
1291
|
+
if retries == UNSET:
|
|
1292
|
+
if self.sdk_configuration.retry_config is not UNSET:
|
|
1293
|
+
retries = self.sdk_configuration.retry_config
|
|
1294
|
+
|
|
1295
|
+
retry_config = None
|
|
1296
|
+
if isinstance(retries, utils.RetryConfig):
|
|
1297
|
+
retry_config = (retries, ["429", "500", "502", "503", "504"])
|
|
1298
|
+
|
|
1299
|
+
http_res = await self.do_request_async(
|
|
1300
|
+
hook_ctx=HookContext(
|
|
1301
|
+
config=self.sdk_configuration,
|
|
1302
|
+
base_url=base_url or "",
|
|
1303
|
+
operation_id="directory_member_download",
|
|
1304
|
+
oauth2_scopes=None,
|
|
1305
|
+
security_source=get_security_from_env(
|
|
1306
|
+
self.sdk_configuration.security, models.Security
|
|
1307
|
+
),
|
|
1308
|
+
),
|
|
1309
|
+
request=req,
|
|
1310
|
+
error_status_codes=["4XX", "500", "5XX"],
|
|
1311
|
+
retry_config=retry_config,
|
|
1312
|
+
)
|
|
1313
|
+
|
|
1314
|
+
if utils.match_response(http_res, "200", "application/json"):
|
|
1315
|
+
return unmarshal_json_response(Any, http_res)
|
|
1316
|
+
if utils.match_response(http_res, "4XX", "*"):
|
|
1317
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1318
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1319
|
+
if utils.match_response(http_res, ["500", "5XX"], "*"):
|
|
1320
|
+
http_res_text = await utils.stream_to_text_async(http_res)
|
|
1321
|
+
raise errors.APIError("API error occurred", http_res, http_res_text)
|
|
1322
|
+
|
|
1323
|
+
raise errors.APIError("Unexpected response received", http_res)
|