mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-07 10:58:55 +00:00
Add a function for injecting your own Authentication into the Typescript-node client (#5865)
This commit is contained in:
parent
62c0f17f98
commit
91f470e41f
@ -171,6 +171,10 @@ export class {{classname}} {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: {{classname}}ApiKeys, value: string) {
|
||||
this.authentications[{{classname}}ApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
@ -123,6 +123,10 @@ export class FakeApi {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: FakeApiApiKeys, value: string) {
|
||||
this.authentications[FakeApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
@ -175,6 +175,10 @@ export class PetApi {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: PetApiApiKeys, value: string) {
|
||||
this.authentications[PetApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
@ -667,6 +671,10 @@ export class StoreApi {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: StoreApiApiKeys, value: string) {
|
||||
this.authentications[StoreApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
@ -913,6 +921,10 @@ export class UserApi {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: UserApiApiKeys, value: string) {
|
||||
this.authentications[UserApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
@ -175,6 +175,10 @@ export class PetApi {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: PetApiApiKeys, value: string) {
|
||||
this.authentications[PetApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
@ -667,6 +671,10 @@ export class StoreApi {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: StoreApiApiKeys, value: string) {
|
||||
this.authentications[StoreApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
@ -913,6 +921,10 @@ export class UserApi {
|
||||
return this._basePath;
|
||||
}
|
||||
|
||||
public setDefaultAuthentication(auth: Authentication) {
|
||||
this.authentications.default = auth;
|
||||
}
|
||||
|
||||
public setApiKey(key: UserApiApiKeys, value: string) {
|
||||
this.authentications[UserApiApiKeys[key]].apiKey = value;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user