superposition-sdk 0.91.2__py3-none-any.whl → 0.93.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of superposition-sdk might be problematic. Click here for more details.

@@ -35,19 +35,25 @@ from .models import (
35
35
  DeleteExperimentGroupInput,
36
36
  DeleteFunctionInput,
37
37
  DeleteTypeTemplatesInput,
38
+ DeleteWebhookInput,
38
39
  DiscardExperimentInput,
39
40
  GetConfigFastInput,
40
41
  GetConfigInput,
41
42
  GetContextFromConditionInput,
42
43
  GetContextInput,
44
+ GetDefaultConfigInput,
43
45
  GetDimensionInput,
44
46
  GetExperimentGroupInput,
45
47
  GetExperimentInput,
46
48
  GetFunctionInput,
47
49
  GetOrganisationInput,
48
50
  GetResolvedConfigInput,
51
+ GetTypeTemplateInput,
49
52
  GetTypeTemplatesListInput,
53
+ GetVersionInput,
54
+ GetWebhookByEventInput,
50
55
  GetWebhookInput,
56
+ GetWorkspaceInput,
51
57
  ListAuditLogsInput,
52
58
  ListContextsInput,
53
59
  ListDefaultConfigsInput,
@@ -78,6 +84,7 @@ from .models import (
78
84
  UpdateTypeTemplatesInput,
79
85
  UpdateWebhookInput,
80
86
  UpdateWorkspaceInput,
87
+ ValidateContextInput,
81
88
  WeightRecomputeInput,
82
89
  )
83
90
 
@@ -108,7 +115,7 @@ async def _serialize_add_members_to_group(input: AddMembersToGroupInput, config:
108
115
  )
109
116
 
110
117
  if input.workspace_id:
111
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
118
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
112
119
  if input.org_id:
113
120
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
114
121
  return _HTTPRequest(
@@ -144,7 +151,7 @@ async def _serialize_applicable_variants(input: ApplicableVariantsInput, config:
144
151
  )
145
152
 
146
153
  if input.workspace_id:
147
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
154
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
148
155
  if input.org_id:
149
156
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
150
157
  return _HTTPRequest(
@@ -184,7 +191,7 @@ async def _serialize_bulk_operation(input: BulkOperationInput, config: Config) -
184
191
  )
185
192
 
186
193
  if input.workspace_id:
187
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
194
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
188
195
  if input.org_id:
189
196
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
190
197
  if input.config_tags:
@@ -227,7 +234,7 @@ async def _serialize_conclude_experiment(input: ConcludeExperimentInput, config:
227
234
  )
228
235
 
229
236
  if input.workspace_id:
230
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
237
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
231
238
  if input.org_id:
232
239
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
233
240
  return _HTTPRequest(
@@ -263,7 +270,7 @@ async def _serialize_create_context(input: CreateContextInput, config: Config) -
263
270
  )
264
271
 
265
272
  if input.workspace_id:
266
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
273
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
267
274
  if input.org_id:
268
275
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
269
276
  if input.config_tags:
@@ -301,7 +308,7 @@ async def _serialize_create_default_config(input: CreateDefaultConfigInput, conf
301
308
  )
302
309
 
303
310
  if input.workspace_id:
304
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
311
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
305
312
  if input.org_id:
306
313
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
307
314
  return _HTTPRequest(
@@ -337,7 +344,7 @@ async def _serialize_create_dimension(input: CreateDimensionInput, config: Confi
337
344
  )
338
345
 
339
346
  if input.workspace_id:
340
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
347
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
341
348
  if input.org_id:
342
349
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
343
350
  return _HTTPRequest(
@@ -373,7 +380,7 @@ async def _serialize_create_experiment(input: CreateExperimentInput, config: Con
373
380
  )
374
381
 
375
382
  if input.workspace_id:
376
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
383
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
377
384
  if input.org_id:
378
385
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
379
386
  return _HTTPRequest(
@@ -409,7 +416,7 @@ async def _serialize_create_experiment_group(input: CreateExperimentGroupInput,
409
416
  )
410
417
 
411
418
  if input.workspace_id:
412
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
419
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
413
420
  if input.org_id:
414
421
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
415
422
  return _HTTPRequest(
@@ -445,7 +452,7 @@ async def _serialize_create_function(input: CreateFunctionInput, config: Config)
445
452
  )
446
453
 
447
454
  if input.workspace_id:
448
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
455
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
449
456
  if input.org_id:
450
457
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
451
458
  return _HTTPRequest(
@@ -513,7 +520,7 @@ async def _serialize_create_type_templates(input: CreateTypeTemplatesInput, conf
513
520
  )
514
521
 
515
522
  if input.workspace_id:
516
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
523
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
517
524
  if input.org_id:
518
525
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
519
526
  return _HTTPRequest(
@@ -549,7 +556,7 @@ async def _serialize_create_webhook(input: CreateWebhookInput, config: Config) -
549
556
  )
550
557
 
551
558
  if input.workspace_id:
552
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
559
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
553
560
  if input.org_id:
554
561
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
555
562
  return _HTTPRequest(
@@ -615,7 +622,7 @@ async def _serialize_delete_context(input: DeleteContextInput, config: Config) -
615
622
  )
616
623
 
617
624
  if input.workspace_id:
618
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
625
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
619
626
  if input.org_id:
620
627
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
621
628
  if input.config_tags:
@@ -649,7 +656,7 @@ async def _serialize_delete_default_config(input: DeleteDefaultConfigInput, conf
649
656
  )
650
657
 
651
658
  if input.workspace_id:
652
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
659
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
653
660
  if input.org_id:
654
661
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
655
662
  return _HTTPRequest(
@@ -681,7 +688,7 @@ async def _serialize_delete_dimension(input: DeleteDimensionInput, config: Confi
681
688
  )
682
689
 
683
690
  if input.workspace_id:
684
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
691
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
685
692
  if input.org_id:
686
693
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
687
694
  return _HTTPRequest(
@@ -713,7 +720,7 @@ async def _serialize_delete_experiment_group(input: DeleteExperimentGroupInput,
713
720
  )
714
721
 
715
722
  if input.workspace_id:
716
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
723
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
717
724
  if input.org_id:
718
725
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
719
726
  return _HTTPRequest(
@@ -745,7 +752,7 @@ async def _serialize_delete_function(input: DeleteFunctionInput, config: Config)
745
752
  )
746
753
 
747
754
  if input.workspace_id:
748
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
755
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
749
756
  if input.org_id:
750
757
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
751
758
  return _HTTPRequest(
@@ -777,7 +784,39 @@ async def _serialize_delete_type_templates(input: DeleteTypeTemplatesInput, conf
777
784
  )
778
785
 
779
786
  if input.workspace_id:
780
- headers.extend(Fields([Field(name="x-tenant", values=[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])]))
781
820
  if input.org_id:
782
821
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
783
822
  return _HTTPRequest(
@@ -818,7 +857,7 @@ async def _serialize_discard_experiment(input: DiscardExperimentInput, config: C
818
857
  )
819
858
 
820
859
  if input.workspace_id:
821
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
860
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
822
861
  if input.org_id:
823
862
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
824
863
  return _HTTPRequest(
@@ -839,7 +878,7 @@ async def _serialize_get_config(input: GetConfigInput, config: Config) -> HTTPRe
839
878
 
840
879
  query_params: list[tuple[str, str | None]] = []
841
880
  if input.prefix is not None:
842
- query_params.append(("prefix", input.prefix))
881
+ query_params.extend(("prefix", e) for e in input.prefix)
843
882
  if input.version is not None:
844
883
  query_params.append(("version", input.version))
845
884
 
@@ -862,7 +901,7 @@ async def _serialize_get_config(input: GetConfigInput, config: Config) -> HTTPRe
862
901
  )
863
902
 
864
903
  if input.workspace_id:
865
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
904
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
866
905
  if input.org_id:
867
906
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
868
907
  return _HTTPRequest(
@@ -889,7 +928,7 @@ async def _serialize_get_config_fast(input: GetConfigFastInput, config: Config)
889
928
  )
890
929
 
891
930
  if input.workspace_id:
892
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
931
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
893
932
  if input.org_id:
894
933
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
895
934
  return _HTTPRequest(
@@ -921,7 +960,7 @@ async def _serialize_get_context(input: GetContextInput, config: Config) -> HTTP
921
960
  )
922
961
 
923
962
  if input.workspace_id:
924
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
963
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
925
964
  if input.org_id:
926
965
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
927
966
  return _HTTPRequest(
@@ -957,7 +996,7 @@ async def _serialize_get_context_from_condition(input: GetContextFromConditionIn
957
996
  )
958
997
 
959
998
  if input.workspace_id:
960
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
999
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
961
1000
  if input.org_id:
962
1001
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
963
1002
  return _HTTPRequest(
@@ -972,6 +1011,38 @@ async def _serialize_get_context_from_condition(input: GetContextFromConditionIn
972
1011
  body=body,
973
1012
  )
974
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
+
975
1046
  async def _serialize_get_dimension(input: GetDimensionInput, config: Config) -> HTTPRequest:
976
1047
  if not input.dimension:
977
1048
  raise ServiceError("dimension must not be empty.")
@@ -989,7 +1060,7 @@ async def _serialize_get_dimension(input: GetDimensionInput, config: Config) ->
989
1060
  )
990
1061
 
991
1062
  if input.workspace_id:
992
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1063
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
993
1064
  if input.org_id:
994
1065
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
995
1066
  return _HTTPRequest(
@@ -1021,7 +1092,7 @@ async def _serialize_get_experiment(input: GetExperimentInput, config: Config) -
1021
1092
  )
1022
1093
 
1023
1094
  if input.workspace_id:
1024
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1095
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1025
1096
  if input.org_id:
1026
1097
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1027
1098
  return _HTTPRequest(
@@ -1053,7 +1124,7 @@ async def _serialize_get_experiment_group(input: GetExperimentGroupInput, config
1053
1124
  )
1054
1125
 
1055
1126
  if input.workspace_id:
1056
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1127
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1057
1128
  if input.org_id:
1058
1129
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1059
1130
  return _HTTPRequest(
@@ -1085,7 +1156,7 @@ async def _serialize_get_function(input: GetFunctionInput, config: Config) -> HT
1085
1156
  )
1086
1157
 
1087
1158
  if input.workspace_id:
1088
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1159
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1089
1160
  if input.org_id:
1090
1161
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1091
1162
  return _HTTPRequest(
@@ -1134,7 +1205,7 @@ async def _serialize_get_resolved_config(input: GetResolvedConfigInput, config:
1134
1205
 
1135
1206
  query_params: list[tuple[str, str | None]] = []
1136
1207
  if input.prefix is not None:
1137
- query_params.append(("prefix", input.prefix))
1208
+ query_params.extend(("prefix", e) for e in input.prefix)
1138
1209
  if input.version is not None:
1139
1210
  query_params.append(("version", input.version))
1140
1211
  if input.show_reasoning is not None:
@@ -1161,7 +1232,7 @@ async def _serialize_get_resolved_config(input: GetResolvedConfigInput, config:
1161
1232
  )
1162
1233
 
1163
1234
  if input.workspace_id:
1164
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1235
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1165
1236
  if input.org_id:
1166
1237
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1167
1238
  if input.merge_strategy:
@@ -1178,6 +1249,38 @@ async def _serialize_get_resolved_config(input: GetResolvedConfigInput, config:
1178
1249
  body=body,
1179
1250
  )
1180
1251
 
1252
+ async def _serialize_get_type_template(input: GetTypeTemplateInput, config: Config) -> HTTPRequest:
1253
+ if not input.type_name:
1254
+ raise ServiceError("type_name must not be empty.")
1255
+
1256
+ path = "/types/{type_name}".format(
1257
+ type_name=urlquote(input.type_name, safe=''),
1258
+ )
1259
+ query: str = f''
1260
+
1261
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1262
+ headers = Fields(
1263
+ [
1264
+
1265
+ ]
1266
+ )
1267
+
1268
+ if input.workspace_id:
1269
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1270
+ if input.org_id:
1271
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1272
+ return _HTTPRequest(
1273
+ destination=_URI(
1274
+ host="",
1275
+ path=path,
1276
+ scheme="https",
1277
+ query=query,
1278
+ ),
1279
+ method="GET",
1280
+ fields=headers,
1281
+ body=body,
1282
+ )
1283
+
1181
1284
  async def _serialize_get_type_templates_list(input: GetTypeTemplatesListInput, config: Config) -> HTTPRequest:
1182
1285
  path = "/types"
1183
1286
  query: str = f''
@@ -1200,7 +1303,39 @@ async def _serialize_get_type_templates_list(input: GetTypeTemplatesListInput, c
1200
1303
  )
1201
1304
 
1202
1305
  if input.workspace_id:
1203
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1306
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1307
+ if input.org_id:
1308
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1309
+ return _HTTPRequest(
1310
+ destination=_URI(
1311
+ host="",
1312
+ path=path,
1313
+ scheme="https",
1314
+ query=query,
1315
+ ),
1316
+ method="GET",
1317
+ fields=headers,
1318
+ body=body,
1319
+ )
1320
+
1321
+ async def _serialize_get_version(input: GetVersionInput, config: Config) -> HTTPRequest:
1322
+ if not input.id:
1323
+ raise ServiceError("id must not be empty.")
1324
+
1325
+ path = "/version/{id}".format(
1326
+ id=urlquote(input.id, safe=''),
1327
+ )
1328
+ query: str = f''
1329
+
1330
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1331
+ headers = Fields(
1332
+ [
1333
+
1334
+ ]
1335
+ )
1336
+
1337
+ if input.workspace_id:
1338
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1204
1339
  if input.org_id:
1205
1340
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1206
1341
  return _HTTPRequest(
@@ -1232,7 +1367,69 @@ async def _serialize_get_webhook(input: GetWebhookInput, config: Config) -> HTTP
1232
1367
  )
1233
1368
 
1234
1369
  if input.workspace_id:
1235
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1370
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1371
+ if input.org_id:
1372
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1373
+ return _HTTPRequest(
1374
+ destination=_URI(
1375
+ host="",
1376
+ path=path,
1377
+ scheme="https",
1378
+ query=query,
1379
+ ),
1380
+ method="GET",
1381
+ fields=headers,
1382
+ body=body,
1383
+ )
1384
+
1385
+ async def _serialize_get_webhook_by_event(input: GetWebhookByEventInput, config: Config) -> HTTPRequest:
1386
+ if not input.event:
1387
+ raise ServiceError("event must not be empty.")
1388
+
1389
+ path = "/webhook/event/{event}".format(
1390
+ event=urlquote(input.event, safe=''),
1391
+ )
1392
+ query: str = f''
1393
+
1394
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1395
+ headers = Fields(
1396
+ [
1397
+
1398
+ ]
1399
+ )
1400
+
1401
+ if input.workspace_id:
1402
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1403
+ if input.org_id:
1404
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1405
+ return _HTTPRequest(
1406
+ destination=_URI(
1407
+ host="",
1408
+ path=path,
1409
+ scheme="https",
1410
+ query=query,
1411
+ ),
1412
+ method="GET",
1413
+ fields=headers,
1414
+ body=body,
1415
+ )
1416
+
1417
+ async def _serialize_get_workspace(input: GetWorkspaceInput, config: Config) -> HTTPRequest:
1418
+ if not input.workspace_name:
1419
+ raise ServiceError("workspace_name must not be empty.")
1420
+
1421
+ path = "/workspaces/{workspace_name}".format(
1422
+ workspace_name=urlquote(input.workspace_name, safe=''),
1423
+ )
1424
+ query: str = f''
1425
+
1426
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
1427
+ headers = Fields(
1428
+ [
1429
+
1430
+ ]
1431
+ )
1432
+
1236
1433
  if input.org_id:
1237
1434
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1238
1435
  return _HTTPRequest(
@@ -1263,11 +1460,13 @@ async def _serialize_list_audit_logs(input: ListAuditLogsInput, config: Config)
1263
1460
  if input.to_date is not None:
1264
1461
  query_params.append(("to_date", serialize_rfc3339(ensure_utc(input.to_date))))
1265
1462
  if input.tables is not None:
1266
- query_params.append(("table", input.tables))
1463
+ query_params.extend(("table", e) for e in input.tables)
1267
1464
  if input.action is not None:
1268
- query_params.append(("action", input.action))
1465
+ query_params.extend(("action", e) for e in input.action)
1269
1466
  if input.username is not None:
1270
1467
  query_params.append(("username", input.username))
1468
+ if input.sort_by is not None:
1469
+ query_params.append(("sort_by", input.sort_by))
1271
1470
 
1272
1471
  query = join_query_params(params=query_params, prefix=query)
1273
1472
 
@@ -1279,7 +1478,7 @@ async def _serialize_list_audit_logs(input: ListAuditLogsInput, config: Config)
1279
1478
  )
1280
1479
 
1281
1480
  if input.workspace_id:
1282
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1481
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1283
1482
  if input.org_id:
1284
1483
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1285
1484
  return _HTTPRequest(
@@ -1295,26 +1494,26 @@ async def _serialize_list_audit_logs(input: ListAuditLogsInput, config: Config)
1295
1494
  )
1296
1495
 
1297
1496
  async def _serialize_list_contexts(input: ListContextsInput, config: Config) -> HTTPRequest:
1298
- path = "/context/list"
1497
+ path = "/context"
1299
1498
  query: str = f''
1300
1499
 
1301
1500
  query_params: list[tuple[str, str | None]] = []
1302
- if input.page is not None:
1303
- query_params.append(("page", str(input.page)))
1304
1501
  if input.count is not None:
1305
1502
  query_params.append(("count", str(input.count)))
1503
+ if input.page is not None:
1504
+ query_params.append(("page", str(input.page)))
1306
1505
  if input.all is not None:
1307
1506
  query_params.append(("all", ('true' if input.all else 'false')))
1308
1507
  if input.prefix is not None:
1309
- query_params.append(("prefix", input.prefix))
1508
+ query_params.extend(("prefix", e) for e in input.prefix)
1310
1509
  if input.sort_on is not None:
1311
1510
  query_params.append(("sort_on", input.sort_on))
1312
1511
  if input.sort_by is not None:
1313
1512
  query_params.append(("sort_by", input.sort_by))
1314
1513
  if input.created_by is not None:
1315
- query_params.append(("created_by", input.created_by))
1514
+ query_params.extend(("created_by", e) for e in input.created_by)
1316
1515
  if input.last_modified_by is not None:
1317
- query_params.append(("last_modified_by", input.last_modified_by))
1516
+ query_params.extend(("last_modified_by", e) for e in input.last_modified_by)
1318
1517
  if input.plaintext is not None:
1319
1518
  query_params.append(("plaintext", input.plaintext))
1320
1519
  if input.dimension_match_strategy is not None:
@@ -1330,7 +1529,7 @@ async def _serialize_list_contexts(input: ListContextsInput, config: Config) ->
1330
1529
  )
1331
1530
 
1332
1531
  if input.workspace_id:
1333
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1532
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1334
1533
  if input.org_id:
1335
1534
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1336
1535
  return _HTTPRequest(
@@ -1356,6 +1555,8 @@ async def _serialize_list_default_configs(input: ListDefaultConfigsInput, config
1356
1555
  query_params.append(("page", str(input.page)))
1357
1556
  if input.all is not None:
1358
1557
  query_params.append(("all", ('true' if input.all else 'false')))
1558
+ if input.name is not None:
1559
+ query_params.append(("name", input.name))
1359
1560
 
1360
1561
  query = join_query_params(params=query_params, prefix=query)
1361
1562
 
@@ -1367,7 +1568,7 @@ async def _serialize_list_default_configs(input: ListDefaultConfigsInput, config
1367
1568
  )
1368
1569
 
1369
1570
  if input.workspace_id:
1370
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1571
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1371
1572
  if input.org_id:
1372
1573
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1373
1574
  return _HTTPRequest(
@@ -1404,7 +1605,7 @@ async def _serialize_list_dimensions(input: ListDimensionsInput, config: Config)
1404
1605
  )
1405
1606
 
1406
1607
  if input.workspace_id:
1407
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1608
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1408
1609
  if input.org_id:
1409
1610
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1410
1611
  return _HTTPRequest(
@@ -1424,14 +1625,14 @@ async def _serialize_list_experiment(input: ListExperimentInput, config: Config)
1424
1625
  query: str = f''
1425
1626
 
1426
1627
  query_params: list[tuple[str, str | None]] = []
1427
- if input.page is not None:
1428
- query_params.append(("page", str(input.page)))
1429
1628
  if input.count is not None:
1430
1629
  query_params.append(("count", str(input.count)))
1630
+ if input.page is not None:
1631
+ query_params.append(("page", str(input.page)))
1431
1632
  if input.all is not None:
1432
1633
  query_params.append(("all", ('true' if input.all else 'false')))
1433
1634
  if input.status is not None:
1434
- query_params.append(("status", input.status))
1635
+ query_params.extend(("status", e) for e in input.status)
1435
1636
  if input.from_date is not None:
1436
1637
  query_params.append(("from_date", serialize_rfc3339(ensure_utc(input.from_date))))
1437
1638
  if input.to_date is not None:
@@ -1439,11 +1640,11 @@ async def _serialize_list_experiment(input: ListExperimentInput, config: Config)
1439
1640
  if input.experiment_name is not None:
1440
1641
  query_params.append(("experiment_name", input.experiment_name))
1441
1642
  if input.experiment_ids is not None:
1442
- query_params.append(("experiment_ids", input.experiment_ids))
1643
+ query_params.extend(("experiment_ids", e) for e in input.experiment_ids)
1443
1644
  if input.experiment_group_ids is not None:
1444
- query_params.append(("experiment_group_ids", input.experiment_group_ids))
1645
+ query_params.extend(("experiment_group_ids", e) for e in input.experiment_group_ids)
1445
1646
  if input.created_by is not None:
1446
- query_params.append(("created_by", input.created_by))
1647
+ query_params.extend(("created_by", e) for e in input.created_by)
1447
1648
  if input.sort_on is not None:
1448
1649
  query_params.append(("sort_on", input.sort_on))
1449
1650
  if input.sort_by is not None:
@@ -1463,7 +1664,7 @@ async def _serialize_list_experiment(input: ListExperimentInput, config: Config)
1463
1664
  )
1464
1665
 
1465
1666
  if input.workspace_id:
1466
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1667
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1467
1668
  if input.org_id:
1468
1669
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1469
1670
  return _HTTPRequest(
@@ -1483,10 +1684,12 @@ async def _serialize_list_experiment_groups(input: ListExperimentGroupsInput, co
1483
1684
  query: str = f''
1484
1685
 
1485
1686
  query_params: list[tuple[str, str | None]] = []
1486
- if input.page is not None:
1487
- query_params.append(("page", str(input.page)))
1488
1687
  if input.count is not None:
1489
1688
  query_params.append(("count", str(input.count)))
1689
+ if input.page is not None:
1690
+ query_params.append(("page", str(input.page)))
1691
+ if input.all is not None:
1692
+ query_params.append(("all", ('true' if input.all else 'false')))
1490
1693
  if input.name is not None:
1491
1694
  query_params.append(("name", input.name))
1492
1695
  if input.created_by is not None:
@@ -1497,10 +1700,8 @@ async def _serialize_list_experiment_groups(input: ListExperimentGroupsInput, co
1497
1700
  query_params.append(("sort_on", input.sort_on))
1498
1701
  if input.sort_by is not None:
1499
1702
  query_params.append(("sort_by", input.sort_by))
1500
- if input.all is not None:
1501
- query_params.append(("all", ('true' if input.all else 'false')))
1502
1703
  if input.group_type is not None:
1503
- query_params.append(("group_type", input.group_type))
1704
+ query_params.extend(("group_type", e) for e in input.group_type)
1504
1705
 
1505
1706
  query = join_query_params(params=query_params, prefix=query)
1506
1707
 
@@ -1512,7 +1713,7 @@ async def _serialize_list_experiment_groups(input: ListExperimentGroupsInput, co
1512
1713
  )
1513
1714
 
1514
1715
  if input.workspace_id:
1515
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1716
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1516
1717
  if input.org_id:
1517
1718
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1518
1719
  return _HTTPRequest(
@@ -1538,6 +1739,8 @@ async def _serialize_list_function(input: ListFunctionInput, config: Config) ->
1538
1739
  query_params.append(("page", str(input.page)))
1539
1740
  if input.all is not None:
1540
1741
  query_params.append(("all", ('true' if input.all else 'false')))
1742
+ if input.function_type is not None:
1743
+ query_params.extend(("function_type", e) for e in input.function_type)
1541
1744
 
1542
1745
  query = join_query_params(params=query_params, prefix=query)
1543
1746
 
@@ -1549,7 +1752,7 @@ async def _serialize_list_function(input: ListFunctionInput, config: Config) ->
1549
1752
  )
1550
1753
 
1551
1754
  if input.workspace_id:
1552
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1755
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1553
1756
  if input.org_id:
1554
1757
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1555
1758
  return _HTTPRequest(
@@ -1617,7 +1820,7 @@ async def _serialize_list_versions(input: ListVersionsInput, config: Config) ->
1617
1820
  )
1618
1821
 
1619
1822
  if input.workspace_id:
1620
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1823
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1621
1824
  if input.org_id:
1622
1825
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1623
1826
  return _HTTPRequest(
@@ -1654,7 +1857,7 @@ async def _serialize_list_webhook(input: ListWebhookInput, config: Config) -> HT
1654
1857
  )
1655
1858
 
1656
1859
  if input.workspace_id:
1657
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1860
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1658
1861
  if input.org_id:
1659
1862
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1660
1863
  return _HTTPRequest(
@@ -1760,7 +1963,7 @@ async def _serialize_move_context(input: MoveContextInput, config: Config) -> HT
1760
1963
  )
1761
1964
 
1762
1965
  if input.workspace_id:
1763
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1966
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1764
1967
  if input.org_id:
1765
1968
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1766
1969
  return _HTTPRequest(
@@ -1801,7 +2004,7 @@ async def _serialize_pause_experiment(input: PauseExperimentInput, config: Confi
1801
2004
  )
1802
2005
 
1803
2006
  if input.workspace_id:
1804
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2007
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1805
2008
  if input.org_id:
1806
2009
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1807
2010
  return _HTTPRequest(
@@ -1842,7 +2045,7 @@ async def _serialize_publish(input: PublishInput, config: Config) -> HTTPRequest
1842
2045
  )
1843
2046
 
1844
2047
  if input.workspace_id:
1845
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2048
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1846
2049
  if input.org_id:
1847
2050
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1848
2051
  return _HTTPRequest(
@@ -1883,7 +2086,7 @@ async def _serialize_ramp_experiment(input: RampExperimentInput, config: Config)
1883
2086
  )
1884
2087
 
1885
2088
  if input.workspace_id:
1886
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2089
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1887
2090
  if input.org_id:
1888
2091
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1889
2092
  return _HTTPRequest(
@@ -1924,7 +2127,7 @@ async def _serialize_remove_members_from_group(input: RemoveMembersFromGroupInpu
1924
2127
  )
1925
2128
 
1926
2129
  if input.workspace_id:
1927
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2130
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1928
2131
  if input.org_id:
1929
2132
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1930
2133
  return _HTTPRequest(
@@ -1965,7 +2168,7 @@ async def _serialize_resume_experiment(input: ResumeExperimentInput, config: Con
1965
2168
  )
1966
2169
 
1967
2170
  if input.workspace_id:
1968
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2171
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1969
2172
  if input.org_id:
1970
2173
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1971
2174
  return _HTTPRequest(
@@ -2010,7 +2213,7 @@ async def _serialize_test(input: TestInput, config: Config) -> HTTPRequest:
2010
2213
  )
2011
2214
 
2012
2215
  if input.workspace_id:
2013
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2216
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2014
2217
  if input.org_id:
2015
2218
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2016
2219
  return _HTTPRequest(
@@ -2051,7 +2254,7 @@ async def _serialize_update_default_config(input: UpdateDefaultConfigInput, conf
2051
2254
  )
2052
2255
 
2053
2256
  if input.workspace_id:
2054
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2257
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2055
2258
  if input.org_id:
2056
2259
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2057
2260
  return _HTTPRequest(
@@ -2061,7 +2264,7 @@ async def _serialize_update_default_config(input: UpdateDefaultConfigInput, conf
2061
2264
  scheme="https",
2062
2265
  query=query,
2063
2266
  ),
2064
- method="PUT",
2267
+ method="PATCH",
2065
2268
  fields=headers,
2066
2269
  body=body,
2067
2270
  )
@@ -2092,7 +2295,7 @@ async def _serialize_update_dimension(input: UpdateDimensionInput, config: Confi
2092
2295
  )
2093
2296
 
2094
2297
  if input.workspace_id:
2095
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2298
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2096
2299
  if input.org_id:
2097
2300
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2098
2301
  return _HTTPRequest(
@@ -2102,7 +2305,7 @@ async def _serialize_update_dimension(input: UpdateDimensionInput, config: Confi
2102
2305
  scheme="https",
2103
2306
  query=query,
2104
2307
  ),
2105
- method="PUT",
2308
+ method="PATCH",
2106
2309
  fields=headers,
2107
2310
  body=body,
2108
2311
  )
@@ -2133,7 +2336,7 @@ async def _serialize_update_experiment_group(input: UpdateExperimentGroupInput,
2133
2336
  )
2134
2337
 
2135
2338
  if input.workspace_id:
2136
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2339
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2137
2340
  if input.org_id:
2138
2341
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2139
2342
  return _HTTPRequest(
@@ -2174,7 +2377,7 @@ async def _serialize_update_function(input: UpdateFunctionInput, config: Config)
2174
2377
  )
2175
2378
 
2176
2379
  if input.workspace_id:
2177
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2380
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2178
2381
  if input.org_id:
2179
2382
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2180
2383
  return _HTTPRequest(
@@ -2221,7 +2424,7 @@ async def _serialize_update_organisation(input: UpdateOrganisationInput, config:
2221
2424
  scheme="https",
2222
2425
  query=query,
2223
2426
  ),
2224
- method="PUT",
2427
+ method="PATCH",
2225
2428
  fields=headers,
2226
2429
  body=body,
2227
2430
  )
@@ -2251,7 +2454,7 @@ async def _serialize_update_override(input: UpdateOverrideInput, config: Config)
2251
2454
  )
2252
2455
 
2253
2456
  if input.workspace_id:
2254
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2457
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2255
2458
  if input.org_id:
2256
2459
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2257
2460
  if input.config_tags:
@@ -2294,7 +2497,7 @@ async def _serialize_update_overrides_experiment(input: UpdateOverridesExperimen
2294
2497
  )
2295
2498
 
2296
2499
  if input.workspace_id:
2297
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2500
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2298
2501
  if input.org_id:
2299
2502
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2300
2503
  return _HTTPRequest(
@@ -2304,7 +2507,7 @@ async def _serialize_update_overrides_experiment(input: UpdateOverridesExperimen
2304
2507
  scheme="https",
2305
2508
  query=query,
2306
2509
  ),
2307
- method="PUT",
2510
+ method="PATCH",
2308
2511
  fields=headers,
2309
2512
  body=body,
2310
2513
  )
@@ -2335,7 +2538,7 @@ async def _serialize_update_type_templates(input: UpdateTypeTemplatesInput, conf
2335
2538
  )
2336
2539
 
2337
2540
  if input.workspace_id:
2338
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2541
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2339
2542
  if input.org_id:
2340
2543
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2341
2544
  return _HTTPRequest(
@@ -2345,7 +2548,7 @@ async def _serialize_update_type_templates(input: UpdateTypeTemplatesInput, conf
2345
2548
  scheme="https",
2346
2549
  query=query,
2347
2550
  ),
2348
- method="PUT",
2551
+ method="PATCH",
2349
2552
  fields=headers,
2350
2553
  body=body,
2351
2554
  )
@@ -2376,7 +2579,7 @@ async def _serialize_update_webhook(input: UpdateWebhookInput, config: Config) -
2376
2579
  )
2377
2580
 
2378
2581
  if input.workspace_id:
2379
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2582
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2380
2583
  if input.org_id:
2381
2584
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2382
2585
  return _HTTPRequest(
@@ -2416,6 +2619,42 @@ async def _serialize_update_workspace(input: UpdateWorkspaceInput, config: Confi
2416
2619
  ]
2417
2620
  )
2418
2621
 
2622
+ if input.org_id:
2623
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2624
+ return _HTTPRequest(
2625
+ destination=_URI(
2626
+ host="",
2627
+ path=path,
2628
+ scheme="https",
2629
+ query=query,
2630
+ ),
2631
+ method="PATCH",
2632
+ fields=headers,
2633
+ body=body,
2634
+ )
2635
+
2636
+ async def _serialize_validate_context(input: ValidateContextInput, config: Config) -> HTTPRequest:
2637
+ path = "/context/validate"
2638
+ query: str = f''
2639
+
2640
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2641
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2642
+ content = codec.serialize(input)
2643
+ if not content:
2644
+ content = b"{}"
2645
+ content_length = len(content)
2646
+ body = SeekableAsyncBytesReader(content)
2647
+
2648
+ headers = Fields(
2649
+ [
2650
+ Field(name="Content-Type", values=["application/json"]),
2651
+ Field(name="Content-Length", values=[str(content_length)]),
2652
+
2653
+ ]
2654
+ )
2655
+
2656
+ if input.workspace_id:
2657
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2419
2658
  if input.org_id:
2420
2659
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2421
2660
  return _HTTPRequest(
@@ -2442,7 +2681,7 @@ async def _serialize_weight_recompute(input: WeightRecomputeInput, config: Confi
2442
2681
  )
2443
2682
 
2444
2683
  if input.workspace_id:
2445
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2684
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2446
2685
  if input.org_id:
2447
2686
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2448
2687
  if input.config_tags: