superposition-sdk 0.85.1__py3-none-any.whl → 0.87.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.
- superposition_sdk/_private/schemas.py +232 -0
- superposition_sdk/client.py +31 -0
- superposition_sdk/config.py +3 -1
- superposition_sdk/deserialize.py +26 -0
- superposition_sdk/models.py +207 -0
- superposition_sdk/serialize.py +31 -0
- superposition_sdk-0.87.0.dist-info/METADATA +64 -0
- superposition_sdk-0.87.0.dist-info/RECORD +12 -0
- superposition_sdk-0.85.1.dist-info/METADATA +0 -31
- superposition_sdk-0.85.1.dist-info/RECORD +0 -12
- {superposition_sdk-0.85.1.dist-info → superposition_sdk-0.87.0.dist-info}/WHEEL +0 -0
|
@@ -5356,6 +5356,15 @@ CREATE_WORKSPACE_INPUT = Schema.collection(
|
|
|
5356
5356
|
],
|
|
5357
5357
|
},
|
|
5358
5358
|
|
|
5359
|
+
"auto_populate_control": {
|
|
5360
|
+
"target": BOOLEAN,
|
|
5361
|
+
"index": 7,
|
|
5362
|
+
"traits": [
|
|
5363
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
5364
|
+
|
|
5365
|
+
],
|
|
5366
|
+
},
|
|
5367
|
+
|
|
5359
5368
|
}
|
|
5360
5369
|
)
|
|
5361
5370
|
|
|
@@ -5503,6 +5512,15 @@ CREATE_WORKSPACE_OUTPUT = Schema.collection(
|
|
|
5503
5512
|
],
|
|
5504
5513
|
},
|
|
5505
5514
|
|
|
5515
|
+
"auto_populate_control": {
|
|
5516
|
+
"target": BOOLEAN,
|
|
5517
|
+
"index": 15,
|
|
5518
|
+
"traits": [
|
|
5519
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
5520
|
+
|
|
5521
|
+
],
|
|
5522
|
+
},
|
|
5523
|
+
|
|
5506
5524
|
}
|
|
5507
5525
|
)
|
|
5508
5526
|
|
|
@@ -12158,6 +12176,15 @@ WORKSPACE_RESPONSE = Schema.collection(
|
|
|
12158
12176
|
],
|
|
12159
12177
|
},
|
|
12160
12178
|
|
|
12179
|
+
"auto_populate_control": {
|
|
12180
|
+
"target": BOOLEAN,
|
|
12181
|
+
"index": 15,
|
|
12182
|
+
"traits": [
|
|
12183
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12184
|
+
|
|
12185
|
+
],
|
|
12186
|
+
},
|
|
12187
|
+
|
|
12161
12188
|
}
|
|
12162
12189
|
)
|
|
12163
12190
|
|
|
@@ -12226,6 +12253,197 @@ LIST_WORKSPACE = Schema(
|
|
|
12226
12253
|
|
|
12227
12254
|
)
|
|
12228
12255
|
|
|
12256
|
+
MIGRATE_WORKSPACE_SCHEMA_INPUT = Schema.collection(
|
|
12257
|
+
id=ShapeID("io.superposition#MigrateWorkspaceSchemaInput"),
|
|
12258
|
+
|
|
12259
|
+
traits=[
|
|
12260
|
+
Trait.new(id=ShapeID("smithy.synthetic#originalShapeId"), value="io.superposition#MigrateWorkspaceSchemaRequest"),
|
|
12261
|
+
Trait.new(id=ShapeID("smithy.api#input")),
|
|
12262
|
+
|
|
12263
|
+
],
|
|
12264
|
+
members={
|
|
12265
|
+
"org_id": {
|
|
12266
|
+
"target": STRING,
|
|
12267
|
+
"index": 0,
|
|
12268
|
+
"traits": [
|
|
12269
|
+
Trait.new(id=ShapeID("smithy.api#default"), value="juspay"),
|
|
12270
|
+
Trait.new(id=ShapeID("smithy.api#httpHeader"), value="x-org-id"),
|
|
12271
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12272
|
+
|
|
12273
|
+
],
|
|
12274
|
+
},
|
|
12275
|
+
|
|
12276
|
+
"workspace_name": {
|
|
12277
|
+
"target": STRING,
|
|
12278
|
+
"index": 1,
|
|
12279
|
+
"traits": [
|
|
12280
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12281
|
+
Trait.new(id=ShapeID("smithy.api#httpLabel")),
|
|
12282
|
+
|
|
12283
|
+
],
|
|
12284
|
+
},
|
|
12285
|
+
|
|
12286
|
+
}
|
|
12287
|
+
)
|
|
12288
|
+
|
|
12289
|
+
MIGRATE_WORKSPACE_SCHEMA_OUTPUT = Schema.collection(
|
|
12290
|
+
id=ShapeID("io.superposition#MigrateWorkspaceSchemaOutput"),
|
|
12291
|
+
|
|
12292
|
+
traits=[
|
|
12293
|
+
Trait.new(id=ShapeID("smithy.synthetic#originalShapeId"), value="io.superposition#WorkspaceResponse"),
|
|
12294
|
+
Trait.new(id=ShapeID("smithy.api#output")),
|
|
12295
|
+
|
|
12296
|
+
],
|
|
12297
|
+
members={
|
|
12298
|
+
"workspace_name": {
|
|
12299
|
+
"target": STRING,
|
|
12300
|
+
"index": 0,
|
|
12301
|
+
"traits": [
|
|
12302
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12303
|
+
|
|
12304
|
+
],
|
|
12305
|
+
},
|
|
12306
|
+
|
|
12307
|
+
"organisation_id": {
|
|
12308
|
+
"target": STRING,
|
|
12309
|
+
"index": 1,
|
|
12310
|
+
"traits": [
|
|
12311
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12312
|
+
|
|
12313
|
+
],
|
|
12314
|
+
},
|
|
12315
|
+
|
|
12316
|
+
"organisation_name": {
|
|
12317
|
+
"target": STRING,
|
|
12318
|
+
"index": 2,
|
|
12319
|
+
"traits": [
|
|
12320
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12321
|
+
|
|
12322
|
+
],
|
|
12323
|
+
},
|
|
12324
|
+
|
|
12325
|
+
"workspace_schema_name": {
|
|
12326
|
+
"target": STRING,
|
|
12327
|
+
"index": 3,
|
|
12328
|
+
"traits": [
|
|
12329
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12330
|
+
|
|
12331
|
+
],
|
|
12332
|
+
},
|
|
12333
|
+
|
|
12334
|
+
"workspace_status": {
|
|
12335
|
+
"target": WORKSPACE_STATUS,
|
|
12336
|
+
"index": 4,
|
|
12337
|
+
"traits": [
|
|
12338
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12339
|
+
|
|
12340
|
+
],
|
|
12341
|
+
},
|
|
12342
|
+
|
|
12343
|
+
"workspace_admin_email": {
|
|
12344
|
+
"target": STRING,
|
|
12345
|
+
"index": 5,
|
|
12346
|
+
"traits": [
|
|
12347
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12348
|
+
|
|
12349
|
+
],
|
|
12350
|
+
},
|
|
12351
|
+
|
|
12352
|
+
"config_version": {
|
|
12353
|
+
"target": STRING,
|
|
12354
|
+
"index": 6,
|
|
12355
|
+
},
|
|
12356
|
+
|
|
12357
|
+
"created_by": {
|
|
12358
|
+
"target": STRING,
|
|
12359
|
+
"index": 7,
|
|
12360
|
+
"traits": [
|
|
12361
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12362
|
+
|
|
12363
|
+
],
|
|
12364
|
+
},
|
|
12365
|
+
|
|
12366
|
+
"last_modified_by": {
|
|
12367
|
+
"target": STRING,
|
|
12368
|
+
"index": 8,
|
|
12369
|
+
"traits": [
|
|
12370
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12371
|
+
|
|
12372
|
+
],
|
|
12373
|
+
},
|
|
12374
|
+
|
|
12375
|
+
"last_modified_at": {
|
|
12376
|
+
"target": DATE_TIME,
|
|
12377
|
+
"index": 9,
|
|
12378
|
+
"traits": [
|
|
12379
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12380
|
+
|
|
12381
|
+
],
|
|
12382
|
+
},
|
|
12383
|
+
|
|
12384
|
+
"created_at": {
|
|
12385
|
+
"target": DATE_TIME,
|
|
12386
|
+
"index": 10,
|
|
12387
|
+
"traits": [
|
|
12388
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12389
|
+
|
|
12390
|
+
],
|
|
12391
|
+
},
|
|
12392
|
+
|
|
12393
|
+
"mandatory_dimensions": {
|
|
12394
|
+
"target": LIST_MANDATORY_DIMENSIONS,
|
|
12395
|
+
"index": 11,
|
|
12396
|
+
},
|
|
12397
|
+
|
|
12398
|
+
"strict_mode": {
|
|
12399
|
+
"target": BOOLEAN,
|
|
12400
|
+
"index": 12,
|
|
12401
|
+
"traits": [
|
|
12402
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12403
|
+
|
|
12404
|
+
],
|
|
12405
|
+
},
|
|
12406
|
+
|
|
12407
|
+
"metrics": {
|
|
12408
|
+
"target": DOCUMENT,
|
|
12409
|
+
"index": 13,
|
|
12410
|
+
},
|
|
12411
|
+
|
|
12412
|
+
"allow_experiment_self_approval": {
|
|
12413
|
+
"target": BOOLEAN,
|
|
12414
|
+
"index": 14,
|
|
12415
|
+
"traits": [
|
|
12416
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12417
|
+
|
|
12418
|
+
],
|
|
12419
|
+
},
|
|
12420
|
+
|
|
12421
|
+
"auto_populate_control": {
|
|
12422
|
+
"target": BOOLEAN,
|
|
12423
|
+
"index": 15,
|
|
12424
|
+
"traits": [
|
|
12425
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
12426
|
+
|
|
12427
|
+
],
|
|
12428
|
+
},
|
|
12429
|
+
|
|
12430
|
+
}
|
|
12431
|
+
)
|
|
12432
|
+
|
|
12433
|
+
MIGRATE_WORKSPACE_SCHEMA = Schema(
|
|
12434
|
+
id=ShapeID("io.superposition#MigrateWorkspaceSchema"),
|
|
12435
|
+
shape_type=ShapeType.OPERATION,
|
|
12436
|
+
traits=[
|
|
12437
|
+
Trait.new(id=ShapeID("smithy.api#http"), value=MappingProxyType({
|
|
12438
|
+
"method": "POST",
|
|
12439
|
+
"uri": "/workspaces/{workspace_name}/db/migrate",
|
|
12440
|
+
})),
|
|
12441
|
+
Trait.new(id=ShapeID("smithy.api#readonly")),
|
|
12442
|
+
|
|
12443
|
+
],
|
|
12444
|
+
|
|
12445
|
+
)
|
|
12446
|
+
|
|
12229
12447
|
UPDATE_ORGANISATION_INPUT = Schema.collection(
|
|
12230
12448
|
id=ShapeID("io.superposition#UpdateOrganisationInput"),
|
|
12231
12449
|
|
|
@@ -12894,6 +13112,11 @@ UPDATE_WORKSPACE_INPUT = Schema.collection(
|
|
|
12894
13112
|
"index": 7,
|
|
12895
13113
|
},
|
|
12896
13114
|
|
|
13115
|
+
"auto_populate_control": {
|
|
13116
|
+
"target": BOOLEAN,
|
|
13117
|
+
"index": 8,
|
|
13118
|
+
},
|
|
13119
|
+
|
|
12897
13120
|
}
|
|
12898
13121
|
)
|
|
12899
13122
|
|
|
@@ -13029,6 +13252,15 @@ UPDATE_WORKSPACE_OUTPUT = Schema.collection(
|
|
|
13029
13252
|
],
|
|
13030
13253
|
},
|
|
13031
13254
|
|
|
13255
|
+
"auto_populate_control": {
|
|
13256
|
+
"target": BOOLEAN,
|
|
13257
|
+
"index": 15,
|
|
13258
|
+
"traits": [
|
|
13259
|
+
Trait.new(id=ShapeID("smithy.api#required")),
|
|
13260
|
+
|
|
13261
|
+
],
|
|
13262
|
+
},
|
|
13263
|
+
|
|
13032
13264
|
}
|
|
13033
13265
|
)
|
|
13034
13266
|
|
superposition_sdk/client.py
CHANGED
|
@@ -78,6 +78,7 @@ from .deserialize import (
|
|
|
78
78
|
_deserialize_list_versions,
|
|
79
79
|
_deserialize_list_webhook,
|
|
80
80
|
_deserialize_list_workspace,
|
|
81
|
+
_deserialize_migrate_workspace_schema,
|
|
81
82
|
_deserialize_move_context,
|
|
82
83
|
_deserialize_pause_experiment,
|
|
83
84
|
_deserialize_publish,
|
|
@@ -230,7 +231,10 @@ from .models import (
|
|
|
230
231
|
ListWebhookOutput,
|
|
231
232
|
ListWorkspaceInput,
|
|
232
233
|
ListWorkspaceOutput,
|
|
234
|
+
MIGRATE_WORKSPACE_SCHEMA,
|
|
233
235
|
MOVE_CONTEXT,
|
|
236
|
+
MigrateWorkspaceSchemaInput,
|
|
237
|
+
MigrateWorkspaceSchemaOutput,
|
|
234
238
|
MoveContextInput,
|
|
235
239
|
MoveContextOutput,
|
|
236
240
|
PAUSE_EXPERIMENT,
|
|
@@ -331,6 +335,7 @@ from .serialize import (
|
|
|
331
335
|
_serialize_list_versions,
|
|
332
336
|
_serialize_list_webhook,
|
|
333
337
|
_serialize_list_workspace,
|
|
338
|
+
_serialize_migrate_workspace_schema,
|
|
334
339
|
_serialize_move_context,
|
|
335
340
|
_serialize_pause_experiment,
|
|
336
341
|
_serialize_publish,
|
|
@@ -1521,6 +1526,32 @@ class Superposition:
|
|
|
1521
1526
|
operation=LIST_WORKSPACE,
|
|
1522
1527
|
)
|
|
1523
1528
|
|
|
1529
|
+
async def migrate_workspace_schema(self, input: MigrateWorkspaceSchemaInput, plugins: list[Plugin] | None = None) -> MigrateWorkspaceSchemaOutput:
|
|
1530
|
+
"""
|
|
1531
|
+
Invokes the MigrateWorkspaceSchema operation.
|
|
1532
|
+
|
|
1533
|
+
:param input: The operation's input.
|
|
1534
|
+
|
|
1535
|
+
:param plugins: A list of callables that modify the configuration dynamically.
|
|
1536
|
+
Changes made by these plugins only apply for the duration of the operation
|
|
1537
|
+
execution and will not affect any other operation invocations.
|
|
1538
|
+
|
|
1539
|
+
"""
|
|
1540
|
+
operation_plugins: list[Plugin] = [
|
|
1541
|
+
|
|
1542
|
+
]
|
|
1543
|
+
if plugins:
|
|
1544
|
+
operation_plugins.extend(plugins)
|
|
1545
|
+
|
|
1546
|
+
return await self._execute_operation(
|
|
1547
|
+
input=input,
|
|
1548
|
+
plugins=operation_plugins,
|
|
1549
|
+
serialize=_serialize_migrate_workspace_schema,
|
|
1550
|
+
deserialize=_deserialize_migrate_workspace_schema,
|
|
1551
|
+
config=self._config,
|
|
1552
|
+
operation=MIGRATE_WORKSPACE_SCHEMA,
|
|
1553
|
+
)
|
|
1554
|
+
|
|
1524
1555
|
async def move_context(self, input: MoveContextInput, plugins: list[Plugin] | None = None) -> MoveContextOutput:
|
|
1525
1556
|
"""
|
|
1526
1557
|
Invokes the MoveContext operation.
|
superposition_sdk/config.py
CHANGED
|
@@ -104,6 +104,8 @@ from .models import (
|
|
|
104
104
|
ListWebhookOutput,
|
|
105
105
|
ListWorkspaceInput,
|
|
106
106
|
ListWorkspaceOutput,
|
|
107
|
+
MigrateWorkspaceSchemaInput,
|
|
108
|
+
MigrateWorkspaceSchemaOutput,
|
|
107
109
|
MoveContextInput,
|
|
108
110
|
MoveContextOutput,
|
|
109
111
|
PauseExperimentInput,
|
|
@@ -143,7 +145,7 @@ from .models import (
|
|
|
143
145
|
)
|
|
144
146
|
|
|
145
147
|
|
|
146
|
-
_ServiceInterceptor = Union[Interceptor[AddMembersToGroupInput, AddMembersToGroupOutput, Any, Any], Interceptor[ApplicableVariantsInput, ApplicableVariantsOutput, Any, Any], Interceptor[BulkOperationInput, BulkOperationOutput, Any, Any], Interceptor[ConcludeExperimentInput, ConcludeExperimentOutput, Any, Any], Interceptor[CreateContextInput, CreateContextOutput, Any, Any], Interceptor[CreateDefaultConfigInput, CreateDefaultConfigOutput, Any, Any], Interceptor[CreateDimensionInput, CreateDimensionOutput, Any, Any], Interceptor[CreateExperimentInput, CreateExperimentOutput, Any, Any], Interceptor[CreateExperimentGroupInput, CreateExperimentGroupOutput, Any, Any], Interceptor[CreateFunctionInput, CreateFunctionOutput, Any, Any], Interceptor[CreateOrganisationInput, CreateOrganisationOutput, Any, Any], Interceptor[CreateTypeTemplatesInput, CreateTypeTemplatesOutput, Any, Any], Interceptor[CreateWebhookInput, CreateWebhookOutput, Any, Any], Interceptor[CreateWorkspaceInput, CreateWorkspaceOutput, Any, Any], Interceptor[DeleteContextInput, DeleteContextOutput, Any, Any], Interceptor[DeleteDefaultConfigInput, DeleteDefaultConfigOutput, Any, Any], Interceptor[DeleteDimensionInput, DeleteDimensionOutput, Any, Any], Interceptor[DeleteExperimentGroupInput, DeleteExperimentGroupOutput, Any, Any], Interceptor[DeleteFunctionInput, DeleteFunctionOutput, Any, Any], Interceptor[DeleteTypeTemplatesInput, DeleteTypeTemplatesOutput, Any, Any], Interceptor[DiscardExperimentInput, DiscardExperimentOutput, Any, Any], Interceptor[GetConfigInput, GetConfigOutput, Any, Any], Interceptor[GetConfigFastInput, GetConfigFastOutput, Any, Any], Interceptor[GetContextInput, GetContextOutput, Any, Any], Interceptor[GetContextFromConditionInput, GetContextFromConditionOutput, Any, Any], Interceptor[GetDimensionInput, GetDimensionOutput, Any, Any], Interceptor[GetExperimentInput, GetExperimentOutput, Any, Any], Interceptor[GetExperimentGroupInput, GetExperimentGroupOutput, Any, Any], Interceptor[GetFunctionInput, GetFunctionOutput, Any, Any], Interceptor[GetOrganisationInput, GetOrganisationOutput, Any, Any], Interceptor[GetResolvedConfigInput, GetResolvedConfigOutput, Any, Any], Interceptor[GetTypeTemplatesListInput, GetTypeTemplatesListOutput, Any, Any], Interceptor[GetWebhookInput, GetWebhookOutput, Any, Any], Interceptor[ListAuditLogsInput, ListAuditLogsOutput, Any, Any], Interceptor[ListContextsInput, ListContextsOutput, Any, Any], Interceptor[ListDefaultConfigsInput, ListDefaultConfigsOutput, Any, Any], Interceptor[ListDimensionsInput, ListDimensionsOutput, Any, Any], Interceptor[ListExperimentInput, ListExperimentOutput, Any, Any], Interceptor[ListExperimentGroupsInput, ListExperimentGroupsOutput, Any, Any], Interceptor[ListFunctionInput, ListFunctionOutput, Any, Any], Interceptor[ListOrganisationInput, ListOrganisationOutput, Any, Any], Interceptor[ListVersionsInput, ListVersionsOutput, Any, Any], Interceptor[ListWebhookInput, ListWebhookOutput, Any, Any], Interceptor[ListWorkspaceInput, ListWorkspaceOutput, Any, Any], Interceptor[MoveContextInput, MoveContextOutput, Any, Any], Interceptor[PauseExperimentInput, PauseExperimentOutput, Any, Any], Interceptor[PublishInput, PublishOutput, Any, Any], Interceptor[RampExperimentInput, RampExperimentOutput, Any, Any], Interceptor[RemoveMembersFromGroupInput, RemoveMembersFromGroupOutput, Any, Any], Interceptor[ResumeExperimentInput, ResumeExperimentOutput, Any, Any], Interceptor[TestInput, TestOutput, Any, Any], Interceptor[UpdateDefaultConfigInput, UpdateDefaultConfigOutput, Any, Any], Interceptor[UpdateDimensionInput, UpdateDimensionOutput, Any, Any], Interceptor[UpdateExperimentGroupInput, UpdateExperimentGroupOutput, Any, Any], Interceptor[UpdateFunctionInput, UpdateFunctionOutput, Any, Any], Interceptor[UpdateOrganisationInput, UpdateOrganisationOutput, Any, Any], Interceptor[UpdateOverrideInput, UpdateOverrideOutput, Any, Any], Interceptor[UpdateOverridesExperimentInput, UpdateOverridesExperimentOutput, Any, Any], Interceptor[UpdateTypeTemplatesInput, UpdateTypeTemplatesOutput, Any, Any], Interceptor[UpdateWebhookInput, UpdateWebhookOutput, Any, Any], Interceptor[UpdateWorkspaceInput, UpdateWorkspaceOutput, Any, Any], Interceptor[WeightRecomputeInput, WeightRecomputeOutput, Any, Any]]
|
|
148
|
+
_ServiceInterceptor = Union[Interceptor[AddMembersToGroupInput, AddMembersToGroupOutput, Any, Any], Interceptor[ApplicableVariantsInput, ApplicableVariantsOutput, Any, Any], Interceptor[BulkOperationInput, BulkOperationOutput, Any, Any], Interceptor[ConcludeExperimentInput, ConcludeExperimentOutput, Any, Any], Interceptor[CreateContextInput, CreateContextOutput, Any, Any], Interceptor[CreateDefaultConfigInput, CreateDefaultConfigOutput, Any, Any], Interceptor[CreateDimensionInput, CreateDimensionOutput, Any, Any], Interceptor[CreateExperimentInput, CreateExperimentOutput, Any, Any], Interceptor[CreateExperimentGroupInput, CreateExperimentGroupOutput, Any, Any], Interceptor[CreateFunctionInput, CreateFunctionOutput, Any, Any], Interceptor[CreateOrganisationInput, CreateOrganisationOutput, Any, Any], Interceptor[CreateTypeTemplatesInput, CreateTypeTemplatesOutput, Any, Any], Interceptor[CreateWebhookInput, CreateWebhookOutput, Any, Any], Interceptor[CreateWorkspaceInput, CreateWorkspaceOutput, Any, Any], Interceptor[DeleteContextInput, DeleteContextOutput, Any, Any], Interceptor[DeleteDefaultConfigInput, DeleteDefaultConfigOutput, Any, Any], Interceptor[DeleteDimensionInput, DeleteDimensionOutput, Any, Any], Interceptor[DeleteExperimentGroupInput, DeleteExperimentGroupOutput, Any, Any], Interceptor[DeleteFunctionInput, DeleteFunctionOutput, Any, Any], Interceptor[DeleteTypeTemplatesInput, DeleteTypeTemplatesOutput, Any, Any], Interceptor[DiscardExperimentInput, DiscardExperimentOutput, Any, Any], Interceptor[GetConfigInput, GetConfigOutput, Any, Any], Interceptor[GetConfigFastInput, GetConfigFastOutput, Any, Any], Interceptor[GetContextInput, GetContextOutput, Any, Any], Interceptor[GetContextFromConditionInput, GetContextFromConditionOutput, Any, Any], Interceptor[GetDimensionInput, GetDimensionOutput, Any, Any], Interceptor[GetExperimentInput, GetExperimentOutput, Any, Any], Interceptor[GetExperimentGroupInput, GetExperimentGroupOutput, Any, Any], Interceptor[GetFunctionInput, GetFunctionOutput, Any, Any], Interceptor[GetOrganisationInput, GetOrganisationOutput, Any, Any], Interceptor[GetResolvedConfigInput, GetResolvedConfigOutput, Any, Any], Interceptor[GetTypeTemplatesListInput, GetTypeTemplatesListOutput, Any, Any], Interceptor[GetWebhookInput, GetWebhookOutput, Any, Any], Interceptor[ListAuditLogsInput, ListAuditLogsOutput, Any, Any], Interceptor[ListContextsInput, ListContextsOutput, Any, Any], Interceptor[ListDefaultConfigsInput, ListDefaultConfigsOutput, Any, Any], Interceptor[ListDimensionsInput, ListDimensionsOutput, Any, Any], Interceptor[ListExperimentInput, ListExperimentOutput, Any, Any], Interceptor[ListExperimentGroupsInput, ListExperimentGroupsOutput, Any, Any], Interceptor[ListFunctionInput, ListFunctionOutput, Any, Any], Interceptor[ListOrganisationInput, ListOrganisationOutput, Any, Any], Interceptor[ListVersionsInput, ListVersionsOutput, Any, Any], Interceptor[ListWebhookInput, ListWebhookOutput, Any, Any], Interceptor[ListWorkspaceInput, ListWorkspaceOutput, Any, Any], Interceptor[MigrateWorkspaceSchemaInput, MigrateWorkspaceSchemaOutput, Any, Any], Interceptor[MoveContextInput, MoveContextOutput, Any, Any], Interceptor[PauseExperimentInput, PauseExperimentOutput, Any, Any], Interceptor[PublishInput, PublishOutput, Any, Any], Interceptor[RampExperimentInput, RampExperimentOutput, Any, Any], Interceptor[RemoveMembersFromGroupInput, RemoveMembersFromGroupOutput, Any, Any], Interceptor[ResumeExperimentInput, ResumeExperimentOutput, Any, Any], Interceptor[TestInput, TestOutput, Any, Any], Interceptor[UpdateDefaultConfigInput, UpdateDefaultConfigOutput, Any, Any], Interceptor[UpdateDimensionInput, UpdateDimensionOutput, Any, Any], Interceptor[UpdateExperimentGroupInput, UpdateExperimentGroupOutput, Any, Any], Interceptor[UpdateFunctionInput, UpdateFunctionOutput, Any, Any], Interceptor[UpdateOrganisationInput, UpdateOrganisationOutput, Any, Any], Interceptor[UpdateOverrideInput, UpdateOverrideOutput, Any, Any], Interceptor[UpdateOverridesExperimentInput, UpdateOverridesExperimentOutput, Any, Any], Interceptor[UpdateTypeTemplatesInput, UpdateTypeTemplatesOutput, Any, Any], Interceptor[UpdateWebhookInput, UpdateWebhookOutput, Any, Any], Interceptor[UpdateWorkspaceInput, UpdateWorkspaceOutput, Any, Any], Interceptor[WeightRecomputeInput, WeightRecomputeOutput, Any, Any]]
|
|
147
149
|
@dataclass(init=False)
|
|
148
150
|
class Config:
|
|
149
151
|
"""Configuration for Superposition."""
|
superposition_sdk/deserialize.py
CHANGED
|
@@ -62,6 +62,7 @@ from .models import (
|
|
|
62
62
|
ListVersionsOutput,
|
|
63
63
|
ListWebhookOutput,
|
|
64
64
|
ListWorkspaceOutput,
|
|
65
|
+
MigrateWorkspaceSchemaOutput,
|
|
65
66
|
MoveContextOutput,
|
|
66
67
|
OrganisationNotFound,
|
|
67
68
|
PauseExperimentOutput,
|
|
@@ -1247,6 +1248,31 @@ async def _deserialize_error_list_workspace(http_response: HTTPResponse, config:
|
|
|
1247
1248
|
case _:
|
|
1248
1249
|
return UnknownApiError(f"{code}: {message}")
|
|
1249
1250
|
|
|
1251
|
+
async def _deserialize_migrate_workspace_schema(http_response: HTTPResponse, config: Config) -> MigrateWorkspaceSchemaOutput:
|
|
1252
|
+
if http_response.status != 200 and http_response.status >= 300:
|
|
1253
|
+
raise await _deserialize_error_migrate_workspace_schema(http_response, config)
|
|
1254
|
+
|
|
1255
|
+
kwargs: dict[str, Any] = {}
|
|
1256
|
+
|
|
1257
|
+
body = await http_response.consume_body_async()
|
|
1258
|
+
if body:
|
|
1259
|
+
codec = JSONCodec(default_timestamp_format=TimestampFormat.EPOCH_SECONDS)
|
|
1260
|
+
deserializer = codec.create_deserializer(body)
|
|
1261
|
+
body_kwargs = MigrateWorkspaceSchemaOutput.deserialize_kwargs(deserializer)
|
|
1262
|
+
kwargs.update(body_kwargs)
|
|
1263
|
+
|
|
1264
|
+
return MigrateWorkspaceSchemaOutput(**kwargs)
|
|
1265
|
+
|
|
1266
|
+
async def _deserialize_error_migrate_workspace_schema(http_response: HTTPResponse, config: Config) -> ApiError:
|
|
1267
|
+
code, message, parsed_body = await parse_rest_json_error_info(http_response)
|
|
1268
|
+
|
|
1269
|
+
match code.lower():
|
|
1270
|
+
case "internalservererror":
|
|
1271
|
+
return await _deserialize_error_internal_server_error(http_response, config, parsed_body, message)
|
|
1272
|
+
|
|
1273
|
+
case _:
|
|
1274
|
+
return UnknownApiError(f"{code}: {message}")
|
|
1275
|
+
|
|
1250
1276
|
async def _deserialize_move_context(http_response: HTTPResponse, config: Config) -> MoveContextOutput:
|
|
1251
1277
|
if http_response.status != 200 and http_response.status >= 300:
|
|
1252
1278
|
raise await _deserialize_error_move_context(http_response, config)
|
superposition_sdk/models.py
CHANGED
|
@@ -167,6 +167,9 @@ from ._private.schemas import (
|
|
|
167
167
|
LIST_WORKSPACE as _SCHEMA_LIST_WORKSPACE,
|
|
168
168
|
LIST_WORKSPACE_INPUT as _SCHEMA_LIST_WORKSPACE_INPUT,
|
|
169
169
|
LIST_WORKSPACE_OUTPUT as _SCHEMA_LIST_WORKSPACE_OUTPUT,
|
|
170
|
+
MIGRATE_WORKSPACE_SCHEMA as _SCHEMA_MIGRATE_WORKSPACE_SCHEMA,
|
|
171
|
+
MIGRATE_WORKSPACE_SCHEMA_INPUT as _SCHEMA_MIGRATE_WORKSPACE_SCHEMA_INPUT,
|
|
172
|
+
MIGRATE_WORKSPACE_SCHEMA_OUTPUT as _SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT,
|
|
170
173
|
MOVE_CONTEXT as _SCHEMA_MOVE_CONTEXT,
|
|
171
174
|
MOVE_CONTEXT_INPUT as _SCHEMA_MOVE_CONTEXT_INPUT,
|
|
172
175
|
MOVE_CONTEXT_OUTPUT as _SCHEMA_MOVE_CONTEXT_OUTPUT,
|
|
@@ -5652,6 +5655,7 @@ class CreateWorkspaceInput:
|
|
|
5652
5655
|
strict_mode: bool | None = None
|
|
5653
5656
|
metrics: Document | None = None
|
|
5654
5657
|
allow_experiment_self_approval: bool | None = None
|
|
5658
|
+
auto_populate_control: bool | None = None
|
|
5655
5659
|
|
|
5656
5660
|
def serialize(self, serializer: ShapeSerializer):
|
|
5657
5661
|
serializer.write_struct(_SCHEMA_CREATE_WORKSPACE_INPUT, self)
|
|
@@ -5675,6 +5679,9 @@ class CreateWorkspaceInput:
|
|
|
5675
5679
|
if self.allow_experiment_self_approval is not None:
|
|
5676
5680
|
serializer.write_boolean(_SCHEMA_CREATE_WORKSPACE_INPUT.members["allow_experiment_self_approval"], self.allow_experiment_self_approval)
|
|
5677
5681
|
|
|
5682
|
+
if self.auto_populate_control is not None:
|
|
5683
|
+
serializer.write_boolean(_SCHEMA_CREATE_WORKSPACE_INPUT.members["auto_populate_control"], self.auto_populate_control)
|
|
5684
|
+
|
|
5678
5685
|
@classmethod
|
|
5679
5686
|
def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
|
|
5680
5687
|
return cls(**cls.deserialize_kwargs(deserializer))
|
|
@@ -5706,6 +5713,9 @@ class CreateWorkspaceInput:
|
|
|
5706
5713
|
case 6:
|
|
5707
5714
|
kwargs["allow_experiment_self_approval"] = de.read_boolean(_SCHEMA_CREATE_WORKSPACE_INPUT.members["allow_experiment_self_approval"])
|
|
5708
5715
|
|
|
5716
|
+
case 7:
|
|
5717
|
+
kwargs["auto_populate_control"] = de.read_boolean(_SCHEMA_CREATE_WORKSPACE_INPUT.members["auto_populate_control"])
|
|
5718
|
+
|
|
5709
5719
|
case _:
|
|
5710
5720
|
logger.debug("Unexpected member schema: %s", schema)
|
|
5711
5721
|
|
|
@@ -5757,6 +5767,8 @@ class CreateWorkspaceOutput:
|
|
|
5757
5767
|
|
|
5758
5768
|
allow_experiment_self_approval: bool
|
|
5759
5769
|
|
|
5770
|
+
auto_populate_control: bool
|
|
5771
|
+
|
|
5760
5772
|
config_version: str | None = None
|
|
5761
5773
|
mandatory_dimensions: list[str] | None = None
|
|
5762
5774
|
metrics: Document | None = None
|
|
@@ -5786,6 +5798,7 @@ class CreateWorkspaceOutput:
|
|
|
5786
5798
|
serializer.write_document(_SCHEMA_CREATE_WORKSPACE_OUTPUT.members["metrics"], self.metrics)
|
|
5787
5799
|
|
|
5788
5800
|
serializer.write_boolean(_SCHEMA_CREATE_WORKSPACE_OUTPUT.members["allow_experiment_self_approval"], self.allow_experiment_self_approval)
|
|
5801
|
+
serializer.write_boolean(_SCHEMA_CREATE_WORKSPACE_OUTPUT.members["auto_populate_control"], self.auto_populate_control)
|
|
5789
5802
|
|
|
5790
5803
|
@classmethod
|
|
5791
5804
|
def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
|
|
@@ -5842,6 +5855,9 @@ class CreateWorkspaceOutput:
|
|
|
5842
5855
|
case 14:
|
|
5843
5856
|
kwargs["allow_experiment_self_approval"] = de.read_boolean(_SCHEMA_CREATE_WORKSPACE_OUTPUT.members["allow_experiment_self_approval"])
|
|
5844
5857
|
|
|
5858
|
+
case 15:
|
|
5859
|
+
kwargs["auto_populate_control"] = de.read_boolean(_SCHEMA_CREATE_WORKSPACE_OUTPUT.members["auto_populate_control"])
|
|
5860
|
+
|
|
5845
5861
|
case _:
|
|
5846
5862
|
logger.debug("Unexpected member schema: %s", schema)
|
|
5847
5863
|
|
|
@@ -12031,6 +12047,8 @@ class WorkspaceResponse:
|
|
|
12031
12047
|
|
|
12032
12048
|
allow_experiment_self_approval: bool
|
|
12033
12049
|
|
|
12050
|
+
auto_populate_control: bool
|
|
12051
|
+
|
|
12034
12052
|
config_version: str | None = None
|
|
12035
12053
|
mandatory_dimensions: list[str] | None = None
|
|
12036
12054
|
metrics: Document | None = None
|
|
@@ -12060,6 +12078,7 @@ class WorkspaceResponse:
|
|
|
12060
12078
|
serializer.write_document(_SCHEMA_WORKSPACE_RESPONSE.members["metrics"], self.metrics)
|
|
12061
12079
|
|
|
12062
12080
|
serializer.write_boolean(_SCHEMA_WORKSPACE_RESPONSE.members["allow_experiment_self_approval"], self.allow_experiment_self_approval)
|
|
12081
|
+
serializer.write_boolean(_SCHEMA_WORKSPACE_RESPONSE.members["auto_populate_control"], self.auto_populate_control)
|
|
12063
12082
|
|
|
12064
12083
|
@classmethod
|
|
12065
12084
|
def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
|
|
@@ -12116,6 +12135,9 @@ class WorkspaceResponse:
|
|
|
12116
12135
|
case 14:
|
|
12117
12136
|
kwargs["allow_experiment_self_approval"] = de.read_boolean(_SCHEMA_WORKSPACE_RESPONSE.members["allow_experiment_self_approval"])
|
|
12118
12137
|
|
|
12138
|
+
case 15:
|
|
12139
|
+
kwargs["auto_populate_control"] = de.read_boolean(_SCHEMA_WORKSPACE_RESPONSE.members["auto_populate_control"])
|
|
12140
|
+
|
|
12119
12141
|
case _:
|
|
12120
12142
|
logger.debug("Unexpected member schema: %s", schema)
|
|
12121
12143
|
|
|
@@ -12195,6 +12217,178 @@ LIST_WORKSPACE = APIOperation(
|
|
|
12195
12217
|
]
|
|
12196
12218
|
)
|
|
12197
12219
|
|
|
12220
|
+
@dataclass(kw_only=True)
|
|
12221
|
+
class MigrateWorkspaceSchemaInput:
|
|
12222
|
+
|
|
12223
|
+
org_id: str = "juspay"
|
|
12224
|
+
workspace_name: str | None = None
|
|
12225
|
+
|
|
12226
|
+
def serialize(self, serializer: ShapeSerializer):
|
|
12227
|
+
serializer.write_struct(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_INPUT, self)
|
|
12228
|
+
|
|
12229
|
+
def serialize_members(self, serializer: ShapeSerializer):
|
|
12230
|
+
pass
|
|
12231
|
+
|
|
12232
|
+
@classmethod
|
|
12233
|
+
def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
|
|
12234
|
+
return cls(**cls.deserialize_kwargs(deserializer))
|
|
12235
|
+
|
|
12236
|
+
@classmethod
|
|
12237
|
+
def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]:
|
|
12238
|
+
kwargs: dict[str, Any] = {}
|
|
12239
|
+
|
|
12240
|
+
def _consumer(schema: Schema, de: ShapeDeserializer) -> None:
|
|
12241
|
+
match schema.expect_member_index():
|
|
12242
|
+
case 0:
|
|
12243
|
+
kwargs["org_id"] = de.read_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_INPUT.members["org_id"])
|
|
12244
|
+
|
|
12245
|
+
case 1:
|
|
12246
|
+
kwargs["workspace_name"] = de.read_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_INPUT.members["workspace_name"])
|
|
12247
|
+
|
|
12248
|
+
case _:
|
|
12249
|
+
logger.debug("Unexpected member schema: %s", schema)
|
|
12250
|
+
|
|
12251
|
+
deserializer.read_struct(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_INPUT, consumer=_consumer)
|
|
12252
|
+
return kwargs
|
|
12253
|
+
|
|
12254
|
+
@dataclass(kw_only=True)
|
|
12255
|
+
class MigrateWorkspaceSchemaOutput:
|
|
12256
|
+
|
|
12257
|
+
workspace_name: str
|
|
12258
|
+
|
|
12259
|
+
organisation_id: str
|
|
12260
|
+
|
|
12261
|
+
organisation_name: str
|
|
12262
|
+
|
|
12263
|
+
workspace_schema_name: str
|
|
12264
|
+
|
|
12265
|
+
workspace_status: str
|
|
12266
|
+
|
|
12267
|
+
workspace_admin_email: str
|
|
12268
|
+
|
|
12269
|
+
created_by: str
|
|
12270
|
+
|
|
12271
|
+
last_modified_by: str
|
|
12272
|
+
|
|
12273
|
+
last_modified_at: datetime
|
|
12274
|
+
|
|
12275
|
+
created_at: datetime
|
|
12276
|
+
|
|
12277
|
+
strict_mode: bool
|
|
12278
|
+
|
|
12279
|
+
allow_experiment_self_approval: bool
|
|
12280
|
+
|
|
12281
|
+
auto_populate_control: bool
|
|
12282
|
+
|
|
12283
|
+
config_version: str | None = None
|
|
12284
|
+
mandatory_dimensions: list[str] | None = None
|
|
12285
|
+
metrics: Document | None = None
|
|
12286
|
+
|
|
12287
|
+
def serialize(self, serializer: ShapeSerializer):
|
|
12288
|
+
serializer.write_struct(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT, self)
|
|
12289
|
+
|
|
12290
|
+
def serialize_members(self, serializer: ShapeSerializer):
|
|
12291
|
+
serializer.write_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["workspace_name"], self.workspace_name)
|
|
12292
|
+
serializer.write_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["organisation_id"], self.organisation_id)
|
|
12293
|
+
serializer.write_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["organisation_name"], self.organisation_name)
|
|
12294
|
+
serializer.write_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["workspace_schema_name"], self.workspace_schema_name)
|
|
12295
|
+
serializer.write_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["workspace_status"], self.workspace_status)
|
|
12296
|
+
serializer.write_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["workspace_admin_email"], self.workspace_admin_email)
|
|
12297
|
+
if self.config_version is not None:
|
|
12298
|
+
serializer.write_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["config_version"], self.config_version)
|
|
12299
|
+
|
|
12300
|
+
serializer.write_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["created_by"], self.created_by)
|
|
12301
|
+
serializer.write_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["last_modified_by"], self.last_modified_by)
|
|
12302
|
+
serializer.write_timestamp(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["last_modified_at"], self.last_modified_at)
|
|
12303
|
+
serializer.write_timestamp(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["created_at"], self.created_at)
|
|
12304
|
+
if self.mandatory_dimensions is not None:
|
|
12305
|
+
_serialize_list_mandatory_dimensions(serializer, _SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["mandatory_dimensions"], self.mandatory_dimensions)
|
|
12306
|
+
|
|
12307
|
+
serializer.write_boolean(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["strict_mode"], self.strict_mode)
|
|
12308
|
+
if self.metrics is not None:
|
|
12309
|
+
serializer.write_document(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["metrics"], self.metrics)
|
|
12310
|
+
|
|
12311
|
+
serializer.write_boolean(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["allow_experiment_self_approval"], self.allow_experiment_self_approval)
|
|
12312
|
+
serializer.write_boolean(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["auto_populate_control"], self.auto_populate_control)
|
|
12313
|
+
|
|
12314
|
+
@classmethod
|
|
12315
|
+
def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
|
|
12316
|
+
return cls(**cls.deserialize_kwargs(deserializer))
|
|
12317
|
+
|
|
12318
|
+
@classmethod
|
|
12319
|
+
def deserialize_kwargs(cls, deserializer: ShapeDeserializer) -> dict[str, Any]:
|
|
12320
|
+
kwargs: dict[str, Any] = {}
|
|
12321
|
+
|
|
12322
|
+
def _consumer(schema: Schema, de: ShapeDeserializer) -> None:
|
|
12323
|
+
match schema.expect_member_index():
|
|
12324
|
+
case 0:
|
|
12325
|
+
kwargs["workspace_name"] = de.read_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["workspace_name"])
|
|
12326
|
+
|
|
12327
|
+
case 1:
|
|
12328
|
+
kwargs["organisation_id"] = de.read_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["organisation_id"])
|
|
12329
|
+
|
|
12330
|
+
case 2:
|
|
12331
|
+
kwargs["organisation_name"] = de.read_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["organisation_name"])
|
|
12332
|
+
|
|
12333
|
+
case 3:
|
|
12334
|
+
kwargs["workspace_schema_name"] = de.read_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["workspace_schema_name"])
|
|
12335
|
+
|
|
12336
|
+
case 4:
|
|
12337
|
+
kwargs["workspace_status"] = de.read_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["workspace_status"])
|
|
12338
|
+
|
|
12339
|
+
case 5:
|
|
12340
|
+
kwargs["workspace_admin_email"] = de.read_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["workspace_admin_email"])
|
|
12341
|
+
|
|
12342
|
+
case 6:
|
|
12343
|
+
kwargs["config_version"] = de.read_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["config_version"])
|
|
12344
|
+
|
|
12345
|
+
case 7:
|
|
12346
|
+
kwargs["created_by"] = de.read_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["created_by"])
|
|
12347
|
+
|
|
12348
|
+
case 8:
|
|
12349
|
+
kwargs["last_modified_by"] = de.read_string(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["last_modified_by"])
|
|
12350
|
+
|
|
12351
|
+
case 9:
|
|
12352
|
+
kwargs["last_modified_at"] = de.read_timestamp(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["last_modified_at"])
|
|
12353
|
+
|
|
12354
|
+
case 10:
|
|
12355
|
+
kwargs["created_at"] = de.read_timestamp(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["created_at"])
|
|
12356
|
+
|
|
12357
|
+
case 11:
|
|
12358
|
+
kwargs["mandatory_dimensions"] = _deserialize_list_mandatory_dimensions(de, _SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["mandatory_dimensions"])
|
|
12359
|
+
|
|
12360
|
+
case 12:
|
|
12361
|
+
kwargs["strict_mode"] = de.read_boolean(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["strict_mode"])
|
|
12362
|
+
|
|
12363
|
+
case 13:
|
|
12364
|
+
kwargs["metrics"] = de.read_document(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["metrics"])
|
|
12365
|
+
|
|
12366
|
+
case 14:
|
|
12367
|
+
kwargs["allow_experiment_self_approval"] = de.read_boolean(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["allow_experiment_self_approval"])
|
|
12368
|
+
|
|
12369
|
+
case 15:
|
|
12370
|
+
kwargs["auto_populate_control"] = de.read_boolean(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT.members["auto_populate_control"])
|
|
12371
|
+
|
|
12372
|
+
case _:
|
|
12373
|
+
logger.debug("Unexpected member schema: %s", schema)
|
|
12374
|
+
|
|
12375
|
+
deserializer.read_struct(_SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT, consumer=_consumer)
|
|
12376
|
+
return kwargs
|
|
12377
|
+
|
|
12378
|
+
MIGRATE_WORKSPACE_SCHEMA = APIOperation(
|
|
12379
|
+
input = MigrateWorkspaceSchemaInput,
|
|
12380
|
+
output = MigrateWorkspaceSchemaOutput,
|
|
12381
|
+
schema = _SCHEMA_MIGRATE_WORKSPACE_SCHEMA,
|
|
12382
|
+
input_schema = _SCHEMA_MIGRATE_WORKSPACE_SCHEMA_INPUT,
|
|
12383
|
+
output_schema = _SCHEMA_MIGRATE_WORKSPACE_SCHEMA_OUTPUT,
|
|
12384
|
+
error_registry = TypeRegistry({
|
|
12385
|
+
ShapeID("io.superposition#InternalServerError"): InternalServerError,
|
|
12386
|
+
}),
|
|
12387
|
+
effective_auth_schemes = [
|
|
12388
|
+
ShapeID("smithy.api#httpBearerAuth")
|
|
12389
|
+
]
|
|
12390
|
+
)
|
|
12391
|
+
|
|
12198
12392
|
@dataclass(kw_only=True)
|
|
12199
12393
|
class UpdateOrganisationInput:
|
|
12200
12394
|
|
|
@@ -12791,6 +12985,7 @@ class UpdateWorkspaceInput:
|
|
|
12791
12985
|
workspace_status: str | None = None
|
|
12792
12986
|
metrics: Document | None = None
|
|
12793
12987
|
allow_experiment_self_approval: bool | None = None
|
|
12988
|
+
auto_populate_control: bool | None = None
|
|
12794
12989
|
|
|
12795
12990
|
def serialize(self, serializer: ShapeSerializer):
|
|
12796
12991
|
serializer.write_struct(_SCHEMA_UPDATE_WORKSPACE_INPUT, self)
|
|
@@ -12814,6 +13009,9 @@ class UpdateWorkspaceInput:
|
|
|
12814
13009
|
if self.allow_experiment_self_approval is not None:
|
|
12815
13010
|
serializer.write_boolean(_SCHEMA_UPDATE_WORKSPACE_INPUT.members["allow_experiment_self_approval"], self.allow_experiment_self_approval)
|
|
12816
13011
|
|
|
13012
|
+
if self.auto_populate_control is not None:
|
|
13013
|
+
serializer.write_boolean(_SCHEMA_UPDATE_WORKSPACE_INPUT.members["auto_populate_control"], self.auto_populate_control)
|
|
13014
|
+
|
|
12817
13015
|
@classmethod
|
|
12818
13016
|
def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
|
|
12819
13017
|
return cls(**cls.deserialize_kwargs(deserializer))
|
|
@@ -12848,6 +13046,9 @@ class UpdateWorkspaceInput:
|
|
|
12848
13046
|
case 7:
|
|
12849
13047
|
kwargs["allow_experiment_self_approval"] = de.read_boolean(_SCHEMA_UPDATE_WORKSPACE_INPUT.members["allow_experiment_self_approval"])
|
|
12850
13048
|
|
|
13049
|
+
case 8:
|
|
13050
|
+
kwargs["auto_populate_control"] = de.read_boolean(_SCHEMA_UPDATE_WORKSPACE_INPUT.members["auto_populate_control"])
|
|
13051
|
+
|
|
12851
13052
|
case _:
|
|
12852
13053
|
logger.debug("Unexpected member schema: %s", schema)
|
|
12853
13054
|
|
|
@@ -12881,6 +13082,8 @@ class UpdateWorkspaceOutput:
|
|
|
12881
13082
|
|
|
12882
13083
|
allow_experiment_self_approval: bool
|
|
12883
13084
|
|
|
13085
|
+
auto_populate_control: bool
|
|
13086
|
+
|
|
12884
13087
|
config_version: str | None = None
|
|
12885
13088
|
mandatory_dimensions: list[str] | None = None
|
|
12886
13089
|
metrics: Document | None = None
|
|
@@ -12910,6 +13113,7 @@ class UpdateWorkspaceOutput:
|
|
|
12910
13113
|
serializer.write_document(_SCHEMA_UPDATE_WORKSPACE_OUTPUT.members["metrics"], self.metrics)
|
|
12911
13114
|
|
|
12912
13115
|
serializer.write_boolean(_SCHEMA_UPDATE_WORKSPACE_OUTPUT.members["allow_experiment_self_approval"], self.allow_experiment_self_approval)
|
|
13116
|
+
serializer.write_boolean(_SCHEMA_UPDATE_WORKSPACE_OUTPUT.members["auto_populate_control"], self.auto_populate_control)
|
|
12913
13117
|
|
|
12914
13118
|
@classmethod
|
|
12915
13119
|
def deserialize(cls, deserializer: ShapeDeserializer) -> Self:
|
|
@@ -12966,6 +13170,9 @@ class UpdateWorkspaceOutput:
|
|
|
12966
13170
|
case 14:
|
|
12967
13171
|
kwargs["allow_experiment_self_approval"] = de.read_boolean(_SCHEMA_UPDATE_WORKSPACE_OUTPUT.members["allow_experiment_self_approval"])
|
|
12968
13172
|
|
|
13173
|
+
case 15:
|
|
13174
|
+
kwargs["auto_populate_control"] = de.read_boolean(_SCHEMA_UPDATE_WORKSPACE_OUTPUT.members["auto_populate_control"])
|
|
13175
|
+
|
|
12969
13176
|
case _:
|
|
12970
13177
|
logger.debug("Unexpected member schema: %s", schema)
|
|
12971
13178
|
|
superposition_sdk/serialize.py
CHANGED
|
@@ -59,6 +59,7 @@ from .models import (
|
|
|
59
59
|
ListVersionsInput,
|
|
60
60
|
ListWebhookInput,
|
|
61
61
|
ListWorkspaceInput,
|
|
62
|
+
MigrateWorkspaceSchemaInput,
|
|
62
63
|
MoveContextInput,
|
|
63
64
|
PauseExperimentInput,
|
|
64
65
|
PublishInput,
|
|
@@ -1695,6 +1696,36 @@ async def _serialize_list_workspace(input: ListWorkspaceInput, config: Config) -
|
|
|
1695
1696
|
body=body,
|
|
1696
1697
|
)
|
|
1697
1698
|
|
|
1699
|
+
async def _serialize_migrate_workspace_schema(input: MigrateWorkspaceSchemaInput, config: Config) -> HTTPRequest:
|
|
1700
|
+
if not input.workspace_name:
|
|
1701
|
+
raise ServiceError("workspace_name must not be empty.")
|
|
1702
|
+
|
|
1703
|
+
path = "/workspaces/{workspace_name}/db/migrate".format(
|
|
1704
|
+
workspace_name=urlquote(input.workspace_name, safe=''),
|
|
1705
|
+
)
|
|
1706
|
+
query: str = f''
|
|
1707
|
+
|
|
1708
|
+
body: AsyncIterable[bytes] = AsyncBytesReader(b'')
|
|
1709
|
+
headers = Fields(
|
|
1710
|
+
[
|
|
1711
|
+
|
|
1712
|
+
]
|
|
1713
|
+
)
|
|
1714
|
+
|
|
1715
|
+
if input.org_id:
|
|
1716
|
+
headers.extend(Fields([Field(name="x-org-id", values=[input.org_id])]))
|
|
1717
|
+
return _HTTPRequest(
|
|
1718
|
+
destination=_URI(
|
|
1719
|
+
host="",
|
|
1720
|
+
path=path,
|
|
1721
|
+
scheme="https",
|
|
1722
|
+
query=query,
|
|
1723
|
+
),
|
|
1724
|
+
method="POST",
|
|
1725
|
+
fields=headers,
|
|
1726
|
+
body=body,
|
|
1727
|
+
)
|
|
1728
|
+
|
|
1698
1729
|
async def _serialize_move_context(input: MoveContextInput, config: Config) -> HTTPRequest:
|
|
1699
1730
|
if not input.id:
|
|
1700
1731
|
raise ServiceError("id must not be empty.")
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: superposition_sdk
|
|
3
|
+
Version: 0.87.0
|
|
4
|
+
Summary: superposition_sdk client
|
|
5
|
+
License: Apache-2.0
|
|
6
|
+
Keywords: smithy,superposition_sdk
|
|
7
|
+
Classifier: Development Status :: 2 - Pre-Alpha
|
|
8
|
+
Classifier: Intended Audience :: Developers
|
|
9
|
+
Classifier: Intended Audience :: System Administrators
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Natural Language :: English
|
|
12
|
+
Classifier: Programming Language :: Python
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
+
Requires-Python: >=3.12
|
|
18
|
+
Requires-Dist: smithy-core==0.0.1
|
|
19
|
+
Requires-Dist: smithy-http[aiohttp]==0.0.1
|
|
20
|
+
Requires-Dist: smithy-json==0.0.1
|
|
21
|
+
Provides-Extra: docs
|
|
22
|
+
Requires-Dist: pydata-sphinx-theme>=0.16.1; extra == 'docs'
|
|
23
|
+
Requires-Dist: sphinx>=8.2.3; extra == 'docs'
|
|
24
|
+
Provides-Extra: tests
|
|
25
|
+
Requires-Dist: pytest-asyncio<0.21.0,>=0.20.3; extra == 'tests'
|
|
26
|
+
Requires-Dist: pytest<8.0.0,>=7.2.0; extra == 'tests'
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
## Superposition SDK
|
|
30
|
+
|
|
31
|
+
Superposition SDK is a Python client for the Superposition platform, designed to facilitate programmatic integration of all Superposition's API capabilities in Python applications. Read the complete documentation at [Superposition SDK Documentation](https://juspay.io/superposition/docs).
|
|
32
|
+
|
|
33
|
+
## Installation
|
|
34
|
+
|
|
35
|
+
Install the Superposition SDK using pip:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pip install superposition-sdk
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Initialization
|
|
42
|
+
|
|
43
|
+
```python
|
|
44
|
+
from superposition_sdk.client import Config, Superposition
|
|
45
|
+
client = Superposition(Config(endpoint_uri="http://localhost:8080"))
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Usage
|
|
49
|
+
|
|
50
|
+
The SDK provides commands for every API call that Superposition supports. Below is an example of how to use the SDK to list default configs.
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
import asyncio
|
|
54
|
+
from superposition_sdk.client import Config, ListDefaultConfigsInput, Superposition
|
|
55
|
+
from pprint import pprint
|
|
56
|
+
|
|
57
|
+
async def list_configs():
|
|
58
|
+
client = Superposition(Config(endpoint_uri="http://localhost:8080"))
|
|
59
|
+
list_configs = ListDefaultConfigsInput(workspace_id="upi", org_id="orgid162145664241766405", all=True)
|
|
60
|
+
response = await client.list_default_configs(list_configs)
|
|
61
|
+
pprint(response)
|
|
62
|
+
|
|
63
|
+
asyncio.run(list_configs())
|
|
64
|
+
```
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
superposition_sdk/__init__.py,sha256=Inc_oe2U1CzZ_ZxsNVbU96RGaAlD-6M5xt1ZcW5hGUo,83
|
|
2
|
+
superposition_sdk/auth.py,sha256=U9D3FmOH8TX0cjibGy_CRnAkTnFEavAek0Jw1YUhN2g,404
|
|
3
|
+
superposition_sdk/client.py,sha256=mas4nI_bk32FXVUQMlOSa-S1Y4ewY8GIoDCIsy6kCCM,88710
|
|
4
|
+
superposition_sdk/config.py,sha256=elPULtcHP7am9Wk7VqIpzPMNlcQIdH1Do9gNeAkqdHM,11425
|
|
5
|
+
superposition_sdk/deserialize.py,sha256=fVUcHo_BtWwtINcbBWGXDVo0GmSPT0pEyDwEB6Jf82Y,77499
|
|
6
|
+
superposition_sdk/models.py,sha256=JNV6ts9ouu_brSMfifEmOwBiIBLlawXFmjQfRv-UNeI,545296
|
|
7
|
+
superposition_sdk/serialize.py,sha256=5naLDkPY1SBrHIuU_SGj05TCLcx7jR59BGy65tHYk58,72728
|
|
8
|
+
superposition_sdk/_private/__init__.py,sha256=DxsJq42a0KfQv9zzLrqT0JVpoXrR-IDIYFGuJe4g1Gc,55
|
|
9
|
+
superposition_sdk/_private/schemas.py,sha256=9UZVCgCoo4t7SnD0paDSSZXw3kLSNpt0fq0l8GrJ83Y,303088
|
|
10
|
+
superposition_sdk-0.87.0.dist-info/METADATA,sha256=eadwxEYdC1mIMrQmsceBeYr_VYn_fT2cA-JiW6NHiTQ,2280
|
|
11
|
+
superposition_sdk-0.87.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
12
|
+
superposition_sdk-0.87.0.dist-info/RECORD,,
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: superposition_sdk
|
|
3
|
-
Version: 0.85.1
|
|
4
|
-
Summary: superposition_sdk client
|
|
5
|
-
License: Apache-2.0
|
|
6
|
-
Keywords: smithy,superposition_sdk
|
|
7
|
-
Classifier: Development Status :: 2 - Pre-Alpha
|
|
8
|
-
Classifier: Intended Audience :: Developers
|
|
9
|
-
Classifier: Intended Audience :: System Administrators
|
|
10
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
-
Classifier: Natural Language :: English
|
|
12
|
-
Classifier: Programming Language :: Python
|
|
13
|
-
Classifier: Programming Language :: Python :: 3
|
|
14
|
-
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.13
|
|
17
|
-
Requires-Python: >=3.12
|
|
18
|
-
Requires-Dist: smithy-core==0.0.1
|
|
19
|
-
Requires-Dist: smithy-http[aiohttp]==0.0.1
|
|
20
|
-
Requires-Dist: smithy-json==0.0.1
|
|
21
|
-
Provides-Extra: docs
|
|
22
|
-
Requires-Dist: pydata-sphinx-theme>=0.16.1; extra == 'docs'
|
|
23
|
-
Requires-Dist: sphinx>=8.2.3; extra == 'docs'
|
|
24
|
-
Provides-Extra: tests
|
|
25
|
-
Requires-Dist: pytest-asyncio<0.21.0,>=0.20.3; extra == 'tests'
|
|
26
|
-
Requires-Dist: pytest<8.0.0,>=7.2.0; extra == 'tests'
|
|
27
|
-
Description-Content-Type: text/markdown
|
|
28
|
-
|
|
29
|
-
## Superposition Client
|
|
30
|
-
|
|
31
|
-
superposition_sdk client
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
superposition_sdk/__init__.py,sha256=Inc_oe2U1CzZ_ZxsNVbU96RGaAlD-6M5xt1ZcW5hGUo,83
|
|
2
|
-
superposition_sdk/auth.py,sha256=U9D3FmOH8TX0cjibGy_CRnAkTnFEavAek0Jw1YUhN2g,404
|
|
3
|
-
superposition_sdk/client.py,sha256=9kj6k0uX6UaP-tAxJoZNhMJVFpC-kWhRXNAqWA4-OO0,87557
|
|
4
|
-
superposition_sdk/config.py,sha256=WfJkW9bPCkNXyxcWet47cUY2OdU--9rs5zuWlssuAag,11276
|
|
5
|
-
superposition_sdk/deserialize.py,sha256=VlPxbY8hwD5Sbgn1IvvMFmm9-wMOVjmYrUkPvDE_WtU,76337
|
|
6
|
-
superposition_sdk/models.py,sha256=az1bVauWYaF5I7N744lQmQkYKyAKHCsMzpPzXGchOgM,535433
|
|
7
|
-
superposition_sdk/serialize.py,sha256=__hMORn6Mx61sy0t3Y5Hs7O5iO1GOyRHYg0kehjbZYA,71892
|
|
8
|
-
superposition_sdk/_private/__init__.py,sha256=DxsJq42a0KfQv9zzLrqT0JVpoXrR-IDIYFGuJe4g1Gc,55
|
|
9
|
-
superposition_sdk/_private/schemas.py,sha256=hpQ-dFMLpQmn1t25yRbcrVv_Zg32_A0FARh0pfozWPU,297589
|
|
10
|
-
superposition_sdk-0.85.1.dist-info/METADATA,sha256=oywrgyDtYKqq2FTompqEpGKm8eN77JfsVLkz72IAvBo,1143
|
|
11
|
-
superposition_sdk-0.85.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
12
|
-
superposition_sdk-0.85.1.dist-info/RECORD,,
|
|
File without changes
|