@redhat-ecosystem-engineering/petstore-client-test 0.0.1
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.
- package/.openapi-generator/FILES +29 -0
- package/.openapi-generator/VERSION +1 -0
- package/.openapi-generator-ignore +23 -0
- package/README.md +156 -0
- package/dist/apis/PetApi.d.ts +354 -0
- package/dist/apis/PetApi.js +423 -0
- package/dist/apis/StoreApi.d.ts +181 -0
- package/dist/apis/StoreApi.js +193 -0
- package/dist/apis/UserApi.d.ts +293 -0
- package/dist/apis/UserApi.js +318 -0
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.js +21 -0
- package/dist/esm/apis/PetApi.d.ts +354 -0
- package/dist/esm/apis/PetApi.js +419 -0
- package/dist/esm/apis/StoreApi.d.ts +181 -0
- package/dist/esm/apis/StoreApi.js +189 -0
- package/dist/esm/apis/UserApi.d.ts +293 -0
- package/dist/esm/apis/UserApi.js +314 -0
- package/dist/esm/apis/index.d.ts +3 -0
- package/dist/esm/apis/index.js +5 -0
- package/dist/esm/index.d.ts +3 -0
- package/dist/esm/index.js +5 -0
- package/dist/esm/models/Category.d.ts +38 -0
- package/dist/esm/models/Category.js +43 -0
- package/dist/esm/models/ModelApiResponse.d.ts +44 -0
- package/dist/esm/models/ModelApiResponse.js +45 -0
- package/dist/esm/models/Order.d.ts +71 -0
- package/dist/esm/models/Order.js +59 -0
- package/dist/esm/models/Pet.d.ts +73 -0
- package/dist/esm/models/Pet.js +65 -0
- package/dist/esm/models/Tag.d.ts +38 -0
- package/dist/esm/models/Tag.js +43 -0
- package/dist/esm/models/User.d.ts +74 -0
- package/dist/esm/models/User.js +55 -0
- package/dist/esm/models/index.d.ts +6 -0
- package/dist/esm/models/index.js +8 -0
- package/dist/esm/runtime.d.ts +184 -0
- package/dist/esm/runtime.js +334 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +21 -0
- package/dist/models/Category.d.ts +38 -0
- package/dist/models/Category.js +50 -0
- package/dist/models/ModelApiResponse.d.ts +44 -0
- package/dist/models/ModelApiResponse.js +52 -0
- package/dist/models/Order.d.ts +71 -0
- package/dist/models/Order.js +67 -0
- package/dist/models/Pet.d.ts +73 -0
- package/dist/models/Pet.js +73 -0
- package/dist/models/Tag.d.ts +38 -0
- package/dist/models/Tag.js +50 -0
- package/dist/models/User.d.ts +74 -0
- package/dist/models/User.js +62 -0
- package/dist/models/index.d.ts +6 -0
- package/dist/models/index.js +24 -0
- package/dist/runtime.d.ts +184 -0
- package/dist/runtime.js +350 -0
- package/docs/Category.md +36 -0
- package/docs/ModelApiResponse.md +38 -0
- package/docs/Order.md +44 -0
- package/docs/Pet.md +44 -0
- package/docs/PetApi.md +622 -0
- package/docs/StoreApi.md +286 -0
- package/docs/Tag.md +36 -0
- package/docs/User.md +48 -0
- package/docs/UserApi.md +496 -0
- package/package.json +21 -0
- package/src/apis/PetApi.ts +739 -0
- package/src/apis/StoreApi.ts +323 -0
- package/src/apis/UserApi.ts +550 -0
- package/src/apis/index.ts +5 -0
- package/src/index.ts +5 -0
- package/src/models/Category.ts +73 -0
- package/src/models/ModelApiResponse.ts +81 -0
- package/src/models/Order.ts +117 -0
- package/src/models/Pet.ts +134 -0
- package/src/models/Tag.ts +73 -0
- package/src/models/User.ts +121 -0
- package/src/models/index.ts +8 -0
- package/src/runtime.ts +432 -0
- package/tsconfig.esm.json +7 -0
- package/tsconfig.json +16 -0
package/docs/PetApi.md
ADDED
|
@@ -0,0 +1,622 @@
|
|
|
1
|
+
# PetApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://petstore3.swagger.io/api/v3*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**addPet**](PetApi.md#addpet) | **POST** /pet | Add a new pet to the store. |
|
|
8
|
+
| [**deletePet**](PetApi.md#deletepet) | **DELETE** /pet/{petId} | Deletes a pet. |
|
|
9
|
+
| [**findPetsByStatus**](PetApi.md#findpetsbystatus) | **GET** /pet/findByStatus | Finds Pets by status. |
|
|
10
|
+
| [**findPetsByTags**](PetApi.md#findpetsbytags) | **GET** /pet/findByTags | Finds Pets by tags. |
|
|
11
|
+
| [**getPetById**](PetApi.md#getpetbyid) | **GET** /pet/{petId} | Find pet by ID. |
|
|
12
|
+
| [**updatePet**](PetApi.md#updatepet) | **PUT** /pet | Update an existing pet. |
|
|
13
|
+
| [**updatePetWithForm**](PetApi.md#updatepetwithform) | **POST** /pet/{petId} | Updates a pet in the store with form data. |
|
|
14
|
+
| [**uploadFile**](PetApi.md#uploadfile) | **POST** /pet/{petId}/uploadImage | Uploads an image. |
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
## addPet
|
|
19
|
+
|
|
20
|
+
> Pet addPet(pet)
|
|
21
|
+
|
|
22
|
+
Add a new pet to the store.
|
|
23
|
+
|
|
24
|
+
Add a new pet to the store.
|
|
25
|
+
|
|
26
|
+
### Example
|
|
27
|
+
|
|
28
|
+
```ts
|
|
29
|
+
import {
|
|
30
|
+
Configuration,
|
|
31
|
+
PetApi,
|
|
32
|
+
} from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
33
|
+
import type { AddPetRequest } from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
34
|
+
|
|
35
|
+
async function example() {
|
|
36
|
+
console.log("🚀 Testing @redhat-ecosystem-engineering/petstore-client-test SDK...");
|
|
37
|
+
const config = new Configuration({
|
|
38
|
+
// To configure OAuth2 access token for authorization: petstore_auth implicit
|
|
39
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
40
|
+
});
|
|
41
|
+
const api = new PetApi(config);
|
|
42
|
+
|
|
43
|
+
const body = {
|
|
44
|
+
// Pet | Create a new pet in the store
|
|
45
|
+
pet: ...,
|
|
46
|
+
} satisfies AddPetRequest;
|
|
47
|
+
|
|
48
|
+
try {
|
|
49
|
+
const data = await api.addPet(body);
|
|
50
|
+
console.log(data);
|
|
51
|
+
} catch (error) {
|
|
52
|
+
console.error(error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Run the test
|
|
57
|
+
example().catch(console.error);
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Parameters
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
| Name | Type | Description | Notes |
|
|
64
|
+
|------------- | ------------- | ------------- | -------------|
|
|
65
|
+
| **pet** | [Pet](Pet.md) | Create a new pet in the store | |
|
|
66
|
+
|
|
67
|
+
### Return type
|
|
68
|
+
|
|
69
|
+
[**Pet**](Pet.md)
|
|
70
|
+
|
|
71
|
+
### Authorization
|
|
72
|
+
|
|
73
|
+
[petstore_auth implicit](../README.md#petstore_auth-implicit)
|
|
74
|
+
|
|
75
|
+
### HTTP request headers
|
|
76
|
+
|
|
77
|
+
- **Content-Type**: `application/json`, `application/xml`, `application/x-www-form-urlencoded`
|
|
78
|
+
- **Accept**: `application/json`, `application/xml`
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### HTTP response details
|
|
82
|
+
| Status code | Description | Response headers |
|
|
83
|
+
|-------------|-------------|------------------|
|
|
84
|
+
| **200** | Successful operation | - |
|
|
85
|
+
| **400** | Invalid input | - |
|
|
86
|
+
| **422** | Validation exception | - |
|
|
87
|
+
| **0** | Unexpected error | - |
|
|
88
|
+
|
|
89
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
## deletePet
|
|
93
|
+
|
|
94
|
+
> deletePet(petId, apiKey)
|
|
95
|
+
|
|
96
|
+
Deletes a pet.
|
|
97
|
+
|
|
98
|
+
Delete a pet.
|
|
99
|
+
|
|
100
|
+
### Example
|
|
101
|
+
|
|
102
|
+
```ts
|
|
103
|
+
import {
|
|
104
|
+
Configuration,
|
|
105
|
+
PetApi,
|
|
106
|
+
} from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
107
|
+
import type { DeletePetRequest } from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
108
|
+
|
|
109
|
+
async function example() {
|
|
110
|
+
console.log("🚀 Testing @redhat-ecosystem-engineering/petstore-client-test SDK...");
|
|
111
|
+
const config = new Configuration({
|
|
112
|
+
// To configure OAuth2 access token for authorization: petstore_auth implicit
|
|
113
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
114
|
+
});
|
|
115
|
+
const api = new PetApi(config);
|
|
116
|
+
|
|
117
|
+
const body = {
|
|
118
|
+
// number | Pet id to delete
|
|
119
|
+
petId: 789,
|
|
120
|
+
// string | (optional)
|
|
121
|
+
apiKey: apiKey_example,
|
|
122
|
+
} satisfies DeletePetRequest;
|
|
123
|
+
|
|
124
|
+
try {
|
|
125
|
+
const data = await api.deletePet(body);
|
|
126
|
+
console.log(data);
|
|
127
|
+
} catch (error) {
|
|
128
|
+
console.error(error);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// Run the test
|
|
133
|
+
example().catch(console.error);
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
### Parameters
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
| Name | Type | Description | Notes |
|
|
140
|
+
|------------- | ------------- | ------------- | -------------|
|
|
141
|
+
| **petId** | `number` | Pet id to delete | [Defaults to `undefined`] |
|
|
142
|
+
| **apiKey** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
143
|
+
|
|
144
|
+
### Return type
|
|
145
|
+
|
|
146
|
+
`void` (Empty response body)
|
|
147
|
+
|
|
148
|
+
### Authorization
|
|
149
|
+
|
|
150
|
+
[petstore_auth implicit](../README.md#petstore_auth-implicit)
|
|
151
|
+
|
|
152
|
+
### HTTP request headers
|
|
153
|
+
|
|
154
|
+
- **Content-Type**: Not defined
|
|
155
|
+
- **Accept**: Not defined
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
### HTTP response details
|
|
159
|
+
| Status code | Description | Response headers |
|
|
160
|
+
|-------------|-------------|------------------|
|
|
161
|
+
| **200** | Pet deleted | - |
|
|
162
|
+
| **400** | Invalid pet value | - |
|
|
163
|
+
| **0** | Unexpected error | - |
|
|
164
|
+
|
|
165
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
## findPetsByStatus
|
|
169
|
+
|
|
170
|
+
> Array<Pet> findPetsByStatus(status)
|
|
171
|
+
|
|
172
|
+
Finds Pets by status.
|
|
173
|
+
|
|
174
|
+
Multiple status values can be provided with comma separated strings.
|
|
175
|
+
|
|
176
|
+
### Example
|
|
177
|
+
|
|
178
|
+
```ts
|
|
179
|
+
import {
|
|
180
|
+
Configuration,
|
|
181
|
+
PetApi,
|
|
182
|
+
} from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
183
|
+
import type { FindPetsByStatusRequest } from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
184
|
+
|
|
185
|
+
async function example() {
|
|
186
|
+
console.log("🚀 Testing @redhat-ecosystem-engineering/petstore-client-test SDK...");
|
|
187
|
+
const config = new Configuration({
|
|
188
|
+
// To configure OAuth2 access token for authorization: petstore_auth implicit
|
|
189
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
190
|
+
});
|
|
191
|
+
const api = new PetApi(config);
|
|
192
|
+
|
|
193
|
+
const body = {
|
|
194
|
+
// 'available' | 'pending' | 'sold' | Status values that need to be considered for filter
|
|
195
|
+
status: status_example,
|
|
196
|
+
} satisfies FindPetsByStatusRequest;
|
|
197
|
+
|
|
198
|
+
try {
|
|
199
|
+
const data = await api.findPetsByStatus(body);
|
|
200
|
+
console.log(data);
|
|
201
|
+
} catch (error) {
|
|
202
|
+
console.error(error);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Run the test
|
|
207
|
+
example().catch(console.error);
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Parameters
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
| Name | Type | Description | Notes |
|
|
214
|
+
|------------- | ------------- | ------------- | -------------|
|
|
215
|
+
| **status** | `available`, `pending`, `sold` | Status values that need to be considered for filter | [Defaults to `'available'`] [Enum: available, pending, sold] |
|
|
216
|
+
|
|
217
|
+
### Return type
|
|
218
|
+
|
|
219
|
+
[**Array<Pet>**](Pet.md)
|
|
220
|
+
|
|
221
|
+
### Authorization
|
|
222
|
+
|
|
223
|
+
[petstore_auth implicit](../README.md#petstore_auth-implicit)
|
|
224
|
+
|
|
225
|
+
### HTTP request headers
|
|
226
|
+
|
|
227
|
+
- **Content-Type**: Not defined
|
|
228
|
+
- **Accept**: `application/json`, `application/xml`
|
|
229
|
+
|
|
230
|
+
|
|
231
|
+
### HTTP response details
|
|
232
|
+
| Status code | Description | Response headers |
|
|
233
|
+
|-------------|-------------|------------------|
|
|
234
|
+
| **200** | successful operation | - |
|
|
235
|
+
| **400** | Invalid status value | - |
|
|
236
|
+
| **0** | Unexpected error | - |
|
|
237
|
+
|
|
238
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
## findPetsByTags
|
|
242
|
+
|
|
243
|
+
> Array<Pet> findPetsByTags(tags)
|
|
244
|
+
|
|
245
|
+
Finds Pets by tags.
|
|
246
|
+
|
|
247
|
+
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
|
|
248
|
+
|
|
249
|
+
### Example
|
|
250
|
+
|
|
251
|
+
```ts
|
|
252
|
+
import {
|
|
253
|
+
Configuration,
|
|
254
|
+
PetApi,
|
|
255
|
+
} from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
256
|
+
import type { FindPetsByTagsRequest } from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
257
|
+
|
|
258
|
+
async function example() {
|
|
259
|
+
console.log("🚀 Testing @redhat-ecosystem-engineering/petstore-client-test SDK...");
|
|
260
|
+
const config = new Configuration({
|
|
261
|
+
// To configure OAuth2 access token for authorization: petstore_auth implicit
|
|
262
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
263
|
+
});
|
|
264
|
+
const api = new PetApi(config);
|
|
265
|
+
|
|
266
|
+
const body = {
|
|
267
|
+
// Array<string> | Tags to filter by
|
|
268
|
+
tags: ...,
|
|
269
|
+
} satisfies FindPetsByTagsRequest;
|
|
270
|
+
|
|
271
|
+
try {
|
|
272
|
+
const data = await api.findPetsByTags(body);
|
|
273
|
+
console.log(data);
|
|
274
|
+
} catch (error) {
|
|
275
|
+
console.error(error);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
// Run the test
|
|
280
|
+
example().catch(console.error);
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
### Parameters
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
| Name | Type | Description | Notes |
|
|
287
|
+
|------------- | ------------- | ------------- | -------------|
|
|
288
|
+
| **tags** | `Array<string>` | Tags to filter by | |
|
|
289
|
+
|
|
290
|
+
### Return type
|
|
291
|
+
|
|
292
|
+
[**Array<Pet>**](Pet.md)
|
|
293
|
+
|
|
294
|
+
### Authorization
|
|
295
|
+
|
|
296
|
+
[petstore_auth implicit](../README.md#petstore_auth-implicit)
|
|
297
|
+
|
|
298
|
+
### HTTP request headers
|
|
299
|
+
|
|
300
|
+
- **Content-Type**: Not defined
|
|
301
|
+
- **Accept**: `application/json`, `application/xml`
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
### HTTP response details
|
|
305
|
+
| Status code | Description | Response headers |
|
|
306
|
+
|-------------|-------------|------------------|
|
|
307
|
+
| **200** | successful operation | - |
|
|
308
|
+
| **400** | Invalid tag value | - |
|
|
309
|
+
| **0** | Unexpected error | - |
|
|
310
|
+
|
|
311
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
## getPetById
|
|
315
|
+
|
|
316
|
+
> Pet getPetById(petId)
|
|
317
|
+
|
|
318
|
+
Find pet by ID.
|
|
319
|
+
|
|
320
|
+
Returns a single pet.
|
|
321
|
+
|
|
322
|
+
### Example
|
|
323
|
+
|
|
324
|
+
```ts
|
|
325
|
+
import {
|
|
326
|
+
Configuration,
|
|
327
|
+
PetApi,
|
|
328
|
+
} from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
329
|
+
import type { GetPetByIdRequest } from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
330
|
+
|
|
331
|
+
async function example() {
|
|
332
|
+
console.log("🚀 Testing @redhat-ecosystem-engineering/petstore-client-test SDK...");
|
|
333
|
+
const config = new Configuration({
|
|
334
|
+
// To configure OAuth2 access token for authorization: petstore_auth implicit
|
|
335
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
336
|
+
// To configure API key authorization: api_key
|
|
337
|
+
apiKey: "YOUR API KEY",
|
|
338
|
+
});
|
|
339
|
+
const api = new PetApi(config);
|
|
340
|
+
|
|
341
|
+
const body = {
|
|
342
|
+
// number | ID of pet to return
|
|
343
|
+
petId: 789,
|
|
344
|
+
} satisfies GetPetByIdRequest;
|
|
345
|
+
|
|
346
|
+
try {
|
|
347
|
+
const data = await api.getPetById(body);
|
|
348
|
+
console.log(data);
|
|
349
|
+
} catch (error) {
|
|
350
|
+
console.error(error);
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Run the test
|
|
355
|
+
example().catch(console.error);
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
### Parameters
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
| Name | Type | Description | Notes |
|
|
362
|
+
|------------- | ------------- | ------------- | -------------|
|
|
363
|
+
| **petId** | `number` | ID of pet to return | [Defaults to `undefined`] |
|
|
364
|
+
|
|
365
|
+
### Return type
|
|
366
|
+
|
|
367
|
+
[**Pet**](Pet.md)
|
|
368
|
+
|
|
369
|
+
### Authorization
|
|
370
|
+
|
|
371
|
+
[petstore_auth implicit](../README.md#petstore_auth-implicit), [api_key](../README.md#api_key)
|
|
372
|
+
|
|
373
|
+
### HTTP request headers
|
|
374
|
+
|
|
375
|
+
- **Content-Type**: Not defined
|
|
376
|
+
- **Accept**: `application/json`, `application/xml`
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
### HTTP response details
|
|
380
|
+
| Status code | Description | Response headers |
|
|
381
|
+
|-------------|-------------|------------------|
|
|
382
|
+
| **200** | successful operation | - |
|
|
383
|
+
| **400** | Invalid ID supplied | - |
|
|
384
|
+
| **404** | Pet not found | - |
|
|
385
|
+
| **0** | Unexpected error | - |
|
|
386
|
+
|
|
387
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
## updatePet
|
|
391
|
+
|
|
392
|
+
> Pet updatePet(pet)
|
|
393
|
+
|
|
394
|
+
Update an existing pet.
|
|
395
|
+
|
|
396
|
+
Update an existing pet by Id.
|
|
397
|
+
|
|
398
|
+
### Example
|
|
399
|
+
|
|
400
|
+
```ts
|
|
401
|
+
import {
|
|
402
|
+
Configuration,
|
|
403
|
+
PetApi,
|
|
404
|
+
} from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
405
|
+
import type { UpdatePetRequest } from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
406
|
+
|
|
407
|
+
async function example() {
|
|
408
|
+
console.log("🚀 Testing @redhat-ecosystem-engineering/petstore-client-test SDK...");
|
|
409
|
+
const config = new Configuration({
|
|
410
|
+
// To configure OAuth2 access token for authorization: petstore_auth implicit
|
|
411
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
412
|
+
});
|
|
413
|
+
const api = new PetApi(config);
|
|
414
|
+
|
|
415
|
+
const body = {
|
|
416
|
+
// Pet | Update an existent pet in the store
|
|
417
|
+
pet: ...,
|
|
418
|
+
} satisfies UpdatePetRequest;
|
|
419
|
+
|
|
420
|
+
try {
|
|
421
|
+
const data = await api.updatePet(body);
|
|
422
|
+
console.log(data);
|
|
423
|
+
} catch (error) {
|
|
424
|
+
console.error(error);
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
// Run the test
|
|
429
|
+
example().catch(console.error);
|
|
430
|
+
```
|
|
431
|
+
|
|
432
|
+
### Parameters
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
| Name | Type | Description | Notes |
|
|
436
|
+
|------------- | ------------- | ------------- | -------------|
|
|
437
|
+
| **pet** | [Pet](Pet.md) | Update an existent pet in the store | |
|
|
438
|
+
|
|
439
|
+
### Return type
|
|
440
|
+
|
|
441
|
+
[**Pet**](Pet.md)
|
|
442
|
+
|
|
443
|
+
### Authorization
|
|
444
|
+
|
|
445
|
+
[petstore_auth implicit](../README.md#petstore_auth-implicit)
|
|
446
|
+
|
|
447
|
+
### HTTP request headers
|
|
448
|
+
|
|
449
|
+
- **Content-Type**: `application/json`, `application/xml`, `application/x-www-form-urlencoded`
|
|
450
|
+
- **Accept**: `application/json`, `application/xml`
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
### HTTP response details
|
|
454
|
+
| Status code | Description | Response headers |
|
|
455
|
+
|-------------|-------------|------------------|
|
|
456
|
+
| **200** | Successful operation | - |
|
|
457
|
+
| **400** | Invalid ID supplied | - |
|
|
458
|
+
| **404** | Pet not found | - |
|
|
459
|
+
| **422** | Validation exception | - |
|
|
460
|
+
| **0** | Unexpected error | - |
|
|
461
|
+
|
|
462
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
463
|
+
|
|
464
|
+
|
|
465
|
+
## updatePetWithForm
|
|
466
|
+
|
|
467
|
+
> Pet updatePetWithForm(petId, name, status)
|
|
468
|
+
|
|
469
|
+
Updates a pet in the store with form data.
|
|
470
|
+
|
|
471
|
+
Updates a pet resource based on the form data.
|
|
472
|
+
|
|
473
|
+
### Example
|
|
474
|
+
|
|
475
|
+
```ts
|
|
476
|
+
import {
|
|
477
|
+
Configuration,
|
|
478
|
+
PetApi,
|
|
479
|
+
} from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
480
|
+
import type { UpdatePetWithFormRequest } from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
481
|
+
|
|
482
|
+
async function example() {
|
|
483
|
+
console.log("🚀 Testing @redhat-ecosystem-engineering/petstore-client-test SDK...");
|
|
484
|
+
const config = new Configuration({
|
|
485
|
+
// To configure OAuth2 access token for authorization: petstore_auth implicit
|
|
486
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
487
|
+
});
|
|
488
|
+
const api = new PetApi(config);
|
|
489
|
+
|
|
490
|
+
const body = {
|
|
491
|
+
// number | ID of pet that needs to be updated
|
|
492
|
+
petId: 789,
|
|
493
|
+
// string | Name of pet that needs to be updated (optional)
|
|
494
|
+
name: name_example,
|
|
495
|
+
// string | Status of pet that needs to be updated (optional)
|
|
496
|
+
status: status_example,
|
|
497
|
+
} satisfies UpdatePetWithFormRequest;
|
|
498
|
+
|
|
499
|
+
try {
|
|
500
|
+
const data = await api.updatePetWithForm(body);
|
|
501
|
+
console.log(data);
|
|
502
|
+
} catch (error) {
|
|
503
|
+
console.error(error);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// Run the test
|
|
508
|
+
example().catch(console.error);
|
|
509
|
+
```
|
|
510
|
+
|
|
511
|
+
### Parameters
|
|
512
|
+
|
|
513
|
+
|
|
514
|
+
| Name | Type | Description | Notes |
|
|
515
|
+
|------------- | ------------- | ------------- | -------------|
|
|
516
|
+
| **petId** | `number` | ID of pet that needs to be updated | [Defaults to `undefined`] |
|
|
517
|
+
| **name** | `string` | Name of pet that needs to be updated | [Optional] [Defaults to `undefined`] |
|
|
518
|
+
| **status** | `string` | Status of pet that needs to be updated | [Optional] [Defaults to `undefined`] |
|
|
519
|
+
|
|
520
|
+
### Return type
|
|
521
|
+
|
|
522
|
+
[**Pet**](Pet.md)
|
|
523
|
+
|
|
524
|
+
### Authorization
|
|
525
|
+
|
|
526
|
+
[petstore_auth implicit](../README.md#petstore_auth-implicit)
|
|
527
|
+
|
|
528
|
+
### HTTP request headers
|
|
529
|
+
|
|
530
|
+
- **Content-Type**: Not defined
|
|
531
|
+
- **Accept**: `application/json`, `application/xml`
|
|
532
|
+
|
|
533
|
+
|
|
534
|
+
### HTTP response details
|
|
535
|
+
| Status code | Description | Response headers |
|
|
536
|
+
|-------------|-------------|------------------|
|
|
537
|
+
| **200** | successful operation | - |
|
|
538
|
+
| **400** | Invalid input | - |
|
|
539
|
+
| **0** | Unexpected error | - |
|
|
540
|
+
|
|
541
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
542
|
+
|
|
543
|
+
|
|
544
|
+
## uploadFile
|
|
545
|
+
|
|
546
|
+
> ModelApiResponse uploadFile(petId, additionalMetadata, body)
|
|
547
|
+
|
|
548
|
+
Uploads an image.
|
|
549
|
+
|
|
550
|
+
Upload image of the pet.
|
|
551
|
+
|
|
552
|
+
### Example
|
|
553
|
+
|
|
554
|
+
```ts
|
|
555
|
+
import {
|
|
556
|
+
Configuration,
|
|
557
|
+
PetApi,
|
|
558
|
+
} from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
559
|
+
import type { UploadFileRequest } from '@redhat-ecosystem-engineering/petstore-client-test';
|
|
560
|
+
|
|
561
|
+
async function example() {
|
|
562
|
+
console.log("🚀 Testing @redhat-ecosystem-engineering/petstore-client-test SDK...");
|
|
563
|
+
const config = new Configuration({
|
|
564
|
+
// To configure OAuth2 access token for authorization: petstore_auth implicit
|
|
565
|
+
accessToken: "YOUR ACCESS TOKEN",
|
|
566
|
+
});
|
|
567
|
+
const api = new PetApi(config);
|
|
568
|
+
|
|
569
|
+
const body = {
|
|
570
|
+
// number | ID of pet to update
|
|
571
|
+
petId: 789,
|
|
572
|
+
// string | Additional Metadata (optional)
|
|
573
|
+
additionalMetadata: additionalMetadata_example,
|
|
574
|
+
// Blob (optional)
|
|
575
|
+
body: BINARY_DATA_HERE,
|
|
576
|
+
} satisfies UploadFileRequest;
|
|
577
|
+
|
|
578
|
+
try {
|
|
579
|
+
const data = await api.uploadFile(body);
|
|
580
|
+
console.log(data);
|
|
581
|
+
} catch (error) {
|
|
582
|
+
console.error(error);
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
|
|
586
|
+
// Run the test
|
|
587
|
+
example().catch(console.error);
|
|
588
|
+
```
|
|
589
|
+
|
|
590
|
+
### Parameters
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
| Name | Type | Description | Notes |
|
|
594
|
+
|------------- | ------------- | ------------- | -------------|
|
|
595
|
+
| **petId** | `number` | ID of pet to update | [Defaults to `undefined`] |
|
|
596
|
+
| **additionalMetadata** | `string` | Additional Metadata | [Optional] [Defaults to `undefined`] |
|
|
597
|
+
| **body** | `Blob` | | [Optional] |
|
|
598
|
+
|
|
599
|
+
### Return type
|
|
600
|
+
|
|
601
|
+
[**ModelApiResponse**](ModelApiResponse.md)
|
|
602
|
+
|
|
603
|
+
### Authorization
|
|
604
|
+
|
|
605
|
+
[petstore_auth implicit](../README.md#petstore_auth-implicit)
|
|
606
|
+
|
|
607
|
+
### HTTP request headers
|
|
608
|
+
|
|
609
|
+
- **Content-Type**: `application/octet-stream`
|
|
610
|
+
- **Accept**: `application/json`
|
|
611
|
+
|
|
612
|
+
|
|
613
|
+
### HTTP response details
|
|
614
|
+
| Status code | Description | Response headers |
|
|
615
|
+
|-------------|-------------|------------------|
|
|
616
|
+
| **200** | successful operation | - |
|
|
617
|
+
| **400** | No file uploaded | - |
|
|
618
|
+
| **404** | Pet not found | - |
|
|
619
|
+
| **0** | Unexpected error | - |
|
|
620
|
+
|
|
621
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
622
|
+
|