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,2705 @@
1
+ # Code generated by smithy-python-codegen DO NOT EDIT.
2
+
3
+ from typing import AsyncIterable
4
+ from urllib.parse import quote as urlquote
5
+
6
+ from smithy_core import URI as _URI
7
+ from smithy_core.aio.types import AsyncBytesReader, SeekableAsyncBytesReader
8
+ from smithy_core.types import TimestampFormat
9
+ from smithy_core.utils import ensure_utc, serialize_rfc3339
10
+ from smithy_http import Field, Fields
11
+ from smithy_http.aio import HTTPRequest as _HTTPRequest
12
+ from smithy_http.aio.interfaces import HTTPRequest
13
+ from smithy_http.utils import join_query_params
14
+ from smithy_json import JSONCodec
15
+
16
+ from .config import Config
17
+ from .models import (
18
+ AddMembersToGroupInput,
19
+ ApplicableVariantsInput,
20
+ BulkOperationInput,
21
+ ConcludeExperimentInput,
22
+ CreateContextInput,
23
+ CreateDefaultConfigInput,
24
+ CreateDimensionInput,
25
+ CreateExperimentGroupInput,
26
+ CreateExperimentInput,
27
+ CreateFunctionInput,
28
+ CreateOrganisationInput,
29
+ CreateTypeTemplatesInput,
30
+ CreateWebhookInput,
31
+ CreateWorkspaceInput,
32
+ DeleteContextInput,
33
+ DeleteDefaultConfigInput,
34
+ DeleteDimensionInput,
35
+ DeleteExperimentGroupInput,
36
+ DeleteFunctionInput,
37
+ DeleteTypeTemplatesInput,
38
+ DeleteWebhookInput,
39
+ DiscardExperimentInput,
40
+ GetConfigFastInput,
41
+ GetConfigInput,
42
+ GetContextFromConditionInput,
43
+ GetContextInput,
44
+ GetDefaultConfigInput,
45
+ GetDimensionInput,
46
+ GetExperimentGroupInput,
47
+ GetExperimentInput,
48
+ GetFunctionInput,
49
+ GetOrganisationInput,
50
+ GetResolvedConfigInput,
51
+ GetTypeTemplateInput,
52
+ GetTypeTemplatesListInput,
53
+ GetVersionInput,
54
+ GetWebhookByEventInput,
55
+ GetWebhookInput,
56
+ GetWorkspaceInput,
57
+ ListAuditLogsInput,
58
+ ListContextsInput,
59
+ ListDefaultConfigsInput,
60
+ ListDimensionsInput,
61
+ ListExperimentGroupsInput,
62
+ ListExperimentInput,
63
+ ListFunctionInput,
64
+ ListOrganisationInput,
65
+ ListVersionsInput,
66
+ ListWebhookInput,
67
+ ListWorkspaceInput,
68
+ MigrateWorkspaceSchemaInput,
69
+ MoveContextInput,
70
+ PauseExperimentInput,
71
+ PublishInput,
72
+ RampExperimentInput,
73
+ RemoveMembersFromGroupInput,
74
+ ResumeExperimentInput,
75
+ ServiceError,
76
+ TestInput,
77
+ UpdateDefaultConfigInput,
78
+ UpdateDimensionInput,
79
+ UpdateExperimentGroupInput,
80
+ UpdateFunctionInput,
81
+ UpdateOrganisationInput,
82
+ UpdateOverrideInput,
83
+ UpdateOverridesExperimentInput,
84
+ UpdateTypeTemplatesInput,
85
+ UpdateWebhookInput,
86
+ UpdateWorkspaceInput,
87
+ ValidateContextInput,
88
+ WeightRecomputeInput,
89
+ )
90
+
91
+
92
+ async def _serialize_add_members_to_group(input: AddMembersToGroupInput, config: Config) -> HTTPRequest:
93
+ if not input.id:
94
+ raise ServiceError("id must not be empty.")
95
+
96
+ path = "/experiment-groups/{id}/add-members".format(
97
+ id=urlquote(input.id, safe=''),
98
+ )
99
+ query: str = f''
100
+
101
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
102
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
103
+ content = codec.serialize(input)
104
+ if not content:
105
+ content = b"{}"
106
+ content_length = len(content)
107
+ body = SeekableAsyncBytesReader(content)
108
+
109
+ headers = Fields(
110
+ [
111
+ Field(name="Content-Type", values=["application/json"]),
112
+ Field(name="Content-Length", values=[str(content_length)]),
113
+
114
+ ]
115
+ )
116
+
117
+ if input.workspace_id:
118
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
119
+ if input.org_id:
120
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
121
+ return _HTTPRequest(
122
+ destination=_URI(
123
+ host="",
124
+ path=path,
125
+ scheme="https",
126
+ query=query,
127
+ ),
128
+ method="PATCH",
129
+ fields=headers,
130
+ body=body,
131
+ )
132
+
133
+ async def _serialize_applicable_variants(input: ApplicableVariantsInput, config: Config) -> HTTPRequest:
134
+ path = "/experiments/applicable-variants"
135
+ query: str = f''
136
+
137
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
138
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
139
+ content = codec.serialize(input)
140
+ if not content:
141
+ content = b"{}"
142
+ content_length = len(content)
143
+ body = SeekableAsyncBytesReader(content)
144
+
145
+ headers = Fields(
146
+ [
147
+ Field(name="Content-Type", values=["application/json"]),
148
+ Field(name="Content-Length", values=[str(content_length)]),
149
+
150
+ ]
151
+ )
152
+
153
+ if input.workspace_id:
154
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
155
+ if input.org_id:
156
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
157
+ return _HTTPRequest(
158
+ destination=_URI(
159
+ host="",
160
+ path=path,
161
+ scheme="https",
162
+ query=query,
163
+ ),
164
+ method="POST",
165
+ fields=headers,
166
+ body=body,
167
+ )
168
+
169
+ async def _serialize_bulk_operation(input: BulkOperationInput, config: Config) -> HTTPRequest:
170
+ path = "/context/bulk-operations"
171
+ query: str = f''
172
+
173
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
174
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
175
+ content = codec.serialize(input)
176
+ if not content:
177
+ content = b"{}"
178
+ content_length = len(content)
179
+ body = SeekableAsyncBytesReader(content)
180
+
181
+ headers = Fields(
182
+ [
183
+ Field(name="Content-Type", values=["application/json"]),
184
+ Field(name="Content-Length", values=[str(content_length)]),
185
+
186
+ ]
187
+ )
188
+
189
+ if input.workspace_id:
190
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
191
+ if input.org_id:
192
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
193
+ if input.config_tags:
194
+ headers.extend(Fields([Field(name="x-config-tags", values=[input.config_tags])]))
195
+ return _HTTPRequest(
196
+ destination=_URI(
197
+ host="",
198
+ path=path,
199
+ scheme="https",
200
+ query=query,
201
+ ),
202
+ method="PUT",
203
+ fields=headers,
204
+ body=body,
205
+ )
206
+
207
+ async def _serialize_conclude_experiment(input: ConcludeExperimentInput, config: Config) -> HTTPRequest:
208
+ if not input.id:
209
+ raise ServiceError("id must not be empty.")
210
+
211
+ path = "/experiments/{id}/conclude".format(
212
+ id=urlquote(input.id, safe=''),
213
+ )
214
+ query: str = f''
215
+
216
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
217
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
218
+ content = codec.serialize(input)
219
+ if not content:
220
+ content = b"{}"
221
+ content_length = len(content)
222
+ body = SeekableAsyncBytesReader(content)
223
+
224
+ headers = Fields(
225
+ [
226
+ Field(name="Content-Type", values=["application/json"]),
227
+ Field(name="Content-Length", values=[str(content_length)]),
228
+
229
+ ]
230
+ )
231
+
232
+ if input.workspace_id:
233
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
234
+ if input.org_id:
235
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
236
+ return _HTTPRequest(
237
+ destination=_URI(
238
+ host="",
239
+ path=path,
240
+ scheme="https",
241
+ query=query,
242
+ ),
243
+ method="PATCH",
244
+ fields=headers,
245
+ body=body,
246
+ )
247
+
248
+ async def _serialize_create_context(input: CreateContextInput, config: Config) -> HTTPRequest:
249
+ path = "/context"
250
+ query: str = f''
251
+
252
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
253
+ content_length: int = 0
254
+ if input.request is not None:
255
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
256
+ content = codec.serialize(input.request)
257
+
258
+ content_length = len(content)
259
+ body = SeekableAsyncBytesReader(content)
260
+ else:
261
+ content_length = 2
262
+ body = SeekableAsyncBytesReader(b"{}")
263
+
264
+ headers = Fields(
265
+ [
266
+ Field(name="Content-Type", values=["application/json"]),
267
+ Field(name="Content-Length", values=[str(content_length)]),
268
+
269
+ ]
270
+ )
271
+
272
+ if input.workspace_id:
273
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
274
+ if input.org_id:
275
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
276
+ if input.config_tags:
277
+ headers.extend(Fields([Field(name="x-config-tags", values=[input.config_tags])]))
278
+ return _HTTPRequest(
279
+ destination=_URI(
280
+ host="",
281
+ path=path,
282
+ scheme="https",
283
+ query=query,
284
+ ),
285
+ method="PUT",
286
+ fields=headers,
287
+ body=body,
288
+ )
289
+
290
+ async def _serialize_create_default_config(input: CreateDefaultConfigInput, config: Config) -> HTTPRequest:
291
+ path = "/default-config"
292
+ query: str = f''
293
+
294
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
295
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
296
+ content = codec.serialize(input)
297
+ if not content:
298
+ content = b"{}"
299
+ content_length = len(content)
300
+ body = SeekableAsyncBytesReader(content)
301
+
302
+ headers = Fields(
303
+ [
304
+ Field(name="Content-Type", values=["application/json"]),
305
+ Field(name="Content-Length", values=[str(content_length)]),
306
+
307
+ ]
308
+ )
309
+
310
+ if input.workspace_id:
311
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
312
+ if input.org_id:
313
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
314
+ return _HTTPRequest(
315
+ destination=_URI(
316
+ host="",
317
+ path=path,
318
+ scheme="https",
319
+ query=query,
320
+ ),
321
+ method="POST",
322
+ fields=headers,
323
+ body=body,
324
+ )
325
+
326
+ async def _serialize_create_dimension(input: CreateDimensionInput, config: Config) -> HTTPRequest:
327
+ path = "/dimension"
328
+ query: str = f''
329
+
330
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
331
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
332
+ content = codec.serialize(input)
333
+ if not content:
334
+ content = b"{}"
335
+ content_length = len(content)
336
+ body = SeekableAsyncBytesReader(content)
337
+
338
+ headers = Fields(
339
+ [
340
+ Field(name="Content-Type", values=["application/json"]),
341
+ Field(name="Content-Length", values=[str(content_length)]),
342
+
343
+ ]
344
+ )
345
+
346
+ if input.workspace_id:
347
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
348
+ if input.org_id:
349
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
350
+ return _HTTPRequest(
351
+ destination=_URI(
352
+ host="",
353
+ path=path,
354
+ scheme="https",
355
+ query=query,
356
+ ),
357
+ method="POST",
358
+ fields=headers,
359
+ body=body,
360
+ )
361
+
362
+ async def _serialize_create_experiment(input: CreateExperimentInput, config: Config) -> HTTPRequest:
363
+ path = "/experiments"
364
+ query: str = f''
365
+
366
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
367
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
368
+ content = codec.serialize(input)
369
+ if not content:
370
+ content = b"{}"
371
+ content_length = len(content)
372
+ body = SeekableAsyncBytesReader(content)
373
+
374
+ headers = Fields(
375
+ [
376
+ Field(name="Content-Type", values=["application/json"]),
377
+ Field(name="Content-Length", values=[str(content_length)]),
378
+
379
+ ]
380
+ )
381
+
382
+ if input.workspace_id:
383
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
384
+ if input.org_id:
385
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
386
+ return _HTTPRequest(
387
+ destination=_URI(
388
+ host="",
389
+ path=path,
390
+ scheme="https",
391
+ query=query,
392
+ ),
393
+ method="POST",
394
+ fields=headers,
395
+ body=body,
396
+ )
397
+
398
+ async def _serialize_create_experiment_group(input: CreateExperimentGroupInput, config: Config) -> HTTPRequest:
399
+ path = "/experiment-groups"
400
+ query: str = f''
401
+
402
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
403
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
404
+ content = codec.serialize(input)
405
+ if not content:
406
+ content = b"{}"
407
+ content_length = len(content)
408
+ body = SeekableAsyncBytesReader(content)
409
+
410
+ headers = Fields(
411
+ [
412
+ Field(name="Content-Type", values=["application/json"]),
413
+ Field(name="Content-Length", values=[str(content_length)]),
414
+
415
+ ]
416
+ )
417
+
418
+ if input.workspace_id:
419
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
420
+ if input.org_id:
421
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
422
+ return _HTTPRequest(
423
+ destination=_URI(
424
+ host="",
425
+ path=path,
426
+ scheme="https",
427
+ query=query,
428
+ ),
429
+ method="POST",
430
+ fields=headers,
431
+ body=body,
432
+ )
433
+
434
+ async def _serialize_create_function(input: CreateFunctionInput, config: Config) -> HTTPRequest:
435
+ path = "/function"
436
+ query: str = f''
437
+
438
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
439
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
440
+ content = codec.serialize(input)
441
+ if not content:
442
+ content = b"{}"
443
+ content_length = len(content)
444
+ body = SeekableAsyncBytesReader(content)
445
+
446
+ headers = Fields(
447
+ [
448
+ Field(name="Content-Type", values=["application/json"]),
449
+ Field(name="Content-Length", values=[str(content_length)]),
450
+
451
+ ]
452
+ )
453
+
454
+ if input.workspace_id:
455
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
456
+ if input.org_id:
457
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
458
+ return _HTTPRequest(
459
+ destination=_URI(
460
+ host="",
461
+ path=path,
462
+ scheme="https",
463
+ query=query,
464
+ ),
465
+ method="POST",
466
+ fields=headers,
467
+ body=body,
468
+ )
469
+
470
+ async def _serialize_create_organisation(input: CreateOrganisationInput, config: Config) -> HTTPRequest:
471
+ path = "/superposition/organisations"
472
+ query: str = f''
473
+
474
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
475
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
476
+ content = codec.serialize(input)
477
+ if not content:
478
+ content = b"{}"
479
+ content_length = len(content)
480
+ body = SeekableAsyncBytesReader(content)
481
+
482
+ headers = Fields(
483
+ [
484
+ Field(name="Content-Type", values=["application/json"]),
485
+ Field(name="Content-Length", values=[str(content_length)]),
486
+
487
+ ]
488
+ )
489
+
490
+ return _HTTPRequest(
491
+ destination=_URI(
492
+ host="",
493
+ path=path,
494
+ scheme="https",
495
+ query=query,
496
+ ),
497
+ method="POST",
498
+ fields=headers,
499
+ body=body,
500
+ )
501
+
502
+ async def _serialize_create_type_templates(input: CreateTypeTemplatesInput, config: Config) -> HTTPRequest:
503
+ path = "/types"
504
+ query: str = f''
505
+
506
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
507
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
508
+ content = codec.serialize(input)
509
+ if not content:
510
+ content = b"{}"
511
+ content_length = len(content)
512
+ body = SeekableAsyncBytesReader(content)
513
+
514
+ headers = Fields(
515
+ [
516
+ Field(name="Content-Type", values=["application/json"]),
517
+ Field(name="Content-Length", values=[str(content_length)]),
518
+
519
+ ]
520
+ )
521
+
522
+ if input.workspace_id:
523
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
524
+ if input.org_id:
525
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
526
+ return _HTTPRequest(
527
+ destination=_URI(
528
+ host="",
529
+ path=path,
530
+ scheme="https",
531
+ query=query,
532
+ ),
533
+ method="POST",
534
+ fields=headers,
535
+ body=body,
536
+ )
537
+
538
+ async def _serialize_create_webhook(input: CreateWebhookInput, config: Config) -> HTTPRequest:
539
+ path = "/webhook"
540
+ query: str = f''
541
+
542
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
543
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
544
+ content = codec.serialize(input)
545
+ if not content:
546
+ content = b"{}"
547
+ content_length = len(content)
548
+ body = SeekableAsyncBytesReader(content)
549
+
550
+ headers = Fields(
551
+ [
552
+ Field(name="Content-Type", values=["application/json"]),
553
+ Field(name="Content-Length", values=[str(content_length)]),
554
+
555
+ ]
556
+ )
557
+
558
+ if input.workspace_id:
559
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
560
+ if input.org_id:
561
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
562
+ return _HTTPRequest(
563
+ destination=_URI(
564
+ host="",
565
+ path=path,
566
+ scheme="https",
567
+ query=query,
568
+ ),
569
+ method="POST",
570
+ fields=headers,
571
+ body=body,
572
+ )
573
+
574
+ async def _serialize_create_workspace(input: CreateWorkspaceInput, config: Config) -> HTTPRequest:
575
+ path = "/workspaces"
576
+ query: str = f''
577
+
578
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
579
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
580
+ content = codec.serialize(input)
581
+ if not content:
582
+ content = b"{}"
583
+ content_length = len(content)
584
+ body = SeekableAsyncBytesReader(content)
585
+
586
+ headers = Fields(
587
+ [
588
+ Field(name="Content-Type", values=["application/json"]),
589
+ Field(name="Content-Length", values=[str(content_length)]),
590
+
591
+ ]
592
+ )
593
+
594
+ if input.org_id:
595
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
596
+ return _HTTPRequest(
597
+ destination=_URI(
598
+ host="",
599
+ path=path,
600
+ scheme="https",
601
+ query=query,
602
+ ),
603
+ method="POST",
604
+ fields=headers,
605
+ body=body,
606
+ )
607
+
608
+ async def _serialize_delete_context(input: DeleteContextInput, config: Config) -> HTTPRequest:
609
+ if not input.id:
610
+ raise ServiceError("id must not be empty.")
611
+
612
+ path = "/context/{id}".format(
613
+ id=urlquote(input.id, safe=''),
614
+ )
615
+ query: str = f''
616
+
617
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
618
+ headers = Fields(
619
+ [
620
+
621
+ ]
622
+ )
623
+
624
+ if input.workspace_id:
625
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
626
+ if input.org_id:
627
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
628
+ if input.config_tags:
629
+ headers.extend(Fields([Field(name="x-config-tags", values=[input.config_tags])]))
630
+ return _HTTPRequest(
631
+ destination=_URI(
632
+ host="",
633
+ path=path,
634
+ scheme="https",
635
+ query=query,
636
+ ),
637
+ method="DELETE",
638
+ fields=headers,
639
+ body=body,
640
+ )
641
+
642
+ async def _serialize_delete_default_config(input: DeleteDefaultConfigInput, config: Config) -> HTTPRequest:
643
+ if not input.key:
644
+ raise ServiceError("key must not be empty.")
645
+
646
+ path = "/default-config/{key}".format(
647
+ key=urlquote(input.key, safe=''),
648
+ )
649
+ query: str = f''
650
+
651
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
652
+ headers = Fields(
653
+ [
654
+
655
+ ]
656
+ )
657
+
658
+ if input.workspace_id:
659
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
660
+ if input.org_id:
661
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
662
+ return _HTTPRequest(
663
+ destination=_URI(
664
+ host="",
665
+ path=path,
666
+ scheme="https",
667
+ query=query,
668
+ ),
669
+ method="DELETE",
670
+ fields=headers,
671
+ body=body,
672
+ )
673
+
674
+ async def _serialize_delete_dimension(input: DeleteDimensionInput, config: Config) -> HTTPRequest:
675
+ if not input.dimension:
676
+ raise ServiceError("dimension must not be empty.")
677
+
678
+ path = "/dimension/{dimension}".format(
679
+ dimension=urlquote(input.dimension, safe=''),
680
+ )
681
+ query: str = f''
682
+
683
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
684
+ headers = Fields(
685
+ [
686
+
687
+ ]
688
+ )
689
+
690
+ if input.workspace_id:
691
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
692
+ if input.org_id:
693
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
694
+ return _HTTPRequest(
695
+ destination=_URI(
696
+ host="",
697
+ path=path,
698
+ scheme="https",
699
+ query=query,
700
+ ),
701
+ method="DELETE",
702
+ fields=headers,
703
+ body=body,
704
+ )
705
+
706
+ async def _serialize_delete_experiment_group(input: DeleteExperimentGroupInput, config: Config) -> HTTPRequest:
707
+ if not input.id:
708
+ raise ServiceError("id must not be empty.")
709
+
710
+ path = "/experiment-groups/{id}".format(
711
+ id=urlquote(input.id, safe=''),
712
+ )
713
+ query: str = f''
714
+
715
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
716
+ headers = Fields(
717
+ [
718
+
719
+ ]
720
+ )
721
+
722
+ if input.workspace_id:
723
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
724
+ if input.org_id:
725
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
726
+ return _HTTPRequest(
727
+ destination=_URI(
728
+ host="",
729
+ path=path,
730
+ scheme="https",
731
+ query=query,
732
+ ),
733
+ method="DELETE",
734
+ fields=headers,
735
+ body=body,
736
+ )
737
+
738
+ async def _serialize_delete_function(input: DeleteFunctionInput, config: Config) -> HTTPRequest:
739
+ if not input.function_name:
740
+ raise ServiceError("function_name must not be empty.")
741
+
742
+ path = "/function/{function_name}".format(
743
+ function_name=urlquote(input.function_name, safe=''),
744
+ )
745
+ query: str = f''
746
+
747
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
748
+ headers = Fields(
749
+ [
750
+
751
+ ]
752
+ )
753
+
754
+ if input.workspace_id:
755
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
756
+ if input.org_id:
757
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
758
+ return _HTTPRequest(
759
+ destination=_URI(
760
+ host="",
761
+ path=path,
762
+ scheme="https",
763
+ query=query,
764
+ ),
765
+ method="DELETE",
766
+ fields=headers,
767
+ body=body,
768
+ )
769
+
770
+ async def _serialize_delete_type_templates(input: DeleteTypeTemplatesInput, config: Config) -> HTTPRequest:
771
+ if not input.type_name:
772
+ raise ServiceError("type_name must not be empty.")
773
+
774
+ path = "/types/{type_name}".format(
775
+ type_name=urlquote(input.type_name, safe=''),
776
+ )
777
+ query: str = f''
778
+
779
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
780
+ headers = Fields(
781
+ [
782
+
783
+ ]
784
+ )
785
+
786
+ if input.workspace_id:
787
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
788
+ if input.org_id:
789
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
790
+ return _HTTPRequest(
791
+ destination=_URI(
792
+ host="",
793
+ path=path,
794
+ scheme="https",
795
+ query=query,
796
+ ),
797
+ method="DELETE",
798
+ fields=headers,
799
+ body=body,
800
+ )
801
+
802
+ async def _serialize_delete_webhook(input: DeleteWebhookInput, config: Config) -> HTTPRequest:
803
+ if not input.name:
804
+ raise ServiceError("name must not be empty.")
805
+
806
+ path = "/webhook/{name}".format(
807
+ name=urlquote(input.name, safe=''),
808
+ )
809
+ query: str = f''
810
+
811
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
812
+ headers = Fields(
813
+ [
814
+
815
+ ]
816
+ )
817
+
818
+ if input.workspace_id:
819
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
820
+ if input.org_id:
821
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
822
+ return _HTTPRequest(
823
+ destination=_URI(
824
+ host="",
825
+ path=path,
826
+ scheme="https",
827
+ query=query,
828
+ ),
829
+ method="DELETE",
830
+ fields=headers,
831
+ body=body,
832
+ )
833
+
834
+ async def _serialize_discard_experiment(input: DiscardExperimentInput, config: Config) -> HTTPRequest:
835
+ if not input.id:
836
+ raise ServiceError("id must not be empty.")
837
+
838
+ path = "/experiments/{id}/discard".format(
839
+ id=urlquote(input.id, safe=''),
840
+ )
841
+ query: str = f''
842
+
843
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
844
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
845
+ content = codec.serialize(input)
846
+ if not content:
847
+ content = b"{}"
848
+ content_length = len(content)
849
+ body = SeekableAsyncBytesReader(content)
850
+
851
+ headers = Fields(
852
+ [
853
+ Field(name="Content-Type", values=["application/json"]),
854
+ Field(name="Content-Length", values=[str(content_length)]),
855
+
856
+ ]
857
+ )
858
+
859
+ if input.workspace_id:
860
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
861
+ if input.org_id:
862
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
863
+ return _HTTPRequest(
864
+ destination=_URI(
865
+ host="",
866
+ path=path,
867
+ scheme="https",
868
+ query=query,
869
+ ),
870
+ method="PATCH",
871
+ fields=headers,
872
+ body=body,
873
+ )
874
+
875
+ async def _serialize_get_config(input: GetConfigInput, config: Config) -> HTTPRequest:
876
+ path = "/config"
877
+ query: str = f''
878
+
879
+ query_params: list[tuple[str, str | None]] = []
880
+ if input.prefix is not None:
881
+ query_params.extend(("prefix", e) for e in input.prefix)
882
+ if input.version is not None:
883
+ query_params.append(("version", input.version))
884
+
885
+ query = join_query_params(params=query_params, prefix=query)
886
+
887
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
888
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
889
+ content = codec.serialize(input)
890
+ if not content:
891
+ content = b"{}"
892
+ content_length = len(content)
893
+ body = SeekableAsyncBytesReader(content)
894
+
895
+ headers = Fields(
896
+ [
897
+ Field(name="Content-Type", values=["application/json"]),
898
+ Field(name="Content-Length", values=[str(content_length)]),
899
+
900
+ ]
901
+ )
902
+
903
+ if input.workspace_id:
904
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
905
+ if input.org_id:
906
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
907
+ return _HTTPRequest(
908
+ destination=_URI(
909
+ host="",
910
+ path=path,
911
+ scheme="https",
912
+ query=query,
913
+ ),
914
+ method="POST",
915
+ fields=headers,
916
+ body=body,
917
+ )
918
+
919
+ async def _serialize_get_config_fast(input: GetConfigFastInput, config: Config) -> HTTPRequest:
920
+ path = "/config/fast"
921
+ query: str = f''
922
+
923
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
924
+ headers = Fields(
925
+ [
926
+
927
+ ]
928
+ )
929
+
930
+ if input.workspace_id:
931
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
932
+ if input.org_id:
933
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
934
+ return _HTTPRequest(
935
+ destination=_URI(
936
+ host="",
937
+ path=path,
938
+ scheme="https",
939
+ query=query,
940
+ ),
941
+ method="GET",
942
+ fields=headers,
943
+ body=body,
944
+ )
945
+
946
+ async def _serialize_get_context(input: GetContextInput, config: Config) -> HTTPRequest:
947
+ if not input.id:
948
+ raise ServiceError("id must not be empty.")
949
+
950
+ path = "/context/{id}".format(
951
+ id=urlquote(input.id, safe=''),
952
+ )
953
+ query: str = f''
954
+
955
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
956
+ headers = Fields(
957
+ [
958
+
959
+ ]
960
+ )
961
+
962
+ if input.workspace_id:
963
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
964
+ if input.org_id:
965
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
966
+ return _HTTPRequest(
967
+ destination=_URI(
968
+ host="",
969
+ path=path,
970
+ scheme="https",
971
+ query=query,
972
+ ),
973
+ method="GET",
974
+ fields=headers,
975
+ body=body,
976
+ )
977
+
978
+ async def _serialize_get_context_from_condition(input: GetContextFromConditionInput, config: Config) -> HTTPRequest:
979
+ path = "/context/get"
980
+ query: str = f''
981
+
982
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
983
+ content_length: int = 0
984
+ if input.context is not None:
985
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
986
+ content = codec.serialize(input.context)
987
+
988
+ content_length = len(content)
989
+ body = SeekableAsyncBytesReader(content)
990
+ headers = Fields(
991
+ [
992
+ Field(name="Content-Type", values=["application/json"]),
993
+ Field(name="Content-Length", values=[str(content_length)]),
994
+
995
+ ]
996
+ )
997
+
998
+ if input.workspace_id:
999
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1000
+ if input.org_id:
1001
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1002
+ return _HTTPRequest(
1003
+ destination=_URI(
1004
+ host="",
1005
+ path=path,
1006
+ scheme="https",
1007
+ query=query,
1008
+ ),
1009
+ method="POST",
1010
+ fields=headers,
1011
+ body=body,
1012
+ )
1013
+
1014
+ async def _serialize_get_default_config(input: GetDefaultConfigInput, config: Config) -> HTTPRequest:
1015
+ if not input.key:
1016
+ raise ServiceError("key must not be empty.")
1017
+
1018
+ path = "/default-config/{key}".format(
1019
+ key=urlquote(input.key, safe=''),
1020
+ )
1021
+ query: str = f''
1022
+
1023
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1024
+ headers = Fields(
1025
+ [
1026
+
1027
+ ]
1028
+ )
1029
+
1030
+ if input.workspace_id:
1031
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1032
+ if input.org_id:
1033
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1034
+ return _HTTPRequest(
1035
+ destination=_URI(
1036
+ host="",
1037
+ path=path,
1038
+ scheme="https",
1039
+ query=query,
1040
+ ),
1041
+ method="GET",
1042
+ fields=headers,
1043
+ body=body,
1044
+ )
1045
+
1046
+ async def _serialize_get_dimension(input: GetDimensionInput, config: Config) -> HTTPRequest:
1047
+ if not input.dimension:
1048
+ raise ServiceError("dimension must not be empty.")
1049
+
1050
+ path = "/dimension/{dimension}".format(
1051
+ dimension=urlquote(input.dimension, safe=''),
1052
+ )
1053
+ query: str = f''
1054
+
1055
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1056
+ headers = Fields(
1057
+ [
1058
+
1059
+ ]
1060
+ )
1061
+
1062
+ if input.workspace_id:
1063
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1064
+ if input.org_id:
1065
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1066
+ return _HTTPRequest(
1067
+ destination=_URI(
1068
+ host="",
1069
+ path=path,
1070
+ scheme="https",
1071
+ query=query,
1072
+ ),
1073
+ method="GET",
1074
+ fields=headers,
1075
+ body=body,
1076
+ )
1077
+
1078
+ async def _serialize_get_experiment(input: GetExperimentInput, config: Config) -> HTTPRequest:
1079
+ if not input.id:
1080
+ raise ServiceError("id must not be empty.")
1081
+
1082
+ path = "/experiments/{id}".format(
1083
+ id=urlquote(input.id, safe=''),
1084
+ )
1085
+ query: str = f''
1086
+
1087
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1088
+ headers = Fields(
1089
+ [
1090
+
1091
+ ]
1092
+ )
1093
+
1094
+ if input.workspace_id:
1095
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1096
+ if input.org_id:
1097
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1098
+ return _HTTPRequest(
1099
+ destination=_URI(
1100
+ host="",
1101
+ path=path,
1102
+ scheme="https",
1103
+ query=query,
1104
+ ),
1105
+ method="GET",
1106
+ fields=headers,
1107
+ body=body,
1108
+ )
1109
+
1110
+ async def _serialize_get_experiment_group(input: GetExperimentGroupInput, config: Config) -> HTTPRequest:
1111
+ if not input.id:
1112
+ raise ServiceError("id must not be empty.")
1113
+
1114
+ path = "/experiment-groups/{id}".format(
1115
+ id=urlquote(input.id, safe=''),
1116
+ )
1117
+ query: str = f''
1118
+
1119
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1120
+ headers = Fields(
1121
+ [
1122
+
1123
+ ]
1124
+ )
1125
+
1126
+ if input.workspace_id:
1127
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1128
+ if input.org_id:
1129
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1130
+ return _HTTPRequest(
1131
+ destination=_URI(
1132
+ host="",
1133
+ path=path,
1134
+ scheme="https",
1135
+ query=query,
1136
+ ),
1137
+ method="GET",
1138
+ fields=headers,
1139
+ body=body,
1140
+ )
1141
+
1142
+ async def _serialize_get_function(input: GetFunctionInput, config: Config) -> HTTPRequest:
1143
+ if not input.function_name:
1144
+ raise ServiceError("function_name must not be empty.")
1145
+
1146
+ path = "/function/{function_name}".format(
1147
+ function_name=urlquote(input.function_name, safe=''),
1148
+ )
1149
+ query: str = f''
1150
+
1151
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1152
+ headers = Fields(
1153
+ [
1154
+
1155
+ ]
1156
+ )
1157
+
1158
+ if input.workspace_id:
1159
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1160
+ if input.org_id:
1161
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1162
+ return _HTTPRequest(
1163
+ destination=_URI(
1164
+ host="",
1165
+ path=path,
1166
+ scheme="https",
1167
+ query=query,
1168
+ ),
1169
+ method="GET",
1170
+ fields=headers,
1171
+ body=body,
1172
+ )
1173
+
1174
+ async def _serialize_get_organisation(input: GetOrganisationInput, config: Config) -> HTTPRequest:
1175
+ if not input.id:
1176
+ raise ServiceError("id must not be empty.")
1177
+
1178
+ path = "/superposition/organisations/{id}".format(
1179
+ id=urlquote(input.id, safe=''),
1180
+ )
1181
+ query: str = f''
1182
+
1183
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1184
+ headers = Fields(
1185
+ [
1186
+
1187
+ ]
1188
+ )
1189
+
1190
+ return _HTTPRequest(
1191
+ destination=_URI(
1192
+ host="",
1193
+ path=path,
1194
+ scheme="https",
1195
+ query=query,
1196
+ ),
1197
+ method="GET",
1198
+ fields=headers,
1199
+ body=body,
1200
+ )
1201
+
1202
+ async def _serialize_get_resolved_config(input: GetResolvedConfigInput, config: Config) -> HTTPRequest:
1203
+ path = "/config/resolve"
1204
+ query: str = f''
1205
+
1206
+ query_params: list[tuple[str, str | None]] = []
1207
+ if input.prefix is not None:
1208
+ query_params.extend(("prefix", e) for e in input.prefix)
1209
+ if input.version is not None:
1210
+ query_params.append(("version", input.version))
1211
+ if input.show_reasoning is not None:
1212
+ query_params.append(("show_reasoning", ('true' if input.show_reasoning else 'false')))
1213
+ if input.context_id is not None:
1214
+ query_params.append(("context_id", input.context_id))
1215
+ if input.resolve_remote is not None:
1216
+ query_params.append(("resolve_remote", ('true' if input.resolve_remote else 'false')))
1217
+
1218
+ query = join_query_params(params=query_params, prefix=query)
1219
+
1220
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1221
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1222
+ content = codec.serialize(input)
1223
+ if not content:
1224
+ content = b"{}"
1225
+ content_length = len(content)
1226
+ body = SeekableAsyncBytesReader(content)
1227
+
1228
+ headers = Fields(
1229
+ [
1230
+ Field(name="Content-Type", values=["application/json"]),
1231
+ Field(name="Content-Length", values=[str(content_length)]),
1232
+
1233
+ ]
1234
+ )
1235
+
1236
+ if input.workspace_id:
1237
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1238
+ if input.org_id:
1239
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1240
+ if input.merge_strategy:
1241
+ headers.extend(Fields([Field(name="x-merge-strategy", values=[input.merge_strategy])]))
1242
+ return _HTTPRequest(
1243
+ destination=_URI(
1244
+ host="",
1245
+ path=path,
1246
+ scheme="https",
1247
+ query=query,
1248
+ ),
1249
+ method="POST",
1250
+ fields=headers,
1251
+ body=body,
1252
+ )
1253
+
1254
+ async def _serialize_get_type_template(input: GetTypeTemplateInput, config: Config) -> HTTPRequest:
1255
+ if not input.type_name:
1256
+ raise ServiceError("type_name must not be empty.")
1257
+
1258
+ path = "/types/{type_name}".format(
1259
+ type_name=urlquote(input.type_name, safe=''),
1260
+ )
1261
+ query: str = f''
1262
+
1263
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1264
+ headers = Fields(
1265
+ [
1266
+
1267
+ ]
1268
+ )
1269
+
1270
+ if input.workspace_id:
1271
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1272
+ if input.org_id:
1273
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1274
+ return _HTTPRequest(
1275
+ destination=_URI(
1276
+ host="",
1277
+ path=path,
1278
+ scheme="https",
1279
+ query=query,
1280
+ ),
1281
+ method="GET",
1282
+ fields=headers,
1283
+ body=body,
1284
+ )
1285
+
1286
+ async def _serialize_get_type_templates_list(input: GetTypeTemplatesListInput, config: Config) -> HTTPRequest:
1287
+ path = "/types"
1288
+ query: str = f''
1289
+
1290
+ query_params: list[tuple[str, str | None]] = []
1291
+ if input.count is not None:
1292
+ query_params.append(("count", str(input.count)))
1293
+ if input.page is not None:
1294
+ query_params.append(("page", str(input.page)))
1295
+ if input.all is not None:
1296
+ query_params.append(("all", ('true' if input.all else 'false')))
1297
+
1298
+ query = join_query_params(params=query_params, prefix=query)
1299
+
1300
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1301
+ headers = Fields(
1302
+ [
1303
+
1304
+ ]
1305
+ )
1306
+
1307
+ if input.workspace_id:
1308
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1309
+ if input.org_id:
1310
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1311
+ return _HTTPRequest(
1312
+ destination=_URI(
1313
+ host="",
1314
+ path=path,
1315
+ scheme="https",
1316
+ query=query,
1317
+ ),
1318
+ method="GET",
1319
+ fields=headers,
1320
+ body=body,
1321
+ )
1322
+
1323
+ async def _serialize_get_version(input: GetVersionInput, config: Config) -> HTTPRequest:
1324
+ if not input.id:
1325
+ raise ServiceError("id must not be empty.")
1326
+
1327
+ path = "/version/{id}".format(
1328
+ id=urlquote(input.id, safe=''),
1329
+ )
1330
+ query: str = f''
1331
+
1332
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1333
+ headers = Fields(
1334
+ [
1335
+
1336
+ ]
1337
+ )
1338
+
1339
+ if input.workspace_id:
1340
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1341
+ if input.org_id:
1342
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1343
+ return _HTTPRequest(
1344
+ destination=_URI(
1345
+ host="",
1346
+ path=path,
1347
+ scheme="https",
1348
+ query=query,
1349
+ ),
1350
+ method="GET",
1351
+ fields=headers,
1352
+ body=body,
1353
+ )
1354
+
1355
+ async def _serialize_get_webhook(input: GetWebhookInput, config: Config) -> HTTPRequest:
1356
+ if not input.name:
1357
+ raise ServiceError("name must not be empty.")
1358
+
1359
+ path = "/webhook/{name}".format(
1360
+ name=urlquote(input.name, safe=''),
1361
+ )
1362
+ query: str = f''
1363
+
1364
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1365
+ headers = Fields(
1366
+ [
1367
+
1368
+ ]
1369
+ )
1370
+
1371
+ if input.workspace_id:
1372
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1373
+ if input.org_id:
1374
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1375
+ return _HTTPRequest(
1376
+ destination=_URI(
1377
+ host="",
1378
+ path=path,
1379
+ scheme="https",
1380
+ query=query,
1381
+ ),
1382
+ method="GET",
1383
+ fields=headers,
1384
+ body=body,
1385
+ )
1386
+
1387
+ async def _serialize_get_webhook_by_event(input: GetWebhookByEventInput, config: Config) -> HTTPRequest:
1388
+ if not input.event:
1389
+ raise ServiceError("event must not be empty.")
1390
+
1391
+ path = "/webhook/event/{event}".format(
1392
+ event=urlquote(input.event, safe=''),
1393
+ )
1394
+ query: str = f''
1395
+
1396
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1397
+ headers = Fields(
1398
+ [
1399
+
1400
+ ]
1401
+ )
1402
+
1403
+ if input.workspace_id:
1404
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1405
+ if input.org_id:
1406
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1407
+ return _HTTPRequest(
1408
+ destination=_URI(
1409
+ host="",
1410
+ path=path,
1411
+ scheme="https",
1412
+ query=query,
1413
+ ),
1414
+ method="GET",
1415
+ fields=headers,
1416
+ body=body,
1417
+ )
1418
+
1419
+ async def _serialize_get_workspace(input: GetWorkspaceInput, config: Config) -> HTTPRequest:
1420
+ if not input.workspace_name:
1421
+ raise ServiceError("workspace_name must not be empty.")
1422
+
1423
+ path = "/workspaces/{workspace_name}".format(
1424
+ workspace_name=urlquote(input.workspace_name, safe=''),
1425
+ )
1426
+ query: str = f''
1427
+
1428
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1429
+ headers = Fields(
1430
+ [
1431
+
1432
+ ]
1433
+ )
1434
+
1435
+ if input.org_id:
1436
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1437
+ return _HTTPRequest(
1438
+ destination=_URI(
1439
+ host="",
1440
+ path=path,
1441
+ scheme="https",
1442
+ query=query,
1443
+ ),
1444
+ method="GET",
1445
+ fields=headers,
1446
+ body=body,
1447
+ )
1448
+
1449
+ async def _serialize_list_audit_logs(input: ListAuditLogsInput, config: Config) -> HTTPRequest:
1450
+ path = "/audit"
1451
+ query: str = f''
1452
+
1453
+ query_params: list[tuple[str, str | None]] = []
1454
+ if input.count is not None:
1455
+ query_params.append(("count", str(input.count)))
1456
+ if input.page is not None:
1457
+ query_params.append(("page", str(input.page)))
1458
+ if input.all is not None:
1459
+ query_params.append(("all", ('true' if input.all else 'false')))
1460
+ if input.from_date is not None:
1461
+ query_params.append(("from_date", serialize_rfc3339(ensure_utc(input.from_date))))
1462
+ if input.to_date is not None:
1463
+ query_params.append(("to_date", serialize_rfc3339(ensure_utc(input.to_date))))
1464
+ if input.tables is not None:
1465
+ query_params.extend(("table", e) for e in input.tables)
1466
+ if input.action is not None:
1467
+ query_params.extend(("action", e) for e in input.action)
1468
+ if input.username is not None:
1469
+ query_params.append(("username", input.username))
1470
+ if input.sort_by is not None:
1471
+ query_params.append(("sort_by", input.sort_by))
1472
+
1473
+ query = join_query_params(params=query_params, prefix=query)
1474
+
1475
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1476
+ headers = Fields(
1477
+ [
1478
+
1479
+ ]
1480
+ )
1481
+
1482
+ if input.workspace_id:
1483
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1484
+ if input.org_id:
1485
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1486
+ return _HTTPRequest(
1487
+ destination=_URI(
1488
+ host="",
1489
+ path=path,
1490
+ scheme="https",
1491
+ query=query,
1492
+ ),
1493
+ method="GET",
1494
+ fields=headers,
1495
+ body=body,
1496
+ )
1497
+
1498
+ async def _serialize_list_contexts(input: ListContextsInput, config: Config) -> HTTPRequest:
1499
+ path = "/context"
1500
+ query: str = f''
1501
+
1502
+ query_params: list[tuple[str, str | None]] = []
1503
+ if input.count is not None:
1504
+ query_params.append(("count", str(input.count)))
1505
+ if input.page is not None:
1506
+ query_params.append(("page", str(input.page)))
1507
+ if input.all is not None:
1508
+ query_params.append(("all", ('true' if input.all else 'false')))
1509
+ if input.prefix is not None:
1510
+ query_params.extend(("prefix", e) for e in input.prefix)
1511
+ if input.sort_on is not None:
1512
+ query_params.append(("sort_on", input.sort_on))
1513
+ if input.sort_by is not None:
1514
+ query_params.append(("sort_by", input.sort_by))
1515
+ if input.created_by is not None:
1516
+ query_params.extend(("created_by", e) for e in input.created_by)
1517
+ if input.last_modified_by is not None:
1518
+ query_params.extend(("last_modified_by", e) for e in input.last_modified_by)
1519
+ if input.plaintext is not None:
1520
+ query_params.append(("plaintext", input.plaintext))
1521
+ if input.dimension_match_strategy is not None:
1522
+ query_params.append(("dimension_match_strategy", input.dimension_match_strategy))
1523
+
1524
+ query = join_query_params(params=query_params, prefix=query)
1525
+
1526
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1527
+ headers = Fields(
1528
+ [
1529
+
1530
+ ]
1531
+ )
1532
+
1533
+ if input.workspace_id:
1534
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1535
+ if input.org_id:
1536
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1537
+ return _HTTPRequest(
1538
+ destination=_URI(
1539
+ host="",
1540
+ path=path,
1541
+ scheme="https",
1542
+ query=query,
1543
+ ),
1544
+ method="GET",
1545
+ fields=headers,
1546
+ body=body,
1547
+ )
1548
+
1549
+ async def _serialize_list_default_configs(input: ListDefaultConfigsInput, config: Config) -> HTTPRequest:
1550
+ path = "/default-config"
1551
+ query: str = f''
1552
+
1553
+ query_params: list[tuple[str, str | None]] = []
1554
+ if input.count is not None:
1555
+ query_params.append(("count", str(input.count)))
1556
+ if input.page is not None:
1557
+ query_params.append(("page", str(input.page)))
1558
+ if input.all is not None:
1559
+ query_params.append(("all", ('true' if input.all else 'false')))
1560
+ if input.name is not None:
1561
+ query_params.append(("name", input.name))
1562
+
1563
+ query = join_query_params(params=query_params, prefix=query)
1564
+
1565
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1566
+ headers = Fields(
1567
+ [
1568
+
1569
+ ]
1570
+ )
1571
+
1572
+ if input.workspace_id:
1573
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1574
+ if input.org_id:
1575
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1576
+ return _HTTPRequest(
1577
+ destination=_URI(
1578
+ host="",
1579
+ path=path,
1580
+ scheme="https",
1581
+ query=query,
1582
+ ),
1583
+ method="GET",
1584
+ fields=headers,
1585
+ body=body,
1586
+ )
1587
+
1588
+ async def _serialize_list_dimensions(input: ListDimensionsInput, config: Config) -> HTTPRequest:
1589
+ path = "/dimension"
1590
+ query: str = f''
1591
+
1592
+ query_params: list[tuple[str, str | None]] = []
1593
+ if input.count is not None:
1594
+ query_params.append(("count", str(input.count)))
1595
+ if input.page is not None:
1596
+ query_params.append(("page", str(input.page)))
1597
+ if input.all is not None:
1598
+ query_params.append(("all", ('true' if input.all else 'false')))
1599
+
1600
+ query = join_query_params(params=query_params, prefix=query)
1601
+
1602
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1603
+ headers = Fields(
1604
+ [
1605
+
1606
+ ]
1607
+ )
1608
+
1609
+ if input.workspace_id:
1610
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1611
+ if input.org_id:
1612
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1613
+ return _HTTPRequest(
1614
+ destination=_URI(
1615
+ host="",
1616
+ path=path,
1617
+ scheme="https",
1618
+ query=query,
1619
+ ),
1620
+ method="GET",
1621
+ fields=headers,
1622
+ body=body,
1623
+ )
1624
+
1625
+ async def _serialize_list_experiment(input: ListExperimentInput, config: Config) -> HTTPRequest:
1626
+ path = "/experiments"
1627
+ query: str = f''
1628
+
1629
+ query_params: list[tuple[str, str | None]] = []
1630
+ if input.count is not None:
1631
+ query_params.append(("count", str(input.count)))
1632
+ if input.page is not None:
1633
+ query_params.append(("page", str(input.page)))
1634
+ if input.all is not None:
1635
+ query_params.append(("all", ('true' if input.all else 'false')))
1636
+ if input.status is not None:
1637
+ query_params.extend(("status", e) for e in input.status)
1638
+ if input.from_date is not None:
1639
+ query_params.append(("from_date", serialize_rfc3339(ensure_utc(input.from_date))))
1640
+ if input.to_date is not None:
1641
+ query_params.append(("to_date", serialize_rfc3339(ensure_utc(input.to_date))))
1642
+ if input.experiment_name is not None:
1643
+ query_params.append(("experiment_name", input.experiment_name))
1644
+ if input.experiment_ids is not None:
1645
+ query_params.extend(("experiment_ids", e) for e in input.experiment_ids)
1646
+ if input.experiment_group_ids is not None:
1647
+ query_params.extend(("experiment_group_ids", e) for e in input.experiment_group_ids)
1648
+ if input.created_by is not None:
1649
+ query_params.extend(("created_by", e) for e in input.created_by)
1650
+ if input.sort_on is not None:
1651
+ query_params.append(("sort_on", input.sort_on))
1652
+ if input.sort_by is not None:
1653
+ query_params.append(("sort_by", input.sort_by))
1654
+ if input.global_experiments_only is not None:
1655
+ query_params.append(("global_experiments_only", ('true' if input.global_experiments_only else 'false')))
1656
+ if input.dimension_match_strategy is not None:
1657
+ query_params.append(("dimension_match_strategy", input.dimension_match_strategy))
1658
+
1659
+ query = join_query_params(params=query_params, prefix=query)
1660
+
1661
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1662
+ headers = Fields(
1663
+ [
1664
+
1665
+ ]
1666
+ )
1667
+
1668
+ if input.workspace_id:
1669
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1670
+ if input.org_id:
1671
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1672
+ return _HTTPRequest(
1673
+ destination=_URI(
1674
+ host="",
1675
+ path=path,
1676
+ scheme="https",
1677
+ query=query,
1678
+ ),
1679
+ method="GET",
1680
+ fields=headers,
1681
+ body=body,
1682
+ )
1683
+
1684
+ async def _serialize_list_experiment_groups(input: ListExperimentGroupsInput, config: Config) -> HTTPRequest:
1685
+ path = "/experiment-groups"
1686
+ query: str = f''
1687
+
1688
+ query_params: list[tuple[str, str | None]] = []
1689
+ if input.count is not None:
1690
+ query_params.append(("count", str(input.count)))
1691
+ if input.page is not None:
1692
+ query_params.append(("page", str(input.page)))
1693
+ if input.all is not None:
1694
+ query_params.append(("all", ('true' if input.all else 'false')))
1695
+ if input.name is not None:
1696
+ query_params.append(("name", input.name))
1697
+ if input.created_by is not None:
1698
+ query_params.append(("created_by", input.created_by))
1699
+ if input.last_modified_by is not None:
1700
+ query_params.append(("last_modified_by", input.last_modified_by))
1701
+ if input.sort_on is not None:
1702
+ query_params.append(("sort_on", input.sort_on))
1703
+ if input.sort_by is not None:
1704
+ query_params.append(("sort_by", input.sort_by))
1705
+ if input.group_type is not None:
1706
+ query_params.extend(("group_type", e) for e in input.group_type)
1707
+
1708
+ query = join_query_params(params=query_params, prefix=query)
1709
+
1710
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1711
+ headers = Fields(
1712
+ [
1713
+
1714
+ ]
1715
+ )
1716
+
1717
+ if input.workspace_id:
1718
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1719
+ if input.org_id:
1720
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1721
+ return _HTTPRequest(
1722
+ destination=_URI(
1723
+ host="",
1724
+ path=path,
1725
+ scheme="https",
1726
+ query=query,
1727
+ ),
1728
+ method="GET",
1729
+ fields=headers,
1730
+ body=body,
1731
+ )
1732
+
1733
+ async def _serialize_list_function(input: ListFunctionInput, config: Config) -> HTTPRequest:
1734
+ path = "/function"
1735
+ query: str = f''
1736
+
1737
+ query_params: list[tuple[str, str | None]] = []
1738
+ if input.count is not None:
1739
+ query_params.append(("count", str(input.count)))
1740
+ if input.page is not None:
1741
+ query_params.append(("page", str(input.page)))
1742
+ if input.all is not None:
1743
+ query_params.append(("all", ('true' if input.all else 'false')))
1744
+ if input.function_type is not None:
1745
+ query_params.extend(("function_type", e) for e in input.function_type)
1746
+
1747
+ query = join_query_params(params=query_params, prefix=query)
1748
+
1749
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1750
+ headers = Fields(
1751
+ [
1752
+
1753
+ ]
1754
+ )
1755
+
1756
+ if input.workspace_id:
1757
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1758
+ if input.org_id:
1759
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1760
+ return _HTTPRequest(
1761
+ destination=_URI(
1762
+ host="",
1763
+ path=path,
1764
+ scheme="https",
1765
+ query=query,
1766
+ ),
1767
+ method="GET",
1768
+ fields=headers,
1769
+ body=body,
1770
+ )
1771
+
1772
+ async def _serialize_list_organisation(input: ListOrganisationInput, config: Config) -> HTTPRequest:
1773
+ path = "/superposition/organisations"
1774
+ query: str = f''
1775
+
1776
+ query_params: list[tuple[str, str | None]] = []
1777
+ if input.count is not None:
1778
+ query_params.append(("count", str(input.count)))
1779
+ if input.page is not None:
1780
+ query_params.append(("page", str(input.page)))
1781
+ if input.all is not None:
1782
+ query_params.append(("all", ('true' if input.all else 'false')))
1783
+
1784
+ query = join_query_params(params=query_params, prefix=query)
1785
+
1786
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1787
+ headers = Fields(
1788
+ [
1789
+
1790
+ ]
1791
+ )
1792
+
1793
+ return _HTTPRequest(
1794
+ destination=_URI(
1795
+ host="",
1796
+ path=path,
1797
+ scheme="https",
1798
+ query=query,
1799
+ ),
1800
+ method="GET",
1801
+ fields=headers,
1802
+ body=body,
1803
+ )
1804
+
1805
+ async def _serialize_list_versions(input: ListVersionsInput, config: Config) -> HTTPRequest:
1806
+ path = "/config/versions"
1807
+ query: str = f''
1808
+
1809
+ query_params: list[tuple[str, str | None]] = []
1810
+ if input.count is not None:
1811
+ query_params.append(("count", str(input.count)))
1812
+ if input.page is not None:
1813
+ query_params.append(("page", str(input.page)))
1814
+
1815
+ query = join_query_params(params=query_params, prefix=query)
1816
+
1817
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1818
+ headers = Fields(
1819
+ [
1820
+
1821
+ ]
1822
+ )
1823
+
1824
+ if input.workspace_id:
1825
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1826
+ if input.org_id:
1827
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1828
+ return _HTTPRequest(
1829
+ destination=_URI(
1830
+ host="",
1831
+ path=path,
1832
+ scheme="https",
1833
+ query=query,
1834
+ ),
1835
+ method="GET",
1836
+ fields=headers,
1837
+ body=body,
1838
+ )
1839
+
1840
+ async def _serialize_list_webhook(input: ListWebhookInput, config: Config) -> HTTPRequest:
1841
+ path = "/webhook"
1842
+ query: str = f''
1843
+
1844
+ query_params: list[tuple[str, str | None]] = []
1845
+ if input.count is not None:
1846
+ query_params.append(("count", str(input.count)))
1847
+ if input.page is not None:
1848
+ query_params.append(("page", str(input.page)))
1849
+ if input.all is not None:
1850
+ query_params.append(("all", ('true' if input.all else 'false')))
1851
+
1852
+ query = join_query_params(params=query_params, prefix=query)
1853
+
1854
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1855
+ headers = Fields(
1856
+ [
1857
+
1858
+ ]
1859
+ )
1860
+
1861
+ if input.workspace_id:
1862
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1863
+ if input.org_id:
1864
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1865
+ return _HTTPRequest(
1866
+ destination=_URI(
1867
+ host="",
1868
+ path=path,
1869
+ scheme="https",
1870
+ query=query,
1871
+ ),
1872
+ method="GET",
1873
+ fields=headers,
1874
+ body=body,
1875
+ )
1876
+
1877
+ async def _serialize_list_workspace(input: ListWorkspaceInput, config: Config) -> HTTPRequest:
1878
+ path = "/workspaces"
1879
+ query: str = f''
1880
+
1881
+ query_params: list[tuple[str, str | None]] = []
1882
+ if input.count is not None:
1883
+ query_params.append(("count", str(input.count)))
1884
+ if input.page is not None:
1885
+ query_params.append(("page", str(input.page)))
1886
+ if input.all is not None:
1887
+ query_params.append(("all", ('true' if input.all else 'false')))
1888
+
1889
+ query = join_query_params(params=query_params, prefix=query)
1890
+
1891
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1892
+ headers = Fields(
1893
+ [
1894
+
1895
+ ]
1896
+ )
1897
+
1898
+ if input.org_id:
1899
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1900
+ return _HTTPRequest(
1901
+ destination=_URI(
1902
+ host="",
1903
+ path=path,
1904
+ scheme="https",
1905
+ query=query,
1906
+ ),
1907
+ method="GET",
1908
+ fields=headers,
1909
+ body=body,
1910
+ )
1911
+
1912
+ async def _serialize_migrate_workspace_schema(input: MigrateWorkspaceSchemaInput, config: Config) -> HTTPRequest:
1913
+ if not input.workspace_name:
1914
+ raise ServiceError("workspace_name must not be empty.")
1915
+
1916
+ path = "/workspaces/{workspace_name}/db/migrate".format(
1917
+ workspace_name=urlquote(input.workspace_name, safe=''),
1918
+ )
1919
+ query: str = f''
1920
+
1921
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1922
+ headers = Fields(
1923
+ [
1924
+
1925
+ ]
1926
+ )
1927
+
1928
+ if input.org_id:
1929
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1930
+ return _HTTPRequest(
1931
+ destination=_URI(
1932
+ host="",
1933
+ path=path,
1934
+ scheme="https",
1935
+ query=query,
1936
+ ),
1937
+ method="POST",
1938
+ fields=headers,
1939
+ body=body,
1940
+ )
1941
+
1942
+ async def _serialize_move_context(input: MoveContextInput, config: Config) -> HTTPRequest:
1943
+ if not input.id:
1944
+ raise ServiceError("id must not be empty.")
1945
+
1946
+ path = "/context/move/{id}".format(
1947
+ id=urlquote(input.id, safe=''),
1948
+ )
1949
+ query: str = f''
1950
+
1951
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1952
+ content_length: int = 0
1953
+ if input.request is not None:
1954
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1955
+ content = codec.serialize(input.request)
1956
+
1957
+ content_length = len(content)
1958
+ body = SeekableAsyncBytesReader(content)
1959
+ else:
1960
+ content_length = 2
1961
+ body = SeekableAsyncBytesReader(b"{}")
1962
+
1963
+ headers = Fields(
1964
+ [
1965
+ Field(name="Content-Type", values=["application/json"]),
1966
+ Field(name="Content-Length", values=[str(content_length)]),
1967
+
1968
+ ]
1969
+ )
1970
+
1971
+ if input.workspace_id:
1972
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1973
+ if input.org_id:
1974
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1975
+ return _HTTPRequest(
1976
+ destination=_URI(
1977
+ host="",
1978
+ path=path,
1979
+ scheme="https",
1980
+ query=query,
1981
+ ),
1982
+ method="PUT",
1983
+ fields=headers,
1984
+ body=body,
1985
+ )
1986
+
1987
+ async def _serialize_pause_experiment(input: PauseExperimentInput, config: Config) -> HTTPRequest:
1988
+ if not input.id:
1989
+ raise ServiceError("id must not be empty.")
1990
+
1991
+ path = "/experiments/{id}/pause".format(
1992
+ id=urlquote(input.id, safe=''),
1993
+ )
1994
+ query: str = f''
1995
+
1996
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1997
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1998
+ content = codec.serialize(input)
1999
+ if not content:
2000
+ content = b"{}"
2001
+ content_length = len(content)
2002
+ body = SeekableAsyncBytesReader(content)
2003
+
2004
+ headers = Fields(
2005
+ [
2006
+ Field(name="Content-Type", values=["application/json"]),
2007
+ Field(name="Content-Length", values=[str(content_length)]),
2008
+
2009
+ ]
2010
+ )
2011
+
2012
+ if input.workspace_id:
2013
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2014
+ if input.org_id:
2015
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2016
+ return _HTTPRequest(
2017
+ destination=_URI(
2018
+ host="",
2019
+ path=path,
2020
+ scheme="https",
2021
+ query=query,
2022
+ ),
2023
+ method="PATCH",
2024
+ fields=headers,
2025
+ body=body,
2026
+ )
2027
+
2028
+ async def _serialize_publish(input: PublishInput, config: Config) -> HTTPRequest:
2029
+ if not input.function_name:
2030
+ raise ServiceError("function_name must not be empty.")
2031
+
2032
+ path = "/function/{function_name}/publish".format(
2033
+ function_name=urlquote(input.function_name, safe=''),
2034
+ )
2035
+ query: str = f''
2036
+
2037
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2038
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2039
+ content = codec.serialize(input)
2040
+ if not content:
2041
+ content = b"{}"
2042
+ content_length = len(content)
2043
+ body = SeekableAsyncBytesReader(content)
2044
+
2045
+ headers = Fields(
2046
+ [
2047
+ Field(name="Content-Type", values=["application/json"]),
2048
+ Field(name="Content-Length", values=[str(content_length)]),
2049
+
2050
+ ]
2051
+ )
2052
+
2053
+ if input.workspace_id:
2054
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2055
+ if input.org_id:
2056
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2057
+ return _HTTPRequest(
2058
+ destination=_URI(
2059
+ host="",
2060
+ path=path,
2061
+ scheme="https",
2062
+ query=query,
2063
+ ),
2064
+ method="PATCH",
2065
+ fields=headers,
2066
+ body=body,
2067
+ )
2068
+
2069
+ async def _serialize_ramp_experiment(input: RampExperimentInput, config: Config) -> HTTPRequest:
2070
+ if not input.id:
2071
+ raise ServiceError("id must not be empty.")
2072
+
2073
+ path = "/experiments/{id}/ramp".format(
2074
+ id=urlquote(input.id, safe=''),
2075
+ )
2076
+ query: str = f''
2077
+
2078
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2079
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2080
+ content = codec.serialize(input)
2081
+ if not content:
2082
+ content = b"{}"
2083
+ content_length = len(content)
2084
+ body = SeekableAsyncBytesReader(content)
2085
+
2086
+ headers = Fields(
2087
+ [
2088
+ Field(name="Content-Type", values=["application/json"]),
2089
+ Field(name="Content-Length", values=[str(content_length)]),
2090
+
2091
+ ]
2092
+ )
2093
+
2094
+ if input.workspace_id:
2095
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2096
+ if input.org_id:
2097
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2098
+ return _HTTPRequest(
2099
+ destination=_URI(
2100
+ host="",
2101
+ path=path,
2102
+ scheme="https",
2103
+ query=query,
2104
+ ),
2105
+ method="PATCH",
2106
+ fields=headers,
2107
+ body=body,
2108
+ )
2109
+
2110
+ async def _serialize_remove_members_from_group(input: RemoveMembersFromGroupInput, config: Config) -> HTTPRequest:
2111
+ if not input.id:
2112
+ raise ServiceError("id must not be empty.")
2113
+
2114
+ path = "/experiment-groups/{id}/remove-members".format(
2115
+ id=urlquote(input.id, safe=''),
2116
+ )
2117
+ query: str = f''
2118
+
2119
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2120
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2121
+ content = codec.serialize(input)
2122
+ if not content:
2123
+ content = b"{}"
2124
+ content_length = len(content)
2125
+ body = SeekableAsyncBytesReader(content)
2126
+
2127
+ headers = Fields(
2128
+ [
2129
+ Field(name="Content-Type", values=["application/json"]),
2130
+ Field(name="Content-Length", values=[str(content_length)]),
2131
+
2132
+ ]
2133
+ )
2134
+
2135
+ if input.workspace_id:
2136
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2137
+ if input.org_id:
2138
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2139
+ return _HTTPRequest(
2140
+ destination=_URI(
2141
+ host="",
2142
+ path=path,
2143
+ scheme="https",
2144
+ query=query,
2145
+ ),
2146
+ method="PATCH",
2147
+ fields=headers,
2148
+ body=body,
2149
+ )
2150
+
2151
+ async def _serialize_resume_experiment(input: ResumeExperimentInput, config: Config) -> HTTPRequest:
2152
+ if not input.id:
2153
+ raise ServiceError("id must not be empty.")
2154
+
2155
+ path = "/experiments/{id}/resume".format(
2156
+ id=urlquote(input.id, safe=''),
2157
+ )
2158
+ query: str = f''
2159
+
2160
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2161
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2162
+ content = codec.serialize(input)
2163
+ if not content:
2164
+ content = b"{}"
2165
+ content_length = len(content)
2166
+ body = SeekableAsyncBytesReader(content)
2167
+
2168
+ headers = Fields(
2169
+ [
2170
+ Field(name="Content-Type", values=["application/json"]),
2171
+ Field(name="Content-Length", values=[str(content_length)]),
2172
+
2173
+ ]
2174
+ )
2175
+
2176
+ if input.workspace_id:
2177
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2178
+ if input.org_id:
2179
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2180
+ return _HTTPRequest(
2181
+ destination=_URI(
2182
+ host="",
2183
+ path=path,
2184
+ scheme="https",
2185
+ query=query,
2186
+ ),
2187
+ method="PATCH",
2188
+ fields=headers,
2189
+ body=body,
2190
+ )
2191
+
2192
+ async def _serialize_test(input: TestInput, config: Config) -> HTTPRequest:
2193
+ if not input.function_name:
2194
+ raise ServiceError("function_name must not be empty.")
2195
+
2196
+ if not input.stage:
2197
+ raise ServiceError("stage must not be empty.")
2198
+
2199
+ path = "/function/{function_name}/{stage}/test".format(
2200
+ function_name=urlquote(input.function_name, safe=''),
2201
+ stage=urlquote(input.stage, safe=''),
2202
+ )
2203
+ query: str = f''
2204
+
2205
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2206
+ content_length: int = 0
2207
+ if input.request is not None:
2208
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2209
+ content = codec.serialize(input.request)
2210
+
2211
+ content_length = len(content)
2212
+ body = SeekableAsyncBytesReader(content)
2213
+ headers = Fields(
2214
+ [
2215
+ Field(name="Content-Type", values=["application/json"]),
2216
+ Field(name="Content-Length", values=[str(content_length)]),
2217
+
2218
+ ]
2219
+ )
2220
+
2221
+ if input.workspace_id:
2222
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2223
+ if input.org_id:
2224
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2225
+ return _HTTPRequest(
2226
+ destination=_URI(
2227
+ host="",
2228
+ path=path,
2229
+ scheme="https",
2230
+ query=query,
2231
+ ),
2232
+ method="POST",
2233
+ fields=headers,
2234
+ body=body,
2235
+ )
2236
+
2237
+ async def _serialize_update_default_config(input: UpdateDefaultConfigInput, config: Config) -> HTTPRequest:
2238
+ if not input.key:
2239
+ raise ServiceError("key must not be empty.")
2240
+
2241
+ path = "/default-config/{key}".format(
2242
+ key=urlquote(input.key, safe=''),
2243
+ )
2244
+ query: str = f''
2245
+
2246
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2247
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2248
+ content = codec.serialize(input)
2249
+ if not content:
2250
+ content = b"{}"
2251
+ content_length = len(content)
2252
+ body = SeekableAsyncBytesReader(content)
2253
+
2254
+ headers = Fields(
2255
+ [
2256
+ Field(name="Content-Type", values=["application/json"]),
2257
+ Field(name="Content-Length", values=[str(content_length)]),
2258
+
2259
+ ]
2260
+ )
2261
+
2262
+ if input.workspace_id:
2263
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2264
+ if input.org_id:
2265
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2266
+ return _HTTPRequest(
2267
+ destination=_URI(
2268
+ host="",
2269
+ path=path,
2270
+ scheme="https",
2271
+ query=query,
2272
+ ),
2273
+ method="PATCH",
2274
+ fields=headers,
2275
+ body=body,
2276
+ )
2277
+
2278
+ async def _serialize_update_dimension(input: UpdateDimensionInput, config: Config) -> HTTPRequest:
2279
+ if not input.dimension:
2280
+ raise ServiceError("dimension must not be empty.")
2281
+
2282
+ path = "/dimension/{dimension}".format(
2283
+ dimension=urlquote(input.dimension, safe=''),
2284
+ )
2285
+ query: str = f''
2286
+
2287
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2288
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2289
+ content = codec.serialize(input)
2290
+ if not content:
2291
+ content = b"{}"
2292
+ content_length = len(content)
2293
+ body = SeekableAsyncBytesReader(content)
2294
+
2295
+ headers = Fields(
2296
+ [
2297
+ Field(name="Content-Type", values=["application/json"]),
2298
+ Field(name="Content-Length", values=[str(content_length)]),
2299
+
2300
+ ]
2301
+ )
2302
+
2303
+ if input.workspace_id:
2304
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2305
+ if input.org_id:
2306
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2307
+ return _HTTPRequest(
2308
+ destination=_URI(
2309
+ host="",
2310
+ path=path,
2311
+ scheme="https",
2312
+ query=query,
2313
+ ),
2314
+ method="PATCH",
2315
+ fields=headers,
2316
+ body=body,
2317
+ )
2318
+
2319
+ async def _serialize_update_experiment_group(input: UpdateExperimentGroupInput, config: Config) -> HTTPRequest:
2320
+ if not input.id:
2321
+ raise ServiceError("id must not be empty.")
2322
+
2323
+ path = "/experiment-groups/{id}".format(
2324
+ id=urlquote(input.id, safe=''),
2325
+ )
2326
+ query: str = f''
2327
+
2328
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2329
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2330
+ content = codec.serialize(input)
2331
+ if not content:
2332
+ content = b"{}"
2333
+ content_length = len(content)
2334
+ body = SeekableAsyncBytesReader(content)
2335
+
2336
+ headers = Fields(
2337
+ [
2338
+ Field(name="Content-Type", values=["application/json"]),
2339
+ Field(name="Content-Length", values=[str(content_length)]),
2340
+
2341
+ ]
2342
+ )
2343
+
2344
+ if input.workspace_id:
2345
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2346
+ if input.org_id:
2347
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2348
+ return _HTTPRequest(
2349
+ destination=_URI(
2350
+ host="",
2351
+ path=path,
2352
+ scheme="https",
2353
+ query=query,
2354
+ ),
2355
+ method="PATCH",
2356
+ fields=headers,
2357
+ body=body,
2358
+ )
2359
+
2360
+ async def _serialize_update_function(input: UpdateFunctionInput, config: Config) -> HTTPRequest:
2361
+ if not input.function_name:
2362
+ raise ServiceError("function_name must not be empty.")
2363
+
2364
+ path = "/function/{function_name}".format(
2365
+ function_name=urlquote(input.function_name, safe=''),
2366
+ )
2367
+ query: str = f''
2368
+
2369
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2370
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2371
+ content = codec.serialize(input)
2372
+ if not content:
2373
+ content = b"{}"
2374
+ content_length = len(content)
2375
+ body = SeekableAsyncBytesReader(content)
2376
+
2377
+ headers = Fields(
2378
+ [
2379
+ Field(name="Content-Type", values=["application/json"]),
2380
+ Field(name="Content-Length", values=[str(content_length)]),
2381
+
2382
+ ]
2383
+ )
2384
+
2385
+ if input.workspace_id:
2386
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2387
+ if input.org_id:
2388
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2389
+ return _HTTPRequest(
2390
+ destination=_URI(
2391
+ host="",
2392
+ path=path,
2393
+ scheme="https",
2394
+ query=query,
2395
+ ),
2396
+ method="PATCH",
2397
+ fields=headers,
2398
+ body=body,
2399
+ )
2400
+
2401
+ async def _serialize_update_organisation(input: UpdateOrganisationInput, config: Config) -> HTTPRequest:
2402
+ if not input.id:
2403
+ raise ServiceError("id must not be empty.")
2404
+
2405
+ path = "/superposition/organisations/{id}".format(
2406
+ id=urlquote(input.id, safe=''),
2407
+ )
2408
+ query: str = f''
2409
+
2410
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2411
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2412
+ content = codec.serialize(input)
2413
+ if not content:
2414
+ content = b"{}"
2415
+ content_length = len(content)
2416
+ body = SeekableAsyncBytesReader(content)
2417
+
2418
+ headers = Fields(
2419
+ [
2420
+ Field(name="Content-Type", values=["application/json"]),
2421
+ Field(name="Content-Length", values=[str(content_length)]),
2422
+
2423
+ ]
2424
+ )
2425
+
2426
+ return _HTTPRequest(
2427
+ destination=_URI(
2428
+ host="",
2429
+ path=path,
2430
+ scheme="https",
2431
+ query=query,
2432
+ ),
2433
+ method="PATCH",
2434
+ fields=headers,
2435
+ body=body,
2436
+ )
2437
+
2438
+ async def _serialize_update_override(input: UpdateOverrideInput, config: Config) -> HTTPRequest:
2439
+ path = "/context/overrides"
2440
+ query: str = f''
2441
+
2442
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2443
+ content_length: int = 0
2444
+ if input.request is not None:
2445
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2446
+ content = codec.serialize(input.request)
2447
+
2448
+ content_length = len(content)
2449
+ body = SeekableAsyncBytesReader(content)
2450
+ else:
2451
+ content_length = 2
2452
+ body = SeekableAsyncBytesReader(b"{}")
2453
+
2454
+ headers = Fields(
2455
+ [
2456
+ Field(name="Content-Type", values=["application/json"]),
2457
+ Field(name="Content-Length", values=[str(content_length)]),
2458
+
2459
+ ]
2460
+ )
2461
+
2462
+ if input.workspace_id:
2463
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2464
+ if input.org_id:
2465
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2466
+ if input.config_tags:
2467
+ headers.extend(Fields([Field(name="x-config-tags", values=[input.config_tags])]))
2468
+ return _HTTPRequest(
2469
+ destination=_URI(
2470
+ host="",
2471
+ path=path,
2472
+ scheme="https",
2473
+ query=query,
2474
+ ),
2475
+ method="PATCH",
2476
+ fields=headers,
2477
+ body=body,
2478
+ )
2479
+
2480
+ async def _serialize_update_overrides_experiment(input: UpdateOverridesExperimentInput, config: Config) -> HTTPRequest:
2481
+ if not input.id:
2482
+ raise ServiceError("id must not be empty.")
2483
+
2484
+ path = "/experiments/{id}/overrides".format(
2485
+ id=urlquote(input.id, safe=''),
2486
+ )
2487
+ query: str = f''
2488
+
2489
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2490
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2491
+ content = codec.serialize(input)
2492
+ if not content:
2493
+ content = b"{}"
2494
+ content_length = len(content)
2495
+ body = SeekableAsyncBytesReader(content)
2496
+
2497
+ headers = Fields(
2498
+ [
2499
+ Field(name="Content-Type", values=["application/json"]),
2500
+ Field(name="Content-Length", values=[str(content_length)]),
2501
+
2502
+ ]
2503
+ )
2504
+
2505
+ if input.workspace_id:
2506
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2507
+ if input.org_id:
2508
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2509
+ return _HTTPRequest(
2510
+ destination=_URI(
2511
+ host="",
2512
+ path=path,
2513
+ scheme="https",
2514
+ query=query,
2515
+ ),
2516
+ method="PATCH",
2517
+ fields=headers,
2518
+ body=body,
2519
+ )
2520
+
2521
+ async def _serialize_update_type_templates(input: UpdateTypeTemplatesInput, config: Config) -> HTTPRequest:
2522
+ if not input.type_name:
2523
+ raise ServiceError("type_name must not be empty.")
2524
+
2525
+ path = "/types/{type_name}".format(
2526
+ type_name=urlquote(input.type_name, safe=''),
2527
+ )
2528
+ query: str = f''
2529
+
2530
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2531
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2532
+ content = codec.serialize(input)
2533
+ if not content:
2534
+ content = b"{}"
2535
+ content_length = len(content)
2536
+ body = SeekableAsyncBytesReader(content)
2537
+
2538
+ headers = Fields(
2539
+ [
2540
+ Field(name="Content-Type", values=["application/json"]),
2541
+ Field(name="Content-Length", values=[str(content_length)]),
2542
+
2543
+ ]
2544
+ )
2545
+
2546
+ if input.workspace_id:
2547
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2548
+ if input.org_id:
2549
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2550
+ return _HTTPRequest(
2551
+ destination=_URI(
2552
+ host="",
2553
+ path=path,
2554
+ scheme="https",
2555
+ query=query,
2556
+ ),
2557
+ method="PATCH",
2558
+ fields=headers,
2559
+ body=body,
2560
+ )
2561
+
2562
+ async def _serialize_update_webhook(input: UpdateWebhookInput, config: Config) -> HTTPRequest:
2563
+ if not input.name:
2564
+ raise ServiceError("name must not be empty.")
2565
+
2566
+ path = "/webhook/{name}".format(
2567
+ name=urlquote(input.name, safe=''),
2568
+ )
2569
+ query: str = f''
2570
+
2571
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2572
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2573
+ content = codec.serialize(input)
2574
+ if not content:
2575
+ content = b"{}"
2576
+ content_length = len(content)
2577
+ body = SeekableAsyncBytesReader(content)
2578
+
2579
+ headers = Fields(
2580
+ [
2581
+ Field(name="Content-Type", values=["application/json"]),
2582
+ Field(name="Content-Length", values=[str(content_length)]),
2583
+
2584
+ ]
2585
+ )
2586
+
2587
+ if input.workspace_id:
2588
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2589
+ if input.org_id:
2590
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2591
+ return _HTTPRequest(
2592
+ destination=_URI(
2593
+ host="",
2594
+ path=path,
2595
+ scheme="https",
2596
+ query=query,
2597
+ ),
2598
+ method="PATCH",
2599
+ fields=headers,
2600
+ body=body,
2601
+ )
2602
+
2603
+ async def _serialize_update_workspace(input: UpdateWorkspaceInput, config: Config) -> HTTPRequest:
2604
+ if not input.workspace_name:
2605
+ raise ServiceError("workspace_name must not be empty.")
2606
+
2607
+ path = "/workspaces/{workspace_name}".format(
2608
+ workspace_name=urlquote(input.workspace_name, safe=''),
2609
+ )
2610
+ query: str = f''
2611
+
2612
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2613
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2614
+ content = codec.serialize(input)
2615
+ if not content:
2616
+ content = b"{}"
2617
+ content_length = len(content)
2618
+ body = SeekableAsyncBytesReader(content)
2619
+
2620
+ headers = Fields(
2621
+ [
2622
+ Field(name="Content-Type", values=["application/json"]),
2623
+ Field(name="Content-Length", values=[str(content_length)]),
2624
+
2625
+ ]
2626
+ )
2627
+
2628
+ if input.org_id:
2629
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2630
+ return _HTTPRequest(
2631
+ destination=_URI(
2632
+ host="",
2633
+ path=path,
2634
+ scheme="https",
2635
+ query=query,
2636
+ ),
2637
+ method="PATCH",
2638
+ fields=headers,
2639
+ body=body,
2640
+ )
2641
+
2642
+ async def _serialize_validate_context(input: ValidateContextInput, config: Config) -> HTTPRequest:
2643
+ path = "/context/validate"
2644
+ query: str = f''
2645
+
2646
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2647
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2648
+ content = codec.serialize(input)
2649
+ if not content:
2650
+ content = b"{}"
2651
+ content_length = len(content)
2652
+ body = SeekableAsyncBytesReader(content)
2653
+
2654
+ headers = Fields(
2655
+ [
2656
+ Field(name="Content-Type", values=["application/json"]),
2657
+ Field(name="Content-Length", values=[str(content_length)]),
2658
+
2659
+ ]
2660
+ )
2661
+
2662
+ if input.workspace_id:
2663
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2664
+ if input.org_id:
2665
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2666
+ return _HTTPRequest(
2667
+ destination=_URI(
2668
+ host="",
2669
+ path=path,
2670
+ scheme="https",
2671
+ query=query,
2672
+ ),
2673
+ method="PUT",
2674
+ fields=headers,
2675
+ body=body,
2676
+ )
2677
+
2678
+ async def _serialize_weight_recompute(input: WeightRecomputeInput, config: Config) -> HTTPRequest:
2679
+ path = "/context/weight/recompute"
2680
+ query: str = f''
2681
+
2682
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2683
+ headers = Fields(
2684
+ [
2685
+
2686
+ ]
2687
+ )
2688
+
2689
+ if input.workspace_id:
2690
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2691
+ if input.org_id:
2692
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2693
+ if input.config_tags:
2694
+ headers.extend(Fields([Field(name="x-config-tags", values=[input.config_tags])]))
2695
+ return _HTTPRequest(
2696
+ destination=_URI(
2697
+ host="",
2698
+ path=path,
2699
+ scheme="https",
2700
+ query=query,
2701
+ ),
2702
+ method="PUT",
2703
+ fields=headers,
2704
+ body=body,
2705
+ )