Gh-4044: Enabling ES6 in javascript client (#5593)

* gh-4044: Added useES6 as an option for javascript templates

* gh-4044: Enabled ES6 in `javascript/api.mustache`

* gh-4044: Enabled ES6 in `javascript/ApiClient.mustache`

* gh-4044: Enabled ES6 in `javascript/enumClass.mustache`

* gh-4044: Added useES6 cli option to `javascript` clients and updated the test cases

* gh-4044: Enabled ES6 in `javascript/index.mustache`

* gh-4044: Enabled ES6 in `javascript` model templates
* `javascript/model.mustache`
* `javascript/partial_model_generic.mustache`
* `javascript/partial_model_enum_class.mustache`
* `javascript/partial_model_inner_enum.mustache`

* gh-4044: Separated `javascript-es6` templates to another folder

* gh-4044: Updated `javascript-es6/index.mustache`

* gh-4044: Enabled ES6 in `javascript-es6/api_doc.mustache`

* gh-4044: Added required dependencies for ES6

* gh-4044: Updated Supportig files for ES6 and non ES6

* gh-4044: Added test scripts to verify `javascript` useEs6 option

* gh-4044: Commented `javascript-es6` scripts due to the permission issues.
This commit is contained in:
Dinuka De Silva
2017-05-24 14:05:54 +05:30
committed by wing328
parent 296e0288ea
commit ca139ffc05
261 changed files with 21570 additions and 10 deletions

View File

@@ -0,0 +1,562 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['superagent', 'querystring'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('superagent'), require('querystring'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.ApiClient = factory(root.superagent, root.querystring);
}
}(this, function(superagent, querystring) {
'use strict';
/**
* @module ApiClient
* @version 1.0.0
*/
/**
* Manages low level client-server communications, parameter marshalling, etc. There should not be any need for an
* application to use this class directly - the *Api and model classes provide the public API for the service. The
* contents of this file should be regarded as internal but are documented for completeness.
* @alias module:ApiClient
* @class
*/
var exports = function() {
/**
* The base URL against which to resolve every API call's (relative) path.
* @type {String}
* @default http://petstore.swagger.io:80/v2
*/
this.basePath = 'http://petstore.swagger.io:80/v2'.replace(/\/+$/, '');
/**
* The authentication methods to be included for all API calls.
* @type {Array.<String>}
*/
this.authentications = {
'api_key': {type: 'apiKey', 'in': 'header', name: 'api_key'},
'http_basic_test': {type: 'basic'},
'petstore_auth': {type: 'oauth2'}
};
/**
* The default HTTP headers to be included for all API calls.
* @type {Array.<String>}
* @default {}
*/
this.defaultHeaders = {};
/**
* The default HTTP timeout for all API calls.
* @type {Number}
* @default 60000
*/
this.timeout = 60000;
/**
* If set to false an additional timestamp parameter is added to all API GET calls to
* prevent browser caching
* @type {Boolean}
* @default true
*/
this.cache = true;
/**
* If set to true, the client will save the cookies from each server
* response, and return them in the next request.
* @default false
*/
this.enableCookies = false;
/*
* Used to save and return cookies in a node.js (non-browser) setting,
* if this.enableCookies is set to true.
*/
if (typeof window === 'undefined') {
this.agent = new superagent.agent();
}
};
/**
* Returns a string representation for an actual parameter.
* @param param The actual parameter.
* @returns {String} The string representation of <code>param</code>.
*/
exports.prototype.paramToString = function(param) {
if (param == undefined || param == null) {
return '';
}
if (param instanceof Date) {
return param.toJSON();
}
return param.toString();
};
/**
* Builds full URL by appending the given path to the base URL and replacing path parameter place-holders with parameter values.
* NOTE: query parameters are not handled here.
* @param {String} path The path to append to the base URL.
* @param {Object} pathParams The parameter values to append.
* @returns {String} The encoded path with parameter values substituted.
*/
exports.prototype.buildUrl = function(path, pathParams) {
if (!path.match(/^\//)) {
path = '/' + path;
}
var url = this.basePath + path;
var _this = this;
url = url.replace(/\{([\w-]+)\}/g, function(fullMatch, key) {
var value;
if (pathParams.hasOwnProperty(key)) {
value = _this.paramToString(pathParams[key]);
} else {
value = fullMatch;
}
return encodeURIComponent(value);
});
return url;
};
/**
* Checks whether the given content type represents JSON.<br>
* JSON content type examples:<br>
* <ul>
* <li>application/json</li>
* <li>application/json; charset=UTF8</li>
* <li>APPLICATION/JSON</li>
* </ul>
* @param {String} contentType The MIME content type to check.
* @returns {Boolean} <code>true</code> if <code>contentType</code> represents JSON, otherwise <code>false</code>.
*/
exports.prototype.isJsonMime = function(contentType) {
return Boolean(contentType != null && contentType.match(/^application\/json(;.*)?$/i));
};
/**
* Chooses a content type from the given array, with JSON preferred; i.e. return JSON if included, otherwise return the first.
* @param {Array.<String>} contentTypes
* @returns {String} The chosen content type, preferring JSON.
*/
exports.prototype.jsonPreferredMime = function(contentTypes) {
for (var i = 0; i < contentTypes.length; i++) {
if (this.isJsonMime(contentTypes[i])) {
return contentTypes[i];
}
}
return contentTypes[0];
};
/**
* Checks whether the given parameter value represents file-like content.
* @param param The parameter to check.
* @returns {Boolean} <code>true</code> if <code>param</code> represents a file.
*/
exports.prototype.isFileParam = function(param) {
// fs.ReadStream in Node.js (but not in runtime like browserify)
if (typeof window === 'undefined' &&
typeof require === 'function' &&
require('fs') &&
param instanceof require('fs').ReadStream) {
return true;
}
// Buffer in Node.js
if (typeof Buffer === 'function' && param instanceof Buffer) {
return true;
}
// Blob in browser
if (typeof Blob === 'function' && param instanceof Blob) {
return true;
}
// File in browser (it seems File object is also instance of Blob, but keep this for safe)
if (typeof File === 'function' && param instanceof File) {
return true;
}
return false;
};
/**
* Normalizes parameter values:
* <ul>
* <li>remove nils</li>
* <li>keep files and arrays</li>
* <li>format to string with `paramToString` for other cases</li>
* </ul>
* @param {Object.<String, Object>} params The parameters as object properties.
* @returns {Object.<String, Object>} normalized parameters.
*/
exports.prototype.normalizeParams = function(params) {
var newParams = {};
for (var key in params) {
if (params.hasOwnProperty(key) && params[key] != undefined && params[key] != null) {
var value = params[key];
if (this.isFileParam(value) || Array.isArray(value)) {
newParams[key] = value;
} else {
newParams[key] = this.paramToString(value);
}
}
}
return newParams;
};
/**
* Enumeration of collection format separator strategies.
* @enum {String}
* @readonly
*/
exports.CollectionFormatEnum = {
/**
* Comma-separated values. Value: <code>csv</code>
* @const
*/
CSV: ',',
/**
* Space-separated values. Value: <code>ssv</code>
* @const
*/
SSV: ' ',
/**
* Tab-separated values. Value: <code>tsv</code>
* @const
*/
TSV: '\t',
/**
* Pipe(|)-separated values. Value: <code>pipes</code>
* @const
*/
PIPES: '|',
/**
* Native array. Value: <code>multi</code>
* @const
*/
MULTI: 'multi'
};
/**
* Builds a string representation of an array-type actual parameter, according to the given collection format.
* @param {Array} param An array parameter.
* @param {module:ApiClient.CollectionFormatEnum} collectionFormat The array element separator strategy.
* @returns {String|Array} A string representation of the supplied collection, using the specified delimiter. Returns
* <code>param</code> as is if <code>collectionFormat</code> is <code>multi</code>.
*/
exports.prototype.buildCollectionParam = function buildCollectionParam(param, collectionFormat) {
if (param == null) {
return null;
}
switch (collectionFormat) {
case 'csv':
return param.map(this.paramToString).join(',');
case 'ssv':
return param.map(this.paramToString).join(' ');
case 'tsv':
return param.map(this.paramToString).join('\t');
case 'pipes':
return param.map(this.paramToString).join('|');
case 'multi':
// return the array directly as SuperAgent will handle it as expected
return param.map(this.paramToString);
default:
throw new Error('Unknown collection format: ' + collectionFormat);
}
};
/**
* Applies authentication headers to the request.
* @param {Object} request The request object created by a <code>superagent()</code> call.
* @param {Array.<String>} authNames An array of authentication method names.
*/
exports.prototype.applyAuthToRequest = function(request, authNames) {
var _this = this;
authNames.forEach(function(authName) {
var auth = _this.authentications[authName];
switch (auth.type) {
case 'basic':
if (auth.username || auth.password) {
request.auth(auth.username || '', auth.password || '');
}
break;
case 'apiKey':
if (auth.apiKey) {
var data = {};
if (auth.apiKeyPrefix) {
data[auth.name] = auth.apiKeyPrefix + ' ' + auth.apiKey;
} else {
data[auth.name] = auth.apiKey;
}
if (auth['in'] === 'header') {
request.set(data);
} else {
request.query(data);
}
}
break;
case 'oauth2':
if (auth.accessToken) {
request.set({'Authorization': 'Bearer ' + auth.accessToken});
}
break;
default:
throw new Error('Unknown authentication type: ' + auth.type);
}
});
};
/**
* Deserializes an HTTP response body into a value of the specified type.
* @param {Object} response A SuperAgent response object.
* @param {(String|Array.<String>|Object.<String, Object>|Function)} returnType The type to return. Pass a string for simple types
* or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
* return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
* all properties on <code>data<code> will be converted to this type.
* @returns A value of the specified type.
*/
exports.prototype.deserialize = function deserialize(response, returnType) {
if (response == null || returnType == null || response.status == 204) {
return null;
}
// Rely on SuperAgent for parsing response body.
// See http://visionmedia.github.io/superagent/#parsing-response-bodies
var data = response.body;
if (data == null || (typeof data === 'object' && typeof data.length === 'undefined' && !Object.keys(data).length)) {
// SuperAgent does not always produce a body; use the unparsed response as a fallback
data = response.text;
}
return exports.convertToType(data, returnType);
};
/**
* Callback function to receive the result of the operation.
* @callback module:ApiClient~callApiCallback
* @param {String} error Error message, if any.
* @param data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Invokes the REST service using the supplied settings and parameters.
* @param {String} path The base URL to invoke.
* @param {String} httpMethod The HTTP method to use.
* @param {Object.<String, String>} pathParams A map of path parameters and their values.
* @param {Object.<String, Object>} queryParams A map of query parameters and their values.
* @param {Object.<String, Object>} headerParams A map of header parameters and their values.
* @param {Object.<String, Object>} formParams A map of form parameters and their values.
* @param {Object} bodyParam The value to pass as the request body.
* @param {Array.<String>} authNames An array of authentication type names.
* @param {Array.<String>} contentTypes An array of request MIME types.
* @param {Array.<String>} accepts An array of acceptable response MIME types.
* @param {(String|Array|ObjectFunction)} returnType The required type to return; can be a string for simple types or the
* constructor for a complex type.
* @param {module:ApiClient~callApiCallback} callback The callback function.
* @returns {Object} The SuperAgent request object.
*/
exports.prototype.callApi = function callApi(path, httpMethod, pathParams,
queryParams, headerParams, formParams, bodyParam, authNames, contentTypes, accepts,
returnType, callback) {
var _this = this;
var url = this.buildUrl(path, pathParams);
var request = superagent(httpMethod, url);
// apply authentications
this.applyAuthToRequest(request, authNames);
// set query parameters
if (httpMethod.toUpperCase() === 'GET' && this.cache === false) {
queryParams['_'] = new Date().getTime();
}
request.query(this.normalizeParams(queryParams));
// set header parameters
request.set(this.defaultHeaders).set(this.normalizeParams(headerParams));
// set request timeout
request.timeout(this.timeout);
var contentType = this.jsonPreferredMime(contentTypes);
if (contentType) {
// Issue with superagent and multipart/form-data (https://github.com/visionmedia/superagent/issues/746)
if(contentType != 'multipart/form-data') {
request.type(contentType);
}
} else if (!request.header['Content-Type']) {
request.type('application/json');
}
if (contentType === 'application/x-www-form-urlencoded') {
request.send(querystring.stringify(this.normalizeParams(formParams)));
} else if (contentType == 'multipart/form-data') {
var _formParams = this.normalizeParams(formParams);
for (var key in _formParams) {
if (_formParams.hasOwnProperty(key)) {
if (this.isFileParam(_formParams[key])) {
// file field
request.attach(key, _formParams[key]);
} else {
request.field(key, _formParams[key]);
}
}
}
} else if (bodyParam) {
request.send(bodyParam);
}
var accept = this.jsonPreferredMime(accepts);
if (accept) {
request.accept(accept);
}
if (returnType === 'Blob') {
request.responseType('blob');
}
// Attach previously saved cookies, if enabled
if (this.enableCookies){
if (typeof window === 'undefined') {
this.agent.attachCookies(request);
}
else {
request.withCredentials();
}
}
request.end(function(error, response) {
if (callback) {
var data = null;
if (!error) {
try {
data = _this.deserialize(response, returnType);
if (_this.enableCookies && typeof window === 'undefined'){
_this.agent.saveCookies(response);
}
} catch (err) {
error = err;
}
}
callback(error, data, response);
}
});
return request;
};
/**
* Parses an ISO-8601 string representation of a date value.
* @param {String} str The date value as a string.
* @returns {Date} The parsed date object.
*/
exports.parseDate = function(str) {
return new Date(str.replace(/T/i, ' '));
};
/**
* Converts a value to the specified type.
* @param {(String|Object)} data The data to convert, as a string or object.
* @param {(String|Array.<String>|Object.<String, Object>|Function)} type The type to return. Pass a string for simple types
* or the constructor function for a complex type. Pass an array containing the type name to return an array of that type. To
* return an object, pass an object with one property whose name is the key type and whose value is the corresponding value type:
* all properties on <code>data<code> will be converted to this type.
* @returns An instance of the specified type or null or undefined if data is null or undefined.
*/
exports.convertToType = function(data, type) {
if (data === null || data === undefined)
return data
switch (type) {
case 'Boolean':
return Boolean(data);
case 'Integer':
return parseInt(data, 10);
case 'Number':
return parseFloat(data);
case 'String':
return String(data);
case 'Date':
return this.parseDate(String(data));
case 'Blob':
return data;
default:
if (type === Object) {
// generic object, return directly
return data;
} else if (typeof type === 'function') {
// for model type like: User
return type.constructFromObject(data);
} else if (Array.isArray(type)) {
// for array type like: ['String']
var itemType = type[0];
return data.map(function(item) {
return exports.convertToType(item, itemType);
});
} else if (typeof type === 'object') {
// for plain object type like: {'String': 'Integer'}
var keyType, valueType;
for (var k in type) {
if (type.hasOwnProperty(k)) {
keyType = k;
valueType = type[k];
break;
}
}
var result = {};
for (var k in data) {
if (data.hasOwnProperty(k)) {
var key = exports.convertToType(k, keyType);
var value = exports.convertToType(data[k], valueType);
result[key] = value;
}
}
return result;
} else {
// for unknown type, return the data directly
return data;
}
}
};
/**
* Constructs a new map or array model from REST data.
* @param data {Object|Array} The REST data.
* @param obj {Object|Array} The target object or array.
*/
exports.constructFromObject = function(data, obj, itemType) {
if (Array.isArray(data)) {
for (var i = 0; i < data.length; i++) {
if (data.hasOwnProperty(i))
obj[i] = exports.convertToType(data[i], itemType);
}
} else {
for (var k in data) {
if (data.hasOwnProperty(k))
obj[k] = exports.convertToType(data[k], itemType);
}
}
};
/**
* The default API client implementation.
* @type {module:ApiClient}
*/
exports.instance = new exports();
return exports;
}));

View File

@@ -0,0 +1,239 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* 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'], 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'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.FakeApi = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Client);
}
}(this, function(ApiClient, Client) {
'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;
/**
* Callback function to receive the result of the testClientModel operation.
* @callback module:api/FakeApi~testClientModelCallback
* @param {String} error Error message, if any.
* @param {module:model/Client} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* To test \&quot;client\&quot; model
* To test \&quot;client\&quot; model
* @param {module:model/Client} body client model
* @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;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling testClientModel");
}
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = [];
var contentTypes = ['application/json'];
var accepts = ['application/json'];
var returnType = Client;
return this.apiClient.callApi(
'/fake', 'PATCH',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the testEndpointParameters operation.
* @callback module:api/FakeApi~testEndpointParametersCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트
* @param {Number} _number None
* @param {Number} _double None
* @param {String} patternWithoutDelimiter None
* @param {Blob} _byte None
* @param {Object} opts Optional parameters
* @param {Number} opts.integer None
* @param {Number} opts.int32 None
* @param {Number} opts.int64 None
* @param {Number} opts._float None
* @param {String} opts._string None
* @param {Blob} opts.binary None
* @param {Date} opts._date None
* @param {Date} opts.dateTime None
* @param {String} opts.password None
* @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) {
opts = opts || {};
var postBody = null;
// verify the required parameter '_number' is set
if (_number === undefined || _number === null) {
throw new Error("Missing the required parameter '_number' when calling testEndpointParameters");
}
// verify the required parameter '_double' is set
if (_double === undefined || _double === null) {
throw new Error("Missing the required parameter '_double' when calling testEndpointParameters");
}
// verify the required parameter 'patternWithoutDelimiter' is set
if (patternWithoutDelimiter === undefined || patternWithoutDelimiter === null) {
throw new Error("Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters");
}
// verify the required parameter '_byte' is set
if (_byte === undefined || _byte === null) {
throw new Error("Missing the required parameter '_byte' when calling testEndpointParameters");
}
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
'integer': opts['integer'],
'int32': opts['int32'],
'int64': opts['int64'],
'number': _number,
'float': opts['_float'],
'double': _double,
'string': opts['_string'],
'pattern_without_delimiter': patternWithoutDelimiter,
'byte': _byte,
'binary': opts['binary'],
'date': opts['_date'],
'dateTime': opts['dateTime'],
'password': opts['password'],
'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;
return this.apiClient.callApi(
'/fake', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the testEnumParameters operation.
* @callback module:api/FakeApi~testEnumParametersCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* To test enum parameters
* To test enum parameters
* @param {Object} opts Optional parameters
* @param {Array.<module:model/String>} opts.enumFormStringArray Form parameter enum test (string array)
* @param {module:model/String} opts.enumFormString Form parameter enum test (string) (default to -efg)
* @param {Array.<module:model/String>} opts.enumHeaderStringArray Header parameter enum test (string array)
* @param {module:model/String} opts.enumHeaderString Header parameter enum test (string) (default to -efg)
* @param {Array.<module:model/String>} opts.enumQueryStringArray Query parameter enum test (string array)
* @param {module:model/String} opts.enumQueryString Query parameter enum test (string) (default to -efg)
* @param {module:model/Number} opts.enumQueryInteger Query parameter enum test (double)
* @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) {
opts = opts || {};
var postBody = null;
var pathParams = {
};
var queryParams = {
'enum_query_string_array': this.apiClient.buildCollectionParam(opts['enumQueryStringArray'], 'csv'),
'enum_query_string': opts['enumQueryString'],
'enum_query_integer': opts['enumQueryInteger']
};
var headerParams = {
'enum_header_string_array': opts['enumHeaderStringArray'],
'enum_header_string': opts['enumHeaderString']
};
var 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;
return this.apiClient.callApi(
'/fake', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
};
return exports;
}));

View File

@@ -0,0 +1,428 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* 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 = {};
}
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;
/**
* Callback function to receive the result of the addPet operation.
* @callback module:api/PetApi~addPetCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Add a new pet to the store
*
* @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;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling addPet");
}
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['petstore_auth'];
var contentTypes = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
'/pet', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the deletePet operation.
* @callback module:api/PetApi~deletePetCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Deletes a pet
*
* @param {Number} petId Pet id to delete
* @param {Object} opts Optional parameters
* @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) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
throw new Error("Missing the required parameter 'petId' when calling deletePet");
}
var pathParams = {
'petId': petId
};
var queryParams = {
};
var headerParams = {
'api_key': opts['apiKey']
};
var formParams = {
};
var authNames = ['petstore_auth'];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
'/pet/{petId}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the findPetsByStatus operation.
* @callback module:api/PetApi~findPetsByStatusCallback
* @param {String} error Error message, if any.
* @param {Array.<module:model/Pet>} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Finds Pets by status
* Multiple status values can be provided with comma separated strings
* @param {Array.<module:model/String>} status Status values that need to be considered for filter
* @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;
// verify the required parameter 'status' is set
if (status === undefined || status === null) {
throw new Error("Missing the required parameter 'status' when calling findPetsByStatus");
}
var pathParams = {
};
var queryParams = {
'status': this.apiClient.buildCollectionParam(status, 'csv')
};
var headerParams = {
};
var formParams = {
};
var authNames = ['petstore_auth'];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = [Pet];
return this.apiClient.callApi(
'/pet/findByStatus', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the findPetsByTags operation.
* @callback module:api/PetApi~findPetsByTagsCallback
* @param {String} error Error message, if any.
* @param {Array.<module:model/Pet>} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Finds Pets by tags
* Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.
* @param {Array.<String>} tags Tags to filter by
* @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;
// verify the required parameter 'tags' is set
if (tags === undefined || tags === null) {
throw new Error("Missing the required parameter 'tags' when calling findPetsByTags");
}
var pathParams = {
};
var queryParams = {
'tags': this.apiClient.buildCollectionParam(tags, 'csv')
};
var headerParams = {
};
var formParams = {
};
var authNames = ['petstore_auth'];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = [Pet];
return this.apiClient.callApi(
'/pet/findByTags', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the getPetById operation.
* @callback module:api/PetApi~getPetByIdCallback
* @param {String} error Error message, if any.
* @param {module:model/Pet} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Find pet by ID
* Returns a single pet
* @param {Number} petId ID of pet to return
* @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;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
throw new Error("Missing the required parameter 'petId' when calling getPetById");
}
var pathParams = {
'petId': petId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = Pet;
return this.apiClient.callApi(
'/pet/{petId}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the updatePet operation.
* @callback module:api/PetApi~updatePetCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Update an existing pet
*
* @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;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling updatePet");
}
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['petstore_auth'];
var contentTypes = ['application/json', 'application/xml'];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
'/pet', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the updatePetWithForm operation.
* @callback module:api/PetApi~updatePetWithFormCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Updates a pet in the store with form data
*
* @param {Number} petId ID of pet that needs to be updated
* @param {Object} opts Optional parameters
* @param {String} opts.name Updated name of the pet
* @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) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
throw new Error("Missing the required parameter 'petId' when calling updatePetWithForm");
}
var pathParams = {
'petId': petId
};
var queryParams = {
};
var headerParams = {
};
var 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;
return this.apiClient.callApi(
'/pet/{petId}', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the uploadFile operation.
* @callback module:api/PetApi~uploadFileCallback
* @param {String} error Error message, if any.
* @param {module:model/ApiResponse} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* uploads an image
*
* @param {Number} petId ID of pet to update
* @param {Object} opts Optional parameters
* @param {String} opts.additionalMetadata Additional data to pass to server
* @param {File} opts.file file to upload
* @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) {
opts = opts || {};
var postBody = null;
// verify the required parameter 'petId' is set
if (petId === undefined || petId === null) {
throw new Error("Missing the required parameter 'petId' when calling uploadFile");
}
var pathParams = {
'petId': petId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
'additionalMetadata': opts['additionalMetadata'],
'file': opts['file']
};
var authNames = ['petstore_auth'];
var contentTypes = ['multipart/form-data'];
var accepts = ['application/json'];
var returnType = ApiResponse;
return this.apiClient.callApi(
'/pet/{petId}/uploadImage', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
};
return exports;
}));

View File

@@ -0,0 +1,225 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* 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 = {};
}
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;
/**
* Callback function to receive the result of the deleteOrder operation.
* @callback module:api/StoreApi~deleteOrderCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Delete purchase order by ID
* For valid response try integer IDs with value &lt; 1000. Anything above 1000 or nonintegers will generate API errors
* @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;
// verify the required parameter 'orderId' is set
if (orderId === undefined || orderId === null) {
throw new Error("Missing the required parameter 'orderId' when calling deleteOrder");
}
var pathParams = {
'order_id': orderId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
'/store/order/{order_id}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the getInventory operation.
* @callback module:api/StoreApi~getInventoryCallback
* @param {String} error Error message, if any.
* @param {Object.<String, {'String': 'Number'}>} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Returns pet inventories by status
* Returns a map of status codes to quantities
* @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;
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = ['api_key'];
var contentTypes = [];
var accepts = ['application/json'];
var returnType = {'String': 'Number'};
return this.apiClient.callApi(
'/store/inventory', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the getOrderById operation.
* @callback module:api/StoreApi~getOrderByIdCallback
* @param {String} error Error message, if any.
* @param {module:model/Order} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Find purchase order by ID
* For valid response try integer IDs with value &lt;&#x3D; 5 or &gt; 10. Other values will generated exceptions
* @param {Number} orderId ID of pet that needs to be fetched
* @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;
// verify the required parameter 'orderId' is set
if (orderId === undefined || orderId === null) {
throw new Error("Missing the required parameter 'orderId' when calling getOrderById");
}
var pathParams = {
'order_id': orderId
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = Order;
return this.apiClient.callApi(
'/store/order/{order_id}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the placeOrder operation.
* @callback module:api/StoreApi~placeOrderCallback
* @param {String} error Error message, if any.
* @param {module:model/Order} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Place an order for a pet
*
* @param {module:model/Order} body order placed for purchasing the pet
* @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;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling placeOrder");
}
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = Order;
return this.apiClient.callApi(
'/store/order', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
};
return exports;
}));

View File

@@ -0,0 +1,415 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* 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 = {};
}
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;
/**
* Callback function to receive the result of the createUser operation.
* @callback module:api/UserApi~createUserCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Create user
* This can only be done by the logged in user.
* @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;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling createUser");
}
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
'/user', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the createUsersWithArrayInput operation.
* @callback module:api/UserApi~createUsersWithArrayInputCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Creates list of users with given input array
*
* @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;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling createUsersWithArrayInput");
}
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
'/user/createWithArray', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the createUsersWithListInput operation.
* @callback module:api/UserApi~createUsersWithListInputCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Creates list of users with given input array
*
* @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;
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling createUsersWithListInput");
}
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
'/user/createWithList', 'POST',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the deleteUser operation.
* @callback module:api/UserApi~deleteUserCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Delete user
* This can only be done by the logged in user.
* @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;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
throw new Error("Missing the required parameter 'username' when calling deleteUser");
}
var pathParams = {
'username': username
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
'/user/{username}', 'DELETE',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the getUserByName operation.
* @callback module:api/UserApi~getUserByNameCallback
* @param {String} error Error message, if any.
* @param {module:model/User} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Get user by user name
*
* @param {String} username The name that needs to be fetched. Use user1 for testing.
* @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;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
throw new Error("Missing the required parameter 'username' when calling getUserByName");
}
var pathParams = {
'username': username
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = User;
return this.apiClient.callApi(
'/user/{username}', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the loginUser operation.
* @callback module:api/UserApi~loginUserCallback
* @param {String} error Error message, if any.
* @param {'String'} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Logs user into the system
*
* @param {String} username The user name for login
* @param {String} password The password for login in clear text
* @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;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
throw new Error("Missing the required parameter 'username' when calling loginUser");
}
// verify the required parameter 'password' is set
if (password === undefined || password === null) {
throw new Error("Missing the required parameter 'password' when calling loginUser");
}
var pathParams = {
};
var queryParams = {
'username': username,
'password': password
};
var headerParams = {
};
var formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = 'String';
return this.apiClient.callApi(
'/user/login', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the logoutUser operation.
* @callback module:api/UserApi~logoutUserCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Logs out current logged in user session
*
* @param {module:api/UserApi~logoutUserCallback} callback The callback function, accepting three arguments: error, data, response
*/
this.logoutUser = function(callback) {
var postBody = null;
var pathParams = {
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
'/user/logout', 'GET',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
/**
* Callback function to receive the result of the updateUser operation.
* @callback module:api/UserApi~updateUserCallback
* @param {String} error Error message, if any.
* @param data This operation does not return a value.
* @param {String} response The complete HTTP response.
*/
/**
* Updated user
* This can only be done by the logged in user.
* @param {String} username name that need to be deleted
* @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;
// verify the required parameter 'username' is set
if (username === undefined || username === null) {
throw new Error("Missing the required parameter 'username' when calling updateUser");
}
// verify the required parameter 'body' is set
if (body === undefined || body === null) {
throw new Error("Missing the required parameter 'body' when calling updateUser");
}
var pathParams = {
'username': username
};
var queryParams = {
};
var headerParams = {
};
var formParams = {
};
var authNames = [];
var contentTypes = [];
var accepts = ['application/xml', 'application/json'];
var returnType = null;
return this.apiClient.callApi(
'/user/{username}', 'PUT',
pathParams, queryParams, headerParams, formParams, postBody,
authNames, contentTypes, accepts, returnType, callback
);
}
};
return exports;
}));

View File

@@ -0,0 +1,245 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterEnum', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/FakeApi', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterEnum'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/FakeApi'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi'));
}
}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, Category, ClassModel, Client, Dog, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterEnum, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, FakeApi, PetApi, StoreApi, UserApi) {
'use strict';
/**
* This_spec_is_mainly_for_testing_Petstore_server_and_contains_fake_endpoints_models__Please_do_not_use_this_for_any_other_purpose__Special_characters__.<br>
* The <code>index</code> module provides access to constructors for all the classes which comprise the public API.
* <p>
* An AMD (recommended!) or CommonJS application will generally do something equivalent to the following:
* <pre>
* var SwaggerPetstore = require('index'); // See note below*.
* var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
* var yyyModel = new SwaggerPetstore.Yyy(); // Construct a model instance.
* yyyModel.someProperty = 'someValue';
* ...
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
* ...
* </pre>
* <em>*NOTE: For a top-level AMD script, use require(['index'], function(){...})
* and put the application logic within the callback function.</em>
* </p>
* <p>
* A non-AMD browser application (discouraged) might do something like this:
* <pre>
* var xxxSvc = new SwaggerPetstore.XxxApi(); // Allocate the API class we're going to use.
* var yyy = new SwaggerPetstore.Yyy(); // Construct a model instance.
* yyyModel.someProperty = 'someValue';
* ...
* var zzz = xxxSvc.doSomething(yyyModel); // Invoke the service.
* ...
* </pre>
* </p>
* @module index
* @version 1.0.0
*/
var exports = {
/**
* The ApiClient constructor.
* @property {module:ApiClient}
*/
ApiClient: ApiClient,
/**
* The AdditionalPropertiesClass model constructor.
* @property {module:model/AdditionalPropertiesClass}
*/
AdditionalPropertiesClass: AdditionalPropertiesClass,
/**
* The Animal model constructor.
* @property {module:model/Animal}
*/
Animal: Animal,
/**
* The AnimalFarm model constructor.
* @property {module:model/AnimalFarm}
*/
AnimalFarm: AnimalFarm,
/**
* The ApiResponse model constructor.
* @property {module:model/ApiResponse}
*/
ApiResponse: ApiResponse,
/**
* The ArrayOfArrayOfNumberOnly model constructor.
* @property {module:model/ArrayOfArrayOfNumberOnly}
*/
ArrayOfArrayOfNumberOnly: ArrayOfArrayOfNumberOnly,
/**
* The ArrayOfNumberOnly model constructor.
* @property {module:model/ArrayOfNumberOnly}
*/
ArrayOfNumberOnly: ArrayOfNumberOnly,
/**
* The ArrayTest model constructor.
* @property {module:model/ArrayTest}
*/
ArrayTest: ArrayTest,
/**
* The Capitalization model constructor.
* @property {module:model/Capitalization}
*/
Capitalization: Capitalization,
/**
* The Cat model constructor.
* @property {module:model/Cat}
*/
Cat: Cat,
/**
* The Category model constructor.
* @property {module:model/Category}
*/
Category: Category,
/**
* The ClassModel model constructor.
* @property {module:model/ClassModel}
*/
ClassModel: ClassModel,
/**
* The Client model constructor.
* @property {module:model/Client}
*/
Client: Client,
/**
* The Dog model constructor.
* @property {module:model/Dog}
*/
Dog: Dog,
/**
* The EnumArrays model constructor.
* @property {module:model/EnumArrays}
*/
EnumArrays: EnumArrays,
/**
* The EnumClass model constructor.
* @property {module:model/EnumClass}
*/
EnumClass: EnumClass,
/**
* The EnumTest model constructor.
* @property {module:model/EnumTest}
*/
EnumTest: EnumTest,
/**
* The FormatTest model constructor.
* @property {module:model/FormatTest}
*/
FormatTest: FormatTest,
/**
* The HasOnlyReadOnly model constructor.
* @property {module:model/HasOnlyReadOnly}
*/
HasOnlyReadOnly: HasOnlyReadOnly,
/**
* The List model constructor.
* @property {module:model/List}
*/
List: List,
/**
* The MapTest model constructor.
* @property {module:model/MapTest}
*/
MapTest: MapTest,
/**
* The MixedPropertiesAndAdditionalPropertiesClass model constructor.
* @property {module:model/MixedPropertiesAndAdditionalPropertiesClass}
*/
MixedPropertiesAndAdditionalPropertiesClass: MixedPropertiesAndAdditionalPropertiesClass,
/**
* The Model200Response model constructor.
* @property {module:model/Model200Response}
*/
Model200Response: Model200Response,
/**
* The ModelReturn model constructor.
* @property {module:model/ModelReturn}
*/
ModelReturn: ModelReturn,
/**
* The Name model constructor.
* @property {module:model/Name}
*/
Name: Name,
/**
* The NumberOnly model constructor.
* @property {module:model/NumberOnly}
*/
NumberOnly: NumberOnly,
/**
* The Order model constructor.
* @property {module:model/Order}
*/
Order: Order,
/**
* The OuterEnum model constructor.
* @property {module:model/OuterEnum}
*/
OuterEnum: OuterEnum,
/**
* The Pet model constructor.
* @property {module:model/Pet}
*/
Pet: Pet,
/**
* The ReadOnlyFirst model constructor.
* @property {module:model/ReadOnlyFirst}
*/
ReadOnlyFirst: ReadOnlyFirst,
/**
* The SpecialModelName model constructor.
* @property {module:model/SpecialModelName}
*/
SpecialModelName: SpecialModelName,
/**
* The Tag model constructor.
* @property {module:model/Tag}
*/
Tag: Tag,
/**
* The User model constructor.
* @property {module:model/User}
*/
User: User,
/**
* The FakeApi service constructor.
* @property {module:api/FakeApi}
*/
FakeApi: FakeApi,
/**
* The PetApi service constructor.
* @property {module:api/PetApi}
*/
PetApi: PetApi,
/**
* The StoreApi service constructor.
* @property {module:api/StoreApi}
*/
StoreApi: StoreApi,
/**
* The UserApi service constructor.
* @property {module:api/UserApi}
*/
UserApi: UserApi
};
return exports;
}));

View File

@@ -0,0 +1,87 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.AdditionalPropertiesClass = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The AdditionalPropertiesClass model module.
* @module model/AdditionalPropertiesClass
* @version 1.0.0
*/
/**
* Constructs a new <code>AdditionalPropertiesClass</code>.
* @alias module:model/AdditionalPropertiesClass
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>AdditionalPropertiesClass</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/AdditionalPropertiesClass} obj Optional instance to populate.
* @return {module:model/AdditionalPropertiesClass} The populated <code>AdditionalPropertiesClass</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('map_property')) {
obj['map_property'] = ApiClient.convertToType(data['map_property'], {'String': 'String'});
}
if (data.hasOwnProperty('map_of_map_property')) {
obj['map_of_map_property'] = ApiClient.convertToType(data['map_of_map_property'], {'String': {'String': 'String'}});
}
}
return obj;
}
/**
* @member {Object.<String, String>} map_property
*/
exports.prototype['map_property'] = undefined;
/**
* @member {Object.<String, Object.<String, String>>} map_of_map_property
*/
exports.prototype['map_of_map_property'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,89 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.Animal = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Animal model module.
* @module model/Animal
* @version 1.0.0
*/
/**
* Constructs a new <code>Animal</code>.
* @alias module:model/Animal
* @class
* @param className {String}
*/
var exports = function(className) {
var _this = this;
_this['className'] = className;
};
/**
* Constructs a <code>Animal</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Animal} obj Optional instance to populate.
* @return {module:model/Animal} The populated <code>Animal</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('className')) {
obj['className'] = ApiClient.convertToType(data['className'], 'String');
}
if (data.hasOwnProperty('color')) {
obj['color'] = ApiClient.convertToType(data['color'], 'String');
}
}
return obj;
}
/**
* @member {String} className
*/
exports.prototype['className'] = undefined;
/**
* @member {String} color
* @default 'red'
*/
exports.prototype['color'] = 'red';
return exports;
}));

