Skip to content

Latest commit

 

History

History
612 lines (440 loc) · 24.7 KB

README.md

File metadata and controls

612 lines (440 loc) · 24.7 KB

Pet

(pet)

Overview

Everything about your Pets

Find out more http://swagger.io

Available Operations

addPetForm

Add a new pet to the store

Example Usage

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();

Parameters

Parameter Type Required Description
request shared.Pet ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.AddPetFormResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

addPetJson

Add a new pet to the store

Example Usage

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();

Parameters

Parameter Type Required Description
request shared.Pet ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.AddPetJsonResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

addPetRaw

Add a new pet to the store

Example Usage

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();

Parameters

Parameter Type Required Description
request Uint8Array ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.AddPetRawResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

deletePet

Deletes a pet

Example Usage

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();

Parameters

Parameter Type Required Description
request operations.DeletePetRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.DeletePetResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

findPetsByStatus

Multiple status values can be provided with comma separated strings

Example Usage

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();

Parameters

Parameter Type Required Description
request operations.FindPetsByStatusRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.FindPetsByStatusResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

findPetsByTags

Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.

Example Usage

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();

Parameters

Parameter Type Required Description
request operations.FindPetsByTagsRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.FindPetsByTagsResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getPetById

Returns a single pet

Example Usage

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();

Parameters

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.

Response

Promise<operations.GetPetByIdResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

updatePetWithForm

Updates a pet in the store with form data

Example Usage

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();

Parameters

Parameter Type Required Description
request operations.UpdatePetWithFormRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.UpdatePetWithFormResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

updatePetForm

Update an existing pet by Id

Example Usage

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();

Parameters

Parameter Type Required Description
request shared.Pet ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.UpdatePetFormResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

updatePetJson

Update an existing pet by Id

Example Usage

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();

Parameters

Parameter Type Required Description
request shared.Pet ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.UpdatePetJsonResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

updatePetRaw

Update an existing pet by Id

Example Usage

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();

Parameters

Parameter Type Required Description
request Uint8Array ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.UpdatePetRawResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

uploadFile

uploads an image

Example Usage

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();

Parameters

Parameter Type Required Description
request operations.UploadFileRequest ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.UploadFileResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /