|
@@ -1,17 +1,17 @@
|
|
|
// @ts-ignore
|
|
|
/* eslint-disable */
|
|
|
-import { request } from 'umi';
|
|
|
+import { request } from 'umi'
|
|
|
|
|
|
/** Update an existing pet PUT /pet */
|
|
|
export async function updatePet(body: API.Pet, options?: { [key: string]: any }) {
|
|
|
return request<any>('/pet', {
|
|
|
method: 'PUT',
|
|
|
headers: {
|
|
|
- 'Content-Type': 'application/json',
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
},
|
|
|
data: body,
|
|
|
- ...(options || {}),
|
|
|
- });
|
|
|
+ ...(options || {})
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/** Add a new pet to the store POST /pet */
|
|
@@ -19,11 +19,11 @@ export async function addPet(body: API.Pet, options?: { [key: string]: any }) {
|
|
|
return request<any>('/pet', {
|
|
|
method: 'POST',
|
|
|
headers: {
|
|
|
- 'Content-Type': 'application/json',
|
|
|
+ 'Content-Type': 'application/json'
|
|
|
},
|
|
|
data: body,
|
|
|
- ...(options || {}),
|
|
|
- });
|
|
|
+ ...(options || {})
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/** Finds Pets by status Multiple status values can be provided with comma separated strings GET /pet/findByStatus */
|
|
@@ -31,18 +31,18 @@ export async function findPetsByStatus(
|
|
|
params: {
|
|
|
// query
|
|
|
/** Status values that need to be considered for filter */
|
|
|
- status: 'available' | 'pending' | 'sold'[];
|
|
|
+ status: 'available' | 'pending' | 'sold'[]
|
|
|
},
|
|
|
- options?: { [key: string]: any },
|
|
|
+ options?: { [key: string]: any }
|
|
|
) {
|
|
|
return request<API.Pet[]>('/pet/findByStatus', {
|
|
|
method: 'GET',
|
|
|
params: {
|
|
|
- ...params,
|
|
|
+ ...params
|
|
|
},
|
|
|
|
|
|
- ...(options || {}),
|
|
|
- });
|
|
|
+ ...(options || {})
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/** Finds Pets by tags Muliple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. GET /pet/findByTags */
|
|
@@ -50,18 +50,18 @@ export async function findPetsByTags(
|
|
|
params: {
|
|
|
// query
|
|
|
/** Tags to filter by */
|
|
|
- tags: string[];
|
|
|
+ tags: string[]
|
|
|
},
|
|
|
- options?: { [key: string]: any },
|
|
|
+ options?: { [key: string]: any }
|
|
|
) {
|
|
|
return request<API.Pet[]>('/pet/findByTags', {
|
|
|
method: 'GET',
|
|
|
params: {
|
|
|
- ...params,
|
|
|
+ ...params
|
|
|
},
|
|
|
|
|
|
- ...(options || {}),
|
|
|
- });
|
|
|
+ ...(options || {})
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/** Find pet by ID Returns a single pet GET /pet/${param0} */
|
|
@@ -69,17 +69,17 @@ export async function getPetById(
|
|
|
params: {
|
|
|
// path
|
|
|
/** ID of pet to return */
|
|
|
- petId: number;
|
|
|
+ petId: number
|
|
|
},
|
|
|
- options?: { [key: string]: any },
|
|
|
+ options?: { [key: string]: any }
|
|
|
) {
|
|
|
- const { petId: param0 } = params;
|
|
|
+ const { petId: param0 } = params
|
|
|
return request<API.Pet>(`/pet/${param0}`, {
|
|
|
method: 'GET',
|
|
|
params: { ...params },
|
|
|
|
|
|
- ...(options || {}),
|
|
|
- });
|
|
|
+ ...(options || {})
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/** Updates a pet in the store with form data POST /pet/${param0} */
|
|
@@ -87,50 +87,50 @@ export async function updatePetWithForm(
|
|
|
params: {
|
|
|
// path
|
|
|
/** ID of pet that needs to be updated */
|
|
|
- petId: number;
|
|
|
+ petId: number
|
|
|
},
|
|
|
body: { name?: string; status?: string },
|
|
|
- options?: { [key: string]: any },
|
|
|
+ options?: { [key: string]: any }
|
|
|
) {
|
|
|
- const { petId: param0 } = params;
|
|
|
- const formData = new FormData();
|
|
|
+ const { petId: param0 } = params
|
|
|
+ const formData = new FormData()
|
|
|
|
|
|
- Object.keys(body).forEach((ele) => {
|
|
|
- const item = (body as any)[ele];
|
|
|
+ Object.keys(body).forEach(ele => {
|
|
|
+ const item = (body as any)[ele]
|
|
|
|
|
|
if (item !== undefined && item !== null) {
|
|
|
- formData.append(ele, typeof item === 'object' ? JSON.stringify(item) : item);
|
|
|
+ formData.append(ele, typeof item === 'object' ? JSON.stringify(item) : item)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
|
|
|
return request<any>(`/pet/${param0}`, {
|
|
|
method: 'POST',
|
|
|
headers: {
|
|
|
- 'Content-Type': 'application/x-www-form-urlencoded',
|
|
|
+ 'Content-Type': 'application/x-www-form-urlencoded'
|
|
|
},
|
|
|
params: { ...params },
|
|
|
data: formData,
|
|
|
- ...(options || {}),
|
|
|
- });
|
|
|
+ ...(options || {})
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/** Deletes a pet DELETE /pet/${param0} */
|
|
|
export async function deletePet(
|
|
|
params: {
|
|
|
// header
|
|
|
- api_key?: string;
|
|
|
+ api_key?: string
|
|
|
// path
|
|
|
/** Pet id to delete */
|
|
|
- petId: number;
|
|
|
+ petId: number
|
|
|
},
|
|
|
- options?: { [key: string]: any },
|
|
|
+ options?: { [key: string]: any }
|
|
|
) {
|
|
|
- const { petId: param0 } = params;
|
|
|
+ const { petId: param0 } = params
|
|
|
return request<any>(`/pet/${param0}`, {
|
|
|
method: 'DELETE',
|
|
|
params: { ...params },
|
|
|
- ...(options || {}),
|
|
|
- });
|
|
|
+ ...(options || {})
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
/** uploads an image POST /pet/${param0}/uploadImage */
|
|
@@ -138,29 +138,29 @@ export async function uploadFile(
|
|
|
params: {
|
|
|
// path
|
|
|
/** ID of pet to update */
|
|
|
- petId: number;
|
|
|
+ petId: number
|
|
|
},
|
|
|
body: { additionalMetadata?: string; file?: string },
|
|
|
- options?: { [key: string]: any },
|
|
|
+ options?: { [key: string]: any }
|
|
|
) {
|
|
|
- const { petId: param0 } = params;
|
|
|
- const formData = new FormData();
|
|
|
+ const { petId: param0 } = params
|
|
|
+ const formData = new FormData()
|
|
|
|
|
|
- Object.keys(body).forEach((ele) => {
|
|
|
- const item = (body as any)[ele];
|
|
|
+ Object.keys(body).forEach(ele => {
|
|
|
+ const item = (body as any)[ele]
|
|
|
|
|
|
if (item !== undefined && item !== null) {
|
|
|
- formData.append(ele, typeof item === 'object' ? JSON.stringify(item) : item);
|
|
|
+ formData.append(ele, typeof item === 'object' ? JSON.stringify(item) : item)
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
|
|
|
return request<API.ApiResponse>(`/pet/${param0}/uploadImage`, {
|
|
|
method: 'POST',
|
|
|
headers: {
|
|
|
- 'Content-Type': 'multipart/form-data',
|
|
|
+ 'Content-Type': 'multipart/form-data'
|
|
|
},
|
|
|
params: { ...params },
|
|
|
data: formData,
|
|
|
- ...(options || {}),
|
|
|
- });
|
|
|
+ ...(options || {})
|
|
|
+ })
|
|
|
}
|