superposition-sdk 0.85.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/__init__.py +3 -0
- superposition_sdk/_private/__init__.py +1 -0
- superposition_sdk/_private/schemas.py +13070 -0
- superposition_sdk/auth.py +16 -0
- superposition_sdk/client.py +2424 -0
- superposition_sdk/config.py +224 -0
- superposition_sdk/deserialize.py +1818 -0
- superposition_sdk/models.py +13019 -0
- superposition_sdk/serialize.py +2421 -0
- superposition_sdk-0.85.0.dist-info/METADATA +31 -0
- superposition_sdk-0.85.0.dist-info/RECORD +12 -0
- superposition_sdk-0.85.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
# Code generated by smithy-python-codegen DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from typing import Any, Callable, TypeAlias, Union
|
|
5
|
+
|
|
6
|
+
from smithy_core.aio.endpoints import StaticEndpointResolver
|
|
7
|
+
from smithy_core.aio.interfaces import EndpointResolver as _EndpointResolver
|
|
8
|
+
from smithy_core.interceptors import Interceptor
|
|
9
|
+
from smithy_core.interfaces import URI
|
|
10
|
+
from smithy_core.interfaces.retries import RetryStrategy
|
|
11
|
+
from smithy_core.retries import SimpleRetryStrategy
|
|
12
|
+
from smithy_http.aio.aiohttp import AIOHTTPClient
|
|
13
|
+
from smithy_http.aio.interfaces import HTTPClient
|
|
14
|
+
from smithy_http.aio.interfaces.auth import HTTPAuthScheme
|
|
15
|
+
from smithy_http.interfaces import HTTPRequestConfiguration
|
|
16
|
+
|
|
17
|
+
from .auth import HTTPAuthSchemeResolver
|
|
18
|
+
from .models import (
|
|
19
|
+
AddMembersToGroupInput,
|
|
20
|
+
AddMembersToGroupOutput,
|
|
21
|
+
ApplicableVariantsInput,
|
|
22
|
+
ApplicableVariantsOutput,
|
|
23
|
+
BulkOperationInput,
|
|
24
|
+
BulkOperationOutput,
|
|
25
|
+
ConcludeExperimentInput,
|
|
26
|
+
ConcludeExperimentOutput,
|
|
27
|
+
CreateContextInput,
|
|
28
|
+
CreateContextOutput,
|
|
29
|
+
CreateDefaultConfigInput,
|
|
30
|
+
CreateDefaultConfigOutput,
|
|
31
|
+
CreateDimensionInput,
|
|
32
|
+
CreateDimensionOutput,
|
|
33
|
+
CreateExperimentGroupInput,
|
|
34
|
+
CreateExperimentGroupOutput,
|
|
35
|
+
CreateExperimentInput,
|
|
36
|
+
CreateExperimentOutput,
|
|
37
|
+
CreateFunctionInput,
|
|
38
|
+
CreateFunctionOutput,
|
|
39
|
+
CreateOrganisationInput,
|
|
40
|
+
CreateOrganisationOutput,
|
|
41
|
+
CreateTypeTemplatesInput,
|
|
42
|
+
CreateTypeTemplatesOutput,
|
|
43
|
+
CreateWebhookInput,
|
|
44
|
+
CreateWebhookOutput,
|
|
45
|
+
CreateWorkspaceInput,
|
|
46
|
+
CreateWorkspaceOutput,
|
|
47
|
+
DeleteContextInput,
|
|
48
|
+
DeleteContextOutput,
|
|
49
|
+
DeleteDefaultConfigInput,
|
|
50
|
+
DeleteDefaultConfigOutput,
|
|
51
|
+
DeleteDimensionInput,
|
|
52
|
+
DeleteDimensionOutput,
|
|
53
|
+
DeleteExperimentGroupInput,
|
|
54
|
+
DeleteExperimentGroupOutput,
|
|
55
|
+
DeleteFunctionInput,
|
|
56
|
+
DeleteFunctionOutput,
|
|
57
|
+
DeleteTypeTemplatesInput,
|
|
58
|
+
DeleteTypeTemplatesOutput,
|
|
59
|
+
DiscardExperimentInput,
|
|
60
|
+
DiscardExperimentOutput,
|
|
61
|
+
GetConfigFastInput,
|
|
62
|
+
GetConfigFastOutput,
|
|
63
|
+
GetConfigInput,
|
|
64
|
+
GetConfigOutput,
|
|
65
|
+
GetContextFromConditionInput,
|
|
66
|
+
GetContextFromConditionOutput,
|
|
67
|
+
GetContextInput,
|
|
68
|
+
GetContextOutput,
|
|
69
|
+
GetDimensionInput,
|
|
70
|
+
GetDimensionOutput,
|
|
71
|
+
GetExperimentGroupInput,
|
|
72
|
+
GetExperimentGroupOutput,
|
|
73
|
+
GetExperimentInput,
|
|
74
|
+
GetExperimentOutput,
|
|
75
|
+
GetFunctionInput,
|
|
76
|
+
GetFunctionOutput,
|
|
77
|
+
GetOrganisationInput,
|
|
78
|
+
GetOrganisationOutput,
|
|
79
|
+
GetResolvedConfigInput,
|
|
80
|
+
GetResolvedConfigOutput,
|
|
81
|
+
GetTypeTemplatesListInput,
|
|
82
|
+
GetTypeTemplatesListOutput,
|
|
83
|
+
GetWebhookInput,
|
|
84
|
+
GetWebhookOutput,
|
|
85
|
+
ListAuditLogsInput,
|
|
86
|
+
ListAuditLogsOutput,
|
|
87
|
+
ListContextsInput,
|
|
88
|
+
ListContextsOutput,
|
|
89
|
+
ListDefaultConfigsInput,
|
|
90
|
+
ListDefaultConfigsOutput,
|
|
91
|
+
ListDimensionsInput,
|
|
92
|
+
ListDimensionsOutput,
|
|
93
|
+
ListExperimentGroupsInput,
|
|
94
|
+
ListExperimentGroupsOutput,
|
|
95
|
+
ListExperimentInput,
|
|
96
|
+
ListExperimentOutput,
|
|
97
|
+
ListFunctionInput,
|
|
98
|
+
ListFunctionOutput,
|
|
99
|
+
ListOrganisationInput,
|
|
100
|
+
ListOrganisationOutput,
|
|
101
|
+
ListVersionsInput,
|
|
102
|
+
ListVersionsOutput,
|
|
103
|
+
ListWebhookInput,
|
|
104
|
+
ListWebhookOutput,
|
|
105
|
+
ListWorkspaceInput,
|
|
106
|
+
ListWorkspaceOutput,
|
|
107
|
+
MoveContextInput,
|
|
108
|
+
MoveContextOutput,
|
|
109
|
+
PauseExperimentInput,
|
|
110
|
+
PauseExperimentOutput,
|
|
111
|
+
PublishInput,
|
|
112
|
+
PublishOutput,
|
|
113
|
+
RampExperimentInput,
|
|
114
|
+
RampExperimentOutput,
|
|
115
|
+
RemoveMembersFromGroupInput,
|
|
116
|
+
RemoveMembersFromGroupOutput,
|
|
117
|
+
ResumeExperimentInput,
|
|
118
|
+
ResumeExperimentOutput,
|
|
119
|
+
TestInput,
|
|
120
|
+
TestOutput,
|
|
121
|
+
UpdateDefaultConfigInput,
|
|
122
|
+
UpdateDefaultConfigOutput,
|
|
123
|
+
UpdateDimensionInput,
|
|
124
|
+
UpdateDimensionOutput,
|
|
125
|
+
UpdateExperimentGroupInput,
|
|
126
|
+
UpdateExperimentGroupOutput,
|
|
127
|
+
UpdateFunctionInput,
|
|
128
|
+
UpdateFunctionOutput,
|
|
129
|
+
UpdateOrganisationInput,
|
|
130
|
+
UpdateOrganisationOutput,
|
|
131
|
+
UpdateOverrideInput,
|
|
132
|
+
UpdateOverrideOutput,
|
|
133
|
+
UpdateOverridesExperimentInput,
|
|
134
|
+
UpdateOverridesExperimentOutput,
|
|
135
|
+
UpdateTypeTemplatesInput,
|
|
136
|
+
UpdateTypeTemplatesOutput,
|
|
137
|
+
UpdateWebhookInput,
|
|
138
|
+
UpdateWebhookOutput,
|
|
139
|
+
UpdateWorkspaceInput,
|
|
140
|
+
UpdateWorkspaceOutput,
|
|
141
|
+
WeightRecomputeInput,
|
|
142
|
+
WeightRecomputeOutput,
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
|
|
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]]
|
|
147
|
+
@dataclass(init=False)
|
|
148
|
+
class Config:
|
|
149
|
+
"""Configuration for Superposition."""
|
|
150
|
+
|
|
151
|
+
endpoint_resolver: _EndpointResolver
|
|
152
|
+
endpoint_uri: str | URI | None
|
|
153
|
+
http_auth_scheme_resolver: HTTPAuthSchemeResolver
|
|
154
|
+
http_auth_schemes: dict[str, HTTPAuthScheme[Any, Any, Any, Any]]
|
|
155
|
+
http_client: HTTPClient
|
|
156
|
+
http_request_config: HTTPRequestConfiguration | None
|
|
157
|
+
interceptors: list[_ServiceInterceptor]
|
|
158
|
+
retry_strategy: RetryStrategy
|
|
159
|
+
|
|
160
|
+
def __init__(
|
|
161
|
+
self,
|
|
162
|
+
*,
|
|
163
|
+
endpoint_resolver: _EndpointResolver | None = None,
|
|
164
|
+
endpoint_uri: str | URI | None = None,
|
|
165
|
+
http_auth_scheme_resolver: HTTPAuthSchemeResolver | None = None,
|
|
166
|
+
http_auth_schemes: dict[str, HTTPAuthScheme[Any, Any, Any, Any]] | None = None,
|
|
167
|
+
http_client: HTTPClient | None = None,
|
|
168
|
+
http_request_config: HTTPRequestConfiguration | None = None,
|
|
169
|
+
interceptors: list[_ServiceInterceptor] | None = None,
|
|
170
|
+
retry_strategy: RetryStrategy | None = None,
|
|
171
|
+
):
|
|
172
|
+
"""Constructor.
|
|
173
|
+
|
|
174
|
+
:param endpoint_resolver:
|
|
175
|
+
The endpoint resolver used to resolve the final endpoint per-operation based on
|
|
176
|
+
the configuration.
|
|
177
|
+
|
|
178
|
+
:param endpoint_uri:
|
|
179
|
+
A static URI to route requests to.
|
|
180
|
+
|
|
181
|
+
:param http_auth_scheme_resolver:
|
|
182
|
+
An http auth scheme resolver that determines the auth scheme for each operation.
|
|
183
|
+
|
|
184
|
+
:param http_auth_schemes:
|
|
185
|
+
A map of http auth scheme ids to http auth schemes.
|
|
186
|
+
|
|
187
|
+
:param http_client:
|
|
188
|
+
The HTTP client used to make requests.
|
|
189
|
+
|
|
190
|
+
:param http_request_config:
|
|
191
|
+
Configuration for individual HTTP requests.
|
|
192
|
+
|
|
193
|
+
:param interceptors:
|
|
194
|
+
The list of interceptors, which are hooks that are called during the execution
|
|
195
|
+
of a request.
|
|
196
|
+
|
|
197
|
+
:param retry_strategy:
|
|
198
|
+
The retry strategy for issuing retry tokens and computing retry delays.
|
|
199
|
+
|
|
200
|
+
"""
|
|
201
|
+
self.endpoint_resolver = endpoint_resolver or StaticEndpointResolver()
|
|
202
|
+
self.endpoint_uri = endpoint_uri
|
|
203
|
+
self.http_auth_scheme_resolver = http_auth_scheme_resolver or HTTPAuthSchemeResolver()
|
|
204
|
+
self.http_auth_schemes = http_auth_schemes or {
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
self.http_client = http_client or AIOHTTPClient()
|
|
208
|
+
self.http_request_config = http_request_config
|
|
209
|
+
self.interceptors = interceptors or []
|
|
210
|
+
self.retry_strategy = retry_strategy or SimpleRetryStrategy()
|
|
211
|
+
|
|
212
|
+
def set_http_auth_scheme(self, scheme: HTTPAuthScheme[Any, Any, Any, Any]) -> None:
|
|
213
|
+
"""Sets the implementation of an auth scheme.
|
|
214
|
+
|
|
215
|
+
Using this method ensures the correct key is used.
|
|
216
|
+
|
|
217
|
+
:param scheme: The auth scheme to add.
|
|
218
|
+
"""
|
|
219
|
+
self.http_auth_schemes[scheme.scheme_id] = scheme
|
|
220
|
+
|
|
221
|
+
#
|
|
222
|
+
# A callable that allows customizing the config object on each request.
|
|
223
|
+
#
|
|
224
|
+
Plugin: TypeAlias = Callable[[Config], None]
|