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.
Files changed (85) hide show
  1. base_client/.fern/metadata.json +13 -0
  2. base_client/CONTRIBUTING.md +125 -0
  3. base_client/README.md +176 -0
  4. base_client/__init__.py +188 -0
  5. base_client/_default_clients.py +30 -0
  6. base_client/bases/__init__.py +34 -0
  7. base_client/bases/client.py +318 -0
  8. base_client/bases/raw_client.py +474 -0
  9. base_client/bases/types/__init__.py +34 -0
  10. base_client/bases/types/list_bases_response.py +20 -0
  11. base_client/binding_plan/__init__.py +4 -0
  12. base_client/binding_plan/client.py +108 -0
  13. base_client/binding_plan/raw_client.py +128 -0
  14. base_client/bindings/__init__.py +34 -0
  15. base_client/bindings/client.py +364 -0
  16. base_client/bindings/raw_client.py +537 -0
  17. base_client/bindings/types/__init__.py +34 -0
  18. base_client/bindings/types/list_bindings_response.py +20 -0
  19. base_client/client.py +252 -0
  20. base_client/core/__init__.py +127 -0
  21. base_client/core/api_error.py +23 -0
  22. base_client/core/client_wrapper.py +102 -0
  23. base_client/core/datetime_utils.py +70 -0
  24. base_client/core/file.py +67 -0
  25. base_client/core/force_multipart.py +18 -0
  26. base_client/core/http_client.py +839 -0
  27. base_client/core/http_response.py +59 -0
  28. base_client/core/http_sse/__init__.py +42 -0
  29. base_client/core/http_sse/_api.py +170 -0
  30. base_client/core/http_sse/_decoders.py +61 -0
  31. base_client/core/http_sse/_exceptions.py +7 -0
  32. base_client/core/http_sse/_models.py +17 -0
  33. base_client/core/jsonable_encoder.py +120 -0
  34. base_client/core/logging.py +107 -0
  35. base_client/core/parse_error.py +36 -0
  36. base_client/core/pydantic_utilities.py +508 -0
  37. base_client/core/query_encoder.py +58 -0
  38. base_client/core/remove_none_from_dict.py +11 -0
  39. base_client/core/request_options.py +35 -0
  40. base_client/core/serialization.py +347 -0
  41. base_client/dsn/__init__.py +4 -0
  42. base_client/dsn/client.py +104 -0
  43. base_client/dsn/raw_client.py +128 -0
  44. base_client/errors/__init__.py +40 -0
  45. base_client/errors/bad_request_error.py +11 -0
  46. base_client/errors/forbidden_error.py +11 -0
  47. base_client/errors/not_found_error.py +11 -0
  48. base_client/reference.md +746 -0
  49. base_client/sync_state/__init__.py +34 -0
  50. base_client/sync_state/client.py +206 -0
  51. base_client/sync_state/raw_client.py +280 -0
  52. base_client/sync_state/types/__init__.py +34 -0
  53. base_client/sync_state/types/sync_state_input_bindings_value.py +23 -0
  54. base_client/tests/conftest.py +21 -0
  55. base_client/tests/test_aiohttp_autodetect.py +113 -0
  56. base_client/types/__init__.py +155 -0
  57. base_client/types/api_key_auth.py +19 -0
  58. base_client/types/authenticated_account_ref.py +20 -0
  59. base_client/types/base.py +23 -0
  60. base_client/types/binding.py +31 -0
  61. base_client/types/binding_auth.py +72 -0
  62. base_client/types/binding_auth_input.py +77 -0
  63. base_client/types/binding_auth_input_api_key.py +19 -0
  64. base_client/types/binding_auth_input_authenticated_account.py +20 -0
  65. base_client/types/binding_auth_input_client_credentials.py +20 -0
  66. base_client/types/binding_auth_input_none.py +17 -0
  67. base_client/types/binding_auth_none.py +17 -0
  68. base_client/types/binding_auth_resource.py +75 -0
  69. base_client/types/binding_auth_resource_api_key.py +17 -0
  70. base_client/types/binding_auth_resource_authenticated_account.py +20 -0
  71. base_client/types/binding_auth_resource_client_credentials.py +19 -0
  72. base_client/types/binding_auth_resource_none.py +17 -0
  73. base_client/types/binding_models.py +23 -0
  74. base_client/types/binding_state.py +24 -0
  75. base_client/types/binding_state_response.py +21 -0
  76. base_client/types/client_credentials_auth.py +20 -0
  77. base_client/types/dagster_all_plan_binding.py +27 -0
  78. base_client/types/dagster_all_plan_binding_mode.py +5 -0
  79. base_client/types/dagster_binding_plan_all.py +23 -0
  80. base_client/types/dsn_response.py +19 -0
  81. base_client/types/error.py +19 -0
  82. base_client/types/run_status.py +10 -0
  83. contextbase_base_client-0.0.0a1.dist-info/METADATA +10 -0
  84. contextbase_base_client-0.0.0a1.dist-info/RECORD +85 -0
  85. contextbase_base_client-0.0.0a1.dist-info/WHEEL +4 -0
