Skip to content

Latest commit

 

History

History
594 lines (428 loc) · 40.9 KB

README.md

File metadata and controls

594 lines (428 loc) · 40.9 KB

Pet

(pet)

Overview

Everything about your Pets

Find out more dfdsiojfidjs http://swagger.io

Available Operations

petsStoreMonday

Update an existing pet by Id

Example Usage

import { Petstore } from "ryan-simple-test-act";

const petstore = new Petstore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await petstore.pet.petsStoreMonday({
    id: 10,
    name: "doggie",
    category: {
      id: 1,
      name: "Dogs",
    },
    photoUrls: [
      "<value>",
    ],
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { PetstoreCore } from "ryan-simple-test-act/core.js";
import { petPetsStoreMonday } from "ryan-simple-test-act/funcs/petPetsStoreMonday.js";

// Use `PetstoreCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const petstore = new PetstoreCore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await petPetsStoreMonday(petstore, {
    id: 10,
    name: "doggie",
    category: {
      id: 1,
      name: "Dogs",
    },
    photoUrls: [
      "<value>",
    ],
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request components.Pet ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.Pet>

Errors

Error Type Status Code Content Type
errors.ApiErrorInvalidInput 400 application/json
errors.ApiErrorUnauthorized 401 application/json
errors.ApiErrorNotFound 404 application/json
errors.SDKError 4XX, 5XX */*

myTestPets

Add a new pet to the store

Example Usage

import { Petstore } from "ryan-simple-test-act";

const petstore = new Petstore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await petstore.pet.myTestPets({
    id: 10,
    name: "doggie",
    category: {
      id: 1,
      name: "Dogs",
    },
    photoUrls: [
      "<value>",
      "<value>",
      "<value>",
    ],
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { PetstoreCore } from "ryan-simple-test-act/core.js";
import { petMyTestPets } from "ryan-simple-test-act/funcs/petMyTestPets.js";

// Use `PetstoreCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const petstore = new PetstoreCore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await petMyTestPets(petstore, {
    id: 10,
    name: "doggie",
    category: {
      id: 1,
      name: "Dogs",
    },
    photoUrls: [
      "<value>",
      "<value>",
      "<value>",
    ],
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request components.Pet ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.Pet>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

findPetsByStatusTypes

Multiple status values can be provided with comma separated strings

Example Usage

import { Petstore } from "ryan-simple-test-act";

const petstore = new Petstore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await petstore.pet.findPetsByStatusTypes({});

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { PetstoreCore } from "ryan-simple-test-act/core.js";
import { petFindPetsByStatusTypes } from "ryan-simple-test-act/funcs/petFindPetsByStatusTypes.js";

// Use `PetstoreCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const petstore = new PetstoreCore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await petFindPetsByStatusTypes(petstore, {});

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.FindPetsByStatusTypesRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.Pet[]>

Errors

Error Type Status Code Content Type
errors.ApiErrorInvalidInput 400 application/json
errors.ApiErrorUnauthorized 401 application/json
errors.ApiErrorNotFound 404 application/json
errors.SDKError 4XX, 5XX */*

findPetsByTags

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

Example Usage

import { Petstore } from "ryan-simple-test-act";

const petstore = new Petstore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await petstore.pet.findPetsByTags({});

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { PetstoreCore } from "ryan-simple-test-act/core.js";
import { petFindPetsByTags } from "ryan-simple-test-act/funcs/petFindPetsByTags.js";

// Use `PetstoreCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const petstore = new PetstoreCore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await petFindPetsByTags(petstore, {});

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.FindPetsByTagsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.Pet[]>

Errors

Error Type Status Code Content Type
errors.ApiErrorInvalidInput 400 application/json
errors.ApiErrorUnauthorized 401 application/json
errors.ApiErrorNotFound 404 application/json
errors.SDKError 4XX, 5XX */*

getPetByIDS

Returns a single pet

Example Usage

import { Petstore } from "ryan-simple-test-act";

const petstore = new Petstore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await petstore.pet.getPetByIDS({
    petId: 137396,
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { PetstoreCore } from "ryan-simple-test-act/core.js";
import { petGetPetByIDS } from "ryan-simple-test-act/funcs/petGetPetByIDS.js";

// Use `PetstoreCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const petstore = new PetstoreCore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await petGetPetByIDS(petstore, {
    petId: 137396,
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.GetPetByIDSRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.Pet>

Errors

Error Type Status Code Content Type
errors.ApiErrorInvalidInput 400 application/json
errors.ApiErrorUnauthorized 401 application/json
errors.ApiErrorNotFound 404 application/json
errors.SDKError 4XX, 5XX */*

deletePet

Deletes a pet

Example Usage

import { Petstore } from "ryan-simple-test-act";

const petstore = new Petstore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await petstore.pet.deletePet({
    petId: 441876,
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { PetstoreCore } from "ryan-simple-test-act/core.js";
import { petDeletePet } from "ryan-simple-test-act/funcs/petDeletePet.js";

// Use `PetstoreCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const petstore = new PetstoreCore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await petDeletePet(petstore, {
    petId: 441876,
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.DeletePetRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.Pet>

Errors

Error Type Status Code Content Type
errors.ApiErrorInvalidInput 400 application/json
errors.ApiErrorUnauthorized 401 application/json
errors.ApiErrorNotFound 404 application/json
errors.SDKError 4XX, 5XX */*

uploadFile

uploads an image

Example Usage

import { Petstore } from "ryan-simple-test-act";

const petstore = new Petstore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await petstore.pet.uploadFile({
    petId: 565380,
  });

  // Handle the result
  console.log(result);
}

run();

Standalone function

The standalone function version of this method:

import { PetstoreCore } from "ryan-simple-test-act/core.js";
import { petUploadFile } from "ryan-simple-test-act/funcs/petUploadFile.js";

// Use `PetstoreCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const petstore = new PetstoreCore({
  apiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await petUploadFile(petstore, {
    petId: 565380,
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result);
}

run();

Parameters

Parameter Type Required Description
request operations.UploadFileRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<components.ApiResponse>

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*