/* * 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 { Order } from 'model/Order'; /** * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors * @summary Delete purchase order by ID * @param fe Callback interface that runs the fetch query * @param orderId ID of the order that needs to be deleted * @response 400 [undefined] Invalid ID supplied * @response 404 [undefined] Order not found */ export public async function StoreApi__deleteOrder(fe : ApiExecuterI, orderId: string) : Promise> { checkRequiredParams('deleteOrder', { 'orderId': orderId }); const _pathParams = { 'orderId': orderId }; const _queryParams = { }; const _headerParams = { }; const _body = undefined; await fe.exec( 'DELETE', '/v2' + '/store/order/{orderId}', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * Returns a map of status codes to quantities * @summary Returns pet inventories by status * @param fe Callback interface that runs the fetch query * @response 200 [~Object+] successful operation */ export public async function StoreApi__getInventory(fe : ApiExecuterI, ) : Promise<~Object+, Object> { checkRequiredParams('getInventory', { }); const _pathParams = { }; const _queryParams = { }; const _headerParams = { }; const _body = undefined; return await fe.<~Object+, undefined>exec( 'GET', '/v2' + '/store/inventory', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions * @summary Find purchase order by ID * @param fe Callback interface that runs the fetch query * @param orderId ID of pet that needs to be fetched * @response 200 [Order] successful operation * @response 400 [undefined] Invalid ID supplied * @response 404 [undefined] Order not found */ export public async function StoreApi__getOrderById(fe : ApiExecuterI, orderId: int) : Promise> { checkRequiredParams('getOrderById', { 'orderId': orderId }); const _pathParams = { 'orderId': orderId }; const _queryParams = { }; const _headerParams = { }; const _body = undefined; return await fe.exec( 'GET', '/v2' + '/store/order/{orderId}', _pathParams, _queryParams, _headerParams, undefined, _body ); } /** * * @summary Place an order for a pet * @param fe Callback interface that runs the fetch query * @param order order placed for purchasing the pet * @response 200 [Order] successful operation * @response 400 [undefined] Invalid Order */ export public async function StoreApi__placeOrder(fe : ApiExecuterI, order: Order) : Promise> { checkRequiredParams('placeOrder', { 'order': order }); const _pathParams = { }; const _queryParams = { }; const _headerParams = { }; const _body = cleanCopyBody(order, 'id', 'petId', 'quantity', 'shipDate', 'status', 'complete'); return await fe.exec( 'POST', '/v2' + '/store/order', _pathParams, _queryParams, _headerParams, undefined, _body ); }