diff --git a/modules/swagger-codegen/src/main/resources/Javascript-Closure-Angular/api.mustache b/modules/swagger-codegen/src/main/resources/Javascript-Closure-Angular/api.mustache index 957add6753e..35604bf73df 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript-Closure-Angular/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript-Closure-Angular/api.mustache @@ -47,8 +47,8 @@ goog.require('{{import}}'); /** @private {!angular.$http} */ this.http_ = $http; - /** @private {!Object} */ - this.httpParamSerializer_ = $injector.get('$httpParamSerializer'); + /** @package {!Object} */ + this.httpParamSerializer = $injector.get('$httpParamSerializer'); } {{package}}.{{classname}}.$inject = ['$http', '$httpParamSerializer', '$injector']; {{#operation}} @@ -69,7 +69,7 @@ goog.require('{{import}}'); var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); {{#hasFormParams}} /** @type {!Object} */ var formParams = {}; @@ -108,7 +108,7 @@ goog.require('{{import}}'); json: {{#hasFormParams}}false{{/hasFormParams}}{{^hasFormParams}}true{{/hasFormParams}}, {{#bodyParam}}data: {{^required}}opt_{{/required}}{{paramName}}, {{/bodyParam}} - {{#hasFormParams}}data: this.httpParamSerializer_(formParams), + {{#hasFormParams}}data: this.httpParamSerializer(formParams), {{/hasFormParams}} params: queryParameters, headers: headerParams @@ -118,7 +118,7 @@ goog.require('{{import}}'); httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); } {{/operation}} {{/operations}} diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js b/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js index 5cf1c6d751d..39a22ebcdbe 100644 --- a/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js +++ b/samples/client/petstore/javascript-closure-angular/API/Client/PetApi.js @@ -3,9 +3,9 @@ * Do not edit this file by hand or your changes will be lost next time it is * generated. * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * Version: 1.0.0 - * Generated at: 2016-04-16T18:02:07.029+08:00 + * Generated at: 2016-04-28T06:15:51.482Z * Generated by: class io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen */ /** @@ -40,11 +40,50 @@ API.Client.PetApi = function($http, $httpParamSerializer, $injector) { /** @private {!angular.$http} */ this.http_ = $http; - /** @private {!Object} */ - this.httpParamSerializer_ = $injector.get('$httpParamSerializer'); + /** @package {!Object} */ + this.httpParamSerializer = $injector.get('$httpParamSerializer'); } API.Client.PetApi.$inject = ['$http', '$httpParamSerializer', '$injector']; +/** + * Update an existing pet + * + * @param {!Pet} body Pet object that needs to be added to the store + * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. + * @return {!angular.$q.Promise} + */ +API.Client.PetApi.prototype.updatePet = function(body, opt_extraHttpRequestParams) { + /** @const {string} */ + var path = this.basePath_ + '/pet'; + + /** @type {!Object} */ + var queryParameters = {}; + + /** @type {!Object} */ + var headerParams = angular.extend({}, this.defaultHeaders_); + // verify required parameter 'body' is set + if (!body) { + throw new Error('Missing required parameter body when calling updatePet'); + } + /** @type {!Object} */ + var httpRequestParams = { + method: 'PUT', + url: path, + json: true, + data: body, + + + params: queryParameters, + headers: headerParams + }; + + if (opt_extraHttpRequestParams) { + httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); + } + + return (/** @type {?} */ (this.http_))(httpRequestParams); +} + /** * Add a new pet to the store * @@ -60,7 +99,7 @@ API.Client.PetApi.prototype.addPet = function(body, opt_extraHttpRequestParams) var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); // verify required parameter 'body' is set if (!body) { throw new Error('Missing required parameter body when calling addPet'); @@ -71,7 +110,9 @@ API.Client.PetApi.prototype.addPet = function(body, opt_extraHttpRequestParams) url: path, json: true, data: body, - params: queryParameters, + + + params: queryParameters, headers: headerParams }; @@ -79,47 +120,7 @@ API.Client.PetApi.prototype.addPet = function(body, opt_extraHttpRequestParams) httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); -} - -/** - * Deletes a pet - * - * @param {!number} petId Pet id to delete - * @param {!string=} opt_apiKey - * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. - * @return {!angular.$q.Promise} - */ -API.Client.PetApi.prototype.deletePet = function(petId, opt_apiKey, opt_extraHttpRequestParams) { - /** @const {string} */ - var path = this.basePath_ + '/pet/{petId}' - .replace('{' + 'petId' + '}', String(petId)); - - /** @type {!Object} */ - var queryParameters = {}; - - /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); - // verify required parameter 'petId' is set - if (!petId) { - throw new Error('Missing required parameter petId when calling deletePet'); - } - headerParams['api_key'] = opt_apiKey; - - /** @type {!Object} */ - var httpRequestParams = { - method: 'DELETE', - url: path, - json: true, - params: queryParameters, - headers: headerParams - }; - - if (opt_extraHttpRequestParams) { - httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); - } - - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); } /** @@ -137,7 +138,7 @@ API.Client.PetApi.prototype.findPetsByStatus = function(status, opt_extraHttpReq var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); // verify required parameter 'status' is set if (!status) { throw new Error('Missing required parameter status when calling findPetsByStatus'); @@ -151,7 +152,9 @@ API.Client.PetApi.prototype.findPetsByStatus = function(status, opt_extraHttpReq method: 'GET', url: path, json: true, - params: queryParameters, + + + params: queryParameters, headers: headerParams }; @@ -159,7 +162,7 @@ API.Client.PetApi.prototype.findPetsByStatus = function(status, opt_extraHttpReq httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); } /** @@ -177,7 +180,7 @@ API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_extraHttpRequest var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); // verify required parameter 'tags' is set if (!tags) { throw new Error('Missing required parameter tags when calling findPetsByTags'); @@ -191,7 +194,9 @@ API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_extraHttpRequest method: 'GET', url: path, json: true, - params: queryParameters, + + + params: queryParameters, headers: headerParams }; @@ -199,7 +204,7 @@ API.Client.PetApi.prototype.findPetsByTags = function(tags, opt_extraHttpRequest httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); } /** @@ -218,7 +223,7 @@ API.Client.PetApi.prototype.getPetById = function(petId, opt_extraHttpRequestPar var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); // verify required parameter 'petId' is set if (!petId) { throw new Error('Missing required parameter petId when calling getPetById'); @@ -228,7 +233,9 @@ API.Client.PetApi.prototype.getPetById = function(petId, opt_extraHttpRequestPar method: 'GET', url: path, json: true, - params: queryParameters, + + + params: queryParameters, headers: headerParams }; @@ -236,44 +243,7 @@ API.Client.PetApi.prototype.getPetById = function(petId, opt_extraHttpRequestPar httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); -} - -/** - * Update an existing pet - * - * @param {!Pet} body Pet object that needs to be added to the store - * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. - * @return {!angular.$q.Promise} - */ -API.Client.PetApi.prototype.updatePet = function(body, opt_extraHttpRequestParams) { - /** @const {string} */ - var path = this.basePath_ + '/pet'; - - /** @type {!Object} */ - var queryParameters = {}; - - /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); - // verify required parameter 'body' is set - if (!body) { - throw new Error('Missing required parameter body when calling updatePet'); - } - /** @type {!Object} */ - var httpRequestParams = { - method: 'PUT', - url: path, - json: true, - data: body, - params: queryParameters, - headers: headerParams - }; - - if (opt_extraHttpRequestParams) { - httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); - } - - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); } /** @@ -294,7 +264,7 @@ API.Client.PetApi.prototype.updatePetWithForm = function(petId, opt_name, opt_st var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); /** @type {!Object} */ var formParams = {}; @@ -313,7 +283,9 @@ API.Client.PetApi.prototype.updatePetWithForm = function(petId, opt_name, opt_st method: 'POST', url: path, json: false, - data: this.httpParamSerializer_(formParams), + + data: this.httpParamSerializer(formParams), + params: queryParameters, headers: headerParams }; @@ -322,7 +294,49 @@ API.Client.PetApi.prototype.updatePetWithForm = function(petId, opt_name, opt_st httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); +} + +/** + * Deletes a pet + * + * @param {!number} petId Pet id to delete + * @param {!string=} opt_apiKey + * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. + * @return {!angular.$q.Promise} + */ +API.Client.PetApi.prototype.deletePet = function(petId, opt_apiKey, opt_extraHttpRequestParams) { + /** @const {string} */ + var path = this.basePath_ + '/pet/{petId}' + .replace('{' + 'petId' + '}', String(petId)); + + /** @type {!Object} */ + var queryParameters = {}; + + /** @type {!Object} */ + var headerParams = angular.extend({}, this.defaultHeaders_); + // verify required parameter 'petId' is set + if (!petId) { + throw new Error('Missing required parameter petId when calling deletePet'); + } + headerParams['api_key'] = opt_apiKey; + + /** @type {!Object} */ + var httpRequestParams = { + method: 'DELETE', + url: path, + json: true, + + + params: queryParameters, + headers: headerParams + }; + + if (opt_extraHttpRequestParams) { + httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); + } + + return (/** @type {?} */ (this.http_))(httpRequestParams); } /** @@ -343,7 +357,7 @@ API.Client.PetApi.prototype.uploadFile = function(petId, opt_additionalMetadata, var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); /** @type {!Object} */ var formParams = {}; @@ -362,7 +376,9 @@ API.Client.PetApi.prototype.uploadFile = function(petId, opt_additionalMetadata, method: 'POST', url: path, json: false, - data: this.httpParamSerializer_(formParams), + + data: this.httpParamSerializer(formParams), + params: queryParameters, headers: headerParams }; @@ -371,5 +387,5 @@ API.Client.PetApi.prototype.uploadFile = function(petId, opt_additionalMetadata, httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); } diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js b/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js index e6c1216099a..9e18eceefcc 100644 --- a/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js +++ b/samples/client/petstore/javascript-closure-angular/API/Client/StoreApi.js @@ -3,9 +3,9 @@ * Do not edit this file by hand or your changes will be lost next time it is * generated. * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * Version: 1.0.0 - * Generated at: 2016-04-16T18:02:07.029+08:00 + * Generated at: 2016-04-28T06:15:51.482Z * Generated by: class io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen */ /** @@ -39,48 +39,11 @@ API.Client.StoreApi = function($http, $httpParamSerializer, $injector) { /** @private {!angular.$http} */ this.http_ = $http; - /** @private {!Object} */ - this.httpParamSerializer_ = $injector.get('$httpParamSerializer'); + /** @package {!Object} */ + this.httpParamSerializer = $injector.get('$httpParamSerializer'); } API.Client.StoreApi.$inject = ['$http', '$httpParamSerializer', '$injector']; -/** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param {!string} orderId ID of the order that needs to be deleted - * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. - * @return {!angular.$q.Promise} - */ -API.Client.StoreApi.prototype.deleteOrder = function(orderId, opt_extraHttpRequestParams) { - /** @const {string} */ - var path = this.basePath_ + '/store/order/{orderId}' - .replace('{' + 'orderId' + '}', String(orderId)); - - /** @type {!Object} */ - var queryParameters = {}; - - /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); - // verify required parameter 'orderId' is set - if (!orderId) { - throw new Error('Missing required parameter orderId when calling deleteOrder'); - } - /** @type {!Object} */ - var httpRequestParams = { - method: 'DELETE', - url: path, - json: true, - params: queryParameters, - headers: headerParams - }; - - if (opt_extraHttpRequestParams) { - httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); - } - - return this.http_(httpRequestParams); -} - /** * Returns pet inventories by status * Returns a map of status codes to quantities @@ -95,13 +58,15 @@ API.Client.StoreApi.prototype.getInventory = function(opt_extraHttpRequestParams var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); /** @type {!Object} */ var httpRequestParams = { method: 'GET', url: path, json: true, - params: queryParameters, + + + params: queryParameters, headers: headerParams }; @@ -109,44 +74,7 @@ API.Client.StoreApi.prototype.getInventory = function(opt_extraHttpRequestParams httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - 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 {!number} orderId ID of pet that needs to be fetched - * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. - * @return {!angular.$q.Promise} - */ -API.Client.StoreApi.prototype.getOrderById = function(orderId, opt_extraHttpRequestParams) { - /** @const {string} */ - var path = this.basePath_ + '/store/order/{orderId}' - .replace('{' + 'orderId' + '}', String(orderId)); - - /** @type {!Object} */ - var queryParameters = {}; - - /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); - // verify required parameter 'orderId' is set - if (!orderId) { - throw new Error('Missing required parameter orderId when calling getOrderById'); - } - /** @type {!Object} */ - var httpRequestParams = { - method: 'GET', - url: path, - json: true, - params: queryParameters, - headers: headerParams - }; - - if (opt_extraHttpRequestParams) { - httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); - } - - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); } /** @@ -164,7 +92,7 @@ API.Client.StoreApi.prototype.placeOrder = function(body, opt_extraHttpRequestPa var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); // verify required parameter 'body' is set if (!body) { throw new Error('Missing required parameter body when calling placeOrder'); @@ -175,7 +103,9 @@ API.Client.StoreApi.prototype.placeOrder = function(body, opt_extraHttpRequestPa url: path, json: true, data: body, - params: queryParameters, + + + params: queryParameters, headers: headerParams }; @@ -183,5 +113,83 @@ API.Client.StoreApi.prototype.placeOrder = function(body, opt_extraHttpRequestPa httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); + return (/** @type {?} */ (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 {!number} orderId ID of pet that needs to be fetched + * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. + * @return {!angular.$q.Promise} + */ +API.Client.StoreApi.prototype.getOrderById = function(orderId, opt_extraHttpRequestParams) { + /** @const {string} */ + var path = this.basePath_ + '/store/order/{orderId}' + .replace('{' + 'orderId' + '}', String(orderId)); + + /** @type {!Object} */ + var queryParameters = {}; + + /** @type {!Object} */ + var headerParams = angular.extend({}, this.defaultHeaders_); + // verify required parameter 'orderId' is set + if (!orderId) { + throw new Error('Missing required parameter orderId when calling getOrderById'); + } + /** @type {!Object} */ + var httpRequestParams = { + method: 'GET', + url: path, + json: true, + + + params: queryParameters, + headers: headerParams + }; + + if (opt_extraHttpRequestParams) { + httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); + } + + return (/** @type {?} */ (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 {!string} orderId ID of the order that needs to be deleted + * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. + * @return {!angular.$q.Promise} + */ +API.Client.StoreApi.prototype.deleteOrder = function(orderId, opt_extraHttpRequestParams) { + /** @const {string} */ + var path = this.basePath_ + '/store/order/{orderId}' + .replace('{' + 'orderId' + '}', String(orderId)); + + /** @type {!Object} */ + var queryParameters = {}; + + /** @type {!Object} */ + var headerParams = angular.extend({}, this.defaultHeaders_); + // verify required parameter 'orderId' is set + if (!orderId) { + throw new Error('Missing required parameter orderId when calling deleteOrder'); + } + /** @type {!Object} */ + var httpRequestParams = { + method: 'DELETE', + url: path, + json: true, + + + params: queryParameters, + headers: headerParams + }; + + if (opt_extraHttpRequestParams) { + httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); + } + + return (/** @type {?} */ (this.http_))(httpRequestParams); } diff --git a/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js b/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js index 97b524c9d8a..733f7d65f5a 100644 --- a/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js +++ b/samples/client/petstore/javascript-closure-angular/API/Client/UserApi.js @@ -3,9 +3,9 @@ * Do not edit this file by hand or your changes will be lost next time it is * generated. * - * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. * Version: 1.0.0 - * Generated at: 2016-04-16T18:02:07.029+08:00 + * Generated at: 2016-04-28T06:15:51.482Z * Generated by: class io.swagger.codegen.languages.JavascriptClosureAngularClientCodegen */ /** @@ -39,8 +39,8 @@ API.Client.UserApi = function($http, $httpParamSerializer, $injector) { /** @private {!angular.$http} */ this.http_ = $http; - /** @private {!Object} */ - this.httpParamSerializer_ = $injector.get('$httpParamSerializer'); + /** @package {!Object} */ + this.httpParamSerializer = $injector.get('$httpParamSerializer'); } API.Client.UserApi.$inject = ['$http', '$httpParamSerializer', '$injector']; @@ -59,7 +59,7 @@ API.Client.UserApi.prototype.createUser = function(body, opt_extraHttpRequestPar var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); // verify required parameter 'body' is set if (!body) { throw new Error('Missing required parameter body when calling createUser'); @@ -70,7 +70,9 @@ API.Client.UserApi.prototype.createUser = function(body, opt_extraHttpRequestPar url: path, json: true, data: body, - params: queryParameters, + + + params: queryParameters, headers: headerParams }; @@ -78,7 +80,7 @@ API.Client.UserApi.prototype.createUser = function(body, opt_extraHttpRequestPar httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); } /** @@ -96,7 +98,7 @@ API.Client.UserApi.prototype.createUsersWithArrayInput = function(body, opt_extr var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); // verify required parameter 'body' is set if (!body) { throw new Error('Missing required parameter body when calling createUsersWithArrayInput'); @@ -107,7 +109,9 @@ API.Client.UserApi.prototype.createUsersWithArrayInput = function(body, opt_extr url: path, json: true, data: body, - params: queryParameters, + + + params: queryParameters, headers: headerParams }; @@ -115,7 +119,7 @@ API.Client.UserApi.prototype.createUsersWithArrayInput = function(body, opt_extr httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); } /** @@ -133,7 +137,7 @@ API.Client.UserApi.prototype.createUsersWithListInput = function(body, opt_extra var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); // verify required parameter 'body' is set if (!body) { throw new Error('Missing required parameter body when calling createUsersWithListInput'); @@ -144,7 +148,9 @@ API.Client.UserApi.prototype.createUsersWithListInput = function(body, opt_extra url: path, json: true, data: body, - params: queryParameters, + + + params: queryParameters, headers: headerParams }; @@ -152,81 +158,7 @@ API.Client.UserApi.prototype.createUsersWithListInput = function(body, opt_extra httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); -} - -/** - * Delete user - * This can only be done by the logged in user. - * @param {!string} username The name that needs to be deleted - * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. - * @return {!angular.$q.Promise} - */ -API.Client.UserApi.prototype.deleteUser = function(username, opt_extraHttpRequestParams) { - /** @const {string} */ - var path = this.basePath_ + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); - - /** @type {!Object} */ - var queryParameters = {}; - - /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); - // verify required parameter 'username' is set - if (!username) { - throw new Error('Missing required parameter username when calling deleteUser'); - } - /** @type {!Object} */ - var httpRequestParams = { - method: 'DELETE', - url: path, - json: true, - params: queryParameters, - headers: headerParams - }; - - if (opt_extraHttpRequestParams) { - httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); - } - - return this.http_(httpRequestParams); -} - -/** - * Get user by user name - * - * @param {!string} username The name that needs to be fetched. Use user1 for testing. - * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. - * @return {!angular.$q.Promise} - */ -API.Client.UserApi.prototype.getUserByName = function(username, opt_extraHttpRequestParams) { - /** @const {string} */ - var path = this.basePath_ + '/user/{username}' - .replace('{' + 'username' + '}', String(username)); - - /** @type {!Object} */ - var queryParameters = {}; - - /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); - // verify required parameter 'username' is set - if (!username) { - throw new Error('Missing required parameter username when calling getUserByName'); - } - /** @type {!Object} */ - var httpRequestParams = { - method: 'GET', - url: path, - json: true, - params: queryParameters, - headers: headerParams - }; - - if (opt_extraHttpRequestParams) { - httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); - } - - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); } /** @@ -245,7 +177,7 @@ API.Client.UserApi.prototype.loginUser = function(username, password, opt_extraH var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); // verify required parameter 'username' is set if (!username) { throw new Error('Missing required parameter username when calling loginUser'); @@ -267,7 +199,9 @@ API.Client.UserApi.prototype.loginUser = function(username, password, opt_extraH method: 'GET', url: path, json: true, - params: queryParameters, + + + params: queryParameters, headers: headerParams }; @@ -275,7 +209,7 @@ API.Client.UserApi.prototype.loginUser = function(username, password, opt_extraH httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); } /** @@ -292,13 +226,15 @@ API.Client.UserApi.prototype.logoutUser = function(opt_extraHttpRequestParams) { var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); /** @type {!Object} */ var httpRequestParams = { method: 'GET', url: path, json: true, - params: queryParameters, + + + params: queryParameters, headers: headerParams }; @@ -306,7 +242,46 @@ API.Client.UserApi.prototype.logoutUser = function(opt_extraHttpRequestParams) { httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); +} + +/** + * Get user by user name + * + * @param {!string} username The name that needs to be fetched. Use user1 for testing. + * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. + * @return {!angular.$q.Promise} + */ +API.Client.UserApi.prototype.getUserByName = function(username, opt_extraHttpRequestParams) { + /** @const {string} */ + var path = this.basePath_ + '/user/{username}' + .replace('{' + 'username' + '}', String(username)); + + /** @type {!Object} */ + var queryParameters = {}; + + /** @type {!Object} */ + var headerParams = angular.extend({}, this.defaultHeaders_); + // verify required parameter 'username' is set + if (!username) { + throw new Error('Missing required parameter username when calling getUserByName'); + } + /** @type {!Object} */ + var httpRequestParams = { + method: 'GET', + url: path, + json: true, + + + params: queryParameters, + headers: headerParams + }; + + if (opt_extraHttpRequestParams) { + httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); + } + + return (/** @type {?} */ (this.http_))(httpRequestParams); } /** @@ -326,7 +301,7 @@ API.Client.UserApi.prototype.updateUser = function(username, body, opt_extraHttp var queryParameters = {}; /** @type {!Object} */ - var headerParams = angular.extend({}, this.defaultHeaders); + var headerParams = angular.extend({}, this.defaultHeaders_); // verify required parameter 'username' is set if (!username) { throw new Error('Missing required parameter username when calling updateUser'); @@ -341,7 +316,9 @@ API.Client.UserApi.prototype.updateUser = function(username, body, opt_extraHttp url: path, json: true, data: body, - params: queryParameters, + + + params: queryParameters, headers: headerParams }; @@ -349,5 +326,44 @@ API.Client.UserApi.prototype.updateUser = function(username, body, opt_extraHttp httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); } - return this.http_(httpRequestParams); + return (/** @type {?} */ (this.http_))(httpRequestParams); +} + +/** + * Delete user + * This can only be done by the logged in user. + * @param {!string} username The name that needs to be deleted + * @param {!angular.$http.Config=} opt_extraHttpRequestParams Extra HTTP parameters to send. + * @return {!angular.$q.Promise} + */ +API.Client.UserApi.prototype.deleteUser = function(username, opt_extraHttpRequestParams) { + /** @const {string} */ + var path = this.basePath_ + '/user/{username}' + .replace('{' + 'username' + '}', String(username)); + + /** @type {!Object} */ + var queryParameters = {}; + + /** @type {!Object} */ + var headerParams = angular.extend({}, this.defaultHeaders_); + // verify required parameter 'username' is set + if (!username) { + throw new Error('Missing required parameter username when calling deleteUser'); + } + /** @type {!Object} */ + var httpRequestParams = { + method: 'DELETE', + url: path, + json: true, + + + params: queryParameters, + headers: headerParams + }; + + if (opt_extraHttpRequestParams) { + httpRequestParams = angular.extend(httpRequestParams, opt_extraHttpRequestParams); + } + + return (/** @type {?} */ (this.http_))(httpRequestParams); }