cliV1 0.0.8__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 (87) hide show
  1. cliv1-0.0.8.dist-info/METADATA +168 -0
  2. cliv1-0.0.8.dist-info/RECORD +87 -0
  3. cliv1-0.0.8.dist-info/WHEEL +4 -0
  4. cliv1-0.0.8.dist-info/licenses/LICENSE +21 -0
  5. swagger_petstore_open_api_3_0/__init__.py +15 -0
  6. swagger_petstore_open_api_3_0/apis/__init__.py +5 -0
  7. swagger_petstore_open_api_3_0/apis/pet_api.py +883 -0
  8. swagger_petstore_open_api_3_0/apis/store.py +413 -0
  9. swagger_petstore_open_api_3_0/apis/user_api.py +794 -0
  10. swagger_petstore_open_api_3_0/async_client.py +79 -0
  11. swagger_petstore_open_api_3_0/auth.py +17 -0
  12. swagger_petstore_open_api_3_0/base_client.py +18 -0
  13. swagger_petstore_open_api_3_0/client.py +77 -0
  14. swagger_petstore_open_api_3_0/core/__init__.py +358 -0
  15. swagger_petstore_open_api_3_0/core/_internal/__init__.py +9 -0
  16. swagger_petstore_open_api_3_0/core/_internal/content_disposition.py +154 -0
  17. swagger_petstore_open_api_3_0/core/_internal/flattening.py +139 -0
  18. swagger_petstore_open_api_3_0/core/_internal/headers.py +144 -0
  19. swagger_petstore_open_api_3_0/core/_internal/sse_parser.py +124 -0
  20. swagger_petstore_open_api_3_0/core/_internal/subscripts.py +50 -0
  21. swagger_petstore_open_api_3_0/core/_internal/urls.py +186 -0
  22. swagger_petstore_open_api_3_0/core/_internal/wire.py +198 -0
  23. swagger_petstore_open_api_3_0/core/adapters.py +177 -0
  24. swagger_petstore_open_api_3_0/core/auth/__init__.py +70 -0
  25. swagger_petstore_open_api_3_0/core/auth/composition.py +175 -0
  26. swagger_petstore_open_api_3_0/core/auth/models.py +216 -0
  27. swagger_petstore_open_api_3_0/core/auth/protocols.py +103 -0
  28. swagger_petstore_open_api_3_0/core/auth/schemes/__init__.py +94 -0
  29. swagger_petstore_open_api_3_0/core/auth/schemes/api_key_auth.py +53 -0
  30. swagger_petstore_open_api_3_0/core/auth/schemes/basic_auth.py +73 -0
  31. swagger_petstore_open_api_3_0/core/auth/schemes/bearer_auth.py +21 -0
  32. swagger_petstore_open_api_3_0/core/auth/schemes/oauth2_authorization_code.py +393 -0
  33. swagger_petstore_open_api_3_0/core/auth/schemes/oauth2_client_credentials.py +127 -0
  34. swagger_petstore_open_api_3_0/core/auth/schemes/oauth2_password.py +142 -0
  35. swagger_petstore_open_api_3_0/core/auth/schemes/oauth2_schemes.py +300 -0
  36. swagger_petstore_open_api_3_0/core/base_raw_response.py +49 -0
  37. swagger_petstore_open_api_3_0/core/bodies.py +550 -0
  38. swagger_petstore_open_api_3_0/core/converters/__init__.py +68 -0
  39. swagger_petstore_open_api_3_0/core/converters/date_time.py +237 -0
  40. swagger_petstore_open_api_3_0/core/converters/encoded_bytes.py +273 -0
  41. swagger_petstore_open_api_3_0/core/converters/open_enum.py +35 -0
  42. swagger_petstore_open_api_3_0/core/decoding.py +498 -0
  43. swagger_petstore_open_api_3_0/core/discriminators.py +129 -0
  44. swagger_petstore_open_api_3_0/core/event_streams.py +225 -0
  45. swagger_petstore_open_api_3_0/core/exceptions.py +38 -0
  46. swagger_petstore_open_api_3_0/core/file_responses.py +335 -0
  47. swagger_petstore_open_api_3_0/core/files.py +173 -0
  48. swagger_petstore_open_api_3_0/core/httpx_transport.py +748 -0
  49. swagger_petstore_open_api_3_0/core/models.py +143 -0
  50. swagger_petstore_open_api_3_0/core/optionality.py +130 -0
  51. swagger_petstore_open_api_3_0/core/params.py +157 -0
  52. swagger_petstore_open_api_3_0/core/raw_client.py +338 -0
  53. swagger_petstore_open_api_3_0/core/request_options.py +94 -0
  54. swagger_petstore_open_api_3_0/core/results.py +123 -0
  55. swagger_petstore_open_api_3_0/core/runtime_env.py +43 -0
  56. swagger_petstore_open_api_3_0/core/servers.py +33 -0
  57. swagger_petstore_open_api_3_0/core/transport.py +191 -0
  58. swagger_petstore_open_api_3_0/errors/__init__.py +48 -0
  59. swagger_petstore_open_api_3_0/errors/add_pet_error.py +21 -0
  60. swagger_petstore_open_api_3_0/errors/delete_order_error.py +21 -0
  61. swagger_petstore_open_api_3_0/errors/delete_pet_error.py +21 -0
  62. swagger_petstore_open_api_3_0/errors/delete_user_error.py +21 -0
  63. swagger_petstore_open_api_3_0/errors/find_pets_by_status_error.py +21 -0
  64. swagger_petstore_open_api_3_0/errors/find_pets_by_tags_error.py +21 -0
  65. swagger_petstore_open_api_3_0/errors/get_order_by_id_error.py +21 -0
  66. swagger_petstore_open_api_3_0/errors/get_pet_by_id_error.py +21 -0
  67. swagger_petstore_open_api_3_0/errors/get_user_by_name_error.py +21 -0
  68. swagger_petstore_open_api_3_0/errors/login_user_error.py +21 -0
  69. swagger_petstore_open_api_3_0/errors/place_order_error.py +21 -0
  70. swagger_petstore_open_api_3_0/errors/update_pet_error.py +21 -0
  71. swagger_petstore_open_api_3_0/errors/update_pet_with_form_error.py +21 -0
  72. swagger_petstore_open_api_3_0/errors/update_user_error.py +21 -0
  73. swagger_petstore_open_api_3_0/errors/upload_file_error.py +21 -0
  74. swagger_petstore_open_api_3_0/models/__init__.py +23 -0
  75. swagger_petstore_open_api_3_0/models/api_response.py +18 -0
  76. swagger_petstore_open_api_3_0/models/category.py +15 -0
  77. swagger_petstore_open_api_3_0/models/enums/__init__.py +4 -0
  78. swagger_petstore_open_api_3_0/models/enums/order_status.py +17 -0
  79. swagger_petstore_open_api_3_0/models/enums/pet_status.py +17 -0
  80. swagger_petstore_open_api_3_0/models/order.py +27 -0
  81. swagger_petstore_open_api_3_0/models/pet.py +28 -0
  82. swagger_petstore_open_api_3_0/models/tag_model.py +15 -0
  83. swagger_petstore_open_api_3_0/models/user.py +29 -0
  84. swagger_petstore_open_api_3_0/py.typed +0 -0
  85. swagger_petstore_open_api_3_0/server/__init__.py +21 -0
  86. swagger_petstore_open_api_3_0/server/server.py +17 -0
  87. swagger_petstore_open_api_3_0/server/server_config.py +52 -0