View File

@@ -0,0 +1,76 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Animal'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Animal'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.AnimalFarm = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal);
}
}(this, function(ApiClient, Animal) {
'use strict';
/**
* The AnimalFarm model module.
* @module model/AnimalFarm
* @version 1.0.0
*/
/**
* Constructs a new <code>AnimalFarm</code>.
* @alias module:model/AnimalFarm
* @class
* @extends Array
*/
var exports = function() {
var _this = this;
_this = new Array();
Object.setPrototypeOf(_this, exports);
return _this;
};
/**
* Constructs a <code>AnimalFarm</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/AnimalFarm} obj Optional instance to populate.
* @return {module:model/AnimalFarm} The populated <code>AnimalFarm</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
ApiClient.constructFromObject(data, obj, 'Animal');
}
return obj;
}
return exports;
}));

View File

@@ -0,0 +1,95 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.ApiResponse = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The ApiResponse model module.
* @module model/ApiResponse
* @version 1.0.0
*/
/**
* Constructs a new <code>ApiResponse</code>.
* @alias module:model/ApiResponse
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>ApiResponse</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ApiResponse} obj Optional instance to populate.
* @return {module:model/ApiResponse} The populated <code>ApiResponse</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('code')) {
obj['code'] = ApiClient.convertToType(data['code'], 'Number');
}
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
}
if (data.hasOwnProperty('message')) {
obj['message'] = ApiClient.convertToType(data['message'], 'String');
}
}
return obj;
}
/**
* @member {Number} code
*/
exports.prototype['code'] = undefined;
/**
* @member {String} type
*/
exports.prototype['type'] = undefined;
/**
* @member {String} message
*/
exports.prototype['message'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,79 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.ArrayOfArrayOfNumberOnly = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The ArrayOfArrayOfNumberOnly model module.
* @module model/ArrayOfArrayOfNumberOnly
* @version 1.0.0
*/
/**
* Constructs a new <code>ArrayOfArrayOfNumberOnly</code>.
* @alias module:model/ArrayOfArrayOfNumberOnly
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>ArrayOfArrayOfNumberOnly</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ArrayOfArrayOfNumberOnly} obj Optional instance to populate.
* @return {module:model/ArrayOfArrayOfNumberOnly} The populated <code>ArrayOfArrayOfNumberOnly</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('ArrayArrayNumber')) {
obj['ArrayArrayNumber'] = ApiClient.convertToType(data['ArrayArrayNumber'], [['Number']]);
}
}
return obj;
}
/**
* @member {Array.<Array.<Number>>} ArrayArrayNumber
*/
exports.prototype['ArrayArrayNumber'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,79 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.ArrayOfNumberOnly = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The ArrayOfNumberOnly model module.
* @module model/ArrayOfNumberOnly
* @version 1.0.0
*/
/**
* Constructs a new <code>ArrayOfNumberOnly</code>.
* @alias module:model/ArrayOfNumberOnly
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>ArrayOfNumberOnly</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ArrayOfNumberOnly} obj Optional instance to populate.
* @return {module:model/ArrayOfNumberOnly} The populated <code>ArrayOfNumberOnly</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('ArrayNumber')) {
obj['ArrayNumber'] = ApiClient.convertToType(data['ArrayNumber'], ['Number']);
}
}
return obj;
}
/**
* @member {Array.<Number>} ArrayNumber
*/
exports.prototype['ArrayNumber'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,95 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/ReadOnlyFirst'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./ReadOnlyFirst'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.ArrayTest = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.ReadOnlyFirst);
}
}(this, function(ApiClient, ReadOnlyFirst) {
'use strict';
/**
* The ArrayTest model module.
* @module model/ArrayTest
* @version 1.0.0
*/
/**
* Constructs a new <code>ArrayTest</code>.
* @alias module:model/ArrayTest
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>ArrayTest</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ArrayTest} obj Optional instance to populate.
* @return {module:model/ArrayTest} The populated <code>ArrayTest</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('array_of_string')) {
obj['array_of_string'] = ApiClient.convertToType(data['array_of_string'], ['String']);
}
if (data.hasOwnProperty('array_array_of_integer')) {
obj['array_array_of_integer'] = ApiClient.convertToType(data['array_array_of_integer'], [['Number']]);
}
if (data.hasOwnProperty('array_array_of_model')) {
obj['array_array_of_model'] = ApiClient.convertToType(data['array_array_of_model'], [[ReadOnlyFirst]]);
}
}
return obj;
}
/**
* @member {Array.<String>} array_of_string
*/
exports.prototype['array_of_string'] = undefined;
/**
* @member {Array.<Array.<Number>>} array_array_of_integer
*/
exports.prototype['array_array_of_integer'] = undefined;
/**
* @member {Array.<Array.<module:model/ReadOnlyFirst>>} array_array_of_model
*/
exports.prototype['array_array_of_model'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,120 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.Capitalization = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Capitalization model module.
* @module model/Capitalization
* @version 1.0.0
*/
/**
* Constructs a new <code>Capitalization</code>.
* @alias module:model/Capitalization
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Capitalization</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Capitalization} obj Optional instance to populate.
* @return {module:model/Capitalization} The populated <code>Capitalization</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('smallCamel')) {
obj['smallCamel'] = ApiClient.convertToType(data['smallCamel'], 'String');
}
if (data.hasOwnProperty('CapitalCamel')) {
obj['CapitalCamel'] = ApiClient.convertToType(data['CapitalCamel'], 'String');
}
if (data.hasOwnProperty('small_Snake')) {
obj['small_Snake'] = ApiClient.convertToType(data['small_Snake'], 'String');
}
if (data.hasOwnProperty('Capital_Snake')) {
obj['Capital_Snake'] = ApiClient.convertToType(data['Capital_Snake'], 'String');
}
if (data.hasOwnProperty('SCA_ETH_Flow_Points')) {
obj['SCA_ETH_Flow_Points'] = ApiClient.convertToType(data['SCA_ETH_Flow_Points'], 'String');
}
if (data.hasOwnProperty('ATT_NAME')) {
obj['ATT_NAME'] = ApiClient.convertToType(data['ATT_NAME'], 'String');
}
}
return obj;
}
/**
* @member {String} smallCamel
*/
exports.prototype['smallCamel'] = undefined;
/**
* @member {String} CapitalCamel
*/
exports.prototype['CapitalCamel'] = undefined;
/**
* @member {String} small_Snake
*/
exports.prototype['small_Snake'] = undefined;
/**
* @member {String} Capital_Snake
*/
exports.prototype['Capital_Snake'] = undefined;
/**
* @member {String} SCA_ETH_Flow_Points
*/
exports.prototype['SCA_ETH_Flow_Points'] = undefined;
/**
* Name of the pet
* @member {String} ATT_NAME
*/
exports.prototype['ATT_NAME'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,84 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Animal'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Animal'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.Cat = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal);
}
}(this, function(ApiClient, Animal) {
'use strict';
/**
* The Cat model module.
* @module model/Cat
* @version 1.0.0
*/
/**
* Constructs a new <code>Cat</code>.
* @alias module:model/Cat
* @class
* @extends module:model/Animal
* @param className {String}
*/
var exports = function(className) {
var _this = this;
Animal.call(_this, className);
};
/**
* Constructs a <code>Cat</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Cat} obj Optional instance to populate.
* @return {module:model/Cat} The populated <code>Cat</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
Animal.constructFromObject(data, obj);
if (data.hasOwnProperty('declawed')) {
obj['declawed'] = ApiClient.convertToType(data['declawed'], 'Boolean');
}
}
return obj;
}
exports.prototype = Object.create(Animal.prototype);
exports.prototype.constructor = exports;
/**
* @member {Boolean} declawed
*/
exports.prototype['declawed'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,87 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.Category = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Category model module.
* @module model/Category
* @version 1.0.0
*/
/**
* Constructs a new <code>Category</code>.
* @alias module:model/Category
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Category</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Category} obj Optional instance to populate.
* @return {module:model/Category} The populated <code>Category</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
}
return obj;
}
/**
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**
* @member {String} name
*/
exports.prototype['name'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,80 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.ClassModel = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The ClassModel model module.
* @module model/ClassModel
* @version 1.0.0
*/
/**
* Constructs a new <code>ClassModel</code>.
* Model for testing model with \&quot;_class\&quot; property
* @alias module:model/ClassModel
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>ClassModel</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ClassModel} obj Optional instance to populate.
* @return {module:model/ClassModel} The populated <code>ClassModel</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('_class')) {
obj['_class'] = ApiClient.convertToType(data['_class'], 'String');
}
}
return obj;
}
/**
* @member {String} _class
*/
exports.prototype['_class'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,79 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.Client = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Client model module.
* @module model/Client
* @version 1.0.0
*/
/**
* Constructs a new <code>Client</code>.
* @alias module:model/Client
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Client</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Client} obj Optional instance to populate.
* @return {module:model/Client} The populated <code>Client</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('client')) {
obj['client'] = ApiClient.convertToType(data['client'], 'String');
}
}
return obj;
}
/**
* @member {String} client
*/
exports.prototype['client'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,84 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Animal'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Animal'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.Dog = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal);
}
}(this, function(ApiClient, Animal) {
'use strict';
/**
* The Dog model module.
* @module model/Dog
* @version 1.0.0
*/
/**
* Constructs a new <code>Dog</code>.
* @alias module:model/Dog
* @class
* @extends module:model/Animal
* @param className {String}
*/
var exports = function(className) {
var _this = this;
Animal.call(_this, className);
};
/**
* Constructs a <code>Dog</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Dog} obj Optional instance to populate.
* @return {module:model/Dog} The populated <code>Dog</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
Animal.constructFromObject(data, obj);
if (data.hasOwnProperty('breed')) {
obj['breed'] = ApiClient.convertToType(data['breed'], 'String');
}
}
return obj;
}
exports.prototype = Object.create(Animal.prototype);
exports.prototype.constructor = exports;
/**
* @member {String} breed
*/
exports.prototype['breed'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,121 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.EnumArrays = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The EnumArrays model module.
* @module model/EnumArrays
* @version 1.0.0
*/
/**
* Constructs a new <code>EnumArrays</code>.
* @alias module:model/EnumArrays
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>EnumArrays</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/EnumArrays} obj Optional instance to populate.
* @return {module:model/EnumArrays} The populated <code>EnumArrays</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('just_symbol')) {
obj['just_symbol'] = ApiClient.convertToType(data['just_symbol'], 'String');
}
if (data.hasOwnProperty('array_enum')) {
obj['array_enum'] = ApiClient.convertToType(data['array_enum'], ['String']);
}
}
return obj;
}
/**
* @member {module:model/EnumArrays.JustSymbolEnum} just_symbol
*/
exports.prototype['just_symbol'] = undefined;
/**
* @member {Array.<module:model/EnumArrays.ArrayEnumEnum>} array_enum
*/
exports.prototype['array_enum'] = undefined;
/**
* Allowed values for the <code>just_symbol</code> property.
* @enum {String}
* @readonly
*/
exports.JustSymbolEnum = {
/**
* value: ">="
* @const
*/
"GREATER_THAN_OR_EQUAL_TO": ">=",
/**
* value: "$"
* @const
*/
"DOLLAR": "$" };
/**
* Allowed values for the <code>arrayEnum</code> property.
* @enum {String}
* @readonly
*/
exports.ArrayEnumEnum = {
/**
* value: "fish"
* @const
*/
"fish": "fish",
/**
* value: "crab"
* @const
*/
"crab": "crab" };
return exports;
}));

View File

@@ -0,0 +1,66 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.EnumClass = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* Enum class EnumClass.
* @enum {}
* @readonly
*/
var exports = {
/**
* value: "_abc"
* @const
*/
"_abc": "_abc",
/**
* value: "-efg"
* @const
*/
"-efg": "-efg",
/**
* value: "(xyz)"
* @const
*/
"(xyz)": "(xyz)" };
/**
* Returns a <code>EnumClass</code> enum value from a Javascript object name.
* @param {Object} data The plain JavaScript object containing the name of the enum value.
* @return {module:model/EnumClass} The enum <code>EnumClass</code> value.
*/
exports.constructFromObject = function(object) {
return object;
}
return exports;
}));

View File

@@ -0,0 +1,159 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/OuterEnum'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./OuterEnum'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.EnumTest = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.OuterEnum);
}
}(this, function(ApiClient, OuterEnum) {
'use strict';
/**
* The EnumTest model module.
* @module model/EnumTest
* @version 1.0.0
*/
/**
* Constructs a new <code>EnumTest</code>.
* @alias module:model/EnumTest
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>EnumTest</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/EnumTest} obj Optional instance to populate.
* @return {module:model/EnumTest} The populated <code>EnumTest</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('enum_string')) {
obj['enum_string'] = ApiClient.convertToType(data['enum_string'], 'String');
}
if (data.hasOwnProperty('enum_integer')) {
obj['enum_integer'] = ApiClient.convertToType(data['enum_integer'], 'Number');
}
if (data.hasOwnProperty('enum_number')) {
obj['enum_number'] = ApiClient.convertToType(data['enum_number'], 'Number');
}
if (data.hasOwnProperty('outerEnum')) {
obj['outerEnum'] = OuterEnum.constructFromObject(data['outerEnum']);
}
}
return obj;
}
/**
* @member {module:model/EnumTest.EnumStringEnum} enum_string
*/
exports.prototype['enum_string'] = undefined;
/**
* @member {module:model/EnumTest.EnumIntegerEnum} enum_integer
*/
exports.prototype['enum_integer'] = undefined;
/**
* @member {module:model/EnumTest.EnumNumberEnum} enum_number
*/
exports.prototype['enum_number'] = undefined;
/**
* @member {module:model/OuterEnum} outerEnum
*/
exports.prototype['outerEnum'] = undefined;
/**
* Allowed values for the <code>enum_string</code> property.
* @enum {String}
* @readonly
*/
exports.EnumStringEnum = {
/**
* value: "UPPER"
* @const
*/
"UPPER": "UPPER",
/**
* value: "lower"
* @const
*/
"lower": "lower",
/**
* value: ""
* @const
*/
"empty": "" };
/**
* Allowed values for the <code>enum_integer</code> property.
* @enum {Number}
* @readonly
*/
exports.EnumIntegerEnum = {
/**
* value: 1
* @const
*/
"1": 1,
/**
* value: -1
* @const
*/
"-1": -1 };
/**
* Allowed values for the <code>enum_number</code> property.
* @enum {Number}
* @readonly
*/
exports.EnumNumberEnum = {
/**
* value: 1.1
* @const
*/
"1.1": 1.1,
/**
* value: -1.2
* @const
*/
"-1.2": -1.2 };
return exports;
}));