@@ -0,0 +1,318 @@
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.base import Base
8
+ from .raw_client import AsyncRawBasesClient, RawBasesClient
9
+ from .types.list_bases_response import ListBasesResponse
10
+
11
+ # this is used as the default value for optional parameters
12
+ OMIT = typing.cast(typing.Any, ...)
13
+
14
+
15
+ class BasesClient:
16
+ def __init__(self, *, client_wrapper: SyncClientWrapper):
17
+ self._raw_client = RawBasesClient(client_wrapper=client_wrapper)
18
+
19
+ @property
20
+ def with_raw_response(self) -> RawBasesClient:
21
+ """
22
+ Retrieves a raw implementation of this client that returns raw responses.
23
+
24
+ Returns
25
+ -------
26
+ RawBasesClient
27
+ """
28
+ return self._raw_client
29
+
30
+ def list_bases(self, *, request_options: typing.Optional[RequestOptions] = None) -> ListBasesResponse:
31
+ """
32
+ Parameters
33
+ ----------
34
+ request_options : typing.Optional[RequestOptions]
35
+ Request-specific configuration.
36
+
37
+ Returns
38
+ -------
39
+ ListBasesResponse
40
+ The caller's bases (a machine caller, as deployment-root, gets the full list).
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.bases.list_bases()
50
+ """
51
+ _response = self._raw_client.list_bases(request_options=request_options)
52
+ return _response.data
53
+
54
+ def create_base(
55
+ self,
56
+ *,
57
+ dsn_secret: str,
58
+ name: str,
59
+ owner_user_id: typing.Optional[str] = OMIT,
60
+ request_options: typing.Optional[RequestOptions] = None,
61
+ ) -> Base:
62
+ """
63
+ Parameters
64
+ ----------
65
+ dsn_secret : str
66
+
67
+ name : str
68
+
69
+ owner_user_id : typing.Optional[str]
70
+
71
+ request_options : typing.Optional[RequestOptions]
72
+ Request-specific configuration.
73
+
74
+ Returns
75
+ -------
76
+ Base
77
+ The created base.
78
+
79
+ Examples
80
+ --------
81
+ from base_client import BaseAPIClient
82
+
83
+ client = BaseAPIClient(
84
+ base_url="https://yourhost.com/path/to/api",
85
+ )
86
+ client.bases.create_base(
87
+ dsn_secret="dsn_secret",
88
+ name="name",
89
+ )
90
+ """
91
+ _response = self._raw_client.create_base(
92
+ dsn_secret=dsn_secret, name=name, owner_user_id=owner_user_id, request_options=request_options
93
+ )
94
+ return _response.data
95
+
96
+ def get_base(self, base_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Base:
97
+ """
98
+ Parameters
99
+ ----------
100
+ base_id : str
101
+
102
+ request_options : typing.Optional[RequestOptions]
103
+ Request-specific configuration.
104
+
105
+ Returns
106
+ -------
107
+ Base
108
+ The base.
109
+
110
+ Examples
111
+ --------
112
+ from base_client import BaseAPIClient
113
+
114
+ client = BaseAPIClient(
115
+ base_url="https://yourhost.com/path/to/api",
116
+ )
117
+ client.bases.get_base(
118
+ base_id="base_id",
119
+ )
120
+ """
121
+ _response = self._raw_client.get_base(base_id, request_options=request_options)
122
+ return _response.data
123
+
124
+ def delete_base(self, base_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
125
+ """
126
+ Parameters
127
+ ----------
128
+ base_id : str
129
+
130
+ request_options : typing.Optional[RequestOptions]
131
+ Request-specific configuration.
132
+
133
+ Returns
134
+ -------
135
+ None
136
+
137
+ Examples
138
+ --------
139
+ from base_client import BaseAPIClient
140
+
141
+ client = BaseAPIClient(
142
+ base_url="https://yourhost.com/path/to/api",
143
+ )
144
+ client.bases.delete_base(
145
+ base_id="base_id",
146
+ )
147
+ """
148
+ _response = self._raw_client.delete_base(base_id, request_options=request_options)
149
+ return _response.data
150
+
151
+
152
+ class AsyncBasesClient:
153
+ def __init__(self, *, client_wrapper: AsyncClientWrapper):
154
+ self._raw_client = AsyncRawBasesClient(client_wrapper=client_wrapper)
155
+
156
+ @property
157
+ def with_raw_response(self) -> AsyncRawBasesClient:
158
+ """
159
+ Retrieves a raw implementation of this client that returns raw responses.
160
+
161
+ Returns
162
+ -------
163
+ AsyncRawBasesClient
164
+ """
165
+ return self._raw_client
166
+
167
+ async def list_bases(self, *, request_options: typing.Optional[RequestOptions] = None) -> ListBasesResponse:
168
+ """
169
+ Parameters
170
+ ----------
171
+ request_options : typing.Optional[RequestOptions]
172
+ Request-specific configuration.
173
+
174
+ Returns
175
+ -------
176
+ ListBasesResponse
177
+ The caller's bases (a machine caller, as deployment-root, gets the full list).
178
+
179
+ Examples
180
+ --------
181
+ import asyncio
182
+
183
+ from base_client import AsyncBaseAPIClient
184
+
185
+ client = AsyncBaseAPIClient(
186
+ base_url="https://yourhost.com/path/to/api",
187
+ )
188
+
189
+
190
+ async def main() -> None:
191
+ await client.bases.list_bases()
192
+
193
+
194
+ asyncio.run(main())
195
+ """
196
+ _response = await self._raw_client.list_bases(request_options=request_options)
197
+ return _response.data
198
+
199
+ async def create_base(
200
+ self,
201
+ *,
202
+ dsn_secret: str,
203
+ name: str,
204
+ owner_user_id: typing.Optional[str] = OMIT,
205
+ request_options: typing.Optional[RequestOptions] = None,
206
+ ) -> Base:
207
+ """
208
+ Parameters
209
+ ----------
210
+ dsn_secret : str
211
+
212
+ name : str
213
+
214
+ owner_user_id : typing.Optional[str]
215
+
216
+ request_options : typing.Optional[RequestOptions]
217
+ Request-specific configuration.
218
+
219
+ Returns
220
+ -------
221
+ Base
222
+ The created base.
223
+
224
+ Examples
225
+ --------
226
+ import asyncio
227
+
228
+ from base_client import AsyncBaseAPIClient
229
+
230
+ client = AsyncBaseAPIClient(
231
+ base_url="https://yourhost.com/path/to/api",
232
+ )
233
+
234
+
235
+ async def main() -> None:
236
+ await client.bases.create_base(
237
+ dsn_secret="dsn_secret",
238
+ name="name",
239
+ )
240
+
241
+
242
+ asyncio.run(main())
243
+ """
244
+ _response = await self._raw_client.create_base(
245
+ dsn_secret=dsn_secret, name=name, owner_user_id=owner_user_id, request_options=request_options
246
+ )
247
+ return _response.data
248
+
249
+ async def get_base(self, base_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> Base:
250
+ """
251
+ Parameters
252
+ ----------
253
+ base_id : str
254
+
255
+ request_options : typing.Optional[RequestOptions]
256
+ Request-specific configuration.
257
+
258
+ Returns
259
+ -------
260
+ Base
261
+ The base.
262
+
263
+ Examples
264
+ --------
265
+ import asyncio
266
+
267
+ from base_client import AsyncBaseAPIClient
268
+
269
+ client = AsyncBaseAPIClient(
270
+ base_url="https://yourhost.com/path/to/api",
271
+ )
272
+
273
+
274
+ async def main() -> None:
275
+ await client.bases.get_base(
276
+ base_id="base_id",
277
+ )
278
+
279
+
280
+ asyncio.run(main())
281
+ """
282
+ _response = await self._raw_client.get_base(base_id, request_options=request_options)
283
+ return _response.data
284
+
285
+ async def delete_base(self, base_id: str, *, request_options: typing.Optional[RequestOptions] = None) -> None:
286
+ """
287
+ Parameters
288
+ ----------
289
+ base_id : str
290
+
291
+ request_options : typing.Optional[RequestOptions]
292
+ Request-specific configuration.
293
+
294
+ Returns
295
+ -------
296
+ None
297
+
298
+ Examples
299
+ --------
300
+ import asyncio
301
+
302
+ from base_client import AsyncBaseAPIClient
303
+
304
+ client = AsyncBaseAPIClient(
305
+ base_url="https://yourhost.com/path/to/api",
306
+ )
307
+
308
+
309
+ async def main() -> None:
310
+ await client.bases.delete_base(
311
+ base_id="base_id",
312
+ )
313
+
314
+
315
+ asyncio.run(main())
316
+ """
317
+ _response = await self._raw_client.delete_base(base_id, request_options=request_options)
318
+ return _response.data