update js es6 samples

This commit is contained in:
wing328
2017-06-19 01:21:22 +08:00
parent 6fef7acf9f
commit 3ad576a53d
94 changed files with 7631 additions and 7833 deletions

View File

@@ -7,45 +7,35 @@
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.2.3-SNAPSHOT
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Client', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterNumber', 'model/OuterString'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('../model/Client'), require('../model/OuterBoolean'), require('../model/OuterComposite'), require('../model/OuterNumber'), require('../model/OuterString'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
import ApiClient from "../ApiClient";
import Client from '../model/Client';
import OuterBoolean from '../model/OuterBoolean';
import OuterComposite from '../model/OuterComposite';
import OuterNumber from '../model/OuterNumber';
import OuterString from '../model/OuterString';
/**
* Fake service.
* @module api/FakeApi
* @version 1.0.0
*/
export default class FakeApi {
/**
* Constructs a new FakeApi.
* @alias module:api/FakeApi
* @class
* @param {module:ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
constructor(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
}
root.SwaggerPetstore.FakeApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client, root.SwaggerPetstore.OuterBoolean, root.SwaggerPetstore.OuterComposite, root.SwaggerPetstore.OuterNumber, root.SwaggerPetstore.OuterString);
}
}(this, function(ApiClient, Client, OuterBoolean, OuterComposite, OuterNumber, OuterString) {
'use strict';
/**
* Fake service.
* @module api/FakeApi
* @version 1.0.0
*/
/**
* Constructs a new FakeApi.
* @alias module:api/FakeApi
* @class
* @param {module:ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
/**
@@ -63,24 +53,24 @@
* @param {module:api/FakeApi~fakeOuterBooleanSerializeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/OuterBoolean}
*/
this.fakeOuterBooleanSerialize = function(opts, callback) {
fakeOuterBooleanSerialize(opts, callback) {
opts = opts || {};
var postBody = opts['body'];
let postBody = opts['body'];
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = [];
var returnType = OuterBoolean;
let authNames = [];
let contentTypes = [];
let accepts = [];
let returnType = OuterBoolean;
return this.apiClient.callApi(
'/fake/outer/boolean', 'POST',
@@ -104,24 +94,24 @@
* @param {module:api/FakeApi~fakeOuterCompositeSerializeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/OuterComposite}
*/
this.fakeOuterCompositeSerialize = function(opts, callback) {
fakeOuterCompositeSerialize(opts, callback) {
opts = opts || {};
var postBody = opts['body'];
let postBody = opts['body'];
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = [];
var returnType = OuterComposite;
let authNames = [];
let contentTypes = [];
let accepts = [];
let returnType = OuterComposite;
return this.apiClient.callApi(
'/fake/outer/composite', 'POST',
@@ -145,24 +135,24 @@
* @param {module:api/FakeApi~fakeOuterNumberSerializeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/OuterNumber}
*/
this.fakeOuterNumberSerialize = function(opts, callback) {
fakeOuterNumberSerialize(opts, callback) {
opts = opts || {};
var postBody = opts['body'];
let postBody = opts['body'];
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = [];
var returnType = OuterNumber;
let authNames = [];
let contentTypes = [];
let accepts = [];
let returnType = OuterNumber;
return this.apiClient.callApi(
'/fake/outer/number', 'POST',
@@ -186,24 +176,24 @@
* @param {module:api/FakeApi~fakeOuterStringSerializeCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/OuterString}
*/
this.fakeOuterStringSerialize = function(opts, callback) {
fakeOuterStringSerialize(opts, callback) {
opts = opts || {};
var postBody = opts['body'];
let postBody = opts['body'];
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = [];
var returnType = OuterString;
let authNames = [];
let contentTypes = [];
let accepts = [];
let returnType = OuterString;
return this.apiClient.callApi(
'/fake/outer/string', 'POST',
@@ -227,8 +217,8 @@
* @param {module:api/FakeApi~testClientModelCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Client}
*/
this.testClientModel = function(body, callback) {
var postBody = body;
testClientModel(body, callback) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -236,19 +226,19 @@
}
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = ['application/json'];
var accepts = ['application/json'];
var returnType = Client;
let authNames = [];
let contentTypes = ['application/json'];
let accepts = ['application/json'];
let returnType = Client;
return this.apiClient.callApi(
'/fake', 'PATCH',
@@ -285,9 +275,9 @@
* @param {String} opts.callback None
* @param {module:api/FakeApi~testEndpointParametersCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.testEndpointParameters = function(_number, _double, patternWithoutDelimiter, _byte, opts, callback) {
testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts, callback) {
opts = opts || {};
var postBody = null;
let postBody = null;
// verify the required parameter '_number' is set
if (_number === undefined || _number === null) {
@@ -310,13 +300,13 @@
}
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
'integer': opts['integer'],
'int32': opts['int32'],
'int64': opts['int64'],
@@ -333,10 +323,10 @@
'callback': opts['callback']
};
var authNames = ['http_basic_test'];
var contentTypes = ['application/xml; charset=utf-8', 'application/json; charset=utf-8'];
var accepts = ['application/xml; charset=utf-8', 'application/json; charset=utf-8'];
var returnType = null;
let authNames = ['http_basic_test'];
let contentTypes = ['application/xml; charset=utf-8', 'application/json; charset=utf-8'];
let accepts = ['application/xml; charset=utf-8', 'application/json; charset=utf-8'];
let returnType = null;
return this.apiClient.callApi(
'/fake', 'POST',
@@ -367,32 +357,32 @@
* @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double)
* @param {module:api/FakeApi~testEnumParametersCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.testEnumParameters = function(opts, callback) {
testEnumParameters(opts, callback) {
opts = opts || {};
var postBody = null;
let postBody = null;
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
'enum_query_string_array': this.apiClient.buildCollectionParam(opts['enumQueryStringArray'], 'csv'),
'enum_query_string': opts['enumQueryString'],
'enum_query_integer': opts['enumQueryInteger']
};
var headerParams = {
let headerParams = {
'enum_header_string_array': opts['enumHeaderStringArray'],
'enum_header_string': opts['enumHeaderString']
};
var formParams = {
let formParams = {
'enum_form_string_array': this.apiClient.buildCollectionParam(opts['enumFormStringArray'], 'csv'),
'enum_form_string': opts['enumFormString'],
'enum_query_double': opts['enumQueryDouble']
};
var authNames = [];
var contentTypes = ['*/*'];
var accepts = ['*/*'];
var returnType = null;
let authNames = [];
let contentTypes = ['*/*'];
let accepts = ['*/*'];
let returnType = null;
return this.apiClient.callApi(
'/fake', 'GET',
@@ -400,7 +390,6 @@
authNames, contentTypes, accepts, returnType, callback
);
}
};
return exports;
}));
}

View File

@@ -7,45 +7,32 @@
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.2.3-SNAPSHOT
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/ApiResponse', 'model/Pet'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('../model/ApiResponse'), require('../model/Pet'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
import ApiClient from "../ApiClient";
import ApiResponse from '../model/ApiResponse';
import Pet from '../model/Pet';
/**
* Pet service.
* @module api/PetApi
* @version 1.0.0
*/
export default class PetApi {
/**
* Constructs a new PetApi.
* @alias module:api/PetApi
* @class
* @param {module:ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
constructor(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
}
root.SwaggerPetstore.PetApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.ApiResponse, root.SwaggerPetstore.Pet);
}
}(this, function(ApiClient, ApiResponse, Pet) {
'use strict';
/**
* Pet service.
* @module api/PetApi
* @version 1.0.0
*/
/**
* Constructs a new PetApi.
* @alias module:api/PetApi
* @class
* @param {module:ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
/**
@@ -62,8 +49,8 @@
* @param {module:model/Pet} body Pet object that needs to be added to the store
* @param {module:api/PetApi~addPetCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.addPet = function(body, callback) {
var postBody = body;
addPet(body, callback) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -71,19 +58,19 @@
}
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = ['petstore_auth'];
var contentTypes = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
let authNames = ['petstore_auth'];
let contentTypes = ['application/json', 'application/xml'];
let accepts = ['application/xml', 'application/json'];
let returnType = null;
return this.apiClient.callApi(
'/pet', 'POST',
@@ -108,9 +95,9 @@
* @param {String} opts.apiKey
* @param {module:api/PetApi~deletePetCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.deletePet = function(petId, opts, callback) {
deletePet(petId, opts, callback) {
opts = opts || {};
var postBody = null;
let postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
@@ -118,21 +105,21 @@
}
var pathParams = {
let pathParams = {
'petId': petId
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
'api_key': opts['apiKey']
};
var formParams = {
let formParams = {
};
var authNames = ['petstore_auth'];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
let authNames = ['petstore_auth'];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = null;
return this.apiClient.callApi(
'/pet/{petId}', 'DELETE',
@@ -156,8 +143,8 @@
* @param {module:api/PetApi~findPetsByStatusCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Array.<module:model/Pet>}
*/
this.findPetsByStatus = function(status, callback) {
var postBody = null;
findPetsByStatus(status, callback) {
let postBody = null;
// verify the required parameter 'status' is set
if (status === undefined || status === null) {
@@ -165,20 +152,20 @@
}
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
'status': this.apiClient.buildCollectionParam(status, 'csv')
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = ['petstore_auth'];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = [Pet];
let authNames = ['petstore_auth'];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = [Pet];
return this.apiClient.callApi(
'/pet/findByStatus', 'GET',
@@ -202,8 +189,8 @@
* @param {module:api/PetApi~findPetsByTagsCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Array.<module:model/Pet>}
*/
this.findPetsByTags = function(tags, callback) {
var postBody = null;
findPetsByTags(tags, callback) {
let postBody = null;
// verify the required parameter 'tags' is set
if (tags === undefined || tags === null) {
@@ -211,20 +198,20 @@
}
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
'tags': this.apiClient.buildCollectionParam(tags, 'csv')
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = ['petstore_auth'];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = [Pet];
let authNames = ['petstore_auth'];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = [Pet];
return this.apiClient.callApi(
'/pet/findByTags', 'GET',
@@ -248,8 +235,8 @@
* @param {module:api/PetApi~getPetByIdCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Pet}
*/
this.getPetById = function(petId, callback) {
var postBody = null;
getPetById(petId, callback) {
let postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
@@ -257,20 +244,20 @@
}
var pathParams = {
let pathParams = {
'petId': petId
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = Pet;
let authNames = ['api_key'];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = Pet;
return this.apiClient.callApi(
'/pet/{petId}', 'GET',
@@ -293,8 +280,8 @@
* @param {module:model/Pet} body Pet object that needs to be added to the store
* @param {module:api/PetApi~updatePetCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.updatePet = function(body, callback) {
var postBody = body;
updatePet(body, callback) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -302,19 +289,19 @@
}
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = ['petstore_auth'];
var contentTypes = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
let authNames = ['petstore_auth'];
let contentTypes = ['application/json', 'application/xml'];
let accepts = ['application/xml', 'application/json'];
let returnType = null;
return this.apiClient.callApi(
'/pet', 'PUT',
@@ -340,9 +327,9 @@
* @param {String} opts.status Updated status of the pet
* @param {module:api/PetApi~updatePetWithFormCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.updatePetWithForm = function(petId, opts, callback) {
updatePetWithForm(petId, opts, callback) {
opts = opts || {};
var postBody = null;
let postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
@@ -350,22 +337,22 @@
}
var pathParams = {
let pathParams = {
'petId': petId
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
'name': opts['name'],
'status': opts['status']
};
var authNames = ['petstore_auth'];
var contentTypes = ['application/x-www-form-urlencoded'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
let authNames = ['petstore_auth'];
let contentTypes = ['application/x-www-form-urlencoded'];
let accepts = ['application/xml', 'application/json'];
let returnType = null;
return this.apiClient.callApi(
'/pet/{petId}', 'POST',
@@ -392,9 +379,9 @@
* @param {module:api/PetApi~uploadFileCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/ApiResponse}
*/
this.uploadFile = function(petId, opts, callback) {
uploadFile(petId, opts, callback) {
opts = opts || {};
var postBody = null;
let postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
@@ -402,22 +389,22 @@
}
var pathParams = {
let pathParams = {
'petId': petId
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
'additionalMetadata': opts['additionalMetadata'],
'file': opts['file']
};
var authNames = ['petstore_auth'];
var contentTypes = ['multipart/form-data'];
var accepts = ['application/json'];
var returnType = ApiResponse;
let authNames = ['petstore_auth'];
let contentTypes = ['multipart/form-data'];
let accepts = ['application/json'];
let returnType = ApiResponse;
return this.apiClient.callApi(
'/pet/{petId}/uploadImage', 'POST',
@@ -425,7 +412,6 @@
authNames, contentTypes, accepts, returnType, callback
);
}
};
return exports;
}));
}

View File

@@ -7,45 +7,31 @@
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.2.3-SNAPSHOT
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Order'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('../model/Order'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
import ApiClient from "../ApiClient";
import Order from '../model/Order';
/**
* Store service.
* @module api/StoreApi
* @version 1.0.0
*/
export default class StoreApi {
/**
* Constructs a new StoreApi.
* @alias module:api/StoreApi
* @class
* @param {module:ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
constructor(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
}
root.SwaggerPetstore.StoreApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Order);
}
}(this, function(ApiClient, Order) {
'use strict';
/**
* Store service.
* @module api/StoreApi
* @version 1.0.0
*/
/**
* Constructs a new StoreApi.
* @alias module:api/StoreApi
* @class
* @param {module:ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
/**
@@ -62,8 +48,8 @@
* @param {String} orderId ID of the order that needs to be deleted
* @param {module:api/StoreApi~deleteOrderCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.deleteOrder = function(orderId, callback) {
var postBody = null;
deleteOrder(orderId, callback) {
let postBody = null;
// verify the required parameter 'orderId' is set
if (orderId === undefined || orderId === null) {
@@ -71,20 +57,20 @@
}
var pathParams = {
let pathParams = {
'order_id': orderId
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = null;
return this.apiClient.callApi(
'/store/order/{order_id}', 'DELETE',
@@ -107,23 +93,23 @@
* @param {module:api/StoreApi~getInventoryCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Object.<String, {'String': 'Number'}>}
*/
this.getInventory = function(callback) {
var postBody = null;
getInventory(callback) {
let postBody = null;
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = {'String': 'Number'};
let authNames = ['api_key'];
let contentTypes = [];
let accepts = ['application/json'];
let returnType = {'String': 'Number'};
return this.apiClient.callApi(
'/store/inventory', 'GET',
@@ -147,8 +133,8 @@
* @param {module:api/StoreApi~getOrderByIdCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Order}
*/
this.getOrderById = function(orderId, callback) {
var postBody = null;
getOrderById(orderId, callback) {
let postBody = null;
// verify the required parameter 'orderId' is set
if (orderId === undefined || orderId === null) {
@@ -156,20 +142,20 @@
}
var pathParams = {
let pathParams = {
'order_id': orderId
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = Order;
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = Order;
return this.apiClient.callApi(
'/store/order/{order_id}', 'GET',
@@ -193,8 +179,8 @@
* @param {module:api/StoreApi~placeOrderCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Order}
*/
this.placeOrder = function(body, callback) {
var postBody = body;
placeOrder(body, callback) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -202,19 +188,19 @@
}
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = Order;
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = Order;
return this.apiClient.callApi(
'/store/order', 'POST',
@@ -222,7 +208,6 @@
authNames, contentTypes, accepts, returnType, callback
);
}
};
return exports;
}));
}

View File

@@ -7,45 +7,31 @@
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.2.3-SNAPSHOT
*
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/User'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('../model/User'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
import ApiClient from "../ApiClient";
import User from '../model/User';
/**
* User service.
* @module api/UserApi
* @version 1.0.0
*/
export default class UserApi {
/**
* Constructs a new UserApi.
* @alias module:api/UserApi
* @class
* @param {module:ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
constructor(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
}
root.SwaggerPetstore.UserApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.User);
}
}(this, function(ApiClient, User) {
'use strict';
/**
* User service.
* @module api/UserApi
* @version 1.0.0
*/
/**
* Constructs a new UserApi.
* @alias module:api/UserApi
* @class
* @param {module:ApiClient} apiClient Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
var exports = function(apiClient) {
this.apiClient = apiClient || ApiClient.instance;
/**
@@ -62,8 +48,8 @@
* @param {module:model/User} body Created user object
* @param {module:api/UserApi~createUserCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.createUser = function(body, callback) {
var postBody = body;
createUser(body, callback) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -71,19 +57,19 @@
}
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = null;
return this.apiClient.callApi(
'/user', 'POST',
@@ -106,8 +92,8 @@
* @param {Array.<module:model/User>} body List of user object
* @param {module:api/UserApi~createUsersWithArrayInputCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.createUsersWithArrayInput = function(body, callback) {
var postBody = body;
createUsersWithArrayInput(body, callback) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -115,19 +101,19 @@
}
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = null;
return this.apiClient.callApi(
'/user/createWithArray', 'POST',
@@ -150,8 +136,8 @@
* @param {Array.<module:model/User>} body List of user object
* @param {module:api/UserApi~createUsersWithListInputCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.createUsersWithListInput = function(body, callback) {
var postBody = body;
createUsersWithListInput(body, callback) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -159,19 +145,19 @@
}
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = null;
return this.apiClient.callApi(
'/user/createWithList', 'POST',
@@ -194,8 +180,8 @@
* @param {String} username The name that needs to be deleted
* @param {module:api/UserApi~deleteUserCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.deleteUser = function(username, callback) {
var postBody = null;
deleteUser(username, callback) {
let postBody = null;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
@@ -203,20 +189,20 @@
}
var pathParams = {
let pathParams = {
'username': username
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = null;
return this.apiClient.callApi(
'/user/{username}', 'DELETE',
@@ -240,8 +226,8 @@
* @param {module:api/UserApi~getUserByNameCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/User}
*/
this.getUserByName = function(username, callback) {
var postBody = null;
getUserByName(username, callback) {
let postBody = null;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
@@ -249,20 +235,20 @@
}
var pathParams = {
let pathParams = {
'username': username
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = User;
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = User;
return this.apiClient.callApi(
'/user/{username}', 'GET',
@@ -287,8 +273,8 @@
* @param {module:api/UserApi~loginUserCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link 'String'}
*/
this.loginUser = function(username, password, callback) {
var postBody = null;
loginUser(username, password, callback) {
let postBody = null;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
@@ -301,21 +287,21 @@
}
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
'username': username,
'password': password
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = 'String';
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = 'String';
return this.apiClient.callApi(
'/user/login', 'GET',
@@ -337,23 +323,23 @@
*
* @param {module:api/UserApi~logoutUserCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.logoutUser = function(callback) {
var postBody = null;
logoutUser(callback) {
let postBody = null;
var pathParams = {
let pathParams = {
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = null;
return this.apiClient.callApi(
'/user/logout', 'GET',
@@ -377,8 +363,8 @@
* @param {module:model/User} body Updated user object
* @param {module:api/UserApi~updateUserCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.updateUser = function(username, body, callback) {
var postBody = body;
updateUser(username, body, callback) {
let postBody = body;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
@@ -391,20 +377,20 @@
}
var pathParams = {
let pathParams = {
'username': username
};
var queryParams = {
let queryParams = {
};
var headerParams = {
let headerParams = {
};
var formParams = {
let formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
let authNames = [];
let contentTypes = [];
let accepts = ['application/xml', 'application/json'];
let returnType = null;
return this.apiClient.callApi(
'/user/{username}', 'PUT',
@@ -412,7 +398,6 @@
authNames, contentTypes, accepts, returnType, callback
);
}
};
return exports;
}));
}