forked from loafle/openapi-generator-original
Updating typescript samples
This commit is contained in:
parent
bc8eae838c
commit
3723a9ba2d
@ -1,6 +1,6 @@
|
|||||||
/// <reference path="api.d.ts" />
|
/// <reference path="api.d.ts" />
|
||||||
|
|
||||||
module api {
|
module {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
export class Category {
|
export class Category {
|
@ -1,6 +1,6 @@
|
|||||||
/// <reference path="api.d.ts" />
|
/// <reference path="api.d.ts" />
|
||||||
|
|
||||||
module api {
|
module {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
export class Order {
|
export class Order {
|
||||||
@ -11,7 +11,7 @@ module api {
|
|||||||
|
|
||||||
quantity: number;
|
quantity: number;
|
||||||
|
|
||||||
shipDate: DateTime;
|
shipDate: Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Order Status
|
* Order Status
|
@ -1,6 +1,6 @@
|
|||||||
/// <reference path="api.d.ts" />
|
/// <reference path="api.d.ts" />
|
||||||
|
|
||||||
module api {
|
module {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
export class Pet {
|
export class Pet {
|
@ -2,12 +2,11 @@
|
|||||||
|
|
||||||
/* tslint:disable:no-unused-variable member-ordering */
|
/* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
module api {
|
module {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
export class PetApi {
|
export class PetApi {
|
||||||
private basePath = 'http://petstore.swagger.io/v2';
|
private basePath = '/v2';
|
||||||
|
|
||||||
static $inject: string[] = ['$http'];
|
static $inject: string[] = ['$http'];
|
||||||
|
|
||||||
@ -17,13 +16,11 @@ module api {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public updatePet (body: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public updatePet (body?: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
var path = this.basePath + '/pet';
|
var path = this.basePath + '/pet';
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
@ -32,11 +29,11 @@ module api {
|
|||||||
data: body,
|
data: body,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -46,13 +43,11 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public addPet (body: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public addPet (body?: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
var path = this.basePath + '/pet';
|
var path = this.basePath + '/pet';
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -61,11 +56,11 @@ module api {
|
|||||||
data: body,
|
data: body,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -75,11 +70,11 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public findPetsByStatus (status: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> {
|
public findPetsByStatus (status?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> {
|
||||||
var path = this.basePath + '/pet/findByStatus';
|
var path = this.basePath + '/pet/findByStatus';
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
if (status !== undefined) {
|
if (status !== undefined) {
|
||||||
queryParameters['status'] = status;
|
queryParameters['status'] = status;
|
||||||
@ -91,11 +86,11 @@ module api {
|
|||||||
json: true,
|
json: true,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -105,11 +100,11 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public findPetsByTags (tags: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> {
|
public findPetsByTags (tags?: Array<string>, extraHttpRequestParams?: any ) : ng.IHttpPromise<Array<Pet>> {
|
||||||
var path = this.basePath + '/pet/findByTags';
|
var path = this.basePath + '/pet/findByTags';
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
if (tags !== undefined) {
|
if (tags !== undefined) {
|
||||||
queryParameters['tags'] = tags;
|
queryParameters['tags'] = tags;
|
||||||
@ -121,11 +116,11 @@ module api {
|
|||||||
json: true,
|
json: true,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -135,32 +130,30 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getPetById (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise<Pet> {
|
public getPetById (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise<Pet> {
|
||||||
var path = this.basePath + '/pet/{petId}';
|
var path = this.basePath + '/pet/{petId}';
|
||||||
|
|
||||||
path = path.replace('{' + 'petId' + '}', String(petId));
|
path = path.replace('{' + 'petId' + '}', String(petId));
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: 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 getPetById');
|
throw new Error('Missing required parameter petId when calling getPetById');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: path,
|
url: path,
|
||||||
json: true,
|
json: true,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -170,32 +163,30 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public updatePetWithForm (petId: string, name: string, status: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public updatePetWithForm (petId: string, name?: string, status?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
var path = this.basePath + '/pet/{petId}';
|
var path = this.basePath + '/pet/{petId}';
|
||||||
|
|
||||||
path = path.replace('{' + 'petId' + '}', String(petId));
|
path = path.replace('{' + 'petId' + '}', String(petId));
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: 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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: path,
|
url: path,
|
||||||
json: true,
|
json: true,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -205,32 +196,32 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public deletePet (apiKey: string, petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public deletePet (petId: number, apiKey?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
var path = this.basePath + '/pet/{petId}';
|
var path = this.basePath + '/pet/{petId}';
|
||||||
|
|
||||||
path = path.replace('{' + 'petId' + '}', String(petId));
|
path = path.replace('{' + 'petId' + '}', String(petId));
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: 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 deletePet');
|
throw new Error('Missing required parameter petId when calling deletePet');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
headerParams['apiKey'] = apiKey;
|
headerParams['apiKey'] = apiKey;
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
url: path,
|
url: path,
|
||||||
json: true,
|
json: true,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -240,32 +231,30 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public uploadFile (petId: number, additionalMetadata: string, file: file, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public uploadFile (petId: number, additionalMetadata?: string, file?: file, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
var path = this.basePath + '/pet/{petId}/uploadImage';
|
var path = this.basePath + '/pet/{petId}/uploadImage';
|
||||||
|
|
||||||
path = path.replace('{' + 'petId' + '}', String(petId));
|
path = path.replace('{' + 'petId' + '}', String(petId));
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: 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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
url: path,
|
url: path,
|
||||||
json: true,
|
json: true,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -274,9 +263,5 @@ module api {
|
|||||||
|
|
||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
angular.module('api_PetApi', ['$http'])
|
|
||||||
.service('PetApi', PetApi);
|
|
||||||
}
|
}
|
@ -2,12 +2,11 @@
|
|||||||
|
|
||||||
/* tslint:disable:no-unused-variable member-ordering */
|
/* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
module api {
|
module {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
export class StoreApi {
|
export class StoreApi {
|
||||||
private basePath = 'http://petstore.swagger.io/v2';
|
private basePath = '/v2';
|
||||||
|
|
||||||
static $inject: string[] = ['$http'];
|
static $inject: string[] = ['$http'];
|
||||||
|
|
||||||
@ -17,13 +16,11 @@ module api {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getInventory ( extraHttpRequestParams?: any ) : ng.IHttpPromise<map<String, number>> {
|
public getInventory (extraHttpRequestParams?: any ) : ng.IHttpPromise<map<String, number>> {
|
||||||
var path = this.basePath + '/store/inventory';
|
var path = this.basePath + '/store/inventory';
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@ -31,11 +28,11 @@ module api {
|
|||||||
json: true,
|
json: true,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -45,13 +42,11 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public placeOrder (body: Order, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> {
|
public placeOrder (body?: Order, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> {
|
||||||
var path = this.basePath + '/store/order';
|
var path = this.basePath + '/store/order';
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -60,11 +55,11 @@ module api {
|
|||||||
data: body,
|
data: body,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -74,32 +69,30 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getOrderById (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> {
|
public getOrderById (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<Order> {
|
||||||
var path = this.basePath + '/store/order/{orderId}';
|
var path = this.basePath + '/store/order/{orderId}';
|
||||||
|
|
||||||
path = path.replace('{' + 'orderId' + '}', String(orderId));
|
path = path.replace('{' + 'orderId' + '}', String(orderId));
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
// 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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: path,
|
url: path,
|
||||||
json: true,
|
json: true,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -109,32 +102,30 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public deleteOrder (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public deleteOrder (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
var path = this.basePath + '/store/order/{orderId}';
|
var path = this.basePath + '/store/order/{orderId}';
|
||||||
|
|
||||||
path = path.replace('{' + 'orderId' + '}', String(orderId));
|
path = path.replace('{' + 'orderId' + '}', String(orderId));
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
// 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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
url: path,
|
url: path,
|
||||||
json: true,
|
json: true,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -143,9 +134,5 @@ module api {
|
|||||||
|
|
||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
angular.module('api_StoreApi', ['$http'])
|
|
||||||
.service('StoreApi', StoreApi);
|
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
/// <reference path="api.d.ts" />
|
/// <reference path="api.d.ts" />
|
||||||
|
|
||||||
module api {
|
module {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
export class Tag {
|
export class Tag {
|
@ -1,6 +1,6 @@
|
|||||||
/// <reference path="api.d.ts" />
|
/// <reference path="api.d.ts" />
|
||||||
|
|
||||||
module api {
|
module {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
export class User {
|
export class User {
|
@ -2,12 +2,11 @@
|
|||||||
|
|
||||||
/* tslint:disable:no-unused-variable member-ordering */
|
/* tslint:disable:no-unused-variable member-ordering */
|
||||||
|
|
||||||
module api {
|
module {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
|
||||||
export class UserApi {
|
export class UserApi {
|
||||||
private basePath = 'http://petstore.swagger.io/v2';
|
private basePath = '/v2';
|
||||||
|
|
||||||
static $inject: string[] = ['$http'];
|
static $inject: string[] = ['$http'];
|
||||||
|
|
||||||
@ -17,13 +16,11 @@ module api {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public createUser (body: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public createUser (body?: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
var path = this.basePath + '/user';
|
var path = this.basePath + '/user';
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -32,11 +29,11 @@ module api {
|
|||||||
data: body,
|
data: body,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -46,13 +43,11 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public createUsersWithArrayInput (body: Array<User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public createUsersWithArrayInput (body?: Array<User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
var path = this.basePath + '/user/createWithArray';
|
var path = this.basePath + '/user/createWithArray';
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -61,11 +56,11 @@ module api {
|
|||||||
data: body,
|
data: body,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -75,13 +70,11 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public createUsersWithListInput (body: Array<User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public createUsersWithListInput (body?: Array<User>, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
var path = this.basePath + '/user/createWithList';
|
var path = this.basePath + '/user/createWithList';
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@ -90,11 +83,11 @@ module api {
|
|||||||
data: body,
|
data: body,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -104,15 +97,17 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public loginUser (username: string, password: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<string> {
|
public loginUser (username?: string, password?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<string> {
|
||||||
var path = this.basePath + '/user/login';
|
var path = this.basePath + '/user/login';
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
if (username !== undefined) {
|
if (username !== undefined) {
|
||||||
queryParameters['username'] = username;
|
queryParameters['username'] = username;
|
||||||
}if (password !== undefined) {
|
}
|
||||||
|
|
||||||
|
if (password !== undefined) {
|
||||||
queryParameters['password'] = password;
|
queryParameters['password'] = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,11 +117,11 @@ module api {
|
|||||||
json: true,
|
json: true,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -136,13 +131,11 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public logoutUser ( extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public logoutUser (extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
var path = this.basePath + '/user/logout';
|
var path = this.basePath + '/user/logout';
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
@ -150,11 +143,11 @@ module api {
|
|||||||
json: true,
|
json: true,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -164,32 +157,30 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public getUserByName (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<User> {
|
public getUserByName (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<User> {
|
||||||
var path = this.basePath + '/user/{username}';
|
var path = this.basePath + '/user/{username}';
|
||||||
|
|
||||||
path = path.replace('{' + 'username' + '}', String(username));
|
path = path.replace('{' + 'username' + '}', String(username));
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
// 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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
url: path,
|
url: path,
|
||||||
json: true,
|
json: true,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -199,21 +190,19 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public updateUser (username: string, body: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public updateUser (username: string, body?: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
var path = this.basePath + '/user/{username}';
|
var path = this.basePath + '/user/{username}';
|
||||||
|
|
||||||
path = path.replace('{' + 'username' + '}', String(username));
|
path = path.replace('{' + 'username' + '}', String(username));
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
// 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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'PUT',
|
method: 'PUT',
|
||||||
url: path,
|
url: path,
|
||||||
@ -221,11 +210,11 @@ module api {
|
|||||||
data: body,
|
data: body,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -235,32 +224,30 @@ module api {
|
|||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
public deleteUser (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
public deleteUser (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> {
|
||||||
var path = this.basePath + '/user/{username}';
|
var path = this.basePath + '/user/{username}';
|
||||||
|
|
||||||
path = path.replace('{' + 'username' + '}', String(username));
|
path = path.replace('{' + 'username' + '}', String(username));
|
||||||
|
|
||||||
var queryParameters: any = {};
|
var queryParameters: any = {};
|
||||||
var headers: any = {};
|
var headerParams: any = {};
|
||||||
|
|
||||||
// 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');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var httpRequestParams: any = {
|
var httpRequestParams: any = {
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
url: path,
|
url: path,
|
||||||
json: true,
|
json: true,
|
||||||
|
|
||||||
params: queryParameters,
|
params: queryParameters,
|
||||||
headers: headers
|
headers: headerParams
|
||||||
};
|
};
|
||||||
|
|
||||||
if (extraHttpRequestParams) {
|
if (extraHttpRequestParams) {
|
||||||
for (var k in extraHttpRequestParams){
|
for (var k in extraHttpRequestParams) {
|
||||||
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
if (extraHttpRequestParams.hasOwnProperty(k)) {
|
||||||
httpRequestParams[k] = extraHttpRequestParams[k];
|
httpRequestParams[k] = extraHttpRequestParams[k];
|
||||||
}
|
}
|
||||||
@ -269,9 +256,5 @@ module api {
|
|||||||
|
|
||||||
return this.$http(httpRequestParams);
|
return this.$http(httpRequestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
angular.module('api_UserApi', ['$http'])
|
|
||||||
.service('UserApi', UserApi);
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user