forked from loafle/openapi-generator-original
Add optional AxiosRequestConfig parameter to typescript-nestjs service functions (#20222)
* feat: add options to service functions * fix: fix type error * refactor: change options parameter * chore: update samples * fix: fix options use order * refactor: rename options * refactor: import type
This commit is contained in:
parent
f1c1567aa9
commit
8c337f05be
@ -8,7 +8,7 @@ import { HttpService } from '@nestjs/axios';
|
||||
{{^useAxiosHttpModule}}
|
||||
import { HttpService, Injectable, Optional } from '@nestjs/common';
|
||||
{{/useAxiosHttpModule}}
|
||||
import { AxiosResponse } from 'axios';
|
||||
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
import { Observable, from, of, switchMap } from 'rxjs';
|
||||
{{#imports}}
|
||||
import { {{classname}} } from '../{{filename}}';
|
||||
@ -93,14 +93,15 @@ export class {{classname}} {
|
||||
{{/allParams}}* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
{{/useSingleRequestParameter}}
|
||||
* @param {*} [{{nickname}}Opts.config] Override http request option.
|
||||
*/
|
||||
{{#useSingleRequestParameter}}
|
||||
public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}): Observable<AxiosResponse<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>>;
|
||||
public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}): Observable<any> {
|
||||
public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}{{nickname}}Opts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>>;
|
||||
public {{nickname}}({{#allParams.0}}requestParameters: {{classname}}{{operationIdCamelCase}}Request, {{/allParams.0}}{{nickname}}Opts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
{{/useSingleRequestParameter}}
|
||||
{{^useSingleRequestParameter}}
|
||||
public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}): Observable<AxiosResponse<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>>;
|
||||
public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}): Observable<any> {
|
||||
public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}{{nickname}}Opts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>>;
|
||||
public {{nickname}}({{#allParams}}{{^isConstEnumParam}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/isConstEnumParam}}{{/allParams}}{{nickname}}Opts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
{{/useSingleRequestParameter}}
|
||||
{{#allParams.0}}
|
||||
{{#useSingleRequestParameter}}
|
||||
@ -291,7 +292,8 @@ export class {{classname}} {
|
||||
responseType: "blob",
|
||||
{{/isResponseFile}}
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...{{nickname}}Opts?.config,
|
||||
headers: {...headers, ...{{nickname}}Opts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
|
@ -12,7 +12,7 @@
|
||||
/* tslint:disable:no-unused-variable member-ordering */
|
||||
|
||||
import { HttpService, Injectable, Optional } from '@nestjs/common';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
import { Observable, from, of, switchMap } from 'rxjs';
|
||||
import { ApiResponse } from '../model/apiResponse';
|
||||
import { Pet } from '../model/pet';
|
||||
@ -49,9 +49,10 @@ export class PetService {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [addPetOpts.config] Override http request option.
|
||||
*/
|
||||
public addPet(pet: Pet, ): Observable<AxiosResponse<Pet>>;
|
||||
public addPet(pet: Pet, ): Observable<any> {
|
||||
public addPet(pet: Pet, addPetOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Pet>>;
|
||||
public addPet(pet: Pet, addPetOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new Error('Required parameter pet was null or undefined when calling addPet.');
|
||||
}
|
||||
@ -96,7 +97,8 @@ export class PetService {
|
||||
pet,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...addPetOpts?.config,
|
||||
headers: {...headers, ...addPetOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -109,9 +111,10 @@ export class PetService {
|
||||
* @param apiKey
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [deletePetOpts.config] Override http request option.
|
||||
*/
|
||||
public deletePet(petId: number, apiKey?: string, ): Observable<AxiosResponse<any>>;
|
||||
public deletePet(petId: number, apiKey?: string, ): Observable<any> {
|
||||
public deletePet(petId: number, apiKey?: string, deletePetOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public deletePet(petId: number, apiKey?: string, deletePetOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new Error('Required parameter petId was null or undefined when calling deletePet.');
|
||||
}
|
||||
@ -150,7 +153,8 @@ export class PetService {
|
||||
return this.httpClient.delete<any>(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...deletePetOpts?.config,
|
||||
headers: {...headers, ...deletePetOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -162,9 +166,10 @@ export class PetService {
|
||||
* @param status Status values that need to be considered for filter
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [findPetsByStatusOpts.config] Override http request option.
|
||||
*/
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable<AxiosResponse<Array<Pet>>>;
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable<any> {
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Array<Pet>>>;
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (status === null || status === undefined) {
|
||||
throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.');
|
||||
}
|
||||
@ -208,7 +213,8 @@ export class PetService {
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...findPetsByStatusOpts?.config,
|
||||
headers: {...headers, ...findPetsByStatusOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -220,9 +226,10 @@ export class PetService {
|
||||
* @param tags Tags to filter by
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [findPetsByTagsOpts.config] Override http request option.
|
||||
*/
|
||||
public findPetsByTags(tags: Array<string>, ): Observable<AxiosResponse<Array<Pet>>>;
|
||||
public findPetsByTags(tags: Array<string>, ): Observable<any> {
|
||||
public findPetsByTags(tags: Array<string>, findPetsByTagsOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Array<Pet>>>;
|
||||
public findPetsByTags(tags: Array<string>, findPetsByTagsOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (tags === null || tags === undefined) {
|
||||
throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.');
|
||||
}
|
||||
@ -266,7 +273,8 @@ export class PetService {
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...findPetsByTagsOpts?.config,
|
||||
headers: {...headers, ...findPetsByTagsOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -278,9 +286,10 @@ export class PetService {
|
||||
* @param petId ID of pet to return
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [getPetByIdOpts.config] Override http request option.
|
||||
*/
|
||||
public getPetById(petId: number, ): Observable<AxiosResponse<Pet>>;
|
||||
public getPetById(petId: number, ): Observable<any> {
|
||||
public getPetById(petId: number, getPetByIdOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Pet>>;
|
||||
public getPetById(petId: number, getPetByIdOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new Error('Required parameter petId was null or undefined when calling getPetById.');
|
||||
}
|
||||
@ -316,7 +325,8 @@ export class PetService {
|
||||
return this.httpClient.get<Pet>(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...getPetByIdOpts?.config,
|
||||
headers: {...headers, ...getPetByIdOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -328,9 +338,10 @@ export class PetService {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [updatePetOpts.config] Override http request option.
|
||||
*/
|
||||
public updatePet(pet: Pet, ): Observable<AxiosResponse<Pet>>;
|
||||
public updatePet(pet: Pet, ): Observable<any> {
|
||||
public updatePet(pet: Pet, updatePetOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Pet>>;
|
||||
public updatePet(pet: Pet, updatePetOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new Error('Required parameter pet was null or undefined when calling updatePet.');
|
||||
}
|
||||
@ -375,7 +386,8 @@ export class PetService {
|
||||
pet,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...updatePetOpts?.config,
|
||||
headers: {...headers, ...updatePetOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -389,9 +401,10 @@ export class PetService {
|
||||
* @param status Updated status of the pet
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [updatePetWithFormOpts.config] Override http request option.
|
||||
*/
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable<AxiosResponse<any>>;
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable<any> {
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.');
|
||||
}
|
||||
@ -449,7 +462,8 @@ export class PetService {
|
||||
convertFormParamsToString ? formParams!.toString() : formParams!,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...updatePetWithFormOpts?.config,
|
||||
headers: {...headers, ...updatePetWithFormOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -463,9 +477,10 @@ export class PetService {
|
||||
* @param file file to upload
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [uploadFileOpts.config] Override http request option.
|
||||
*/
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable<AxiosResponse<ApiResponse>>;
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable<any> {
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<ApiResponse>>;
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new Error('Required parameter petId was null or undefined when calling uploadFile.');
|
||||
}
|
||||
@ -528,7 +543,8 @@ export class PetService {
|
||||
convertFormParamsToString ? formParams!.toString() : formParams!,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...uploadFileOpts?.config,
|
||||
headers: {...headers, ...uploadFileOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
|
@ -12,7 +12,7 @@
|
||||
/* tslint:disable:no-unused-variable member-ordering */
|
||||
|
||||
import { HttpService, Injectable, Optional } from '@nestjs/common';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
import { Observable, from, of, switchMap } from 'rxjs';
|
||||
import { Order } from '../model/order';
|
||||
import { Configuration } from '../configuration';
|
||||
@ -48,9 +48,10 @@ export class StoreService {
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [deleteOrderOpts.config] Override http request option.
|
||||
*/
|
||||
public deleteOrder(orderId: string, ): Observable<AxiosResponse<any>>;
|
||||
public deleteOrder(orderId: string, ): Observable<any> {
|
||||
public deleteOrder(orderId: string, deleteOrderOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public deleteOrder(orderId: string, deleteOrderOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.');
|
||||
}
|
||||
@ -79,7 +80,8 @@ export class StoreService {
|
||||
return this.httpClient.delete<any>(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...deleteOrderOpts?.config,
|
||||
headers: {...headers, ...deleteOrderOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -90,9 +92,10 @@ export class StoreService {
|
||||
* Returns a map of status codes to quantities
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [getInventoryOpts.config] Override http request option.
|
||||
*/
|
||||
public getInventory(): Observable<AxiosResponse<{ [key: string]: number; }>>;
|
||||
public getInventory(): Observable<any> {
|
||||
public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<{ [key: string]: number; }>>;
|
||||
public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
let accessTokenObservable: Observable<any> = of(null);
|
||||
@ -123,7 +126,8 @@ export class StoreService {
|
||||
return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...getInventoryOpts?.config,
|
||||
headers: {...headers, ...getInventoryOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -135,9 +139,10 @@ export class StoreService {
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [getOrderByIdOpts.config] Override http request option.
|
||||
*/
|
||||
public getOrderById(orderId: number, ): Observable<AxiosResponse<Order>>;
|
||||
public getOrderById(orderId: number, ): Observable<any> {
|
||||
public getOrderById(orderId: number, getOrderByIdOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Order>>;
|
||||
public getOrderById(orderId: number, getOrderByIdOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new Error('Required parameter orderId was null or undefined when calling getOrderById.');
|
||||
}
|
||||
@ -168,7 +173,8 @@ export class StoreService {
|
||||
return this.httpClient.get<Order>(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...getOrderByIdOpts?.config,
|
||||
headers: {...headers, ...getOrderByIdOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -180,9 +186,10 @@ export class StoreService {
|
||||
* @param order order placed for purchasing the pet
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [placeOrderOpts.config] Override http request option.
|
||||
*/
|
||||
public placeOrder(order: Order, ): Observable<AxiosResponse<Order>>;
|
||||
public placeOrder(order: Order, ): Observable<any> {
|
||||
public placeOrder(order: Order, placeOrderOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Order>>;
|
||||
public placeOrder(order: Order, placeOrderOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (order === null || order === undefined) {
|
||||
throw new Error('Required parameter order was null or undefined when calling placeOrder.');
|
||||
}
|
||||
@ -219,7 +226,8 @@ export class StoreService {
|
||||
order,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...placeOrderOpts?.config,
|
||||
headers: {...headers, ...placeOrderOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
|
@ -12,7 +12,7 @@
|
||||
/* tslint:disable:no-unused-variable member-ordering */
|
||||
|
||||
import { HttpService, Injectable, Optional } from '@nestjs/common';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
import { Observable, from, of, switchMap } from 'rxjs';
|
||||
import { User } from '../model/user';
|
||||
import { Configuration } from '../configuration';
|
||||
@ -48,9 +48,10 @@ export class UserService {
|
||||
* @param user Created user object
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [createUserOpts.config] Override http request option.
|
||||
*/
|
||||
public createUser(user: User, ): Observable<AxiosResponse<any>>;
|
||||
public createUser(user: User, ): Observable<any> {
|
||||
public createUser(user: User, createUserOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public createUser(user: User, createUserOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling createUser.');
|
||||
}
|
||||
@ -90,7 +91,8 @@ export class UserService {
|
||||
user,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...createUserOpts?.config,
|
||||
headers: {...headers, ...createUserOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -102,9 +104,10 @@ export class UserService {
|
||||
* @param user List of user object
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [createUsersWithArrayInputOpts.config] Override http request option.
|
||||
*/
|
||||
public createUsersWithArrayInput(user: Array<User>, ): Observable<AxiosResponse<any>>;
|
||||
public createUsersWithArrayInput(user: Array<User>, ): Observable<any> {
|
||||
public createUsersWithArrayInput(user: Array<User>, createUsersWithArrayInputOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public createUsersWithArrayInput(user: Array<User>, createUsersWithArrayInputOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.');
|
||||
}
|
||||
@ -144,7 +147,8 @@ export class UserService {
|
||||
user,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...createUsersWithArrayInputOpts?.config,
|
||||
headers: {...headers, ...createUsersWithArrayInputOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -156,9 +160,10 @@ export class UserService {
|
||||
* @param user List of user object
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [createUsersWithListInputOpts.config] Override http request option.
|
||||
*/
|
||||
public createUsersWithListInput(user: Array<User>, ): Observable<AxiosResponse<any>>;
|
||||
public createUsersWithListInput(user: Array<User>, ): Observable<any> {
|
||||
public createUsersWithListInput(user: Array<User>, createUsersWithListInputOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public createUsersWithListInput(user: Array<User>, createUsersWithListInputOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.');
|
||||
}
|
||||
@ -198,7 +203,8 @@ export class UserService {
|
||||
user,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...createUsersWithListInputOpts?.config,
|
||||
headers: {...headers, ...createUsersWithListInputOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -210,9 +216,10 @@ export class UserService {
|
||||
* @param username The name that needs to be deleted
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [deleteUserOpts.config] Override http request option.
|
||||
*/
|
||||
public deleteUser(username: string, ): Observable<AxiosResponse<any>>;
|
||||
public deleteUser(username: string, ): Observable<any> {
|
||||
public deleteUser(username: string, deleteUserOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public deleteUser(username: string, deleteUserOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (username === null || username === undefined) {
|
||||
throw new Error('Required parameter username was null or undefined when calling deleteUser.');
|
||||
}
|
||||
@ -246,7 +253,8 @@ export class UserService {
|
||||
return this.httpClient.delete<any>(`${this.basePath}/user/${encodeURIComponent(String(username))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...deleteUserOpts?.config,
|
||||
headers: {...headers, ...deleteUserOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -258,9 +266,10 @@ export class UserService {
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [getUserByNameOpts.config] Override http request option.
|
||||
*/
|
||||
public getUserByName(username: string, ): Observable<AxiosResponse<User>>;
|
||||
public getUserByName(username: string, ): Observable<any> {
|
||||
public getUserByName(username: string, getUserByNameOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<User>>;
|
||||
public getUserByName(username: string, getUserByNameOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (username === null || username === undefined) {
|
||||
throw new Error('Required parameter username was null or undefined when calling getUserByName.');
|
||||
}
|
||||
@ -291,7 +300,8 @@ export class UserService {
|
||||
return this.httpClient.get<User>(`${this.basePath}/user/${encodeURIComponent(String(username))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...getUserByNameOpts?.config,
|
||||
headers: {...headers, ...getUserByNameOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -304,9 +314,10 @@ export class UserService {
|
||||
* @param password The password for login in clear text
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [loginUserOpts.config] Override http request option.
|
||||
*/
|
||||
public loginUser(username: string, password: string, ): Observable<AxiosResponse<string>>;
|
||||
public loginUser(username: string, password: string, ): Observable<any> {
|
||||
public loginUser(username: string, password: string, loginUserOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<string>>;
|
||||
public loginUser(username: string, password: string, loginUserOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (username === null || username === undefined) {
|
||||
throw new Error('Required parameter username was null or undefined when calling loginUser.');
|
||||
}
|
||||
@ -350,7 +361,8 @@ export class UserService {
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...loginUserOpts?.config,
|
||||
headers: {...headers, ...loginUserOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -361,9 +373,10 @@ export class UserService {
|
||||
*
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [logoutUserOpts.config] Override http request option.
|
||||
*/
|
||||
public logoutUser(): Observable<AxiosResponse<any>>;
|
||||
public logoutUser(): Observable<any> {
|
||||
public logoutUser(logoutUserOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public logoutUser(logoutUserOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
let accessTokenObservable: Observable<any> = of(null);
|
||||
@ -393,7 +406,8 @@ export class UserService {
|
||||
return this.httpClient.get<any>(`${this.basePath}/user/logout`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...logoutUserOpts?.config,
|
||||
headers: {...headers, ...logoutUserOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -406,9 +420,10 @@ export class UserService {
|
||||
* @param user Updated user object
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [updateUserOpts.config] Override http request option.
|
||||
*/
|
||||
public updateUser(username: string, user: User, ): Observable<AxiosResponse<any>>;
|
||||
public updateUser(username: string, user: User, ): Observable<any> {
|
||||
public updateUser(username: string, user: User, updateUserOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public updateUser(username: string, user: User, updateUserOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (username === null || username === undefined) {
|
||||
throw new Error('Required parameter username was null or undefined when calling updateUser.');
|
||||
}
|
||||
@ -452,7 +467,8 @@ export class UserService {
|
||||
user,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...updateUserOpts?.config,
|
||||
headers: {...headers, ...updateUserOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
import { Injectable, Optional } from '@nestjs/common';
|
||||
import { HttpService } from '@nestjs/axios';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
import { Observable, from, of, switchMap } from 'rxjs';
|
||||
import { ApiResponse } from '../model/apiResponse';
|
||||
import { Pet } from '../model/pet';
|
||||
@ -50,9 +50,10 @@ export class PetService {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [addPetOpts.config] Override http request option.
|
||||
*/
|
||||
public addPet(pet: Pet, ): Observable<AxiosResponse<Pet>>;
|
||||
public addPet(pet: Pet, ): Observable<any> {
|
||||
public addPet(pet: Pet, addPetOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Pet>>;
|
||||
public addPet(pet: Pet, addPetOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new Error('Required parameter pet was null or undefined when calling addPet.');
|
||||
}
|
||||
@ -97,7 +98,8 @@ export class PetService {
|
||||
pet,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...addPetOpts?.config,
|
||||
headers: {...headers, ...addPetOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -110,9 +112,10 @@ export class PetService {
|
||||
* @param apiKey
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [deletePetOpts.config] Override http request option.
|
||||
*/
|
||||
public deletePet(petId: number, apiKey?: string, ): Observable<AxiosResponse<any>>;
|
||||
public deletePet(petId: number, apiKey?: string, ): Observable<any> {
|
||||
public deletePet(petId: number, apiKey?: string, deletePetOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public deletePet(petId: number, apiKey?: string, deletePetOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new Error('Required parameter petId was null or undefined when calling deletePet.');
|
||||
}
|
||||
@ -151,7 +154,8 @@ export class PetService {
|
||||
return this.httpClient.delete<any>(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...deletePetOpts?.config,
|
||||
headers: {...headers, ...deletePetOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -163,9 +167,10 @@ export class PetService {
|
||||
* @param status Status values that need to be considered for filter
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [findPetsByStatusOpts.config] Override http request option.
|
||||
*/
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable<AxiosResponse<Array<Pet>>>;
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, ): Observable<any> {
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Array<Pet>>>;
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, findPetsByStatusOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (status === null || status === undefined) {
|
||||
throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.');
|
||||
}
|
||||
@ -209,7 +214,8 @@ export class PetService {
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...findPetsByStatusOpts?.config,
|
||||
headers: {...headers, ...findPetsByStatusOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -221,9 +227,10 @@ export class PetService {
|
||||
* @param tags Tags to filter by
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [findPetsByTagsOpts.config] Override http request option.
|
||||
*/
|
||||
public findPetsByTags(tags: Array<string>, ): Observable<AxiosResponse<Array<Pet>>>;
|
||||
public findPetsByTags(tags: Array<string>, ): Observable<any> {
|
||||
public findPetsByTags(tags: Array<string>, findPetsByTagsOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Array<Pet>>>;
|
||||
public findPetsByTags(tags: Array<string>, findPetsByTagsOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (tags === null || tags === undefined) {
|
||||
throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.');
|
||||
}
|
||||
@ -267,7 +274,8 @@ export class PetService {
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...findPetsByTagsOpts?.config,
|
||||
headers: {...headers, ...findPetsByTagsOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -279,9 +287,10 @@ export class PetService {
|
||||
* @param petId ID of pet to return
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [getPetByIdOpts.config] Override http request option.
|
||||
*/
|
||||
public getPetById(petId: number, ): Observable<AxiosResponse<Pet>>;
|
||||
public getPetById(petId: number, ): Observable<any> {
|
||||
public getPetById(petId: number, getPetByIdOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Pet>>;
|
||||
public getPetById(petId: number, getPetByIdOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new Error('Required parameter petId was null or undefined when calling getPetById.');
|
||||
}
|
||||
@ -317,7 +326,8 @@ export class PetService {
|
||||
return this.httpClient.get<Pet>(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...getPetByIdOpts?.config,
|
||||
headers: {...headers, ...getPetByIdOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -329,9 +339,10 @@ export class PetService {
|
||||
* @param pet Pet object that needs to be added to the store
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [updatePetOpts.config] Override http request option.
|
||||
*/
|
||||
public updatePet(pet: Pet, ): Observable<AxiosResponse<Pet>>;
|
||||
public updatePet(pet: Pet, ): Observable<any> {
|
||||
public updatePet(pet: Pet, updatePetOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Pet>>;
|
||||
public updatePet(pet: Pet, updatePetOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new Error('Required parameter pet was null or undefined when calling updatePet.');
|
||||
}
|
||||
@ -376,7 +387,8 @@ export class PetService {
|
||||
pet,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...updatePetOpts?.config,
|
||||
headers: {...headers, ...updatePetOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -390,9 +402,10 @@ export class PetService {
|
||||
* @param status Updated status of the pet
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [updatePetWithFormOpts.config] Override http request option.
|
||||
*/
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable<AxiosResponse<any>>;
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, ): Observable<any> {
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, updatePetWithFormOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.');
|
||||
}
|
||||
@ -450,7 +463,8 @@ export class PetService {
|
||||
convertFormParamsToString ? formParams!.toString() : formParams!,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...updatePetWithFormOpts?.config,
|
||||
headers: {...headers, ...updatePetWithFormOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -464,9 +478,10 @@ export class PetService {
|
||||
* @param file file to upload
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [uploadFileOpts.config] Override http request option.
|
||||
*/
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable<AxiosResponse<ApiResponse>>;
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, ): Observable<any> {
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<ApiResponse>>;
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, uploadFileOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new Error('Required parameter petId was null or undefined when calling uploadFile.');
|
||||
}
|
||||
@ -529,7 +544,8 @@ export class PetService {
|
||||
convertFormParamsToString ? formParams!.toString() : formParams!,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...uploadFileOpts?.config,
|
||||
headers: {...headers, ...uploadFileOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
import { Injectable, Optional } from '@nestjs/common';
|
||||
import { HttpService } from '@nestjs/axios';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
import { Observable, from, of, switchMap } from 'rxjs';
|
||||
import { Order } from '../model/order';
|
||||
import { Configuration } from '../configuration';
|
||||
@ -49,9 +49,10 @@ export class StoreService {
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [deleteOrderOpts.config] Override http request option.
|
||||
*/
|
||||
public deleteOrder(orderId: string, ): Observable<AxiosResponse<any>>;
|
||||
public deleteOrder(orderId: string, ): Observable<any> {
|
||||
public deleteOrder(orderId: string, deleteOrderOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public deleteOrder(orderId: string, deleteOrderOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.');
|
||||
}
|
||||
@ -80,7 +81,8 @@ export class StoreService {
|
||||
return this.httpClient.delete<any>(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...deleteOrderOpts?.config,
|
||||
headers: {...headers, ...deleteOrderOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -91,9 +93,10 @@ export class StoreService {
|
||||
* Returns a map of status codes to quantities
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [getInventoryOpts.config] Override http request option.
|
||||
*/
|
||||
public getInventory(): Observable<AxiosResponse<{ [key: string]: number; }>>;
|
||||
public getInventory(): Observable<any> {
|
||||
public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<{ [key: string]: number; }>>;
|
||||
public getInventory(getInventoryOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
let accessTokenObservable: Observable<any> = of(null);
|
||||
@ -124,7 +127,8 @@ export class StoreService {
|
||||
return this.httpClient.get<{ [key: string]: number; }>(`${this.basePath}/store/inventory`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...getInventoryOpts?.config,
|
||||
headers: {...headers, ...getInventoryOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -136,9 +140,10 @@ export class StoreService {
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [getOrderByIdOpts.config] Override http request option.
|
||||
*/
|
||||
public getOrderById(orderId: number, ): Observable<AxiosResponse<Order>>;
|
||||
public getOrderById(orderId: number, ): Observable<any> {
|
||||
public getOrderById(orderId: number, getOrderByIdOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Order>>;
|
||||
public getOrderById(orderId: number, getOrderByIdOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new Error('Required parameter orderId was null or undefined when calling getOrderById.');
|
||||
}
|
||||
@ -169,7 +174,8 @@ export class StoreService {
|
||||
return this.httpClient.get<Order>(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...getOrderByIdOpts?.config,
|
||||
headers: {...headers, ...getOrderByIdOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -181,9 +187,10 @@ export class StoreService {
|
||||
* @param order order placed for purchasing the pet
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [placeOrderOpts.config] Override http request option.
|
||||
*/
|
||||
public placeOrder(order: Order, ): Observable<AxiosResponse<Order>>;
|
||||
public placeOrder(order: Order, ): Observable<any> {
|
||||
public placeOrder(order: Order, placeOrderOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<Order>>;
|
||||
public placeOrder(order: Order, placeOrderOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (order === null || order === undefined) {
|
||||
throw new Error('Required parameter order was null or undefined when calling placeOrder.');
|
||||
}
|
||||
@ -220,7 +227,8 @@ export class StoreService {
|
||||
order,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...placeOrderOpts?.config,
|
||||
headers: {...headers, ...placeOrderOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
import { Injectable, Optional } from '@nestjs/common';
|
||||
import { HttpService } from '@nestjs/axios';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
import { Observable, from, of, switchMap } from 'rxjs';
|
||||
import { User } from '../model/user';
|
||||
import { Configuration } from '../configuration';
|
||||
@ -49,9 +49,10 @@ export class UserService {
|
||||
* @param user Created user object
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [createUserOpts.config] Override http request option.
|
||||
*/
|
||||
public createUser(user: User, ): Observable<AxiosResponse<any>>;
|
||||
public createUser(user: User, ): Observable<any> {
|
||||
public createUser(user: User, createUserOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public createUser(user: User, createUserOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling createUser.');
|
||||
}
|
||||
@ -91,7 +92,8 @@ export class UserService {
|
||||
user,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...createUserOpts?.config,
|
||||
headers: {...headers, ...createUserOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -103,9 +105,10 @@ export class UserService {
|
||||
* @param user List of user object
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [createUsersWithArrayInputOpts.config] Override http request option.
|
||||
*/
|
||||
public createUsersWithArrayInput(user: Array<User>, ): Observable<AxiosResponse<any>>;
|
||||
public createUsersWithArrayInput(user: Array<User>, ): Observable<any> {
|
||||
public createUsersWithArrayInput(user: Array<User>, createUsersWithArrayInputOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public createUsersWithArrayInput(user: Array<User>, createUsersWithArrayInputOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling createUsersWithArrayInput.');
|
||||
}
|
||||
@ -145,7 +148,8 @@ export class UserService {
|
||||
user,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...createUsersWithArrayInputOpts?.config,
|
||||
headers: {...headers, ...createUsersWithArrayInputOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -157,9 +161,10 @@ export class UserService {
|
||||
* @param user List of user object
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [createUsersWithListInputOpts.config] Override http request option.
|
||||
*/
|
||||
public createUsersWithListInput(user: Array<User>, ): Observable<AxiosResponse<any>>;
|
||||
public createUsersWithListInput(user: Array<User>, ): Observable<any> {
|
||||
public createUsersWithListInput(user: Array<User>, createUsersWithListInputOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public createUsersWithListInput(user: Array<User>, createUsersWithListInputOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (user === null || user === undefined) {
|
||||
throw new Error('Required parameter user was null or undefined when calling createUsersWithListInput.');
|
||||
}
|
||||
@ -199,7 +204,8 @@ export class UserService {
|
||||
user,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...createUsersWithListInputOpts?.config,
|
||||
headers: {...headers, ...createUsersWithListInputOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -211,9 +217,10 @@ export class UserService {
|
||||
* @param username The name that needs to be deleted
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [deleteUserOpts.config] Override http request option.
|
||||
*/
|
||||
public deleteUser(username: string, ): Observable<AxiosResponse<any>>;
|
||||
public deleteUser(username: string, ): Observable<any> {
|
||||
public deleteUser(username: string, deleteUserOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public deleteUser(username: string, deleteUserOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (username === null || username === undefined) {
|
||||
throw new Error('Required parameter username was null or undefined when calling deleteUser.');
|
||||
}
|
||||
@ -247,7 +254,8 @@ export class UserService {
|
||||
return this.httpClient.delete<any>(`${this.basePath}/user/${encodeURIComponent(String(username))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...deleteUserOpts?.config,
|
||||
headers: {...headers, ...deleteUserOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -259,9 +267,10 @@ export class UserService {
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [getUserByNameOpts.config] Override http request option.
|
||||
*/
|
||||
public getUserByName(username: string, ): Observable<AxiosResponse<User>>;
|
||||
public getUserByName(username: string, ): Observable<any> {
|
||||
public getUserByName(username: string, getUserByNameOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<User>>;
|
||||
public getUserByName(username: string, getUserByNameOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (username === null || username === undefined) {
|
||||
throw new Error('Required parameter username was null or undefined when calling getUserByName.');
|
||||
}
|
||||
@ -292,7 +301,8 @@ export class UserService {
|
||||
return this.httpClient.get<User>(`${this.basePath}/user/${encodeURIComponent(String(username))}`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...getUserByNameOpts?.config,
|
||||
headers: {...headers, ...getUserByNameOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -305,9 +315,10 @@ export class UserService {
|
||||
* @param password The password for login in clear text
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [loginUserOpts.config] Override http request option.
|
||||
*/
|
||||
public loginUser(username: string, password: string, ): Observable<AxiosResponse<string>>;
|
||||
public loginUser(username: string, password: string, ): Observable<any> {
|
||||
public loginUser(username: string, password: string, loginUserOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<string>>;
|
||||
public loginUser(username: string, password: string, loginUserOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (username === null || username === undefined) {
|
||||
throw new Error('Required parameter username was null or undefined when calling loginUser.');
|
||||
}
|
||||
@ -351,7 +362,8 @@ export class UserService {
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...loginUserOpts?.config,
|
||||
headers: {...headers, ...loginUserOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -362,9 +374,10 @@ export class UserService {
|
||||
*
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [logoutUserOpts.config] Override http request option.
|
||||
*/
|
||||
public logoutUser(): Observable<AxiosResponse<any>>;
|
||||
public logoutUser(): Observable<any> {
|
||||
public logoutUser(logoutUserOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public logoutUser(logoutUserOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
let headers = {...this.defaultHeaders};
|
||||
|
||||
let accessTokenObservable: Observable<any> = of(null);
|
||||
@ -394,7 +407,8 @@ export class UserService {
|
||||
return this.httpClient.get<any>(`${this.basePath}/user/logout`,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...logoutUserOpts?.config,
|
||||
headers: {...headers, ...logoutUserOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
@ -407,9 +421,10 @@ export class UserService {
|
||||
* @param user Updated user object
|
||||
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
|
||||
* @param reportProgress flag to report request and response progress.
|
||||
* @param {*} [updateUserOpts.config] Override http request option.
|
||||
*/
|
||||
public updateUser(username: string, user: User, ): Observable<AxiosResponse<any>>;
|
||||
public updateUser(username: string, user: User, ): Observable<any> {
|
||||
public updateUser(username: string, user: User, updateUserOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public updateUser(username: string, user: User, updateUserOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
if (username === null || username === undefined) {
|
||||
throw new Error('Required parameter username was null or undefined when calling updateUser.');
|
||||
}
|
||||
@ -453,7 +468,8 @@ export class UserService {
|
||||
user,
|
||||
{
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...updateUserOpts?.config,
|
||||
headers: {...headers, ...updateUserOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
import { Injectable, Optional } from '@nestjs/common';
|
||||
import { HttpService } from '@nestjs/axios';
|
||||
import { AxiosResponse } from 'axios';
|
||||
import type { AxiosRequestConfig, AxiosResponse } from 'axios';
|
||||
import { Observable, from, of, switchMap } from 'rxjs';
|
||||
import { Configuration } from '../configuration';
|
||||
import { COLLECTION_FORMATS } from '../variables';
|
||||
@ -74,9 +74,10 @@ export class DefaultService {
|
||||
* Test reserved param names
|
||||
*
|
||||
* @param {DefaultServiceTestReservedParamNamesRequest} requestParameters Request parameters.
|
||||
* @param {*} [testReservedParamNamesOpts.config] Override http request option.
|
||||
*/
|
||||
public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, ): Observable<AxiosResponse<any>>;
|
||||
public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, ): Observable<any> {
|
||||
public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, testReservedParamNamesOpts?: { config?: AxiosRequestConfig }): Observable<AxiosResponse<any>>;
|
||||
public testReservedParamNames(requestParameters: DefaultServiceTestReservedParamNamesRequest, testReservedParamNamesOpts?: { config?: AxiosRequestConfig }): Observable<any> {
|
||||
const {
|
||||
notReserved,
|
||||
'from': _from,
|
||||
@ -138,7 +139,8 @@ export class DefaultService {
|
||||
{
|
||||
params: queryParameters,
|
||||
withCredentials: this.configuration.withCredentials,
|
||||
headers: headers
|
||||
...testReservedParamNamesOpts?.config,
|
||||
headers: {...headers, ...testReservedParamNamesOpts?.config?.headers},
|
||||
}
|
||||
);
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user