2025-01-09 15:29:27 +08:00
/* eslint-disable */
// @ts-ignore
2025-01-14 21:45:01 +08:00
import request from '@/utils/request' ;
import { CustomRequestOptions } from '@/interceptors/request' ;
2025-01-09 15:29:27 +08:00
2025-01-14 21:45:01 +08:00
import * as API from './types' ;
2025-01-09 15:29:27 +08:00
/** Returns pet inventories by status Returns a map of status codes to quantities GET /store/inventory */
2025-01-14 21:45:01 +08:00
export async function getInventory ( {
options ,
} : {
options? : CustomRequestOptions ;
} ) {
2025-01-09 15:29:27 +08:00
return request < Record < string , unknown > > ( '/store/inventory' , {
method : 'GET' ,
. . . ( options || { } ) ,
2025-01-14 21:45:01 +08:00
} ) ;
2025-01-09 15:29:27 +08:00
}
/** Place an order for a pet POST /store/order */
export async function placeOrder ( {
body ,
options ,
} : {
2025-01-14 21:45:01 +08:00
body : API.Order ;
options? : CustomRequestOptions ;
2025-01-09 15:29:27 +08:00
} ) {
return request < API.Order > ( '/store/order' , {
method : 'POST' ,
headers : {
'Content-Type' : 'application/json' ,
} ,
data : body ,
. . . ( options || { } ) ,
2025-01-14 21:45:01 +08:00
} ) ;
2025-01-09 15:29:27 +08:00
}
/** Find purchase order by ID For valid response try integer IDs with value >= 1 and <= 10. Other values will generated exceptions GET /store/order/${param0} */
export async function getOrderById ( {
params ,
options ,
} : {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
2025-01-14 21:45:01 +08:00
params : API.getOrderByIdParams ;
options? : CustomRequestOptions ;
2025-01-09 15:29:27 +08:00
} ) {
2025-01-14 21:45:01 +08:00
const { orderId : param0 , . . . queryParams } = params ;
2025-01-09 15:29:27 +08:00
return request < API.Order > ( ` /store/order/ ${ param0 } ` , {
method : 'GET' ,
params : { . . . queryParams } ,
. . . ( options || { } ) ,
2025-01-14 21:45:01 +08:00
} ) ;
2025-01-09 15:29:27 +08:00
}
/** Delete purchase order by ID For valid response try integer IDs with positive integer value. Negative or non-integer values will generate API errors DELETE /store/order/${param0} */
export async function deleteOrder ( {
params ,
options ,
} : {
// 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
2025-01-14 21:45:01 +08:00
params : API.deleteOrderParams ;
options? : CustomRequestOptions ;
2025-01-09 15:29:27 +08:00
} ) {
2025-01-14 21:45:01 +08:00
const { orderId : param0 , . . . queryParams } = params ;
2025-01-09 15:29:27 +08:00
return request < unknown > ( ` /store/order/ ${ param0 } ` , {
method : 'DELETE' ,
params : { . . . queryParams } ,
. . . ( options || { } ) ,
2025-01-14 21:45:01 +08:00
} ) ;
2025-01-09 15:29:27 +08:00
}