Skip to content

Latest commit

 

History

History
292 lines (204 loc) · 12.2 KB

README.md

File metadata and controls

292 lines (204 loc) · 12.2 KB

Store

(store)

Overview

Access to Petstore orders

Find out more about our store http://swagger.io

Available Operations

deleteOrder

For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors

Example Usage

import { Test } from "Test";

async function run() {
  const sdk = new Test({
    security: {
      petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
    },
  });

  const res = await sdk.store.deleteOrder({
    orderId: 127902,
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

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

Response

Promise<operations.DeleteOrderResponse>

Errors

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

getInventory

Returns a map of status codes to quantities

Example Usage

import { Test } from "Test";
import { GetInventorySecurity } from "Test/dist/sdk/models/operations";

async function run() {
  const sdk = new Test();
const operationSecurity: GetInventorySecurity = {
  apiKey: "<YOUR_API_KEY_HERE>",
};

  const res = await sdk.store.getInventory(operationSecurity);

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

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

Response

Promise<operations.GetInventoryResponse>

Errors

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

getOrderById

For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions.

Example Usage

import { Test } from "Test";

async function run() {
  const sdk = new Test({
    security: {
      petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
    },
  });

  const res = await sdk.store.getOrderById({
    orderId: 614993,
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

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

Response

Promise<operations.GetOrderByIdResponse>

Errors

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

placeOrderForm

Place a new order in the store

Example Usage

import { Test } from "Test";
import { Status } from "Test/dist/sdk/models/shared";

async function run() {
  const sdk = new Test({
    security: {
      petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
    },
  });

  const res = await sdk.store.placeOrderForm({
    id: 10,
    petId: 198772,
    quantity: 7,
    status: Status.Approved,
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

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

Response

Promise<operations.PlaceOrderFormResponse>

Errors

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

placeOrderJson

Place a new order in the store

Example Usage

import { Test } from "Test";
import { Status } from "Test/dist/sdk/models/shared";

async function run() {
  const sdk = new Test({
    security: {
      petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
    },
  });

  const res = await sdk.store.placeOrderJson({
    id: 10,
    petId: 198772,
    quantity: 7,
    status: Status.Approved,
  });

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

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

Response

Promise<operations.PlaceOrderJsonResponse>

Errors

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

placeOrderRaw

Place a new order in the store

Example Usage

import { Test } from "Test";
import { Status } from "Test/dist/sdk/models/shared";

async function run() {
  const sdk = new Test({
    security: {
      petstoreAuth: "<YOUR_PETSTORE_AUTH_HERE>",
    },
  });

  const res = await sdk.store.placeOrderRaw(new TextEncoder().encode("0xcB9dC14dEe"));

  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.PlaceOrderRawResponse>

Errors

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