forked from loafle/openapi-generator-original
Made api call configuration separately settable
This commit is contained in:
parent
7786f2e9fb
commit
a00e342505
@ -1,5 +1,6 @@
|
||||
// TODO: better import syntax?
|
||||
import { BaseAPIRequestFactory, RequiredError } from './baseapi';
|
||||
import {Configuration} from '../configuration';
|
||||
import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
|
||||
import * as FormData from "form-data";
|
||||
import {ObjectSerializer} from '../models/ObjectSerializer';
|
||||
@ -15,8 +16,10 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
|
||||
// TODO: allow passing of Configuration via Options (=> overwrites config set for this request factory
|
||||
|
||||
{{#operation}}
|
||||
public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): RequestContext {
|
||||
public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
{{#allParams}}
|
||||
|
||||
{{#required}}
|
||||
// verify required parameter '{{paramName}}' is not null or undefined
|
||||
if ({{paramName}} === null || {{paramName}} === undefined) {
|
||||
@ -31,7 +34,7 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
|
||||
.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}};
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.{{httpMethod}});
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.{{httpMethod}});
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -100,7 +103,7 @@ export class {{classname}}RequestFactory extends BaseAPIRequestFactory {
|
||||
{{/hasAuthMethods}}
|
||||
// Apply auth methods
|
||||
{{#authMethods}}
|
||||
authMethod = this.configuration.authMethods["{{name}}"]
|
||||
authMethod = config.authMethods["{{name}}"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ export class {{classname}} {
|
||||
}
|
||||
|
||||
{{#operation}}
|
||||
public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: any): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
|
||||
public {{nickname}}({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options?: Configuration): Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}void{{/returnType}}> {
|
||||
const requestContext = this.requestFactory.{{nickname}}({{#allParams}}{{paramName}}, {{/allParams}}options);
|
||||
|
||||
// build promise chain
|
||||
|
@ -1,5 +1,6 @@
|
||||
// TODO: better import syntax?
|
||||
import { BaseAPIRequestFactory, RequiredError } from './baseapi';
|
||||
import {Configuration} from '../configuration';
|
||||
import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
|
||||
import * as FormData from "form-data";
|
||||
import {ObjectSerializer} from '../models/ObjectSerializer';
|
||||
@ -12,7 +13,9 @@ import { Pet } from '../models/Pet';
|
||||
export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
// TODO: allow passing of Configuration via Options (=> overwrites config set for this request factory
|
||||
|
||||
public addPet(pet: Pet, options?: any): RequestContext {
|
||||
public addPet(pet: Pet, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling addPet.');
|
||||
@ -23,7 +26,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -42,7 +45,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = this.configuration.authMethods["petstore_auth"]
|
||||
authMethod = config.authMethods["petstore_auth"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
@ -50,19 +53,22 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public deletePet(petId: number, apiKey?: string, options?: any): RequestContext {
|
||||
public deletePet(petId: number, apiKey?: string, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling deletePet.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -77,7 +83,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = this.configuration.authMethods["petstore_auth"]
|
||||
authMethod = config.authMethods["petstore_auth"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
@ -85,7 +91,9 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): RequestContext {
|
||||
public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'status' is not null or undefined
|
||||
if (status === null || status === undefined) {
|
||||
throw new RequiredError('Required parameter status was null or undefined when calling findPetsByStatus.');
|
||||
@ -96,7 +104,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
const localVarPath = '/pet/findByStatus';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -113,7 +121,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = this.configuration.authMethods["petstore_auth"]
|
||||
authMethod = config.authMethods["petstore_auth"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
@ -121,7 +129,9 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public findPetsByTags(tags: Array<string>, options?: any): RequestContext {
|
||||
public findPetsByTags(tags: Array<string>, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'tags' is not null or undefined
|
||||
if (tags === null || tags === undefined) {
|
||||
throw new RequiredError('Required parameter tags was null or undefined when calling findPetsByTags.');
|
||||
@ -132,7 +142,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
const localVarPath = '/pet/findByTags';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -149,7 +159,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = this.configuration.authMethods["petstore_auth"]
|
||||
authMethod = config.authMethods["petstore_auth"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
@ -157,7 +167,9 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public getPetById(petId: number, options?: any): RequestContext {
|
||||
public getPetById(petId: number, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling getPetById.');
|
||||
@ -169,7 +181,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -183,7 +195,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = this.configuration.authMethods["api_key"]
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
@ -191,7 +203,9 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public updatePet(pet: Pet, options?: any): RequestContext {
|
||||
public updatePet(pet: Pet, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'pet' is not null or undefined
|
||||
if (pet === null || pet === undefined) {
|
||||
throw new RequiredError('Required parameter pet was null or undefined when calling updatePet.');
|
||||
@ -202,7 +216,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
const localVarPath = '/pet';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -221,7 +235,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = this.configuration.authMethods["petstore_auth"]
|
||||
authMethod = config.authMethods["petstore_auth"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
@ -229,19 +243,23 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, options?: any): RequestContext {
|
||||
public updatePetWithForm(petId: number, name?: string, status?: string, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling updatePetWithForm.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -265,7 +283,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = this.configuration.authMethods["petstore_auth"]
|
||||
authMethod = config.authMethods["petstore_auth"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
@ -273,19 +291,23 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: any): RequestContext {
|
||||
public uploadFile(petId: number, additionalMetadata?: string, file?: HttpFile, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'petId' is not null or undefined
|
||||
if (petId === null || petId === undefined) {
|
||||
throw new RequiredError('Required parameter petId was null or undefined when calling uploadFile.');
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/pet/{petId}/uploadImage'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -309,7 +331,7 @@ export class PetApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = this.configuration.authMethods["petstore_auth"]
|
||||
authMethod = config.authMethods["petstore_auth"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
// TODO: better import syntax?
|
||||
import { BaseAPIRequestFactory, RequiredError } from './baseapi';
|
||||
import {Configuration} from '../configuration';
|
||||
import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
|
||||
import * as FormData from "form-data";
|
||||
import {ObjectSerializer} from '../models/ObjectSerializer';
|
||||
@ -11,7 +12,9 @@ import { Order } from '../models/Order';
|
||||
export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
// TODO: allow passing of Configuration via Options (=> overwrites config set for this request factory
|
||||
|
||||
public deleteOrder(orderId: string, options?: any): RequestContext {
|
||||
public deleteOrder(orderId: string, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'orderId' is not null or undefined
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new RequiredError('Required parameter orderId was null or undefined when calling deleteOrder.');
|
||||
@ -23,7 +26,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -40,13 +43,14 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public getInventory(options?: any): RequestContext {
|
||||
public getInventory(options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/store/inventory';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -60,7 +64,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
|
||||
let authMethod = null;
|
||||
// Apply auth methods
|
||||
authMethod = this.configuration.authMethods["api_key"]
|
||||
authMethod = config.authMethods["api_key"]
|
||||
if (authMethod) {
|
||||
authMethod.applySecurityAuthentication(requestContext);
|
||||
}
|
||||
@ -68,7 +72,9 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public getOrderById(orderId: number, options?: any): RequestContext {
|
||||
public getOrderById(orderId: number, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'orderId' is not null or undefined
|
||||
if (orderId === null || orderId === undefined) {
|
||||
throw new RequiredError('Required parameter orderId was null or undefined when calling getOrderById.');
|
||||
@ -80,7 +86,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -97,7 +103,9 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public placeOrder(order: Order, options?: any): RequestContext {
|
||||
public placeOrder(order: Order, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'order' is not null or undefined
|
||||
if (order === null || order === undefined) {
|
||||
throw new RequiredError('Required parameter order was null or undefined when calling placeOrder.');
|
||||
@ -108,7 +116,7 @@ export class StoreApiRequestFactory extends BaseAPIRequestFactory {
|
||||
const localVarPath = '/store/order';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
|
@ -1,5 +1,6 @@
|
||||
// TODO: better import syntax?
|
||||
import { BaseAPIRequestFactory, RequiredError } from './baseapi';
|
||||
import {Configuration} from '../configuration';
|
||||
import { RequestContext, HttpMethod, ResponseContext, HttpFile} from '../http/http';
|
||||
import * as FormData from "form-data";
|
||||
import {ObjectSerializer} from '../models/ObjectSerializer';
|
||||
@ -11,7 +12,9 @@ import { User } from '../models/User';
|
||||
export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
// TODO: allow passing of Configuration via Options (=> overwrites config set for this request factory
|
||||
|
||||
public createUser(user: User, options?: any): RequestContext {
|
||||
public createUser(user: User, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUser.');
|
||||
@ -22,7 +25,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
const localVarPath = '/user';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -44,7 +47,9 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: any): RequestContext {
|
||||
public createUsersWithArrayInput(user: Array<User>, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithArrayInput.');
|
||||
@ -55,7 +60,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
const localVarPath = '/user/createWithArray';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -77,7 +82,9 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public createUsersWithListInput(user: Array<User>, options?: any): RequestContext {
|
||||
public createUsersWithListInput(user: Array<User>, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling createUsersWithListInput.');
|
||||
@ -88,7 +95,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
const localVarPath = '/user/createWithList';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.POST);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -110,7 +117,9 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public deleteUser(username: string, options?: any): RequestContext {
|
||||
public deleteUser(username: string, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling deleteUser.');
|
||||
@ -122,7 +131,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.DELETE);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -139,7 +148,9 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public getUserByName(username: string, options?: any): RequestContext {
|
||||
public getUserByName(username: string, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling getUserByName.');
|
||||
@ -151,7 +162,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -168,12 +179,15 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public loginUser(username: string, password: string, options?: any): RequestContext {
|
||||
public loginUser(username: string, password: string, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling loginUser.');
|
||||
}
|
||||
|
||||
|
||||
// verify required parameter 'password' is not null or undefined
|
||||
if (password === null || password === undefined) {
|
||||
throw new RequiredError('Required parameter password was null or undefined when calling loginUser.');
|
||||
@ -184,7 +198,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
const localVarPath = '/user/login';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -207,13 +221,14 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public logoutUser(options?: any): RequestContext {
|
||||
public logoutUser(options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// Path Params
|
||||
const localVarPath = '/user/logout';
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.GET);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
@ -230,12 +245,15 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
return requestContext;
|
||||
}
|
||||
|
||||
public updateUser(username: string, user: User, options?: any): RequestContext {
|
||||
public updateUser(username: string, user: User, options?: Configuration): RequestContext {
|
||||
let config = options || this.configuration;
|
||||
|
||||
// verify required parameter 'username' is not null or undefined
|
||||
if (username === null || username === undefined) {
|
||||
throw new RequiredError('Required parameter username was null or undefined when calling updateUser.');
|
||||
}
|
||||
|
||||
|
||||
// verify required parameter 'user' is not null or undefined
|
||||
if (user === null || user === undefined) {
|
||||
throw new RequiredError('Required parameter user was null or undefined when calling updateUser.');
|
||||
@ -247,7 +265,7 @@ export class UserApiRequestFactory extends BaseAPIRequestFactory {
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
|
||||
// Make Request Context
|
||||
const requestContext = this.configuration.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
const requestContext = config.baseServer.makeRequestContext(localVarPath, HttpMethod.PUT);
|
||||
requestContext.setHeaderParam("Accept", "application/json")
|
||||
|
||||
// Query Params
|
||||
|
Loading…
x
Reference in New Issue
Block a user