mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-03-10 08:31:23 +00:00
Accept Promises for the apiKey configuration in the typescript-fetch generator. (#17758)
This commit is contained in:
@@ -191,13 +191,13 @@ export class {{classname}} extends runtime.BaseAPI {
|
||||
{{#isApiKey}}
|
||||
{{#isKeyInHeader}}
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["{{keyParamName}}"] = this.configuration.apiKey("{{keyParamName}}"); // {{name}} authentication
|
||||
headerParameters["{{keyParamName}}"] = await this.configuration.apiKey("{{keyParamName}}"); // {{name}} authentication
|
||||
}
|
||||
|
||||
{{/isKeyInHeader}}
|
||||
{{#isKeyInQuery}}
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
queryParameters["{{keyParamName}}"] = this.configuration.apiKey("{{keyParamName}}"); // {{name}} authentication
|
||||
queryParameters["{{keyParamName}}"] = await this.configuration.apiKey("{{keyParamName}}"); // {{name}} authentication
|
||||
}
|
||||
|
||||
{{/isKeyInQuery}}
|
||||
|
||||
@@ -11,7 +11,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -48,7 +48,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -47,7 +47,7 @@ export class FakeClassnameTags123Api extends runtime.BaseAPI {
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
queryParameters["api_key_query"] = this.configuration.apiKey("api_key_query"); // api_key_query authentication
|
||||
queryParameters["api_key_query"] = await this.configuration.apiKey("api_key_query"); // api_key_query authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -250,7 +250,7 @@ export class PetApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -80,7 +80,7 @@ export class StoreApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -240,7 +240,7 @@ export class PetApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -80,7 +80,7 @@ export class StoreApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -240,7 +240,7 @@ export class PetApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -80,7 +80,7 @@ export class StoreApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -240,7 +240,7 @@ export class PetApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -80,7 +80,7 @@ export class StoreApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -240,7 +240,7 @@ export class PetApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -80,7 +80,7 @@ export class StoreApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -355,7 +355,7 @@ export class PetApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -80,7 +80,7 @@ export class StoreApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -47,7 +47,7 @@ export class FakeClassnameTags123Api extends runtime.BaseAPI {
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
queryParameters["api_key_query"] = this.configuration.apiKey("api_key_query"); // api_key_query authentication
|
||||
queryParameters["api_key_query"] = await this.configuration.apiKey("api_key_query"); // api_key_query authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -250,7 +250,7 @@ export class PetApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -80,7 +80,7 @@ export class StoreApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -379,7 +379,7 @@ export class PetApi extends runtime.BaseAPI implements PetApiInterface {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -151,7 +151,7 @@ export class StoreApi extends runtime.BaseAPI implements StoreApiInterface {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -240,7 +240,7 @@ export class PetApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -80,7 +80,7 @@ export class StoreApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
@@ -234,7 +234,7 @@ export class PetApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -76,7 +76,7 @@ export class StoreApi extends runtime.BaseAPI {
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.apiKey) {
|
||||
headerParameters["api_key"] = this.configuration.apiKey("api_key"); // api_key authentication
|
||||
headerParameters["api_key"] = await this.configuration.apiKey("api_key"); // api_key authentication
|
||||
}
|
||||
|
||||
const response = await this.request({
|
||||
|
||||
@@ -22,7 +22,7 @@ export interface ConfigurationParameters {
|
||||
queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings
|
||||
username?: string; // parameter for basic security
|
||||
password?: string; // parameter for basic security
|
||||
apiKey?: string | ((name: string) => string); // parameter for apiKey security
|
||||
apiKey?: string | Promise<string> | ((name: string) => string | Promise<string>); // parameter for apiKey security
|
||||
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string | Promise<string>); // parameter for oauth2 security
|
||||
headers?: HTTPHeaders; //header params we want to use on every request
|
||||
credentials?: RequestCredentials; //value for the credentials param we want to use on each request
|
||||
@@ -59,7 +59,7 @@ export class Configuration {
|
||||
return this.configuration.password;
|
||||
}
|
||||
|
||||
get apiKey(): ((name: string) => string) | undefined {
|
||||
get apiKey(): ((name: string) => string | Promise<string>) | undefined {
|
||||
const apiKey = this.configuration.apiKey;
|
||||
if (apiKey) {
|
||||
return typeof apiKey === 'function' ? apiKey : () => apiKey;
|
||||
|
||||
Reference in New Issue
Block a user