View File

@@ -0,0 +1,179 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.FormatTest = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The FormatTest model module.
* @module model/FormatTest
* @version 1.0.0
*/
/**
* Constructs a new <code>FormatTest</code>.
* @alias module:model/FormatTest
* @class
* @param _number {Number}
* @param _byte {Blob}
* @param _date {Date}
* @param password {String}
*/
var exports = function(_number, _byte, _date, password) {
var _this = this;
_this['number'] = _number;
_this['byte'] = _byte;
_this['date'] = _date;
_this['password'] = password;
};
/**
* Constructs a <code>FormatTest</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/FormatTest} obj Optional instance to populate.
* @return {module:model/FormatTest} The populated <code>FormatTest</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('integer')) {
obj['integer'] = ApiClient.convertToType(data['integer'], 'Number');
}
if (data.hasOwnProperty('int32')) {
obj['int32'] = ApiClient.convertToType(data['int32'], 'Number');
}
if (data.hasOwnProperty('int64')) {
obj['int64'] = ApiClient.convertToType(data['int64'], 'Number');
}
if (data.hasOwnProperty('number')) {
obj['number'] = ApiClient.convertToType(data['number'], 'Number');
}
if (data.hasOwnProperty('float')) {
obj['float'] = ApiClient.convertToType(data['float'], 'Number');
}
if (data.hasOwnProperty('double')) {
obj['double'] = ApiClient.convertToType(data['double'], 'Number');
}
if (data.hasOwnProperty('string')) {
obj['string'] = ApiClient.convertToType(data['string'], 'String');
}
if (data.hasOwnProperty('byte')) {
obj['byte'] = ApiClient.convertToType(data['byte'], 'Blob');
}
if (data.hasOwnProperty('binary')) {
obj['binary'] = ApiClient.convertToType(data['binary'], 'Blob');
}
if (data.hasOwnProperty('date')) {
obj['date'] = ApiClient.convertToType(data['date'], 'Date');
}
if (data.hasOwnProperty('dateTime')) {
obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date');
}
if (data.hasOwnProperty('uuid')) {
obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String');
}
if (data.hasOwnProperty('password')) {
obj['password'] = ApiClient.convertToType(data['password'], 'String');
}
}
return obj;
}
/**
* @member {Number} integer
*/
exports.prototype['integer'] = undefined;
/**
* @member {Number} int32
*/
exports.prototype['int32'] = undefined;
/**
* @member {Number} int64
*/
exports.prototype['int64'] = undefined;
/**
* @member {Number} number
*/
exports.prototype['number'] = undefined;
/**
* @member {Number} float
*/
exports.prototype['float'] = undefined;
/**
* @member {Number} double
*/
exports.prototype['double'] = undefined;
/**
* @member {String} string
*/
exports.prototype['string'] = undefined;
/**
* @member {Blob} byte
*/
exports.prototype['byte'] = undefined;
/**
* @member {Blob} binary
*/
exports.prototype['binary'] = undefined;
/**
* @member {Date} date
*/
exports.prototype['date'] = undefined;
/**
* @member {Date} dateTime
*/
exports.prototype['dateTime'] = undefined;
/**
* @member {String} uuid
*/
exports.prototype['uuid'] = undefined;
/**
* @member {String} password
*/
exports.prototype['password'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,87 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.HasOnlyReadOnly = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The HasOnlyReadOnly model module.
* @module model/HasOnlyReadOnly
* @version 1.0.0
*/
/**
* Constructs a new <code>HasOnlyReadOnly</code>.
* @alias module:model/HasOnlyReadOnly
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>HasOnlyReadOnly</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/HasOnlyReadOnly} obj Optional instance to populate.
* @return {module:model/HasOnlyReadOnly} The populated <code>HasOnlyReadOnly</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('bar')) {
obj['bar'] = ApiClient.convertToType(data['bar'], 'String');
}
if (data.hasOwnProperty('foo')) {
obj['foo'] = ApiClient.convertToType(data['foo'], 'String');
}
}
return obj;
}
/**
* @member {String} bar
*/
exports.prototype['bar'] = undefined;
/**
* @member {String} foo
*/
exports.prototype['foo'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,79 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.List = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The List model module.
* @module model/List
* @version 1.0.0
*/
/**
* Constructs a new <code>List</code>.
* @alias module:model/List
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>List</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/List} obj Optional instance to populate.
* @return {module:model/List} The populated <code>List</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('123-list')) {
obj['123-list'] = ApiClient.convertToType(data['123-list'], 'String');
}
}
return obj;
}
/**
* @member {String} 123-list
*/
exports.prototype['123-list'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,104 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.MapTest = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The MapTest model module.
* @module model/MapTest
* @version 1.0.0
*/
/**
* Constructs a new <code>MapTest</code>.
* @alias module:model/MapTest
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>MapTest</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/MapTest} obj Optional instance to populate.
* @return {module:model/MapTest} The populated <code>MapTest</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('map_map_of_string')) {
obj['map_map_of_string'] = ApiClient.convertToType(data['map_map_of_string'], {'String': {'String': 'String'}});
}
if (data.hasOwnProperty('map_of_enum_string')) {
obj['map_of_enum_string'] = ApiClient.convertToType(data['map_of_enum_string'], {'String': 'String'});
}
}
return obj;
}
/**
* @member {Object.<String, Object.<String, String>>} map_map_of_string
*/
exports.prototype['map_map_of_string'] = undefined;
/**
* @member {Object.<String, module:model/MapTest.InnerEnum>} map_of_enum_string
*/
exports.prototype['map_of_enum_string'] = undefined;
/**
* Allowed values for the <code>inner</code> property.
* @enum {String}
* @readonly
*/
exports.InnerEnum = {
/**
* value: "UPPER"
* @const
*/
"UPPER": "UPPER",
/**
* value: "lower"
* @const
*/
"lower": "lower" };
return exports;
}));