@@ -0,0 +1,191 @@
1
+ """The HTTP boundary: what a request and a response are, and what a transport must provide.
2
+
3
+ The two protocols are the seam between the SDK and whatever HTTP library actually moves bytes.
4
+ Keeping them SDK-owned is deliberate: no third-party request or response type reaches the public
5
+ surface, and a caller can supply their own transport by satisfying :class:`HttpClient` or
6
+ :class:`AsyncHttpClient`.
7
+
8
+ There is no response *dataclass* here at all. A result carries the head as fields of its own, and a
9
+ body that has been read is ``bytes`` -- handed to a decode step or to an error mapper beside the
10
+ status it switches on. So the vocabulary at this boundary is three things: a request, a response
11
+ whose body is still on the wire, and the bytes that come off it.
12
+
13
+ The request and response shapes live here; the body shapes a request can carry live in
14
+ ``bodies.py``, beside the factories that build them, and reach a transport through
15
+ :attr:`HttpRequest.body`."""
16
+
17
+ from __future__ import annotations
18
+
19
+ from collections.abc import AsyncIterator, Iterator, Mapping
20
+ from dataclasses import dataclass
21
+ from typing import Protocol
22
+
23
+ from ._internal.urls import strip_query
24
+ from .bodies import RequestBody
25
+
26
+
27
+ @dataclass(frozen=True, slots=True)
28
+ class HttpRequest:
29
+ """An outbound request, fully resolved and ready for a transport to send."""
30
+
31
+ method: str
32
+ url: str
33
+ headers: Mapping[str, str]
34
+
35
+ body: RequestBody | None = None
36
+ timeout: float | None = None
37
+ """Seconds to wait, or ``None`` to leave the transport's own timeout in force."""
38
+
39
+ def __repr__(self) -> str:
40
+ # Identify by method and path only. ``headers`` holds the rendered credential, the query
41
+ # string holds a query-placed api key, and ``body`` holds a form-encoded ``client_secret``
42
+ # -- so none of the three reaches the string form. This is also the type that crosses the
43
+ # ``HttpClient`` seam, which is where a logging transport would print it. The fields stay
44
+ # readable: this is a string form, not redaction.
45
+ return f"{type(self).__name__}(method={self.method!r}, url={strip_query(self.url)!r})"
46
+
47
+
48
+ class HttpResponse(Protocol):
49
+ """A response whose head has arrived and whose body has not been read.
50
+
51
+ The status and headers are facts as soon as this exists, which is what lets a streamed call
52
+ still yield a ``Success`` or a ``Failure``: only the payload is deferred, never the outcome.
53
+ It holds a connection until it is closed. Header names MUST be lowercased, the same rule the
54
+ request side applies in ``_internal/headers.py``.
55
+
56
+ ``read`` is the seam the error path and every buffered decoder take, not a convenience over
57
+ ``iter_bytes``: it must both buffer the whole body *and* release the connection, so a body
58
+ survives the close that frees the socket.
59
+
60
+ ``iter_bytes`` re-chunks to ``chunk_size`` bytes when given an ``int``; given ``None`` it MUST yield
61
+ each chunk as the network delivered it, buffering nothing of its own -- a latency-bound consumer such
62
+ as an event stream reads it that way, since a fixed size would hold a twenty-byte event back until
63
+ enough followed it.
64
+
65
+ ``close`` MUST be idempotent. The runtime closes twice on one path: a buffered decoder releases
66
+ the body in its own ``finally``, and a decoder that raises is then closed again by the seam that
67
+ called it -- the belt that keeps a failed decode from stranding a socket."""
68
+
69
+ @property
70
+ def url(self) -> str:
71
+ """The URL this response came from.
72
+
73
+ Carried on the response rather than passed alongside it, because the payloads that outlive
74
+ the call are the only readers and have no other way to name themselves once abandoned. It
75
+ is the URL the request asked for: the SDK never follows redirects."""
76
+ ...
77
+
78
+ @property
79
+ def status_code(self) -> int: ...
80
+
81
+ @property
82
+ def headers(self) -> Mapping[str, str]: ...
83
+
84
+ def iter_bytes(self, chunk_size: int | None) -> Iterator[bytes]: ...
85
+
86
+ def read(self) -> bytes: ...
87
+
88
+ def close(self) -> None: ...
89
+
90
+
91
+ class AsyncHttpResponse(Protocol):
92
+ """The awaited twin. ``aclose`` rather than ``close``, matching the SDK's async client.
93
+
94
+ ``url``, ``status_code`` and ``headers`` stay synchronous properties -- the head has already
95
+ arrived. Header names MUST be lowercased, the same rule the request side applies, and ``aread``
96
+ carries ``read``'s obligation: buffer the whole body and release the connection. ``aclose``
97
+ carries ``close``'s -- it MUST be idempotent, for the same double-close path. ``aiter_bytes``
98
+ carries ``iter_bytes``'s ``chunk_size`` contract, ``None`` included."""
99
+
100
+ @property
101
+ def url(self) -> str:
102
+ """The URL this response came from; see :attr:`HttpResponse.url`."""
103
+ ...
104
+
105
+ @property
106
+ def status_code(self) -> int: ...
107
+
108
+ @property
109
+ def headers(self) -> Mapping[str, str]: ...
110
+
111
+ def aiter_bytes(self, chunk_size: int | None) -> AsyncIterator[bytes]: ...
112
+
113
+ async def aread(self) -> bytes: ...
114
+
115
+ async def aclose(self) -> None: ...
116
+
117
+
118
+ class HttpClient(Protocol):
119
+ """Sync transport contract.
120
+
121
+ There is **one** request seam. ``send`` returns as soon as the response head has arrived and
122
+ never reads the body; who reads it, and when the connection is released, is the decoder's
123
+ business (ADR-0063). A transport that buffered would be answering a question nobody asked --
124
+ and, underneath, the library this one wraps reaches a streamed response first in either case.
125
+
126
+ Implementations:
127
+ - MUST NOT mutate the incoming :class:`HttpRequest`.
128
+ - MUST honour ``request.timeout`` when it is set, and fall back to their own configured
129
+ timeout when it is ``None``.
130
+ - MUST lowercase the header names on the returned response: HTTP/1.1 treats them
131
+ case-insensitively and HTTP/2 requires lowercase, so a caller's lookup needs no case
132
+ handling -- the same rule, for the same reason, as the request side in
133
+ ``_internal/headers.py``.
134
+ - MUST label a body from what the body carries, and spell nothing of its own: a
135
+ :class:`BinaryBody`'s ``media_type`` as ``Content-Type`` and, where it names one, its
136
+ ``filename`` as ``Content-Disposition``. Both merge **underneath** ``request.headers``, so a
137
+ caller's ``extra_headers`` still wins. The shipped transport renders the disposition through
138
+ ``_internal/content_disposition.py``; a custom one owning that rendering is the cost it
139
+ already carries for the media type.
140
+ - SHOULD be idempotent for ``close()``.
141
+ - MAY raise their underlying library's exceptions."""
142
+
143
+ def send(self, request: HttpRequest) -> HttpResponse:
144
+ """Execute a request and return its response with the body unread.
145
+
146
+ Returns once the response head has arrived; the connection stays checked out until the
147
+ returned response is closed.
148
+
149
+ Args:
150
+ request: The request to send, which MUST NOT be mutated.
151
+
152
+ Returns:
153
+ The response head, its body pending, its header names lowercased."""
154
+ ...
155
+
156
+ def close(self) -> None:
157
+ """Release underlying resources (connections, pools). Should be idempotent."""
158
+ ...
159
+
160
+
161
+ class AsyncHttpClient(Protocol):
162
+ """Async transport contract -- the same shape as :class:`HttpClient`, awaited.
163
+
164
+ The same obligations apply, including honouring ``request.timeout``, lowercasing the
165
+ response's header names, and leaving the body unread. ``aclose`` rather than ``close`` matches
166
+ httpx and the SDK's own async client.
167
+
168
+ One obligation is this side's alone:
169
+
170
+ - Implementations MUST resolve an async :attr:`MultipartFile.content` themselves. A multipart
171
+ encoder pulls every part from a synchronous chunk generator, so an awaitable ``read`` cannot
172
+ be driven from inside one; the shipped transport drains such a part to a temp file before
173
+ encoding, which keeps it bounded rather than resident and leaves it sized. A raw
174
+ :class:`BinaryBody` needs no such pre-pass -- its async arms stream natively."""
175
+
176
+ async def send(self, request: HttpRequest) -> AsyncHttpResponse:
177
+ """Execute a request and return its response with the body unread.
178
+
179
+ Returns once the response head has arrived; the connection stays checked out until the
180
+ returned response is closed.
181
+
182
+ Args:
183
+ request: The request to send, which MUST NOT be mutated.
184
+
185
+ Returns:
186
+ The response head, its body pending, its header names lowercased."""
187
+ ...
188
+
189
+ async def aclose(self) -> None:
190
+ """Release underlying resources (connections, pools). Should be idempotent."""
191
+ ...
@@ -0,0 +1,48 @@
1
+ from .add_pet_error import AddPetErrorBody, add_pet_error_mapper
2
+ from .delete_order_error import DeleteOrderErrorBody, delete_order_error_mapper
3
+ from .delete_pet_error import DeletePetErrorBody, delete_pet_error_mapper
4
+ from .delete_user_error import DeleteUserErrorBody, delete_user_error_mapper
5
+ from .find_pets_by_status_error import FindPetsByStatusErrorBody, find_pets_by_status_error_mapper
6
+ from .find_pets_by_tags_error import FindPetsByTagsErrorBody, find_pets_by_tags_error_mapper
7
+ from .get_order_by_id_error import GetOrderByIdErrorBody, get_order_by_id_error_mapper
8
+ from .get_pet_by_id_error import GetPetByIdErrorBody, get_pet_by_id_error_mapper
9
+ from .get_user_by_name_error import GetUserByNameErrorBody, get_user_by_name_error_mapper
10
+ from .login_user_error import LoginUserErrorBody, login_user_error_mapper
11
+ from .place_order_error import PlaceOrderErrorBody, place_order_error_mapper
12
+ from .update_pet_error import UpdatePetErrorBody, update_pet_error_mapper
13
+ from .update_pet_with_form_error import UpdatePetWithFormErrorBody, update_pet_with_form_error_mapper
14
+ from .update_user_error import UpdateUserErrorBody, update_user_error_mapper
15
+ from .upload_file_error import UploadFileErrorBody, upload_file_error_mapper
16
+
17
+ __all__ = [
18
+ "AddPetErrorBody",
19
+ "DeleteOrderErrorBody",
20
+ "DeletePetErrorBody",
21
+ "DeleteUserErrorBody",
22
+ "FindPetsByStatusErrorBody",
23
+ "FindPetsByTagsErrorBody",
24
+ "GetOrderByIdErrorBody",
25
+ "GetPetByIdErrorBody",
26
+ "GetUserByNameErrorBody",
27
+ "LoginUserErrorBody",
28
+ "PlaceOrderErrorBody",
29
+ "UpdatePetErrorBody",
30
+ "UpdatePetWithFormErrorBody",
31
+ "UpdateUserErrorBody",
32
+ "UploadFileErrorBody",
33
+ "add_pet_error_mapper",
34
+ "delete_order_error_mapper",
35
+ "delete_pet_error_mapper",
36
+ "delete_user_error_mapper",
37
+ "find_pets_by_status_error_mapper",
38
+ "find_pets_by_tags_error_mapper",
39
+ "get_order_by_id_error_mapper",
40
+ "get_pet_by_id_error_mapper",
41
+ "get_user_by_name_error_mapper",
42
+ "login_user_error_mapper",
43
+ "place_order_error_mapper",
44
+ "update_pet_error_mapper",
45
+ "update_pet_with_form_error_mapper",
46
+ "update_user_error_mapper",
47
+ "upload_file_error_mapper",
48
+ ]
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ AddPetErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _AddPetError:
13
+ def map(self, status_code: int, content: bytes) -> AddPetErrorBody:
14
+ match status_code:
15
+ case 400 | 422:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ add_pet_error_mapper: Final[ErrorMapper[AddPetErrorBody]] = _AddPetError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ DeleteOrderErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _DeleteOrderError:
13
+ def map(self, status_code: int, content: bytes) -> DeleteOrderErrorBody:
14
+ match status_code:
15
+ case 400 | 404:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ delete_order_error_mapper: Final[ErrorMapper[DeleteOrderErrorBody]] = _DeleteOrderError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ DeletePetErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _DeletePetError:
13
+ def map(self, status_code: int, content: bytes) -> DeletePetErrorBody:
14
+ match status_code:
15
+ case 400:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ delete_pet_error_mapper: Final[ErrorMapper[DeletePetErrorBody]] = _DeletePetError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ DeleteUserErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _DeleteUserError:
13
+ def map(self, status_code: int, content: bytes) -> DeleteUserErrorBody:
14
+ match status_code:
15
+ case 400 | 404:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ delete_user_error_mapper: Final[ErrorMapper[DeleteUserErrorBody]] = _DeleteUserError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ FindPetsByStatusErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _FindPetsByStatusError:
13
+ def map(self, status_code: int, content: bytes) -> FindPetsByStatusErrorBody:
14
+ match status_code:
15
+ case 400:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ find_pets_by_status_error_mapper: Final[ErrorMapper[FindPetsByStatusErrorBody]] = _FindPetsByStatusError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ FindPetsByTagsErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _FindPetsByTagsError:
13
+ def map(self, status_code: int, content: bytes) -> FindPetsByTagsErrorBody:
14
+ match status_code:
15
+ case 400:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ find_pets_by_tags_error_mapper: Final[ErrorMapper[FindPetsByTagsErrorBody]] = _FindPetsByTagsError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ GetOrderByIdErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _GetOrderByIdError:
13
+ def map(self, status_code: int, content: bytes) -> GetOrderByIdErrorBody:
14
+ match status_code:
15
+ case 400 | 404:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ get_order_by_id_error_mapper: Final[ErrorMapper[GetOrderByIdErrorBody]] = _GetOrderByIdError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ GetPetByIdErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _GetPetByIdError:
13
+ def map(self, status_code: int, content: bytes) -> GetPetByIdErrorBody:
14
+ match status_code:
15
+ case 400 | 404:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ get_pet_by_id_error_mapper: Final[ErrorMapper[GetPetByIdErrorBody]] = _GetPetByIdError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ GetUserByNameErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _GetUserByNameError:
13
+ def map(self, status_code: int, content: bytes) -> GetUserByNameErrorBody:
14
+ match status_code:
15
+ case 400 | 404:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ get_user_by_name_error_mapper: Final[ErrorMapper[GetUserByNameErrorBody]] = _GetUserByNameError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ LoginUserErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _LoginUserError:
13
+ def map(self, status_code: int, content: bytes) -> LoginUserErrorBody:
14
+ match status_code:
15
+ case 400:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ login_user_error_mapper: Final[ErrorMapper[LoginUserErrorBody]] = _LoginUserError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ PlaceOrderErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _PlaceOrderError:
13
+ def map(self, status_code: int, content: bytes) -> PlaceOrderErrorBody:
14
+ match status_code:
15
+ case 400 | 422:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ place_order_error_mapper: Final[ErrorMapper[PlaceOrderErrorBody]] = _PlaceOrderError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ UpdatePetErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _UpdatePetError:
13
+ def map(self, status_code: int, content: bytes) -> UpdatePetErrorBody:
14
+ match status_code:
15
+ case 400 | 404 | 422:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ update_pet_error_mapper: Final[ErrorMapper[UpdatePetErrorBody]] = _UpdatePetError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ UpdatePetWithFormErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _UpdatePetWithFormError:
13
+ def map(self, status_code: int, content: bytes) -> UpdatePetWithFormErrorBody:
14
+ match status_code:
15
+ case 400:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ update_pet_with_form_error_mapper: Final[ErrorMapper[UpdatePetWithFormErrorBody]] = _UpdatePetWithFormError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ UpdateUserErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _UpdateUserError:
13
+ def map(self, status_code: int, content: bytes) -> UpdateUserErrorBody:
14
+ match status_code:
15
+ case 400 | 404:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ update_user_error_mapper: Final[ErrorMapper[UpdateUserErrorBody]] = _UpdateUserError()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ from dataclasses import dataclass
4
+ from typing import Final, TypeAlias
5
+
6
+ from ..core import ErrorMapper, RawError
7
+
8
+ UploadFileErrorBody: TypeAlias = RawError
9
+
10
+
11
+ @dataclass(frozen=True, slots=True)
12
+ class _UploadFileError:
13
+ def map(self, status_code: int, content: bytes) -> UploadFileErrorBody:
14
+ match status_code:
15
+ case 400 | 404:
16
+ return RawError(status_code, content)
17
+ case _:
18
+ return RawError(status_code, content)
19
+
20
+
21
+ upload_file_error_mapper: Final[ErrorMapper[UploadFileErrorBody]] = _UploadFileError()
@@ -0,0 +1,23 @@
1
+ from . import enums
2
+ from .api_response import ApiResponse, ApiResponseDict
3
+ from .category import Category, CategoryDict
4
+ from .order import Order, OrderDict
5
+ from .pet import Pet, PetDict
6
+ from .tag_model import TagModel, TagModelDict
7
+ from .user import User, UserDict
8
+
9
+ __all__ = [
10
+ "enums",
11
+ "ApiResponse",
12
+ "ApiResponseDict",
13
+ "Category",
14
+ "CategoryDict",
15
+ "Order",
16
+ "OrderDict",
17
+ "Pet",
18
+ "PetDict",
19
+ "TagModel",
20
+ "TagModelDict",
21
+ "User",
22
+ "UserDict",
23
+ ]
@@ -0,0 +1,18 @@
1
+ from __future__ import annotations
2
+
3
+ from pydantic import Field
4
+ from typing_extensions import NotRequired, TypedDict
5
+
6
+ from ..core import UNSET, Optional, SdkBaseModel
7
+
8
+
9
+ class ApiResponse(SdkBaseModel):
10
+ code: Optional[int] = UNSET
11
+ type_: Optional[str] = Field(default=UNSET, alias="type")
12
+ message: Optional[str] = UNSET
13
+
14
+
15
+ class ApiResponseDict(TypedDict):
16
+ code: NotRequired[int]
17
+ type_: NotRequired[str]
18
+ message: NotRequired[str]
@@ -0,0 +1,15 @@
1
+ from __future__ import annotations
2
+
3
+ from typing_extensions import NotRequired, TypedDict
4
+
5
+ from ..core import UNSET, Optional, SdkBaseModel
6
+
7
+
8
+ class Category(SdkBaseModel):
9
+ id: Optional[int] = UNSET
10
+ name: Optional[str] = UNSET
11
+
12
+
13
+ class CategoryDict(TypedDict):
14
+ id: NotRequired[int]
15
+ name: NotRequired[str]
@@ -0,0 +1,4 @@
1
+ from .order_status import OrderStatus, OrderStatusOrStr
2
+ from .pet_status import PetStatus, PetStatusOrStr
3
+
4
+ __all__ = ["OrderStatus", "OrderStatusOrStr", "PetStatus", "PetStatusOrStr"]
@@ -0,0 +1,17 @@
1
+ from enum import Enum
2
+ from typing import Annotated, TypeAlias
3
+
4
+ from ...core import open_enum_validator
5
+
6
+
7
+ class OrderStatus(str, Enum):
8
+ """Order Status"""
9
+
10
+ PLACED = "placed"
11
+ APPROVED = "approved"
12
+ DELIVERED = "delivered"
13
+
14
+ __str__ = str.__str__
15
+
16
+
17
+ OrderStatusOrStr: TypeAlias = Annotated[OrderStatus | str, open_enum_validator(OrderStatus)]