// This file is auto-generated by @hey-api/openapi-ts import type { Client, Options as Options2, TDataShape } from './client' import { client } from './client.gen' import type { AddPetData, AddPetErrors, AddPetResponses, CreateUserData, CreateUserErrors, CreateUserResponses, CreateUsersWithListInputData, CreateUsersWithListInputErrors, CreateUsersWithListInputResponses, DeleteOrderData, DeleteOrderErrors, DeleteOrderResponses, DeletePetData, DeletePetErrors, DeletePetResponses, DeleteUserData, DeleteUserErrors, DeleteUserResponses, FindPetsByStatusData, FindPetsByStatusErrors, FindPetsByStatusResponses, FindPetsByTagsData, FindPetsByTagsErrors, FindPetsByTagsResponses, GetInventoryData, GetInventoryErrors, GetInventoryResponses, GetOrderByIdData, GetOrderByIdErrors, GetOrderByIdResponses, GetPetByIdData, GetPetByIdErrors, GetPetByIdResponses, GetUserByNameData, GetUserByNameErrors, GetUserByNameResponses, LoginUserData, LoginUserErrors, LoginUserResponses, LogoutUserData, LogoutUserErrors, LogoutUserResponses, PlaceOrderData, PlaceOrderErrors, PlaceOrderResponses, UpdatePetData, UpdatePetErrors, UpdatePetResponses, UpdatePetWithFormData, UpdatePetWithFormErrors, UpdatePetWithFormResponses, UpdateUserData, UpdateUserErrors, UpdateUserResponses, UploadFileData, UploadFileErrors, UploadFileResponses } from './types.gen' export type Options< TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean > = Options2 & { /** * You can provide a client instance returned by `createClient()` instead of * individual options. This might be also useful if you want to implement a * custom client. */ client?: Client /** * You can pass arbitrary values through the `meta` object. This can be * used to access values that aren't defined as part of the SDK function. */ meta?: Record } /** * Add a new pet to the store. * * Add a new pet to the store. */ export const addPet = ( options: Options ) => (options.client ?? client).post({ security: [{ scheme: 'bearer', type: 'http' }], url: '/pet', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }) /** * Update an existing pet. * * Update an existing pet by Id. */ export const updatePet = ( options: Options ) => (options.client ?? client).put({ security: [{ scheme: 'bearer', type: 'http' }], url: '/pet', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } }) /** * Finds Pets by status. * * Multiple status values can be provided with comma separated strings. */ export const findPetsByStatus = ( options: Options ) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/pet/findByStatus', ...options }) /** * Finds Pets by tags. * * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. */ export const findPetsByTags = ( options: Options ) => (options.client ?? client).get({ security: [{ scheme: 'bearer', type: 'http' }], url: '/pet/findByTags', ...options }) /** * Deletes a pet. * * Delete a pet. */ export const deletePet = ( options: Options ) => (options.client ?? client).delete({ security: [{ scheme: 'bearer', type: 'http' }], url: '/pet/{petId}', ...options }) /** * Find pet by ID. * * Returns a single pet. */ export const getPetById = ( options: Options ) => (options.client ?? client).get({ security: [ { name: 'api_key', type: 'apiKey' }, { scheme: 'bearer', type: 'http' } ], url: '/pet/{petId}', ...options }) /** * Updates a pet in the store with form data. * * Updates a pet resource based on the form data. */ export const updatePetWithForm = ( options: Options ) => (options.client ?? client).post< UpdatePetWithFormResponses, UpdatePetWithFormErrors, ThrowOnError >({ security: [{ scheme: 'bearer', type: 'http' }], url: '/pet/{petId}', ...options }) /** * Uploads an image. * * Upload image of the pet. */ export const uploadFile = ( options: Options ) => (options.client ?? client).post({ bodySerializer: null, security: [{ scheme: 'bearer', type: 'http' }], url: '/pet/{petId}/uploadImage', ...options, headers: { 'Content-Type': 'application/octet-stream', ...options.headers } }) /** * Returns pet inventories by status. * * Returns a map of status codes to quantities. */ export const getInventory = ( options?: Options ) => (options?.client ?? client).get({ security: [{ name: 'api_key', type: 'apiKey' }], url: '/store/inventory', ...options }) /** * Place an order for a pet. * * Place a new order in the store. */ export const placeOrder = ( options?: Options ) => (options?.client ?? client).post({ url: '/store/order', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }) /** * Delete purchase order by identifier. * * For valid response try integer IDs with value < 1000. Anything above 1000 or non-integers will generate API errors. */ export const deleteOrder = ( options: Options ) => (options.client ?? client).delete({ url: '/store/order/{orderId}', ...options }) /** * Find purchase order by ID. * * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions. */ export const getOrderById = ( options: Options ) => (options.client ?? client).get({ url: '/store/order/{orderId}', ...options }) /** * Create user. * * This can only be done by the logged in user. */ export const createUser = ( options?: Options ) => (options?.client ?? client).post({ url: '/user', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }) /** * Creates list of users with given input array. * * Creates list of users with given input array. */ export const createUsersWithListInput = ( options?: Options ) => (options?.client ?? client).post< CreateUsersWithListInputResponses, CreateUsersWithListInputErrors, ThrowOnError >({ url: '/user/createWithList', ...options, headers: { 'Content-Type': 'application/json', ...options?.headers } }) /** * Logs user into the system. * * Log into the system. */ export const loginUser = ( options?: Options ) => (options?.client ?? client).get({ url: '/user/login', ...options }) /** * Logs out current logged in user session. * * Log user out of the system. */ export const logoutUser = ( options?: Options ) => (options?.client ?? client).get({ url: '/user/logout', ...options }) /** * Delete user resource. * * This can only be done by the logged in user. */ export const deleteUser = ( options: Options ) => (options.client ?? client).delete({ url: '/user/{username}', ...options }) /** * Get user by user name. * * Get user detail based on username. */ export const getUserByName = ( options: Options ) => (options.client ?? client).get({ url: '/user/{username}', ...options }) /** * Update user resource. * * This can only be done by the logged in user. */ export const updateUser = ( options: Options ) => (options.client ?? client).put({ url: '/user/{username}', ...options, headers: { 'Content-Type': 'application/json', ...options.headers } })