/* * 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 { ApiResponse } from 'model/ApiResponse'; import { Pet } from 'model/Pet'; /** * * @summary Add a new pet to the store * @param fe Callback interface that runs the fetch query * @param pet Pet object that needs to be added to the store * @response 200 [Pet] successful operation * @response 405 [undefined] Invalid input */ export public async function PetApi__addPet(fe : ApiExecuterI, pet: Pet) : Promise> { checkRequiredParams('addPet', { 'pet': pet }); const _pathParams = { }; const _queryParams = { }; const _headerParams = { }; const _body = cleanCopyBody(pet, 'id', 'category', 'name', 'photoUrls', 'tags', 'status'); return await fe.exec( 'POST', '/v2' + '/pet', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * * @summary Deletes a pet * @param fe Callback interface that runs the fetch query * @param petId Pet id to delete * @param apiKey * @response 400 [undefined] Invalid pet value */ export public async function PetApi__deletePet(fe : ApiExecuterI, petId: int, apiKey: string=) : Promise> { checkRequiredParams('deletePet', { 'petId': petId, }); const _pathParams = { 'petId': petId }; const _queryParams = { }; const _headerParams = { 'api_key': apiKey }; const _body = undefined; await fe.exec( 'DELETE', '/v2' + '/pet/{petId}', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * Multiple status values can be provided with comma separated strings * @summary Finds Pets by status * @param fe Callback interface that runs the fetch query * @param status Status values that need to be considered for filter * @response 200 [Pet[]] successful operation * @response 400 [undefined] Invalid status value */ export public async function PetApi__findPetsByStatus(fe : ApiExecuterI, status: "available" | "pending" | "sold"[]) : Promise> { checkRequiredParams('findPetsByStatus', { 'status': status }); const _pathParams = { }; const _queryParams = { 'status': status }; const _headerParams = { }; const _body = undefined; return await fe.exec( 'GET', '/v2' + '/pet/findByStatus', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @summary Finds Pets by tags * @param fe Callback interface that runs the fetch query * @param tags Tags to filter by * @response 200 [Pet[]] successful operation * @response 400 [undefined] Invalid tag value */ export public async function PetApi__findPetsByTags(fe : ApiExecuterI, tags: string[]) : Promise> { checkRequiredParams('findPetsByTags', { 'tags': tags }); const _pathParams = { }; const _queryParams = { 'tags': tags }; const _headerParams = { }; const _body = undefined; return await fe.exec( 'GET', '/v2' + '/pet/findByTags', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * Returns a single pet * @summary Find pet by ID * @param fe Callback interface that runs the fetch query * @param petId ID of pet to return * @response 200 [Pet] successful operation * @response 400 [undefined] Invalid ID supplied * @response 404 [undefined] Pet not found */ export public async function PetApi__getPetById(fe : ApiExecuterI, petId: int) : Promise> { checkRequiredParams('getPetById', { 'petId': petId }); const _pathParams = { 'petId': petId }; const _queryParams = { }; const _headerParams = { }; const _body = undefined; return await fe.exec( 'GET', '/v2' + '/pet/{petId}', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * * @summary Update an existing pet * @param fe Callback interface that runs the fetch query * @param pet Pet object that needs to be added to the store * @response 200 [Pet] successful operation * @response 400 [undefined] Invalid ID supplied * @response 404 [undefined] Pet not found * @response 405 [undefined] Validation exception */ export public async function PetApi__updatePet(fe : ApiExecuterI, pet: Pet) : Promise> { checkRequiredParams('updatePet', { 'pet': pet }); const _pathParams = { }; const _queryParams = { }; const _headerParams = { }; const _body = cleanCopyBody(pet, 'id', 'category', 'name', 'photoUrls', 'tags', 'status'); return await fe.exec( 'PUT', '/v2' + '/pet', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * * @summary Updates a pet in the store with form data * @param fe Callback interface that runs the fetch query * @param petId ID of pet that needs to be updated * @param name Updated name of the pet * @param status Updated status of the pet * @response 405 [undefined] Invalid input */ export public async function PetApi__updatePetWithForm(fe : ApiExecuterI, petId: int, name: string=, status: string=) : Promise> { checkRequiredParams('updatePetWithForm', { 'petId': petId, }); const _pathParams = { 'petId': petId }; const _queryParams = { }; const _headerParams = { }; const _body = undefined; await fe.exec( 'POST', '/v2' + '/pet/{petId}', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * * @summary uploads an image * @param fe Callback interface that runs the fetch query * @param petId ID of pet to update * @param additionalMetadata Additional data to pass to server * @param file file to upload * @response 200 [ApiResponse] successful operation */ export public async function PetApi__uploadFile(fe : ApiExecuterI, petId: int, additionalMetadata: string=, file: any=) : Promise { checkRequiredParams('uploadFile', { 'petId': petId, }); const _pathParams = { 'petId': petId }; const _queryParams = { }; const _headerParams = { }; const _body = undefined; return await fe.exec( 'POST', '/v2' + '/pet/{petId}/uploadImage', _pathParams, _queryParams, _headerParams, undefined, _body ); }