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