/* * OpenAPI Petstore * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * The version of the OpenAPI document: 1.0.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { ApiExecuterI, ApiError, checkRequiredParams, cleanCopyBody } from "api/ApiHelper" import { User } from 'model/User'; /** * This can only be done by the logged in user. * @summary Create user * @param fe Callback interface that runs the fetch query * @param user Created user object * @response 0 [undefined] successful operation */ export public async function UserApi__createUser(fe : ApiExecuterI, user: User) : Promise { checkRequiredParams('createUser', { 'user': user }); const _pathParams = { }; const _queryParams = { }; const _headerParams = { }; const _body = cleanCopyBody(user, 'id', 'username', 'firstName', 'lastName', 'email', 'password', 'phone', 'userStatus'); await fe.exec( 'POST', '/v2' + '/user', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * * @summary Creates list of users with given input array * @param fe Callback interface that runs the fetch query * @param user List of user object * @response 0 [undefined] successful operation */ export public async function UserApi__createUsersWithArrayInput(fe : ApiExecuterI, user: User[]) : Promise { checkRequiredParams('createUsersWithArrayInput', { 'user': user }); const _pathParams = { }; const _queryParams = { }; const _headerParams = { }; const _body = user; await fe.exec( 'POST', '/v2' + '/user/createWithArray', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * * @summary Creates list of users with given input array * @param fe Callback interface that runs the fetch query * @param user List of user object * @response 0 [undefined] successful operation */ export public async function UserApi__createUsersWithListInput(fe : ApiExecuterI, user: User[]) : Promise { checkRequiredParams('createUsersWithListInput', { 'user': user }); const _pathParams = { }; const _queryParams = { }; const _headerParams = { }; const _body = user; await fe.exec( 'POST', '/v2' + '/user/createWithList', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * This can only be done by the logged in user. * @summary Delete user * @param fe Callback interface that runs the fetch query * @param username The name that needs to be deleted * @response 400 [undefined] Invalid username supplied * @response 404 [undefined] User not found */ export public async function UserApi__deleteUser(fe : ApiExecuterI, username: string) : Promise> { checkRequiredParams('deleteUser', { 'username': username }); const _pathParams = { 'username': username }; const _queryParams = { }; const _headerParams = { }; const _body = undefined; await fe.exec( 'DELETE', '/v2' + '/user/{username}', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * * @summary Get user by user name * @param fe Callback interface that runs the fetch query * @param username The name that needs to be fetched. Use user1 for testing. * @response 200 [User] successful operation * @response 400 [undefined] Invalid username supplied * @response 404 [undefined] User not found */ export public async function UserApi__getUserByName(fe : ApiExecuterI, username: string) : Promise> { checkRequiredParams('getUserByName', { 'username': username }); const _pathParams = { 'username': username }; const _queryParams = { }; const _headerParams = { }; const _body = undefined; return await fe.exec( 'GET', '/v2' + '/user/{username}', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * * @summary Logs user into the system * @param fe Callback interface that runs the fetch query * @param username The user name for login * @param password The password for login in clear text * @response 200 [string] successful operation * @response 400 [undefined] Invalid username/password supplied */ export public async function UserApi__loginUser(fe : ApiExecuterI, username: string, password: string) : Promise> { checkRequiredParams('loginUser', { 'username': username, 'password': password }); const _pathParams = { }; const _queryParams = { 'username': username, 'password': password }; const _headerParams = { }; const _body = undefined; return await fe.exec( 'GET', '/v2' + '/user/login', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * * @summary Logs out current logged in user session * @param fe Callback interface that runs the fetch query * @response 0 [undefined] successful operation */ export public async function UserApi__logoutUser(fe : ApiExecuterI, ) : Promise { checkRequiredParams('logoutUser', { }); const _pathParams = { }; const _queryParams = { }; const _headerParams = { }; const _body = undefined; await fe.exec( 'GET', '/v2' + '/user/logout', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * This can only be done by the logged in user. * @summary Updated user * @param fe Callback interface that runs the fetch query * @param username name that need to be deleted * @param user Updated user object * @response 400 [undefined] Invalid user supplied * @response 404 [undefined] User not found */ export public async function UserApi__updateUser(fe : ApiExecuterI, username: string, user: User) : Promise> { checkRequiredParams('updateUser', { 'username': username, 'user': user }); const _pathParams = { 'username': username }; const _queryParams = { }; const _headerParams = { }; const _body = cleanCopyBody(user, 'id', 'username', 'firstName', 'lastName', 'email', 'password', 'phone', 'userStatus'); await fe.exec( 'PUT', '/v2' + '/user/{username}', _pathParams, _queryParams, _headerParams, undefined, _body ); }