View File

@@ -0,0 +1,95 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Animal'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Animal'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Animal);
}
}(this, function(ApiClient, Animal) {
'use strict';
/**
* The MixedPropertiesAndAdditionalPropertiesClass model module.
* @module model/MixedPropertiesAndAdditionalPropertiesClass
* @version 1.0.0
*/
/**
* Constructs a new <code>MixedPropertiesAndAdditionalPropertiesClass</code>.
* @alias module:model/MixedPropertiesAndAdditionalPropertiesClass
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>MixedPropertiesAndAdditionalPropertiesClass</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/MixedPropertiesAndAdditionalPropertiesClass} obj Optional instance to populate.
* @return {module:model/MixedPropertiesAndAdditionalPropertiesClass} The populated <code>MixedPropertiesAndAdditionalPropertiesClass</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('uuid')) {
obj['uuid'] = ApiClient.convertToType(data['uuid'], 'String');
}
if (data.hasOwnProperty('dateTime')) {
obj['dateTime'] = ApiClient.convertToType(data['dateTime'], 'Date');
}
if (data.hasOwnProperty('map')) {
obj['map'] = ApiClient.convertToType(data['map'], {'String': Animal});
}
}
return obj;
}
/**
* @member {String} uuid
*/
exports.prototype['uuid'] = undefined;
/**
* @member {Date} dateTime
*/
exports.prototype['dateTime'] = undefined;
/**
* @member {Object.<String, module:model/Animal>} map
*/
exports.prototype['map'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,88 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.Model200Response = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Model200Response model module.
* @module model/Model200Response
* @version 1.0.0
*/
/**
* Constructs a new <code>Model200Response</code>.
* Model for testing model name starting with number
* @alias module:model/Model200Response
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Model200Response</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Model200Response} obj Optional instance to populate.
* @return {module:model/Model200Response} The populated <code>Model200Response</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'Number');
}
if (data.hasOwnProperty('class')) {
obj['class'] = ApiClient.convertToType(data['class'], 'String');
}
}
return obj;
}
/**
* @member {Number} name
*/
exports.prototype['name'] = undefined;
/**
* @member {String} class
*/
exports.prototype['class'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,80 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.ModelReturn = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The ModelReturn model module.
* @module model/ModelReturn
* @version 1.0.0
*/
/**
* Constructs a new <code>ModelReturn</code>.
* Model for testing reserved words
* @alias module:model/ModelReturn
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>ModelReturn</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ModelReturn} obj Optional instance to populate.
* @return {module:model/ModelReturn} The populated <code>ModelReturn</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('return')) {
obj['return'] = ApiClient.convertToType(data['return'], 'Number');
}
}
return obj;
}
/**
* @member {Number} return
*/
exports.prototype['return'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,105 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.Name = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Name model module.
* @module model/Name
* @version 1.0.0
*/
/**
* Constructs a new <code>Name</code>.
* Model for testing model name same as property name
* @alias module:model/Name
* @class
* @param name {Number}
*/
var exports = function(name) {
var _this = this;
_this['name'] = name;
};
/**
* Constructs a <code>Name</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Name} obj Optional instance to populate.
* @return {module:model/Name} The populated <code>Name</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'Number');
}
if (data.hasOwnProperty('snake_case')) {
obj['snake_case'] = ApiClient.convertToType(data['snake_case'], 'Number');
}
if (data.hasOwnProperty('property')) {
obj['property'] = ApiClient.convertToType(data['property'], 'String');
}
if (data.hasOwnProperty('123Number')) {
obj['123Number'] = ApiClient.convertToType(data['123Number'], 'Number');
}
}
return obj;
}
/**
* @member {Number} name
*/
exports.prototype['name'] = undefined;
/**
* @member {Number} snake_case
*/
exports.prototype['snake_case'] = undefined;
/**
* @member {String} property
*/
exports.prototype['property'] = undefined;
/**
* @member {Number} 123Number
*/
exports.prototype['123Number'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,79 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.NumberOnly = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The NumberOnly model module.
* @module model/NumberOnly
* @version 1.0.0
*/
/**
* Constructs a new <code>NumberOnly</code>.
* @alias module:model/NumberOnly
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>NumberOnly</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/NumberOnly} obj Optional instance to populate.
* @return {module:model/NumberOnly} The populated <code>NumberOnly</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('JustNumber')) {
obj['JustNumber'] = ApiClient.convertToType(data['JustNumber'], 'Number');
}
}
return obj;
}
/**
* @member {Number} JustNumber
*/
exports.prototype['JustNumber'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,143 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.Order = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Order model module.
* @module model/Order
* @version 1.0.0
*/
/**
* Constructs a new <code>Order</code>.
* @alias module:model/Order
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Order</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Order} obj Optional instance to populate.
* @return {module:model/Order} The populated <code>Order</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('petId')) {
obj['petId'] = ApiClient.convertToType(data['petId'], 'Number');
}
if (data.hasOwnProperty('quantity')) {
obj['quantity'] = ApiClient.convertToType(data['quantity'], 'Number');
}
if (data.hasOwnProperty('shipDate')) {
obj['shipDate'] = ApiClient.convertToType(data['shipDate'], 'Date');
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
if (data.hasOwnProperty('complete')) {
obj['complete'] = ApiClient.convertToType(data['complete'], 'Boolean');
}
}
return obj;
}
/**
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**
* @member {Number} petId
*/
exports.prototype['petId'] = undefined;
/**
* @member {Number} quantity
*/
exports.prototype['quantity'] = undefined;
/**
* @member {Date} shipDate
*/
exports.prototype['shipDate'] = undefined;
/**
* Order Status
* @member {module:model/Order.StatusEnum} status
*/
exports.prototype['status'] = undefined;
/**
* @member {Boolean} complete
* @default false
*/
exports.prototype['complete'] = false;
/**
* Allowed values for the <code>status</code> property.
* @enum {String}
* @readonly
*/
exports.StatusEnum = {
/**
* value: "placed"
* @const
*/
"placed": "placed",
/**
* value: "approved"
* @const
*/
"approved": "approved",
/**
* value: "delivered"
* @const
*/
"delivered": "delivered" };
return exports;
}));

View File

@@ -0,0 +1,66 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.OuterEnum = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* Enum class OuterEnum.
* @enum {}
* @readonly
*/
var exports = {
/**
* value: "placed"
* @const
*/
"placed": "placed",
/**
* value: "approved"
* @const
*/
"approved": "approved",
/**
* value: "delivered"
* @const
*/
"delivered": "delivered" };
/**
* Returns a <code>OuterEnum</code> enum value from a Javascript object name.
* @param {Object} data The plain JavaScript object containing the name of the enum value.
* @return {module:model/OuterEnum} The enum <code>OuterEnum</code> value.
*/
exports.constructFromObject = function(object) {
return object;
}
return exports;
}));

View File

@@ -0,0 +1,144 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient', 'model/Category', 'model/Tag'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Category'), require('./Tag'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.Pet = factory(root.SwaggerPetstore.ApiClient, root.SwaggerPetstore.Category, root.SwaggerPetstore.Tag);
}
}(this, function(ApiClient, Category, Tag) {
'use strict';
/**
* The Pet model module.
* @module model/Pet
* @version 1.0.0
*/
/**
* Constructs a new <code>Pet</code>.
* @alias module:model/Pet
* @class
* @param name {String}
* @param photoUrls {Array.<String>}
*/
var exports = function(name, photoUrls) {
var _this = this;
_this['name'] = name;
_this['photoUrls'] = photoUrls;
};
/**
* Constructs a <code>Pet</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Pet} obj Optional instance to populate.
* @return {module:model/Pet} The populated <code>Pet</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('category')) {
obj['category'] = Category.constructFromObject(data['category']);
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('photoUrls')) {
obj['photoUrls'] = ApiClient.convertToType(data['photoUrls'], ['String']);
}
if (data.hasOwnProperty('tags')) {
obj['tags'] = ApiClient.convertToType(data['tags'], [Tag]);
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
}
return obj;
}
/**
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**
* @member {module:model/Category} category
*/
exports.prototype['category'] = undefined;
/**
* @member {String} name
*/
exports.prototype['name'] = undefined;
/**
* @member {Array.<String>} photoUrls
*/
exports.prototype['photoUrls'] = undefined;
/**
* @member {Array.<module:model/Tag>} tags
*/
exports.prototype['tags'] = undefined;
/**
* pet status in the store
* @member {module:model/Pet.StatusEnum} status
*/
exports.prototype['status'] = undefined;
/**
* Allowed values for the <code>status</code> property.
* @enum {String}
* @readonly
*/
exports.StatusEnum = {
/**
* value: "available"
* @const
*/
"available": "available",
/**
* value: "pending"
* @const
*/
"pending": "pending",
/**
* value: "sold"
* @const
*/
"sold": "sold" };
return exports;
}));

