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;
@@ -55,24 +45,24 @@
* @param {module:model/OuterBoolean} opts.body Input boolean as post body
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterBoolean} and HTTP response
*/
this.fakeOuterBooleanSerializeWithHttpInfo = function(opts) {
fakeOuterBooleanSerializeWithHttpInfo(opts) {
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',
@@ -87,7 +77,7 @@
* @param {module:model/OuterBoolean} opts.body Input boolean as post body
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OuterBoolean}
*/
this.fakeOuterBooleanSerialize = function(opts) {
fakeOuterBooleanSerialize(opts) {
return this.fakeOuterBooleanSerializeWithHttpInfo(opts)
.then(function(response_and_data) {
return response_and_data.data;
@@ -101,24 +91,24 @@
* @param {module:model/OuterComposite} opts.body Input composite as post body
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterComposite} and HTTP response
*/
this.fakeOuterCompositeSerializeWithHttpInfo = function(opts) {
fakeOuterCompositeSerializeWithHttpInfo(opts) {
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',
@@ -133,7 +123,7 @@
* @param {module:model/OuterComposite} opts.body Input composite as post body
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OuterComposite}
*/
this.fakeOuterCompositeSerialize = function(opts) {
fakeOuterCompositeSerialize(opts) {
return this.fakeOuterCompositeSerializeWithHttpInfo(opts)
.then(function(response_and_data) {
return response_and_data.data;
@@ -147,24 +137,24 @@
* @param {module:model/OuterNumber} opts.body Input number as post body
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterNumber} and HTTP response
*/
this.fakeOuterNumberSerializeWithHttpInfo = function(opts) {
fakeOuterNumberSerializeWithHttpInfo(opts) {
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',
@@ -179,7 +169,7 @@
* @param {module:model/OuterNumber} opts.body Input number as post body
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OuterNumber}
*/
this.fakeOuterNumberSerialize = function(opts) {
fakeOuterNumberSerialize(opts) {
return this.fakeOuterNumberSerializeWithHttpInfo(opts)
.then(function(response_and_data) {
return response_and_data.data;
@@ -193,24 +183,24 @@
* @param {module:model/OuterString} opts.body Input string as post body
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/OuterString} and HTTP response
*/
this.fakeOuterStringSerializeWithHttpInfo = function(opts) {
fakeOuterStringSerializeWithHttpInfo(opts) {
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',
@@ -225,7 +215,7 @@
* @param {module:model/OuterString} opts.body Input string as post body
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/OuterString}
*/
this.fakeOuterStringSerialize = function(opts) {
fakeOuterStringSerialize(opts) {
return this.fakeOuterStringSerializeWithHttpInfo(opts)
.then(function(response_and_data) {
return response_and_data.data;
@@ -239,8 +229,8 @@
* @param {module:model/Client} body client model
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Client} and HTTP response
*/
this.testClientModelWithHttpInfo = function(body) {
var postBody = body;
testClientModelWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -248,19 +238,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',
@@ -275,7 +265,7 @@
* @param {module:model/Client} body client model
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Client}
*/
this.testClientModel = function(body) {
testClientModel(body) {
return this.testClientModelWithHttpInfo(body)
.then(function(response_and_data) {
return response_and_data.data;
@@ -303,9 +293,9 @@
* @param {String} opts.callback None
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.testEndpointParametersWithHttpInfo = function(_number, _double, patternWithoutDelimiter, _byte, opts) {
testEndpointParametersWithHttpInfo(_number, _double, patternWithoutDelimiter, _byte, opts) {
opts = opts || {};
var postBody = null;
let postBody = null;
// verify the required parameter '_number' is set
if (_number === undefined || _number === null) {
@@ -328,13 +318,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'],
@@ -351,10 +341,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',
@@ -383,7 +373,7 @@
* @param {String} opts.callback None
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.testEndpointParameters = function(_number, _double, patternWithoutDelimiter, _byte, opts) {
testEndpointParameters(_number, _double, patternWithoutDelimiter, _byte, opts) {
return this.testEndpointParametersWithHttpInfo(_number, _double, patternWithoutDelimiter, _byte, opts)
.then(function(response_and_data) {
return response_and_data.data;
@@ -405,32 +395,32 @@
* @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double)
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.testEnumParametersWithHttpInfo = function(opts) {
testEnumParametersWithHttpInfo(opts) {
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',
@@ -453,13 +443,12 @@
* @param {module:model/Number} opts.enumQueryDouble Query parameter enum test (double)
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.testEnumParameters = function(opts) {
testEnumParameters(opts) {
return this.testEnumParametersWithHttpInfo(opts)
.then(function(response_and_data) {
return response_and_data.data;
});
}
};
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;
@@ -55,8 +42,8 @@
* @param {module:model/Pet} body Pet object that needs to be added to the store
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.addPetWithHttpInfo = function(body) {
var postBody = body;
addPetWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -64,19 +51,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',
@@ -91,7 +78,7 @@
* @param {module:model/Pet} body Pet object that needs to be added to the store
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.addPet = function(body) {
addPet(body) {
return this.addPetWithHttpInfo(body)
.then(function(response_and_data) {
return response_and_data.data;
@@ -107,9 +94,9 @@
* @param {String} opts.apiKey
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.deletePetWithHttpInfo = function(petId, opts) {
deletePetWithHttpInfo(petId, opts) {
opts = opts || {};
var postBody = null;
let postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
@@ -117,21 +104,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',
@@ -148,7 +135,7 @@
* @param {String} opts.apiKey
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.deletePet = function(petId, opts) {
deletePet(petId, opts) {
return this.deletePetWithHttpInfo(petId, opts)
.then(function(response_and_data) {
return response_and_data.data;
@@ -162,8 +149,8 @@
* @param {Array.<module:model/String>} status Status values that need to be considered for filter
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/Pet>} and HTTP response
*/
this.findPetsByStatusWithHttpInfo = function(status) {
var postBody = null;
findPetsByStatusWithHttpInfo(status) {
let postBody = null;
// verify the required parameter 'status' is set
if (status === undefined || status === null) {
@@ -171,20 +158,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',
@@ -199,7 +186,7 @@
* @param {Array.<module:model/String>} status Status values that need to be considered for filter
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/Pet>}
*/
this.findPetsByStatus = function(status) {
findPetsByStatus(status) {
return this.findPetsByStatusWithHttpInfo(status)
.then(function(response_and_data) {
return response_and_data.data;
@@ -213,8 +200,8 @@
* @param {Array.<String>} tags Tags to filter by
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Array.<module:model/Pet>} and HTTP response
*/
this.findPetsByTagsWithHttpInfo = function(tags) {
var postBody = null;
findPetsByTagsWithHttpInfo(tags) {
let postBody = null;
// verify the required parameter 'tags' is set
if (tags === undefined || tags === null) {
@@ -222,20 +209,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',
@@ -250,7 +237,7 @@
* @param {Array.<String>} tags Tags to filter by
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Array.<module:model/Pet>}
*/
this.findPetsByTags = function(tags) {
findPetsByTags(tags) {
return this.findPetsByTagsWithHttpInfo(tags)
.then(function(response_and_data) {
return response_and_data.data;
@@ -264,8 +251,8 @@
* @param {Number} petId ID of pet to return
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Pet} and HTTP response
*/
this.getPetByIdWithHttpInfo = function(petId) {
var postBody = null;
getPetByIdWithHttpInfo(petId) {
let postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
@@ -273,20 +260,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',
@@ -301,7 +288,7 @@
* @param {Number} petId ID of pet to return
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Pet}
*/
this.getPetById = function(petId) {
getPetById(petId) {
return this.getPetByIdWithHttpInfo(petId)
.then(function(response_and_data) {
return response_and_data.data;
@@ -315,8 +302,8 @@
* @param {module:model/Pet} body Pet object that needs to be added to the store
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.updatePetWithHttpInfo = function(body) {
var postBody = body;
updatePetWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -324,19 +311,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',
@@ -351,7 +338,7 @@
* @param {module:model/Pet} body Pet object that needs to be added to the store
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.updatePet = function(body) {
updatePet(body) {
return this.updatePetWithHttpInfo(body)
.then(function(response_and_data) {
return response_and_data.data;
@@ -368,9 +355,9 @@
* @param {String} opts.status Updated status of the pet
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.updatePetWithFormWithHttpInfo = function(petId, opts) {
updatePetWithFormWithHttpInfo(petId, opts) {
opts = opts || {};
var postBody = null;
let postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
@@ -378,22 +365,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',
@@ -411,7 +398,7 @@
* @param {String} opts.status Updated status of the pet
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.updatePetWithForm = function(petId, opts) {
updatePetWithForm(petId, opts) {
return this.updatePetWithFormWithHttpInfo(petId, opts)
.then(function(response_and_data) {
return response_and_data.data;
@@ -428,9 +415,9 @@
* @param {File} opts.file file to upload
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ApiResponse} and HTTP response
*/
this.uploadFileWithHttpInfo = function(petId, opts) {
uploadFileWithHttpInfo(petId, opts) {
opts = opts || {};
var postBody = null;
let postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
@@ -438,22 +425,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',
@@ -471,13 +458,12 @@
* @param {File} opts.file file to upload
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ApiResponse}
*/
this.uploadFile = function(petId, opts) {
uploadFile(petId, opts) {
return this.uploadFileWithHttpInfo(petId, opts)
.then(function(response_and_data) {
return response_and_data.data;
});
}
};
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;
@@ -55,8 +41,8 @@
* @param {String} orderId ID of the order that needs to be deleted
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.deleteOrderWithHttpInfo = function(orderId) {
var postBody = null;
deleteOrderWithHttpInfo(orderId) {
let postBody = null;
// verify the required parameter 'orderId' is set
if (orderId === undefined || orderId === null) {
@@ -64,20 +50,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',
@@ -92,7 +78,7 @@
* @param {String} orderId ID of the order that needs to be deleted
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.deleteOrder = function(orderId) {
deleteOrder(orderId) {
return this.deleteOrderWithHttpInfo(orderId)
.then(function(response_and_data) {
return response_and_data.data;
@@ -105,23 +91,23 @@
* Returns a map of status codes to quantities
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link Object.<String, {'String': 'Number'}>} and HTTP response
*/
this.getInventoryWithHttpInfo = function() {
var postBody = null;
getInventoryWithHttpInfo() {
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',
@@ -135,7 +121,7 @@
* Returns a map of status codes to quantities
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link Object.<String, {'String': 'Number'}>}
*/
this.getInventory = function() {
getInventory() {
return this.getInventoryWithHttpInfo()
.then(function(response_and_data) {
return response_and_data.data;
@@ -149,8 +135,8 @@
* @param {Number} orderId ID of pet that needs to be fetched
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response
*/
this.getOrderByIdWithHttpInfo = function(orderId) {
var postBody = null;
getOrderByIdWithHttpInfo(orderId) {
let postBody = null;
// verify the required parameter 'orderId' is set
if (orderId === undefined || orderId === null) {
@@ -158,20 +144,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',
@@ -186,7 +172,7 @@
* @param {Number} orderId ID of pet that needs to be fetched
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order}
*/
this.getOrderById = function(orderId) {
getOrderById(orderId) {
return this.getOrderByIdWithHttpInfo(orderId)
.then(function(response_and_data) {
return response_and_data.data;
@@ -200,8 +186,8 @@
* @param {module:model/Order} body order placed for purchasing the pet
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/Order} and HTTP response
*/
this.placeOrderWithHttpInfo = function(body) {
var postBody = body;
placeOrderWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -209,19 +195,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',
@@ -236,13 +222,12 @@
* @param {module:model/Order} body order placed for purchasing the pet
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/Order}
*/
this.placeOrder = function(body) {
placeOrder(body) {
return this.placeOrderWithHttpInfo(body)
.then(function(response_and_data) {
return response_and_data.data;
});
}
};
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;
@@ -55,8 +41,8 @@
* @param {module:model/User} body Created user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.createUserWithHttpInfo = function(body) {
var postBody = body;
createUserWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -64,19 +50,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',
@@ -91,7 +77,7 @@
* @param {module:model/User} body Created user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.createUser = function(body) {
createUser(body) {
return this.createUserWithHttpInfo(body)
.then(function(response_and_data) {
return response_and_data.data;
@@ -105,8 +91,8 @@
* @param {Array.<module:model/User>} body List of user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.createUsersWithArrayInputWithHttpInfo = function(body) {
var postBody = body;
createUsersWithArrayInputWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -114,19 +100,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',
@@ -141,7 +127,7 @@
* @param {Array.<module:model/User>} body List of user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.createUsersWithArrayInput = function(body) {
createUsersWithArrayInput(body) {
return this.createUsersWithArrayInputWithHttpInfo(body)
.then(function(response_and_data) {
return response_and_data.data;
@@ -155,8 +141,8 @@
* @param {Array.<module:model/User>} body List of user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.createUsersWithListInputWithHttpInfo = function(body) {
var postBody = body;
createUsersWithListInputWithHttpInfo(body) {
let postBody = body;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
@@ -164,19 +150,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',
@@ -191,7 +177,7 @@
* @param {Array.<module:model/User>} body List of user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.createUsersWithListInput = function(body) {
createUsersWithListInput(body) {
return this.createUsersWithListInputWithHttpInfo(body)
.then(function(response_and_data) {
return response_and_data.data;
@@ -205,8 +191,8 @@
* @param {String} username The name that needs to be deleted
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.deleteUserWithHttpInfo = function(username) {
var postBody = null;
deleteUserWithHttpInfo(username) {
let postBody = null;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
@@ -214,20 +200,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',
@@ -242,7 +228,7 @@
* @param {String} username The name that needs to be deleted
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.deleteUser = function(username) {
deleteUser(username) {
return this.deleteUserWithHttpInfo(username)
.then(function(response_and_data) {
return response_and_data.data;
@@ -256,8 +242,8 @@
* @param {String} username The name that needs to be fetched. Use user1 for testing.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/User} and HTTP response
*/
this.getUserByNameWithHttpInfo = function(username) {
var postBody = null;
getUserByNameWithHttpInfo(username) {
let postBody = null;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
@@ -265,20 +251,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',
@@ -293,7 +279,7 @@
* @param {String} username The name that needs to be fetched. Use user1 for testing.
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/User}
*/
this.getUserByName = function(username) {
getUserByName(username) {
return this.getUserByNameWithHttpInfo(username)
.then(function(response_and_data) {
return response_and_data.data;
@@ -308,8 +294,8 @@
* @param {String} password The password for login in clear text
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link 'String'} and HTTP response
*/
this.loginUserWithHttpInfo = function(username, password) {
var postBody = null;
loginUserWithHttpInfo(username, password) {
let postBody = null;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
@@ -322,21 +308,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',
@@ -352,7 +338,7 @@
* @param {String} password The password for login in clear text
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link 'String'}
*/
this.loginUser = function(username, password) {
loginUser(username, password) {
return this.loginUserWithHttpInfo(username, password)
.then(function(response_and_data) {
return response_and_data.data;
@@ -365,23 +351,23 @@
*
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.logoutUserWithHttpInfo = function() {
var postBody = null;
logoutUserWithHttpInfo() {
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',
@@ -395,7 +381,7 @@
*
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.logoutUser = function() {
logoutUser() {
return this.logoutUserWithHttpInfo()
.then(function(response_and_data) {
return response_and_data.data;
@@ -410,8 +396,8 @@
* @param {module:model/User} body Updated user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing HTTP response
*/
this.updateUserWithHttpInfo = function(username, body) {
var postBody = body;
updateUserWithHttpInfo(username, body) {
let postBody = body;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
@@ -424,20 +410,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',
@@ -453,13 +439,12 @@
* @param {module:model/User} body Updated user object
* @return {Promise} a {@link https://www.promisejs.org/|Promise}
*/
this.updateUser = function(username, body) {
updateUser(username, body) {
return this.updateUserWithHttpInfo(username, body)
.then(function(response_and_data) {
return response_and_data.data;
});
}
};
return exports;
}));
}