cliV1 0.0.7__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 (92) hide show
  1. cliv1-0.0.7.dist-info/METADATA +212 -0
  2. cliv1-0.0.7.dist-info/RECORD +92 -0
  3. cliv1-0.0.7.dist-info/WHEEL +4 -0
  4. cliv1-0.0.7.dist-info/licenses/LICENSE +21 -0
  5. swagger_petstore_open_api_3_1_0/__init__.py +15 -0
  6. swagger_petstore_open_api_3_1_0/apis/__init__.py +5 -0
  7. swagger_petstore_open_api_3_1_0/apis/pet_api.py +922 -0
  8. swagger_petstore_open_api_3_1_0/apis/store.py +432 -0
  9. swagger_petstore_open_api_3_1_0/apis/user_api.py +829 -0
  10. swagger_petstore_open_api_3_1_0/async_client.py +87 -0
  11. swagger_petstore_open_api_3_1_0/auth.py +17 -0
  12. swagger_petstore_open_api_3_1_0/base_client.py +27 -0
  13. swagger_petstore_open_api_3_1_0/client.py +85 -0
  14. swagger_petstore_open_api_3_1_0/core/__init__.py +395 -0
  15. swagger_petstore_open_api_3_1_0/core/_internal/__init__.py +9 -0
  16. swagger_petstore_open_api_3_1_0/core/_internal/content_disposition.py +154 -0
  17. swagger_petstore_open_api_3_1_0/core/_internal/flattening.py +104 -0
  18. swagger_petstore_open_api_3_1_0/core/_internal/headers.py +243 -0
  19. swagger_petstore_open_api_3_1_0/core/_internal/redaction.py +208 -0
  20. swagger_petstore_open_api_3_1_0/core/_internal/sse_parser.py +124 -0
  21. swagger_petstore_open_api_3_1_0/core/_internal/subscripts.py +50 -0
  22. swagger_petstore_open_api_3_1_0/core/_internal/urls.py +172 -0
  23. swagger_petstore_open_api_3_1_0/core/_internal/wire.py +201 -0
  24. swagger_petstore_open_api_3_1_0/core/adapters.py +177 -0
  25. swagger_petstore_open_api_3_1_0/core/auth/__init__.py +70 -0
  26. swagger_petstore_open_api_3_1_0/core/auth/composition.py +175 -0
  27. swagger_petstore_open_api_3_1_0/core/auth/models.py +216 -0
  28. swagger_petstore_open_api_3_1_0/core/auth/protocols.py +103 -0
  29. swagger_petstore_open_api_3_1_0/core/auth/schemes/__init__.py +94 -0
  30. swagger_petstore_open_api_3_1_0/core/auth/schemes/api_key_auth.py +53 -0
  31. swagger_petstore_open_api_3_1_0/core/auth/schemes/basic_auth.py +73 -0
  32. swagger_petstore_open_api_3_1_0/core/auth/schemes/bearer_auth.py +21 -0
  33. swagger_petstore_open_api_3_1_0/core/auth/schemes/oauth2_authorization_code.py +395 -0
  34. swagger_petstore_open_api_3_1_0/core/auth/schemes/oauth2_client_credentials.py +130 -0
  35. swagger_petstore_open_api_3_1_0/core/auth/schemes/oauth2_password.py +145 -0
  36. swagger_petstore_open_api_3_1_0/core/auth/schemes/oauth2_schemes.py +300 -0
  37. swagger_petstore_open_api_3_1_0/core/base_raw_response.py +49 -0
  38. swagger_petstore_open_api_3_1_0/core/bodies.py +590 -0
  39. swagger_petstore_open_api_3_1_0/core/converters/__init__.py +68 -0
  40. swagger_petstore_open_api_3_1_0/core/converters/date_time.py +237 -0
  41. swagger_petstore_open_api_3_1_0/core/converters/encoded_bytes.py +273 -0
  42. swagger_petstore_open_api_3_1_0/core/converters/open_enum.py +35 -0
  43. swagger_petstore_open_api_3_1_0/core/decoding.py +498 -0
  44. swagger_petstore_open_api_3_1_0/core/discriminators.py +129 -0
  45. swagger_petstore_open_api_3_1_0/core/event_streams.py +225 -0
  46. swagger_petstore_open_api_3_1_0/core/exceptions.py +78 -0
  47. swagger_petstore_open_api_3_1_0/core/file_responses.py +337 -0
  48. swagger_petstore_open_api_3_1_0/core/files.py +174 -0
  49. swagger_petstore_open_api_3_1_0/core/httpx2_transport.py +748 -0
  50. swagger_petstore_open_api_3_1_0/core/logging.py +472 -0
  51. swagger_petstore_open_api_3_1_0/core/models.py +143 -0
  52. swagger_petstore_open_api_3_1_0/core/optionality.py +144 -0
  53. swagger_petstore_open_api_3_1_0/core/pagination.py +452 -0
  54. swagger_petstore_open_api_3_1_0/core/paginator.py +55 -0
  55. swagger_petstore_open_api_3_1_0/core/params.py +157 -0
  56. swagger_petstore_open_api_3_1_0/core/raw_client.py +480 -0
  57. swagger_petstore_open_api_3_1_0/core/request_options.py +172 -0
  58. swagger_petstore_open_api_3_1_0/core/results.py +178 -0
  59. swagger_petstore_open_api_3_1_0/core/retries.py +237 -0
  60. swagger_petstore_open_api_3_1_0/core/runtime_env.py +43 -0
  61. swagger_petstore_open_api_3_1_0/core/servers.py +33 -0
  62. swagger_petstore_open_api_3_1_0/core/transport.py +218 -0
  63. swagger_petstore_open_api_3_1_0/errors/__init__.py +48 -0
  64. swagger_petstore_open_api_3_1_0/errors/add_pet_error.py +21 -0
  65. swagger_petstore_open_api_3_1_0/errors/delete_order_error.py +21 -0
  66. swagger_petstore_open_api_3_1_0/errors/delete_pet_error.py +21 -0
  67. swagger_petstore_open_api_3_1_0/errors/delete_user_error.py +21 -0
  68. swagger_petstore_open_api_3_1_0/errors/find_pets_by_status_error.py +21 -0
  69. swagger_petstore_open_api_3_1_0/errors/find_pets_by_tags_error.py +21 -0
  70. swagger_petstore_open_api_3_1_0/errors/get_order_by_id_error.py +21 -0
  71. swagger_petstore_open_api_3_1_0/errors/get_pet_by_id_error.py +21 -0
  72. swagger_petstore_open_api_3_1_0/errors/get_user_by_name_error.py +21 -0
  73. swagger_petstore_open_api_3_1_0/errors/login_user_error.py +21 -0
  74. swagger_petstore_open_api_3_1_0/errors/place_order_error.py +21 -0
  75. swagger_petstore_open_api_3_1_0/errors/update_pet_error.py +21 -0
  76. swagger_petstore_open_api_3_1_0/errors/update_pet_with_form_error.py +21 -0
  77. swagger_petstore_open_api_3_1_0/errors/update_user_error.py +21 -0
  78. swagger_petstore_open_api_3_1_0/errors/upload_file_error.py +21 -0
  79. swagger_petstore_open_api_3_1_0/models/__init__.py +23 -0
  80. swagger_petstore_open_api_3_1_0/models/api_response.py +18 -0
  81. swagger_petstore_open_api_3_1_0/models/category.py +15 -0
  82. swagger_petstore_open_api_3_1_0/models/enums/__init__.py +4 -0
  83. swagger_petstore_open_api_3_1_0/models/enums/order_status.py +17 -0
  84. swagger_petstore_open_api_3_1_0/models/enums/pet_status.py +17 -0
  85. swagger_petstore_open_api_3_1_0/models/order.py +27 -0
  86. swagger_petstore_open_api_3_1_0/models/pet.py +28 -0
  87. swagger_petstore_open_api_3_1_0/models/tag_model.py +15 -0
  88. swagger_petstore_open_api_3_1_0/models/user.py +29 -0
  89. swagger_petstore_open_api_3_1_0/py.typed +0 -0
  90. swagger_petstore_open_api_3_1_0/server/__init__.py +21 -0
  91. swagger_petstore_open_api_3_1_0/server/server.py +17 -0
  92. swagger_petstore_open_api_3_1_0/server/server_config.py +52 -0