View File

@@ -0,0 +1,87 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.ReadOnlyFirst = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The ReadOnlyFirst model module.
* @module model/ReadOnlyFirst
* @version 1.0.0
*/
/**
* Constructs a new <code>ReadOnlyFirst</code>.
* @alias module:model/ReadOnlyFirst
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>ReadOnlyFirst</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/ReadOnlyFirst} obj Optional instance to populate.
* @return {module:model/ReadOnlyFirst} The populated <code>ReadOnlyFirst</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('bar')) {
obj['bar'] = ApiClient.convertToType(data['bar'], 'String');
}
if (data.hasOwnProperty('baz')) {
obj['baz'] = ApiClient.convertToType(data['baz'], 'String');
}
}
return obj;
}
/**
* @member {String} bar
*/
exports.prototype['bar'] = undefined;
/**
* @member {String} baz
*/
exports.prototype['baz'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,79 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.SpecialModelName = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The SpecialModelName model module.
* @module model/SpecialModelName
* @version 1.0.0
*/
/**
* Constructs a new <code>SpecialModelName</code>.
* @alias module:model/SpecialModelName
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>SpecialModelName</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/SpecialModelName} obj Optional instance to populate.
* @return {module:model/SpecialModelName} The populated <code>SpecialModelName</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('$special[property.name]')) {
obj['$special[property.name]'] = ApiClient.convertToType(data['$special[property.name]'], 'Number');
}
}
return obj;
}
/**
* @member {Number} $special[property.name]
*/
exports.prototype['$special[property.name]'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,87 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.Tag = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The Tag model module.
* @module model/Tag
* @version 1.0.0
*/
/**
* Constructs a new <code>Tag</code>.
* @alias module:model/Tag
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Tag</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/Tag} obj Optional instance to populate.
* @return {module:model/Tag} The populated <code>Tag</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
}
return obj;
}
/**
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**
* @member {String} name
*/
exports.prototype['name'] = undefined;
return exports;
}));

