superposition-sdk 0.94.1__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.
@@ -0,0 +1,2006 @@
1
+ # Code generated by smithy-python-codegen DO NOT EDIT.
2
+
3
+ from datetime import datetime
4
+ import json
5
+ from typing import Any
6
+
7
+ from smithy_core.documents import DocumentValue
8
+ from smithy_core.prelude import DOCUMENT as _SCHEMA_DOCUMENT
9
+ from smithy_core.types import TimestampFormat
10
+ from smithy_core.utils import ensure_utc, expect_type
11
+ from smithy_http.aio.interfaces import HTTPResponse
12
+ from smithy_http.aio.restjson import parse_rest_json_error_info
13
+ from smithy_json import JSONCodec
14
+
15
+ from .config import Config
16
+ from .models import (
17
+ AddMembersToGroupOutput,
18
+ ApiError,
19
+ ApplicableVariantsOutput,
20
+ BulkOperationOutput,
21
+ ConcludeExperimentOutput,
22
+ CreateContextOutput,
23
+ CreateDefaultConfigOutput,
24
+ CreateDimensionOutput,
25
+ CreateExperimentGroupOutput,
26
+ CreateExperimentOutput,
27
+ CreateFunctionOutput,
28
+ CreateOrganisationOutput,
29
+ CreateTypeTemplatesOutput,
30
+ CreateWebhookOutput,
31
+ CreateWorkspaceOutput,
32
+ DeleteContextOutput,
33
+ DeleteDefaultConfigOutput,
34
+ DeleteDimensionOutput,
35
+ DeleteExperimentGroupOutput,
36
+ DeleteFunctionOutput,
37
+ DeleteTypeTemplatesOutput,
38
+ DeleteWebhookOutput,
39
+ DiscardExperimentOutput,
40
+ GetConfigFastOutput,
41
+ GetConfigOutput,
42
+ GetContextFromConditionOutput,
43
+ GetContextOutput,
44
+ GetDefaultConfigOutput,
45
+ GetDimensionOutput,
46
+ GetExperimentGroupOutput,
47
+ GetExperimentOutput,
48
+ GetFunctionOutput,
49
+ GetOrganisationOutput,
50
+ GetResolvedConfigOutput,
51
+ GetTypeTemplateOutput,
52
+ GetTypeTemplatesListOutput,
53
+ GetVersionOutput,
54
+ GetWebhookByEventOutput,
55
+ GetWebhookOutput,
56
+ GetWorkspaceOutput,
57
+ InternalServerError,
58
+ ListAuditLogsOutput,
59
+ ListContextsOutput,
60
+ ListDefaultConfigsOutput,
61
+ ListDimensionsOutput,
62
+ ListExperimentGroupsOutput,
63
+ ListExperimentOutput,
64
+ ListFunctionOutput,
65
+ ListOrganisationOutput,
66
+ ListVersionsOutput,
67
+ ListWebhookOutput,
68
+ ListWorkspaceOutput,
69
+ MigrateWorkspaceSchemaOutput,
70
+ MoveContextOutput,
71
+ PauseExperimentOutput,
72
+ PublishOutput,
73
+ RampExperimentOutput,
74
+ RemoveMembersFromGroupOutput,
75
+ ResourceNotFound,
76
+ ResumeExperimentOutput,
77
+ TestOutput,
78
+ UnknownApiError,
79
+ UpdateDefaultConfigOutput,
80
+ UpdateDimensionOutput,
81
+ UpdateExperimentGroupOutput,
82
+ UpdateFunctionOutput,
83
+ UpdateOrganisationOutput,
84
+ UpdateOverrideOutput,
85
+ UpdateOverridesExperimentOutput,
86
+ UpdateTypeTemplatesOutput,
87
+ UpdateWebhookOutput,
88
+ UpdateWorkspaceOutput,
89
+ ValidateContextOutput,
90
+ WeightRecomputeOutput,
91
+ )
92
+
93
+
94
+ async def _deserialize_add_members_to_group(http_response: HTTPResponse, config: Config) -> AddMembersToGroupOutput:
95
+ if http_response.status != 200 and http_response.status >= 300:
96
+ raise await _deserialize_error_add_members_to_group(http_response, config)
97
+
98
+ kwargs: dict[str, Any] = {}
99
+
100
+ body = await http_response.consume_body_async()
101
+ if body:
102
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
103
+ deserializer = codec.create_deserializer(body)
104
+ body_kwargs = AddMembersToGroupOutput.deserialize_kwargs(deserializer)
105
+ kwargs.update(body_kwargs)
106
+
107
+ return AddMembersToGroupOutput(**kwargs)
108
+
109
+ async def _deserialize_error_add_members_to_group(http_response: HTTPResponse, config: Config) -> ApiError:
110
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
111
+
112
+ match code.lower():
113
+ case "internalservererror":
114
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
115
+
116
+ case "resourcenotfound":
117
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
118
+
119
+ case _:
120
+ return UnknownApiError(f"{code}: {message}")
121
+
122
+ async def _deserialize_applicable_variants(http_response: HTTPResponse, config: Config) -> ApplicableVariantsOutput:
123
+ if http_response.status != 200 and http_response.status >= 300:
124
+ raise await _deserialize_error_applicable_variants(http_response, config)
125
+
126
+ kwargs: dict[str, Any] = {}
127
+
128
+ body = await http_response.consume_body_async()
129
+ if body:
130
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
131
+ deserializer = codec.create_deserializer(body)
132
+ body_kwargs = ApplicableVariantsOutput.deserialize_kwargs(deserializer)
133
+ kwargs.update(body_kwargs)
134
+
135
+ return ApplicableVariantsOutput(**kwargs)
136
+
137
+ async def _deserialize_error_applicable_variants(http_response: HTTPResponse, config: Config) -> ApiError:
138
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
139
+
140
+ match code.lower():
141
+ case "internalservererror":
142
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
143
+
144
+ case _:
145
+ return UnknownApiError(f"{code}: {message}")
146
+
147
+ async def _deserialize_bulk_operation(http_response: HTTPResponse, config: Config) -> BulkOperationOutput:
148
+ if http_response.status != 200 and http_response.status >= 300:
149
+ raise await _deserialize_error_bulk_operation(http_response, config)
150
+
151
+ kwargs: dict[str, Any] = {}
152
+
153
+ body = await http_response.consume_body_async()
154
+ if body:
155
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
156
+ deserializer = codec.create_deserializer(body)
157
+ body_kwargs = BulkOperationOutput.deserialize_kwargs(deserializer)
158
+ kwargs.update(body_kwargs)
159
+
160
+ return BulkOperationOutput(**kwargs)
161
+
162
+ async def _deserialize_error_bulk_operation(http_response: HTTPResponse, config: Config) -> ApiError:
163
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
164
+
165
+ match code.lower():
166
+ case "internalservererror":
167
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
168
+
169
+ case "resourcenotfound":
170
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
171
+
172
+ case _:
173
+ return UnknownApiError(f"{code}: {message}")
174
+
175
+ async def _deserialize_conclude_experiment(http_response: HTTPResponse, config: Config) -> ConcludeExperimentOutput:
176
+ if http_response.status != 200 and http_response.status >= 300:
177
+ raise await _deserialize_error_conclude_experiment(http_response, config)
178
+
179
+ kwargs: dict[str, Any] = {}
180
+
181
+ body = await http_response.consume_body_async()
182
+ if body:
183
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
184
+ deserializer = codec.create_deserializer(body)
185
+ body_kwargs = ConcludeExperimentOutput.deserialize_kwargs(deserializer)
186
+ kwargs.update(body_kwargs)
187
+
188
+ return ConcludeExperimentOutput(**kwargs)
189
+
190
+ async def _deserialize_error_conclude_experiment(http_response: HTTPResponse, config: Config) -> ApiError:
191
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
192
+
193
+ match code.lower():
194
+ case "internalservererror":
195
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
196
+
197
+ case "resourcenotfound":
198
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
199
+
200
+ case _:
201
+ return UnknownApiError(f"{code}: {message}")
202
+
203
+ async def _deserialize_create_context(http_response: HTTPResponse, config: Config) -> CreateContextOutput:
204
+ if http_response.status != 200 and http_response.status >= 300:
205
+ raise await _deserialize_error_create_context(http_response, config)
206
+
207
+ kwargs: dict[str, Any] = {}
208
+
209
+ body = await http_response.consume_body_async()
210
+ if body:
211
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
212
+ deserializer = codec.create_deserializer(body)
213
+ body_kwargs = CreateContextOutput.deserialize_kwargs(deserializer)
214
+ kwargs.update(body_kwargs)
215
+
216
+ return CreateContextOutput(**kwargs)
217
+
218
+ async def _deserialize_error_create_context(http_response: HTTPResponse, config: Config) -> ApiError:
219
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
220
+
221
+ match code.lower():
222
+ case "internalservererror":
223
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
224
+
225
+ case "resourcenotfound":
226
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
227
+
228
+ case _:
229
+ return UnknownApiError(f"{code}: {message}")
230
+
231
+ async def _deserialize_create_default_config(http_response: HTTPResponse, config: Config) -> CreateDefaultConfigOutput:
232
+ if http_response.status != 200 and http_response.status >= 300:
233
+ raise await _deserialize_error_create_default_config(http_response, config)
234
+
235
+ kwargs: dict[str, Any] = {}
236
+
237
+ body = await http_response.consume_body_async()
238
+ if body:
239
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
240
+ deserializer = codec.create_deserializer(body)
241
+ body_kwargs = CreateDefaultConfigOutput.deserialize_kwargs(deserializer)
242
+ kwargs.update(body_kwargs)
243
+
244
+ return CreateDefaultConfigOutput(**kwargs)
245
+
246
+ async def _deserialize_error_create_default_config(http_response: HTTPResponse, config: Config) -> ApiError:
247
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
248
+
249
+ match code.lower():
250
+ case "internalservererror":
251
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
252
+
253
+ case _:
254
+ return UnknownApiError(f"{code}: {message}")
255
+
256
+ async def _deserialize_create_dimension(http_response: HTTPResponse, config: Config) -> CreateDimensionOutput:
257
+ if http_response.status != 200 and http_response.status >= 300:
258
+ raise await _deserialize_error_create_dimension(http_response, config)
259
+
260
+ kwargs: dict[str, Any] = {}
261
+
262
+ body = await http_response.consume_body_async()
263
+ if body:
264
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
265
+ deserializer = codec.create_deserializer(body)
266
+ body_kwargs = CreateDimensionOutput.deserialize_kwargs(deserializer)
267
+ kwargs.update(body_kwargs)
268
+
269
+ return CreateDimensionOutput(**kwargs)
270
+
271
+ async def _deserialize_error_create_dimension(http_response: HTTPResponse, config: Config) -> ApiError:
272
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
273
+
274
+ match code.lower():
275
+ case "internalservererror":
276
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
277
+
278
+ case _:
279
+ return UnknownApiError(f"{code}: {message}")
280
+
281
+ async def _deserialize_create_experiment(http_response: HTTPResponse, config: Config) -> CreateExperimentOutput:
282
+ if http_response.status != 200 and http_response.status >= 300:
283
+ raise await _deserialize_error_create_experiment(http_response, config)
284
+
285
+ kwargs: dict[str, Any] = {}
286
+
287
+ body = await http_response.consume_body_async()
288
+ if body:
289
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
290
+ deserializer = codec.create_deserializer(body)
291
+ body_kwargs = CreateExperimentOutput.deserialize_kwargs(deserializer)
292
+ kwargs.update(body_kwargs)
293
+
294
+ return CreateExperimentOutput(**kwargs)
295
+
296
+ async def _deserialize_error_create_experiment(http_response: HTTPResponse, config: Config) -> ApiError:
297
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
298
+
299
+ match code.lower():
300
+ case "internalservererror":
301
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
302
+
303
+ case _:
304
+ return UnknownApiError(f"{code}: {message}")
305
+
306
+ async def _deserialize_create_experiment_group(http_response: HTTPResponse, config: Config) -> CreateExperimentGroupOutput:
307
+ if http_response.status != 200 and http_response.status >= 300:
308
+ raise await _deserialize_error_create_experiment_group(http_response, config)
309
+
310
+ kwargs: dict[str, Any] = {}
311
+
312
+ body = await http_response.consume_body_async()
313
+ if body:
314
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
315
+ deserializer = codec.create_deserializer(body)
316
+ body_kwargs = CreateExperimentGroupOutput.deserialize_kwargs(deserializer)
317
+ kwargs.update(body_kwargs)
318
+
319
+ return CreateExperimentGroupOutput(**kwargs)
320
+
321
+ async def _deserialize_error_create_experiment_group(http_response: HTTPResponse, config: Config) -> ApiError:
322
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
323
+
324
+ match code.lower():
325
+ case "internalservererror":
326
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
327
+
328
+ case _:
329
+ return UnknownApiError(f"{code}: {message}")
330
+
331
+ async def _deserialize_create_function(http_response: HTTPResponse, config: Config) -> CreateFunctionOutput:
332
+ if http_response.status != 200 and http_response.status >= 300:
333
+ raise await _deserialize_error_create_function(http_response, config)
334
+
335
+ kwargs: dict[str, Any] = {}
336
+
337
+ body = await http_response.consume_body_async()
338
+ if body:
339
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
340
+ deserializer = codec.create_deserializer(body)
341
+ body_kwargs = CreateFunctionOutput.deserialize_kwargs(deserializer)
342
+ kwargs.update(body_kwargs)
343
+
344
+ return CreateFunctionOutput(**kwargs)
345
+
346
+ async def _deserialize_error_create_function(http_response: HTTPResponse, config: Config) -> ApiError:
347
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
348
+
349
+ match code.lower():
350
+ case "internalservererror":
351
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
352
+
353
+ case _:
354
+ return UnknownApiError(f"{code}: {message}")
355
+
356
+ async def _deserialize_create_organisation(http_response: HTTPResponse, config: Config) -> CreateOrganisationOutput:
357
+ if http_response.status != 200 and http_response.status >= 300:
358
+ raise await _deserialize_error_create_organisation(http_response, config)
359
+
360
+ kwargs: dict[str, Any] = {}
361
+
362
+ body = await http_response.consume_body_async()
363
+ if body:
364
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
365
+ deserializer = codec.create_deserializer(body)
366
+ body_kwargs = CreateOrganisationOutput.deserialize_kwargs(deserializer)
367
+ kwargs.update(body_kwargs)
368
+
369
+ return CreateOrganisationOutput(**kwargs)
370
+
371
+ async def _deserialize_error_create_organisation(http_response: HTTPResponse, config: Config) -> ApiError:
372
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
373
+
374
+ match code.lower():
375
+ case "internalservererror":
376
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
377
+
378
+ case _:
379
+ return UnknownApiError(f"{code}: {message}")
380
+
381
+ async def _deserialize_create_type_templates(http_response: HTTPResponse, config: Config) -> CreateTypeTemplatesOutput:
382
+ if http_response.status != 200 and http_response.status >= 300:
383
+ raise await _deserialize_error_create_type_templates(http_response, config)
384
+
385
+ kwargs: dict[str, Any] = {}
386
+
387
+ body = await http_response.consume_body_async()
388
+ if body:
389
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
390
+ deserializer = codec.create_deserializer(body)
391
+ body_kwargs = CreateTypeTemplatesOutput.deserialize_kwargs(deserializer)
392
+ kwargs.update(body_kwargs)
393
+
394
+ return CreateTypeTemplatesOutput(**kwargs)
395
+
396
+ async def _deserialize_error_create_type_templates(http_response: HTTPResponse, config: Config) -> ApiError:
397
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
398
+
399
+ match code.lower():
400
+ case "internalservererror":
401
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
402
+
403
+ case _:
404
+ return UnknownApiError(f"{code}: {message}")
405
+
406
+ async def _deserialize_create_webhook(http_response: HTTPResponse, config: Config) -> CreateWebhookOutput:
407
+ if http_response.status != 200 and http_response.status >= 300:
408
+ raise await _deserialize_error_create_webhook(http_response, config)
409
+
410
+ kwargs: dict[str, Any] = {}
411
+
412
+ body = await http_response.consume_body_async()
413
+ if body:
414
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
415
+ deserializer = codec.create_deserializer(body)
416
+ body_kwargs = CreateWebhookOutput.deserialize_kwargs(deserializer)
417
+ kwargs.update(body_kwargs)
418
+
419
+ return CreateWebhookOutput(**kwargs)
420
+
421
+ async def _deserialize_error_create_webhook(http_response: HTTPResponse, config: Config) -> ApiError:
422
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
423
+
424
+ match code.lower():
425
+ case "internalservererror":
426
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
427
+
428
+ case _:
429
+ return UnknownApiError(f"{code}: {message}")
430
+
431
+ async def _deserialize_create_workspace(http_response: HTTPResponse, config: Config) -> CreateWorkspaceOutput:
432
+ if http_response.status != 200 and http_response.status >= 300:
433
+ raise await _deserialize_error_create_workspace(http_response, config)
434
+
435
+ kwargs: dict[str, Any] = {}
436
+
437
+ body = await http_response.consume_body_async()
438
+ if body:
439
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
440
+ deserializer = codec.create_deserializer(body)
441
+ body_kwargs = CreateWorkspaceOutput.deserialize_kwargs(deserializer)
442
+ kwargs.update(body_kwargs)
443
+
444
+ return CreateWorkspaceOutput(**kwargs)
445
+
446
+ async def _deserialize_error_create_workspace(http_response: HTTPResponse, config: Config) -> ApiError:
447
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
448
+
449
+ match code.lower():
450
+ case "internalservererror":
451
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
452
+
453
+ case _:
454
+ return UnknownApiError(f"{code}: {message}")
455
+
456
+ async def _deserialize_delete_context(http_response: HTTPResponse, config: Config) -> DeleteContextOutput:
457
+ if http_response.status != 204 and http_response.status >= 300:
458
+ raise await _deserialize_error_delete_context(http_response, config)
459
+
460
+ kwargs: dict[str, Any] = {}
461
+
462
+ return DeleteContextOutput(**kwargs)
463
+
464
+ async def _deserialize_error_delete_context(http_response: HTTPResponse, config: Config) -> ApiError:
465
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
466
+
467
+ match code.lower():
468
+ case "internalservererror":
469
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
470
+
471
+ case "resourcenotfound":
472
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
473
+
474
+ case _:
475
+ return UnknownApiError(f"{code}: {message}")
476
+
477
+ async def _deserialize_delete_default_config(http_response: HTTPResponse, config: Config) -> DeleteDefaultConfigOutput:
478
+ if http_response.status != 204 and http_response.status >= 300:
479
+ raise await _deserialize_error_delete_default_config(http_response, config)
480
+
481
+ kwargs: dict[str, Any] = {}
482
+
483
+ return DeleteDefaultConfigOutput(**kwargs)
484
+
485
+ async def _deserialize_error_delete_default_config(http_response: HTTPResponse, config: Config) -> ApiError:
486
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
487
+
488
+ match code.lower():
489
+ case "internalservererror":
490
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
491
+
492
+ case "resourcenotfound":
493
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
494
+
495
+ case _:
496
+ return UnknownApiError(f"{code}: {message}")
497
+
498
+ async def _deserialize_delete_dimension(http_response: HTTPResponse, config: Config) -> DeleteDimensionOutput:
499
+ if http_response.status != 204 and http_response.status >= 300:
500
+ raise await _deserialize_error_delete_dimension(http_response, config)
501
+
502
+ kwargs: dict[str, Any] = {}
503
+
504
+ return DeleteDimensionOutput(**kwargs)
505
+
506
+ async def _deserialize_error_delete_dimension(http_response: HTTPResponse, config: Config) -> ApiError:
507
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
508
+
509
+ match code.lower():
510
+ case "internalservererror":
511
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
512
+
513
+ case "resourcenotfound":
514
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
515
+
516
+ case _:
517
+ return UnknownApiError(f"{code}: {message}")
518
+
519
+ async def _deserialize_delete_experiment_group(http_response: HTTPResponse, config: Config) -> DeleteExperimentGroupOutput:
520
+ if http_response.status != 200 and http_response.status >= 300:
521
+ raise await _deserialize_error_delete_experiment_group(http_response, config)
522
+
523
+ kwargs: dict[str, Any] = {}
524
+
525
+ body = await http_response.consume_body_async()
526
+ if body:
527
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
528
+ deserializer = codec.create_deserializer(body)
529
+ body_kwargs = DeleteExperimentGroupOutput.deserialize_kwargs(deserializer)
530
+ kwargs.update(body_kwargs)
531
+
532
+ return DeleteExperimentGroupOutput(**kwargs)
533
+
534
+ async def _deserialize_error_delete_experiment_group(http_response: HTTPResponse, config: Config) -> ApiError:
535
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
536
+
537
+ match code.lower():
538
+ case "internalservererror":
539
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
540
+
541
+ case "resourcenotfound":
542
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
543
+
544
+ case _:
545
+ return UnknownApiError(f"{code}: {message}")
546
+
547
+ async def _deserialize_delete_function(http_response: HTTPResponse, config: Config) -> DeleteFunctionOutput:
548
+ if http_response.status != 204 and http_response.status >= 300:
549
+ raise await _deserialize_error_delete_function(http_response, config)
550
+
551
+ kwargs: dict[str, Any] = {}
552
+
553
+ return DeleteFunctionOutput(**kwargs)
554
+
555
+ async def _deserialize_error_delete_function(http_response: HTTPResponse, config: Config) -> ApiError:
556
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
557
+
558
+ match code.lower():
559
+ case "internalservererror":
560
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
561
+
562
+ case "resourcenotfound":
563
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
564
+
565
+ case _:
566
+ return UnknownApiError(f"{code}: {message}")
567
+
568
+ async def _deserialize_delete_type_templates(http_response: HTTPResponse, config: Config) -> DeleteTypeTemplatesOutput:
569
+ if http_response.status != 200 and http_response.status >= 300:
570
+ raise await _deserialize_error_delete_type_templates(http_response, config)
571
+
572
+ kwargs: dict[str, Any] = {}
573
+
574
+ body = await http_response.consume_body_async()
575
+ if body:
576
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
577
+ deserializer = codec.create_deserializer(body)
578
+ body_kwargs = DeleteTypeTemplatesOutput.deserialize_kwargs(deserializer)
579
+ kwargs.update(body_kwargs)
580
+
581
+ return DeleteTypeTemplatesOutput(**kwargs)
582
+
583
+ async def _deserialize_error_delete_type_templates(http_response: HTTPResponse, config: Config) -> ApiError:
584
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
585
+
586
+ match code.lower():
587
+ case "internalservererror":
588
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
589
+
590
+ case "resourcenotfound":
591
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
592
+
593
+ case _:
594
+ return UnknownApiError(f"{code}: {message}")
595
+
596
+ async def _deserialize_delete_webhook(http_response: HTTPResponse, config: Config) -> DeleteWebhookOutput:
597
+ if http_response.status != 204 and http_response.status >= 300:
598
+ raise await _deserialize_error_delete_webhook(http_response, config)
599
+
600
+ kwargs: dict[str, Any] = {}
601
+
602
+ return DeleteWebhookOutput(**kwargs)
603
+
604
+ async def _deserialize_error_delete_webhook(http_response: HTTPResponse, config: Config) -> ApiError:
605
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
606
+
607
+ match code.lower():
608
+ case "internalservererror":
609
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
610
+
611
+ case "resourcenotfound":
612
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
613
+
614
+ case _:
615
+ return UnknownApiError(f"{code}: {message}")
616
+
617
+ async def _deserialize_discard_experiment(http_response: HTTPResponse, config: Config) -> DiscardExperimentOutput:
618
+ if http_response.status != 200 and http_response.status >= 300:
619
+ raise await _deserialize_error_discard_experiment(http_response, config)
620
+
621
+ kwargs: dict[str, Any] = {}
622
+
623
+ body = await http_response.consume_body_async()
624
+ if body:
625
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
626
+ deserializer = codec.create_deserializer(body)
627
+ body_kwargs = DiscardExperimentOutput.deserialize_kwargs(deserializer)
628
+ kwargs.update(body_kwargs)
629
+
630
+ return DiscardExperimentOutput(**kwargs)
631
+
632
+ async def _deserialize_error_discard_experiment(http_response: HTTPResponse, config: Config) -> ApiError:
633
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
634
+
635
+ match code.lower():
636
+ case "internalservererror":
637
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
638
+
639
+ case "resourcenotfound":
640
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
641
+
642
+ case _:
643
+ return UnknownApiError(f"{code}: {message}")
644
+
645
+ async def _deserialize_get_config(http_response: HTTPResponse, config: Config) -> GetConfigOutput:
646
+ if http_response.status != 200 and http_response.status >= 300:
647
+ raise await _deserialize_error_get_config(http_response, config)
648
+
649
+ kwargs: dict[str, Any] = {}
650
+
651
+ body = await http_response.consume_body_async()
652
+ if body:
653
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
654
+ deserializer = codec.create_deserializer(body)
655
+ body_kwargs = GetConfigOutput.deserialize_kwargs(deserializer)
656
+ kwargs.update(body_kwargs)
657
+
658
+ for fld in http_response.fields:
659
+ for key, value in fld.as_tuples():
660
+ _key_lowercase = key.lower()
661
+ match _key_lowercase:
662
+ case "x-config-version":
663
+ kwargs["version"] = value
664
+
665
+ case "last-modified":
666
+ kwargs["last_modified"] = ensure_utc(datetime.fromisoformat(expect_type(str, value)))
667
+
668
+ case "x-audit-id":
669
+ kwargs["audit_id"] = value
670
+
671
+ case _:
672
+ pass
673
+
674
+ return GetConfigOutput(**kwargs)
675
+
676
+ async def _deserialize_error_get_config(http_response: HTTPResponse, config: Config) -> ApiError:
677
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
678
+
679
+ match code.lower():
680
+ case "internalservererror":
681
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
682
+
683
+ case _:
684
+ return UnknownApiError(f"{code}: {message}")
685
+
686
+ async def _deserialize_get_config_fast(http_response: HTTPResponse, config: Config) -> GetConfigFastOutput:
687
+ if http_response.status != 200 and http_response.status >= 300:
688
+ raise await _deserialize_error_get_config_fast(http_response, config)
689
+
690
+ kwargs: dict[str, Any] = {}
691
+
692
+ body = await http_response.consume_body_async()
693
+ if body:
694
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
695
+ deserializer = codec.create_deserializer(body)
696
+ kwargs["config"] = deserializer.read_document(_SCHEMA_DOCUMENT)
697
+
698
+ for fld in http_response.fields:
699
+ for key, value in fld.as_tuples():
700
+ _key_lowercase = key.lower()
701
+ match _key_lowercase:
702
+ case "x-config-version":
703
+ kwargs["version"] = value
704
+
705
+ case "last-modified":
706
+ kwargs["last_modified"] = ensure_utc(datetime.fromisoformat(expect_type(str, value)))
707
+
708
+ case "x-audit-id":
709
+ kwargs["audit_id"] = value
710
+
711
+ case _:
712
+ pass
713
+
714
+ return GetConfigFastOutput(**kwargs)
715
+
716
+ async def _deserialize_error_get_config_fast(http_response: HTTPResponse, config: Config) -> ApiError:
717
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
718
+
719
+ match code.lower():
720
+ case "internalservererror":
721
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
722
+
723
+ case _:
724
+ return UnknownApiError(f"{code}: {message}")
725
+
726
+ async def _deserialize_get_context(http_response: HTTPResponse, config: Config) -> GetContextOutput:
727
+ if http_response.status != 200 and http_response.status >= 300:
728
+ raise await _deserialize_error_get_context(http_response, config)
729
+
730
+ kwargs: dict[str, Any] = {}
731
+
732
+ body = await http_response.consume_body_async()
733
+ if body:
734
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
735
+ deserializer = codec.create_deserializer(body)
736
+ body_kwargs = GetContextOutput.deserialize_kwargs(deserializer)
737
+ kwargs.update(body_kwargs)
738
+
739
+ return GetContextOutput(**kwargs)
740
+
741
+ async def _deserialize_error_get_context(http_response: HTTPResponse, config: Config) -> ApiError:
742
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
743
+
744
+ match code.lower():
745
+ case "internalservererror":
746
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
747
+
748
+ case "resourcenotfound":
749
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
750
+
751
+ case _:
752
+ return UnknownApiError(f"{code}: {message}")
753
+
754
+ async def _deserialize_get_context_from_condition(http_response: HTTPResponse, config: Config) -> GetContextFromConditionOutput:
755
+ if http_response.status != 200 and http_response.status >= 300:
756
+ raise await _deserialize_error_get_context_from_condition(http_response, config)
757
+
758
+ kwargs: dict[str, Any] = {}
759
+
760
+ body = await http_response.consume_body_async()
761
+ if body:
762
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
763
+ deserializer = codec.create_deserializer(body)
764
+ body_kwargs = GetContextFromConditionOutput.deserialize_kwargs(deserializer)
765
+ kwargs.update(body_kwargs)
766
+
767
+ return GetContextFromConditionOutput(**kwargs)
768
+
769
+ async def _deserialize_error_get_context_from_condition(http_response: HTTPResponse, config: Config) -> ApiError:
770
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
771
+
772
+ match code.lower():
773
+ case "internalservererror":
774
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
775
+
776
+ case "resourcenotfound":
777
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
778
+
779
+ case _:
780
+ return UnknownApiError(f"{code}: {message}")
781
+
782
+ async def _deserialize_get_default_config(http_response: HTTPResponse, config: Config) -> GetDefaultConfigOutput:
783
+ if http_response.status != 200 and http_response.status >= 300:
784
+ raise await _deserialize_error_get_default_config(http_response, config)
785
+
786
+ kwargs: dict[str, Any] = {}
787
+
788
+ body = await http_response.consume_body_async()
789
+ if body:
790
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
791
+ deserializer = codec.create_deserializer(body)
792
+ body_kwargs = GetDefaultConfigOutput.deserialize_kwargs(deserializer)
793
+ kwargs.update(body_kwargs)
794
+
795
+ return GetDefaultConfigOutput(**kwargs)
796
+
797
+ async def _deserialize_error_get_default_config(http_response: HTTPResponse, config: Config) -> ApiError:
798
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
799
+
800
+ match code.lower():
801
+ case "internalservererror":
802
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
803
+
804
+ case "resourcenotfound":
805
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
806
+
807
+ case _:
808
+ return UnknownApiError(f"{code}: {message}")
809
+
810
+ async def _deserialize_get_dimension(http_response: HTTPResponse, config: Config) -> GetDimensionOutput:
811
+ if http_response.status != 200 and http_response.status >= 300:
812
+ raise await _deserialize_error_get_dimension(http_response, config)
813
+
814
+ kwargs: dict[str, Any] = {}
815
+
816
+ body = await http_response.consume_body_async()
817
+ if body:
818
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
819
+ deserializer = codec.create_deserializer(body)
820
+ body_kwargs = GetDimensionOutput.deserialize_kwargs(deserializer)
821
+ kwargs.update(body_kwargs)
822
+
823
+ return GetDimensionOutput(**kwargs)
824
+
825
+ async def _deserialize_error_get_dimension(http_response: HTTPResponse, config: Config) -> ApiError:
826
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
827
+
828
+ match code.lower():
829
+ case "internalservererror":
830
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
831
+
832
+ case "resourcenotfound":
833
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
834
+
835
+ case _:
836
+ return UnknownApiError(f"{code}: {message}")
837
+
838
+ async def _deserialize_get_experiment(http_response: HTTPResponse, config: Config) -> GetExperimentOutput:
839
+ if http_response.status != 200 and http_response.status >= 300:
840
+ raise await _deserialize_error_get_experiment(http_response, config)
841
+
842
+ kwargs: dict[str, Any] = {}
843
+
844
+ body = await http_response.consume_body_async()
845
+ if body:
846
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
847
+ deserializer = codec.create_deserializer(body)
848
+ body_kwargs = GetExperimentOutput.deserialize_kwargs(deserializer)
849
+ kwargs.update(body_kwargs)
850
+
851
+ return GetExperimentOutput(**kwargs)
852
+
853
+ async def _deserialize_error_get_experiment(http_response: HTTPResponse, config: Config) -> ApiError:
854
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
855
+
856
+ match code.lower():
857
+ case "internalservererror":
858
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
859
+
860
+ case "resourcenotfound":
861
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
862
+
863
+ case _:
864
+ return UnknownApiError(f"{code}: {message}")
865
+
866
+ async def _deserialize_get_experiment_group(http_response: HTTPResponse, config: Config) -> GetExperimentGroupOutput:
867
+ if http_response.status != 200 and http_response.status >= 300:
868
+ raise await _deserialize_error_get_experiment_group(http_response, config)
869
+
870
+ kwargs: dict[str, Any] = {}
871
+
872
+ body = await http_response.consume_body_async()
873
+ if body:
874
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
875
+ deserializer = codec.create_deserializer(body)
876
+ body_kwargs = GetExperimentGroupOutput.deserialize_kwargs(deserializer)
877
+ kwargs.update(body_kwargs)
878
+
879
+ return GetExperimentGroupOutput(**kwargs)
880
+
881
+ async def _deserialize_error_get_experiment_group(http_response: HTTPResponse, config: Config) -> ApiError:
882
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
883
+
884
+ match code.lower():
885
+ case "internalservererror":
886
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
887
+
888
+ case "resourcenotfound":
889
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
890
+
891
+ case _:
892
+ return UnknownApiError(f"{code}: {message}")
893
+
894
+ async def _deserialize_get_function(http_response: HTTPResponse, config: Config) -> GetFunctionOutput:
895
+ if http_response.status != 200 and http_response.status >= 300:
896
+ raise await _deserialize_error_get_function(http_response, config)
897
+
898
+ kwargs: dict[str, Any] = {}
899
+
900
+ body = await http_response.consume_body_async()
901
+ if body:
902
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
903
+ deserializer = codec.create_deserializer(body)
904
+ body_kwargs = GetFunctionOutput.deserialize_kwargs(deserializer)
905
+ kwargs.update(body_kwargs)
906
+
907
+ return GetFunctionOutput(**kwargs)
908
+
909
+ async def _deserialize_error_get_function(http_response: HTTPResponse, config: Config) -> ApiError:
910
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
911
+
912
+ match code.lower():
913
+ case "internalservererror":
914
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
915
+
916
+ case "resourcenotfound":
917
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
918
+
919
+ case _:
920
+ return UnknownApiError(f"{code}: {message}")
921
+
922
+ async def _deserialize_get_organisation(http_response: HTTPResponse, config: Config) -> GetOrganisationOutput:
923
+ if http_response.status != 200 and http_response.status >= 300:
924
+ raise await _deserialize_error_get_organisation(http_response, config)
925
+
926
+ kwargs: dict[str, Any] = {}
927
+
928
+ body = await http_response.consume_body_async()
929
+ if body:
930
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
931
+ deserializer = codec.create_deserializer(body)
932
+ body_kwargs = GetOrganisationOutput.deserialize_kwargs(deserializer)
933
+ kwargs.update(body_kwargs)
934
+
935
+ return GetOrganisationOutput(**kwargs)
936
+
937
+ async def _deserialize_error_get_organisation(http_response: HTTPResponse, config: Config) -> ApiError:
938
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
939
+
940
+ match code.lower():
941
+ case "internalservererror":
942
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
943
+
944
+ case "resourcenotfound":
945
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
946
+
947
+ case _:
948
+ return UnknownApiError(f"{code}: {message}")
949
+
950
+ async def _deserialize_get_resolved_config(http_response: HTTPResponse, config: Config) -> GetResolvedConfigOutput:
951
+ if http_response.status != 200 and http_response.status >= 300:
952
+ raise await _deserialize_error_get_resolved_config(http_response, config)
953
+
954
+ kwargs: dict[str, Any] = {}
955
+
956
+ body = await http_response.consume_body_async()
957
+ if body:
958
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
959
+ deserializer = codec.create_deserializer(body)
960
+ kwargs["config"] = deserializer.read_document(_SCHEMA_DOCUMENT)
961
+
962
+ for fld in http_response.fields:
963
+ for key, value in fld.as_tuples():
964
+ _key_lowercase = key.lower()
965
+ match _key_lowercase:
966
+ case "x-config-version":
967
+ kwargs["version"] = value
968
+
969
+ case "last-modified":
970
+ kwargs["last_modified"] = ensure_utc(datetime.fromisoformat(expect_type(str, value)))
971
+
972
+ case "x-audit-id":
973
+ kwargs["audit_id"] = value
974
+
975
+ case _:
976
+ pass
977
+
978
+ return GetResolvedConfigOutput(**kwargs)
979
+
980
+ async def _deserialize_error_get_resolved_config(http_response: HTTPResponse, config: Config) -> ApiError:
981
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
982
+
983
+ match code.lower():
984
+ case "internalservererror":
985
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
986
+
987
+ case _:
988
+ return UnknownApiError(f"{code}: {message}")
989
+
990
+ async def _deserialize_get_type_template(http_response: HTTPResponse, config: Config) -> GetTypeTemplateOutput:
991
+ if http_response.status != 200 and http_response.status >= 300:
992
+ raise await _deserialize_error_get_type_template(http_response, config)
993
+
994
+ kwargs: dict[str, Any] = {}
995
+
996
+ body = await http_response.consume_body_async()
997
+ if body:
998
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
999
+ deserializer = codec.create_deserializer(body)
1000
+ body_kwargs = GetTypeTemplateOutput.deserialize_kwargs(deserializer)
1001
+ kwargs.update(body_kwargs)
1002
+
1003
+ return GetTypeTemplateOutput(**kwargs)
1004
+
1005
+ async def _deserialize_error_get_type_template(http_response: HTTPResponse, config: Config) -> ApiError:
1006
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1007
+
1008
+ match code.lower():
1009
+ case "internalservererror":
1010
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1011
+
1012
+ case "resourcenotfound":
1013
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1014
+
1015
+ case _:
1016
+ return UnknownApiError(f"{code}: {message}")
1017
+
1018
+ async def _deserialize_get_type_templates_list(http_response: HTTPResponse, config: Config) -> GetTypeTemplatesListOutput:
1019
+ if http_response.status != 200 and http_response.status >= 300:
1020
+ raise await _deserialize_error_get_type_templates_list(http_response, config)
1021
+
1022
+ kwargs: dict[str, Any] = {}
1023
+
1024
+ body = await http_response.consume_body_async()
1025
+ if body:
1026
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1027
+ deserializer = codec.create_deserializer(body)
1028
+ body_kwargs = GetTypeTemplatesListOutput.deserialize_kwargs(deserializer)
1029
+ kwargs.update(body_kwargs)
1030
+
1031
+ return GetTypeTemplatesListOutput(**kwargs)
1032
+
1033
+ async def _deserialize_error_get_type_templates_list(http_response: HTTPResponse, config: Config) -> ApiError:
1034
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1035
+
1036
+ match code.lower():
1037
+ case "internalservererror":
1038
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1039
+
1040
+ case _:
1041
+ return UnknownApiError(f"{code}: {message}")
1042
+
1043
+ async def _deserialize_get_version(http_response: HTTPResponse, config: Config) -> GetVersionOutput:
1044
+ if http_response.status != 200 and http_response.status >= 300:
1045
+ raise await _deserialize_error_get_version(http_response, config)
1046
+
1047
+ kwargs: dict[str, Any] = {}
1048
+
1049
+ body = await http_response.consume_body_async()
1050
+ if body:
1051
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1052
+ deserializer = codec.create_deserializer(body)
1053
+ body_kwargs = GetVersionOutput.deserialize_kwargs(deserializer)
1054
+ kwargs.update(body_kwargs)
1055
+
1056
+ return GetVersionOutput(**kwargs)
1057
+
1058
+ async def _deserialize_error_get_version(http_response: HTTPResponse, config: Config) -> ApiError:
1059
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1060
+
1061
+ match code.lower():
1062
+ case "internalservererror":
1063
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1064
+
1065
+ case "resourcenotfound":
1066
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1067
+
1068
+ case _:
1069
+ return UnknownApiError(f"{code}: {message}")
1070
+
1071
+ async def _deserialize_get_webhook(http_response: HTTPResponse, config: Config) -> GetWebhookOutput:
1072
+ if http_response.status != 200 and http_response.status >= 300:
1073
+ raise await _deserialize_error_get_webhook(http_response, config)
1074
+
1075
+ kwargs: dict[str, Any] = {}
1076
+
1077
+ body = await http_response.consume_body_async()
1078
+ if body:
1079
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1080
+ deserializer = codec.create_deserializer(body)
1081
+ body_kwargs = GetWebhookOutput.deserialize_kwargs(deserializer)
1082
+ kwargs.update(body_kwargs)
1083
+
1084
+ return GetWebhookOutput(**kwargs)
1085
+
1086
+ async def _deserialize_error_get_webhook(http_response: HTTPResponse, config: Config) -> ApiError:
1087
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1088
+
1089
+ match code.lower():
1090
+ case "internalservererror":
1091
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1092
+
1093
+ case "resourcenotfound":
1094
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1095
+
1096
+ case _:
1097
+ return UnknownApiError(f"{code}: {message}")
1098
+
1099
+ async def _deserialize_get_webhook_by_event(http_response: HTTPResponse, config: Config) -> GetWebhookByEventOutput:
1100
+ if http_response.status != 200 and http_response.status >= 300:
1101
+ raise await _deserialize_error_get_webhook_by_event(http_response, config)
1102
+
1103
+ kwargs: dict[str, Any] = {}
1104
+
1105
+ body = await http_response.consume_body_async()
1106
+ if body:
1107
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1108
+ deserializer = codec.create_deserializer(body)
1109
+ body_kwargs = GetWebhookByEventOutput.deserialize_kwargs(deserializer)
1110
+ kwargs.update(body_kwargs)
1111
+
1112
+ return GetWebhookByEventOutput(**kwargs)
1113
+
1114
+ async def _deserialize_error_get_webhook_by_event(http_response: HTTPResponse, config: Config) -> ApiError:
1115
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1116
+
1117
+ match code.lower():
1118
+ case "internalservererror":
1119
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1120
+
1121
+ case "resourcenotfound":
1122
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1123
+
1124
+ case _:
1125
+ return UnknownApiError(f"{code}: {message}")
1126
+
1127
+ async def _deserialize_get_workspace(http_response: HTTPResponse, config: Config) -> GetWorkspaceOutput:
1128
+ if http_response.status != 200 and http_response.status >= 300:
1129
+ raise await _deserialize_error_get_workspace(http_response, config)
1130
+
1131
+ kwargs: dict[str, Any] = {}
1132
+
1133
+ body = await http_response.consume_body_async()
1134
+ if body:
1135
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1136
+ deserializer = codec.create_deserializer(body)
1137
+ body_kwargs = GetWorkspaceOutput.deserialize_kwargs(deserializer)
1138
+ kwargs.update(body_kwargs)
1139
+
1140
+ return GetWorkspaceOutput(**kwargs)
1141
+
1142
+ async def _deserialize_error_get_workspace(http_response: HTTPResponse, config: Config) -> ApiError:
1143
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1144
+
1145
+ match code.lower():
1146
+ case "internalservererror":
1147
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1148
+
1149
+ case "resourcenotfound":
1150
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1151
+
1152
+ case _:
1153
+ return UnknownApiError(f"{code}: {message}")
1154
+
1155
+ async def _deserialize_list_audit_logs(http_response: HTTPResponse, config: Config) -> ListAuditLogsOutput:
1156
+ if http_response.status != 200 and http_response.status >= 300:
1157
+ raise await _deserialize_error_list_audit_logs(http_response, config)
1158
+
1159
+ kwargs: dict[str, Any] = {}
1160
+
1161
+ body = await http_response.consume_body_async()
1162
+ if body:
1163
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1164
+ deserializer = codec.create_deserializer(body)
1165
+ body_kwargs = ListAuditLogsOutput.deserialize_kwargs(deserializer)
1166
+ kwargs.update(body_kwargs)
1167
+
1168
+ return ListAuditLogsOutput(**kwargs)
1169
+
1170
+ async def _deserialize_error_list_audit_logs(http_response: HTTPResponse, config: Config) -> ApiError:
1171
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1172
+
1173
+ match code.lower():
1174
+ case "internalservererror":
1175
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1176
+
1177
+ case _:
1178
+ return UnknownApiError(f"{code}: {message}")
1179
+
1180
+ async def _deserialize_list_contexts(http_response: HTTPResponse, config: Config) -> ListContextsOutput:
1181
+ if http_response.status != 200 and http_response.status >= 300:
1182
+ raise await _deserialize_error_list_contexts(http_response, config)
1183
+
1184
+ kwargs: dict[str, Any] = {}
1185
+
1186
+ body = await http_response.consume_body_async()
1187
+ if body:
1188
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1189
+ deserializer = codec.create_deserializer(body)
1190
+ body_kwargs = ListContextsOutput.deserialize_kwargs(deserializer)
1191
+ kwargs.update(body_kwargs)
1192
+
1193
+ return ListContextsOutput(**kwargs)
1194
+
1195
+ async def _deserialize_error_list_contexts(http_response: HTTPResponse, config: Config) -> ApiError:
1196
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1197
+
1198
+ match code.lower():
1199
+ case "internalservererror":
1200
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1201
+
1202
+ case _:
1203
+ return UnknownApiError(f"{code}: {message}")
1204
+
1205
+ async def _deserialize_list_default_configs(http_response: HTTPResponse, config: Config) -> ListDefaultConfigsOutput:
1206
+ if http_response.status != 200 and http_response.status >= 300:
1207
+ raise await _deserialize_error_list_default_configs(http_response, config)
1208
+
1209
+ kwargs: dict[str, Any] = {}
1210
+
1211
+ body = await http_response.consume_body_async()
1212
+ if body:
1213
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1214
+ deserializer = codec.create_deserializer(body)
1215
+ body_kwargs = ListDefaultConfigsOutput.deserialize_kwargs(deserializer)
1216
+ kwargs.update(body_kwargs)
1217
+
1218
+ return ListDefaultConfigsOutput(**kwargs)
1219
+
1220
+ async def _deserialize_error_list_default_configs(http_response: HTTPResponse, config: Config) -> ApiError:
1221
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1222
+
1223
+ match code.lower():
1224
+ case "internalservererror":
1225
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1226
+
1227
+ case _:
1228
+ return UnknownApiError(f"{code}: {message}")
1229
+
1230
+ async def _deserialize_list_dimensions(http_response: HTTPResponse, config: Config) -> ListDimensionsOutput:
1231
+ if http_response.status != 200 and http_response.status >= 300:
1232
+ raise await _deserialize_error_list_dimensions(http_response, config)
1233
+
1234
+ kwargs: dict[str, Any] = {}
1235
+
1236
+ body = await http_response.consume_body_async()
1237
+ if body:
1238
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1239
+ deserializer = codec.create_deserializer(body)
1240
+ body_kwargs = ListDimensionsOutput.deserialize_kwargs(deserializer)
1241
+ kwargs.update(body_kwargs)
1242
+
1243
+ return ListDimensionsOutput(**kwargs)
1244
+
1245
+ async def _deserialize_error_list_dimensions(http_response: HTTPResponse, config: Config) -> ApiError:
1246
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1247
+
1248
+ match code.lower():
1249
+ case "internalservererror":
1250
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1251
+
1252
+ case _:
1253
+ return UnknownApiError(f"{code}: {message}")
1254
+
1255
+ async def _deserialize_list_experiment(http_response: HTTPResponse, config: Config) -> ListExperimentOutput:
1256
+ if http_response.status != 200 and http_response.status >= 300:
1257
+ raise await _deserialize_error_list_experiment(http_response, config)
1258
+
1259
+ kwargs: dict[str, Any] = {}
1260
+
1261
+ body = await http_response.consume_body_async()
1262
+ if body:
1263
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1264
+ deserializer = codec.create_deserializer(body)
1265
+ body_kwargs = ListExperimentOutput.deserialize_kwargs(deserializer)
1266
+ kwargs.update(body_kwargs)
1267
+
1268
+ return ListExperimentOutput(**kwargs)
1269
+
1270
+ async def _deserialize_error_list_experiment(http_response: HTTPResponse, config: Config) -> ApiError:
1271
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1272
+
1273
+ match code.lower():
1274
+ case "internalservererror":
1275
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1276
+
1277
+ case _:
1278
+ return UnknownApiError(f"{code}: {message}")
1279
+
1280
+ async def _deserialize_list_experiment_groups(http_response: HTTPResponse, config: Config) -> ListExperimentGroupsOutput:
1281
+ if http_response.status != 200 and http_response.status >= 300:
1282
+ raise await _deserialize_error_list_experiment_groups(http_response, config)
1283
+
1284
+ kwargs: dict[str, Any] = {}
1285
+
1286
+ body = await http_response.consume_body_async()
1287
+ if body:
1288
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1289
+ deserializer = codec.create_deserializer(body)
1290
+ body_kwargs = ListExperimentGroupsOutput.deserialize_kwargs(deserializer)
1291
+ kwargs.update(body_kwargs)
1292
+
1293
+ return ListExperimentGroupsOutput(**kwargs)
1294
+
1295
+ async def _deserialize_error_list_experiment_groups(http_response: HTTPResponse, config: Config) -> ApiError:
1296
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1297
+
1298
+ match code.lower():
1299
+ case "internalservererror":
1300
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1301
+
1302
+ case _:
1303
+ return UnknownApiError(f"{code}: {message}")
1304
+
1305
+ async def _deserialize_list_function(http_response: HTTPResponse, config: Config) -> ListFunctionOutput:
1306
+ if http_response.status != 200 and http_response.status >= 300:
1307
+ raise await _deserialize_error_list_function(http_response, config)
1308
+
1309
+ kwargs: dict[str, Any] = {}
1310
+
1311
+ body = await http_response.consume_body_async()
1312
+ if body:
1313
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1314
+ deserializer = codec.create_deserializer(body)
1315
+ body_kwargs = ListFunctionOutput.deserialize_kwargs(deserializer)
1316
+ kwargs.update(body_kwargs)
1317
+
1318
+ return ListFunctionOutput(**kwargs)
1319
+
1320
+ async def _deserialize_error_list_function(http_response: HTTPResponse, config: Config) -> ApiError:
1321
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1322
+
1323
+ match code.lower():
1324
+ case "internalservererror":
1325
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1326
+
1327
+ case _:
1328
+ return UnknownApiError(f"{code}: {message}")
1329
+
1330
+ async def _deserialize_list_organisation(http_response: HTTPResponse, config: Config) -> ListOrganisationOutput:
1331
+ if http_response.status != 200 and http_response.status >= 300:
1332
+ raise await _deserialize_error_list_organisation(http_response, config)
1333
+
1334
+ kwargs: dict[str, Any] = {}
1335
+
1336
+ body = await http_response.consume_body_async()
1337
+ if body:
1338
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1339
+ deserializer = codec.create_deserializer(body)
1340
+ body_kwargs = ListOrganisationOutput.deserialize_kwargs(deserializer)
1341
+ kwargs.update(body_kwargs)
1342
+
1343
+ return ListOrganisationOutput(**kwargs)
1344
+
1345
+ async def _deserialize_error_list_organisation(http_response: HTTPResponse, config: Config) -> ApiError:
1346
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1347
+
1348
+ match code.lower():
1349
+ case "internalservererror":
1350
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1351
+
1352
+ case _:
1353
+ return UnknownApiError(f"{code}: {message}")
1354
+
1355
+ async def _deserialize_list_versions(http_response: HTTPResponse, config: Config) -> ListVersionsOutput:
1356
+ if http_response.status != 200 and http_response.status >= 300:
1357
+ raise await _deserialize_error_list_versions(http_response, config)
1358
+
1359
+ kwargs: dict[str, Any] = {}
1360
+
1361
+ body = await http_response.consume_body_async()
1362
+ if body:
1363
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1364
+ deserializer = codec.create_deserializer(body)
1365
+ body_kwargs = ListVersionsOutput.deserialize_kwargs(deserializer)
1366
+ kwargs.update(body_kwargs)
1367
+
1368
+ return ListVersionsOutput(**kwargs)
1369
+
1370
+ async def _deserialize_error_list_versions(http_response: HTTPResponse, config: Config) -> ApiError:
1371
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1372
+
1373
+ match code.lower():
1374
+ case "internalservererror":
1375
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1376
+
1377
+ case _:
1378
+ return UnknownApiError(f"{code}: {message}")
1379
+
1380
+ async def _deserialize_list_webhook(http_response: HTTPResponse, config: Config) -> ListWebhookOutput:
1381
+ if http_response.status != 200 and http_response.status >= 300:
1382
+ raise await _deserialize_error_list_webhook(http_response, config)
1383
+
1384
+ kwargs: dict[str, Any] = {}
1385
+
1386
+ body = await http_response.consume_body_async()
1387
+ if body:
1388
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1389
+ deserializer = codec.create_deserializer(body)
1390
+ body_kwargs = ListWebhookOutput.deserialize_kwargs(deserializer)
1391
+ kwargs.update(body_kwargs)
1392
+
1393
+ return ListWebhookOutput(**kwargs)
1394
+
1395
+ async def _deserialize_error_list_webhook(http_response: HTTPResponse, config: Config) -> ApiError:
1396
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1397
+
1398
+ match code.lower():
1399
+ case "internalservererror":
1400
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1401
+
1402
+ case _:
1403
+ return UnknownApiError(f"{code}: {message}")
1404
+
1405
+ async def _deserialize_list_workspace(http_response: HTTPResponse, config: Config) -> ListWorkspaceOutput:
1406
+ if http_response.status != 200 and http_response.status >= 300:
1407
+ raise await _deserialize_error_list_workspace(http_response, config)
1408
+
1409
+ kwargs: dict[str, Any] = {}
1410
+
1411
+ body = await http_response.consume_body_async()
1412
+ if body:
1413
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1414
+ deserializer = codec.create_deserializer(body)
1415
+ body_kwargs = ListWorkspaceOutput.deserialize_kwargs(deserializer)
1416
+ kwargs.update(body_kwargs)
1417
+
1418
+ return ListWorkspaceOutput(**kwargs)
1419
+
1420
+ async def _deserialize_error_list_workspace(http_response: HTTPResponse, config: Config) -> ApiError:
1421
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1422
+
1423
+ match code.lower():
1424
+ case "internalservererror":
1425
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1426
+
1427
+ case _:
1428
+ return UnknownApiError(f"{code}: {message}")
1429
+
1430
+ async def _deserialize_migrate_workspace_schema(http_response: HTTPResponse, config: Config) -> MigrateWorkspaceSchemaOutput:
1431
+ if http_response.status != 200 and http_response.status >= 300:
1432
+ raise await _deserialize_error_migrate_workspace_schema(http_response, config)
1433
+
1434
+ kwargs: dict[str, Any] = {}
1435
+
1436
+ body = await http_response.consume_body_async()
1437
+ if body:
1438
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1439
+ deserializer = codec.create_deserializer(body)
1440
+ body_kwargs = MigrateWorkspaceSchemaOutput.deserialize_kwargs(deserializer)
1441
+ kwargs.update(body_kwargs)
1442
+
1443
+ return MigrateWorkspaceSchemaOutput(**kwargs)
1444
+
1445
+ async def _deserialize_error_migrate_workspace_schema(http_response: HTTPResponse, config: Config) -> ApiError:
1446
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1447
+
1448
+ match code.lower():
1449
+ case "internalservererror":
1450
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1451
+
1452
+ case "resourcenotfound":
1453
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1454
+
1455
+ case _:
1456
+ return UnknownApiError(f"{code}: {message}")
1457
+
1458
+ async def _deserialize_move_context(http_response: HTTPResponse, config: Config) -> MoveContextOutput:
1459
+ if http_response.status != 200 and http_response.status >= 300:
1460
+ raise await _deserialize_error_move_context(http_response, config)
1461
+
1462
+ kwargs: dict[str, Any] = {}
1463
+
1464
+ body = await http_response.consume_body_async()
1465
+ if body:
1466
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1467
+ deserializer = codec.create_deserializer(body)
1468
+ body_kwargs = MoveContextOutput.deserialize_kwargs(deserializer)
1469
+ kwargs.update(body_kwargs)
1470
+
1471
+ return MoveContextOutput(**kwargs)
1472
+
1473
+ async def _deserialize_error_move_context(http_response: HTTPResponse, config: Config) -> ApiError:
1474
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1475
+
1476
+ match code.lower():
1477
+ case "internalservererror":
1478
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1479
+
1480
+ case "resourcenotfound":
1481
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1482
+
1483
+ case _:
1484
+ return UnknownApiError(f"{code}: {message}")
1485
+
1486
+ async def _deserialize_pause_experiment(http_response: HTTPResponse, config: Config) -> PauseExperimentOutput:
1487
+ if http_response.status != 200 and http_response.status >= 300:
1488
+ raise await _deserialize_error_pause_experiment(http_response, config)
1489
+
1490
+ kwargs: dict[str, Any] = {}
1491
+
1492
+ body = await http_response.consume_body_async()
1493
+ if body:
1494
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1495
+ deserializer = codec.create_deserializer(body)
1496
+ body_kwargs = PauseExperimentOutput.deserialize_kwargs(deserializer)
1497
+ kwargs.update(body_kwargs)
1498
+
1499
+ return PauseExperimentOutput(**kwargs)
1500
+
1501
+ async def _deserialize_error_pause_experiment(http_response: HTTPResponse, config: Config) -> ApiError:
1502
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1503
+
1504
+ match code.lower():
1505
+ case "internalservererror":
1506
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1507
+
1508
+ case "resourcenotfound":
1509
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1510
+
1511
+ case _:
1512
+ return UnknownApiError(f"{code}: {message}")
1513
+
1514
+ async def _deserialize_publish(http_response: HTTPResponse, config: Config) -> PublishOutput:
1515
+ if http_response.status != 200 and http_response.status >= 300:
1516
+ raise await _deserialize_error_publish(http_response, config)
1517
+
1518
+ kwargs: dict[str, Any] = {}
1519
+
1520
+ body = await http_response.consume_body_async()
1521
+ if body:
1522
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1523
+ deserializer = codec.create_deserializer(body)
1524
+ body_kwargs = PublishOutput.deserialize_kwargs(deserializer)
1525
+ kwargs.update(body_kwargs)
1526
+
1527
+ return PublishOutput(**kwargs)
1528
+
1529
+ async def _deserialize_error_publish(http_response: HTTPResponse, config: Config) -> ApiError:
1530
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1531
+
1532
+ match code.lower():
1533
+ case "internalservererror":
1534
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1535
+
1536
+ case "resourcenotfound":
1537
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1538
+
1539
+ case _:
1540
+ return UnknownApiError(f"{code}: {message}")
1541
+
1542
+ async def _deserialize_ramp_experiment(http_response: HTTPResponse, config: Config) -> RampExperimentOutput:
1543
+ if http_response.status != 200 and http_response.status >= 300:
1544
+ raise await _deserialize_error_ramp_experiment(http_response, config)
1545
+
1546
+ kwargs: dict[str, Any] = {}
1547
+
1548
+ body = await http_response.consume_body_async()
1549
+ if body:
1550
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1551
+ deserializer = codec.create_deserializer(body)
1552
+ body_kwargs = RampExperimentOutput.deserialize_kwargs(deserializer)
1553
+ kwargs.update(body_kwargs)
1554
+
1555
+ return RampExperimentOutput(**kwargs)
1556
+
1557
+ async def _deserialize_error_ramp_experiment(http_response: HTTPResponse, config: Config) -> ApiError:
1558
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1559
+
1560
+ match code.lower():
1561
+ case "internalservererror":
1562
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1563
+
1564
+ case "resourcenotfound":
1565
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1566
+
1567
+ case _:
1568
+ return UnknownApiError(f"{code}: {message}")
1569
+
1570
+ async def _deserialize_remove_members_from_group(http_response: HTTPResponse, config: Config) -> RemoveMembersFromGroupOutput:
1571
+ if http_response.status != 200 and http_response.status >= 300:
1572
+ raise await _deserialize_error_remove_members_from_group(http_response, config)
1573
+
1574
+ kwargs: dict[str, Any] = {}
1575
+
1576
+ body = await http_response.consume_body_async()
1577
+ if body:
1578
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1579
+ deserializer = codec.create_deserializer(body)
1580
+ body_kwargs = RemoveMembersFromGroupOutput.deserialize_kwargs(deserializer)
1581
+ kwargs.update(body_kwargs)
1582
+
1583
+ return RemoveMembersFromGroupOutput(**kwargs)
1584
+
1585
+ async def _deserialize_error_remove_members_from_group(http_response: HTTPResponse, config: Config) -> ApiError:
1586
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1587
+
1588
+ match code.lower():
1589
+ case "internalservererror":
1590
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1591
+
1592
+ case "resourcenotfound":
1593
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1594
+
1595
+ case _:
1596
+ return UnknownApiError(f"{code}: {message}")
1597
+
1598
+ async def _deserialize_resume_experiment(http_response: HTTPResponse, config: Config) -> ResumeExperimentOutput:
1599
+ if http_response.status != 200 and http_response.status >= 300:
1600
+ raise await _deserialize_error_resume_experiment(http_response, config)
1601
+
1602
+ kwargs: dict[str, Any] = {}
1603
+
1604
+ body = await http_response.consume_body_async()
1605
+ if body:
1606
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1607
+ deserializer = codec.create_deserializer(body)
1608
+ body_kwargs = ResumeExperimentOutput.deserialize_kwargs(deserializer)
1609
+ kwargs.update(body_kwargs)
1610
+
1611
+ return ResumeExperimentOutput(**kwargs)
1612
+
1613
+ async def _deserialize_error_resume_experiment(http_response: HTTPResponse, config: Config) -> ApiError:
1614
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1615
+
1616
+ match code.lower():
1617
+ case "internalservererror":
1618
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1619
+
1620
+ case "resourcenotfound":
1621
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1622
+
1623
+ case _:
1624
+ return UnknownApiError(f"{code}: {message}")
1625
+
1626
+ async def _deserialize_test(http_response: HTTPResponse, config: Config) -> TestOutput:
1627
+ if http_response.status != 200 and http_response.status >= 300:
1628
+ raise await _deserialize_error_test(http_response, config)
1629
+
1630
+ kwargs: dict[str, Any] = {}
1631
+
1632
+ body = await http_response.consume_body_async()
1633
+ if body:
1634
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1635
+ deserializer = codec.create_deserializer(body)
1636
+ body_kwargs = TestOutput.deserialize_kwargs(deserializer)
1637
+ kwargs.update(body_kwargs)
1638
+
1639
+ return TestOutput(**kwargs)
1640
+
1641
+ async def _deserialize_error_test(http_response: HTTPResponse, config: Config) -> ApiError:
1642
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1643
+
1644
+ match code.lower():
1645
+ case "internalservererror":
1646
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1647
+
1648
+ case "resourcenotfound":
1649
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1650
+
1651
+ case _:
1652
+ return UnknownApiError(f"{code}: {message}")
1653
+
1654
+ async def _deserialize_update_default_config(http_response: HTTPResponse, config: Config) -> UpdateDefaultConfigOutput:
1655
+ if http_response.status != 200 and http_response.status >= 300:
1656
+ raise await _deserialize_error_update_default_config(http_response, config)
1657
+
1658
+ kwargs: dict[str, Any] = {}
1659
+
1660
+ body = await http_response.consume_body_async()
1661
+ if body:
1662
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1663
+ deserializer = codec.create_deserializer(body)
1664
+ body_kwargs = UpdateDefaultConfigOutput.deserialize_kwargs(deserializer)
1665
+ kwargs.update(body_kwargs)
1666
+
1667
+ return UpdateDefaultConfigOutput(**kwargs)
1668
+
1669
+ async def _deserialize_error_update_default_config(http_response: HTTPResponse, config: Config) -> ApiError:
1670
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1671
+
1672
+ match code.lower():
1673
+ case "internalservererror":
1674
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1675
+
1676
+ case "resourcenotfound":
1677
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1678
+
1679
+ case _:
1680
+ return UnknownApiError(f"{code}: {message}")
1681
+
1682
+ async def _deserialize_update_dimension(http_response: HTTPResponse, config: Config) -> UpdateDimensionOutput:
1683
+ if http_response.status != 200 and http_response.status >= 300:
1684
+ raise await _deserialize_error_update_dimension(http_response, config)
1685
+
1686
+ kwargs: dict[str, Any] = {}
1687
+
1688
+ body = await http_response.consume_body_async()
1689
+ if body:
1690
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1691
+ deserializer = codec.create_deserializer(body)
1692
+ body_kwargs = UpdateDimensionOutput.deserialize_kwargs(deserializer)
1693
+ kwargs.update(body_kwargs)
1694
+
1695
+ return UpdateDimensionOutput(**kwargs)
1696
+
1697
+ async def _deserialize_error_update_dimension(http_response: HTTPResponse, config: Config) -> ApiError:
1698
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1699
+
1700
+ match code.lower():
1701
+ case "internalservererror":
1702
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1703
+
1704
+ case "resourcenotfound":
1705
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1706
+
1707
+ case _:
1708
+ return UnknownApiError(f"{code}: {message}")
1709
+
1710
+ async def _deserialize_update_experiment_group(http_response: HTTPResponse, config: Config) -> UpdateExperimentGroupOutput:
1711
+ if http_response.status != 200 and http_response.status >= 300:
1712
+ raise await _deserialize_error_update_experiment_group(http_response, config)
1713
+
1714
+ kwargs: dict[str, Any] = {}
1715
+
1716
+ body = await http_response.consume_body_async()
1717
+ if body:
1718
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1719
+ deserializer = codec.create_deserializer(body)
1720
+ body_kwargs = UpdateExperimentGroupOutput.deserialize_kwargs(deserializer)
1721
+ kwargs.update(body_kwargs)
1722
+
1723
+ return UpdateExperimentGroupOutput(**kwargs)
1724
+
1725
+ async def _deserialize_error_update_experiment_group(http_response: HTTPResponse, config: Config) -> ApiError:
1726
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1727
+
1728
+ match code.lower():
1729
+ case "internalservererror":
1730
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1731
+
1732
+ case "resourcenotfound":
1733
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1734
+
1735
+ case _:
1736
+ return UnknownApiError(f"{code}: {message}")
1737
+
1738
+ async def _deserialize_update_function(http_response: HTTPResponse, config: Config) -> UpdateFunctionOutput:
1739
+ if http_response.status != 200 and http_response.status >= 300:
1740
+ raise await _deserialize_error_update_function(http_response, config)
1741
+
1742
+ kwargs: dict[str, Any] = {}
1743
+
1744
+ body = await http_response.consume_body_async()
1745
+ if body:
1746
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1747
+ deserializer = codec.create_deserializer(body)
1748
+ body_kwargs = UpdateFunctionOutput.deserialize_kwargs(deserializer)
1749
+ kwargs.update(body_kwargs)
1750
+
1751
+ return UpdateFunctionOutput(**kwargs)
1752
+
1753
+ async def _deserialize_error_update_function(http_response: HTTPResponse, config: Config) -> ApiError:
1754
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1755
+
1756
+ match code.lower():
1757
+ case "internalservererror":
1758
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1759
+
1760
+ case "resourcenotfound":
1761
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1762
+
1763
+ case _:
1764
+ return UnknownApiError(f"{code}: {message}")
1765
+
1766
+ async def _deserialize_update_organisation(http_response: HTTPResponse, config: Config) -> UpdateOrganisationOutput:
1767
+ if http_response.status != 200 and http_response.status >= 300:
1768
+ raise await _deserialize_error_update_organisation(http_response, config)
1769
+
1770
+ kwargs: dict[str, Any] = {}
1771
+
1772
+ body = await http_response.consume_body_async()
1773
+ if body:
1774
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1775
+ deserializer = codec.create_deserializer(body)
1776
+ body_kwargs = UpdateOrganisationOutput.deserialize_kwargs(deserializer)
1777
+ kwargs.update(body_kwargs)
1778
+
1779
+ return UpdateOrganisationOutput(**kwargs)
1780
+
1781
+ async def _deserialize_error_update_organisation(http_response: HTTPResponse, config: Config) -> ApiError:
1782
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1783
+
1784
+ match code.lower():
1785
+ case "internalservererror":
1786
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1787
+
1788
+ case "resourcenotfound":
1789
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1790
+
1791
+ case _:
1792
+ return UnknownApiError(f"{code}: {message}")
1793
+
1794
+ async def _deserialize_update_override(http_response: HTTPResponse, config: Config) -> UpdateOverrideOutput:
1795
+ if http_response.status != 200 and http_response.status >= 300:
1796
+ raise await _deserialize_error_update_override(http_response, config)
1797
+
1798
+ kwargs: dict[str, Any] = {}
1799
+
1800
+ body = await http_response.consume_body_async()
1801
+ if body:
1802
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1803
+ deserializer = codec.create_deserializer(body)
1804
+ body_kwargs = UpdateOverrideOutput.deserialize_kwargs(deserializer)
1805
+ kwargs.update(body_kwargs)
1806
+
1807
+ return UpdateOverrideOutput(**kwargs)
1808
+
1809
+ async def _deserialize_error_update_override(http_response: HTTPResponse, config: Config) -> ApiError:
1810
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1811
+
1812
+ match code.lower():
1813
+ case "internalservererror":
1814
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1815
+
1816
+ case "resourcenotfound":
1817
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1818
+
1819
+ case _:
1820
+ return UnknownApiError(f"{code}: {message}")
1821
+
1822
+ async def _deserialize_update_overrides_experiment(http_response: HTTPResponse, config: Config) -> UpdateOverridesExperimentOutput:
1823
+ if http_response.status != 200 and http_response.status >= 300:
1824
+ raise await _deserialize_error_update_overrides_experiment(http_response, config)
1825
+
1826
+ kwargs: dict[str, Any] = {}
1827
+
1828
+ body = await http_response.consume_body_async()
1829
+ if body:
1830
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1831
+ deserializer = codec.create_deserializer(body)
1832
+ body_kwargs = UpdateOverridesExperimentOutput.deserialize_kwargs(deserializer)
1833
+ kwargs.update(body_kwargs)
1834
+
1835
+ return UpdateOverridesExperimentOutput(**kwargs)
1836
+
1837
+ async def _deserialize_error_update_overrides_experiment(http_response: HTTPResponse, config: Config) -> ApiError:
1838
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1839
+
1840
+ match code.lower():
1841
+ case "internalservererror":
1842
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1843
+
1844
+ case "resourcenotfound":
1845
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1846
+
1847
+ case _:
1848
+ return UnknownApiError(f"{code}: {message}")
1849
+
1850
+ async def _deserialize_update_type_templates(http_response: HTTPResponse, config: Config) -> UpdateTypeTemplatesOutput:
1851
+ if http_response.status != 200 and http_response.status >= 300:
1852
+ raise await _deserialize_error_update_type_templates(http_response, config)
1853
+
1854
+ kwargs: dict[str, Any] = {}
1855
+
1856
+ body = await http_response.consume_body_async()
1857
+ if body:
1858
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1859
+ deserializer = codec.create_deserializer(body)
1860
+ body_kwargs = UpdateTypeTemplatesOutput.deserialize_kwargs(deserializer)
1861
+ kwargs.update(body_kwargs)
1862
+
1863
+ return UpdateTypeTemplatesOutput(**kwargs)
1864
+
1865
+ async def _deserialize_error_update_type_templates(http_response: HTTPResponse, config: Config) -> ApiError:
1866
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1867
+
1868
+ match code.lower():
1869
+ case "internalservererror":
1870
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1871
+
1872
+ case "resourcenotfound":
1873
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1874
+
1875
+ case _:
1876
+ return UnknownApiError(f"{code}: {message}")
1877
+
1878
+ async def _deserialize_update_webhook(http_response: HTTPResponse, config: Config) -> UpdateWebhookOutput:
1879
+ if http_response.status != 200 and http_response.status >= 300:
1880
+ raise await _deserialize_error_update_webhook(http_response, config)
1881
+
1882
+ kwargs: dict[str, Any] = {}
1883
+
1884
+ body = await http_response.consume_body_async()
1885
+ if body:
1886
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1887
+ deserializer = codec.create_deserializer(body)
1888
+ body_kwargs = UpdateWebhookOutput.deserialize_kwargs(deserializer)
1889
+ kwargs.update(body_kwargs)
1890
+
1891
+ return UpdateWebhookOutput(**kwargs)
1892
+
1893
+ async def _deserialize_error_update_webhook(http_response: HTTPResponse, config: Config) -> ApiError:
1894
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1895
+
1896
+ match code.lower():
1897
+ case "internalservererror":
1898
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1899
+
1900
+ case "resourcenotfound":
1901
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1902
+
1903
+ case _:
1904
+ return UnknownApiError(f"{code}: {message}")
1905
+
1906
+ async def _deserialize_update_workspace(http_response: HTTPResponse, config: Config) -> UpdateWorkspaceOutput:
1907
+ if http_response.status != 200 and http_response.status >= 300:
1908
+ raise await _deserialize_error_update_workspace(http_response, config)
1909
+
1910
+ kwargs: dict[str, Any] = {}
1911
+
1912
+ body = await http_response.consume_body_async()
1913
+ if body:
1914
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1915
+ deserializer = codec.create_deserializer(body)
1916
+ body_kwargs = UpdateWorkspaceOutput.deserialize_kwargs(deserializer)
1917
+ kwargs.update(body_kwargs)
1918
+
1919
+ return UpdateWorkspaceOutput(**kwargs)
1920
+
1921
+ async def _deserialize_error_update_workspace(http_response: HTTPResponse, config: Config) -> ApiError:
1922
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1923
+
1924
+ match code.lower():
1925
+ case "internalservererror":
1926
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1927
+
1928
+ case "resourcenotfound":
1929
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1930
+
1931
+ case _:
1932
+ return UnknownApiError(f"{code}: {message}")
1933
+
1934
+ async def _deserialize_validate_context(http_response: HTTPResponse, config: Config) -> ValidateContextOutput:
1935
+ if http_response.status != 200 and http_response.status >= 300:
1936
+ raise await _deserialize_error_validate_context(http_response, config)
1937
+
1938
+ kwargs: dict[str, Any] = {}
1939
+
1940
+ return ValidateContextOutput(**kwargs)
1941
+
1942
+ async def _deserialize_error_validate_context(http_response: HTTPResponse, config: Config) -> ApiError:
1943
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1944
+
1945
+ match code.lower():
1946
+ case "internalservererror":
1947
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1948
+
1949
+ case _:
1950
+ return UnknownApiError(f"{code}: {message}")
1951
+
1952
+ async def _deserialize_weight_recompute(http_response: HTTPResponse, config: Config) -> WeightRecomputeOutput:
1953
+ if http_response.status != 200 and http_response.status >= 300:
1954
+ raise await _deserialize_error_weight_recompute(http_response, config)
1955
+
1956
+ kwargs: dict[str, Any] = {}
1957
+
1958
+ body = await http_response.consume_body_async()
1959
+ if body:
1960
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1961
+ deserializer = codec.create_deserializer(body)
1962
+ body_kwargs = WeightRecomputeOutput.deserialize_kwargs(deserializer)
1963
+ kwargs.update(body_kwargs)
1964
+
1965
+ return WeightRecomputeOutput(**kwargs)
1966
+
1967
+ async def _deserialize_error_weight_recompute(http_response: HTTPResponse, config: Config) -> ApiError:
1968
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1969
+
1970
+ match code.lower():
1971
+ case "internalservererror":
1972
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1973
+
1974
+ case _:
1975
+ return UnknownApiError(f"{code}: {message}")
1976
+
1977
+ async def _deserialize_error_internal_server_error(
1978
+ http_response: HTTPResponse,
1979
+ config: Config,
1980
+ parsed_body: dict[str, DocumentValue] | None,
1981
+ default_message: str,
1982
+ ) -> InternalServerError:
1983
+ kwargs: dict[str, Any] = {"message": default_message}
1984
+
1985
+ if parsed_body is None:
1986
+ body = await http_response.consume_body_async()
1987
+ else:
1988
+ body = json.dumps(parsed_body).encode('utf-8')
1989
+
1990
+ if body:
1991
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1992
+ deserializer = codec.create_deserializer(body)
1993
+ body_kwargs = InternalServerError.deserialize_kwargs(deserializer)
1994
+ kwargs.update(body_kwargs)
1995
+
1996
+ return InternalServerError(**kwargs)
1997
+
1998
+ async def _deserialize_error_resource_not_found(
1999
+ http_response: HTTPResponse,
2000
+ config: Config,
2001
+ parsed_body: dict[str, DocumentValue] | None,
2002
+ default_message: str,
2003
+ ) -> ResourceNotFound:
2004
+ kwargs: dict[str, Any] = {"message": default_message}
2005
+
2006
+ return ResourceNotFound(**kwargs)