(user)
Operations about user
- createUser - Create user
- createUsersWithListInput - Creates list of users with given input array
- loginUser - Logs user into the system
- logoutUser - Logs out current logged in user session
- getUserByName - Get user by user name
- updateUser - Update user
- deleteUser - Delete user
This can only be done by the logged in user.
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();
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();
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. |
Promise<components.User>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Creates list of users with given input array
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();
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();
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. |
Promise<components.User>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Logs user into the system
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();
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();
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. |
Promise<operations.LoginUserResponse>
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 | */* |
Logs out current logged in user session
import { Petstore } from "ryan-simple-test-act";
const petstore = new Petstore({
apiKey: "<YOUR_API_KEY_HERE>",
});
async function run() {
await petstore.user.logoutUser();
}
run();
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();
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. |
Promise<void>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Get user by user name
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();
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();
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. |
Promise<components.User>
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 | */* |
This can only be done by the logged in user.
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();
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();
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. |
Promise<void>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
This can only be done by the logged in user.
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();
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();
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. |
Promise<components.User>
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 | */* |