diff options
Diffstat (limited to '.venv/lib/python3.12/site-packages/unstructured_client/models/errors')
4 files changed, 70 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/unstructured_client/models/errors/__init__.py b/.venv/lib/python3.12/site-packages/unstructured_client/models/errors/__init__.py new file mode 100644 index 00000000..03839458 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/unstructured_client/models/errors/__init__.py @@ -0,0 +1,7 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from .httpvalidationerror import * +from .sdkerror import * +from .servererror import * + +__all__ = ["Detail","HTTPValidationError","SDKError","ServerError"] diff --git a/.venv/lib/python3.12/site-packages/unstructured_client/models/errors/httpvalidationerror.py b/.venv/lib/python3.12/site-packages/unstructured_client/models/errors/httpvalidationerror.py new file mode 100644 index 00000000..9b943ef5 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/unstructured_client/models/errors/httpvalidationerror.py @@ -0,0 +1,21 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from ...models.shared import validationerror as shared_validationerror +from dataclasses_json import Undefined, dataclass_json +from typing import List, Optional, Union +from unstructured_client import utils + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class HTTPValidationError(Exception): + detail: Optional[Detail] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('detail'), 'exclude': lambda f: f is None }}) + + + def __str__(self) -> str: + return utils.marshal_json(self, type(self)) + +Detail = Union[List[shared_validationerror.ValidationError], str] diff --git a/.venv/lib/python3.12/site-packages/unstructured_client/models/errors/sdkerror.py b/.venv/lib/python3.12/site-packages/unstructured_client/models/errors/sdkerror.py new file mode 100644 index 00000000..2e7ef211 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/unstructured_client/models/errors/sdkerror.py @@ -0,0 +1,24 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +import requests as requests_http + + +class SDKError(Exception): + """Represents an error returned by the API.""" + message: str + status_code: int + body: str + raw_response: requests_http.Response + + def __init__(self, message: str, status_code: int, body: str, raw_response: requests_http.Response): + self.message = message + self.status_code = status_code + self.body = body + self.raw_response = raw_response + + def __str__(self): + body = '' + if len(self.body) > 0: + body = f'\n{self.body}' + + return f'{self.message}: Status {self.status_code}{body}' diff --git a/.venv/lib/python3.12/site-packages/unstructured_client/models/errors/servererror.py b/.venv/lib/python3.12/site-packages/unstructured_client/models/errors/servererror.py new file mode 100644 index 00000000..14e1bd77 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/unstructured_client/models/errors/servererror.py @@ -0,0 +1,18 @@ +"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" + +from __future__ import annotations +import dataclasses +from dataclasses_json import Undefined, dataclass_json +from typing import Optional +from unstructured_client import utils + + +@dataclass_json(undefined=Undefined.EXCLUDE) + +@dataclasses.dataclass +class ServerError(Exception): + detail: Optional[str] = dataclasses.field(default=None, metadata={'dataclasses_json': { 'letter_case': utils.get_field_name('detail'), 'exclude': lambda f: f is None }}) + + + def __str__(self) -> str: + return utils.marshal_json(self, type(self)) |