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.
- cliv1-0.0.8.dist-info/METADATA +168 -0
- cliv1-0.0.8.dist-info/RECORD +87 -0
- cliv1-0.0.8.dist-info/WHEEL +4 -0
- cliv1-0.0.8.dist-info/licenses/LICENSE +21 -0
- swagger_petstore_open_api_3_0/__init__.py +15 -0
- swagger_petstore_open_api_3_0/apis/__init__.py +5 -0
- swagger_petstore_open_api_3_0/apis/pet_api.py +883 -0
- swagger_petstore_open_api_3_0/apis/store.py +413 -0
- swagger_petstore_open_api_3_0/apis/user_api.py +794 -0
- swagger_petstore_open_api_3_0/async_client.py +79 -0
- swagger_petstore_open_api_3_0/auth.py +17 -0
- swagger_petstore_open_api_3_0/base_client.py +18 -0
- swagger_petstore_open_api_3_0/client.py +77 -0
- swagger_petstore_open_api_3_0/core/__init__.py +358 -0
- swagger_petstore_open_api_3_0/core/_internal/__init__.py +9 -0
- swagger_petstore_open_api_3_0/core/_internal/content_disposition.py +154 -0
- swagger_petstore_open_api_3_0/core/_internal/flattening.py +139 -0
- swagger_petstore_open_api_3_0/core/_internal/headers.py +144 -0
- swagger_petstore_open_api_3_0/core/_internal/sse_parser.py +124 -0
- swagger_petstore_open_api_3_0/core/_internal/subscripts.py +50 -0
- swagger_petstore_open_api_3_0/core/_internal/urls.py +186 -0
- swagger_petstore_open_api_3_0/core/_internal/wire.py +198 -0
- swagger_petstore_open_api_3_0/core/adapters.py +177 -0
- swagger_petstore_open_api_3_0/core/auth/__init__.py +70 -0
- swagger_petstore_open_api_3_0/core/auth/composition.py +175 -0
- swagger_petstore_open_api_3_0/core/auth/models.py +216 -0
- swagger_petstore_open_api_3_0/core/auth/protocols.py +103 -0
- swagger_petstore_open_api_3_0/core/auth/schemes/__init__.py +94 -0
- swagger_petstore_open_api_3_0/core/auth/schemes/api_key_auth.py +53 -0
- swagger_petstore_open_api_3_0/core/auth/schemes/basic_auth.py +73 -0
- swagger_petstore_open_api_3_0/core/auth/schemes/bearer_auth.py +21 -0
- swagger_petstore_open_api_3_0/core/auth/schemes/oauth2_authorization_code.py +393 -0
- swagger_petstore_open_api_3_0/core/auth/schemes/oauth2_client_credentials.py +127 -0
- swagger_petstore_open_api_3_0/core/auth/schemes/oauth2_password.py +142 -0
- swagger_petstore_open_api_3_0/core/auth/schemes/oauth2_schemes.py +300 -0
- swagger_petstore_open_api_3_0/core/base_raw_response.py +49 -0
- swagger_petstore_open_api_3_0/core/bodies.py +550 -0
- swagger_petstore_open_api_3_0/core/converters/__init__.py +68 -0
- swagger_petstore_open_api_3_0/core/converters/date_time.py +237 -0
- swagger_petstore_open_api_3_0/core/converters/encoded_bytes.py +273 -0
- swagger_petstore_open_api_3_0/core/converters/open_enum.py +35 -0
- swagger_petstore_open_api_3_0/core/decoding.py +498 -0
- swagger_petstore_open_api_3_0/core/discriminators.py +129 -0
- swagger_petstore_open_api_3_0/core/event_streams.py +225 -0
- swagger_petstore_open_api_3_0/core/exceptions.py +38 -0
- swagger_petstore_open_api_3_0/core/file_responses.py +335 -0
- swagger_petstore_open_api_3_0/core/files.py +173 -0
- swagger_petstore_open_api_3_0/core/httpx_transport.py +748 -0
- swagger_petstore_open_api_3_0/core/models.py +143 -0
- swagger_petstore_open_api_3_0/core/optionality.py +130 -0
- swagger_petstore_open_api_3_0/core/params.py +157 -0
- swagger_petstore_open_api_3_0/core/raw_client.py +338 -0
- swagger_petstore_open_api_3_0/core/request_options.py +94 -0
- swagger_petstore_open_api_3_0/core/results.py +123 -0
- swagger_petstore_open_api_3_0/core/runtime_env.py +43 -0
- swagger_petstore_open_api_3_0/core/servers.py +33 -0
- swagger_petstore_open_api_3_0/core/transport.py +191 -0
- swagger_petstore_open_api_3_0/errors/__init__.py +48 -0
- swagger_petstore_open_api_3_0/errors/add_pet_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/delete_order_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/delete_pet_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/delete_user_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/find_pets_by_status_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/find_pets_by_tags_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/get_order_by_id_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/get_pet_by_id_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/get_user_by_name_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/login_user_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/place_order_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/update_pet_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/update_pet_with_form_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/update_user_error.py +21 -0
- swagger_petstore_open_api_3_0/errors/upload_file_error.py +21 -0
- swagger_petstore_open_api_3_0/models/__init__.py +23 -0
- swagger_petstore_open_api_3_0/models/api_response.py +18 -0
- swagger_petstore_open_api_3_0/models/category.py +15 -0
- swagger_petstore_open_api_3_0/models/enums/__init__.py +4 -0
- swagger_petstore_open_api_3_0/models/enums/order_status.py +17 -0
- swagger_petstore_open_api_3_0/models/enums/pet_status.py +17 -0
- swagger_petstore_open_api_3_0/models/order.py +27 -0
- swagger_petstore_open_api_3_0/models/pet.py +28 -0
- swagger_petstore_open_api_3_0/models/tag_model.py +15 -0
- swagger_petstore_open_api_3_0/models/user.py +29 -0
- swagger_petstore_open_api_3_0/py.typed +0 -0
- swagger_petstore_open_api_3_0/server/__init__.py +21 -0
- swagger_petstore_open_api_3_0/server/server.py +17 -0
- swagger_petstore_open_api_3_0/server/server_config.py +52 -0
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from uuid import UUID, uuid4
|
|
4
|
+
|
|
5
|
+
from ..auth import AsyncAuthSchemes, AuthSchemes
|
|
6
|
+
from ..core import (
|
|
7
|
+
ApiResult,
|
|
8
|
+
AsyncRawClient,
|
|
9
|
+
RawClient,
|
|
10
|
+
RawError,
|
|
11
|
+
RequestOptionsOrDict,
|
|
12
|
+
RFC3339DateTime,
|
|
13
|
+
SecuredRawResponse,
|
|
14
|
+
async_empty_response,
|
|
15
|
+
async_json_decoder,
|
|
16
|
+
empty_response,
|
|
17
|
+
form_body,
|
|
18
|
+
json_decoder,
|
|
19
|
+
param,
|
|
20
|
+
raw_error_response,
|
|
21
|
+
)
|
|
22
|
+
from ..errors.delete_order_error import DeleteOrderErrorBody, delete_order_error_mapper
|
|
23
|
+
from ..errors.get_order_by_id_error import GetOrderByIdErrorBody, get_order_by_id_error_mapper
|
|
24
|
+
from ..errors.place_order_error import PlaceOrderErrorBody, place_order_error_mapper
|
|
25
|
+
from ..models.enums.order_status import OrderStatusOrStr
|
|
26
|
+
from ..models.order import Order
|
|
27
|
+
from ..server.server import Server
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
class Store:
|
|
31
|
+
def __init__(self, client: RawClient, server: Server, auth: AuthSchemes) -> None:
|
|
32
|
+
self._with_raw_response = StoreWithRawResponse(client, server, auth)
|
|
33
|
+
|
|
34
|
+
def delete_order(self, order_id: int, *, request_options: RequestOptionsOrDict | None = None) -> None:
|
|
35
|
+
"""For valid response try integer IDs with value < 1000. Anything above 1000 or non-integers will generate API
|
|
36
|
+
errors.
|
|
37
|
+
|
|
38
|
+
Args:
|
|
39
|
+
order_id: ID of the order that needs to be deleted
|
|
40
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
order deleted
|
|
44
|
+
|
|
45
|
+
Raises:
|
|
46
|
+
ApiError: Invalid ID supplied Order not found ``error`` is ``RawError``."""
|
|
47
|
+
return self._with_raw_response.delete_order(order_id, request_options=request_options).unwrap()
|
|
48
|
+
|
|
49
|
+
def get_inventory(self, *, request_options: RequestOptionsOrDict | None = None) -> dict[str, int]:
|
|
50
|
+
"""Returns a map of status codes to quantities.
|
|
51
|
+
|
|
52
|
+
Args:
|
|
53
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
54
|
+
|
|
55
|
+
Returns:
|
|
56
|
+
successful operation
|
|
57
|
+
|
|
58
|
+
Raises:
|
|
59
|
+
ApiError: If the API responds with an error status code. ``error`` is ``RawError``."""
|
|
60
|
+
return self._with_raw_response.get_inventory(request_options=request_options).unwrap()
|
|
61
|
+
|
|
62
|
+
def get_order_by_id(self, order_id: int, *, request_options: RequestOptionsOrDict | None = None) -> Order:
|
|
63
|
+
"""For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
|
|
64
|
+
|
|
65
|
+
Args:
|
|
66
|
+
order_id: ID of order that needs to be fetched
|
|
67
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
68
|
+
|
|
69
|
+
Returns:
|
|
70
|
+
successful operation
|
|
71
|
+
|
|
72
|
+
Raises:
|
|
73
|
+
ApiError: Invalid ID supplied Order not found ``error`` is ``RawError``."""
|
|
74
|
+
return self._with_raw_response.get_order_by_id(order_id, request_options=request_options).unwrap()
|
|
75
|
+
|
|
76
|
+
def place_order(
|
|
77
|
+
self,
|
|
78
|
+
*,
|
|
79
|
+
id_: int | None = None,
|
|
80
|
+
pet_id: int | None = None,
|
|
81
|
+
quantity: int | None = None,
|
|
82
|
+
ship_date: RFC3339DateTime | None = None,
|
|
83
|
+
status: OrderStatusOrStr | None = None,
|
|
84
|
+
complete: bool | None = None,
|
|
85
|
+
request_options: RequestOptionsOrDict | None = None,
|
|
86
|
+
) -> Order:
|
|
87
|
+
"""Place a new order in the store.
|
|
88
|
+
|
|
89
|
+
Args:
|
|
90
|
+
id_: Value sent with the request.
|
|
91
|
+
pet_id: Value sent with the request.
|
|
92
|
+
quantity: Value sent with the request.
|
|
93
|
+
ship_date: Value sent with the request.
|
|
94
|
+
status: Order Status
|
|
95
|
+
complete: Value sent with the request.
|
|
96
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
97
|
+
|
|
98
|
+
Returns:
|
|
99
|
+
successful operation
|
|
100
|
+
|
|
101
|
+
Raises:
|
|
102
|
+
ApiError: Invalid input Validation exception ``error`` is ``RawError``."""
|
|
103
|
+
return self._with_raw_response.place_order(
|
|
104
|
+
id_=id_,
|
|
105
|
+
pet_id=pet_id,
|
|
106
|
+
quantity=quantity,
|
|
107
|
+
ship_date=ship_date,
|
|
108
|
+
status=status,
|
|
109
|
+
complete=complete,
|
|
110
|
+
request_options=request_options,
|
|
111
|
+
).unwrap()
|
|
112
|
+
|
|
113
|
+
@property
|
|
114
|
+
def with_raw_response(self) -> StoreWithRawResponse:
|
|
115
|
+
return self._with_raw_response
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
class AsyncStore:
|
|
119
|
+
def __init__(self, client: AsyncRawClient, server: Server, auth: AsyncAuthSchemes) -> None:
|
|
120
|
+
self._with_raw_response = AsyncStoreWithRawResponse(client, server, auth)
|
|
121
|
+
|
|
122
|
+
async def delete_order(self, order_id: int, *, request_options: RequestOptionsOrDict | None = None) -> None:
|
|
123
|
+
"""For valid response try integer IDs with value < 1000. Anything above 1000 or non-integers will generate API
|
|
124
|
+
errors.
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
order_id: ID of the order that needs to be deleted
|
|
128
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
129
|
+
|
|
130
|
+
Returns:
|
|
131
|
+
order deleted
|
|
132
|
+
|
|
133
|
+
Raises:
|
|
134
|
+
ApiError: Invalid ID supplied Order not found ``error`` is ``RawError``."""
|
|
135
|
+
return (await self._with_raw_response.delete_order(order_id, request_options=request_options)).unwrap()
|
|
136
|
+
|
|
137
|
+
async def get_inventory(self, *, request_options: RequestOptionsOrDict | None = None) -> dict[str, int]:
|
|
138
|
+
"""Returns a map of status codes to quantities.
|
|
139
|
+
|
|
140
|
+
Args:
|
|
141
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
142
|
+
|
|
143
|
+
Returns:
|
|
144
|
+
successful operation
|
|
145
|
+
|
|
146
|
+
Raises:
|
|
147
|
+
ApiError: If the API responds with an error status code. ``error`` is ``RawError``."""
|
|
148
|
+
return (await self._with_raw_response.get_inventory(request_options=request_options)).unwrap()
|
|
149
|
+
|
|
150
|
+
async def get_order_by_id(self, order_id: int, *, request_options: RequestOptionsOrDict | None = None) -> Order:
|
|
151
|
+
"""For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
|
|
152
|
+
|
|
153
|
+
Args:
|
|
154
|
+
order_id: ID of order that needs to be fetched
|
|
155
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
156
|
+
|
|
157
|
+
Returns:
|
|
158
|
+
successful operation
|
|
159
|
+
|
|
160
|
+
Raises:
|
|
161
|
+
ApiError: Invalid ID supplied Order not found ``error`` is ``RawError``."""
|
|
162
|
+
return (await self._with_raw_response.get_order_by_id(order_id, request_options=request_options)).unwrap()
|
|
163
|
+
|
|
164
|
+
async def place_order(
|
|
165
|
+
self,
|
|
166
|
+
*,
|
|
167
|
+
id_: int | None = None,
|
|
168
|
+
pet_id: int | None = None,
|
|
169
|
+
quantity: int | None = None,
|
|
170
|
+
ship_date: RFC3339DateTime | None = None,
|
|
171
|
+
status: OrderStatusOrStr | None = None,
|
|
172
|
+
complete: bool | None = None,
|
|
173
|
+
request_options: RequestOptionsOrDict | None = None,
|
|
174
|
+
) -> Order:
|
|
175
|
+
"""Place a new order in the store.
|
|
176
|
+
|
|
177
|
+
Args:
|
|
178
|
+
id_: Value sent with the request.
|
|
179
|
+
pet_id: Value sent with the request.
|
|
180
|
+
quantity: Value sent with the request.
|
|
181
|
+
ship_date: Value sent with the request.
|
|
182
|
+
status: Order Status
|
|
183
|
+
complete: Value sent with the request.
|
|
184
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
185
|
+
|
|
186
|
+
Returns:
|
|
187
|
+
successful operation
|
|
188
|
+
|
|
189
|
+
Raises:
|
|
190
|
+
ApiError: Invalid input Validation exception ``error`` is ``RawError``."""
|
|
191
|
+
return (
|
|
192
|
+
await self._with_raw_response.place_order(
|
|
193
|
+
id_=id_,
|
|
194
|
+
pet_id=pet_id,
|
|
195
|
+
quantity=quantity,
|
|
196
|
+
ship_date=ship_date,
|
|
197
|
+
status=status,
|
|
198
|
+
complete=complete,
|
|
199
|
+
request_options=request_options,
|
|
200
|
+
)
|
|
201
|
+
).unwrap()
|
|
202
|
+
|
|
203
|
+
@property
|
|
204
|
+
def with_raw_response(self) -> AsyncStoreWithRawResponse:
|
|
205
|
+
return self._with_raw_response
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
class StoreWithRawResponse(SecuredRawResponse[RawClient, Server, AuthSchemes]):
|
|
209
|
+
def delete_order(
|
|
210
|
+
self, order_id: int, *, request_options: RequestOptionsOrDict | None = None
|
|
211
|
+
) -> ApiResult[None, DeleteOrderErrorBody]:
|
|
212
|
+
"""For valid response try integer IDs with value < 1000. Anything above 1000 or non-integers will generate API
|
|
213
|
+
errors.
|
|
214
|
+
|
|
215
|
+
Args:
|
|
216
|
+
order_id: ID of the order that needs to be deleted
|
|
217
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
218
|
+
|
|
219
|
+
Returns:
|
|
220
|
+
An ``ApiResult`` holding the deserialized response or the error body."""
|
|
221
|
+
return self._client.execute(
|
|
222
|
+
http_method="DELETE",
|
|
223
|
+
url_template=self._server.default("/store/order/{orderId}"),
|
|
224
|
+
path_params=[param[int]("orderId", order_id)],
|
|
225
|
+
headers=[param[UUID]("Idempotency-Key", uuid4())],
|
|
226
|
+
decoder=empty_response,
|
|
227
|
+
error_mapper=delete_order_error_mapper,
|
|
228
|
+
request_options=request_options,
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
def get_inventory(
|
|
232
|
+
self, *, request_options: RequestOptionsOrDict | None = None
|
|
233
|
+
) -> ApiResult[dict[str, int], RawError]:
|
|
234
|
+
"""Returns a map of status codes to quantities.
|
|
235
|
+
|
|
236
|
+
Args:
|
|
237
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
238
|
+
|
|
239
|
+
Returns:
|
|
240
|
+
An ``ApiResult`` holding the deserialized response or the error body."""
|
|
241
|
+
return self._client.execute(
|
|
242
|
+
http_method="GET",
|
|
243
|
+
url_template=self._server.default("/store/inventory"),
|
|
244
|
+
auth_scheme=self._auth.api_key,
|
|
245
|
+
decoder=json_decoder[dict[str, int]],
|
|
246
|
+
error_mapper=raw_error_response,
|
|
247
|
+
request_options=request_options,
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
def get_order_by_id(
|
|
251
|
+
self, order_id: int, *, request_options: RequestOptionsOrDict | None = None
|
|
252
|
+
) -> ApiResult[Order, GetOrderByIdErrorBody]:
|
|
253
|
+
"""For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
|
|
254
|
+
|
|
255
|
+
Args:
|
|
256
|
+
order_id: ID of order that needs to be fetched
|
|
257
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
258
|
+
|
|
259
|
+
Returns:
|
|
260
|
+
An ``ApiResult`` holding the deserialized response or the error body."""
|
|
261
|
+
return self._client.execute(
|
|
262
|
+
http_method="GET",
|
|
263
|
+
url_template=self._server.default("/store/order/{orderId}"),
|
|
264
|
+
path_params=[param[int]("orderId", order_id)],
|
|
265
|
+
decoder=json_decoder[Order],
|
|
266
|
+
error_mapper=get_order_by_id_error_mapper,
|
|
267
|
+
request_options=request_options,
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
def place_order(
|
|
271
|
+
self,
|
|
272
|
+
*,
|
|
273
|
+
id_: int | None = None,
|
|
274
|
+
pet_id: int | None = None,
|
|
275
|
+
quantity: int | None = None,
|
|
276
|
+
ship_date: RFC3339DateTime | None = None,
|
|
277
|
+
status: OrderStatusOrStr | None = None,
|
|
278
|
+
complete: bool | None = None,
|
|
279
|
+
request_options: RequestOptionsOrDict | None = None,
|
|
280
|
+
) -> ApiResult[Order, PlaceOrderErrorBody]:
|
|
281
|
+
"""Place a new order in the store.
|
|
282
|
+
|
|
283
|
+
Args:
|
|
284
|
+
id_: Value sent with the request.
|
|
285
|
+
pet_id: Value sent with the request.
|
|
286
|
+
quantity: Value sent with the request.
|
|
287
|
+
ship_date: Value sent with the request.
|
|
288
|
+
status: Order Status
|
|
289
|
+
complete: Value sent with the request.
|
|
290
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
291
|
+
|
|
292
|
+
Returns:
|
|
293
|
+
An ``ApiResult`` holding the deserialized response or the error body."""
|
|
294
|
+
return self._client.execute(
|
|
295
|
+
http_method="POST",
|
|
296
|
+
url_template=self._server.default("/store/order"),
|
|
297
|
+
headers=[param[UUID]("Idempotency-Key", uuid4())],
|
|
298
|
+
body=form_body(
|
|
299
|
+
param[int | None]("id", id_),
|
|
300
|
+
param[int | None]("petId", pet_id),
|
|
301
|
+
param[int | None]("quantity", quantity),
|
|
302
|
+
param[RFC3339DateTime | None]("shipDate", ship_date),
|
|
303
|
+
param[OrderStatusOrStr | None]("status", status),
|
|
304
|
+
param[bool | None]("complete", complete),
|
|
305
|
+
),
|
|
306
|
+
decoder=json_decoder[Order],
|
|
307
|
+
error_mapper=place_order_error_mapper,
|
|
308
|
+
request_options=request_options,
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
class AsyncStoreWithRawResponse(SecuredRawResponse[AsyncRawClient, Server, AsyncAuthSchemes]):
|
|
313
|
+
async def delete_order(
|
|
314
|
+
self, order_id: int, *, request_options: RequestOptionsOrDict | None = None
|
|
315
|
+
) -> ApiResult[None, DeleteOrderErrorBody]:
|
|
316
|
+
"""For valid response try integer IDs with value < 1000. Anything above 1000 or non-integers will generate API
|
|
317
|
+
errors.
|
|
318
|
+
|
|
319
|
+
Args:
|
|
320
|
+
order_id: ID of the order that needs to be deleted
|
|
321
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
322
|
+
|
|
323
|
+
Returns:
|
|
324
|
+
An ``ApiResult`` holding the deserialized response or the error body."""
|
|
325
|
+
return await self._client.execute(
|
|
326
|
+
http_method="DELETE",
|
|
327
|
+
url_template=self._server.default("/store/order/{orderId}"),
|
|
328
|
+
path_params=[param[int]("orderId", order_id)],
|
|
329
|
+
headers=[param[UUID]("Idempotency-Key", uuid4())],
|
|
330
|
+
decoder=async_empty_response,
|
|
331
|
+
error_mapper=delete_order_error_mapper,
|
|
332
|
+
request_options=request_options,
|
|
333
|
+
)
|
|
334
|
+
|
|
335
|
+
async def get_inventory(
|
|
336
|
+
self, *, request_options: RequestOptionsOrDict | None = None
|
|
337
|
+
) -> ApiResult[dict[str, int], RawError]:
|
|
338
|
+
"""Returns a map of status codes to quantities.
|
|
339
|
+
|
|
340
|
+
Args:
|
|
341
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
342
|
+
|
|
343
|
+
Returns:
|
|
344
|
+
An ``ApiResult`` holding the deserialized response or the error body."""
|
|
345
|
+
return await self._client.execute(
|
|
346
|
+
http_method="GET",
|
|
347
|
+
url_template=self._server.default("/store/inventory"),
|
|
348
|
+
auth_scheme=self._auth.api_key,
|
|
349
|
+
decoder=async_json_decoder[dict[str, int]],
|
|
350
|
+
error_mapper=raw_error_response,
|
|
351
|
+
request_options=request_options,
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
async def get_order_by_id(
|
|
355
|
+
self, order_id: int, *, request_options: RequestOptionsOrDict | None = None
|
|
356
|
+
) -> ApiResult[Order, GetOrderByIdErrorBody]:
|
|
357
|
+
"""For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.
|
|
358
|
+
|
|
359
|
+
Args:
|
|
360
|
+
order_id: ID of order that needs to be fetched
|
|
361
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
362
|
+
|
|
363
|
+
Returns:
|
|
364
|
+
An ``ApiResult`` holding the deserialized response or the error body."""
|
|
365
|
+
return await self._client.execute(
|
|
366
|
+
http_method="GET",
|
|
367
|
+
url_template=self._server.default("/store/order/{orderId}"),
|
|
368
|
+
path_params=[param[int]("orderId", order_id)],
|
|
369
|
+
decoder=async_json_decoder[Order],
|
|
370
|
+
error_mapper=get_order_by_id_error_mapper,
|
|
371
|
+
request_options=request_options,
|
|
372
|
+
)
|
|
373
|
+
|
|
374
|
+
async def place_order(
|
|
375
|
+
self,
|
|
376
|
+
*,
|
|
377
|
+
id_: int | None = None,
|
|
378
|
+
pet_id: int | None = None,
|
|
379
|
+
quantity: int | None = None,
|
|
380
|
+
ship_date: RFC3339DateTime | None = None,
|
|
381
|
+
status: OrderStatusOrStr | None = None,
|
|
382
|
+
complete: bool | None = None,
|
|
383
|
+
request_options: RequestOptionsOrDict | None = None,
|
|
384
|
+
) -> ApiResult[Order, PlaceOrderErrorBody]:
|
|
385
|
+
"""Place a new order in the store.
|
|
386
|
+
|
|
387
|
+
Args:
|
|
388
|
+
id_: Value sent with the request.
|
|
389
|
+
pet_id: Value sent with the request.
|
|
390
|
+
quantity: Value sent with the request.
|
|
391
|
+
ship_date: Value sent with the request.
|
|
392
|
+
status: Order Status
|
|
393
|
+
complete: Value sent with the request.
|
|
394
|
+
request_options: Per-call overrides for this one request, such as a timeout or extra headers.
|
|
395
|
+
|
|
396
|
+
Returns:
|
|
397
|
+
An ``ApiResult`` holding the deserialized response or the error body."""
|
|
398
|
+
return await self._client.execute(
|
|
399
|
+
http_method="POST",
|
|
400
|
+
url_template=self._server.default("/store/order"),
|
|
401
|
+
headers=[param[UUID]("Idempotency-Key", uuid4())],
|
|
402
|
+
body=form_body(
|
|
403
|
+
param[int | None]("id", id_),
|
|
404
|
+
param[int | None]("petId", pet_id),
|
|
405
|
+
param[int | None]("quantity", quantity),
|
|
406
|
+
param[RFC3339DateTime | None]("shipDate", ship_date),
|
|
407
|
+
param[OrderStatusOrStr | None]("status", status),
|
|
408
|
+
param[bool | None]("complete", complete),
|
|
409
|
+
),
|
|
410
|
+
decoder=async_json_decoder[Order],
|
|
411
|
+
error_mapper=place_order_error_mapper,
|
|
412
|
+
request_options=request_options,
|
|
413
|
+
)
|