lambdadb 0.1.3__py3-none-any.whl → 0.2.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 lambdadb might be problematic. Click here for more details.
- lambdadb/_hooks/__init__.py +0 -1
- lambdadb/_hooks/sdkhooks.py +4 -6
- lambdadb/_hooks/types.py +8 -2
- lambdadb/_version.py +4 -4
- lambdadb/basesdk.py +12 -20
- lambdadb/collections.py +12 -0
- lambdadb/docs.py +10 -0
- lambdadb/models/__init__.py +0 -87
- lambdadb/projects.py +0 -1211
- lambdadb/sdk.py +2 -7
- lambdadb/sdkconfiguration.py +0 -7
- lambdadb/utils/forms.py +49 -28
- {lambdadb-0.1.3.dist-info → lambdadb-0.2.0.dist-info}/METADATA +74 -89
- {lambdadb-0.1.3.dist-info → lambdadb-0.2.0.dist-info}/RECORD +16 -22
- lambdadb/models/createprojectop.py +0 -39
- lambdadb/models/deleteprojectop.py +0 -52
- lambdadb/models/getprojectop.py +0 -39
- lambdadb/models/listprojectsop.py +0 -38
- lambdadb/models/projectresponse.py +0 -38
- lambdadb/models/updateprojectop.py +0 -58
- {lambdadb-0.1.3.dist-info → lambdadb-0.2.0.dist-info}/LICENSE +0 -0
- {lambdadb-0.1.3.dist-info → lambdadb-0.2.0.dist-info}/WHEEL +0 -0
lambdadb/sdk.py
CHANGED
|
@@ -100,16 +100,11 @@ class Lambdadb(BaseSDK):
|
|
|
100
100
|
|
|
101
101
|
hooks = SDKHooks()
|
|
102
102
|
|
|
103
|
-
current_server_url, *_ = self.sdk_configuration.get_server_details()
|
|
104
|
-
server_url, self.sdk_configuration.client = hooks.sdk_init(
|
|
105
|
-
current_server_url, client
|
|
106
|
-
)
|
|
107
|
-
if current_server_url != server_url:
|
|
108
|
-
self.sdk_configuration.server_url = server_url
|
|
109
|
-
|
|
110
103
|
# pylint: disable=protected-access
|
|
111
104
|
self.sdk_configuration.__dict__["_hooks"] = hooks
|
|
112
105
|
|
|
106
|
+
self.sdk_configuration = hooks.sdk_init(self.sdk_configuration)
|
|
107
|
+
|
|
113
108
|
weakref.finalize(
|
|
114
109
|
self,
|
|
115
110
|
close_clients,
|
lambdadb/sdkconfiguration.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
2
|
|
|
3
|
-
from ._hooks import SDKHooks
|
|
4
3
|
from ._version import (
|
|
5
4
|
__gen_version__,
|
|
6
5
|
__openapi_doc_version__,
|
|
@@ -41,9 +40,6 @@ class SDKConfiguration:
|
|
|
41
40
|
retry_config: OptionalNullable[RetryConfig] = Field(default_factory=lambda: UNSET)
|
|
42
41
|
timeout_ms: Optional[int] = None
|
|
43
42
|
|
|
44
|
-
def __post_init__(self):
|
|
45
|
-
self._hooks = SDKHooks()
|
|
46
|
-
|
|
47
43
|
def get_server_details(self) -> Tuple[str, Dict[str, str]]:
|
|
48
44
|
if self.server_url is not None and self.server_url:
|
|
49
45
|
return remove_suffix(self.server_url, "/"), {}
|
|
@@ -51,6 +47,3 @@ class SDKConfiguration:
|
|
|
51
47
|
self.server_idx = 0
|
|
52
48
|
|
|
53
49
|
return SERVERS[self.server_idx], {}
|
|
54
|
-
|
|
55
|
-
def get_hooks(self) -> SDKHooks:
|
|
56
|
-
return self._hooks
|
lambdadb/utils/forms.py
CHANGED
|
@@ -86,11 +86,39 @@ def _populate_form(
|
|
|
86
86
|
return form
|
|
87
87
|
|
|
88
88
|
|
|
89
|
+
def _extract_file_properties(file_obj: Any) -> Tuple[str, Any, Any]:
|
|
90
|
+
"""Extract file name, content, and content type from a file object."""
|
|
91
|
+
file_fields: Dict[str, FieldInfo] = file_obj.__class__.model_fields
|
|
92
|
+
|
|
93
|
+
file_name = ""
|
|
94
|
+
content = None
|
|
95
|
+
content_type = None
|
|
96
|
+
|
|
97
|
+
for file_field_name in file_fields:
|
|
98
|
+
file_field = file_fields[file_field_name]
|
|
99
|
+
|
|
100
|
+
file_metadata = find_field_metadata(file_field, MultipartFormMetadata)
|
|
101
|
+
if file_metadata is None:
|
|
102
|
+
continue
|
|
103
|
+
|
|
104
|
+
if file_metadata.content:
|
|
105
|
+
content = getattr(file_obj, file_field_name, None)
|
|
106
|
+
elif file_field_name == "content_type":
|
|
107
|
+
content_type = getattr(file_obj, file_field_name, None)
|
|
108
|
+
else:
|
|
109
|
+
file_name = getattr(file_obj, file_field_name)
|
|
110
|
+
|
|
111
|
+
if file_name == "" or content is None:
|
|
112
|
+
raise ValueError("invalid multipart/form-data file")
|
|
113
|
+
|
|
114
|
+
return file_name, content, content_type
|
|
115
|
+
|
|
116
|
+
|
|
89
117
|
def serialize_multipart_form(
|
|
90
118
|
media_type: str, request: Any
|
|
91
|
-
) -> Tuple[str, Dict[str, Any],
|
|
119
|
+
) -> Tuple[str, Dict[str, Any], List[Tuple[str, Any]]]:
|
|
92
120
|
form: Dict[str, Any] = {}
|
|
93
|
-
files:
|
|
121
|
+
files: List[Tuple[str, Any]] = []
|
|
94
122
|
|
|
95
123
|
if not isinstance(request, BaseModel):
|
|
96
124
|
raise TypeError("invalid request body type")
|
|
@@ -112,39 +140,32 @@ def serialize_multipart_form(
|
|
|
112
140
|
f_name = field.alias if field.alias else name
|
|
113
141
|
|
|
114
142
|
if field_metadata.file:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
file_field = file_fields[file_field_name]
|
|
143
|
+
if isinstance(val, List):
|
|
144
|
+
# Handle array of files
|
|
145
|
+
for file_obj in val:
|
|
146
|
+
if not _is_set(file_obj):
|
|
147
|
+
continue
|
|
148
|
+
|
|
149
|
+
file_name, content, content_type = _extract_file_properties(file_obj)
|
|
123
150
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
151
|
+
if content_type is not None:
|
|
152
|
+
files.append((f_name + "[]", (file_name, content, content_type)))
|
|
153
|
+
else:
|
|
154
|
+
files.append((f_name + "[]", (file_name, content)))
|
|
155
|
+
else:
|
|
156
|
+
# Handle single file
|
|
157
|
+
file_name, content, content_type = _extract_file_properties(val)
|
|
127
158
|
|
|
128
|
-
if
|
|
129
|
-
|
|
130
|
-
elif file_field_name == "content_type":
|
|
131
|
-
content_type = getattr(val, file_field_name, None)
|
|
159
|
+
if content_type is not None:
|
|
160
|
+
files.append((f_name, (file_name, content, content_type)))
|
|
132
161
|
else:
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
if file_name == "" or content is None:
|
|
136
|
-
raise ValueError("invalid multipart/form-data file")
|
|
137
|
-
|
|
138
|
-
if content_type is not None:
|
|
139
|
-
files[f_name] = (file_name, content, content_type)
|
|
140
|
-
else:
|
|
141
|
-
files[f_name] = (file_name, content)
|
|
162
|
+
files.append((f_name, (file_name, content)))
|
|
142
163
|
elif field_metadata.json:
|
|
143
|
-
files
|
|
164
|
+
files.append((f_name, (
|
|
144
165
|
None,
|
|
145
166
|
marshal_json(val, request_field_types[name]),
|
|
146
167
|
"application/json",
|
|
147
|
-
)
|
|
168
|
+
)))
|
|
148
169
|
else:
|
|
149
170
|
if isinstance(val, List):
|
|
150
171
|
values = []
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: lambdadb
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.2.0
|
|
4
4
|
Summary: Python Client SDK Generated by Speakeasy.
|
|
5
5
|
Author: Speakeasy
|
|
6
6
|
Requires-Python: >=3.9.2
|
|
@@ -9,8 +9,10 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.11
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.12
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.13
|
|
12
|
+
Requires-Dist: httpcore (>=1.0.9)
|
|
12
13
|
Requires-Dist: httpx (>=0.28.1)
|
|
13
14
|
Requires-Dist: pydantic (>=2.11.2)
|
|
15
|
+
Project-URL: Repository, https://github.com/lambdadb/lambdadb-python-client.git
|
|
14
16
|
Description-Content-Type: text/markdown
|
|
15
17
|
|
|
16
18
|
# LambdaDB Python SDK
|
|
@@ -33,21 +35,21 @@ LambdaDB API: LambdaDB Open API Spec
|
|
|
33
35
|
<!-- Start Table of Contents [toc] -->
|
|
34
36
|
## Table of Contents
|
|
35
37
|
<!-- $toc-max-depth=2 -->
|
|
36
|
-
* [LambdaDB Python SDK](
|
|
37
|
-
* [SDK Installation](
|
|
38
|
-
* [IDE Support](
|
|
39
|
-
* [SDK Example Usage](
|
|
40
|
-
* [Authentication](
|
|
41
|
-
* [Available Resources and Operations](
|
|
42
|
-
* [Retries](
|
|
43
|
-
* [Error Handling](
|
|
44
|
-
* [Server Selection](
|
|
45
|
-
* [Custom HTTP Client](
|
|
46
|
-
* [Resource Management](
|
|
47
|
-
* [Debugging](
|
|
48
|
-
* [Development](
|
|
49
|
-
* [Maturity](
|
|
50
|
-
* [Contributions](
|
|
38
|
+
* [LambdaDB Python SDK](https://github.com/lambdadb/lambdadb-python-client/blob/master/#lambdadb-python-sdk)
|
|
39
|
+
* [SDK Installation](https://github.com/lambdadb/lambdadb-python-client/blob/master/#sdk-installation)
|
|
40
|
+
* [IDE Support](https://github.com/lambdadb/lambdadb-python-client/blob/master/#ide-support)
|
|
41
|
+
* [SDK Example Usage](https://github.com/lambdadb/lambdadb-python-client/blob/master/#sdk-example-usage)
|
|
42
|
+
* [Authentication](https://github.com/lambdadb/lambdadb-python-client/blob/master/#authentication)
|
|
43
|
+
* [Available Resources and Operations](https://github.com/lambdadb/lambdadb-python-client/blob/master/#available-resources-and-operations)
|
|
44
|
+
* [Retries](https://github.com/lambdadb/lambdadb-python-client/blob/master/#retries)
|
|
45
|
+
* [Error Handling](https://github.com/lambdadb/lambdadb-python-client/blob/master/#error-handling)
|
|
46
|
+
* [Server Selection](https://github.com/lambdadb/lambdadb-python-client/blob/master/#server-selection)
|
|
47
|
+
* [Custom HTTP Client](https://github.com/lambdadb/lambdadb-python-client/blob/master/#custom-http-client)
|
|
48
|
+
* [Resource Management](https://github.com/lambdadb/lambdadb-python-client/blob/master/#resource-management)
|
|
49
|
+
* [Debugging](https://github.com/lambdadb/lambdadb-python-client/blob/master/#debugging)
|
|
50
|
+
* [Development](https://github.com/lambdadb/lambdadb-python-client/blob/master/#development)
|
|
51
|
+
* [Maturity](https://github.com/lambdadb/lambdadb-python-client/blob/master/#maturity)
|
|
52
|
+
* [Contributions](https://github.com/lambdadb/lambdadb-python-client/blob/master/#contributions)
|
|
51
53
|
|
|
52
54
|
<!-- End Table of Contents [toc] -->
|
|
53
55
|
|
|
@@ -126,14 +128,14 @@ Generally, the SDK will work well with most IDEs out of the box. However, when u
|
|
|
126
128
|
|
|
127
129
|
```python
|
|
128
130
|
# Synchronous Example
|
|
129
|
-
from lambdadb import Lambdadb
|
|
131
|
+
from lambdadb import Lambdadb
|
|
130
132
|
|
|
131
133
|
|
|
132
|
-
with Lambdadb(
|
|
134
|
+
with Lambdadb(
|
|
135
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
136
|
+
) as l_client:
|
|
133
137
|
|
|
134
|
-
res = l_client.projects.list(
|
|
135
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
136
|
-
))
|
|
138
|
+
res = l_client.projects.collections.list(project_name="<value>")
|
|
137
139
|
|
|
138
140
|
# Handle response
|
|
139
141
|
print(res)
|
|
@@ -145,15 +147,15 @@ The same SDK client can also be used to make asychronous requests by importing a
|
|
|
145
147
|
```python
|
|
146
148
|
# Asynchronous Example
|
|
147
149
|
import asyncio
|
|
148
|
-
from lambdadb import Lambdadb
|
|
150
|
+
from lambdadb import Lambdadb
|
|
149
151
|
|
|
150
152
|
async def main():
|
|
151
153
|
|
|
152
|
-
async with Lambdadb(
|
|
154
|
+
async with Lambdadb(
|
|
155
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
156
|
+
) as l_client:
|
|
153
157
|
|
|
154
|
-
res = await l_client.projects.list_async(
|
|
155
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
156
|
-
))
|
|
158
|
+
res = await l_client.projects.collections.list_async(project_name="<value>")
|
|
157
159
|
|
|
158
160
|
# Handle response
|
|
159
161
|
print(res)
|
|
@@ -187,24 +189,6 @@ with Lambdadb(
|
|
|
187
189
|
# Handle response
|
|
188
190
|
print(res)
|
|
189
191
|
|
|
190
|
-
```
|
|
191
|
-
|
|
192
|
-
### Per-Operation Security Schemes
|
|
193
|
-
|
|
194
|
-
Some operations in this SDK require the security scheme to be specified at the request level. For example:
|
|
195
|
-
```python
|
|
196
|
-
from lambdadb import Lambdadb, models
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
with Lambdadb() as l_client:
|
|
200
|
-
|
|
201
|
-
res = l_client.projects.list(security=models.ListProjectsSecurity(
|
|
202
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
203
|
-
))
|
|
204
|
-
|
|
205
|
-
# Handle response
|
|
206
|
-
print(res)
|
|
207
|
-
|
|
208
192
|
```
|
|
209
193
|
<!-- End Authentication [security] -->
|
|
210
194
|
|
|
@@ -215,30 +199,25 @@ with Lambdadb() as l_client:
|
|
|
215
199
|
<summary>Available methods</summary>
|
|
216
200
|
|
|
217
201
|
|
|
218
|
-
### [projects](docs/sdks/projects/README.md)
|
|
202
|
+
### [projects](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/projects/README.md)
|
|
219
203
|
|
|
220
|
-
* [list](docs/sdks/projects/README.md#list) - List all projects in an account.
|
|
221
|
-
* [create](docs/sdks/projects/README.md#create) - Create a project.
|
|
222
|
-
* [get](docs/sdks/projects/README.md#get) - Get metadata of an existing project.
|
|
223
|
-
* [delete](docs/sdks/projects/README.md#delete) - Delete an existing project.
|
|
224
|
-
* [update](docs/sdks/projects/README.md#update) - Configure an existing project
|
|
225
204
|
|
|
226
|
-
#### [projects.collections](docs/sdks/collections/README.md)
|
|
205
|
+
#### [projects.collections](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md)
|
|
227
206
|
|
|
228
|
-
* [list](docs/sdks/collections/README.md#list) - List all collections in an existing project.
|
|
229
|
-
* [create](docs/sdks/collections/README.md#create) - Create an collection.
|
|
230
|
-
* [delete](docs/sdks/collections/README.md#delete) - Delete an existing collection.
|
|
231
|
-
* [get](docs/sdks/collections/README.md#get) - Get metadata of an existing collection.
|
|
232
|
-
* [update](docs/sdks/collections/README.md#update) - Configure an collection.
|
|
233
|
-
* [query](docs/sdks/collections/README.md#query) - Search an collection with a query and return the most similar documents.
|
|
207
|
+
* [list](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#list) - List all collections in an existing project.
|
|
208
|
+
* [create](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#create) - Create an collection.
|
|
209
|
+
* [delete](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#delete) - Delete an existing collection.
|
|
210
|
+
* [get](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#get) - Get metadata of an existing collection.
|
|
211
|
+
* [update](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#update) - Configure an collection.
|
|
212
|
+
* [query](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/collections/README.md#query) - Search an collection with a query and return the most similar documents.
|
|
234
213
|
|
|
235
|
-
#### [projects.collections.docs](docs/sdks/docs/README.md)
|
|
214
|
+
#### [projects.collections.docs](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md)
|
|
236
215
|
|
|
237
|
-
* [upsert](docs/sdks/docs/README.md#upsert) - Upsert documents into an collection. Note that the maximum supported payload size is 6MB.
|
|
238
|
-
* [get_bulk_upsert](docs/sdks/docs/README.md#get_bulk_upsert) - Request required info to upload documents.
|
|
239
|
-
* [bulk_upsert](docs/sdks/docs/README.md#bulk_upsert) - Bulk upsert documents into an collection. Note that the maximum supported object size is 200MB.
|
|
240
|
-
* [delete](docs/sdks/docs/README.md#delete) - Delete documents by document IDs or query filter from an collection.
|
|
241
|
-
* [fetch](docs/sdks/docs/README.md#fetch) - Lookup and return documents by document IDs from an collection.
|
|
216
|
+
* [upsert](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md#upsert) - Upsert documents into an collection. Note that the maximum supported payload size is 6MB.
|
|
217
|
+
* [get_bulk_upsert](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md#get_bulk_upsert) - Request required info to upload documents.
|
|
218
|
+
* [bulk_upsert](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md#bulk_upsert) - Bulk upsert documents into an collection. Note that the maximum supported object size is 200MB.
|
|
219
|
+
* [delete](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md#delete) - Delete documents by document IDs or query filter from an collection.
|
|
220
|
+
* [fetch](https://github.com/lambdadb/lambdadb-python-client/blob/master/docs/sdks/docs/README.md#fetch) - Lookup and return documents by document IDs from an collection.
|
|
242
221
|
|
|
243
222
|
</details>
|
|
244
223
|
<!-- End Available Resources and Operations [operations] -->
|
|
@@ -250,15 +229,15 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an
|
|
|
250
229
|
|
|
251
230
|
To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
|
|
252
231
|
```python
|
|
253
|
-
from lambdadb import Lambdadb
|
|
232
|
+
from lambdadb import Lambdadb
|
|
254
233
|
from lambdadb.utils import BackoffStrategy, RetryConfig
|
|
255
234
|
|
|
256
235
|
|
|
257
|
-
with Lambdadb(
|
|
236
|
+
with Lambdadb(
|
|
237
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
238
|
+
) as l_client:
|
|
258
239
|
|
|
259
|
-
res = l_client.projects.list(
|
|
260
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
261
|
-
),
|
|
240
|
+
res = l_client.projects.collections.list(project_name="<value>",
|
|
262
241
|
RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
|
|
263
242
|
|
|
264
243
|
# Handle response
|
|
@@ -268,17 +247,16 @@ with Lambdadb() as l_client:
|
|
|
268
247
|
|
|
269
248
|
If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
|
|
270
249
|
```python
|
|
271
|
-
from lambdadb import Lambdadb
|
|
250
|
+
from lambdadb import Lambdadb
|
|
272
251
|
from lambdadb.utils import BackoffStrategy, RetryConfig
|
|
273
252
|
|
|
274
253
|
|
|
275
254
|
with Lambdadb(
|
|
276
255
|
retry_config=RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False),
|
|
256
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
277
257
|
) as l_client:
|
|
278
258
|
|
|
279
|
-
res = l_client.projects.list(
|
|
280
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
281
|
-
))
|
|
259
|
+
res = l_client.projects.collections.list(project_name="<value>")
|
|
282
260
|
|
|
283
261
|
# Handle response
|
|
284
262
|
print(res)
|
|
@@ -302,26 +280,27 @@ By default, an API error will raise a errors.APIError exception, which has the f
|
|
|
302
280
|
|
|
303
281
|
When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `list_async` method may raise the following exceptions:
|
|
304
282
|
|
|
305
|
-
| Error Type
|
|
306
|
-
|
|
|
307
|
-
| errors.UnauthenticatedError
|
|
308
|
-
| errors.
|
|
309
|
-
| errors.
|
|
310
|
-
| errors.
|
|
283
|
+
| Error Type | Status Code | Content Type |
|
|
284
|
+
| ---------------------------- | ----------- | ---------------- |
|
|
285
|
+
| errors.UnauthenticatedError | 401 | application/json |
|
|
286
|
+
| errors.ResourceNotFoundError | 404 | application/json |
|
|
287
|
+
| errors.TooManyRequestsError | 429 | application/json |
|
|
288
|
+
| errors.InternalServerError | 500 | application/json |
|
|
289
|
+
| errors.APIError | 4XX, 5XX | \*/\* |
|
|
311
290
|
|
|
312
291
|
### Example
|
|
313
292
|
|
|
314
293
|
```python
|
|
315
|
-
from lambdadb import Lambdadb, errors
|
|
294
|
+
from lambdadb import Lambdadb, errors
|
|
316
295
|
|
|
317
296
|
|
|
318
|
-
with Lambdadb(
|
|
297
|
+
with Lambdadb(
|
|
298
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
299
|
+
) as l_client:
|
|
319
300
|
res = None
|
|
320
301
|
try:
|
|
321
302
|
|
|
322
|
-
res = l_client.projects.list(
|
|
323
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
324
|
-
))
|
|
303
|
+
res = l_client.projects.collections.list(project_name="<value>")
|
|
325
304
|
|
|
326
305
|
# Handle response
|
|
327
306
|
print(res)
|
|
@@ -329,6 +308,9 @@ with Lambdadb() as l_client:
|
|
|
329
308
|
except errors.UnauthenticatedError as e:
|
|
330
309
|
# handle e.data: errors.UnauthenticatedErrorData
|
|
331
310
|
raise(e)
|
|
311
|
+
except errors.ResourceNotFoundError as e:
|
|
312
|
+
# handle e.data: errors.ResourceNotFoundErrorData
|
|
313
|
+
raise(e)
|
|
332
314
|
except errors.TooManyRequestsError as e:
|
|
333
315
|
# handle e.data: errors.TooManyRequestsErrorData
|
|
334
316
|
raise(e)
|
|
@@ -348,16 +330,15 @@ with Lambdadb() as l_client:
|
|
|
348
330
|
|
|
349
331
|
The default server can be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
|
|
350
332
|
```python
|
|
351
|
-
from lambdadb import Lambdadb
|
|
333
|
+
from lambdadb import Lambdadb
|
|
352
334
|
|
|
353
335
|
|
|
354
336
|
with Lambdadb(
|
|
355
337
|
server_url="https://{baseUrl}",
|
|
338
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
356
339
|
) as l_client:
|
|
357
340
|
|
|
358
|
-
res = l_client.projects.list(
|
|
359
|
-
admin_api_key="<YOUR_ADMIN_API_KEY>",
|
|
360
|
-
))
|
|
341
|
+
res = l_client.projects.collections.list(project_name="<value>")
|
|
361
342
|
|
|
362
343
|
# Handle response
|
|
363
344
|
print(res)
|
|
@@ -457,14 +438,18 @@ The `Lambdadb` class implements the context manager protocol and registers a fin
|
|
|
457
438
|
from lambdadb import Lambdadb
|
|
458
439
|
def main():
|
|
459
440
|
|
|
460
|
-
with Lambdadb(
|
|
441
|
+
with Lambdadb(
|
|
442
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
443
|
+
) as l_client:
|
|
461
444
|
# Rest of application here...
|
|
462
445
|
|
|
463
446
|
|
|
464
447
|
# Or when using async:
|
|
465
448
|
async def amain():
|
|
466
449
|
|
|
467
|
-
async with Lambdadb(
|
|
450
|
+
async with Lambdadb(
|
|
451
|
+
project_api_key="<YOUR_PROJECT_API_KEY>",
|
|
452
|
+
) as l_client:
|
|
468
453
|
# Rest of application here...
|
|
469
454
|
```
|
|
470
455
|
<!-- End Resource Management [resource-management] -->
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
lambdadb/__init__.py,sha256=w2u919V3Tzv4zEPQ-OYJ79gQ_4_SyW7GOFFoHtqXDFA,401
|
|
2
|
-
lambdadb/_hooks/__init__.py,sha256=
|
|
2
|
+
lambdadb/_hooks/__init__.py,sha256=p5J13DeYuISQyQWirjJAObHIf2VtIlOtFqnIpvjjVwk,118
|
|
3
3
|
lambdadb/_hooks/registration.py,sha256=1QZB41w6If7I9dXiOSQx6dhSc6BPWrnI5Q5bMOr4iVA,624
|
|
4
|
-
lambdadb/_hooks/sdkhooks.py,sha256=
|
|
5
|
-
lambdadb/_hooks/types.py,sha256=
|
|
6
|
-
lambdadb/_version.py,sha256=
|
|
7
|
-
lambdadb/basesdk.py,sha256=
|
|
8
|
-
lambdadb/collections.py,sha256=
|
|
9
|
-
lambdadb/docs.py,sha256=
|
|
4
|
+
lambdadb/_hooks/sdkhooks.py,sha256=KGhPvIuUjurDBQOT6t-aWgiu1YDRXpn-OMz6_PkUdFk,2463
|
|
5
|
+
lambdadb/_hooks/types.py,sha256=09dUW5q4HN9aVFAhskDLQqjxLPBfDD97uuucmdcBa6Q,2987
|
|
6
|
+
lambdadb/_version.py,sha256=9hZg4PkIlz2tuq8jxeXakBDfOC8LtKIEXV6_U2th84c,458
|
|
7
|
+
lambdadb/basesdk.py,sha256=Uo8ZEdXVHmS_j1F9on47XeJD6sj9plIrna_6Oo_1I-I,11853
|
|
8
|
+
lambdadb/collections.py,sha256=c3YcLTKm9kkNo9ZSJolYvEJHViqt7nM1RZ3x4fc6e4I,69413
|
|
9
|
+
lambdadb/docs.py,sha256=jtrogN__GPuavf2bySAjklPLvtm0JMDezkY2qSlc83k,57368
|
|
10
10
|
lambdadb/errors/__init__.py,sha256=V406LU9TLJQ0eocD79_PpsCjOmH6DAUnBTKd0Ra23uQ,2637
|
|
11
11
|
lambdadb/errors/apierror.py,sha256=9mTyJSyvUAOnSfW_1HWt9dGl8IDlpQ68DebwYsDNdug,528
|
|
12
12
|
lambdadb/errors/badrequest_error.py,sha256=OX1fo-ja-N-zqV4opH_LXnz_vwa2gZbgDx0aAeNMYL0,514
|
|
@@ -16,32 +16,26 @@ lambdadb/errors/resourcenotfound_error.py,sha256=VfsNJ9xJjMzZFoQGt5wu6JkUpRzFhrP
|
|
|
16
16
|
lambdadb/errors/toomanyrequests_error.py,sha256=yHFjs27JCb5mVmOZZqKmA4IG1ONs6FVERWIK_Gwgqwo,539
|
|
17
17
|
lambdadb/errors/unauthenticated_error.py,sha256=HD2a2JwLcIDefnkDLdbHJCbkY28u2cmAGOI8S6Q5m48,539
|
|
18
18
|
lambdadb/httpclient.py,sha256=Eu73urOAiZQtdUIyOUnPccxCiBbWEKrXG-JrRG3SLM4,3946
|
|
19
|
-
lambdadb/models/__init__.py,sha256=
|
|
19
|
+
lambdadb/models/__init__.py,sha256=VF8BdZdl5V9jQanOX2-UJ5SjGKdk2MGbKrs1J4sffxg,11752
|
|
20
20
|
lambdadb/models/bulkupsertdocsop.py,sha256=r7WrCY_8uKgQr07eIBOk1U6clKPOKy6OMfsnl43Q5kA,1674
|
|
21
21
|
lambdadb/models/collectionresponse.py,sha256=zK3nHrb_zRKc9B6NuAtd_V1gESwD-fULqZ4SmkmVQHg,2121
|
|
22
22
|
lambdadb/models/createcollectionop.py,sha256=Hk-6zcL9ZWrFDPh23J805x8YwL2_3It02R2oRI9eQ6w,2198
|
|
23
|
-
lambdadb/models/createprojectop.py,sha256=ekgwDcoiDyfhQTO92CSBL-SwHk133AmF67J24BzJlfU,1202
|
|
24
23
|
lambdadb/models/deletecollectionop.py,sha256=MCNYTYXCwsIP4NQXB3CA2oZwF0HFALaIpSUBePP05KM,1171
|
|
25
24
|
lambdadb/models/deletedocsop.py,sha256=ybWYrAqQiOe8piMUM6msCOlLm4-2f4u7aLrHl050UZo,2131
|
|
26
|
-
lambdadb/models/deleteprojectop.py,sha256=9yCpgk-pjrbgYcDOQQTbixXm7CYsXAq11le5DroH2oA,1306
|
|
27
25
|
lambdadb/models/fetchdocsop.py,sha256=tak7MMPl4OozANBW2ORRW7OjjNztHoHwfgYtSz7-2KE,3285
|
|
28
26
|
lambdadb/models/getbulkupsertdocsop.py,sha256=oUkcvIkrM_wIxrCoB_X-jBL9QqA_qpo7olh24vBSdWQ,2586
|
|
29
27
|
lambdadb/models/getcollectionop.py,sha256=9X_4fW9sYfXVe_gPqCbnKBEr0z7ss_wNrhRdSXhNSRU,865
|
|
30
|
-
lambdadb/models/getprojectop.py,sha256=hxv2I92Gp8W46b599zZhLdHhGWSErJCjZgyJFwoXiEo,1006
|
|
31
28
|
lambdadb/models/indexconfigs_union.py,sha256=fAq_wlTU1p_mdbq_ZuCFIb_DldfvL__Tphc36ocUl0w,2020
|
|
32
29
|
lambdadb/models/listcollectionsop.py,sha256=Q7OM34dUCRQhft3vg4FLlnRIXWhUAhxG4rX_nIrL9_8,1081
|
|
33
|
-
lambdadb/models/listprojectsop.py,sha256=-ziVP7iGTlD0RDUCkRw_7sS6xMpVB4GyYJwpI6bgfLw,1031
|
|
34
|
-
lambdadb/models/projectresponse.py,sha256=oKimGJ8YtrOSZDeCNZWcPhVL0UO_vhO3uozcZ3kUAIw,1070
|
|
35
30
|
lambdadb/models/querycollectionop.py,sha256=ZS-tHGqw6gRDstMEHg7NuWdmuMInLwRIvKnrbKgMGU8,4797
|
|
36
31
|
lambdadb/models/security.py,sha256=nP-VTWFY6O-UPNPsWcsg38JcXr2zSy_m7qieDix6SxA,698
|
|
37
32
|
lambdadb/models/status.py,sha256=pl66KcDT9ao6yLXXXOBqerh_StjpNiJb34Yf7VoijEI,250
|
|
38
33
|
lambdadb/models/updatecollectionop.py,sha256=AH-xDQYtywu6rn5clKKXIuamXk3iYdwSfN5kCi5Ygtk,1470
|
|
39
|
-
lambdadb/models/updateprojectop.py,sha256=OjtkpuNpJiKbqVP2vQvoCmXlb1Oe3fTjPgJUOZWtAHc,1446
|
|
40
34
|
lambdadb/models/upsertdocsop.py,sha256=6oMppMfQtgyVoUrNZ6S_qWFMZmkmPBqQumGWzN78nNk,1684
|
|
41
|
-
lambdadb/projects.py,sha256=
|
|
35
|
+
lambdadb/projects.py,sha256=C3NlfWplO4rsiejfCOzdSghCI3HqayA-H6gfsEeab3c,516
|
|
42
36
|
lambdadb/py.typed,sha256=zrp19r0G21lr2yRiMC0f8MFkQFGj9wMpSbboePMg8KM,59
|
|
43
|
-
lambdadb/sdk.py,sha256=
|
|
44
|
-
lambdadb/sdkconfiguration.py,sha256
|
|
37
|
+
lambdadb/sdk.py,sha256=IxNrSAABHB12ncsSOFVweuSOSwHECQQwhq1CK4G-5Iw,6076
|
|
38
|
+
lambdadb/sdkconfiguration.py,sha256=-sHtaoBluBcNOYRTKxLMnovJazRm3ZWV9VOYCSS0UNY,1589
|
|
45
39
|
lambdadb/types/__init__.py,sha256=RArOwSgeeTIva6h-4ttjXwMUeCkz10nAFBL9D-QljI4,377
|
|
46
40
|
lambdadb/types/basemodel.py,sha256=L79WXvTECbSqaJzs8D3ud_KdIWkU7Cx2wbohDAktE9E,1127
|
|
47
41
|
lambdadb/utils/__init__.py,sha256=BQt6xIdX86A6mOHAnxAXBXaPgdUJtDy2-_4ymAsII_Y,5436
|
|
@@ -49,7 +43,7 @@ lambdadb/utils/annotations.py,sha256=aR7mZG34FzgRdew7WZPYEu9QGBerpuKxCF4sek5Z_5Y
|
|
|
49
43
|
lambdadb/utils/datetimes.py,sha256=oppAA5e3V35pQov1-FNLKxAaNF1_XWi-bQtyjjql3H8,855
|
|
50
44
|
lambdadb/utils/enums.py,sha256=REU6ydF8gsVL3xaeGX4sMNyiL3q5P9h29-f6Sa6luAE,2633
|
|
51
45
|
lambdadb/utils/eventstreaming.py,sha256=LtcrfJYw4nP2Oe4Wl0-cEURLzRGYReRGWNFY5wYECIE,6186
|
|
52
|
-
lambdadb/utils/forms.py,sha256=
|
|
46
|
+
lambdadb/utils/forms.py,sha256=EJdnrfIkuwpDtekyHutla0HjI_FypTYcmYNyPKEu_W0,6874
|
|
53
47
|
lambdadb/utils/headers.py,sha256=cPxWSmUILrefTGDzTH1Hdj7_Hlsj-EY6K5Tyc4iH4dk,3663
|
|
54
48
|
lambdadb/utils/logger.py,sha256=cU5AqG-IoxPayWXFZSayzLILandB50DjxgadREK-NAE,675
|
|
55
49
|
lambdadb/utils/metadata.py,sha256=Per2KFXXOqOtoUWXrlIfjrSrBg199KrRW0nKQDgHIBU,3136
|
|
@@ -60,7 +54,7 @@ lambdadb/utils/security.py,sha256=Dq3M6Ee_x_uWRPZ7vvM4XQNxjCMSlphrRn6qVs1pljU,60
|
|
|
60
54
|
lambdadb/utils/serializers.py,sha256=hiHBXM1AY8_N2Z_rvFfNSYwvLBkSQlPGFp8poasdU4s,5986
|
|
61
55
|
lambdadb/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
|
|
62
56
|
lambdadb/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
|
|
63
|
-
lambdadb-0.
|
|
64
|
-
lambdadb-0.
|
|
65
|
-
lambdadb-0.
|
|
66
|
-
lambdadb-0.
|
|
57
|
+
lambdadb-0.2.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
58
|
+
lambdadb-0.2.0.dist-info/METADATA,sha256=VYSiLCGH_MeiEALgq8o_vQ69rNFh1oR4fjWbQN52XzE,18666
|
|
59
|
+
lambdadb-0.2.0.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
60
|
+
lambdadb-0.2.0.dist-info/RECORD,,
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
from lambdadb.types import BaseModel
|
|
5
|
-
from lambdadb.utils import FieldMetadata, SecurityMetadata
|
|
6
|
-
import pydantic
|
|
7
|
-
from typing import Optional
|
|
8
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class CreateProjectSecurityTypedDict(TypedDict):
|
|
12
|
-
admin_api_key: str
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class CreateProjectSecurity(BaseModel):
|
|
16
|
-
admin_api_key: Annotated[
|
|
17
|
-
str,
|
|
18
|
-
FieldMetadata(
|
|
19
|
-
security=SecurityMetadata(
|
|
20
|
-
scheme=True,
|
|
21
|
-
scheme_type="apiKey",
|
|
22
|
-
sub_type="header",
|
|
23
|
-
field_name="x-api-key",
|
|
24
|
-
)
|
|
25
|
-
),
|
|
26
|
-
]
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class CreateProjectRequestTypedDict(TypedDict):
|
|
30
|
-
project_name: NotRequired[str]
|
|
31
|
-
r"""Displayed project name. Note that the supported maximum length is 45."""
|
|
32
|
-
rate_limit: NotRequired[float]
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
class CreateProjectRequest(BaseModel):
|
|
36
|
-
project_name: Annotated[Optional[str], pydantic.Field(alias="projectName")] = None
|
|
37
|
-
r"""Displayed project name. Note that the supported maximum length is 45."""
|
|
38
|
-
|
|
39
|
-
rate_limit: Annotated[Optional[float], pydantic.Field(alias="rateLimit")] = None
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
from lambdadb.types import BaseModel
|
|
5
|
-
from lambdadb.utils import FieldMetadata, PathParamMetadata, SecurityMetadata
|
|
6
|
-
import pydantic
|
|
7
|
-
from typing import Optional
|
|
8
|
-
from typing_extensions import Annotated, NotRequired, TypedDict
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class DeleteProjectSecurityTypedDict(TypedDict):
|
|
12
|
-
admin_api_key: str
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class DeleteProjectSecurity(BaseModel):
|
|
16
|
-
admin_api_key: Annotated[
|
|
17
|
-
str,
|
|
18
|
-
FieldMetadata(
|
|
19
|
-
security=SecurityMetadata(
|
|
20
|
-
scheme=True,
|
|
21
|
-
scheme_type="apiKey",
|
|
22
|
-
sub_type="header",
|
|
23
|
-
field_name="x-api-key",
|
|
24
|
-
)
|
|
25
|
-
),
|
|
26
|
-
]
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
class DeleteProjectRequestTypedDict(TypedDict):
|
|
30
|
-
project_name: str
|
|
31
|
-
r"""Project name."""
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
class DeleteProjectRequest(BaseModel):
|
|
35
|
-
project_name: Annotated[
|
|
36
|
-
str,
|
|
37
|
-
pydantic.Field(alias="projectName"),
|
|
38
|
-
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
39
|
-
]
|
|
40
|
-
r"""Project name."""
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
class DeleteProjectResponseTypedDict(TypedDict):
|
|
44
|
-
r"""Project delete request accepted."""
|
|
45
|
-
|
|
46
|
-
message: NotRequired[str]
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
class DeleteProjectResponse(BaseModel):
|
|
50
|
-
r"""Project delete request accepted."""
|
|
51
|
-
|
|
52
|
-
message: Optional[str] = None
|
lambdadb/models/getprojectop.py
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
|
|
2
|
-
|
|
3
|
-
from __future__ import annotations
|
|
4
|
-
from lambdadb.types import BaseModel
|
|
5
|
-
from lambdadb.utils import FieldMetadata, PathParamMetadata, SecurityMetadata
|
|
6
|
-
import pydantic
|
|
7
|
-
from typing_extensions import Annotated, TypedDict
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class GetProjectSecurityTypedDict(TypedDict):
|
|
11
|
-
admin_api_key: str
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
class GetProjectSecurity(BaseModel):
|
|
15
|
-
admin_api_key: Annotated[
|
|
16
|
-
str,
|
|
17
|
-
FieldMetadata(
|
|
18
|
-
security=SecurityMetadata(
|
|
19
|
-
scheme=True,
|
|
20
|
-
scheme_type="apiKey",
|
|
21
|
-
sub_type="header",
|
|
22
|
-
field_name="x-api-key",
|
|
23
|
-
)
|
|
24
|
-
),
|
|
25
|
-
]
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
class GetProjectRequestTypedDict(TypedDict):
|
|
29
|
-
project_name: str
|
|
30
|
-
r"""Project name."""
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class GetProjectRequest(BaseModel):
|
|
34
|
-
project_name: Annotated[
|
|
35
|
-
str,
|
|
36
|
-
pydantic.Field(alias="projectName"),
|
|
37
|
-
FieldMetadata(path=PathParamMetadata(style="simple", explode=False)),
|
|
38
|
-
]
|
|
39
|
-
r"""Project name."""
|