@@ -0,0 +1,922 @@
1
+ from __future__ import annotations
2
+
3
+ from uuid import UUID, uuid4
4
+
5
+ from ..auth import AsyncAuthSchemes, AuthSchemes
6
+ from ..core import (
7
+ AnySchemes,
8
+ ApiResult,
9
+ AsyncAnySchemes,
10
+ AsyncFileInput,
11
+ AsyncRawClient,
12
+ FileInput,
13
+ RawClient,
14
+ RequestOptionsOrDict,
15
+ SecuredRawResponse,
16
+ async_empty_response,
17
+ async_json_decoder,
18
+ binary_body,
19
+ empty_response,
20
+ form_body,
21
+ json_decoder,
22
+ param,
23
+ unwrap,
24
+ )
25
+ from ..errors.add_pet_error import AddPetErrorBody, add_pet_error_mapper
26
+ from ..errors.delete_pet_error import DeletePetErrorBody, delete_pet_error_mapper
27
+ from ..errors.find_pets_by_status_error import FindPetsByStatusErrorBody, find_pets_by_status_error_mapper
28
+ from ..errors.find_pets_by_tags_error import FindPetsByTagsErrorBody, find_pets_by_tags_error_mapper
29
+ from ..errors.get_pet_by_id_error import GetPetByIdErrorBody, get_pet_by_id_error_mapper
30
+ from ..errors.update_pet_error import UpdatePetErrorBody, update_pet_error_mapper
31
+ from ..errors.update_pet_with_form_error import UpdatePetWithFormErrorBody, update_pet_with_form_error_mapper
32
+ from ..errors.upload_file_error import UploadFileErrorBody, upload_file_error_mapper
33
+ from ..models.api_response import ApiResponse
34
+ from ..models.category import Category, CategoryDict
35
+ from ..models.enums.pet_status import PetStatusOrStr
36
+ from ..models.pet import Pet
37
+ from ..models.tag_model import TagModel, TagModelDict
38
+ from ..server.server import Server
39
+
40
+
41
+ class PetApi:
42
+ def __init__(self, client: RawClient, server: Server, auth: AuthSchemes) -> None:
43
+ self._with_raw_response = PetApiWithRawResponse(client, server, auth)
44
+
45
+ def add_pet(
46
+ self,
47
+ name: str,
48
+ photo_urls: list[str],
49
+ *,
50
+ id_: int | None = None,
51
+ category: Category | CategoryDict | None = None,
52
+ tags: list[TagModel | TagModelDict] | None = None,
53
+ status: PetStatusOrStr | None = None,
54
+ request_options: RequestOptionsOrDict | None = None,
55
+ ) -> Pet:
56
+ """Add a new pet to the store.
57
+
58
+ Args:
59
+ name: Value sent with the request.
60
+ photo_urls: Value sent with the request.
61
+ id_: Value sent with the request.
62
+ category: Value sent with the request.
63
+ tags: Value sent with the request.
64
+ status: pet status in the store
65
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
66
+ count and statuses.
67
+
68
+ Returns:
69
+ Successful operation
70
+
71
+ Raises:
72
+ ApiError: Invalid input Validation exception ``error`` is ``RawError``."""
73
+ return unwrap(
74
+ self._with_raw_response.add_pet(
75
+ name, photo_urls, id_=id_, category=category, tags=tags, status=status, request_options=request_options
76
+ ),
77
+ )
78
+
79
+ def delete_pet(
80
+ self, pet_id: int, *, api_key: str | None = None, request_options: RequestOptionsOrDict | None = None
81
+ ) -> None:
82
+ """Delete a pet.
83
+
84
+ Args:
85
+ pet_id: Pet id to delete
86
+ api_key: Value sent with the request.
87
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
88
+ count and statuses.
89
+
90
+ Returns:
91
+ Pet deleted
92
+
93
+ Raises:
94
+ ApiError: Invalid pet value ``error`` is ``RawError``."""
95
+ return unwrap(self._with_raw_response.delete_pet(pet_id, api_key=api_key, request_options=request_options))
96
+
97
+ def find_pets_by_status(
98
+ self, *, status: PetStatusOrStr | None = None, request_options: RequestOptionsOrDict | None = None
99
+ ) -> list[Pet]:
100
+ """Multiple status values can be provided with comma separated strings.
101
+
102
+ Args:
103
+ status: Status values that need to be considered for filter
104
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
105
+ count and statuses.
106
+
107
+ Returns:
108
+ successful operation
109
+
110
+ Raises:
111
+ ApiError: Invalid status value ``error`` is ``RawError``."""
112
+ return unwrap(self._with_raw_response.find_pets_by_status(status=status, request_options=request_options))
113
+
114
+ def find_pets_by_tags(
115
+ self, *, tags: list[str] | None = None, request_options: RequestOptionsOrDict | None = None
116
+ ) -> list[Pet]:
117
+ """Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
118
+
119
+ Args:
120
+ tags: Tags to filter by
121
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
122
+ count and statuses.
123
+
124
+ Returns:
125
+ successful operation
126
+
127
+ Raises:
128
+ ApiError: Invalid tag value ``error`` is ``RawError``."""
129
+ return unwrap(self._with_raw_response.find_pets_by_tags(tags=tags, request_options=request_options))
130
+
131
+ def get_pet_by_id(self, pet_id: int, *, request_options: RequestOptionsOrDict | None = None) -> Pet:
132
+ """Returns a single pet.
133
+
134
+ Args:
135
+ pet_id: ID of pet to return
136
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
137
+ count and statuses.
138
+
139
+ Returns:
140
+ successful operation
141
+
142
+ Raises:
143
+ ApiError: Invalid ID supplied Pet not found ``error`` is ``RawError``."""
144
+ return unwrap(self._with_raw_response.get_pet_by_id(pet_id, request_options=request_options))
145
+
146
+ def update_pet(
147
+ self,
148
+ name: str,
149
+ photo_urls: list[str],
150
+ *,
151
+ id_: int | None = None,
152
+ category: Category | CategoryDict | None = None,
153
+ tags: list[TagModel | TagModelDict] | None = None,
154
+ status: PetStatusOrStr | None = None,
155
+ request_options: RequestOptionsOrDict | None = None,
156
+ ) -> Pet:
157
+ """Update an existing pet by Id.
158
+
159
+ Args:
160
+ name: Value sent with the request.
161
+ photo_urls: Value sent with the request.
162
+ id_: Value sent with the request.
163
+ category: Value sent with the request.
164
+ tags: Value sent with the request.
165
+ status: pet status in the store
166
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
167
+ count and statuses.
168
+
169
+ Returns:
170
+ Successful operation
171
+
172
+ Raises:
173
+ ApiError: Invalid ID supplied Pet not found Validation exception ``error`` is ``RawError``."""
174
+ return unwrap(
175
+ self._with_raw_response.update_pet(
176
+ name, photo_urls, id_=id_, category=category, tags=tags, status=status, request_options=request_options
177
+ ),
178
+ )
179
+
180
+ def update_pet_with_form(
181
+ self,
182
+ pet_id: int,
183
+ *,
184
+ name: str | None = None,
185
+ status: str | None = None,
186
+ request_options: RequestOptionsOrDict | None = None,
187
+ ) -> Pet:
188
+ """Updates a pet resource based on the form data.
189
+
190
+ Args:
191
+ pet_id: ID of pet that needs to be updated
192
+ name: Name of pet that needs to be updated
193
+ status: Status of pet that needs to be updated
194
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
195
+ count and statuses.
196
+
197
+ Returns:
198
+ successful operation
199
+
200
+ Raises:
201
+ ApiError: Invalid input ``error`` is ``RawError``."""
202
+ return unwrap(
203
+ self._with_raw_response.update_pet_with_form(
204
+ pet_id, name=name, status=status, request_options=request_options
205
+ ),
206
+ )
207
+
208
+ def upload_file(
209
+ self,
210
+ pet_id: int,
211
+ *,
212
+ additional_metadata: str | None = None,
213
+ body: FileInput | None = None,
214
+ request_options: RequestOptionsOrDict | None = None,
215
+ ) -> ApiResponse:
216
+ """Upload image of the pet.
217
+
218
+ Args:
219
+ pet_id: ID of pet to update
220
+ additional_metadata: Additional Metadata
221
+ body: The request body.
222
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
223
+ count and statuses.
224
+
225
+ Returns:
226
+ successful operation
227
+
228
+ Raises:
229
+ ApiError: No file uploaded Pet not found ``error`` is ``RawError``."""
230
+ return unwrap(
231
+ self._with_raw_response.upload_file(
232
+ pet_id, additional_metadata=additional_metadata, body=body, request_options=request_options
233
+ ),
234
+ )
235
+
236
+ @property
237
+ def with_raw_response(self) -> PetApiWithRawResponse:
238
+ return self._with_raw_response
239
+
240
+
241
+ class AsyncPetApi:
242
+ def __init__(self, client: AsyncRawClient, server: Server, auth: AsyncAuthSchemes) -> None:
243
+ self._with_raw_response = AsyncPetApiWithRawResponse(client, server, auth)
244
+
245
+ async def add_pet(
246
+ self,
247
+ name: str,
248
+ photo_urls: list[str],
249
+ *,
250
+ id_: int | None = None,
251
+ category: Category | CategoryDict | None = None,
252
+ tags: list[TagModel | TagModelDict] | None = None,
253
+ status: PetStatusOrStr | None = None,
254
+ request_options: RequestOptionsOrDict | None = None,
255
+ ) -> Pet:
256
+ """Add a new pet to the store.
257
+
258
+ Args:
259
+ name: Value sent with the request.
260
+ photo_urls: Value sent with the request.
261
+ id_: Value sent with the request.
262
+ category: Value sent with the request.
263
+ tags: Value sent with the request.
264
+ status: pet status in the store
265
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
266
+ count and statuses.
267
+
268
+ Returns:
269
+ Successful operation
270
+
271
+ Raises:
272
+ ApiError: Invalid input Validation exception ``error`` is ``RawError``."""
273
+ return unwrap(
274
+ await self._with_raw_response.add_pet(
275
+ name, photo_urls, id_=id_, category=category, tags=tags, status=status, request_options=request_options
276
+ ),
277
+ )
278
+
279
+ async def delete_pet(
280
+ self, pet_id: int, *, api_key: str | None = None, request_options: RequestOptionsOrDict | None = None
281
+ ) -> None:
282
+ """Delete a pet.
283
+
284
+ Args:
285
+ pet_id: Pet id to delete
286
+ api_key: Value sent with the request.
287
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
288
+ count and statuses.
289
+
290
+ Returns:
291
+ Pet deleted
292
+
293
+ Raises:
294
+ ApiError: Invalid pet value ``error`` is ``RawError``."""
295
+ return unwrap(
296
+ await self._with_raw_response.delete_pet(pet_id, api_key=api_key, request_options=request_options)
297
+ )
298
+
299
+ async def find_pets_by_status(
300
+ self, *, status: PetStatusOrStr | None = None, request_options: RequestOptionsOrDict | None = None
301
+ ) -> list[Pet]:
302
+ """Multiple status values can be provided with comma separated strings.
303
+
304
+ Args:
305
+ status: Status values that need to be considered for filter
306
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
307
+ count and statuses.
308
+
309
+ Returns:
310
+ successful operation
311
+
312
+ Raises:
313
+ ApiError: Invalid status value ``error`` is ``RawError``."""
314
+ return unwrap(await self._with_raw_response.find_pets_by_status(status=status, request_options=request_options))
315
+
316
+ async def find_pets_by_tags(
317
+ self, *, tags: list[str] | None = None, request_options: RequestOptionsOrDict | None = None
318
+ ) -> list[Pet]:
319
+ """Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
320
+
321
+ Args:
322
+ tags: Tags to filter by
323
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
324
+ count and statuses.
325
+
326
+ Returns:
327
+ successful operation
328
+
329
+ Raises:
330
+ ApiError: Invalid tag value ``error`` is ``RawError``."""
331
+ return unwrap(await self._with_raw_response.find_pets_by_tags(tags=tags, request_options=request_options))
332
+
333
+ async def get_pet_by_id(self, pet_id: int, *, request_options: RequestOptionsOrDict | None = None) -> Pet:
334
+ """Returns a single pet.
335
+
336
+ Args:
337
+ pet_id: ID of pet to return
338
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
339
+ count and statuses.
340
+
341
+ Returns:
342
+ successful operation
343
+
344
+ Raises:
345
+ ApiError: Invalid ID supplied Pet not found ``error`` is ``RawError``."""
346
+ return unwrap(await self._with_raw_response.get_pet_by_id(pet_id, request_options=request_options))
347
+
348
+ async def update_pet(
349
+ self,
350
+ name: str,
351
+ photo_urls: list[str],
352
+ *,
353
+ id_: int | None = None,
354
+ category: Category | CategoryDict | None = None,
355
+ tags: list[TagModel | TagModelDict] | None = None,
356
+ status: PetStatusOrStr | None = None,
357
+ request_options: RequestOptionsOrDict | None = None,
358
+ ) -> Pet:
359
+ """Update an existing pet by Id.
360
+
361
+ Args:
362
+ name: Value sent with the request.
363
+ photo_urls: Value sent with the request.
364
+ id_: Value sent with the request.
365
+ category: Value sent with the request.
366
+ tags: Value sent with the request.
367
+ status: pet status in the store
368
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
369
+ count and statuses.
370
+
371
+ Returns:
372
+ Successful operation
373
+
374
+ Raises:
375
+ ApiError: Invalid ID supplied Pet not found Validation exception ``error`` is ``RawError``."""
376
+ return unwrap(
377
+ await self._with_raw_response.update_pet(
378
+ name, photo_urls, id_=id_, category=category, tags=tags, status=status, request_options=request_options
379
+ ),
380
+ )
381
+
382
+ async def update_pet_with_form(
383
+ self,
384
+ pet_id: int,
385
+ *,
386
+ name: str | None = None,
387
+ status: str | None = None,
388
+ request_options: RequestOptionsOrDict | None = None,
389
+ ) -> Pet:
390
+ """Updates a pet resource based on the form data.
391
+
392
+ Args:
393
+ pet_id: ID of pet that needs to be updated
394
+ name: Name of pet that needs to be updated
395
+ status: Status of pet that needs to be updated
396
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
397
+ count and statuses.
398
+
399
+ Returns:
400
+ successful operation
401
+
402
+ Raises:
403
+ ApiError: Invalid input ``error`` is ``RawError``."""
404
+ return unwrap(
405
+ await self._with_raw_response.update_pet_with_form(
406
+ pet_id, name=name, status=status, request_options=request_options
407
+ ),
408
+ )
409
+
410
+ async def upload_file(
411
+ self,
412
+ pet_id: int,
413
+ *,
414
+ additional_metadata: str | None = None,
415
+ body: AsyncFileInput | None = None,
416
+ request_options: RequestOptionsOrDict | None = None,
417
+ ) -> ApiResponse:
418
+ """Upload image of the pet.
419
+
420
+ Args:
421
+ pet_id: ID of pet to update
422
+ additional_metadata: Additional Metadata
423
+ body: The request body.
424
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
425
+ count and statuses.
426
+
427
+ Returns:
428
+ successful operation
429
+
430
+ Raises:
431
+ ApiError: No file uploaded Pet not found ``error`` is ``RawError``."""
432
+ return unwrap(
433
+ await self._with_raw_response.upload_file(
434
+ pet_id, additional_metadata=additional_metadata, body=body, request_options=request_options
435
+ ),
436
+ )
437
+
438
+ @property
439
+ def with_raw_response(self) -> AsyncPetApiWithRawResponse:
440
+ return self._with_raw_response
441
+
442
+
443
+ class PetApiWithRawResponse(SecuredRawResponse[RawClient, Server, AuthSchemes]):
444
+ def add_pet(
445
+ self,
446
+ name: str,
447
+ photo_urls: list[str],
448
+ *,
449
+ id_: int | None = None,
450
+ category: Category | CategoryDict | None = None,
451
+ tags: list[TagModel | TagModelDict] | None = None,
452
+ status: PetStatusOrStr | None = None,
453
+ request_options: RequestOptionsOrDict | None = None,
454
+ ) -> ApiResult[Pet, AddPetErrorBody]:
455
+ """Add a new pet to the store.
456
+
457
+ Args:
458
+ name: Value sent with the request.
459
+ photo_urls: Value sent with the request.
460
+ id_: Value sent with the request.
461
+ category: Value sent with the request.
462
+ tags: Value sent with the request.
463
+ status: pet status in the store
464
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
465
+ count and statuses.
466
+
467
+ Returns:
468
+ An ``ApiResult`` holding the deserialized response or the error body."""
469
+ return self._client.execute(
470
+ http_method="POST",
471
+ url_template=self._server.default("/pet"),
472
+ headers=[param[UUID]("Idempotency-Key", uuid4())],
473
+ body=form_body(
474
+ param[str]("name", name),
475
+ param[list[str]]("photoUrls", photo_urls),
476
+ param[int | None]("id", id_),
477
+ param[Category | CategoryDict | None]("category", category),
478
+ param[list[TagModel | TagModelDict] | None]("tags", tags),
479
+ param[PetStatusOrStr | None]("status", status),
480
+ ),
481
+ auth_scheme=self._auth.petstore_auth,
482
+ decoder=json_decoder[Pet],
483
+ error_mapper=add_pet_error_mapper,
484
+ request_options=request_options,
485
+ )
486
+
487
+ def delete_pet(
488
+ self, pet_id: int, *, api_key: str | None = None, request_options: RequestOptionsOrDict | None = None
489
+ ) -> ApiResult[None, DeletePetErrorBody]:
490
+ """Delete a pet.
491
+
492
+ Args:
493
+ pet_id: Pet id to delete
494
+ api_key: Value sent with the request.
495
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
496
+ count and statuses.
497
+
498
+ Returns:
499
+ An ``ApiResult`` holding the deserialized response or the error body."""
500
+ return self._client.execute(
501
+ http_method="DELETE",
502
+ url_template=self._server.default("/pet/{petId}"),
503
+ path_params=[param[int]("petId", pet_id)],
504
+ headers=[param[str | None]("api_key", api_key), param[UUID]("Idempotency-Key", uuid4())],
505
+ auth_scheme=self._auth.petstore_auth,
506
+ decoder=empty_response,
507
+ error_mapper=delete_pet_error_mapper,
508
+ request_options=request_options,
509
+ )
510
+
511
+ def find_pets_by_status(
512
+ self, *, status: PetStatusOrStr | None = None, request_options: RequestOptionsOrDict | None = None
513
+ ) -> ApiResult[list[Pet], FindPetsByStatusErrorBody]:
514
+ """Multiple status values can be provided with comma separated strings.
515
+
516
+ Args:
517
+ status: Status values that need to be considered for filter
518
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
519
+ count and statuses.
520
+
521
+ Returns:
522
+ An ``ApiResult`` holding the deserialized response or the error body."""
523
+ return self._client.execute(
524
+ http_method="GET",
525
+ url_template=self._server.default("/pet/findByStatus"),
526
+ query_params=[param[PetStatusOrStr | None]("status", status)],
527
+ auth_scheme=self._auth.petstore_auth,
528
+ decoder=json_decoder[list[Pet]],
529
+ error_mapper=find_pets_by_status_error_mapper,
530
+ request_options=request_options,
531
+ )
532
+
533
+ def find_pets_by_tags(
534
+ self, *, tags: list[str] | None = None, request_options: RequestOptionsOrDict | None = None
535
+ ) -> ApiResult[list[Pet], FindPetsByTagsErrorBody]:
536
+ """Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
537
+
538
+ Args:
539
+ tags: Tags to filter by
540
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
541
+ count and statuses.
542
+
543
+ Returns:
544
+ An ``ApiResult`` holding the deserialized response or the error body."""
545
+ return self._client.execute(
546
+ http_method="GET",
547
+ url_template=self._server.default("/pet/findByTags"),
548
+ query_params=[param[list[str] | None]("tags", tags)],
549
+ auth_scheme=self._auth.petstore_auth,
550
+ decoder=json_decoder[list[Pet]],
551
+ error_mapper=find_pets_by_tags_error_mapper,
552
+ request_options=request_options,
553
+ )
554
+
555
+ def get_pet_by_id(
556
+ self, pet_id: int, *, request_options: RequestOptionsOrDict | None = None
557
+ ) -> ApiResult[Pet, GetPetByIdErrorBody]:
558
+ """Returns a single pet.
559
+
560
+ Args:
561
+ pet_id: ID of pet to return
562
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
563
+ count and statuses.
564
+
565
+ Returns:
566
+ An ``ApiResult`` holding the deserialized response or the error body."""
567
+ return self._client.execute(
568
+ http_method="GET",
569
+ url_template=self._server.default("/pet/{petId}"),
570
+ path_params=[param[int]("petId", pet_id)],
571
+ auth_scheme=AnySchemes(self._auth.api_key, self._auth.petstore_auth),
572
+ decoder=json_decoder[Pet],
573
+ error_mapper=get_pet_by_id_error_mapper,
574
+ request_options=request_options,
575
+ )
576
+
577
+ def update_pet(
578
+ self,
579
+ name: str,
580
+ photo_urls: list[str],
581
+ *,
582
+ id_: int | None = None,
583
+ category: Category | CategoryDict | None = None,
584
+ tags: list[TagModel | TagModelDict] | None = None,
585
+ status: PetStatusOrStr | None = None,
586
+ request_options: RequestOptionsOrDict | None = None,
587
+ ) -> ApiResult[Pet, UpdatePetErrorBody]:
588
+ """Update an existing pet by Id.
589
+
590
+ Args:
591
+ name: Value sent with the request.
592
+ photo_urls: Value sent with the request.
593
+ id_: Value sent with the request.
594
+ category: Value sent with the request.
595
+ tags: Value sent with the request.
596
+ status: pet status in the store
597
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
598
+ count and statuses.
599
+
600
+ Returns:
601
+ An ``ApiResult`` holding the deserialized response or the error body."""
602
+ return self._client.execute(
603
+ http_method="PUT",
604
+ url_template=self._server.default("/pet"),
605
+ headers=[param[UUID]("Idempotency-Key", uuid4())],
606
+ body=form_body(
607
+ param[str]("name", name),
608
+ param[list[str]]("photoUrls", photo_urls),
609
+ param[int | None]("id", id_),
610
+ param[Category | CategoryDict | None]("category", category),
611
+ param[list[TagModel | TagModelDict] | None]("tags", tags),
612
+ param[PetStatusOrStr | None]("status", status),
613
+ ),
614
+ auth_scheme=self._auth.petstore_auth,
615
+ decoder=json_decoder[Pet],
616
+ error_mapper=update_pet_error_mapper,
617
+ request_options=request_options,
618
+ )
619
+
620
+ def update_pet_with_form(
621
+ self,
622
+ pet_id: int,
623
+ *,
624
+ name: str | None = None,
625
+ status: str | None = None,
626
+ request_options: RequestOptionsOrDict | None = None,
627
+ ) -> ApiResult[Pet, UpdatePetWithFormErrorBody]:
628
+ """Updates a pet resource based on the form data.
629
+
630
+ Args:
631
+ pet_id: ID of pet that needs to be updated
632
+ name: Name of pet that needs to be updated
633
+ status: Status of pet that needs to be updated
634
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
635
+ count and statuses.
636
+
637
+ Returns:
638
+ An ``ApiResult`` holding the deserialized response or the error body."""
639
+ return self._client.execute(
640
+ http_method="POST",
641
+ url_template=self._server.default("/pet/{petId}"),
642
+ path_params=[param[int]("petId", pet_id)],
643
+ query_params=[param[str | None]("name", name), param[str | None]("status", status)],
644
+ headers=[param[UUID]("Idempotency-Key", uuid4())],
645
+ auth_scheme=self._auth.petstore_auth,
646
+ decoder=json_decoder[Pet],
647
+ error_mapper=update_pet_with_form_error_mapper,
648
+ request_options=request_options,
649
+ )
650
+
651
+ def upload_file(
652
+ self,
653
+ pet_id: int,
654
+ *,
655
+ additional_metadata: str | None = None,
656
+ body: FileInput | None = None,
657
+ request_options: RequestOptionsOrDict | None = None,
658
+ ) -> ApiResult[ApiResponse, UploadFileErrorBody]:
659
+ """Upload image of the pet.
660
+
661
+ Args:
662
+ pet_id: ID of pet to update
663
+ additional_metadata: Additional Metadata
664
+ body: The request body.
665
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
666
+ count and statuses.
667
+
668
+ Returns:
669
+ An ``ApiResult`` holding the deserialized response or the error body."""
670
+ return self._client.execute(
671
+ http_method="POST",
672
+ url_template=self._server.default("/pet/{petId}/uploadImage"),
673
+ path_params=[param[int]("petId", pet_id)],
674
+ query_params=[param[str | None]("additionalMetadata", additional_metadata)],
675
+ headers=[param[UUID]("Idempotency-Key", uuid4())],
676
+ body=binary_body(body),
677
+ auth_scheme=self._auth.petstore_auth,
678
+ decoder=json_decoder[ApiResponse],
679
+ error_mapper=upload_file_error_mapper,
680
+ request_options=request_options,
681
+ )
682
+
683
+
684
+ class AsyncPetApiWithRawResponse(SecuredRawResponse[AsyncRawClient, Server, AsyncAuthSchemes]):
685
+ async def add_pet(
686
+ self,
687
+ name: str,
688
+ photo_urls: list[str],
689
+ *,
690
+ id_: int | None = None,
691
+ category: Category | CategoryDict | None = None,
692
+ tags: list[TagModel | TagModelDict] | None = None,
693
+ status: PetStatusOrStr | None = None,
694
+ request_options: RequestOptionsOrDict | None = None,
695
+ ) -> ApiResult[Pet, AddPetErrorBody]:
696
+ """Add a new pet to the store.
697
+
698
+ Args:
699
+ name: Value sent with the request.
700
+ photo_urls: Value sent with the request.
701
+ id_: Value sent with the request.
702
+ category: Value sent with the request.
703
+ tags: Value sent with the request.
704
+ status: pet status in the store
705
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
706
+ count and statuses.
707
+
708
+ Returns:
709
+ An ``ApiResult`` holding the deserialized response or the error body."""
710
+ return await self._client.execute(
711
+ http_method="POST",
712
+ url_template=self._server.default("/pet"),
713
+ headers=[param[UUID]("Idempotency-Key", uuid4())],
714
+ body=form_body(
715
+ param[str]("name", name),
716
+ param[list[str]]("photoUrls", photo_urls),
717
+ param[int | None]("id", id_),
718
+ param[Category | CategoryDict | None]("category", category),
719
+ param[list[TagModel | TagModelDict] | None]("tags", tags),
720
+ param[PetStatusOrStr | None]("status", status),
721
+ ),
722
+ auth_scheme=self._auth.petstore_auth,
723
+ decoder=async_json_decoder[Pet],
724
+ error_mapper=add_pet_error_mapper,
725
+ request_options=request_options,
726
+ )
727
+
728
+ async def delete_pet(
729
+ self, pet_id: int, *, api_key: str | None = None, request_options: RequestOptionsOrDict | None = None
730
+ ) -> ApiResult[None, DeletePetErrorBody]:
731
+ """Delete a pet.
732
+
733
+ Args:
734
+ pet_id: Pet id to delete
735
+ api_key: Value sent with the request.
736
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
737
+ count and statuses.
738
+
739
+ Returns:
740
+ An ``ApiResult`` holding the deserialized response or the error body."""
741
+ return await self._client.execute(
742
+ http_method="DELETE",
743
+ url_template=self._server.default("/pet/{petId}"),
744
+ path_params=[param[int]("petId", pet_id)],
745
+ headers=[param[str | None]("api_key", api_key), param[UUID]("Idempotency-Key", uuid4())],
746
+ auth_scheme=self._auth.petstore_auth,
747
+ decoder=async_empty_response,
748
+ error_mapper=delete_pet_error_mapper,
749
+ request_options=request_options,
750
+ )
751
+
752
+ async def find_pets_by_status(
753
+ self, *, status: PetStatusOrStr | None = None, request_options: RequestOptionsOrDict | None = None
754
+ ) -> ApiResult[list[Pet], FindPetsByStatusErrorBody]:
755
+ """Multiple status values can be provided with comma separated strings.
756
+
757
+ Args:
758
+ status: Status values that need to be considered for filter
759
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
760
+ count and statuses.
761
+
762
+ Returns:
763
+ An ``ApiResult`` holding the deserialized response or the error body."""
764
+ return await self._client.execute(
765
+ http_method="GET",
766
+ url_template=self._server.default("/pet/findByStatus"),
767
+ query_params=[param[PetStatusOrStr | None]("status", status)],
768
+ auth_scheme=self._auth.petstore_auth,
769
+ decoder=async_json_decoder[list[Pet]],
770
+ error_mapper=find_pets_by_status_error_mapper,
771
+ request_options=request_options,
772
+ )
773
+
774
+ async def find_pets_by_tags(
775
+ self, *, tags: list[str] | None = None, request_options: RequestOptionsOrDict | None = None
776
+ ) -> ApiResult[list[Pet], FindPetsByTagsErrorBody]:
777
+ """Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
778
+
779
+ Args:
780
+ tags: Tags to filter by
781
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
782
+ count and statuses.
783
+
784
+ Returns:
785
+ An ``ApiResult`` holding the deserialized response or the error body."""
786
+ return await self._client.execute(
787
+ http_method="GET",
788
+ url_template=self._server.default("/pet/findByTags"),
789
+ query_params=[param[list[str] | None]("tags", tags)],
790
+ auth_scheme=self._auth.petstore_auth,
791
+ decoder=async_json_decoder[list[Pet]],
792
+ error_mapper=find_pets_by_tags_error_mapper,
793
+ request_options=request_options,
794
+ )
795
+
796
+ async def get_pet_by_id(
797
+ self, pet_id: int, *, request_options: RequestOptionsOrDict | None = None
798
+ ) -> ApiResult[Pet, GetPetByIdErrorBody]:
799
+ """Returns a single pet.
800
+
801
+ Args:
802
+ pet_id: ID of pet to return
803
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
804
+ count and statuses.
805
+
806
+ Returns:
807
+ An ``ApiResult`` holding the deserialized response or the error body."""
808
+ return await self._client.execute(
809
+ http_method="GET",
810
+ url_template=self._server.default("/pet/{petId}"),
811
+ path_params=[param[int]("petId", pet_id)],
812
+ auth_scheme=AsyncAnySchemes(self._auth.api_key, self._auth.petstore_auth),
813
+ decoder=async_json_decoder[Pet],
814
+ error_mapper=get_pet_by_id_error_mapper,
815
+ request_options=request_options,
816
+ )
817
+
818
+ async def update_pet(
819
+ self,
820
+ name: str,
821
+ photo_urls: list[str],
822
+ *,
823
+ id_: int | None = None,
824
+ category: Category | CategoryDict | None = None,
825
+ tags: list[TagModel | TagModelDict] | None = None,
826
+ status: PetStatusOrStr | None = None,
827
+ request_options: RequestOptionsOrDict | None = None,
828
+ ) -> ApiResult[Pet, UpdatePetErrorBody]:
829
+ """Update an existing pet by Id.
830
+
831
+ Args:
832
+ name: Value sent with the request.
833
+ photo_urls: Value sent with the request.
834
+ id_: Value sent with the request.
835
+ category: Value sent with the request.
836
+ tags: Value sent with the request.
837
+ status: pet status in the store
838
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
839
+ count and statuses.
840
+
841
+ Returns:
842
+ An ``ApiResult`` holding the deserialized response or the error body."""
843
+ return await self._client.execute(
844
+ http_method="PUT",
845
+ url_template=self._server.default("/pet"),
846
+ headers=[param[UUID]("Idempotency-Key", uuid4())],
847
+ body=form_body(
848
+ param[str]("name", name),
849
+ param[list[str]]("photoUrls", photo_urls),
850
+ param[int | None]("id", id_),
851
+ param[Category | CategoryDict | None]("category", category),
852
+ param[list[TagModel | TagModelDict] | None]("tags", tags),
853
+ param[PetStatusOrStr | None]("status", status),
854
+ ),
855
+ auth_scheme=self._auth.petstore_auth,
856
+ decoder=async_json_decoder[Pet],
857
+ error_mapper=update_pet_error_mapper,
858
+ request_options=request_options,
859
+ )
860
+
861
+ async def update_pet_with_form(
862
+ self,
863
+ pet_id: int,
864
+ *,
865
+ name: str | None = None,
866
+ status: str | None = None,
867
+ request_options: RequestOptionsOrDict | None = None,
868
+ ) -> ApiResult[Pet, UpdatePetWithFormErrorBody]:
869
+ """Updates a pet resource based on the form data.
870
+
871
+ Args:
872
+ pet_id: ID of pet that needs to be updated
873
+ name: Name of pet that needs to be updated
874
+ status: Status of pet that needs to be updated
875
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
876
+ count and statuses.
877
+
878
+ Returns:
879
+ An ``ApiResult`` holding the deserialized response or the error body."""
880
+ return await self._client.execute(
881
+ http_method="POST",
882
+ url_template=self._server.default("/pet/{petId}"),
883
+ path_params=[param[int]("petId", pet_id)],
884
+ query_params=[param[str | None]("name", name), param[str | None]("status", status)],
885
+ headers=[param[UUID]("Idempotency-Key", uuid4())],
886
+ auth_scheme=self._auth.petstore_auth,
887
+ decoder=async_json_decoder[Pet],
888
+ error_mapper=update_pet_with_form_error_mapper,
889
+ request_options=request_options,
890
+ )
891
+
892
+ async def upload_file(
893
+ self,
894
+ pet_id: int,
895
+ *,
896
+ additional_metadata: str | None = None,
897
+ body: AsyncFileInput | None = None,
898
+ request_options: RequestOptionsOrDict | None = None,
899
+ ) -> ApiResult[ApiResponse, UploadFileErrorBody]:
900
+ """Upload image of the pet.
901
+
902
+ Args:
903
+ pet_id: ID of pet to update
904
+ additional_metadata: Additional Metadata
905
+ body: The request body.
906
+ request_options: Per-call overrides for this one request, such as a timeout, extra headers, or its retry
907
+ count and statuses.
908
+
909
+ Returns:
910
+ An ``ApiResult`` holding the deserialized response or the error body."""
911
+ return await self._client.execute(
912
+ http_method="POST",
913
+ url_template=self._server.default("/pet/{petId}/uploadImage"),
914
+ path_params=[param[int]("petId", pet_id)],
915
+ query_params=[param[str | None]("additionalMetadata", additional_metadata)],
916
+ headers=[param[UUID]("Idempotency-Key", uuid4())],
917
+ body=binary_body(body),
918
+ auth_scheme=self._auth.petstore_auth,
919
+ decoder=async_json_decoder[ApiResponse],
920
+ error_mapper=upload_file_error_mapper,
921
+ request_options=request_options,
922
+ )