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.

@@ -36,20 +36,25 @@ from .models import (
36
36
  DeleteExperimentGroupOutput,
37
37
  DeleteFunctionOutput,
38
38
  DeleteTypeTemplatesOutput,
39
+ DeleteWebhookOutput,
39
40
  DiscardExperimentOutput,
40
- FunctionNotFound,
41
41
  GetConfigFastOutput,
42
42
  GetConfigOutput,
43
43
  GetContextFromConditionOutput,
44
44
  GetContextOutput,
45
+ GetDefaultConfigOutput,
45
46
  GetDimensionOutput,
46
47
  GetExperimentGroupOutput,
47
48
  GetExperimentOutput,
48
49
  GetFunctionOutput,
49
50
  GetOrganisationOutput,
50
51
  GetResolvedConfigOutput,
52
+ GetTypeTemplateOutput,
51
53
  GetTypeTemplatesListOutput,
54
+ GetVersionOutput,
55
+ GetWebhookByEventOutput,
52
56
  GetWebhookOutput,
57
+ GetWorkspaceOutput,
53
58
  InternalServerError,
54
59
  ListAuditLogsOutput,
55
60
  ListContextsOutput,
@@ -64,7 +69,6 @@ from .models import (
64
69
  ListWorkspaceOutput,
65
70
  MigrateWorkspaceSchemaOutput,
66
71
  MoveContextOutput,
67
- OrganisationNotFound,
68
72
  PauseExperimentOutput,
69
73
  PublishOutput,
70
74
  RampExperimentOutput,
@@ -72,7 +76,6 @@ from .models import (
72
76
  ResourceNotFound,
73
77
  ResumeExperimentOutput,
74
78
  TestOutput,
75
- TypeTemplatesNotFound,
76
79
  UnknownApiError,
77
80
  UpdateDefaultConfigOutput,
78
81
  UpdateDimensionOutput,
@@ -84,9 +87,8 @@ from .models import (
84
87
  UpdateTypeTemplatesOutput,
85
88
  UpdateWebhookOutput,
86
89
  UpdateWorkspaceOutput,
87
- WebhookNotFound,
90
+ ValidateContextOutput,
88
91
  WeightRecomputeOutput,
89
- WorkspaceNotFound,
90
92
  )
91
93
 
92
94
 
@@ -163,6 +165,9 @@ async def _deserialize_error_bulk_operation(http_response: HTTPResponse, config:
163
165
  case "internalservererror":
164
166
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
165
167
 
168
+ case "resourcenotfound":
169
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
170
+
166
171
  case _:
167
172
  return UnknownApiError(f"{code}: {message}")
168
173
 
@@ -188,6 +193,9 @@ async def _deserialize_error_conclude_experiment(http_response: HTTPResponse, co
188
193
  case "internalservererror":
189
194
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
190
195
 
196
+ case "resourcenotfound":
197
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
198
+
191
199
  case _:
192
200
  return UnknownApiError(f"{code}: {message}")
193
201
 
@@ -213,6 +221,9 @@ async def _deserialize_error_create_context(http_response: HTTPResponse, config:
213
221
  case "internalservererror":
214
222
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
215
223
 
224
+ case "resourcenotfound":
225
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
226
+
216
227
  case _:
217
228
  return UnknownApiError(f"{code}: {message}")
218
229
 
@@ -547,8 +558,8 @@ async def _deserialize_error_delete_function(http_response: HTTPResponse, config
547
558
  case "internalservererror":
548
559
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
549
560
 
550
- case "functionnotfound":
551
- return await _deserialize_error_function_not_found(http_response, config, parsed_body, message)
561
+ case "resourcenotfound":
562
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
552
563
 
553
564
  case _:
554
565
  return UnknownApiError(f"{code}: {message}")
@@ -575,8 +586,29 @@ async def _deserialize_error_delete_type_templates(http_response: HTTPResponse,
575
586
  case "internalservererror":
576
587
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
577
588
 
578
- case "typetemplatesnotfound":
579
- return await _deserialize_error_type_templates_not_found(http_response, config, parsed_body, message)
589
+ case "resourcenotfound":
590
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
591
+
592
+ case _:
593
+ return UnknownApiError(f"{code}: {message}")
594
+
595
+ async def _deserialize_delete_webhook(http_response: HTTPResponse, config: Config) -> DeleteWebhookOutput:
596
+ if http_response.status != 201 and http_response.status >= 300:
597
+ raise await _deserialize_error_delete_webhook(http_response, config)
598
+
599
+ kwargs: dict[str, Any] = {}
600
+
601
+ return DeleteWebhookOutput(**kwargs)
602
+
603
+ async def _deserialize_error_delete_webhook(http_response: HTTPResponse, config: Config) -> ApiError:
604
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
605
+
606
+ match code.lower():
607
+ case "internalservererror":
608
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
609
+
610
+ case "resourcenotfound":
611
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
580
612
 
581
613
  case _:
582
614
  return UnknownApiError(f"{code}: {message}")
@@ -603,6 +635,9 @@ async def _deserialize_error_discard_experiment(http_response: HTTPResponse, con
603
635
  case "internalservererror":
604
636
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
605
637
 
638
+ case "resourcenotfound":
639
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
640
+
606
641
  case _:
607
642
  return UnknownApiError(f"{code}: {message}")
608
643
 
@@ -743,6 +778,34 @@ async def _deserialize_error_get_context_from_condition(http_response: HTTPRespo
743
778
  case _:
744
779
  return UnknownApiError(f"{code}: {message}")
745
780
 
781
+ async def _deserialize_get_default_config(http_response: HTTPResponse, config: Config) -> GetDefaultConfigOutput:
782
+ if http_response.status != 200 and http_response.status >= 300:
783
+ raise await _deserialize_error_get_default_config(http_response, config)
784
+
785
+ kwargs: dict[str, Any] = {}
786
+
787
+ body = await http_response.consume_body_async()
788
+ if body:
789
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
790
+ deserializer = codec.create_deserializer(body)
791
+ body_kwargs = GetDefaultConfigOutput.deserialize_kwargs(deserializer)
792
+ kwargs.update(body_kwargs)
793
+
794
+ return GetDefaultConfigOutput(**kwargs)
795
+
796
+ async def _deserialize_error_get_default_config(http_response: HTTPResponse, config: Config) -> ApiError:
797
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
798
+
799
+ match code.lower():
800
+ case "internalservererror":
801
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
802
+
803
+ case "resourcenotfound":
804
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
805
+
806
+ case _:
807
+ return UnknownApiError(f"{code}: {message}")
808
+
746
809
  async def _deserialize_get_dimension(http_response: HTTPResponse, config: Config) -> GetDimensionOutput:
747
810
  if http_response.status != 200 and http_response.status >= 300:
748
811
  raise await _deserialize_error_get_dimension(http_response, config)
@@ -793,6 +856,9 @@ async def _deserialize_error_get_experiment(http_response: HTTPResponse, config:
793
856
  case "internalservererror":
794
857
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
795
858
 
859
+ case "resourcenotfound":
860
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
861
+
796
862
  case _:
797
863
  return UnknownApiError(f"{code}: {message}")
798
864
 
@@ -846,8 +912,8 @@ async def _deserialize_error_get_function(http_response: HTTPResponse, config: C
846
912
  case "internalservererror":
847
913
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
848
914
 
849
- case "functionnotfound":
850
- return await _deserialize_error_function_not_found(http_response, config, parsed_body, message)
915
+ case "resourcenotfound":
916
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
851
917
 
852
918
  case _:
853
919
  return UnknownApiError(f"{code}: {message}")
@@ -874,8 +940,8 @@ async def _deserialize_error_get_organisation(http_response: HTTPResponse, confi
874
940
  case "internalservererror":
875
941
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
876
942
 
877
- case "organisationnotfound":
878
- return await _deserialize_error_organisation_not_found(http_response, config, parsed_body, message)
943
+ case "resourcenotfound":
944
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
879
945
 
880
946
  case _:
881
947
  return UnknownApiError(f"{code}: {message}")
@@ -920,6 +986,34 @@ async def _deserialize_error_get_resolved_config(http_response: HTTPResponse, co
920
986
  case _:
921
987
  return UnknownApiError(f"{code}: {message}")
922
988
 
989
+ async def _deserialize_get_type_template(http_response: HTTPResponse, config: Config) -> GetTypeTemplateOutput:
990
+ if http_response.status != 200 and http_response.status >= 300:
991
+ raise await _deserialize_error_get_type_template(http_response, config)
992
+
993
+ kwargs: dict[str, Any] = {}
994
+
995
+ body = await http_response.consume_body_async()
996
+ if body:
997
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
998
+ deserializer = codec.create_deserializer(body)
999
+ body_kwargs = GetTypeTemplateOutput.deserialize_kwargs(deserializer)
1000
+ kwargs.update(body_kwargs)
1001
+
1002
+ return GetTypeTemplateOutput(**kwargs)
1003
+
1004
+ async def _deserialize_error_get_type_template(http_response: HTTPResponse, config: Config) -> ApiError:
1005
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1006
+
1007
+ match code.lower():
1008
+ case "internalservererror":
1009
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1010
+
1011
+ case "resourcenotfound":
1012
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1013
+
1014
+ case _:
1015
+ return UnknownApiError(f"{code}: {message}")
1016
+
923
1017
  async def _deserialize_get_type_templates_list(http_response: HTTPResponse, config: Config) -> GetTypeTemplatesListOutput:
924
1018
  if http_response.status != 200 and http_response.status >= 300:
925
1019
  raise await _deserialize_error_get_type_templates_list(http_response, config)
@@ -945,6 +1039,34 @@ async def _deserialize_error_get_type_templates_list(http_response: HTTPResponse
945
1039
  case _:
946
1040
  return UnknownApiError(f"{code}: {message}")
947
1041
 
1042
+ async def _deserialize_get_version(http_response: HTTPResponse, config: Config) -> GetVersionOutput:
1043
+ if http_response.status != 200 and http_response.status >= 300:
1044
+ raise await _deserialize_error_get_version(http_response, config)
1045
+
1046
+ kwargs: dict[str, Any] = {}
1047
+
1048
+ body = await http_response.consume_body_async()
1049
+ if body:
1050
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1051
+ deserializer = codec.create_deserializer(body)
1052
+ body_kwargs = GetVersionOutput.deserialize_kwargs(deserializer)
1053
+ kwargs.update(body_kwargs)
1054
+
1055
+ return GetVersionOutput(**kwargs)
1056
+
1057
+ async def _deserialize_error_get_version(http_response: HTTPResponse, config: Config) -> ApiError:
1058
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1059
+
1060
+ match code.lower():
1061
+ case "internalservererror":
1062
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1063
+
1064
+ case "resourcenotfound":
1065
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1066
+
1067
+ case _:
1068
+ return UnknownApiError(f"{code}: {message}")
1069
+
948
1070
  async def _deserialize_get_webhook(http_response: HTTPResponse, config: Config) -> GetWebhookOutput:
949
1071
  if http_response.status != 200 and http_response.status >= 300:
950
1072
  raise await _deserialize_error_get_webhook(http_response, config)
@@ -967,6 +1089,65 @@ async def _deserialize_error_get_webhook(http_response: HTTPResponse, config: Co
967
1089
  case "internalservererror":
968
1090
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
969
1091
 
1092
+ case "resourcenotfound":
1093
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1094
+
1095
+ case _:
1096
+ return UnknownApiError(f"{code}: {message}")
1097
+
1098
+ async def _deserialize_get_webhook_by_event(http_response: HTTPResponse, config: Config) -> GetWebhookByEventOutput:
1099
+ if http_response.status != 200 and http_response.status >= 300:
1100
+ raise await _deserialize_error_get_webhook_by_event(http_response, config)
1101
+
1102
+ kwargs: dict[str, Any] = {}
1103
+
1104
+ body = await http_response.consume_body_async()
1105
+ if body:
1106
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1107
+ deserializer = codec.create_deserializer(body)
1108
+ body_kwargs = GetWebhookByEventOutput.deserialize_kwargs(deserializer)
1109
+ kwargs.update(body_kwargs)
1110
+
1111
+ return GetWebhookByEventOutput(**kwargs)
1112
+
1113
+ async def _deserialize_error_get_webhook_by_event(http_response: HTTPResponse, config: Config) -> ApiError:
1114
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1115
+
1116
+ match code.lower():
1117
+ case "internalservererror":
1118
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1119
+
1120
+ case "resourcenotfound":
1121
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1122
+
1123
+ case _:
1124
+ return UnknownApiError(f"{code}: {message}")
1125
+
1126
+ async def _deserialize_get_workspace(http_response: HTTPResponse, config: Config) -> GetWorkspaceOutput:
1127
+ if http_response.status != 200 and http_response.status >= 300:
1128
+ raise await _deserialize_error_get_workspace(http_response, config)
1129
+
1130
+ kwargs: dict[str, Any] = {}
1131
+
1132
+ body = await http_response.consume_body_async()
1133
+ if body:
1134
+ codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
1135
+ deserializer = codec.create_deserializer(body)
1136
+ body_kwargs = GetWorkspaceOutput.deserialize_kwargs(deserializer)
1137
+ kwargs.update(body_kwargs)
1138
+
1139
+ return GetWorkspaceOutput(**kwargs)
1140
+
1141
+ async def _deserialize_error_get_workspace(http_response: HTTPResponse, config: Config) -> ApiError:
1142
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1143
+
1144
+ match code.lower():
1145
+ case "internalservererror":
1146
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1147
+
1148
+ case "resourcenotfound":
1149
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1150
+
970
1151
  case _:
971
1152
  return UnknownApiError(f"{code}: {message}")
972
1153
 
@@ -1042,9 +1223,6 @@ async def _deserialize_error_list_default_configs(http_response: HTTPResponse, c
1042
1223
  case "internalservererror":
1043
1224
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1044
1225
 
1045
- case "resourcenotfound":
1046
- return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1047
-
1048
1226
  case _:
1049
1227
  return UnknownApiError(f"{code}: {message}")
1050
1228
 
@@ -1270,6 +1448,9 @@ async def _deserialize_error_migrate_workspace_schema(http_response: HTTPRespons
1270
1448
  case "internalservererror":
1271
1449
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1272
1450
 
1451
+ case "resourcenotfound":
1452
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1453
+
1273
1454
  case _:
1274
1455
  return UnknownApiError(f"{code}: {message}")
1275
1456
 
@@ -1323,6 +1504,9 @@ async def _deserialize_error_pause_experiment(http_response: HTTPResponse, confi
1323
1504
  case "internalservererror":
1324
1505
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1325
1506
 
1507
+ case "resourcenotfound":
1508
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1509
+
1326
1510
  case _:
1327
1511
  return UnknownApiError(f"{code}: {message}")
1328
1512
 
@@ -1348,8 +1532,8 @@ async def _deserialize_error_publish(http_response: HTTPResponse, config: Config
1348
1532
  case "internalservererror":
1349
1533
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1350
1534
 
1351
- case "functionnotfound":
1352
- return await _deserialize_error_function_not_found(http_response, config, parsed_body, message)
1535
+ case "resourcenotfound":
1536
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1353
1537
 
1354
1538
  case _:
1355
1539
  return UnknownApiError(f"{code}: {message}")
@@ -1376,6 +1560,9 @@ async def _deserialize_error_ramp_experiment(http_response: HTTPResponse, config
1376
1560
  case "internalservererror":
1377
1561
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1378
1562
 
1563
+ case "resourcenotfound":
1564
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1565
+
1379
1566
  case _:
1380
1567
  return UnknownApiError(f"{code}: {message}")
1381
1568
 
@@ -1429,6 +1616,9 @@ async def _deserialize_error_resume_experiment(http_response: HTTPResponse, conf
1429
1616
  case "internalservererror":
1430
1617
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1431
1618
 
1619
+ case "resourcenotfound":
1620
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1621
+
1432
1622
  case _:
1433
1623
  return UnknownApiError(f"{code}: {message}")
1434
1624
 
@@ -1454,8 +1644,8 @@ async def _deserialize_error_test(http_response: HTTPResponse, config: Config) -
1454
1644
  case "internalservererror":
1455
1645
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1456
1646
 
1457
- case "functionnotfound":
1458
- return await _deserialize_error_function_not_found(http_response, config, parsed_body, message)
1647
+ case "resourcenotfound":
1648
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1459
1649
 
1460
1650
  case _:
1461
1651
  return UnknownApiError(f"{code}: {message}")
@@ -1566,8 +1756,8 @@ async def _deserialize_error_update_function(http_response: HTTPResponse, config
1566
1756
  case "internalservererror":
1567
1757
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1568
1758
 
1569
- case "functionnotfound":
1570
- return await _deserialize_error_function_not_found(http_response, config, parsed_body, message)
1759
+ case "resourcenotfound":
1760
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1571
1761
 
1572
1762
  case _:
1573
1763
  return UnknownApiError(f"{code}: {message}")
@@ -1594,8 +1784,8 @@ async def _deserialize_error_update_organisation(http_response: HTTPResponse, co
1594
1784
  case "internalservererror":
1595
1785
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1596
1786
 
1597
- case "organisationnotfound":
1598
- return await _deserialize_error_organisation_not_found(http_response, config, parsed_body, message)
1787
+ case "resourcenotfound":
1788
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1599
1789
 
1600
1790
  case _:
1601
1791
  return UnknownApiError(f"{code}: {message}")
@@ -1650,6 +1840,9 @@ async def _deserialize_error_update_overrides_experiment(http_response: HTTPResp
1650
1840
  case "internalservererror":
1651
1841
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1652
1842
 
1843
+ case "resourcenotfound":
1844
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1845
+
1653
1846
  case _:
1654
1847
  return UnknownApiError(f"{code}: {message}")
1655
1848
 
@@ -1675,8 +1868,8 @@ async def _deserialize_error_update_type_templates(http_response: HTTPResponse,
1675
1868
  case "internalservererror":
1676
1869
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1677
1870
 
1678
- case "typetemplatesnotfound":
1679
- return await _deserialize_error_type_templates_not_found(http_response, config, parsed_body, message)
1871
+ case "resourcenotfound":
1872
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1680
1873
 
1681
1874
  case _:
1682
1875
  return UnknownApiError(f"{code}: {message}")
@@ -1703,8 +1896,8 @@ async def _deserialize_error_update_webhook(http_response: HTTPResponse, config:
1703
1896
  case "internalservererror":
1704
1897
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1705
1898
 
1706
- case "webhooknotfound":
1707
- return await _deserialize_error_webhook_not_found(http_response, config, parsed_body, message)
1899
+ case "resourcenotfound":
1900
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1708
1901
 
1709
1902
  case _:
1710
1903
  return UnknownApiError(f"{code}: {message}")
@@ -1731,8 +1924,26 @@ async def _deserialize_error_update_workspace(http_response: HTTPResponse, confi
1731
1924
  case "internalservererror":
1732
1925
  return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1733
1926
 
1734
- case "workspacenotfound":
1735
- return await _deserialize_error_workspace_not_found(http_response, config, parsed_body, message)
1927
+ case "resourcenotfound":
1928
+ return await _deserialize_error_resource_not_found(http_response, config, parsed_body, message)
1929
+
1930
+ case _:
1931
+ return UnknownApiError(f"{code}: {message}")
1932
+
1933
+ async def _deserialize_validate_context(http_response: HTTPResponse, config: Config) -> ValidateContextOutput:
1934
+ if http_response.status != 200 and http_response.status >= 300:
1935
+ raise await _deserialize_error_validate_context(http_response, config)
1936
+
1937
+ kwargs: dict[str, Any] = {}
1938
+
1939
+ return ValidateContextOutput(**kwargs)
1940
+
1941
+ async def _deserialize_error_validate_context(http_response: HTTPResponse, config: Config) -> ApiError:
1942
+ code, message, parsed_body = await parse_rest_json_error_info(http_response)
1943
+
1944
+ match code.lower():
1945
+ case "internalservererror":
1946
+ return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
1736
1947
 
1737
1948
  case _:
1738
1949
  return UnknownApiError(f"{code}: {message}")
@@ -1762,16 +1973,6 @@ async def _deserialize_error_weight_recompute(http_response: HTTPResponse, confi
1762
1973
  case _:
1763
1974
  return UnknownApiError(f"{code}: {message}")
1764
1975
 
1765
- async def _deserialize_error_function_not_found(
1766
- http_response: HTTPResponse,
1767
- config: Config,
1768
- parsed_body: dict[str, DocumentValue] | None,
1769
- default_message: str,
1770
- ) -> FunctionNotFound:
1771
- kwargs: dict[str, Any] = {"message": default_message}
1772
-
1773
- return FunctionNotFound(**kwargs)
1774
-
1775
1976
  async def _deserialize_error_internal_server_error(
1776
1977
  http_response: HTTPResponse,
1777
1978
  config: Config,
@@ -1793,16 +1994,6 @@ async def _deserialize_error_internal_server_error(
1793
1994
 
1794
1995
  return InternalServerError(**kwargs)
1795
1996
 
1796
- async def _deserialize_error_organisation_not_found(
1797
- http_response: HTTPResponse,
1798
- config: Config,
1799
- parsed_body: dict[str, DocumentValue] | None,
1800
- default_message: str,
1801
- ) -> OrganisationNotFound:
1802
- kwargs: dict[str, Any] = {"message": default_message}
1803
-
1804
- return OrganisationNotFound(**kwargs)
1805
-
1806
1997
  async def _deserialize_error_resource_not_found(
1807
1998
  http_response: HTTPResponse,
1808
1999
  config: Config,
@@ -1812,33 +2003,3 @@ async def _deserialize_error_resource_not_found(
1812
2003
  kwargs: dict[str, Any] = {"message": default_message}
1813
2004
 
1814
2005
  return ResourceNotFound(**kwargs)
1815
-
1816
- async def _deserialize_error_type_templates_not_found(
1817
- http_response: HTTPResponse,
1818
- config: Config,
1819
- parsed_body: dict[str, DocumentValue] | None,
1820
- default_message: str,
1821
- ) -> TypeTemplatesNotFound:
1822
- kwargs: dict[str, Any] = {"message": default_message}
1823
-
1824
- return TypeTemplatesNotFound(**kwargs)
1825
-
1826
- async def _deserialize_error_webhook_not_found(
1827
- http_response: HTTPResponse,
1828
- config: Config,
1829
- parsed_body: dict[str, DocumentValue] | None,
1830
- default_message: str,
1831
- ) -> WebhookNotFound:
1832
- kwargs: dict[str, Any] = {"message": default_message}
1833
-
1834
- return WebhookNotFound(**kwargs)
1835
-
1836
- async def _deserialize_error_workspace_not_found(
1837
- http_response: HTTPResponse,
1838
- config: Config,
1839
- parsed_body: dict[str, DocumentValue] | None,
1840
- default_message: str,
1841
- ) -> WorkspaceNotFound:
1842
- kwargs: dict[str, Any] = {"message": default_message}
1843
-
1844
- return WorkspaceNotFound(**kwargs)