From 3723a9ba2d1d78d6a4a15e9216bd3b20ec091181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mads=20M=C3=A6tzke=20Tandrup?= Date: Fri, 24 Jul 2015 10:22:41 +0200 Subject: [PATCH] Updating typescript samples --- .../typescript-angular/{api => }/Category.ts | 2 +- .../typescript-angular/{api => }/Order.ts | 4 +- .../typescript-angular/{api => }/Pet.ts | 2 +- .../typescript-angular/{api => }/PetApi.ts | 153 ++++++++---------- .../typescript-angular/{api => }/StoreApi.ts | 81 ++++------ .../typescript-angular/{api => }/Tag.ts | 2 +- .../typescript-angular/{api => }/User.ts | 2 +- .../typescript-angular/{api => }/UserApi.ts | 153 ++++++++---------- .../typescript-angular/{api => }/api.d.ts | 0 9 files changed, 177 insertions(+), 222 deletions(-) rename samples/client/petstore/typescript-angular/{api => }/Category.ts (90%) rename samples/client/petstore/typescript-angular/{api => }/Order.ts (91%) rename samples/client/petstore/typescript-angular/{api => }/Pet.ts (97%) rename samples/client/petstore/typescript-angular/{api => }/PetApi.ts (74%) rename samples/client/petstore/typescript-angular/{api => }/StoreApi.ts (72%) rename samples/client/petstore/typescript-angular/{api => }/Tag.ts (90%) rename samples/client/petstore/typescript-angular/{api => }/User.ts (96%) rename samples/client/petstore/typescript-angular/{api => }/UserApi.ts (73%) rename samples/client/petstore/typescript-angular/{api => }/api.d.ts (100%) diff --git a/samples/client/petstore/typescript-angular/api/Category.ts b/samples/client/petstore/typescript-angular/Category.ts similarity index 90% rename from samples/client/petstore/typescript-angular/api/Category.ts rename to samples/client/petstore/typescript-angular/Category.ts index e4a3caa208..2ec6a2b20f 100644 --- a/samples/client/petstore/typescript-angular/api/Category.ts +++ b/samples/client/petstore/typescript-angular/Category.ts @@ -1,6 +1,6 @@ /// -module api { +module { 'use strict'; export class Category { diff --git a/samples/client/petstore/typescript-angular/api/Order.ts b/samples/client/petstore/typescript-angular/Order.ts similarity index 91% rename from samples/client/petstore/typescript-angular/api/Order.ts rename to samples/client/petstore/typescript-angular/Order.ts index 3f37c60875..f916138d7a 100644 --- a/samples/client/petstore/typescript-angular/api/Order.ts +++ b/samples/client/petstore/typescript-angular/Order.ts @@ -1,6 +1,6 @@ /// -module api { +module { 'use strict'; export class Order { @@ -11,7 +11,7 @@ module api { quantity: number; - shipDate: DateTime; + shipDate: Date; /** * Order Status diff --git a/samples/client/petstore/typescript-angular/api/Pet.ts b/samples/client/petstore/typescript-angular/Pet.ts similarity index 97% rename from samples/client/petstore/typescript-angular/api/Pet.ts rename to samples/client/petstore/typescript-angular/Pet.ts index c34be9c3db..ac8d6b72fd 100644 --- a/samples/client/petstore/typescript-angular/api/Pet.ts +++ b/samples/client/petstore/typescript-angular/Pet.ts @@ -1,6 +1,6 @@ /// -module api { +module { 'use strict'; export class Pet { diff --git a/samples/client/petstore/typescript-angular/api/PetApi.ts b/samples/client/petstore/typescript-angular/PetApi.ts similarity index 74% rename from samples/client/petstore/typescript-angular/api/PetApi.ts rename to samples/client/petstore/typescript-angular/PetApi.ts index d294cfbebb..3067994a76 100644 --- a/samples/client/petstore/typescript-angular/api/PetApi.ts +++ b/samples/client/petstore/typescript-angular/PetApi.ts @@ -2,12 +2,11 @@ /* tslint:disable:no-unused-variable member-ordering */ -module api { +module { 'use strict'; - export class PetApi { - private basePath = 'http://petstore.swagger.io/v2'; + private basePath = '/v2'; static $inject: string[] = ['$http']; @@ -16,15 +15,13 @@ module api { this.basePath = basePath; } } - - public updatePet (body: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + + public updatePet (body?: Pet, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { var path = this.basePath + '/pet'; - + var queryParameters: any = {}; - var headers: any = {}; - - - + var headerParams: any = {}; + var httpRequestParams: any = { method: 'PUT', url: path, @@ -32,11 +29,11 @@ module api { data: body, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -45,15 +42,13 @@ module api { 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 queryParameters: any = {}; - var headers: any = {}; - - - + var headerParams: any = {}; + var httpRequestParams: any = { method: 'POST', url: path, @@ -61,11 +56,11 @@ module api { data: body, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -74,28 +69,28 @@ module api { return this.$http(httpRequestParams); } - - public findPetsByStatus (status: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise> { + + public findPetsByStatus (status?: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise> { var path = this.basePath + '/pet/findByStatus'; - + var queryParameters: any = {}; - var headers: any = {}; - + var headerParams: any = {}; + if (status !== undefined) { queryParameters['status'] = status; } - + var httpRequestParams: any = { method: 'GET', url: path, json: true, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -104,28 +99,28 @@ module api { return this.$http(httpRequestParams); } - - public findPetsByTags (tags: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise> { + + public findPetsByTags (tags?: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise> { var path = this.basePath + '/pet/findByTags'; - + var queryParameters: any = {}; - var headers: any = {}; - + var headerParams: any = {}; + if (tags !== undefined) { queryParameters['tags'] = tags; } - + var httpRequestParams: any = { method: 'GET', url: path, json: true, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -134,33 +129,31 @@ module api { return this.$http(httpRequestParams); } - - public getPetById (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise { + + public getPetById (petId: number, extraHttpRequestParams?: any ) : ng.IHttpPromise { var path = this.basePath + '/pet/{petId}'; - + path = path.replace('{' + 'petId' + '}', String(petId)); - + var queryParameters: any = {}; - var headers: any = {}; - + var headerParams: any = {}; + // verify required parameter 'petId' is set if (!petId) { throw new Error('Missing required parameter petId when calling getPetById'); } - - - + var httpRequestParams: any = { method: 'GET', url: path, json: true, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -169,33 +162,31 @@ module api { 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}'; - + path = path.replace('{' + 'petId' + '}', String(petId)); - + var queryParameters: any = {}; - var headers: any = {}; - + var headerParams: any = {}; + // verify required parameter 'petId' is set if (!petId) { throw new Error('Missing required parameter petId when calling updatePetWithForm'); } - - - + var httpRequestParams: any = { method: 'POST', url: path, json: true, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -204,33 +195,33 @@ module api { 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}'; - + path = path.replace('{' + 'petId' + '}', String(petId)); - + var queryParameters: any = {}; - var headers: any = {}; - + var headerParams: any = {}; + // verify required parameter 'petId' is set if (!petId) { throw new Error('Missing required parameter petId when calling deletePet'); } - - + headerParams['apiKey'] = apiKey; + var httpRequestParams: any = { method: 'DELETE', url: path, json: true, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -239,33 +230,31 @@ module api { 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'; - + path = path.replace('{' + 'petId' + '}', String(petId)); - + var queryParameters: any = {}; - var headers: any = {}; - + var headerParams: any = {}; + // verify required parameter 'petId' is set if (!petId) { throw new Error('Missing required parameter petId when calling uploadFile'); } - - - + var httpRequestParams: any = { method: 'POST', url: path, json: true, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -274,9 +263,5 @@ module api { return this.$http(httpRequestParams); } - } - - angular.module('api_PetApi', ['$http']) - .service('PetApi', PetApi); } diff --git a/samples/client/petstore/typescript-angular/api/StoreApi.ts b/samples/client/petstore/typescript-angular/StoreApi.ts similarity index 72% rename from samples/client/petstore/typescript-angular/api/StoreApi.ts rename to samples/client/petstore/typescript-angular/StoreApi.ts index e8c85b00c4..67f60be313 100644 --- a/samples/client/petstore/typescript-angular/api/StoreApi.ts +++ b/samples/client/petstore/typescript-angular/StoreApi.ts @@ -2,12 +2,11 @@ /* tslint:disable:no-unused-variable member-ordering */ -module api { +module { 'use strict'; - export class StoreApi { - private basePath = 'http://petstore.swagger.io/v2'; + private basePath = '/v2'; static $inject: string[] = ['$http']; @@ -16,26 +15,24 @@ module api { this.basePath = basePath; } } - - public getInventory ( extraHttpRequestParams?: any ) : ng.IHttpPromise> { + + public getInventory (extraHttpRequestParams?: any ) : ng.IHttpPromise> { var path = this.basePath + '/store/inventory'; - + var queryParameters: any = {}; - var headers: any = {}; - - - + var headerParams: any = {}; + var httpRequestParams: any = { method: 'GET', url: path, json: true, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -44,15 +41,13 @@ module api { return this.$http(httpRequestParams); } - - public placeOrder (body: Order, extraHttpRequestParams?: any ) : ng.IHttpPromise { + + public placeOrder (body?: Order, extraHttpRequestParams?: any ) : ng.IHttpPromise { var path = this.basePath + '/store/order'; - + var queryParameters: any = {}; - var headers: any = {}; - - - + var headerParams: any = {}; + var httpRequestParams: any = { method: 'POST', url: path, @@ -60,11 +55,11 @@ module api { data: body, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -73,33 +68,31 @@ module api { return this.$http(httpRequestParams); } - - public getOrderById (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise { + + public getOrderById (orderId: string, extraHttpRequestParams?: any ) : ng.IHttpPromise { var path = this.basePath + '/store/order/{orderId}'; - + path = path.replace('{' + 'orderId' + '}', String(orderId)); - + var queryParameters: any = {}; - var headers: any = {}; - + var headerParams: any = {}; + // verify required parameter 'orderId' is set if (!orderId) { throw new Error('Missing required parameter orderId when calling getOrderById'); } - - - + var httpRequestParams: any = { method: 'GET', url: path, json: true, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -108,33 +101,31 @@ module api { 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}'; - + path = path.replace('{' + 'orderId' + '}', String(orderId)); - + var queryParameters: any = {}; - var headers: any = {}; - + var headerParams: any = {}; + // verify required parameter 'orderId' is set if (!orderId) { throw new Error('Missing required parameter orderId when calling deleteOrder'); } - - - + var httpRequestParams: any = { method: 'DELETE', url: path, json: true, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -143,9 +134,5 @@ module api { return this.$http(httpRequestParams); } - } - - angular.module('api_StoreApi', ['$http']) - .service('StoreApi', StoreApi); } diff --git a/samples/client/petstore/typescript-angular/api/Tag.ts b/samples/client/petstore/typescript-angular/Tag.ts similarity index 90% rename from samples/client/petstore/typescript-angular/api/Tag.ts rename to samples/client/petstore/typescript-angular/Tag.ts index 33f0ffaa1e..e614fcc084 100644 --- a/samples/client/petstore/typescript-angular/api/Tag.ts +++ b/samples/client/petstore/typescript-angular/Tag.ts @@ -1,6 +1,6 @@ /// -module api { +module { 'use strict'; export class Tag { diff --git a/samples/client/petstore/typescript-angular/api/User.ts b/samples/client/petstore/typescript-angular/User.ts similarity index 96% rename from samples/client/petstore/typescript-angular/api/User.ts rename to samples/client/petstore/typescript-angular/User.ts index 5738504494..93b8ae0fde 100644 --- a/samples/client/petstore/typescript-angular/api/User.ts +++ b/samples/client/petstore/typescript-angular/User.ts @@ -1,6 +1,6 @@ /// -module api { +module { 'use strict'; export class User { diff --git a/samples/client/petstore/typescript-angular/api/UserApi.ts b/samples/client/petstore/typescript-angular/UserApi.ts similarity index 73% rename from samples/client/petstore/typescript-angular/api/UserApi.ts rename to samples/client/petstore/typescript-angular/UserApi.ts index 40d82f7385..10166a0ea9 100644 --- a/samples/client/petstore/typescript-angular/api/UserApi.ts +++ b/samples/client/petstore/typescript-angular/UserApi.ts @@ -2,12 +2,11 @@ /* tslint:disable:no-unused-variable member-ordering */ -module api { +module { 'use strict'; - export class UserApi { - private basePath = 'http://petstore.swagger.io/v2'; + private basePath = '/v2'; static $inject: string[] = ['$http']; @@ -16,15 +15,13 @@ module api { this.basePath = basePath; } } - - public createUser (body: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + + public createUser (body?: User, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { var path = this.basePath + '/user'; - + var queryParameters: any = {}; - var headers: any = {}; - - - + var headerParams: any = {}; + var httpRequestParams: any = { method: 'POST', url: path, @@ -32,11 +29,11 @@ module api { data: body, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -45,15 +42,13 @@ module api { return this.$http(httpRequestParams); } - - public createUsersWithArrayInput (body: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + + public createUsersWithArrayInput (body?: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { var path = this.basePath + '/user/createWithArray'; - + var queryParameters: any = {}; - var headers: any = {}; - - - + var headerParams: any = {}; + var httpRequestParams: any = { method: 'POST', url: path, @@ -61,11 +56,11 @@ module api { data: body, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -74,15 +69,13 @@ module api { return this.$http(httpRequestParams); } - - public createUsersWithListInput (body: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + + public createUsersWithListInput (body?: Array, extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { var path = this.basePath + '/user/createWithList'; - + var queryParameters: any = {}; - var headers: any = {}; - - - + var headerParams: any = {}; + var httpRequestParams: any = { method: 'POST', url: path, @@ -90,11 +83,11 @@ module api { data: body, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -103,30 +96,32 @@ module api { return this.$http(httpRequestParams); } - - public loginUser (username: string, password: string, extraHttpRequestParams?: any ) : ng.IHttpPromise { + + public loginUser (username?: string, password?: string, extraHttpRequestParams?: any ) : ng.IHttpPromise { var path = this.basePath + '/user/login'; - + var queryParameters: any = {}; - var headers: any = {}; - + var headerParams: any = {}; + if (username !== undefined) { queryParameters['username'] = username; - }if (password !== undefined) { + } + + if (password !== undefined) { queryParameters['password'] = password; } - + var httpRequestParams: any = { method: 'GET', url: path, json: true, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -135,26 +130,24 @@ module api { return this.$http(httpRequestParams); } - - public logoutUser ( extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { + + public logoutUser (extraHttpRequestParams?: any ) : ng.IHttpPromise<{}> { var path = this.basePath + '/user/logout'; - + var queryParameters: any = {}; - var headers: any = {}; - - - + var headerParams: any = {}; + var httpRequestParams: any = { method: 'GET', url: path, json: true, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -163,33 +156,31 @@ module api { return this.$http(httpRequestParams); } - - public getUserByName (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise { + + public getUserByName (username: string, extraHttpRequestParams?: any ) : ng.IHttpPromise { var path = this.basePath + '/user/{username}'; - + path = path.replace('{' + 'username' + '}', String(username)); - + var queryParameters: any = {}; - var headers: any = {}; - + var headerParams: any = {}; + // verify required parameter 'username' is set if (!username) { throw new Error('Missing required parameter username when calling getUserByName'); } - - - + var httpRequestParams: any = { method: 'GET', url: path, json: true, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -198,22 +189,20 @@ module api { 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}'; - + path = path.replace('{' + 'username' + '}', String(username)); - + var queryParameters: any = {}; - var headers: any = {}; - + var headerParams: any = {}; + // verify required parameter 'username' is set if (!username) { throw new Error('Missing required parameter username when calling updateUser'); } - - - + var httpRequestParams: any = { method: 'PUT', url: path, @@ -221,11 +210,11 @@ module api { data: body, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -234,33 +223,31 @@ module api { 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}'; - + path = path.replace('{' + 'username' + '}', String(username)); - + var queryParameters: any = {}; - var headers: any = {}; - + var headerParams: any = {}; + // verify required parameter 'username' is set if (!username) { throw new Error('Missing required parameter username when calling deleteUser'); } - - - + var httpRequestParams: any = { method: 'DELETE', url: path, json: true, params: queryParameters, - headers: headers + headers: headerParams }; if (extraHttpRequestParams) { - for (var k in extraHttpRequestParams){ + for (var k in extraHttpRequestParams) { if (extraHttpRequestParams.hasOwnProperty(k)) { httpRequestParams[k] = extraHttpRequestParams[k]; } @@ -269,9 +256,5 @@ module api { return this.$http(httpRequestParams); } - } - - angular.module('api_UserApi', ['$http']) - .service('UserApi', UserApi); } diff --git a/samples/client/petstore/typescript-angular/api/api.d.ts b/samples/client/petstore/typescript-angular/api.d.ts similarity index 100% rename from samples/client/petstore/typescript-angular/api/api.d.ts rename to samples/client/petstore/typescript-angular/api.d.ts