View File

@@ -0,0 +1,136 @@
/**
* Swagger Petstore
* This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\
*
* OpenAPI spec version: 1.0.0
* Contact: apiteam@swagger.io
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*
*/
(function(root, factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define(['ApiClient'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'));
} else {
// Browser globals (root is window)
if (!root.SwaggerPetstore) {
root.SwaggerPetstore = {};
}
root.SwaggerPetstore.User = factory(root.SwaggerPetstore.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The User model module.
* @module model/User
* @version 1.0.0
*/
/**
* Constructs a new <code>User</code>.
* @alias module:model/User
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>User</code> from a plain JavaScript object, optionally creating a new instance.
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
* @param {Object} data The plain JavaScript object bearing properties of interest.
* @param {module:model/User} obj Optional instance to populate.
* @return {module:model/User} The populated <code>User</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('username')) {
obj['username'] = ApiClient.convertToType(data['username'], 'String');
}
if (data.hasOwnProperty('firstName')) {
obj['firstName'] = ApiClient.convertToType(data['firstName'], 'String');
}
if (data.hasOwnProperty('lastName')) {
obj['lastName'] = ApiClient.convertToType(data['lastName'], 'String');
}
if (data.hasOwnProperty('email')) {
obj['email'] = ApiClient.convertToType(data['email'], 'String');
}
if (data.hasOwnProperty('password')) {
obj['password'] = ApiClient.convertToType(data['password'], 'String');
}
if (data.hasOwnProperty('phone')) {
obj['phone'] = ApiClient.convertToType(data['phone'], 'String');
}
if (data.hasOwnProperty('userStatus')) {
obj['userStatus'] = ApiClient.convertToType(data['userStatus'], 'Number');
}
}
return obj;
}
/**
* @member {Number} id
*/
exports.prototype['id'] = undefined;
/**
* @member {String} username
*/
exports.prototype['username'] = undefined;
/**
* @member {String} firstName
*/
exports.prototype['firstName'] = undefined;
/**
* @member {String} lastName
*/
exports.prototype['lastName'] = undefined;
/**
* @member {String} email
*/
exports.prototype['email'] = undefined;
/**
* @member {String} password
*/
exports.prototype['password'] = undefined;
/**
* @member {String} phone
*/
exports.prototype['phone'] = undefined;
/**
* User Status
* @member {Number} userStatus
*/
exports.prototype['userStatus'] = undefined;
return exports;
}));