forked from loafle/openapi-generator-original
[typescript-node] Fix invalid type when using node@10 and ES5 (#7133)
* replace ClientResponse with IncommingMessage in mustache * updated samples * updated integrationtests
This commit is contained in:
@@ -12,7 +12,7 @@ import * as fs from 'fs';
|
||||
import * as http from 'http';
|
||||
|
||||
export class HttpError extends Error {
|
||||
constructor (public response: http.{{#supportsES6}}IncomingMessage{{/supportsES6}}{{^supportsES6}}ClientResponse{{/supportsES6}}, public body: any, public statusCode?: number) {
|
||||
constructor (public response: http.IncomingMessage, public body: any, public statusCode?: number) {
|
||||
super('HTTP request failed');
|
||||
this.name = 'HttpError';
|
||||
}
|
||||
|
||||
@@ -154,7 +154,7 @@ export class {{classname}} {
|
||||
* @param {{paramName}} {{description}}
|
||||
{{/allParams}}
|
||||
*/
|
||||
public async {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.{{#supportsES6}}IncomingMessage{{/supportsES6}}{{^supportsES6}}ClientResponse{{/supportsES6}}; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> {
|
||||
public async {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> {
|
||||
const localVarPath = this.basePath + '{{{path}}}'{{#pathParams}}
|
||||
.replace('{' + '{{baseName}}' + '}', encodeURIComponent(String({{paramName}}))){{/pathParams}};
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -261,7 +261,7 @@ export class {{classname}} {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.{{#supportsES6}}IncomingMessage{{/supportsES6}}{{^supportsES6}}ClientResponse{{/supportsES6}}; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
|
||||
@@ -139,7 +139,7 @@ export class PetApi {
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
*/
|
||||
public addPet (body?: Pet) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public addPet (body?: Pet) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/pet';
|
||||
let queryParameters: any = {};
|
||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||
@@ -167,7 +167,7 @@ export class PetApi {
|
||||
requestOptions.form = formParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
request(requestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -187,7 +187,7 @@ export class PetApi {
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
*/
|
||||
public deletePet (petId: number, apiKey?: string) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public deletePet (petId: number, apiKey?: string) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', String(petId));
|
||||
let queryParameters: any = {};
|
||||
@@ -222,7 +222,7 @@ export class PetApi {
|
||||
requestOptions.form = formParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
request(requestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -241,7 +241,7 @@ export class PetApi {
|
||||
* Returns a pet when ID < 10. ID > 10 or nonintegers will simulate API error conditions
|
||||
* @param petId ID of pet that needs to be fetched
|
||||
*/
|
||||
public getPetById (petId: number) : Promise<{ response: http.ClientResponse; body: Pet; }> {
|
||||
public getPetById (petId: number) : Promise<{ response: http.IncomingMessage; body: Pet; }> {
|
||||
const localVarPath = this.basePath + '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', String(petId));
|
||||
let queryParameters: any = {};
|
||||
@@ -274,7 +274,7 @@ export class PetApi {
|
||||
requestOptions.form = formParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Pet; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Pet; }>((resolve, reject) => {
|
||||
request(requestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -293,7 +293,7 @@ export class PetApi {
|
||||
*
|
||||
* @param body Pet object that needs to be added to the store
|
||||
*/
|
||||
public updatePet (body?: Pet) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public updatePet (body?: Pet) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/pet';
|
||||
let queryParameters: any = {};
|
||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||
@@ -321,7 +321,7 @@ export class PetApi {
|
||||
requestOptions.form = formParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
request(requestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -342,7 +342,7 @@ export class PetApi {
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public updatePetWithForm (petId: string, name?: string, status?: string) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public updatePetWithForm (petId: string, name?: string, status?: string) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', String(petId));
|
||||
let queryParameters: any = {};
|
||||
@@ -383,7 +383,7 @@ export class PetApi {
|
||||
requestOptions.form = formParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
request(requestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -443,7 +443,7 @@ export class StoreApi {
|
||||
* For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public deleteOrder (orderId: string) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public deleteOrder (orderId: string) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', String(orderId));
|
||||
let queryParameters: any = {};
|
||||
@@ -476,7 +476,7 @@ export class StoreApi {
|
||||
requestOptions.form = formParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
request(requestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -494,7 +494,7 @@ export class StoreApi {
|
||||
* Returns pet inventories by status
|
||||
* Returns a map of status codes to quantities
|
||||
*/
|
||||
public getInventory () : Promise<{ response: http.ClientResponse; body: { [key: string]: number; }; }> {
|
||||
public getInventory () : Promise<{ response: http.IncomingMessage; body: { [key: string]: number; }; }> {
|
||||
const localVarPath = this.basePath + '/store/inventory';
|
||||
let queryParameters: any = {};
|
||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||
@@ -521,7 +521,7 @@ export class StoreApi {
|
||||
requestOptions.form = formParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: { [key: string]: number; }; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: { [key: string]: number; }; }>((resolve, reject) => {
|
||||
request(requestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -540,7 +540,7 @@ export class StoreApi {
|
||||
* For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public getOrderById (orderId: string) : Promise<{ response: http.ClientResponse; body: Order; }> {
|
||||
public getOrderById (orderId: string) : Promise<{ response: http.IncomingMessage; body: Order; }> {
|
||||
const localVarPath = this.basePath + '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', String(orderId));
|
||||
let queryParameters: any = {};
|
||||
@@ -573,7 +573,7 @@ export class StoreApi {
|
||||
requestOptions.form = formParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Order; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Order; }>((resolve, reject) => {
|
||||
request(requestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -592,7 +592,7 @@ export class StoreApi {
|
||||
*
|
||||
* @param body order placed for purchasing the pet
|
||||
*/
|
||||
public placeOrder (body?: Order) : Promise<{ response: http.ClientResponse; body: Order; }> {
|
||||
public placeOrder (body?: Order) : Promise<{ response: http.IncomingMessage; body: Order; }> {
|
||||
const localVarPath = this.basePath + '/store/order';
|
||||
let queryParameters: any = {};
|
||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||
@@ -620,7 +620,7 @@ export class StoreApi {
|
||||
requestOptions.form = formParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Order; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Order; }>((resolve, reject) => {
|
||||
request(requestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
|
||||
@@ -73,7 +73,7 @@ export class DefaultApi {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public getObjectWithEnums (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array<ObjectWithEnums>; }> {
|
||||
public getObjectWithEnums (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<ObjectWithEnums>; }> {
|
||||
const localVarPath = this.basePath + '/getobjectwithenums';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
|
||||
@@ -101,7 +101,7 @@ export class DefaultApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Array<ObjectWithEnums>; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Array<ObjectWithEnums>; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -120,7 +120,7 @@ export class DefaultApi {
|
||||
*
|
||||
* @param objectWithEnums
|
||||
*/
|
||||
public postObjectWithEnums (objectWithEnums: ObjectWithEnums, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public postObjectWithEnums (objectWithEnums: ObjectWithEnums, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/postobjectwithenums';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this.defaultHeaders);
|
||||
@@ -154,7 +154,7 @@ export class DefaultApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as fs from 'fs';
|
||||
import * as http from 'http';
|
||||
|
||||
export class HttpError extends Error {
|
||||
constructor (public response: http.ClientResponse, public body: any, public statusCode?: number) {
|
||||
constructor (public response: http.IncomingMessage, public body: any, public statusCode?: number) {
|
||||
super('HTTP request failed');
|
||||
this.name = 'HttpError';
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ export class PetApi {
|
||||
* @summary Add a new pet to the store
|
||||
* @param body Pet object that needs to be added to the store
|
||||
*/
|
||||
public async addPet (body: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async addPet (body: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/pet';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -144,7 +144,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -165,7 +165,7 @@ export class PetApi {
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
*/
|
||||
public async deletePet (petId: number, apiKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async deletePet (petId: number, apiKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -210,7 +210,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -230,7 +230,7 @@ export class PetApi {
|
||||
* @summary Finds Pets by status
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public async findPetsByStatus (status: Array<'available' | 'pending' | 'sold'>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array<Pet>; }> {
|
||||
public async findPetsByStatus (status: Array<'available' | 'pending' | 'sold'>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<Pet>; }> {
|
||||
const localVarPath = this.basePath + '/pet/findByStatus';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -284,7 +284,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Array<Pet>; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Array<Pet>; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -305,7 +305,7 @@ export class PetApi {
|
||||
* @summary Finds Pets by tags
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public async findPetsByTags (tags: Array<string>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array<Pet>; }> {
|
||||
public async findPetsByTags (tags: Array<string>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<Pet>; }> {
|
||||
const localVarPath = this.basePath + '/pet/findByTags';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -359,7 +359,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Array<Pet>; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Array<Pet>; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -380,7 +380,7 @@ export class PetApi {
|
||||
* @summary Find pet by ID
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public async getPetById (petId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Pet; }> {
|
||||
public async getPetById (petId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Pet; }> {
|
||||
const localVarPath = this.basePath + '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -431,7 +431,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Pet; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Pet; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -452,7 +452,7 @@ export class PetApi {
|
||||
* @summary Update an existing pet
|
||||
* @param body Pet object that needs to be added to the store
|
||||
*/
|
||||
public async updatePet (body: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async updatePet (body: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/pet';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -496,7 +496,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -518,7 +518,7 @@ export class PetApi {
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public async updatePetWithForm (petId: number, name?: string, status?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async updatePetWithForm (petId: number, name?: string, status?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -570,7 +570,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -592,7 +592,7 @@ export class PetApi {
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
*/
|
||||
public async uploadFile (petId: number, additionalMetadata?: string, file?: RequestFile, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: ApiResponse; }> {
|
||||
public async uploadFile (petId: number, additionalMetadata?: string, file?: RequestFile, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ApiResponse; }> {
|
||||
const localVarPath = this.basePath + '/pet/{petId}/uploadImage'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -652,7 +652,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: ApiResponse; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: ApiResponse; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
|
||||
@@ -94,7 +94,7 @@ export class StoreApi {
|
||||
* @summary Delete purchase order by ID
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public async deleteOrder (orderId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async deleteOrder (orderId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -135,7 +135,7 @@ export class StoreApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -154,7 +154,7 @@ export class StoreApi {
|
||||
* Returns a map of status codes to quantities
|
||||
* @summary Returns pet inventories by status
|
||||
*/
|
||||
public async getInventory (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: { [key: string]: number; }; }> {
|
||||
public async getInventory (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: { [key: string]: number; }; }> {
|
||||
const localVarPath = this.basePath + '/store/inventory';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -199,7 +199,7 @@ export class StoreApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: { [key: string]: number; }; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: { [key: string]: number; }; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -220,7 +220,7 @@ export class StoreApi {
|
||||
* @summary Find purchase order by ID
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public async getOrderById (orderId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Order; }> {
|
||||
public async getOrderById (orderId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Order; }> {
|
||||
const localVarPath = this.basePath + '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -268,7 +268,7 @@ export class StoreApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Order; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Order; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -289,7 +289,7 @@ export class StoreApi {
|
||||
* @summary Place an order for a pet
|
||||
* @param body order placed for purchasing the pet
|
||||
*/
|
||||
public async placeOrder (body: Order, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Order; }> {
|
||||
public async placeOrder (body: Order, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Order; }> {
|
||||
const localVarPath = this.basePath + '/store/order';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -337,7 +337,7 @@ export class StoreApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Order; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Order; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
|
||||
@@ -91,7 +91,7 @@ export class UserApi {
|
||||
* @summary Create user
|
||||
* @param body Created user object
|
||||
*/
|
||||
public async createUser (body: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async createUser (body: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/user';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -132,7 +132,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -152,7 +152,7 @@ export class UserApi {
|
||||
* @summary Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
*/
|
||||
public async createUsersWithArrayInput (body: Array<User>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async createUsersWithArrayInput (body: Array<User>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/user/createWithArray';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -193,7 +193,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -213,7 +213,7 @@ export class UserApi {
|
||||
* @summary Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
*/
|
||||
public async createUsersWithListInput (body: Array<User>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async createUsersWithListInput (body: Array<User>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/user/createWithList';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -254,7 +254,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -274,7 +274,7 @@ export class UserApi {
|
||||
* @summary Delete user
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public async deleteUser (username: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async deleteUser (username: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -315,7 +315,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -335,7 +335,7 @@ export class UserApi {
|
||||
* @summary Get user by user name
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public async getUserByName (username: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: User; }> {
|
||||
public async getUserByName (username: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: User; }> {
|
||||
const localVarPath = this.basePath + '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -383,7 +383,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: User; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: User; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -405,7 +405,7 @@ export class UserApi {
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public async loginUser (username: string, password: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: string; }> {
|
||||
public async loginUser (username: string, password: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
|
||||
const localVarPath = this.basePath + '/user/login';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -465,7 +465,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: string; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -485,7 +485,7 @@ export class UserApi {
|
||||
*
|
||||
* @summary Logs out current logged in user session
|
||||
*/
|
||||
public async logoutUser (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async logoutUser (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/user/logout';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -520,7 +520,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -541,7 +541,7 @@ export class UserApi {
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
*/
|
||||
public async updateUser (username: string, body: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async updateUser (username: string, body: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -588,7 +588,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
|
||||
@@ -8,7 +8,7 @@ import * as fs from 'fs';
|
||||
import * as http from 'http';
|
||||
|
||||
export class HttpError extends Error {
|
||||
constructor (public response: http.ClientResponse, public body: any, public statusCode?: number) {
|
||||
constructor (public response: http.IncomingMessage, public body: any, public statusCode?: number) {
|
||||
super('HTTP request failed');
|
||||
this.name = 'HttpError';
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ export class PetApi {
|
||||
* @summary Add a new pet to the store
|
||||
* @param body Pet object that needs to be added to the store
|
||||
*/
|
||||
public async addPet (body: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async addPet (body: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/pet';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -144,7 +144,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -165,7 +165,7 @@ export class PetApi {
|
||||
* @param petId Pet id to delete
|
||||
* @param apiKey
|
||||
*/
|
||||
public async deletePet (petId: number, apiKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async deletePet (petId: number, apiKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -210,7 +210,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -230,7 +230,7 @@ export class PetApi {
|
||||
* @summary Finds Pets by status
|
||||
* @param status Status values that need to be considered for filter
|
||||
*/
|
||||
public async findPetsByStatus (status: Array<'available' | 'pending' | 'sold'>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array<Pet>; }> {
|
||||
public async findPetsByStatus (status: Array<'available' | 'pending' | 'sold'>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<Pet>; }> {
|
||||
const localVarPath = this.basePath + '/pet/findByStatus';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -284,7 +284,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Array<Pet>; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Array<Pet>; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -305,7 +305,7 @@ export class PetApi {
|
||||
* @summary Finds Pets by tags
|
||||
* @param tags Tags to filter by
|
||||
*/
|
||||
public async findPetsByTags (tags: Array<string>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Array<Pet>; }> {
|
||||
public async findPetsByTags (tags: Array<string>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Array<Pet>; }> {
|
||||
const localVarPath = this.basePath + '/pet/findByTags';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -359,7 +359,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Array<Pet>; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Array<Pet>; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -380,7 +380,7 @@ export class PetApi {
|
||||
* @summary Find pet by ID
|
||||
* @param petId ID of pet to return
|
||||
*/
|
||||
public async getPetById (petId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Pet; }> {
|
||||
public async getPetById (petId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Pet; }> {
|
||||
const localVarPath = this.basePath + '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -431,7 +431,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Pet; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Pet; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -452,7 +452,7 @@ export class PetApi {
|
||||
* @summary Update an existing pet
|
||||
* @param body Pet object that needs to be added to the store
|
||||
*/
|
||||
public async updatePet (body: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async updatePet (body: Pet, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/pet';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -496,7 +496,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -518,7 +518,7 @@ export class PetApi {
|
||||
* @param name Updated name of the pet
|
||||
* @param status Updated status of the pet
|
||||
*/
|
||||
public async updatePetWithForm (petId: number, name?: string, status?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async updatePetWithForm (petId: number, name?: string, status?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/pet/{petId}'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -570,7 +570,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -592,7 +592,7 @@ export class PetApi {
|
||||
* @param additionalMetadata Additional data to pass to server
|
||||
* @param file file to upload
|
||||
*/
|
||||
public async uploadFile (petId: number, additionalMetadata?: string, file?: RequestFile, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: ApiResponse; }> {
|
||||
public async uploadFile (petId: number, additionalMetadata?: string, file?: RequestFile, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: ApiResponse; }> {
|
||||
const localVarPath = this.basePath + '/pet/{petId}/uploadImage'
|
||||
.replace('{' + 'petId' + '}', encodeURIComponent(String(petId)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -652,7 +652,7 @@ export class PetApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: ApiResponse; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: ApiResponse; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
|
||||
@@ -94,7 +94,7 @@ export class StoreApi {
|
||||
* @summary Delete purchase order by ID
|
||||
* @param orderId ID of the order that needs to be deleted
|
||||
*/
|
||||
public async deleteOrder (orderId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async deleteOrder (orderId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -135,7 +135,7 @@ export class StoreApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -154,7 +154,7 @@ export class StoreApi {
|
||||
* Returns a map of status codes to quantities
|
||||
* @summary Returns pet inventories by status
|
||||
*/
|
||||
public async getInventory (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: { [key: string]: number; }; }> {
|
||||
public async getInventory (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: { [key: string]: number; }; }> {
|
||||
const localVarPath = this.basePath + '/store/inventory';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -199,7 +199,7 @@ export class StoreApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: { [key: string]: number; }; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: { [key: string]: number; }; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -220,7 +220,7 @@ export class StoreApi {
|
||||
* @summary Find purchase order by ID
|
||||
* @param orderId ID of pet that needs to be fetched
|
||||
*/
|
||||
public async getOrderById (orderId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Order; }> {
|
||||
public async getOrderById (orderId: number, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Order; }> {
|
||||
const localVarPath = this.basePath + '/store/order/{orderId}'
|
||||
.replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -268,7 +268,7 @@ export class StoreApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Order; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Order; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -289,7 +289,7 @@ export class StoreApi {
|
||||
* @summary Place an order for a pet
|
||||
* @param body order placed for purchasing the pet
|
||||
*/
|
||||
public async placeOrder (body: Order, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Order; }> {
|
||||
public async placeOrder (body: Order, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: Order; }> {
|
||||
const localVarPath = this.basePath + '/store/order';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -337,7 +337,7 @@ export class StoreApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: Order; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: Order; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
|
||||
@@ -91,7 +91,7 @@ export class UserApi {
|
||||
* @summary Create user
|
||||
* @param body Created user object
|
||||
*/
|
||||
public async createUser (body: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async createUser (body: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/user';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -132,7 +132,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -152,7 +152,7 @@ export class UserApi {
|
||||
* @summary Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
*/
|
||||
public async createUsersWithArrayInput (body: Array<User>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async createUsersWithArrayInput (body: Array<User>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/user/createWithArray';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -193,7 +193,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -213,7 +213,7 @@ export class UserApi {
|
||||
* @summary Creates list of users with given input array
|
||||
* @param body List of user object
|
||||
*/
|
||||
public async createUsersWithListInput (body: Array<User>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async createUsersWithListInput (body: Array<User>, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/user/createWithList';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -254,7 +254,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -274,7 +274,7 @@ export class UserApi {
|
||||
* @summary Delete user
|
||||
* @param username The name that needs to be deleted
|
||||
*/
|
||||
public async deleteUser (username: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async deleteUser (username: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -315,7 +315,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -335,7 +335,7 @@ export class UserApi {
|
||||
* @summary Get user by user name
|
||||
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||
*/
|
||||
public async getUserByName (username: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: User; }> {
|
||||
public async getUserByName (username: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: User; }> {
|
||||
const localVarPath = this.basePath + '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -383,7 +383,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: User; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: User; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -405,7 +405,7 @@ export class UserApi {
|
||||
* @param username The user name for login
|
||||
* @param password The password for login in clear text
|
||||
*/
|
||||
public async loginUser (username: string, password: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: string; }> {
|
||||
public async loginUser (username: string, password: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body: string; }> {
|
||||
const localVarPath = this.basePath + '/user/login';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -465,7 +465,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body: string; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body: string; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -485,7 +485,7 @@ export class UserApi {
|
||||
*
|
||||
* @summary Logs out current logged in user session
|
||||
*/
|
||||
public async logoutUser (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async logoutUser (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/user/logout';
|
||||
let localVarQueryParameters: any = {};
|
||||
let localVarHeaderParams: any = (<any>Object).assign({}, this._defaultHeaders);
|
||||
@@ -520,7 +520,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
@@ -541,7 +541,7 @@ export class UserApi {
|
||||
* @param username name that need to be deleted
|
||||
* @param body Updated user object
|
||||
*/
|
||||
public async updateUser (username: string, body: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> {
|
||||
public async updateUser (username: string, body: User, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.IncomingMessage; body?: any; }> {
|
||||
const localVarPath = this.basePath + '/user/{username}'
|
||||
.replace('{' + 'username' + '}', encodeURIComponent(String(username)));
|
||||
let localVarQueryParameters: any = {};
|
||||
@@ -588,7 +588,7 @@ export class UserApi {
|
||||
localVarRequestOptions.form = localVarFormParams;
|
||||
}
|
||||
}
|
||||
return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => {
|
||||
return new Promise<{ response: http.IncomingMessage; body?: any; }>((resolve, reject) => {
|
||||
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
||||
if (error) {
|
||||
reject(error);
|
||||
|
||||
Reference in New Issue
Block a user