superposition-sdk 0.91.2__py3-none-any.whl → 0.92.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(
@@ -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(
@@ -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(
@@ -1268,6 +1465,8 @@ async def _serialize_list_audit_logs(input: ListAuditLogsInput, config: Config)
1268
1465
  query_params.append(("action", 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,14 +1494,14 @@ 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:
@@ -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,10 +1625,10 @@ 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:
@@ -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,8 +1700,6 @@ 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
1704
  query_params.append(("group_type", input.group_type))
1504
1705
 
@@ -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(
@@ -1549,7 +1750,7 @@ async def _serialize_list_function(input: ListFunctionInput, config: Config) ->
1549
1750
  )
1550
1751
 
1551
1752
  if input.workspace_id:
1552
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1753
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1553
1754
  if input.org_id:
1554
1755
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1555
1756
  return _HTTPRequest(
@@ -1617,7 +1818,7 @@ async def _serialize_list_versions(input: ListVersionsInput, config: Config) ->
1617
1818
  )
1618
1819
 
1619
1820
  if input.workspace_id:
1620
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1821
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1621
1822
  if input.org_id:
1622
1823
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1623
1824
  return _HTTPRequest(
@@ -1654,7 +1855,7 @@ async def _serialize_list_webhook(input: ListWebhookInput, config: Config) -> HT
1654
1855
  )
1655
1856
 
1656
1857
  if input.workspace_id:
1657
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1858
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1658
1859
  if input.org_id:
1659
1860
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1660
1861
  return _HTTPRequest(
@@ -1760,7 +1961,7 @@ async def _serialize_move_context(input: MoveContextInput, config: Config) -> HT
1760
1961
  )
1761
1962
 
1762
1963
  if input.workspace_id:
1763
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
1964
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1764
1965
  if input.org_id:
1765
1966
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1766
1967
  return _HTTPRequest(
@@ -1801,7 +2002,7 @@ async def _serialize_pause_experiment(input: PauseExperimentInput, config: Confi
1801
2002
  )
1802
2003
 
1803
2004
  if input.workspace_id:
1804
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2005
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1805
2006
  if input.org_id:
1806
2007
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1807
2008
  return _HTTPRequest(
@@ -1842,7 +2043,7 @@ async def _serialize_publish(input: PublishInput, config: Config) -> HTTPRequest
1842
2043
  )
1843
2044
 
1844
2045
  if input.workspace_id:
1845
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2046
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1846
2047
  if input.org_id:
1847
2048
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1848
2049
  return _HTTPRequest(
@@ -1883,7 +2084,7 @@ async def _serialize_ramp_experiment(input: RampExperimentInput, config: Config)
1883
2084
  )
1884
2085
 
1885
2086
  if input.workspace_id:
1886
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2087
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1887
2088
  if input.org_id:
1888
2089
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1889
2090
  return _HTTPRequest(
@@ -1924,7 +2125,7 @@ async def _serialize_remove_members_from_group(input: RemoveMembersFromGroupInpu
1924
2125
  )
1925
2126
 
1926
2127
  if input.workspace_id:
1927
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2128
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1928
2129
  if input.org_id:
1929
2130
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1930
2131
  return _HTTPRequest(
@@ -1965,7 +2166,7 @@ async def _serialize_resume_experiment(input: ResumeExperimentInput, config: Con
1965
2166
  )
1966
2167
 
1967
2168
  if input.workspace_id:
1968
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2169
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
1969
2170
  if input.org_id:
1970
2171
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
1971
2172
  return _HTTPRequest(
@@ -2010,7 +2211,7 @@ async def _serialize_test(input: TestInput, config: Config) -> HTTPRequest:
2010
2211
  )
2011
2212
 
2012
2213
  if input.workspace_id:
2013
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2214
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2014
2215
  if input.org_id:
2015
2216
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2016
2217
  return _HTTPRequest(
@@ -2051,7 +2252,7 @@ async def _serialize_update_default_config(input: UpdateDefaultConfigInput, conf
2051
2252
  )
2052
2253
 
2053
2254
  if input.workspace_id:
2054
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2255
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2055
2256
  if input.org_id:
2056
2257
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2057
2258
  return _HTTPRequest(
@@ -2061,7 +2262,7 @@ async def _serialize_update_default_config(input: UpdateDefaultConfigInput, conf
2061
2262
  scheme="https",
2062
2263
  query=query,
2063
2264
  ),
2064
- method="PUT",
2265
+ method="PATCH",
2065
2266
  fields=headers,
2066
2267
  body=body,
2067
2268
  )
@@ -2092,7 +2293,7 @@ async def _serialize_update_dimension(input: UpdateDimensionInput, config: Confi
2092
2293
  )
2093
2294
 
2094
2295
  if input.workspace_id:
2095
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2296
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2096
2297
  if input.org_id:
2097
2298
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2098
2299
  return _HTTPRequest(
@@ -2102,7 +2303,7 @@ async def _serialize_update_dimension(input: UpdateDimensionInput, config: Confi
2102
2303
  scheme="https",
2103
2304
  query=query,
2104
2305
  ),
2105
- method="PUT",
2306
+ method="PATCH",
2106
2307
  fields=headers,
2107
2308
  body=body,
2108
2309
  )
@@ -2133,7 +2334,7 @@ async def _serialize_update_experiment_group(input: UpdateExperimentGroupInput,
2133
2334
  )
2134
2335
 
2135
2336
  if input.workspace_id:
2136
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2337
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2137
2338
  if input.org_id:
2138
2339
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2139
2340
  return _HTTPRequest(
@@ -2174,7 +2375,7 @@ async def _serialize_update_function(input: UpdateFunctionInput, config: Config)
2174
2375
  )
2175
2376
 
2176
2377
  if input.workspace_id:
2177
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2378
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2178
2379
  if input.org_id:
2179
2380
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2180
2381
  return _HTTPRequest(
@@ -2221,7 +2422,7 @@ async def _serialize_update_organisation(input: UpdateOrganisationInput, config:
2221
2422
  scheme="https",
2222
2423
  query=query,
2223
2424
  ),
2224
- method="PUT",
2425
+ method="PATCH",
2225
2426
  fields=headers,
2226
2427
  body=body,
2227
2428
  )
@@ -2251,7 +2452,7 @@ async def _serialize_update_override(input: UpdateOverrideInput, config: Config)
2251
2452
  )
2252
2453
 
2253
2454
  if input.workspace_id:
2254
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2455
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2255
2456
  if input.org_id:
2256
2457
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2257
2458
  if input.config_tags:
@@ -2294,7 +2495,7 @@ async def _serialize_update_overrides_experiment(input: UpdateOverridesExperimen
2294
2495
  )
2295
2496
 
2296
2497
  if input.workspace_id:
2297
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2498
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2298
2499
  if input.org_id:
2299
2500
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2300
2501
  return _HTTPRequest(
@@ -2304,7 +2505,7 @@ async def _serialize_update_overrides_experiment(input: UpdateOverridesExperimen
2304
2505
  scheme="https",
2305
2506
  query=query,
2306
2507
  ),
2307
- method="PUT",
2508
+ method="PATCH",
2308
2509
  fields=headers,
2309
2510
  body=body,
2310
2511
  )
@@ -2335,7 +2536,7 @@ async def _serialize_update_type_templates(input: UpdateTypeTemplatesInput, conf
2335
2536
  )
2336
2537
 
2337
2538
  if input.workspace_id:
2338
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2539
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2339
2540
  if input.org_id:
2340
2541
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2341
2542
  return _HTTPRequest(
@@ -2345,7 +2546,7 @@ async def _serialize_update_type_templates(input: UpdateTypeTemplatesInput, conf
2345
2546
  scheme="https",
2346
2547
  query=query,
2347
2548
  ),
2348
- method="PUT",
2549
+ method="PATCH",
2349
2550
  fields=headers,
2350
2551
  body=body,
2351
2552
  )
@@ -2376,7 +2577,7 @@ async def _serialize_update_webhook(input: UpdateWebhookInput, config: Config) -
2376
2577
  )
2377
2578
 
2378
2579
  if input.workspace_id:
2379
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2580
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2380
2581
  if input.org_id:
2381
2582
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2382
2583
  return _HTTPRequest(
@@ -2416,6 +2617,42 @@ async def _serialize_update_workspace(input: UpdateWorkspaceInput, config: Confi
2416
2617
  ]
2417
2618
  )
2418
2619
 
2620
+ if input.org_id:
2621
+ headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2622
+ return _HTTPRequest(
2623
+ destination=_URI(
2624
+ host="",
2625
+ path=path,
2626
+ scheme="https",
2627
+ query=query,
2628
+ ),
2629
+ method="PATCH",
2630
+ fields=headers,
2631
+ body=body,
2632
+ )
2633
+
2634
+ async def _serialize_validate_context(input: ValidateContextInput, config: Config) -> HTTPRequest:
2635
+ path = "/context/validate"
2636
+ query: str = f''
2637
+
2638
+ body: AsyncIterable[bytes] = AsyncBytesReader(b'')
2639
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
2640
+ content = codec.serialize(input)
2641
+ if not content:
2642
+ content = b"{}"
2643
+ content_length = len(content)
2644
+ body = SeekableAsyncBytesReader(content)
2645
+
2646
+ headers = Fields(
2647
+ [
2648
+ Field(name="Content-Type", values=["application/json"]),
2649
+ Field(name="Content-Length", values=[str(content_length)]),
2650
+
2651
+ ]
2652
+ )
2653
+
2654
+ if input.workspace_id:
2655
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2419
2656
  if input.org_id:
2420
2657
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2421
2658
  return _HTTPRequest(
@@ -2442,7 +2679,7 @@ async def _serialize_weight_recompute(input: WeightRecomputeInput, config: Confi
2442
2679
  )
2443
2680
 
2444
2681
  if input.workspace_id:
2445
- headers.extend(Fields([Field(name="x-tenant", values=[input.workspace_id])]))
2682
+ headers.extend(Fields([Field(name="x-workspace", values=[input.workspace_id])]))
2446
2683
  if input.org_id:
2447
2684
  headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
2448
2685
  if input.config_tags: