mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-08 21:36:13 +00:00
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:
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
89
samples/client/petstore/javascript-es6/src/model/Animal.js
Normal file
89
samples/client/petstore/javascript-es6/src/model/Animal.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
84
samples/client/petstore/javascript-es6/src/model/Cat.js
Normal file
84
samples/client/petstore/javascript-es6/src/model/Cat.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
87
samples/client/petstore/javascript-es6/src/model/Category.js
Normal file
87
samples/client/petstore/javascript-es6/src/model/Category.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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 \"_class\" 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;
|
||||
}));
|
||||
|
||||
|
||||
79
samples/client/petstore/javascript-es6/src/model/Client.js
Normal file
79
samples/client/petstore/javascript-es6/src/model/Client.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
84
samples/client/petstore/javascript-es6/src/model/Dog.js
Normal file
84
samples/client/petstore/javascript-es6/src/model/Dog.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
121
samples/client/petstore/javascript-es6/src/model/EnumArrays.js
Normal file
121
samples/client/petstore/javascript-es6/src/model/EnumArrays.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
159
samples/client/petstore/javascript-es6/src/model/EnumTest.js
Normal file
159
samples/client/petstore/javascript-es6/src/model/EnumTest.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
179
samples/client/petstore/javascript-es6/src/model/FormatTest.js
Normal file
179
samples/client/petstore/javascript-es6/src/model/FormatTest.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
79
samples/client/petstore/javascript-es6/src/model/List.js
Normal file
79
samples/client/petstore/javascript-es6/src/model/List.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
104
samples/client/petstore/javascript-es6/src/model/MapTest.js
Normal file
104
samples/client/petstore/javascript-es6/src/model/MapTest.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
105
samples/client/petstore/javascript-es6/src/model/Name.js
Normal file
105
samples/client/petstore/javascript-es6/src/model/Name.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
143
samples/client/petstore/javascript-es6/src/model/Order.js
Normal file
143
samples/client/petstore/javascript-es6/src/model/Order.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
144
samples/client/petstore/javascript-es6/src/model/Pet.js
Normal file
144
samples/client/petstore/javascript-es6/src/model/Pet.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
@@ -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;
|
||||
}));
|
||||
|
||||
|
||||
87
samples/client/petstore/javascript-es6/src/model/Tag.js
Normal file
87
samples/client/petstore/javascript-es6/src/model/Tag.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
136
samples/client/petstore/javascript-es6/src/model/User.js
Normal file
136
samples/client/petstore/javascript-es6/src/model/User.js
Normal 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;
|
||||
}));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user