alchemy-python 0.1.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.
- alchemy/.fern/metadata.json +18 -0
- alchemy/CONTRIBUTING.md +125 -0
- alchemy/__init__.py +380 -0
- alchemy/_default_clients.py +30 -0
- alchemy/auth/__init__.py +4 -0
- alchemy/auth/client.py +767 -0
- alchemy/auth/raw_client.py +866 -0
- alchemy/client.py +717 -0
- alchemy/core/__init__.py +127 -0
- alchemy/core/api_error.py +23 -0
- alchemy/core/client_wrapper.py +155 -0
- alchemy/core/datetime_utils.py +70 -0
- alchemy/core/file.py +67 -0
- alchemy/core/force_multipart.py +18 -0
- alchemy/core/http_client.py +940 -0
- alchemy/core/http_response.py +63 -0
- alchemy/core/http_sse/__init__.py +42 -0
- alchemy/core/http_sse/_api.py +455 -0
- alchemy/core/http_sse/_decoders.py +74 -0
- alchemy/core/http_sse/_exceptions.py +7 -0
- alchemy/core/http_sse/_models.py +17 -0
- alchemy/core/jsonable_encoder.py +133 -0
- alchemy/core/logging.py +107 -0
- alchemy/core/oauth_token_provider.py +73 -0
- alchemy/core/parse_error.py +36 -0
- alchemy/core/pydantic_utilities.py +486 -0
- alchemy/core/query_encoder.py +58 -0
- alchemy/core/remove_none_from_dict.py +11 -0
- alchemy/core/request_options.py +40 -0
- alchemy/core/serialization.py +347 -0
- alchemy/environment.py +7 -0
- alchemy/function/__init__.py +34 -0
- alchemy/function/client.py +808 -0
- alchemy/function/raw_client.py +903 -0
- alchemy/function/version/__init__.py +4 -0
- alchemy/function/version/client.py +364 -0
- alchemy/function/version/raw_client.py +410 -0
- alchemy/host/__init__.py +4 -0
- alchemy/host/client.py +227 -0
- alchemy/host/raw_client.py +242 -0
- alchemy/instance/__init__.py +4 -0
- alchemy/instance/client.py +136 -0
- alchemy/instance/raw_client.py +141 -0
- alchemy/invocation/__init__.py +4 -0
- alchemy/invocation/client.py +570 -0
- alchemy/invocation/raw_client.py +636 -0
- alchemy/member/__init__.py +4 -0
- alchemy/member/client.py +441 -0
- alchemy/member/raw_client.py +504 -0
- alchemy/metrics/__init__.py +4 -0
- alchemy/metrics/client.py +428 -0
- alchemy/metrics/raw_client.py +478 -0
- alchemy/py.typed +0 -0
- alchemy/raw_client.py +138 -0
- alchemy/reference.md +3300 -0
- alchemy/runtime/__init__.py +4 -0
- alchemy/runtime/client.py +141 -0
- alchemy/runtime/raw_client.py +140 -0
- alchemy/service_account/__init__.py +4 -0
- alchemy/service_account/client.py +429 -0
- alchemy/service_account/raw_client.py +490 -0
- alchemy/template/__init__.py +4 -0
- alchemy/template/client.py +141 -0
- alchemy/template/raw_client.py +140 -0
- alchemy/types/__init__.py +344 -0
- alchemy/types/auth_v1accept_invite_response.py +5 -0
- alchemy/types/auth_v1create_service_account_response.py +34 -0
- alchemy/types/auth_v1get_auth_config_request.py +5 -0
- alchemy/types/auth_v1get_auth_config_response.py +53 -0
- alchemy/types/auth_v1get_session_request.py +9 -0
- alchemy/types/auth_v1get_session_response.py +28 -0
- alchemy/types/auth_v1get_token_response.py +29 -0
- alchemy/types/auth_v1invite_member_response.py +29 -0
- alchemy/types/auth_v1list_members_request.py +5 -0
- alchemy/types/auth_v1list_members_response.py +34 -0
- alchemy/types/auth_v1list_service_accounts_request.py +5 -0
- alchemy/types/auth_v1list_service_accounts_response.py +29 -0
- alchemy/types/auth_v1login_response.py +5 -0
- alchemy/types/auth_v1logout_request.py +8 -0
- alchemy/types/auth_v1logout_response.py +5 -0
- alchemy/types/auth_v1member.py +31 -0
- alchemy/types/auth_v1register_response.py +23 -0
- alchemy/types/auth_v1remove_member_response.py +5 -0
- alchemy/types/auth_v1remove_service_account_response.py +5 -0
- alchemy/types/auth_v1role.py +5 -0
- alchemy/types/auth_v1rotate_service_account_secret_response.py +31 -0
- alchemy/types/auth_v1service_account.py +35 -0
- alchemy/types/auth_v1set_member_role_response.py +5 -0
- alchemy/types/connect_error.py +38 -0
- alchemy/types/connect_error_code.py +25 -0
- alchemy/types/connect_error_details_any.py +36 -0
- alchemy/types/connect_protocol_version.py +5 -0
- alchemy/types/connect_timeout_header.py +6 -0
- alchemy/types/functions_v1arrow_contract.py +50 -0
- alchemy/types/functions_v1contract.py +8 -0
- alchemy/types/functions_v1contract_arrow.py +20 -0
- alchemy/types/functions_v1contract_json_schema.py +26 -0
- alchemy/types/functions_v1contract_violation.py +32 -0
- alchemy/types/functions_v1create_function_response.py +22 -0
- alchemy/types/functions_v1create_function_version_response.py +20 -0
- alchemy/types/functions_v1delete_function_response.py +5 -0
- alchemy/types/functions_v1function.py +100 -0
- alchemy/types/functions_v1function_error.py +30 -0
- alchemy/types/functions_v1function_error_kind.py +15 -0
- alchemy/types/functions_v1function_spec.py +58 -0
- alchemy/types/functions_v1function_version.py +81 -0
- alchemy/types/functions_v1function_version_status.py +13 -0
- alchemy/types/functions_v1get_function_response.py +20 -0
- alchemy/types/functions_v1get_function_version_response.py +20 -0
- alchemy/types/functions_v1get_host_request.py +5 -0
- alchemy/types/functions_v1get_host_response.py +20 -0
- alchemy/types/functions_v1get_invocation_logs_request.py +31 -0
- alchemy/types/functions_v1get_invocation_logs_response.py +24 -0
- alchemy/types/functions_v1get_invocation_response.py +20 -0
- alchemy/types/functions_v1get_version_request.py +5 -0
- alchemy/types/functions_v1get_version_response.py +25 -0
- alchemy/types/functions_v1host.py +58 -0
- alchemy/types/functions_v1instance.py +54 -0
- alchemy/types/functions_v1instance_status.py +14 -0
- alchemy/types/functions_v1invocation.py +106 -0
- alchemy/types/functions_v1invocation_protocol.py +8 -0
- alchemy/types/functions_v1invocation_stats.py +41 -0
- alchemy/types/functions_v1invocation_status.py +18 -0
- alchemy/types/functions_v1invoke_async_response.py +34 -0
- alchemy/types/functions_v1invoke_response.py +8 -0
- alchemy/types/functions_v1invoke_response_error.py +20 -0
- alchemy/types/functions_v1invoke_response_output.py +19 -0
- alchemy/types/functions_v1json_schema_contract.py +28 -0
- alchemy/types/functions_v1list_function_versions_response.py +22 -0
- alchemy/types/functions_v1list_functions_response.py +22 -0
- alchemy/types/functions_v1list_hosts_request.py +5 -0
- alchemy/types/functions_v1list_hosts_response.py +23 -0
- alchemy/types/functions_v1list_instances_response.py +20 -0
- alchemy/types/functions_v1list_invocations_response.py +22 -0
- alchemy/types/functions_v1list_runtimes_request.py +5 -0
- alchemy/types/functions_v1list_runtimes_response.py +22 -0
- alchemy/types/functions_v1list_templates_request.py +5 -0
- alchemy/types/functions_v1list_templates_response.py +20 -0
- alchemy/types/functions_v1network.py +5 -0
- alchemy/types/functions_v1pagination_request.py +31 -0
- alchemy/types/functions_v1pagination_response.py +33 -0
- alchemy/types/functions_v1resources.py +28 -0
- alchemy/types/functions_v1runtime.py +59 -0
- alchemy/types/functions_v1runtime_starters.py +29 -0
- alchemy/types/functions_v1source.py +31 -0
- alchemy/types/functions_v1source_file.py +28 -0
- alchemy/types/functions_v1source_layer.py +27 -0
- alchemy/types/functions_v1source_limits.py +30 -0
- alchemy/types/functions_v1start_kind.py +8 -0
- alchemy/types/functions_v1tail_invocations_request.py +32 -0
- alchemy/types/functions_v1tail_invocations_response.py +34 -0
- alchemy/types/functions_v1template.py +94 -0
- alchemy/types/functions_v1template_source.py +27 -0
- alchemy/types/functions_v1update_function_response.py +20 -0
- alchemy/types/google_protobuf_list_value.py +10 -0
- alchemy/types/google_protobuf_null_value.py +5 -0
- alchemy/types/google_protobuf_struct.py +10 -0
- alchemy/types/google_protobuf_value.py +5 -0
- alchemy/types/metrics_v1aggregate_row.py +24 -0
- alchemy/types/metrics_v1get_queue_response.py +25 -0
- alchemy/types/metrics_v1metric.py +16 -0
- alchemy/types/metrics_v1metric_dimension.py +14 -0
- alchemy/types/metrics_v1metric_filter.py +26 -0
- alchemy/types/metrics_v1metric_granularity.py +13 -0
- alchemy/types/metrics_v1query_aggregate_response.py +20 -0
- alchemy/types/metrics_v1query_timeseries_response.py +20 -0
- alchemy/types/metrics_v1timeseries.py +28 -0
- alchemy/types/metrics_v1timeseries_point.py +28 -0
- alchemy_python-0.1.0.dist-info/METADATA +196 -0
- alchemy_python-0.1.0.dist-info/RECORD +172 -0
- alchemy_python-0.1.0.dist-info/WHEEL +4 -0
- alchemy_python-0.1.0.dist-info/licenses/LICENSE +201 -0
alchemy/auth/client.py
ADDED
|
@@ -0,0 +1,767 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
6
|
+
from ..core.request_options import RequestOptions
|
|
7
|
+
from ..types.auth_v1accept_invite_response import AuthV1AcceptInviteResponse
|
|
8
|
+
from ..types.auth_v1get_auth_config_request import AuthV1GetAuthConfigRequest
|
|
9
|
+
from ..types.auth_v1get_auth_config_response import AuthV1GetAuthConfigResponse
|
|
10
|
+
from ..types.auth_v1get_session_request import AuthV1GetSessionRequest
|
|
11
|
+
from ..types.auth_v1get_session_response import AuthV1GetSessionResponse
|
|
12
|
+
from ..types.auth_v1get_token_response import AuthV1GetTokenResponse
|
|
13
|
+
from ..types.auth_v1login_response import AuthV1LoginResponse
|
|
14
|
+
from ..types.auth_v1logout_request import AuthV1LogoutRequest
|
|
15
|
+
from ..types.auth_v1logout_response import AuthV1LogoutResponse
|
|
16
|
+
from ..types.auth_v1register_response import AuthV1RegisterResponse
|
|
17
|
+
from ..types.connect_timeout_header import ConnectTimeoutHeader
|
|
18
|
+
from .raw_client import AsyncRawAuthClient, RawAuthClient
|
|
19
|
+
|
|
20
|
+
# this is used as the default value for optional parameters
|
|
21
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class AuthClient:
|
|
25
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
26
|
+
self._raw_client = RawAuthClient(client_wrapper=client_wrapper)
|
|
27
|
+
|
|
28
|
+
@property
|
|
29
|
+
def with_raw_response(self) -> RawAuthClient:
|
|
30
|
+
"""
|
|
31
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
32
|
+
|
|
33
|
+
Returns
|
|
34
|
+
-------
|
|
35
|
+
RawAuthClient
|
|
36
|
+
"""
|
|
37
|
+
return self._raw_client
|
|
38
|
+
|
|
39
|
+
def accept_invite(
|
|
40
|
+
self,
|
|
41
|
+
*,
|
|
42
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
43
|
+
user_id: typing.Optional[str] = OMIT,
|
|
44
|
+
code: typing.Optional[str] = OMIT,
|
|
45
|
+
password: typing.Optional[str] = OMIT,
|
|
46
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
47
|
+
) -> AuthV1AcceptInviteResponse:
|
|
48
|
+
"""
|
|
49
|
+
Parameters
|
|
50
|
+
----------
|
|
51
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
52
|
+
Define the timeout, in ms
|
|
53
|
+
|
|
54
|
+
user_id : typing.Optional[str]
|
|
55
|
+
|
|
56
|
+
code : typing.Optional[str]
|
|
57
|
+
|
|
58
|
+
password : typing.Optional[str]
|
|
59
|
+
|
|
60
|
+
request_options : typing.Optional[RequestOptions]
|
|
61
|
+
Request-specific configuration.
|
|
62
|
+
|
|
63
|
+
Returns
|
|
64
|
+
-------
|
|
65
|
+
AuthV1AcceptInviteResponse
|
|
66
|
+
Success
|
|
67
|
+
|
|
68
|
+
Examples
|
|
69
|
+
--------
|
|
70
|
+
from alchemy import Alchemy
|
|
71
|
+
|
|
72
|
+
client = Alchemy(
|
|
73
|
+
client_id="YOUR_CLIENT_ID",
|
|
74
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
75
|
+
)
|
|
76
|
+
client.auth.accept_invite(
|
|
77
|
+
connect_timeout_ms=1000.0,
|
|
78
|
+
)
|
|
79
|
+
"""
|
|
80
|
+
_response = self._raw_client.accept_invite(
|
|
81
|
+
connect_timeout_ms=connect_timeout_ms,
|
|
82
|
+
user_id=user_id,
|
|
83
|
+
code=code,
|
|
84
|
+
password=password,
|
|
85
|
+
request_options=request_options,
|
|
86
|
+
)
|
|
87
|
+
return _response.data
|
|
88
|
+
|
|
89
|
+
def get_config(
|
|
90
|
+
self,
|
|
91
|
+
*,
|
|
92
|
+
request: AuthV1GetAuthConfigRequest,
|
|
93
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
94
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
95
|
+
) -> AuthV1GetAuthConfigResponse:
|
|
96
|
+
"""
|
|
97
|
+
Session; pre-token, public. An empty issuer means auth is disabled.
|
|
98
|
+
|
|
99
|
+
Parameters
|
|
100
|
+
----------
|
|
101
|
+
request : AuthV1GetAuthConfigRequest
|
|
102
|
+
|
|
103
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
104
|
+
Define the timeout, in ms
|
|
105
|
+
|
|
106
|
+
request_options : typing.Optional[RequestOptions]
|
|
107
|
+
Request-specific configuration.
|
|
108
|
+
|
|
109
|
+
Returns
|
|
110
|
+
-------
|
|
111
|
+
AuthV1GetAuthConfigResponse
|
|
112
|
+
Success
|
|
113
|
+
|
|
114
|
+
Examples
|
|
115
|
+
--------
|
|
116
|
+
from alchemy import Alchemy
|
|
117
|
+
|
|
118
|
+
client = Alchemy(
|
|
119
|
+
client_id="YOUR_CLIENT_ID",
|
|
120
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
121
|
+
)
|
|
122
|
+
client.auth.get_config(
|
|
123
|
+
connect_timeout_ms=1000.0,
|
|
124
|
+
request={"key": "value"},
|
|
125
|
+
)
|
|
126
|
+
"""
|
|
127
|
+
_response = self._raw_client.get_config(
|
|
128
|
+
request=request, connect_timeout_ms=connect_timeout_ms, request_options=request_options
|
|
129
|
+
)
|
|
130
|
+
return _response.data
|
|
131
|
+
|
|
132
|
+
def get_session(
|
|
133
|
+
self,
|
|
134
|
+
*,
|
|
135
|
+
request: AuthV1GetSessionRequest,
|
|
136
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
137
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
138
|
+
) -> AuthV1GetSessionResponse:
|
|
139
|
+
"""
|
|
140
|
+
Session; authenticated. The UI's sign-in check.
|
|
141
|
+
|
|
142
|
+
Parameters
|
|
143
|
+
----------
|
|
144
|
+
request : AuthV1GetSessionRequest
|
|
145
|
+
|
|
146
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
147
|
+
Define the timeout, in ms
|
|
148
|
+
|
|
149
|
+
request_options : typing.Optional[RequestOptions]
|
|
150
|
+
Request-specific configuration.
|
|
151
|
+
|
|
152
|
+
Returns
|
|
153
|
+
-------
|
|
154
|
+
AuthV1GetSessionResponse
|
|
155
|
+
Success
|
|
156
|
+
|
|
157
|
+
Examples
|
|
158
|
+
--------
|
|
159
|
+
from alchemy import Alchemy
|
|
160
|
+
|
|
161
|
+
client = Alchemy(
|
|
162
|
+
client_id="YOUR_CLIENT_ID",
|
|
163
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
164
|
+
)
|
|
165
|
+
client.auth.get_session(
|
|
166
|
+
connect_timeout_ms=1000.0,
|
|
167
|
+
request={"key": "value"},
|
|
168
|
+
)
|
|
169
|
+
"""
|
|
170
|
+
_response = self._raw_client.get_session(
|
|
171
|
+
request=request, connect_timeout_ms=connect_timeout_ms, request_options=request_options
|
|
172
|
+
)
|
|
173
|
+
return _response.data
|
|
174
|
+
|
|
175
|
+
def get_token(
|
|
176
|
+
self,
|
|
177
|
+
*,
|
|
178
|
+
client_id: str,
|
|
179
|
+
client_secret: str,
|
|
180
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
181
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
182
|
+
) -> AuthV1GetTokenResponse:
|
|
183
|
+
"""
|
|
184
|
+
Parameters
|
|
185
|
+
----------
|
|
186
|
+
client_id : str
|
|
187
|
+
|
|
188
|
+
client_secret : str
|
|
189
|
+
|
|
190
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
191
|
+
Define the timeout, in ms
|
|
192
|
+
|
|
193
|
+
request_options : typing.Optional[RequestOptions]
|
|
194
|
+
Request-specific configuration.
|
|
195
|
+
|
|
196
|
+
Returns
|
|
197
|
+
-------
|
|
198
|
+
AuthV1GetTokenResponse
|
|
199
|
+
Success
|
|
200
|
+
|
|
201
|
+
Examples
|
|
202
|
+
--------
|
|
203
|
+
from alchemy import Alchemy
|
|
204
|
+
|
|
205
|
+
client = Alchemy(
|
|
206
|
+
client_id="YOUR_CLIENT_ID",
|
|
207
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
208
|
+
)
|
|
209
|
+
client.auth.get_token(
|
|
210
|
+
connect_timeout_ms=1000.0,
|
|
211
|
+
client_id="clientId",
|
|
212
|
+
client_secret="clientSecret",
|
|
213
|
+
)
|
|
214
|
+
"""
|
|
215
|
+
_response = self._raw_client.get_token(
|
|
216
|
+
client_id=client_id,
|
|
217
|
+
client_secret=client_secret,
|
|
218
|
+
connect_timeout_ms=connect_timeout_ms,
|
|
219
|
+
request_options=request_options,
|
|
220
|
+
)
|
|
221
|
+
return _response.data
|
|
222
|
+
|
|
223
|
+
def login(
|
|
224
|
+
self,
|
|
225
|
+
*,
|
|
226
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
227
|
+
login_name: typing.Optional[str] = OMIT,
|
|
228
|
+
password: typing.Optional[str] = OMIT,
|
|
229
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
230
|
+
) -> AuthV1LoginResponse:
|
|
231
|
+
"""
|
|
232
|
+
Parameters
|
|
233
|
+
----------
|
|
234
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
235
|
+
Define the timeout, in ms
|
|
236
|
+
|
|
237
|
+
login_name : typing.Optional[str]
|
|
238
|
+
|
|
239
|
+
password : typing.Optional[str]
|
|
240
|
+
|
|
241
|
+
request_options : typing.Optional[RequestOptions]
|
|
242
|
+
Request-specific configuration.
|
|
243
|
+
|
|
244
|
+
Returns
|
|
245
|
+
-------
|
|
246
|
+
AuthV1LoginResponse
|
|
247
|
+
Success
|
|
248
|
+
|
|
249
|
+
Examples
|
|
250
|
+
--------
|
|
251
|
+
from alchemy import Alchemy
|
|
252
|
+
|
|
253
|
+
client = Alchemy(
|
|
254
|
+
client_id="YOUR_CLIENT_ID",
|
|
255
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
256
|
+
)
|
|
257
|
+
client.auth.login(
|
|
258
|
+
connect_timeout_ms=1000.0,
|
|
259
|
+
)
|
|
260
|
+
"""
|
|
261
|
+
_response = self._raw_client.login(
|
|
262
|
+
connect_timeout_ms=connect_timeout_ms,
|
|
263
|
+
login_name=login_name,
|
|
264
|
+
password=password,
|
|
265
|
+
request_options=request_options,
|
|
266
|
+
)
|
|
267
|
+
return _response.data
|
|
268
|
+
|
|
269
|
+
def logout(
|
|
270
|
+
self,
|
|
271
|
+
*,
|
|
272
|
+
request: AuthV1LogoutRequest,
|
|
273
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
274
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
275
|
+
) -> AuthV1LogoutResponse:
|
|
276
|
+
"""
|
|
277
|
+
Parameters
|
|
278
|
+
----------
|
|
279
|
+
request : AuthV1LogoutRequest
|
|
280
|
+
|
|
281
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
282
|
+
Define the timeout, in ms
|
|
283
|
+
|
|
284
|
+
request_options : typing.Optional[RequestOptions]
|
|
285
|
+
Request-specific configuration.
|
|
286
|
+
|
|
287
|
+
Returns
|
|
288
|
+
-------
|
|
289
|
+
AuthV1LogoutResponse
|
|
290
|
+
Success
|
|
291
|
+
|
|
292
|
+
Examples
|
|
293
|
+
--------
|
|
294
|
+
from alchemy import Alchemy
|
|
295
|
+
|
|
296
|
+
client = Alchemy(
|
|
297
|
+
client_id="YOUR_CLIENT_ID",
|
|
298
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
299
|
+
)
|
|
300
|
+
client.auth.logout(
|
|
301
|
+
connect_timeout_ms=1000.0,
|
|
302
|
+
request={"key": "value"},
|
|
303
|
+
)
|
|
304
|
+
"""
|
|
305
|
+
_response = self._raw_client.logout(
|
|
306
|
+
request=request, connect_timeout_ms=connect_timeout_ms, request_options=request_options
|
|
307
|
+
)
|
|
308
|
+
return _response.data
|
|
309
|
+
|
|
310
|
+
def register(
|
|
311
|
+
self,
|
|
312
|
+
*,
|
|
313
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
314
|
+
org_name: typing.Optional[str] = OMIT,
|
|
315
|
+
given_name: typing.Optional[str] = OMIT,
|
|
316
|
+
family_name: typing.Optional[str] = OMIT,
|
|
317
|
+
email: typing.Optional[str] = OMIT,
|
|
318
|
+
password: typing.Optional[str] = OMIT,
|
|
319
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
320
|
+
) -> AuthV1RegisterResponse:
|
|
321
|
+
"""
|
|
322
|
+
Parameters
|
|
323
|
+
----------
|
|
324
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
325
|
+
Define the timeout, in ms
|
|
326
|
+
|
|
327
|
+
org_name : typing.Optional[str]
|
|
328
|
+
|
|
329
|
+
given_name : typing.Optional[str]
|
|
330
|
+
|
|
331
|
+
family_name : typing.Optional[str]
|
|
332
|
+
|
|
333
|
+
email : typing.Optional[str]
|
|
334
|
+
|
|
335
|
+
password : typing.Optional[str]
|
|
336
|
+
|
|
337
|
+
request_options : typing.Optional[RequestOptions]
|
|
338
|
+
Request-specific configuration.
|
|
339
|
+
|
|
340
|
+
Returns
|
|
341
|
+
-------
|
|
342
|
+
AuthV1RegisterResponse
|
|
343
|
+
Success
|
|
344
|
+
|
|
345
|
+
Examples
|
|
346
|
+
--------
|
|
347
|
+
from alchemy import Alchemy
|
|
348
|
+
|
|
349
|
+
client = Alchemy(
|
|
350
|
+
client_id="YOUR_CLIENT_ID",
|
|
351
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
352
|
+
)
|
|
353
|
+
client.auth.register(
|
|
354
|
+
connect_timeout_ms=1000.0,
|
|
355
|
+
)
|
|
356
|
+
"""
|
|
357
|
+
_response = self._raw_client.register(
|
|
358
|
+
connect_timeout_ms=connect_timeout_ms,
|
|
359
|
+
org_name=org_name,
|
|
360
|
+
given_name=given_name,
|
|
361
|
+
family_name=family_name,
|
|
362
|
+
email=email,
|
|
363
|
+
password=password,
|
|
364
|
+
request_options=request_options,
|
|
365
|
+
)
|
|
366
|
+
return _response.data
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
class AsyncAuthClient:
|
|
370
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
371
|
+
self._raw_client = AsyncRawAuthClient(client_wrapper=client_wrapper)
|
|
372
|
+
|
|
373
|
+
@property
|
|
374
|
+
def with_raw_response(self) -> AsyncRawAuthClient:
|
|
375
|
+
"""
|
|
376
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
377
|
+
|
|
378
|
+
Returns
|
|
379
|
+
-------
|
|
380
|
+
AsyncRawAuthClient
|
|
381
|
+
"""
|
|
382
|
+
return self._raw_client
|
|
383
|
+
|
|
384
|
+
async def accept_invite(
|
|
385
|
+
self,
|
|
386
|
+
*,
|
|
387
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
388
|
+
user_id: typing.Optional[str] = OMIT,
|
|
389
|
+
code: typing.Optional[str] = OMIT,
|
|
390
|
+
password: typing.Optional[str] = OMIT,
|
|
391
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
392
|
+
) -> AuthV1AcceptInviteResponse:
|
|
393
|
+
"""
|
|
394
|
+
Parameters
|
|
395
|
+
----------
|
|
396
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
397
|
+
Define the timeout, in ms
|
|
398
|
+
|
|
399
|
+
user_id : typing.Optional[str]
|
|
400
|
+
|
|
401
|
+
code : typing.Optional[str]
|
|
402
|
+
|
|
403
|
+
password : typing.Optional[str]
|
|
404
|
+
|
|
405
|
+
request_options : typing.Optional[RequestOptions]
|
|
406
|
+
Request-specific configuration.
|
|
407
|
+
|
|
408
|
+
Returns
|
|
409
|
+
-------
|
|
410
|
+
AuthV1AcceptInviteResponse
|
|
411
|
+
Success
|
|
412
|
+
|
|
413
|
+
Examples
|
|
414
|
+
--------
|
|
415
|
+
import asyncio
|
|
416
|
+
|
|
417
|
+
from alchemy import AsyncAlchemy
|
|
418
|
+
|
|
419
|
+
client = AsyncAlchemy(
|
|
420
|
+
client_id="YOUR_CLIENT_ID",
|
|
421
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
422
|
+
)
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
async def main() -> None:
|
|
426
|
+
await client.auth.accept_invite(
|
|
427
|
+
connect_timeout_ms=1000.0,
|
|
428
|
+
)
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
asyncio.run(main())
|
|
432
|
+
"""
|
|
433
|
+
_response = await self._raw_client.accept_invite(
|
|
434
|
+
connect_timeout_ms=connect_timeout_ms,
|
|
435
|
+
user_id=user_id,
|
|
436
|
+
code=code,
|
|
437
|
+
password=password,
|
|
438
|
+
request_options=request_options,
|
|
439
|
+
)
|
|
440
|
+
return _response.data
|
|
441
|
+
|
|
442
|
+
async def get_config(
|
|
443
|
+
self,
|
|
444
|
+
*,
|
|
445
|
+
request: AuthV1GetAuthConfigRequest,
|
|
446
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
447
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
448
|
+
) -> AuthV1GetAuthConfigResponse:
|
|
449
|
+
"""
|
|
450
|
+
Session; pre-token, public. An empty issuer means auth is disabled.
|
|
451
|
+
|
|
452
|
+
Parameters
|
|
453
|
+
----------
|
|
454
|
+
request : AuthV1GetAuthConfigRequest
|
|
455
|
+
|
|
456
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
457
|
+
Define the timeout, in ms
|
|
458
|
+
|
|
459
|
+
request_options : typing.Optional[RequestOptions]
|
|
460
|
+
Request-specific configuration.
|
|
461
|
+
|
|
462
|
+
Returns
|
|
463
|
+
-------
|
|
464
|
+
AuthV1GetAuthConfigResponse
|
|
465
|
+
Success
|
|
466
|
+
|
|
467
|
+
Examples
|
|
468
|
+
--------
|
|
469
|
+
import asyncio
|
|
470
|
+
|
|
471
|
+
from alchemy import AsyncAlchemy
|
|
472
|
+
|
|
473
|
+
client = AsyncAlchemy(
|
|
474
|
+
client_id="YOUR_CLIENT_ID",
|
|
475
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
476
|
+
)
|
|
477
|
+
|
|
478
|
+
|
|
479
|
+
async def main() -> None:
|
|
480
|
+
await client.auth.get_config(
|
|
481
|
+
connect_timeout_ms=1000.0,
|
|
482
|
+
request={"key": "value"},
|
|
483
|
+
)
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
asyncio.run(main())
|
|
487
|
+
"""
|
|
488
|
+
_response = await self._raw_client.get_config(
|
|
489
|
+
request=request, connect_timeout_ms=connect_timeout_ms, request_options=request_options
|
|
490
|
+
)
|
|
491
|
+
return _response.data
|
|
492
|
+
|
|
493
|
+
async def get_session(
|
|
494
|
+
self,
|
|
495
|
+
*,
|
|
496
|
+
request: AuthV1GetSessionRequest,
|
|
497
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
498
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
499
|
+
) -> AuthV1GetSessionResponse:
|
|
500
|
+
"""
|
|
501
|
+
Session; authenticated. The UI's sign-in check.
|
|
502
|
+
|
|
503
|
+
Parameters
|
|
504
|
+
----------
|
|
505
|
+
request : AuthV1GetSessionRequest
|
|
506
|
+
|
|
507
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
508
|
+
Define the timeout, in ms
|
|
509
|
+
|
|
510
|
+
request_options : typing.Optional[RequestOptions]
|
|
511
|
+
Request-specific configuration.
|
|
512
|
+
|
|
513
|
+
Returns
|
|
514
|
+
-------
|
|
515
|
+
AuthV1GetSessionResponse
|
|
516
|
+
Success
|
|
517
|
+
|
|
518
|
+
Examples
|
|
519
|
+
--------
|
|
520
|
+
import asyncio
|
|
521
|
+
|
|
522
|
+
from alchemy import AsyncAlchemy
|
|
523
|
+
|
|
524
|
+
client = AsyncAlchemy(
|
|
525
|
+
client_id="YOUR_CLIENT_ID",
|
|
526
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
527
|
+
)
|
|
528
|
+
|
|
529
|
+
|
|
530
|
+
async def main() -> None:
|
|
531
|
+
await client.auth.get_session(
|
|
532
|
+
connect_timeout_ms=1000.0,
|
|
533
|
+
request={"key": "value"},
|
|
534
|
+
)
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
asyncio.run(main())
|
|
538
|
+
"""
|
|
539
|
+
_response = await self._raw_client.get_session(
|
|
540
|
+
request=request, connect_timeout_ms=connect_timeout_ms, request_options=request_options
|
|
541
|
+
)
|
|
542
|
+
return _response.data
|
|
543
|
+
|
|
544
|
+
async def get_token(
|
|
545
|
+
self,
|
|
546
|
+
*,
|
|
547
|
+
client_id: str,
|
|
548
|
+
client_secret: str,
|
|
549
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
550
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
551
|
+
) -> AuthV1GetTokenResponse:
|
|
552
|
+
"""
|
|
553
|
+
Parameters
|
|
554
|
+
----------
|
|
555
|
+
client_id : str
|
|
556
|
+
|
|
557
|
+
client_secret : str
|
|
558
|
+
|
|
559
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
560
|
+
Define the timeout, in ms
|
|
561
|
+
|
|
562
|
+
request_options : typing.Optional[RequestOptions]
|
|
563
|
+
Request-specific configuration.
|
|
564
|
+
|
|
565
|
+
Returns
|
|
566
|
+
-------
|
|
567
|
+
AuthV1GetTokenResponse
|
|
568
|
+
Success
|
|
569
|
+
|
|
570
|
+
Examples
|
|
571
|
+
--------
|
|
572
|
+
import asyncio
|
|
573
|
+
|
|
574
|
+
from alchemy import AsyncAlchemy
|
|
575
|
+
|
|
576
|
+
client = AsyncAlchemy(
|
|
577
|
+
client_id="YOUR_CLIENT_ID",
|
|
578
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
579
|
+
)
|
|
580
|
+
|
|
581
|
+
|
|
582
|
+
async def main() -> None:
|
|
583
|
+
await client.auth.get_token(
|
|
584
|
+
connect_timeout_ms=1000.0,
|
|
585
|
+
client_id="clientId",
|
|
586
|
+
client_secret="clientSecret",
|
|
587
|
+
)
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
asyncio.run(main())
|
|
591
|
+
"""
|
|
592
|
+
_response = await self._raw_client.get_token(
|
|
593
|
+
client_id=client_id,
|
|
594
|
+
client_secret=client_secret,
|
|
595
|
+
connect_timeout_ms=connect_timeout_ms,
|
|
596
|
+
request_options=request_options,
|
|
597
|
+
)
|
|
598
|
+
return _response.data
|
|
599
|
+
|
|
600
|
+
async def login(
|
|
601
|
+
self,
|
|
602
|
+
*,
|
|
603
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
604
|
+
login_name: typing.Optional[str] = OMIT,
|
|
605
|
+
password: typing.Optional[str] = OMIT,
|
|
606
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
607
|
+
) -> AuthV1LoginResponse:
|
|
608
|
+
"""
|
|
609
|
+
Parameters
|
|
610
|
+
----------
|
|
611
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
612
|
+
Define the timeout, in ms
|
|
613
|
+
|
|
614
|
+
login_name : typing.Optional[str]
|
|
615
|
+
|
|
616
|
+
password : typing.Optional[str]
|
|
617
|
+
|
|
618
|
+
request_options : typing.Optional[RequestOptions]
|
|
619
|
+
Request-specific configuration.
|
|
620
|
+
|
|
621
|
+
Returns
|
|
622
|
+
-------
|
|
623
|
+
AuthV1LoginResponse
|
|
624
|
+
Success
|
|
625
|
+
|
|
626
|
+
Examples
|
|
627
|
+
--------
|
|
628
|
+
import asyncio
|
|
629
|
+
|
|
630
|
+
from alchemy import AsyncAlchemy
|
|
631
|
+
|
|
632
|
+
client = AsyncAlchemy(
|
|
633
|
+
client_id="YOUR_CLIENT_ID",
|
|
634
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
635
|
+
)
|
|
636
|
+
|
|
637
|
+
|
|
638
|
+
async def main() -> None:
|
|
639
|
+
await client.auth.login(
|
|
640
|
+
connect_timeout_ms=1000.0,
|
|
641
|
+
)
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
asyncio.run(main())
|
|
645
|
+
"""
|
|
646
|
+
_response = await self._raw_client.login(
|
|
647
|
+
connect_timeout_ms=connect_timeout_ms,
|
|
648
|
+
login_name=login_name,
|
|
649
|
+
password=password,
|
|
650
|
+
request_options=request_options,
|
|
651
|
+
)
|
|
652
|
+
return _response.data
|
|
653
|
+
|
|
654
|
+
async def logout(
|
|
655
|
+
self,
|
|
656
|
+
*,
|
|
657
|
+
request: AuthV1LogoutRequest,
|
|
658
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
659
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
660
|
+
) -> AuthV1LogoutResponse:
|
|
661
|
+
"""
|
|
662
|
+
Parameters
|
|
663
|
+
----------
|
|
664
|
+
request : AuthV1LogoutRequest
|
|
665
|
+
|
|
666
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
667
|
+
Define the timeout, in ms
|
|
668
|
+
|
|
669
|
+
request_options : typing.Optional[RequestOptions]
|
|
670
|
+
Request-specific configuration.
|
|
671
|
+
|
|
672
|
+
Returns
|
|
673
|
+
-------
|
|
674
|
+
AuthV1LogoutResponse
|
|
675
|
+
Success
|
|
676
|
+
|
|
677
|
+
Examples
|
|
678
|
+
--------
|
|
679
|
+
import asyncio
|
|
680
|
+
|
|
681
|
+
from alchemy import AsyncAlchemy
|
|
682
|
+
|
|
683
|
+
client = AsyncAlchemy(
|
|
684
|
+
client_id="YOUR_CLIENT_ID",
|
|
685
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
686
|
+
)
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
async def main() -> None:
|
|
690
|
+
await client.auth.logout(
|
|
691
|
+
connect_timeout_ms=1000.0,
|
|
692
|
+
request={"key": "value"},
|
|
693
|
+
)
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
asyncio.run(main())
|
|
697
|
+
"""
|
|
698
|
+
_response = await self._raw_client.logout(
|
|
699
|
+
request=request, connect_timeout_ms=connect_timeout_ms, request_options=request_options
|
|
700
|
+
)
|
|
701
|
+
return _response.data
|
|
702
|
+
|
|
703
|
+
async def register(
|
|
704
|
+
self,
|
|
705
|
+
*,
|
|
706
|
+
connect_timeout_ms: typing.Optional[ConnectTimeoutHeader] = None,
|
|
707
|
+
org_name: typing.Optional[str] = OMIT,
|
|
708
|
+
given_name: typing.Optional[str] = OMIT,
|
|
709
|
+
family_name: typing.Optional[str] = OMIT,
|
|
710
|
+
email: typing.Optional[str] = OMIT,
|
|
711
|
+
password: typing.Optional[str] = OMIT,
|
|
712
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
713
|
+
) -> AuthV1RegisterResponse:
|
|
714
|
+
"""
|
|
715
|
+
Parameters
|
|
716
|
+
----------
|
|
717
|
+
connect_timeout_ms : typing.Optional[ConnectTimeoutHeader]
|
|
718
|
+
Define the timeout, in ms
|
|
719
|
+
|
|
720
|
+
org_name : typing.Optional[str]
|
|
721
|
+
|
|
722
|
+
given_name : typing.Optional[str]
|
|
723
|
+
|
|
724
|
+
family_name : typing.Optional[str]
|
|
725
|
+
|
|
726
|
+
email : typing.Optional[str]
|
|
727
|
+
|
|
728
|
+
password : typing.Optional[str]
|
|
729
|
+
|
|
730
|
+
request_options : typing.Optional[RequestOptions]
|
|
731
|
+
Request-specific configuration.
|
|
732
|
+
|
|
733
|
+
Returns
|
|
734
|
+
-------
|
|
735
|
+
AuthV1RegisterResponse
|
|
736
|
+
Success
|
|
737
|
+
|
|
738
|
+
Examples
|
|
739
|
+
--------
|
|
740
|
+
import asyncio
|
|
741
|
+
|
|
742
|
+
from alchemy import AsyncAlchemy
|
|
743
|
+
|
|
744
|
+
client = AsyncAlchemy(
|
|
745
|
+
client_id="YOUR_CLIENT_ID",
|
|
746
|
+
client_secret="YOUR_CLIENT_SECRET",
|
|
747
|
+
)
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
async def main() -> None:
|
|
751
|
+
await client.auth.register(
|
|
752
|
+
connect_timeout_ms=1000.0,
|
|
753
|
+
)
|
|
754
|
+
|
|
755
|
+
|
|
756
|
+
asyncio.run(main())
|
|
757
|
+
"""
|
|
758
|
+
_response = await self._raw_client.register(
|
|
759
|
+
connect_timeout_ms=connect_timeout_ms,
|
|
760
|
+
org_name=org_name,
|
|
761
|
+
given_name=given_name,
|
|
762
|
+
family_name=family_name,
|
|
763
|
+
email=email,
|
|
764
|
+
password=password,
|
|
765
|
+
request_options=request_options,
|
|
766
|
+
)
|
|
767
|
+
return _response.data
|