forked from loafle/openapi-generator-original
Merge pull request #1553 from aersamkull/master
Adds comments to TypeScript Generator & updates samples
This commit is contained in:
commit
d5f5d43c36
@ -33,7 +33,12 @@ namespace {{package}} {
|
|||||||
}
|
}
|
||||||
|
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
|
/**
|
||||||
|
* {{summary}}
|
||||||
|
* {{notes}}
|
||||||
|
{{#allParams}}* @param {{paramName}} {{description}}
|
||||||
|
{{/allParams}}
|
||||||
|
*/
|
||||||
public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any ) : ng.IHttpPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}> {
|
public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}, {{/allParams}}extraHttpRequestParams?: any ) : ng.IHttpPromise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}{}{{/returnType}}> {
|
||||||
const path = this.basePath + '{{path}}'{{#pathParams}}
|
const path = this.basePath + '{{path}}'{{#pathParams}}
|
||||||
.replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}};
|
.replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}};
|
||||||
|
@ -167,7 +167,12 @@ export class {{classname}} {
|
|||||||
return <T1&T2>objA;
|
return <T1&T2>objA;
|
||||||
}
|
}
|
||||||
{{#operation}}
|
{{#operation}}
|
||||||
|
/**
|
||||||
|
* {{summary}}
|
||||||
|
* {{notes}}
|
||||||
|
{{#allParams}}* @param {{paramName}} {{description}}
|
||||||
|
{{/allParams}}
|
||||||
|
*/
|
||||||
public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : Promise<{ response: http.ClientResponse; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> {
|
public {{nickname}} ({{#allParams}}{{paramName}}{{^required}}?{{/required}}: {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) : Promise<{ response: http.ClientResponse; {{#returnType}}body: {{{returnType}}}; {{/returnType}}{{^returnType}}body?: any; {{/returnType}} }> {
|
||||||
const path = this.url + this.basePath + '{{path}}'{{#pathParams}}
|
const path = this.url + this.basePath + '{{path}}'{{#pathParams}}
|
||||||
.replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}};
|
.replace('{' + '{{baseName}}' + '}', String({{paramName}})){{/pathParams}};
|
||||||
|
@ -3,11 +3,22 @@
|
|||||||
namespace API.Client {
|
namespace API.Client {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export interface Category {
|
export interface Category {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
id?: number;
|
id?: number;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,30 +3,65 @@
|
|||||||
namespace API.Client {
|
namespace API.Client {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export interface Order {
|
export interface Order {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
id?: number;
|
id?: number;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
petId?: number;
|
petId?: number;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
quantity?: number;
|
quantity?: number;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
shipDate?: Date;
|
shipDate?: Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Order Status
|
* Order Status
|
||||||
*/
|
*/
|
||||||
|
|
||||||
status?: Order.StatusEnum;
|
status?: Order.StatusEnum;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
complete?: boolean;
|
complete?: boolean;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export namespace Order {
|
export namespace Order {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export enum StatusEnum {
|
export enum StatusEnum {
|
||||||
placed = <any> 'placed',
|
placed = <any> 'placed',
|
||||||
approved = <any> 'approved',
|
approved = <any> 'approved',
|
||||||
delivered = <any> 'delivered',
|
delivered = <any> 'delivered',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,30 +3,65 @@
|
|||||||
namespace API.Client {
|
namespace API.Client {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export interface Pet {
|
export interface Pet {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
id?: number;
|
id?: number;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
category?: Category;
|
category?: Category;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
photoUrls: Array<string>;
|
photoUrls: Array<string>;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
tags?: Array<Tag>;
|
tags?: Array<Tag>;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* pet status in the store
|
* pet status in the store
|
||||||
*/
|
*/
|
||||||
|
|
||||||
status?: Pet.StatusEnum;
|
status?: Pet.StatusEnum;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export namespace Pet {
|
export namespace Pet {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export enum StatusEnum {
|
export enum StatusEnum {
|
||||||
available = <any> 'available',
|
available = <any> 'available',
|
||||||
pending = <any> 'pending',
|
pending = <any> 'pending',
|
||||||
sold = <any> 'sold',
|
sold = <any> 'sold',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
/* tslint:disable:no-unused-variable member-ordering */
|
/* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
|
|
||||||
namespace API.Client {
|
namespace API.Client {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
export class PetApi {
|
export class PetApi {
|
||||||
protected basePath = 'http://petstore.swagger.io/v2';
|
protected basePath = 'http://petstore.swagger.io/v2';
|
||||||
public defaultHeaders : any = {};
|
public defaultHeaders : any = {};
|
||||||
@ -27,11 +29,25 @@ namespace API.Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update an existing pet
|
||||||
|
*
|
||||||
|
* @param body Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
*/
|
||||||
public updatePet (body?: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public updatePet (body?: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
const path = this.basePath + '/pet';
|
const path = this.basePath + '/pet';
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
url: path,
|
url: path,
|
||||||
@ -50,11 +66,25 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add a new pet to the store
|
||||||
|
*
|
||||||
|
* @param body Pet object that needs to be added to the store
|
||||||
|
|
||||||
|
*/
|
||||||
public addPet (body?: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public addPet (body?: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
const path = this.basePath + '/pet';
|
const path = this.basePath + '/pet';
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: path,
|
url: path,
|
||||||
@ -73,15 +103,30 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds Pets by status
|
||||||
|
* Multiple status values can be provided with comma seperated strings
|
||||||
|
* @param status Status values that need to be considered for filter
|
||||||
|
|
||||||
|
*/
|
||||||
public findPetsByStatus (status?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> {
|
public findPetsByStatus (status?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> {
|
||||||
const path = this.basePath + '/pet/findByStatus';
|
const path = this.basePath + '/pet/findByStatus';
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (status !== undefined) {
|
if (status !== undefined) {
|
||||||
queryParameters['status'] = status;
|
queryParameters['status'] = status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: path,
|
url: path,
|
||||||
@ -99,15 +144,30 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Finds Pets by tags
|
||||||
|
* Muliple tags can be provided with comma seperated strings. Use tag1, tag2, tag3 for testing.
|
||||||
|
* @param tags Tags to filter by
|
||||||
|
|
||||||
|
*/
|
||||||
public findPetsByTags (tags?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> {
|
public findPetsByTags (tags?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> {
|
||||||
const path = this.basePath + '/pet/findByTags';
|
const path = this.basePath + '/pet/findByTags';
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (tags !== undefined) {
|
if (tags !== undefined) {
|
||||||
queryParameters['tags'] = tags;
|
queryParameters['tags'] = tags;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: path,
|
url: path,
|
||||||
@ -125,16 +185,31 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find pet by ID
|
||||||
|
* 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, extraHttpRequestParams?: any ) : ng.IHttpPromise<Pet> {
|
public getPetById (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise<Pet> {
|
||||||
const path = this.basePath + '/pet/{petId}'
|
const path = this.basePath + '/pet/{petId}'
|
||||||
.replace('{' + 'petId' + '}', String(petId));
|
.replace('{' + 'petId' + '}', String(petId));
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// verify required parameter 'petId' is set
|
// verify required parameter 'petId' is set
|
||||||
if (!petId) {
|
if (!petId) {
|
||||||
throw new Error('Missing required parameter petId when calling getPetById');
|
throw new Error('Missing required parameter petId when calling getPetById');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: path,
|
url: path,
|
||||||
@ -152,24 +227,49 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates a pet in the store with form data
|
||||||
|
*
|
||||||
|
* @param petId ID of pet that needs to be updated
|
||||||
|
* @param name Updated name of the pet
|
||||||
|
* @param status Updated status of the pet
|
||||||
|
|
||||||
|
*/
|
||||||
public updatePetWithForm (petId: string, name?: string, status?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public updatePetWithForm (petId: string, name?: string, status?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
const path = this.basePath + '/pet/{petId}'
|
const path = this.basePath + '/pet/{petId}'
|
||||||
.replace('{' + 'petId' + '}', String(petId));
|
.replace('{' + 'petId' + '}', String(petId));
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
let formParams: any = {};
|
let formParams: any = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// verify required parameter 'petId' is set
|
// verify required parameter 'petId' is set
|
||||||
if (!petId) {
|
if (!petId) {
|
||||||
throw new Error('Missing required parameter petId when calling updatePetWithForm');
|
throw new Error('Missing required parameter petId when calling updatePetWithForm');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
headerParams['Content-Type'] = 'application/x-www-form-urlencoded';
|
headerParams['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
formParams['name'] = name;
|
formParams['name'] = name;
|
||||||
|
|
||||||
|
|
||||||
formParams['status'] = status;
|
formParams['status'] = status;
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: path,
|
url: path,
|
||||||
@ -188,18 +288,37 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Deletes a pet
|
||||||
|
*
|
||||||
|
* @param petId Pet id to delete
|
||||||
|
* @param apiKey
|
||||||
|
|
||||||
|
*/
|
||||||
public deletePet (petId: number, apiKey?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public deletePet (petId: number, apiKey?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
const path = this.basePath + '/pet/{petId}'
|
const path = this.basePath + '/pet/{petId}'
|
||||||
.replace('{' + 'petId' + '}', String(petId));
|
.replace('{' + 'petId' + '}', String(petId));
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// verify required parameter 'petId' is set
|
// verify required parameter 'petId' is set
|
||||||
if (!petId) {
|
if (!petId) {
|
||||||
throw new Error('Missing required parameter petId when calling deletePet');
|
throw new Error('Missing required parameter petId when calling deletePet');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
headerParams['api_key'] = apiKey;
|
headerParams['api_key'] = apiKey;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
url: path,
|
url: path,
|
||||||
@ -217,24 +336,49 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* uploads an image
|
||||||
|
*
|
||||||
|
* @param petId ID of pet to update
|
||||||
|
* @param additionalMetadata Additional data to pass to server
|
||||||
|
* @param file file to upload
|
||||||
|
|
||||||
|
*/
|
||||||
public uploadFile (petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public uploadFile (petId: number, additionalMetadata?: string, file?: any, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
const path = this.basePath + '/pet/{petId}/uploadImage'
|
const path = this.basePath + '/pet/{petId}/uploadImage'
|
||||||
.replace('{' + 'petId' + '}', String(petId));
|
.replace('{' + 'petId' + '}', String(petId));
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
let formParams: any = {};
|
let formParams: any = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// verify required parameter 'petId' is set
|
// verify required parameter 'petId' is set
|
||||||
if (!petId) {
|
if (!petId) {
|
||||||
throw new Error('Missing required parameter petId when calling uploadFile');
|
throw new Error('Missing required parameter petId when calling uploadFile');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
headerParams['Content-Type'] = 'application/x-www-form-urlencoded';
|
headerParams['Content-Type'] = 'application/x-www-form-urlencoded';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
formParams['additionalMetadata'] = additionalMetadata;
|
formParams['additionalMetadata'] = additionalMetadata;
|
||||||
|
|
||||||
|
|
||||||
formParams['file'] = file;
|
formParams['file'] = file;
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: path,
|
url: path,
|
||||||
@ -252,5 +396,7 @@ namespace API.Client {
|
|||||||
|
|
||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
/* tslint:disable:no-unused-variable member-ordering */
|
/* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
|
|
||||||
namespace API.Client {
|
namespace API.Client {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
export class StoreApi {
|
export class StoreApi {
|
||||||
protected basePath = 'http://petstore.swagger.io/v2';
|
protected basePath = 'http://petstore.swagger.io/v2';
|
||||||
public defaultHeaders : any = {};
|
public defaultHeaders : any = {};
|
||||||
@ -27,11 +29,22 @@ namespace API.Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns pet inventories by status
|
||||||
|
* Returns a map of status codes to quantities
|
||||||
|
|
||||||
|
*/
|
||||||
public getInventory (extraHttpRequestParams?: any ) : ng.IHttpPromise<{ [key: string]: number; }> {
|
public getInventory (extraHttpRequestParams?: any ) : ng.IHttpPromise<{ [key: string]: number; }> {
|
||||||
const path = this.basePath + '/store/inventory';
|
const path = this.basePath + '/store/inventory';
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: path,
|
url: path,
|
||||||
@ -49,11 +62,25 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Place an order for a pet
|
||||||
|
*
|
||||||
|
* @param body order placed for purchasing the pet
|
||||||
|
|
||||||
|
*/
|
||||||
public placeOrder (body?: Order, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> {
|
public placeOrder (body?: Order, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> {
|
||||||
const path = this.basePath + '/store/order';
|
const path = this.basePath + '/store/order';
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: path,
|
url: path,
|
||||||
@ -72,16 +99,31 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find purchase order by ID
|
||||||
|
* 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, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> {
|
public getOrderById (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> {
|
||||||
const path = this.basePath + '/store/order/{orderId}'
|
const path = this.basePath + '/store/order/{orderId}'
|
||||||
.replace('{' + 'orderId' + '}', String(orderId));
|
.replace('{' + 'orderId' + '}', String(orderId));
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// verify required parameter 'orderId' is set
|
// verify required parameter 'orderId' is set
|
||||||
if (!orderId) {
|
if (!orderId) {
|
||||||
throw new Error('Missing required parameter orderId when calling getOrderById');
|
throw new Error('Missing required parameter orderId when calling getOrderById');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: path,
|
url: path,
|
||||||
@ -99,16 +141,31 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete purchase order by ID
|
||||||
|
* 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, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public deleteOrder (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
const path = this.basePath + '/store/order/{orderId}'
|
const path = this.basePath + '/store/order/{orderId}'
|
||||||
.replace('{' + 'orderId' + '}', String(orderId));
|
.replace('{' + 'orderId' + '}', String(orderId));
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// verify required parameter 'orderId' is set
|
// verify required parameter 'orderId' is set
|
||||||
if (!orderId) {
|
if (!orderId) {
|
||||||
throw new Error('Missing required parameter orderId when calling deleteOrder');
|
throw new Error('Missing required parameter orderId when calling deleteOrder');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
url: path,
|
url: path,
|
||||||
@ -125,5 +182,7 @@ namespace API.Client {
|
|||||||
|
|
||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,11 +3,22 @@
|
|||||||
namespace API.Client {
|
namespace API.Client {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export interface Tag {
|
export interface Tag {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
id?: number;
|
id?: number;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
name?: string;
|
name?: string;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3,26 +3,50 @@
|
|||||||
namespace API.Client {
|
namespace API.Client {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export interface User {
|
export interface User {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
id?: number;
|
id?: number;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
username?: string;
|
username?: string;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
firstName?: string;
|
firstName?: string;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lastName?: string;
|
lastName?: string;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
email?: string;
|
email?: string;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
password?: string;
|
password?: string;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
phone?: string;
|
phone?: string;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* User Status
|
* User Status
|
||||||
*/
|
*/
|
||||||
|
|
||||||
userStatus?: number;
|
userStatus?: number;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
/* tslint:disable:no-unused-variable member-ordering */
|
/* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
|
|
||||||
namespace API.Client {
|
namespace API.Client {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
export class UserApi {
|
export class UserApi {
|
||||||
protected basePath = 'http://petstore.swagger.io/v2';
|
protected basePath = 'http://petstore.swagger.io/v2';
|
||||||
public defaultHeaders : any = {};
|
public defaultHeaders : any = {};
|
||||||
@ -27,11 +29,25 @@ namespace API.Client {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* @param body Created user object
|
||||||
|
|
||||||
|
*/
|
||||||
public createUser (body?: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public createUser (body?: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
const path = this.basePath + '/user';
|
const path = this.basePath + '/user';
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: path,
|
url: path,
|
||||||
@ -50,11 +66,25 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*
|
||||||
|
* @param body List of user object
|
||||||
|
|
||||||
|
*/
|
||||||
public createUsersWithArrayInput (body?: Array<User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public createUsersWithArrayInput (body?: Array<User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
const path = this.basePath + '/user/createWithArray';
|
const path = this.basePath + '/user/createWithArray';
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: path,
|
url: path,
|
||||||
@ -73,11 +103,25 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates list of users with given input array
|
||||||
|
*
|
||||||
|
* @param body List of user object
|
||||||
|
|
||||||
|
*/
|
||||||
public createUsersWithListInput (body?: Array<User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public createUsersWithListInput (body?: Array<User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
const path = this.basePath + '/user/createWithList';
|
const path = this.basePath + '/user/createWithList';
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: path,
|
url: path,
|
||||||
@ -96,19 +140,38 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs user into the system
|
||||||
|
*
|
||||||
|
* @param username The user name for login
|
||||||
|
* @param password The password for login in clear text
|
||||||
|
|
||||||
|
*/
|
||||||
public loginUser (username?: string, password?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<string> {
|
public loginUser (username?: string, password?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<string> {
|
||||||
const path = this.basePath + '/user/login';
|
const path = this.basePath + '/user/login';
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (username !== undefined) {
|
if (username !== undefined) {
|
||||||
queryParameters['username'] = username;
|
queryParameters['username'] = username;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (password !== undefined) {
|
if (password !== undefined) {
|
||||||
queryParameters['password'] = password;
|
queryParameters['password'] = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: path,
|
url: path,
|
||||||
@ -126,11 +189,22 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Logs out current logged in user session
|
||||||
|
*
|
||||||
|
|
||||||
|
*/
|
||||||
public logoutUser (extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public logoutUser (extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
const path = this.basePath + '/user/logout';
|
const path = this.basePath + '/user/logout';
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: path,
|
url: path,
|
||||||
@ -148,16 +222,31 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get user by user name
|
||||||
|
*
|
||||||
|
* @param username The name that needs to be fetched. Use user1 for testing.
|
||||||
|
|
||||||
|
*/
|
||||||
public getUserByName (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<User> {
|
public getUserByName (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<User> {
|
||||||
const path = this.basePath + '/user/{username}'
|
const path = this.basePath + '/user/{username}'
|
||||||
.replace('{' + 'username' + '}', String(username));
|
.replace('{' + 'username' + '}', String(username));
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// verify required parameter 'username' is set
|
// verify required parameter 'username' is set
|
||||||
if (!username) {
|
if (!username) {
|
||||||
throw new Error('Missing required parameter username when calling getUserByName');
|
throw new Error('Missing required parameter username when calling getUserByName');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: path,
|
url: path,
|
||||||
@ -175,16 +264,34 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updated user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* @param username name that need to be deleted
|
||||||
|
* @param body Updated user object
|
||||||
|
|
||||||
|
*/
|
||||||
public updateUser (username: string, body?: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public updateUser (username: string, body?: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
const path = this.basePath + '/user/{username}'
|
const path = this.basePath + '/user/{username}'
|
||||||
.replace('{' + 'username' + '}', String(username));
|
.replace('{' + 'username' + '}', String(username));
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// verify required parameter 'username' is set
|
// verify required parameter 'username' is set
|
||||||
if (!username) {
|
if (!username) {
|
||||||
throw new Error('Missing required parameter username when calling updateUser');
|
throw new Error('Missing required parameter username when calling updateUser');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
url: path,
|
url: path,
|
||||||
@ -203,16 +310,31 @@ namespace API.Client {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete user
|
||||||
|
* This can only be done by the logged in user.
|
||||||
|
* @param username The name that needs to be deleted
|
||||||
|
|
||||||
|
*/
|
||||||
public deleteUser (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public deleteUser (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
const path = this.basePath + '/user/{username}'
|
const path = this.basePath + '/user/{username}'
|
||||||
.replace('{' + 'username' + '}', String(username));
|
.replace('{' + 'username' + '}', String(username));
|
||||||
|
|
||||||
let queryParameters: any = {};
|
let queryParameters: any = {};
|
||||||
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
let headerParams: any = this.extendObj({}, this.defaultHeaders);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// verify required parameter 'username' is set
|
// verify required parameter 'username' is set
|
||||||
if (!username) {
|
if (!username) {
|
||||||
throw new Error('Missing required parameter username when calling deleteUser');
|
throw new Error('Missing required parameter username when calling deleteUser');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let httpRequestParams: any = {
|
let httpRequestParams: any = {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
url: path,
|
url: path,
|
||||||
@ -229,5 +351,7 @@ namespace API.Client {
|
|||||||
|
|
||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,9 +1,37 @@
|
|||||||
|
|
||||||
|
|
||||||
/// <reference path="User.ts" />
|
/// <reference path="User.ts" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <reference path="Category.ts" />
|
/// <reference path="Category.ts" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <reference path="Pet.ts" />
|
/// <reference path="Pet.ts" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <reference path="Tag.ts" />
|
/// <reference path="Tag.ts" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <reference path="Order.ts" />
|
/// <reference path="Order.ts" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <reference path="UserApi.ts" />
|
/// <reference path="UserApi.ts" />
|
||||||
/// <reference path="PetApi.ts" />
|
|
||||||
|
|
||||||
|
|
||||||
/// <reference path="StoreApi.ts" />
|
/// <reference path="StoreApi.ts" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/// <reference path="PetApi.ts" />
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user