contextbase-base-client 0.0.0a1__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.
- base_client/.fern/metadata.json +13 -0
- base_client/CONTRIBUTING.md +125 -0
- base_client/README.md +176 -0
- base_client/__init__.py +188 -0
- base_client/_default_clients.py +30 -0
- base_client/bases/__init__.py +34 -0
- base_client/bases/client.py +318 -0
- base_client/bases/raw_client.py +474 -0
- base_client/bases/types/__init__.py +34 -0
- base_client/bases/types/list_bases_response.py +20 -0
- base_client/binding_plan/__init__.py +4 -0
- base_client/binding_plan/client.py +108 -0
- base_client/binding_plan/raw_client.py +128 -0
- base_client/bindings/__init__.py +34 -0
- base_client/bindings/client.py +364 -0
- base_client/bindings/raw_client.py +537 -0
- base_client/bindings/types/__init__.py +34 -0
- base_client/bindings/types/list_bindings_response.py +20 -0
- base_client/client.py +252 -0
- base_client/core/__init__.py +127 -0
- base_client/core/api_error.py +23 -0
- base_client/core/client_wrapper.py +102 -0
- base_client/core/datetime_utils.py +70 -0
- base_client/core/file.py +67 -0
- base_client/core/force_multipart.py +18 -0
- base_client/core/http_client.py +839 -0
- base_client/core/http_response.py +59 -0
- base_client/core/http_sse/__init__.py +42 -0
- base_client/core/http_sse/_api.py +170 -0
- base_client/core/http_sse/_decoders.py +61 -0
- base_client/core/http_sse/_exceptions.py +7 -0
- base_client/core/http_sse/_models.py +17 -0
- base_client/core/jsonable_encoder.py +120 -0
- base_client/core/logging.py +107 -0
- base_client/core/parse_error.py +36 -0
- base_client/core/pydantic_utilities.py +508 -0
- base_client/core/query_encoder.py +58 -0
- base_client/core/remove_none_from_dict.py +11 -0
- base_client/core/request_options.py +35 -0
- base_client/core/serialization.py +347 -0
- base_client/dsn/__init__.py +4 -0
- base_client/dsn/client.py +104 -0
- base_client/dsn/raw_client.py +128 -0
- base_client/errors/__init__.py +40 -0
- base_client/errors/bad_request_error.py +11 -0
- base_client/errors/forbidden_error.py +11 -0
- base_client/errors/not_found_error.py +11 -0
- base_client/reference.md +746 -0
- base_client/sync_state/__init__.py +34 -0
- base_client/sync_state/client.py +206 -0
- base_client/sync_state/raw_client.py +280 -0
- base_client/sync_state/types/__init__.py +34 -0
- base_client/sync_state/types/sync_state_input_bindings_value.py +23 -0
- base_client/tests/conftest.py +21 -0
- base_client/tests/test_aiohttp_autodetect.py +113 -0
- base_client/types/__init__.py +155 -0
- base_client/types/api_key_auth.py +19 -0
- base_client/types/authenticated_account_ref.py +20 -0
- base_client/types/base.py +23 -0
- base_client/types/binding.py +31 -0
- base_client/types/binding_auth.py +72 -0
- base_client/types/binding_auth_input.py +77 -0
- base_client/types/binding_auth_input_api_key.py +19 -0
- base_client/types/binding_auth_input_authenticated_account.py +20 -0
- base_client/types/binding_auth_input_client_credentials.py +20 -0
- base_client/types/binding_auth_input_none.py +17 -0
- base_client/types/binding_auth_none.py +17 -0
- base_client/types/binding_auth_resource.py +75 -0
- base_client/types/binding_auth_resource_api_key.py +17 -0
- base_client/types/binding_auth_resource_authenticated_account.py +20 -0
- base_client/types/binding_auth_resource_client_credentials.py +19 -0
- base_client/types/binding_auth_resource_none.py +17 -0
- base_client/types/binding_models.py +23 -0
- base_client/types/binding_state.py +24 -0
- base_client/types/binding_state_response.py +21 -0
- base_client/types/client_credentials_auth.py +20 -0
- base_client/types/dagster_all_plan_binding.py +27 -0
- base_client/types/dagster_all_plan_binding_mode.py +5 -0
- base_client/types/dagster_binding_plan_all.py +23 -0
- base_client/types/dsn_response.py +19 -0
- base_client/types/error.py +19 -0
- base_client/types/run_status.py +10 -0
- contextbase_base_client-0.0.0a1.dist-info/METADATA +10 -0
- contextbase_base_client-0.0.0a1.dist-info/RECORD +85 -0
- contextbase_base_client-0.0.0a1.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
from json.decoder import JSONDecodeError
|
|
5
|
+
|
|
6
|
+
from ..core.api_error import ApiError
|
|
7
|
+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
|
8
|
+
from ..core.http_response import AsyncHttpResponse, HttpResponse
|
|
9
|
+
from ..core.jsonable_encoder import encode_path_param
|
|
10
|
+
from ..core.parse_error import ParsingError
|
|
11
|
+
from ..core.pydantic_utilities import parse_obj_as
|
|
12
|
+
from ..core.request_options import RequestOptions
|
|
13
|
+
from ..errors.bad_request_error import BadRequestError
|
|
14
|
+
from ..errors.forbidden_error import ForbiddenError
|
|
15
|
+
from ..errors.not_found_error import NotFoundError
|
|
16
|
+
from ..types.base import Base
|
|
17
|
+
from ..types.error import Error
|
|
18
|
+
from .types.list_bases_response import ListBasesResponse
|
|
19
|
+
from pydantic import ValidationError
|
|
20
|
+
|
|
21
|
+
# this is used as the default value for optional parameters
|
|
22
|
+
OMIT = typing.cast(typing.Any, ...)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class RawBasesClient:
|
|
26
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
27
|
+
self._client_wrapper = client_wrapper
|
|
28
|
+
|
|
29
|
+
def list_bases(self, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[ListBasesResponse]:
|
|
30
|
+
"""
|
|
31
|
+
Parameters
|
|
32
|
+
----------
|
|
33
|
+
request_options : typing.Optional[RequestOptions]
|
|
34
|
+
Request-specific configuration.
|
|
35
|
+
|
|
36
|
+
Returns
|
|
37
|
+
-------
|
|
38
|
+
HttpResponse[ListBasesResponse]
|
|
39
|
+
The caller's bases (a machine caller, as deployment-root, gets the full list).
|
|
40
|
+
"""
|
|
41
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
42
|
+
"base/bases",
|
|
43
|
+
method="GET",
|
|
44
|
+
request_options=request_options,
|
|
45
|
+
)
|
|
46
|
+
try:
|
|
47
|
+
if 200 <= _response.status_code < 300:
|
|
48
|
+
_data = typing.cast(
|
|
49
|
+
ListBasesResponse,
|
|
50
|
+
parse_obj_as(
|
|
51
|
+
type_=ListBasesResponse, # type: ignore
|
|
52
|
+
object_=_response.json(),
|
|
53
|
+
),
|
|
54
|
+
)
|
|
55
|
+
return HttpResponse(response=_response, data=_data)
|
|
56
|
+
_response_json = _response.json()
|
|
57
|
+
except JSONDecodeError:
|
|
58
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
59
|
+
except ValidationError as e:
|
|
60
|
+
raise ParsingError(
|
|
61
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
62
|
+
)
|
|
63
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
64
|
+
|
|
65
|
+
def create_base(
|
|
66
|
+
self,
|
|
67
|
+
*,
|
|
68
|
+
dsn_secret: str,
|
|
69
|
+
name: str,
|
|
70
|
+
owner_user_id: typing.Optional[str] = OMIT,
|
|
71
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
72
|
+
) -> HttpResponse[Base]:
|
|
73
|
+
"""
|
|
74
|
+
Parameters
|
|
75
|
+
----------
|
|
76
|
+
dsn_secret : str
|
|
77
|
+
|
|
78
|
+
name : str
|
|
79
|
+
|
|
80
|
+
owner_user_id : typing.Optional[str]
|
|
81
|
+
|
|
82
|
+
request_options : typing.Optional[RequestOptions]
|
|
83
|
+
Request-specific configuration.
|
|
84
|
+
|
|
85
|
+
Returns
|
|
86
|
+
-------
|
|
87
|
+
HttpResponse[Base]
|
|
88
|
+
The created base.
|
|
89
|
+
"""
|
|
90
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
91
|
+
"base/bases",
|
|
92
|
+
method="POST",
|
|
93
|
+
json={
|
|
94
|
+
"dsn_secret": dsn_secret,
|
|
95
|
+
"name": name,
|
|
96
|
+
"owner_user_id": owner_user_id,
|
|
97
|
+
},
|
|
98
|
+
headers={
|
|
99
|
+
"content-type": "application/json",
|
|
100
|
+
},
|
|
101
|
+
request_options=request_options,
|
|
102
|
+
omit=OMIT,
|
|
103
|
+
)
|
|
104
|
+
try:
|
|
105
|
+
if 200 <= _response.status_code < 300:
|
|
106
|
+
_data = typing.cast(
|
|
107
|
+
Base,
|
|
108
|
+
parse_obj_as(
|
|
109
|
+
type_=Base, # type: ignore
|
|
110
|
+
object_=_response.json(),
|
|
111
|
+
),
|
|
112
|
+
)
|
|
113
|
+
return HttpResponse(response=_response, data=_data)
|
|
114
|
+
if _response.status_code == 400:
|
|
115
|
+
raise BadRequestError(
|
|
116
|
+
headers=dict(_response.headers),
|
|
117
|
+
body=typing.cast(
|
|
118
|
+
Error,
|
|
119
|
+
parse_obj_as(
|
|
120
|
+
type_=Error, # type: ignore
|
|
121
|
+
object_=_response.json(),
|
|
122
|
+
),
|
|
123
|
+
),
|
|
124
|
+
)
|
|
125
|
+
if _response.status_code == 403:
|
|
126
|
+
raise ForbiddenError(
|
|
127
|
+
headers=dict(_response.headers),
|
|
128
|
+
body=typing.cast(
|
|
129
|
+
Error,
|
|
130
|
+
parse_obj_as(
|
|
131
|
+
type_=Error, # type: ignore
|
|
132
|
+
object_=_response.json(),
|
|
133
|
+
),
|
|
134
|
+
),
|
|
135
|
+
)
|
|
136
|
+
_response_json = _response.json()
|
|
137
|
+
except JSONDecodeError:
|
|
138
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
139
|
+
except ValidationError as e:
|
|
140
|
+
raise ParsingError(
|
|
141
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
142
|
+
)
|
|
143
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
144
|
+
|
|
145
|
+
def get_base(self, base_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> HttpResponse[Base]:
|
|
146
|
+
"""
|
|
147
|
+
Parameters
|
|
148
|
+
----------
|
|
149
|
+
base_id : str
|
|
150
|
+
|
|
151
|
+
request_options : typing.Optional[RequestOptions]
|
|
152
|
+
Request-specific configuration.
|
|
153
|
+
|
|
154
|
+
Returns
|
|
155
|
+
-------
|
|
156
|
+
HttpResponse[Base]
|
|
157
|
+
The base.
|
|
158
|
+
"""
|
|
159
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
160
|
+
f"base/bases/{encode_path_param(base_id)}",
|
|
161
|
+
method="GET",
|
|
162
|
+
request_options=request_options,
|
|
163
|
+
)
|
|
164
|
+
try:
|
|
165
|
+
if 200 <= _response.status_code < 300:
|
|
166
|
+
_data = typing.cast(
|
|
167
|
+
Base,
|
|
168
|
+
parse_obj_as(
|
|
169
|
+
type_=Base, # type: ignore
|
|
170
|
+
object_=_response.json(),
|
|
171
|
+
),
|
|
172
|
+
)
|
|
173
|
+
return HttpResponse(response=_response, data=_data)
|
|
174
|
+
if _response.status_code == 403:
|
|
175
|
+
raise ForbiddenError(
|
|
176
|
+
headers=dict(_response.headers),
|
|
177
|
+
body=typing.cast(
|
|
178
|
+
Error,
|
|
179
|
+
parse_obj_as(
|
|
180
|
+
type_=Error, # type: ignore
|
|
181
|
+
object_=_response.json(),
|
|
182
|
+
),
|
|
183
|
+
),
|
|
184
|
+
)
|
|
185
|
+
_response_json = _response.json()
|
|
186
|
+
except JSONDecodeError:
|
|
187
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
188
|
+
except ValidationError as e:
|
|
189
|
+
raise ParsingError(
|
|
190
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
191
|
+
)
|
|
192
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
193
|
+
|
|
194
|
+
def delete_base(
|
|
195
|
+
self, base_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
196
|
+
) -> HttpResponse[None]:
|
|
197
|
+
"""
|
|
198
|
+
Parameters
|
|
199
|
+
----------
|
|
200
|
+
base_id : str
|
|
201
|
+
|
|
202
|
+
request_options : typing.Optional[RequestOptions]
|
|
203
|
+
Request-specific configuration.
|
|
204
|
+
|
|
205
|
+
Returns
|
|
206
|
+
-------
|
|
207
|
+
HttpResponse[None]
|
|
208
|
+
"""
|
|
209
|
+
_response = self._client_wrapper.httpx_client.request(
|
|
210
|
+
f"base/bases/{encode_path_param(base_id)}",
|
|
211
|
+
method="DELETE",
|
|
212
|
+
request_options=request_options,
|
|
213
|
+
)
|
|
214
|
+
try:
|
|
215
|
+
if 200 <= _response.status_code < 300:
|
|
216
|
+
return HttpResponse(response=_response, data=None)
|
|
217
|
+
if _response.status_code == 403:
|
|
218
|
+
raise ForbiddenError(
|
|
219
|
+
headers=dict(_response.headers),
|
|
220
|
+
body=typing.cast(
|
|
221
|
+
Error,
|
|
222
|
+
parse_obj_as(
|
|
223
|
+
type_=Error, # type: ignore
|
|
224
|
+
object_=_response.json(),
|
|
225
|
+
),
|
|
226
|
+
),
|
|
227
|
+
)
|
|
228
|
+
if _response.status_code == 404:
|
|
229
|
+
raise NotFoundError(
|
|
230
|
+
headers=dict(_response.headers),
|
|
231
|
+
body=typing.cast(
|
|
232
|
+
Error,
|
|
233
|
+
parse_obj_as(
|
|
234
|
+
type_=Error, # type: ignore
|
|
235
|
+
object_=_response.json(),
|
|
236
|
+
),
|
|
237
|
+
),
|
|
238
|
+
)
|
|
239
|
+
_response_json = _response.json()
|
|
240
|
+
except JSONDecodeError:
|
|
241
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
242
|
+
except ValidationError as e:
|
|
243
|
+
raise ParsingError(
|
|
244
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
245
|
+
)
|
|
246
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
class AsyncRawBasesClient:
|
|
250
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
251
|
+
self._client_wrapper = client_wrapper
|
|
252
|
+
|
|
253
|
+
async def list_bases(
|
|
254
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
|
255
|
+
) -> AsyncHttpResponse[ListBasesResponse]:
|
|
256
|
+
"""
|
|
257
|
+
Parameters
|
|
258
|
+
----------
|
|
259
|
+
request_options : typing.Optional[RequestOptions]
|
|
260
|
+
Request-specific configuration.
|
|
261
|
+
|
|
262
|
+
Returns
|
|
263
|
+
-------
|
|
264
|
+
AsyncHttpResponse[ListBasesResponse]
|
|
265
|
+
The caller's bases (a machine caller, as deployment-root, gets the full list).
|
|
266
|
+
"""
|
|
267
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
268
|
+
"base/bases",
|
|
269
|
+
method="GET",
|
|
270
|
+
request_options=request_options,
|
|
271
|
+
)
|
|
272
|
+
try:
|
|
273
|
+
if 200 <= _response.status_code < 300:
|
|
274
|
+
_data = typing.cast(
|
|
275
|
+
ListBasesResponse,
|
|
276
|
+
parse_obj_as(
|
|
277
|
+
type_=ListBasesResponse, # type: ignore
|
|
278
|
+
object_=_response.json(),
|
|
279
|
+
),
|
|
280
|
+
)
|
|
281
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
282
|
+
_response_json = _response.json()
|
|
283
|
+
except JSONDecodeError:
|
|
284
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
285
|
+
except ValidationError as e:
|
|
286
|
+
raise ParsingError(
|
|
287
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
288
|
+
)
|
|
289
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
290
|
+
|
|
291
|
+
async def create_base(
|
|
292
|
+
self,
|
|
293
|
+
*,
|
|
294
|
+
dsn_secret: str,
|
|
295
|
+
name: str,
|
|
296
|
+
owner_user_id: typing.Optional[str] = OMIT,
|
|
297
|
+
request_options: typing.Optional[RequestOptions] = None,
|
|
298
|
+
) -> AsyncHttpResponse[Base]:
|
|
299
|
+
"""
|
|
300
|
+
Parameters
|
|
301
|
+
----------
|
|
302
|
+
dsn_secret : str
|
|
303
|
+
|
|
304
|
+
name : str
|
|
305
|
+
|
|
306
|
+
owner_user_id : typing.Optional[str]
|
|
307
|
+
|
|
308
|
+
request_options : typing.Optional[RequestOptions]
|
|
309
|
+
Request-specific configuration.
|
|
310
|
+
|
|
311
|
+
Returns
|
|
312
|
+
-------
|
|
313
|
+
AsyncHttpResponse[Base]
|
|
314
|
+
The created base.
|
|
315
|
+
"""
|
|
316
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
317
|
+
"base/bases",
|
|
318
|
+
method="POST",
|
|
319
|
+
json={
|
|
320
|
+
"dsn_secret": dsn_secret,
|
|
321
|
+
"name": name,
|
|
322
|
+
"owner_user_id": owner_user_id,
|
|
323
|
+
},
|
|
324
|
+
headers={
|
|
325
|
+
"content-type": "application/json",
|
|
326
|
+
},
|
|
327
|
+
request_options=request_options,
|
|
328
|
+
omit=OMIT,
|
|
329
|
+
)
|
|
330
|
+
try:
|
|
331
|
+
if 200 <= _response.status_code < 300:
|
|
332
|
+
_data = typing.cast(
|
|
333
|
+
Base,
|
|
334
|
+
parse_obj_as(
|
|
335
|
+
type_=Base, # type: ignore
|
|
336
|
+
object_=_response.json(),
|
|
337
|
+
),
|
|
338
|
+
)
|
|
339
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
340
|
+
if _response.status_code == 400:
|
|
341
|
+
raise BadRequestError(
|
|
342
|
+
headers=dict(_response.headers),
|
|
343
|
+
body=typing.cast(
|
|
344
|
+
Error,
|
|
345
|
+
parse_obj_as(
|
|
346
|
+
type_=Error, # type: ignore
|
|
347
|
+
object_=_response.json(),
|
|
348
|
+
),
|
|
349
|
+
),
|
|
350
|
+
)
|
|
351
|
+
if _response.status_code == 403:
|
|
352
|
+
raise ForbiddenError(
|
|
353
|
+
headers=dict(_response.headers),
|
|
354
|
+
body=typing.cast(
|
|
355
|
+
Error,
|
|
356
|
+
parse_obj_as(
|
|
357
|
+
type_=Error, # type: ignore
|
|
358
|
+
object_=_response.json(),
|
|
359
|
+
),
|
|
360
|
+
),
|
|
361
|
+
)
|
|
362
|
+
_response_json = _response.json()
|
|
363
|
+
except JSONDecodeError:
|
|
364
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
365
|
+
except ValidationError as e:
|
|
366
|
+
raise ParsingError(
|
|
367
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
368
|
+
)
|
|
369
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
370
|
+
|
|
371
|
+
async def get_base(
|
|
372
|
+
self, base_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
373
|
+
) -> AsyncHttpResponse[Base]:
|
|
374
|
+
"""
|
|
375
|
+
Parameters
|
|
376
|
+
----------
|
|
377
|
+
base_id : str
|
|
378
|
+
|
|
379
|
+
request_options : typing.Optional[RequestOptions]
|
|
380
|
+
Request-specific configuration.
|
|
381
|
+
|
|
382
|
+
Returns
|
|
383
|
+
-------
|
|
384
|
+
AsyncHttpResponse[Base]
|
|
385
|
+
The base.
|
|
386
|
+
"""
|
|
387
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
388
|
+
f"base/bases/{encode_path_param(base_id)}",
|
|
389
|
+
method="GET",
|
|
390
|
+
request_options=request_options,
|
|
391
|
+
)
|
|
392
|
+
try:
|
|
393
|
+
if 200 <= _response.status_code < 300:
|
|
394
|
+
_data = typing.cast(
|
|
395
|
+
Base,
|
|
396
|
+
parse_obj_as(
|
|
397
|
+
type_=Base, # type: ignore
|
|
398
|
+
object_=_response.json(),
|
|
399
|
+
),
|
|
400
|
+
)
|
|
401
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
|
402
|
+
if _response.status_code == 403:
|
|
403
|
+
raise ForbiddenError(
|
|
404
|
+
headers=dict(_response.headers),
|
|
405
|
+
body=typing.cast(
|
|
406
|
+
Error,
|
|
407
|
+
parse_obj_as(
|
|
408
|
+
type_=Error, # type: ignore
|
|
409
|
+
object_=_response.json(),
|
|
410
|
+
),
|
|
411
|
+
),
|
|
412
|
+
)
|
|
413
|
+
_response_json = _response.json()
|
|
414
|
+
except JSONDecodeError:
|
|
415
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
416
|
+
except ValidationError as e:
|
|
417
|
+
raise ParsingError(
|
|
418
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
419
|
+
)
|
|
420
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
421
|
+
|
|
422
|
+
async def delete_base(
|
|
423
|
+
self, base_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
424
|
+
) -> AsyncHttpResponse[None]:
|
|
425
|
+
"""
|
|
426
|
+
Parameters
|
|
427
|
+
----------
|
|
428
|
+
base_id : str
|
|
429
|
+
|
|
430
|
+
request_options : typing.Optional[RequestOptions]
|
|
431
|
+
Request-specific configuration.
|
|
432
|
+
|
|
433
|
+
Returns
|
|
434
|
+
-------
|
|
435
|
+
AsyncHttpResponse[None]
|
|
436
|
+
"""
|
|
437
|
+
_response = await self._client_wrapper.httpx_client.request(
|
|
438
|
+
f"base/bases/{encode_path_param(base_id)}",
|
|
439
|
+
method="DELETE",
|
|
440
|
+
request_options=request_options,
|
|
441
|
+
)
|
|
442
|
+
try:
|
|
443
|
+
if 200 <= _response.status_code < 300:
|
|
444
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
445
|
+
if _response.status_code == 403:
|
|
446
|
+
raise ForbiddenError(
|
|
447
|
+
headers=dict(_response.headers),
|
|
448
|
+
body=typing.cast(
|
|
449
|
+
Error,
|
|
450
|
+
parse_obj_as(
|
|
451
|
+
type_=Error, # type: ignore
|
|
452
|
+
object_=_response.json(),
|
|
453
|
+
),
|
|
454
|
+
),
|
|
455
|
+
)
|
|
456
|
+
if _response.status_code == 404:
|
|
457
|
+
raise NotFoundError(
|
|
458
|
+
headers=dict(_response.headers),
|
|
459
|
+
body=typing.cast(
|
|
460
|
+
Error,
|
|
461
|
+
parse_obj_as(
|
|
462
|
+
type_=Error, # type: ignore
|
|
463
|
+
object_=_response.json(),
|
|
464
|
+
),
|
|
465
|
+
),
|
|
466
|
+
)
|
|
467
|
+
_response_json = _response.json()
|
|
468
|
+
except JSONDecodeError:
|
|
469
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
|
470
|
+
except ValidationError as e:
|
|
471
|
+
raise ParsingError(
|
|
472
|
+
status_code=_response.status_code, headers=dict(_response.headers), body=_response.json(), cause=e
|
|
473
|
+
)
|
|
474
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
# isort: skip_file
|
|
4
|
+
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
7
|
+
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .list_bases_response import ListBasesResponse
|
|
10
|
+
_dynamic_imports: typing.Dict[str, str] = {"ListBasesResponse": ".list_bases_response"}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
14
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
15
|
+
if module_name is None:
|
|
16
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
17
|
+
try:
|
|
18
|
+
module = import_module(module_name, __package__)
|
|
19
|
+
if module_name == f".{attr_name}":
|
|
20
|
+
return module
|
|
21
|
+
else:
|
|
22
|
+
return getattr(module, attr_name)
|
|
23
|
+
except ImportError as e:
|
|
24
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
25
|
+
except AttributeError as e:
|
|
26
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def __dir__():
|
|
30
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
31
|
+
return sorted(lazy_attrs)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
__all__ = ["ListBasesResponse"]
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
|
|
3
|
+
import typing
|
|
4
|
+
|
|
5
|
+
import pydantic
|
|
6
|
+
from ...core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel
|
|
7
|
+
from ...types.base import Base
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class ListBasesResponse(UniversalBaseModel):
|
|
11
|
+
bases: typing.List[Base]
|
|
12
|
+
|
|
13
|
+
if IS_PYDANTIC_V2:
|
|
14
|
+
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2
|
|
15
|
+
else:
|
|
16
|
+
|
|
17
|
+
class Config:
|
|
18
|
+
frozen = True
|
|
19
|
+
smart_union = True
|
|
20
|
+
extra = pydantic.Extra.allow
|
|
@@ -0,0 +1,108 @@
|
|
|
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.dagster_binding_plan_all import DagsterBindingPlanAll
|
|
8
|
+
from .raw_client import AsyncRawBindingPlanClient, RawBindingPlanClient
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class BindingPlanClient:
|
|
12
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
13
|
+
self._raw_client = RawBindingPlanClient(client_wrapper=client_wrapper)
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def with_raw_response(self) -> RawBindingPlanClient:
|
|
17
|
+
"""
|
|
18
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
19
|
+
|
|
20
|
+
Returns
|
|
21
|
+
-------
|
|
22
|
+
RawBindingPlanClient
|
|
23
|
+
"""
|
|
24
|
+
return self._raw_client
|
|
25
|
+
|
|
26
|
+
def get_binding_plan(
|
|
27
|
+
self, base_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
28
|
+
) -> DagsterBindingPlanAll:
|
|
29
|
+
"""
|
|
30
|
+
Parameters
|
|
31
|
+
----------
|
|
32
|
+
base_id : str
|
|
33
|
+
|
|
34
|
+
request_options : typing.Optional[RequestOptions]
|
|
35
|
+
Request-specific configuration.
|
|
36
|
+
|
|
37
|
+
Returns
|
|
38
|
+
-------
|
|
39
|
+
DagsterBindingPlanAll
|
|
40
|
+
Dagster binding plan (enabled bindings, secrets resolved).
|
|
41
|
+
|
|
42
|
+
Examples
|
|
43
|
+
--------
|
|
44
|
+
from base_client import BaseAPIClient
|
|
45
|
+
|
|
46
|
+
client = BaseAPIClient(
|
|
47
|
+
base_url="https://yourhost.com/path/to/api",
|
|
48
|
+
)
|
|
49
|
+
client.binding_plan.get_binding_plan(
|
|
50
|
+
base_id="base_id",
|
|
51
|
+
)
|
|
52
|
+
"""
|
|
53
|
+
_response = self._raw_client.get_binding_plan(base_id, request_options=request_options)
|
|
54
|
+
return _response.data
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
class AsyncBindingPlanClient:
|
|
58
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
59
|
+
self._raw_client = AsyncRawBindingPlanClient(client_wrapper=client_wrapper)
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def with_raw_response(self) -> AsyncRawBindingPlanClient:
|
|
63
|
+
"""
|
|
64
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
|
65
|
+
|
|
66
|
+
Returns
|
|
67
|
+
-------
|
|
68
|
+
AsyncRawBindingPlanClient
|
|
69
|
+
"""
|
|
70
|
+
return self._raw_client
|
|
71
|
+
|
|
72
|
+
async def get_binding_plan(
|
|
73
|
+
self, base_id: str, *, request_options: typing.Optional[RequestOptions] = None
|
|
74
|
+
) -> DagsterBindingPlanAll:
|
|
75
|
+
"""
|
|
76
|
+
Parameters
|
|
77
|
+
----------
|
|
78
|
+
base_id : str
|
|
79
|
+
|
|
80
|
+
request_options : typing.Optional[RequestOptions]
|
|
81
|
+
Request-specific configuration.
|
|
82
|
+
|
|
83
|
+
Returns
|
|
84
|
+
-------
|
|
85
|
+
DagsterBindingPlanAll
|
|
86
|
+
Dagster binding plan (enabled bindings, secrets resolved).
|
|
87
|
+
|
|
88
|
+
Examples
|
|
89
|
+
--------
|
|
90
|
+
import asyncio
|
|
91
|
+
|
|
92
|
+
from base_client import AsyncBaseAPIClient
|
|
93
|
+
|
|
94
|
+
client = AsyncBaseAPIClient(
|
|
95
|
+
base_url="https://yourhost.com/path/to/api",
|
|
96
|
+
)
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
async def main() -> None:
|
|
100
|
+
await client.binding_plan.get_binding_plan(
|
|
101
|
+
base_id="base_id",
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
asyncio.run(main())
|
|
106
|
+
"""
|
|
107
|
+
_response = await self._raw_client.get_binding_plan(base_id, request_options=request_options)
|
|
108
|
+
return _response.data
|