(pet)
Everything about your Pets
Find out more http://swagger.io
- addPetForm - Add a new pet to the store
- addPetJson - Add a new pet to the store
- addPetRaw - Add a new pet to the store
- deletePet - Deletes a pet
- findPetsByStatus - Finds Pets by status
- findPetsByTags - Finds Pets by tags
- getPetById - Find pet by ID
- updatePetWithForm - Updates a pet in the store with form data
- updatePetForm - Update an existing pet
- updatePetJson - Update an existing pet
- updatePetRaw - Update an existing pet
- uploadFile - uploads an image
Add a new pet to the store
import { Test } from "Test";
import { PetStatus } from "Test/dist/sdk/models/shared";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.pet.addPetForm({
category: {
id: 1,
name: "Dogs",
},
id: 10,
name: "doggie",
photoUrls: [
"<value>",
],
tags: [
{},
],
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
shared.Pet | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.AddPetFormResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Add a new pet to the store
import { Test } from "Test";
import { PetStatus } from "Test/dist/sdk/models/shared";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.pet.addPetJson({
category: {
id: 1,
name: "Dogs",
},
id: 10,
name: "doggie",
photoUrls: [
"<value>",
],
tags: [
{},
],
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
shared.Pet | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.AddPetJsonResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Add a new pet to the store
import { Test } from "Test";
import { PetStatus } from "Test/dist/sdk/models/shared";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.pet.addPetRaw(new TextEncoder().encode("0xcf5E85CDde"));
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
Uint8Array | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.AddPetRawResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Deletes a pet
import { Test } from "Test";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.pet.deletePet({
petId: 441876,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DeletePetRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.DeletePetResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Multiple status values can be provided with comma separated strings
import { Test } from "Test";
import { Status } from "Test/dist/sdk/models/operations";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.pet.findPetsByStatus({});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FindPetsByStatusRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.FindPetsByStatusResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
import { Test } from "Test";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.pet.findPetsByTags({
tags: [
"<value>",
],
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.FindPetsByTagsRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.FindPetsByTagsResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Returns a single pet
import { Test } from "Test";
import { GetPetByIdSecurity } from "Test/dist/sdk/models/operations";
async function run() {
const sdk = new Test();
const operationSecurity: GetPetByIdSecurity = {
apiKey: "<YOUR_API_KEY_HERE>",
};
const res = await sdk.pet.getPetById({
petId: 504151,
}, operationSecurity);
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.GetPetByIdRequest | ✔️ | The request object to use for the request. |
security |
operations.GetPetByIdSecurity | ✔️ | The security requirements to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.GetPetByIdResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Updates a pet in the store with form data
import { Test } from "Test";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.pet.updatePetWithForm({
petId: 303241,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.UpdatePetWithFormRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.UpdatePetWithFormResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Update an existing pet by Id
import { Test } from "Test";
import { PetStatus } from "Test/dist/sdk/models/shared";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.pet.updatePetForm({
category: {
id: 1,
name: "Dogs",
},
id: 10,
name: "doggie",
photoUrls: [
"<value>",
],
tags: [
{},
],
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
shared.Pet | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.UpdatePetFormResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Update an existing pet by Id
import { Test } from "Test";
import { PetStatus } from "Test/dist/sdk/models/shared";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.pet.updatePetJson({
category: {
id: 1,
name: "Dogs",
},
id: 10,
name: "doggie",
photoUrls: [
"<value>",
],
tags: [
{},
],
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
shared.Pet | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.UpdatePetJsonResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
Update an existing pet by Id
import { Test } from "Test";
import { PetStatus } from "Test/dist/sdk/models/shared";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.pet.updatePetRaw(new TextEncoder().encode("0x6bCA76De67"));
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
Uint8Array | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.UpdatePetRawResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |
uploads an image
import { Test } from "Test";
async function run() {
const sdk = new Test({
security: {
petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
},
});
const res = await sdk.pet.uploadFile({
requestBody: new TextEncoder().encode("0xc7cca7F47D"),
petId: 621158,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.UploadFileRequest | ✔️ | The request object to use for the request. |
config |
AxiosRequestConfig | ➖ | Available config options for making requests. |
Promise<operations.UploadFileResponse>
Error Object | Status Code | Content Type |
---|---|---|
errors.SDKError | 4xx-5xx | / |