Add a function for injecting your own Authentication into the Typescript-node client (#5865)

This commit is contained in:
Brendan Burns 2017-06-27 09:23:40 -07:00 committed by wing328
parent 62c0f17f98
commit 91f470e41f
4 changed files with 32 additions and 0 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}