lambdadb 0.3.5__tar.gz → 0.3.6__tar.gz

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.

Files changed (72) hide show
  1. {lambdadb-0.3.5 → lambdadb-0.3.6}/PKG-INFO +49 -36
  2. {lambdadb-0.3.5 → lambdadb-0.3.6}/README-PYPI.md +48 -35
  3. {lambdadb-0.3.5 → lambdadb-0.3.6}/pyproject.toml +1 -1
  4. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/_version.py +3 -3
  5. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/basesdk.py +4 -4
  6. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/collections.py +234 -350
  7. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/docs.py +239 -367
  8. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/errors/__init__.py +9 -0
  9. lambdadb-0.3.6/src/lambdadb/errors/apierror.py +38 -0
  10. lambdadb-0.3.6/src/lambdadb/errors/badrequest_error.py +26 -0
  11. lambdadb-0.3.6/src/lambdadb/errors/internalservererror.py +26 -0
  12. lambdadb-0.3.6/src/lambdadb/errors/lambdadberror.py +26 -0
  13. lambdadb-0.3.6/src/lambdadb/errors/no_response_error.py +13 -0
  14. lambdadb-0.3.6/src/lambdadb/errors/resourcealreadyexists_error.py +26 -0
  15. lambdadb-0.3.6/src/lambdadb/errors/resourcenotfound_error.py +26 -0
  16. lambdadb-0.3.6/src/lambdadb/errors/responsevalidationerror.py +25 -0
  17. lambdadb-0.3.6/src/lambdadb/errors/toomanyrequests_error.py +26 -0
  18. lambdadb-0.3.6/src/lambdadb/errors/unauthenticated_error.py +26 -0
  19. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/__init__.py +0 -42
  20. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/deletedocsop.py +3 -11
  21. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/fetchdocsop.py +3 -11
  22. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/querycollectionop.py +7 -31
  23. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/updatedocsop.py +3 -11
  24. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/upsertdocsop.py +3 -11
  25. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/__init__.py +3 -0
  26. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/serializers.py +21 -3
  27. lambdadb-0.3.5/src/lambdadb/errors/apierror.py +0 -22
  28. lambdadb-0.3.5/src/lambdadb/errors/badrequest_error.py +0 -20
  29. lambdadb-0.3.5/src/lambdadb/errors/internalservererror.py +0 -20
  30. lambdadb-0.3.5/src/lambdadb/errors/resourcealreadyexists_error.py +0 -20
  31. lambdadb-0.3.5/src/lambdadb/errors/resourcenotfound_error.py +0 -20
  32. lambdadb-0.3.5/src/lambdadb/errors/toomanyrequests_error.py +0 -20
  33. lambdadb-0.3.5/src/lambdadb/errors/unauthenticated_error.py +0 -20
  34. {lambdadb-0.3.5 → lambdadb-0.3.6}/LICENSE +0 -0
  35. {lambdadb-0.3.5 → lambdadb-0.3.6}/py.typed +0 -0
  36. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/__init__.py +0 -0
  37. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/_hooks/__init__.py +0 -0
  38. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/_hooks/registration.py +0 -0
  39. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/_hooks/sdkhooks.py +0 -0
  40. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/_hooks/types.py +0 -0
  41. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/httpclient.py +0 -0
  42. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/bulkupsertdocsop.py +0 -0
  43. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/collectionresponse.py +0 -0
  44. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/createcollectionop.py +0 -0
  45. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/deletecollectionop.py +0 -0
  46. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/getbulkupsertdocsop.py +0 -0
  47. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/getcollectionop.py +0 -0
  48. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/indexconfigs_union.py +0 -0
  49. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/listcollectionsop.py +0 -0
  50. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/messageresponse.py +0 -0
  51. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/security.py +0 -0
  52. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/status.py +0 -0
  53. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/models/updatecollectionop.py +0 -0
  54. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/py.typed +0 -0
  55. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/sdk.py +0 -0
  56. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/sdkconfiguration.py +0 -0
  57. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/types/__init__.py +0 -0
  58. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/types/basemodel.py +0 -0
  59. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/annotations.py +0 -0
  60. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/datetimes.py +0 -0
  61. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/enums.py +0 -0
  62. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/eventstreaming.py +0 -0
  63. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/forms.py +0 -0
  64. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/headers.py +0 -0
  65. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/logger.py +0 -0
  66. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/metadata.py +0 -0
  67. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/queryparams.py +0 -0
  68. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/requestbodies.py +0 -0
  69. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/retries.py +0 -0
  70. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/security.py +0 -0
  71. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/url.py +0 -0
  72. {lambdadb-0.3.5 → lambdadb-0.3.6}/src/lambdadb/utils/values.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: lambdadb
