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