Skip to content

Latest commit

 

History

History
596 lines (427 loc) · 39.8 KB

README.md

File metadata and controls

596 lines (427 loc) · 39.8 KB

User

(user)

Overview

Operations about user

Available Operations

createUser

This can only be done by the logged in user.

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.user.createUser({
    id: 10,
    username: "theUser",
    firstName: "John",
    lastName: "James",
    email: "[email protected]",
    password: "12345",
    phone: "12345",
    userStatus: 1,
  });

  // 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 { userCreateUser } from "ryan-simple-test-act/funcs/userCreateUser.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 userCreateUser(petstore, {
    id: 10,
    username: "theUser",
    firstName: "John",
    lastName: "James",
    email: "[email protected]",
    password: "12345",
    phone: "12345",
    userStatus: 1,
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request components.User ✔️ 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.User>

Errors

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

createUsersWithListInput

Creates list of users with given input array

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.user.createUsersWithListInput([
    {
      id: 10,
      username: "theUser",
      firstName: "John",
      lastName: "James",
      email: "[email protected]",
      password: "12345",
      phone: "12345",
      userStatus: 1,
    },
  ]);

  // 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 { userCreateUsersWithListInput } from "ryan-simple-test-act/funcs/userCreateUsersWithListInput.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 userCreateUsersWithListInput(petstore, [
    {
      id: 10,
      username: "theUser",
      firstName: "John",
      lastName: "James",
      email: "[email protected]",
      password: "12345",
      phone: "12345",
      userStatus: 1,
    },
  ]);

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request components.User[] ✔️ 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.User>

Errors

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

loginUser

Logs user into the system

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.user.loginUser({});

  // 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 { userLoginUser } from "ryan-simple-test-act/funcs/userLoginUser.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 userLoginUser(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.LoginUserRequest ✔️ 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<operations.LoginUserResponse>

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 */*

logoutUser

Logs out current logged in user session

Example Usage

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

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

async function run() {
  await petstore.user.logoutUser();


}

run();

Standalone function

The standalone function version of this method:

import { PetstoreCore } from "ryan-simple-test-act/core.js";
import { userLogoutUser } from "ryan-simple-test-act/funcs/userLogoutUser.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 userLogoutUser(petstore);

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

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
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<void>

Errors

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

getUserByName

Get user by user name

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.user.getUserByName({
    username: "Zachery_Lubowitz15",
  });

  // 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 { userGetUserByName } from "ryan-simple-test-act/funcs/userGetUserByName.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 userGetUserByName(petstore, {
    username: "Zachery_Lubowitz15",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.GetUserByNameRequest ✔️ 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.User>

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 */*

updateUser

This can only be done by the logged in user.

Example Usage

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

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

async function run() {
  await petstore.user.updateUser({
    username: "Dandre_Hand41",
    user: {
      id: 10,
      username: "theUser",
      firstName: "John",
      lastName: "James",
      email: "[email protected]",
      password: "12345",
      phone: "12345",
      userStatus: 1,
    },
  });


}

run();

Standalone function

The standalone function version of this method:

import { PetstoreCore } from "ryan-simple-test-act/core.js";
import { userUpdateUser } from "ryan-simple-test-act/funcs/userUpdateUser.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 userUpdateUser(petstore, {
    username: "Dandre_Hand41",
    user: {
      id: 10,
      username: "theUser",
      firstName: "John",
      lastName: "James",
      email: "[email protected]",
      password: "12345",
      phone: "12345",
      userStatus: 1,
    },
  });

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

  const { value: result } = res;

  
}

run();

Parameters

Parameter Type Required Description
request operations.UpdateUserRequest ✔️ 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<void>

Errors

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

deleteUser

This can only be done by the logged in user.

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.user.deleteUser({
    username: "Demetris_Schmitt",
  });

  // 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 { userDeleteUser } from "ryan-simple-test-act/funcs/userDeleteUser.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 userDeleteUser(petstore, {
    username: "Demetris_Schmitt",
  });

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

  const { value: result } = res;

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

run();

Parameters

Parameter Type Required Description
request operations.DeleteUserRequest ✔️ 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.User>

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 */*