3
- Version: 0.3.5
3
+ Version: 0.3.6
4
4
  Summary: Python Client SDK Generated by Speakeasy.
5
5
  Author: Speakeasy
6
6
  Requires-Python: >=3.9.2
@@ -265,29 +265,18 @@ with LambdaDB(
265
265
  <!-- Start Error Handling [errors] -->
266
266
  ## Error Handling
267
267
 
268
- Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
268
+ [`LambdaDBError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/lambdadberror.py) is the base class for all HTTP error responses. It has the following properties:
269
269
 
270
- By default, an API error will raise a errors.APIError exception, which has the following properties:
271
-
272
- | Property | Type | Description |
273
- |-----------------|------------------|-----------------------|
274
- | `.status_code` | *int* | The HTTP status code |
275
- | `.message` | *str* | The error message |
276
- | `.raw_response` | *httpx.Response* | The raw HTTP response |
277
- | `.body` | *str* | The response content |
278
-
279
- 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:
280
-
281
- | Error Type | Status Code | Content Type |
282
- | ---------------------------- | ----------- | ---------------- |
283
- | errors.UnauthenticatedError | 401 | application/json |
284
- | errors.ResourceNotFoundError | 404 | application/json |
285
- | errors.TooManyRequestsError | 429 | application/json |
286
- | errors.InternalServerError | 500 | application/json |
287
- | errors.APIError | 4XX, 5XX | \*/\* |
270
+ | Property | Type | Description |
271
+ | ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
272
+ | `err.message` | `str` | Error message |
273
+ | `err.status_code` | `int` | HTTP response status code eg `404` |
274
+ | `err.headers` | `httpx.Headers` | HTTP response headers |
275
+ | `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
276
+ | `err.raw_response` | `httpx.Response` | Raw HTTP response |
277
+ | `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](https://github.com/lambdadb/lambdadb-python-client/blob/master/#error-classes). |
288
278
 
289
279
  ### Example
290
-
291
280
  ```python
292
281
  from lambdadb import LambdaDB, errors
293
282
 
@@ -303,22 +292,46 @@ with LambdaDB(
303
292
  # Handle response
304
293
  print(res)
305
294
 
306
- except errors.UnauthenticatedError as e:
307
- # handle e.data: errors.UnauthenticatedErrorData
308
- raise(e)
309
- except errors.ResourceNotFoundError as e:
310
- # handle e.data: errors.ResourceNotFoundErrorData
311
- raise(e)
312
- except errors.TooManyRequestsError as e:
313
- # handle e.data: errors.TooManyRequestsErrorData
314
- raise(e)
315
- except errors.InternalServerError as e:
316
- # handle e.data: errors.InternalServerErrorData
317
- raise(e)
318
- except errors.APIError as e:
319
- # handle exception
320
- raise(e)
295
+
296
+ except errors.LambdaDBError as e:
297
+ # The base class for HTTP error responses
298
+ print(e.message)
299
+ print(e.status_code)
300
+ print(e.body)
301
+ print(e.headers)
302
+ print(e.raw_response)
303
+
304
+ # Depending on the method different errors may be thrown
305
+ if isinstance(e, errors.UnauthenticatedError):
306
+ print(e.data.message) # Optional[str]
321
307
  ```
308
+
309
+ ### Error Classes
310
+ **Primary errors:**
311
+ * [`LambdaDBError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/lambdadberror.py): The base class for HTTP error responses.
312
+ * [`UnauthenticatedError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/unauthenticatederror.py): Unauthenticated. Status code `401`.
313
+ * [`TooManyRequestsError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/toomanyrequestserror.py): Too many requests. Status code `429`.
314
+ * [`InternalServerError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/internalservererror.py): Internal server error. Status code `500`.
315
+ * [`ResourceNotFoundError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/resourcenotfounderror.py): Resource not found. Status code `404`. *
316
+
317
+ <details><summary>Less common errors (7)</summary>
318
+
319
+ <br />
320
+
321
+ **Network errors:**
322
+ * [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
323
+ * [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
324
+ * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
325
+
326
+
327
+ **Inherit from [`LambdaDBError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/lambdadberror.py)**:
328
+ * [`BadRequestError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/badrequesterror.py): Bad request. Status code `400`. Applicable to 8 of 12 methods.*
329
+ * [`ResourceAlreadyExistsError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/resourcealreadyexistserror.py): Resource already exists. Status code `409`. Applicable to 1 of 12 methods.*
330
+ * [`ResponseValidationError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
331
+
332
+ </details>
333
+
334
+ \* Check [the method documentation](https://github.com/lambdadb/lambdadb-python-client/blob/master/#available-resources-and-operations) to see if the error is applicable.
322
335
  <!-- End Error Handling [errors] -->
323
336
 
324
337
  <!-- Start Server Selection [server] -->
@@ -248,29 +248,18 @@ with LambdaDB(
248
248
  <!-- Start Error Handling [errors] -->
249
249
  ## Error Handling
250
250
 
251
- Handling errors in this SDK should largely match your expectations. All operations return a response object or raise an exception.
251
+ [`LambdaDBError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/lambdadberror.py) is the base class for all HTTP error responses. It has the following properties:
252
252
 
253
- By default, an API error will raise a errors.APIError exception, which has the following properties:
254
-
255
- | Property | Type | Description |
256
- |-----------------|------------------|-----------------------|
257
- | `.status_code` | *int* | The HTTP status code |
258
- | `.message` | *str* | The error message |
259
- | `.raw_response` | *httpx.Response* | The raw HTTP response |
260
- | `.body` | *str* | The response content |
261
-
262
- 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:
263
-
264
- | Error Type | Status Code | Content Type |
265
- | ---------------------------- | ----------- | ---------------- |
266
- | errors.UnauthenticatedError | 401 | application/json |
267
- | errors.ResourceNotFoundError | 404 | application/json |
268
- | errors.TooManyRequestsError | 429 | application/json |
269
- | errors.InternalServerError | 500 | application/json |
270
- | errors.APIError | 4XX, 5XX | \*/\* |
253
+ | Property | Type | Description |
254
+ | ------------------ | ---------------- | --------------------------------------------------------------------------------------- |
255
+ | `err.message` | `str` | Error message |
256
+ | `err.status_code` | `int` | HTTP response status code eg `404` |
257
+ | `err.headers` | `httpx.Headers` | HTTP response headers |
258
+ | `err.body` | `str` | HTTP body. Can be empty string if no body is returned. |
259
+ | `err.raw_response` | `httpx.Response` | Raw HTTP response |
260
+ | `err.data` | | Optional. Some errors may contain structured data. [See Error Classes](https://github.com/lambdadb/lambdadb-python-client/blob/master/#error-classes). |
271
261
 
272
262
  ### Example
273
-
274
263
  ```python
275
264
  from lambdadb import LambdaDB, errors
276
265
 
@@ -286,22 +275,46 @@ with LambdaDB(
286
275
  # Handle response
287
276
  print(res)
288
277
 
289
- except errors.UnauthenticatedError as e:
290
- # handle e.data: errors.UnauthenticatedErrorData
291
- raise(e)
292
- except errors.ResourceNotFoundError as e:
293
- # handle e.data: errors.ResourceNotFoundErrorData
294
- raise(e)
295
- except errors.TooManyRequestsError as e:
296
- # handle e.data: errors.TooManyRequestsErrorData
297
- raise(e)
298
- except errors.InternalServerError as e:
299
- # handle e.data: errors.InternalServerErrorData
300
- raise(e)
301
- except errors.APIError as e:
302
- # handle exception
303
- raise(e)
278
+
279
+ except errors.LambdaDBError as e:
280
+ # The base class for HTTP error responses
281
+ print(e.message)
282
+ print(e.status_code)
283
+ print(e.body)
284
+ print(e.headers)
285
+ print(e.raw_response)
286
+
287
+ # Depending on the method different errors may be thrown
288
+ if isinstance(e, errors.UnauthenticatedError):
289
+ print(e.data.message) # Optional[str]
304
290
  ```
291
+
292
+ ### Error Classes
293
+ **Primary errors:**
294
+ * [`LambdaDBError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/lambdadberror.py): The base class for HTTP error responses.
295
+ * [`UnauthenticatedError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/unauthenticatederror.py): Unauthenticated. Status code `401`.
296
+ * [`TooManyRequestsError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/toomanyrequestserror.py): Too many requests. Status code `429`.
297
+ * [`InternalServerError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/internalservererror.py): Internal server error. Status code `500`.
298
+ * [`ResourceNotFoundError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/resourcenotfounderror.py): Resource not found. Status code `404`. *
299
+
300
+ <details><summary>Less common errors (7)</summary>
301
+
302
+ <br />
303
+
304
+ **Network errors:**
305
+ * [`httpx.RequestError`](https://www.python-httpx.org/exceptions/#httpx.RequestError): Base class for request errors.
306
+ * [`httpx.ConnectError`](https://www.python-httpx.org/exceptions/#httpx.ConnectError): HTTP client was unable to make a request to a server.
307
+ * [`httpx.TimeoutException`](https://www.python-httpx.org/exceptions/#httpx.TimeoutException): HTTP request timed out.
308
+
309
+
310
+ **Inherit from [`LambdaDBError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/lambdadberror.py)**:
311
+ * [`BadRequestError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/badrequesterror.py): Bad request. Status code `400`. Applicable to 8 of 12 methods.*
312
+ * [`ResourceAlreadyExistsError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/resourcealreadyexistserror.py): Resource already exists. Status code `409`. Applicable to 1 of 12 methods.*
313
+ * [`ResponseValidationError`](https://github.com/lambdadb/lambdadb-python-client/blob/master/./src/lambdadb/errors/responsevalidationerror.py): Type mismatch between the response data and the expected Pydantic model. Provides access to the Pydantic validation error via the `cause` attribute.
314
+
315
+ </details>
316
+
317
+ \* Check [the method documentation](https://github.com/lambdadb/lambdadb-python-client/blob/master/#available-resources-and-operations) to see if the error is applicable.
305
318
  <!-- End Error Handling [errors] -->
306
319
 
307
320
  <!-- Start Server Selection [server] -->
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "lambdadb"
3
- version = "0.3.5"
3
+ version = "0.3.6"
4
4
  description = "Python Client SDK Generated by Speakeasy."
5
5
  authors = [{ name = "Speakeasy" },]
6
6
  readme = "README-PYPI.md"
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "lambdadb"
6
- __version__: str = "0.3.5"
6
+ __version__: str = "0.3.6"
7
7
  __openapi_doc_version__: str = "1.1.1"
8
- __gen_version__: str = "2.644.1"
9
- __user_agent__: str = "speakeasy-sdk/python 0.3.5 2.644.1 1.1.1 lambdadb"
8
+ __gen_version__: str = "2.647.2"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.3.6 2.647.2 1.1.1 lambdadb"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
@@ -240,7 +240,7 @@ class BaseSDK:
240
240
 
241
241
  if http_res is None:
242
242
  logger.debug("Raising no response SDK error")
243
- raise errors.APIError("No response received")
243
+ raise errors.NoResponseError("No response received")
244
244
 
245
245
  logger.debug(
246
246
  "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s",
@@ -261,7 +261,7 @@ class BaseSDK:
261
261
  http_res = result
262
262
  else:
263
263
  logger.debug("Raising unexpected SDK error")
264
- raise errors.APIError("Unexpected error occurred")
264
+ raise errors.APIError("Unexpected error occurred", http_res)
265
265
 
266
266
  return http_res
267
267
 
@@ -312,7 +312,7 @@ class BaseSDK:
312
312
 
313
313
  if http_res is None:
314
314
  logger.debug("Raising no response SDK error")
315
- raise errors.APIError("No response received")
315
+ raise errors.NoResponseError("No response received")
316
316
 
317
317
  logger.debug(
318
318
  "Response:\nStatus Code: %s\nURL: %s\nHeaders: %s\nBody: %s",
@@ -333,7 +333,7 @@ class BaseSDK:
333
333
  http_res = result
334
334
  else:
335
335
  logger.debug("Raising unexpected SDK error")
336
- raise errors.APIError("Unexpected error occurred")
336
+ raise errors.APIError("Unexpected error occurred", http_res)
337
337
 
338
338
  return http_res
339
339