Combine javascript and javascript-apollo generators (#13270)

* Combine javascript and javascript-apollo generator functionality

* Combine javascript and javascript-apollo templates

* update configs

* deprecate javascript-apollo generator

* bonus magic string deletion 

* update samples

* update generator docs

* fix: include .babelrc in apollo generation

* update samples

* update samples

* rename javascript-apollo to javascript-apollo-deprecated

* fix javascript apollo library template

Apollo library now uses the partial_model_generic template file from the ES6 library, as it includes many fixes and improvements (including handling models with ill-named attributes)

* update samples

* Create javascript-apollo-deprecated.md

* Updated javascript generator template's gitignore

Updates .gitignore with that from https://github.com/github/gitignore/blob/main/Node.gitignore

Main reason for the update is to ignore the 'dist' folder with compiled files by default.

* javascript generator: merge api_test template files

The only difference is that Apollo is not designed for browser, so having a "if(browser)" check is useless, but doesn't hurt.

* update docs

* cleanup

* avoid possible config clash

* update javascript-apollo sample

* update javascript-es6 sample

I kept the pom.xml from before

* update javascript-promise-es6 sample

kept pom.xml

* update samples
This commit is contained in:
João Neto
2022-08-27 07:29:35 +02:00
committed by GitHub
parent 2c22a01779
commit 62a0878bae
353 changed files with 11411 additions and 5169 deletions

View File

@@ -1,70 +0,0 @@
/**
* OpenAPI 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
import Animal from './Animal';
/**
* The AnimalFarm model module.
* @module model/AnimalFarm
* @version 1.0.0
*/
class AnimalFarm extends Array {
/**
* Constructs a new <code>AnimalFarm</code>.
* @alias module:model/AnimalFarm
* @extends Array
*/
constructor() {
super();
AnimalFarm.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* 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.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new AnimalFarm();
ApiClient.constructFromObject(data, obj, 'Animal');
}
return obj;
}
}
export default AnimalFarm;

View File

@@ -1,81 +0,0 @@
/**
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The InlineObject model module.
* @module model/InlineObject
* @version 1.0.0
*/
class InlineObject {
/**
* Constructs a new <code>InlineObject</code>.
* @alias module:model/InlineObject
*/
constructor() {
InlineObject.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>InlineObject</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/InlineObject} obj Optional instance to populate.
* @return {module:model/InlineObject} The populated <code>InlineObject</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new InlineObject();
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
}
return obj;
}
}
/**
* Updated name of the pet
* @member {String} name
*/
InlineObject.prototype['name'] = undefined;
/**
* Updated status of the pet
* @member {String} status
*/
InlineObject.prototype['status'] = undefined;
export default InlineObject;

View File

@@ -1,81 +0,0 @@
/**
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The InlineObject1 model module.
* @module model/InlineObject1
* @version 1.0.0
*/
class InlineObject1 {
/**
* Constructs a new <code>InlineObject1</code>.
* @alias module:model/InlineObject1
*/
constructor() {
InlineObject1.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>InlineObject1</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/InlineObject1} obj Optional instance to populate.
* @return {module:model/InlineObject1} The populated <code>InlineObject1</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new InlineObject1();
if (data.hasOwnProperty('additionalMetadata')) {
obj['additionalMetadata'] = ApiClient.convertToType(data['additionalMetadata'], 'String');
}
if (data.hasOwnProperty('file')) {
obj['file'] = ApiClient.convertToType(data['file'], File);
}
}
return obj;
}
}
/**
* Additional data to pass to server
* @member {String} additionalMetadata
*/
InlineObject1.prototype['additionalMetadata'] = undefined;
/**
* file to upload
* @member {File} file
*/
InlineObject1.prototype['file'] = undefined;
export default InlineObject1;

View File

@@ -1,130 +0,0 @@
/**
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The InlineObject2 model module.
* @module model/InlineObject2
* @version 1.0.0
*/
class InlineObject2 {
/**
* Constructs a new <code>InlineObject2</code>.
* @alias module:model/InlineObject2
*/
constructor() {
InlineObject2.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>InlineObject2</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/InlineObject2} obj Optional instance to populate.
* @return {module:model/InlineObject2} The populated <code>InlineObject2</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new InlineObject2();
if (data.hasOwnProperty('enum_form_string_array')) {
obj['enum_form_string_array'] = ApiClient.convertToType(data['enum_form_string_array'], ['String']);
}
if (data.hasOwnProperty('enum_form_string')) {
obj['enum_form_string'] = ApiClient.convertToType(data['enum_form_string'], 'String');
}
}
return obj;
}
}
/**
* Form parameter enum test (string array)
* @member {Array.<module:model/InlineObject2.EnumFormStringArrayEnum>} enum_form_string_array
*/
InlineObject2.prototype['enum_form_string_array'] = undefined;
/**
* Form parameter enum test (string)
* @member {module:model/InlineObject2.EnumFormStringEnum} enum_form_string
* @default '-efg'
*/
InlineObject2.prototype['enum_form_string'] = '-efg';
/**
* Allowed values for the <code>enumFormStringArray</code> property.
* @enum {String}
* @readonly
*/
InlineObject2['EnumFormStringArrayEnum'] = {
/**
* value: ">"
* @const
*/
"GREATER_THAN": ">",
/**
* value: "$"
* @const
*/
"DOLLAR": "$"
};
/**
* Allowed values for the <code>enum_form_string</code> property.
* @enum {String}
* @readonly
*/
InlineObject2['EnumFormStringEnum'] = {
/**
* value: "_abc"
* @const
*/
"_abc": "_abc",
/**
* value: "-efg"
* @const
*/
"-efg": "-efg",
/**
* value: "(xyz)"
* @const
*/
"(xyz)": "(xyz)"
};
export default InlineObject2;

View File

@@ -1,197 +0,0 @@
/**
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The InlineObject3 model module.
* @module model/InlineObject3
* @version 1.0.0
*/
class InlineObject3 {
/**
* Constructs a new <code>InlineObject3</code>.
* @alias module:model/InlineObject3
* @param _number {Number} None
* @param _double {Number} None
* @param patternWithoutDelimiter {String} None
* @param _byte {Blob} None
*/
constructor(_number, _double, patternWithoutDelimiter, _byte) {
InlineObject3.initialize(this, _number, _double, patternWithoutDelimiter, _byte);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, _number, _double, patternWithoutDelimiter, _byte) {
obj['number'] = _number;
obj['double'] = _double;
obj['pattern_without_delimiter'] = patternWithoutDelimiter;
obj['byte'] = _byte;
}
/**
* Constructs a <code>InlineObject3</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/InlineObject3} obj Optional instance to populate.
* @return {module:model/InlineObject3} The populated <code>InlineObject3</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new InlineObject3();
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('pattern_without_delimiter')) {
obj['pattern_without_delimiter'] = ApiClient.convertToType(data['pattern_without_delimiter'], 'String');
}
if (data.hasOwnProperty('byte')) {
obj['byte'] = ApiClient.convertToType(data['byte'], 'Blob');
}
if (data.hasOwnProperty('binary')) {
obj['binary'] = ApiClient.convertToType(data['binary'], File);
}
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('password')) {
obj['password'] = ApiClient.convertToType(data['password'], 'String');
}
if (data.hasOwnProperty('callback')) {
obj['callback'] = ApiClient.convertToType(data['callback'], 'String');
}
}
return obj;
}
}
/**
* None
* @member {Number} integer
*/
InlineObject3.prototype['integer'] = undefined;
/**
* None
* @member {Number} int32
*/
InlineObject3.prototype['int32'] = undefined;
/**
* None
* @member {Number} int64
*/
InlineObject3.prototype['int64'] = undefined;
/**
* None
* @member {Number} number
*/
InlineObject3.prototype['number'] = undefined;
/**
* None
* @member {Number} float
*/
InlineObject3.prototype['float'] = undefined;
/**
* None
* @member {Number} double
*/
InlineObject3.prototype['double'] = undefined;
/**
* None
* @member {String} string
*/
InlineObject3.prototype['string'] = undefined;
/**
* None
* @member {String} pattern_without_delimiter
*/
InlineObject3.prototype['pattern_without_delimiter'] = undefined;
/**
* None
* @member {Blob} byte
*/
InlineObject3.prototype['byte'] = undefined;
/**
* None
* @member {File} binary
*/
InlineObject3.prototype['binary'] = undefined;
/**
* None
* @member {Date} date
*/
InlineObject3.prototype['date'] = undefined;
/**
* None
* @member {Date} dateTime
*/
InlineObject3.prototype['dateTime'] = undefined;
/**
* None
* @member {String} password
*/
InlineObject3.prototype['password'] = undefined;
/**
* None
* @member {String} callback
*/
InlineObject3.prototype['callback'] = undefined;
export default InlineObject3;

View File

@@ -1,85 +0,0 @@
/**
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The InlineObject4 model module.
* @module model/InlineObject4
* @version 1.0.0
*/
class InlineObject4 {
/**
* Constructs a new <code>InlineObject4</code>.
* @alias module:model/InlineObject4
* @param param {String} field1
* @param param2 {String} field2
*/
constructor(param, param2) {
InlineObject4.initialize(this, param, param2);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, param, param2) {
obj['param'] = param;
obj['param2'] = param2;
}
/**
* Constructs a <code>InlineObject4</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/InlineObject4} obj Optional instance to populate.
* @return {module:model/InlineObject4} The populated <code>InlineObject4</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new InlineObject4();
if (data.hasOwnProperty('param')) {
obj['param'] = ApiClient.convertToType(data['param'], 'String');
}
if (data.hasOwnProperty('param2')) {
obj['param2'] = ApiClient.convertToType(data['param2'], 'String');
}
}
return obj;
}
}
/**
* field1
* @member {String} param
*/
InlineObject4.prototype['param'] = undefined;
/**
* field2
* @member {String} param2
*/
InlineObject4.prototype['param2'] = undefined;
export default InlineObject4;

View File

@@ -1,83 +0,0 @@
/**
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The InlineObject5 model module.
* @module model/InlineObject5
* @version 1.0.0
*/
class InlineObject5 {
/**
* Constructs a new <code>InlineObject5</code>.
* @alias module:model/InlineObject5
* @param requiredFile {File} file to upload
*/
constructor(requiredFile) {
InlineObject5.initialize(this, requiredFile);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, requiredFile) {
obj['requiredFile'] = requiredFile;
}
/**
* Constructs a <code>InlineObject5</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/InlineObject5} obj Optional instance to populate.
* @return {module:model/InlineObject5} The populated <code>InlineObject5</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new InlineObject5();
if (data.hasOwnProperty('additionalMetadata')) {
obj['additionalMetadata'] = ApiClient.convertToType(data['additionalMetadata'], 'String');
}
if (data.hasOwnProperty('requiredFile')) {
obj['requiredFile'] = ApiClient.convertToType(data['requiredFile'], File);
}
}
return obj;
}
}
/**
* Additional data to pass to server
* @member {String} additionalMetadata
*/
InlineObject5.prototype['additionalMetadata'] = undefined;
/**
* file to upload
* @member {File} requiredFile
*/
InlineObject5.prototype['requiredFile'] = undefined;
export default InlineObject5;

View File

@@ -1,72 +0,0 @@
/**
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
import Foo from './Foo';
/**
* The InlineResponseDefault model module.
* @module model/InlineResponseDefault
* @version 1.0.0
*/
class InlineResponseDefault {
/**
* Constructs a new <code>InlineResponseDefault</code>.
* @alias module:model/InlineResponseDefault
*/
constructor() {
InlineResponseDefault.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>InlineResponseDefault</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/InlineResponseDefault} obj Optional instance to populate.
* @return {module:model/InlineResponseDefault} The populated <code>InlineResponseDefault</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new InlineResponseDefault();
if (data.hasOwnProperty('string')) {
obj['string'] = Foo.constructFromObject(data['string']);
}
}
return obj;
}
}
/**
* @member {module:model/Foo} string
*/
InlineResponseDefault.prototype['string'] = undefined;
export default InlineResponseDefault;

View File

@@ -1,72 +0,0 @@
/**
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The ModelReturn model module.
* @module model/ModelReturn
* @version 1.0.0
*/
class ModelReturn {
/**
* Constructs a new <code>ModelReturn</code>.
* Model for testing reserved words
* @alias module:model/ModelReturn
*/
constructor() {
ModelReturn.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* 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.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new ModelReturn();
if (data.hasOwnProperty('return')) {
obj['return'] = ApiClient.convertToType(data['return'], 'Number');
}
}
return obj;
}
}
/**
* @member {Number} return
*/
ModelReturn.prototype['return'] = undefined;
export default ModelReturn;

View File

@@ -1,46 +0,0 @@
/**
* OpenAPI 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: \" \\
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* Enum class SingleRefType.
* @enum {}
* @readonly
*/
export default class SingleRefType {
/**
* value: "admin"
* @const
*/
"admin" = "admin";
/**
* value: "user"
* @const
*/
"user" = "user";
/**
* Returns a <code>SingleRefType</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/SingleRefType} The enum <code>SingleRefType</code> value.
*/
static constructFromObject(object) {
return object;
}
}

View File

@@ -1,67 +0,0 @@
/**
* OpenAPI 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The StringBooleanMap model module.
* @module model/StringBooleanMap
* @version 1.0.0
*/
class StringBooleanMap {
/**
* Constructs a new <code>StringBooleanMap</code>.
* @alias module:model/StringBooleanMap
* @extends Object
*/
constructor() {
StringBooleanMap.initialize(this);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj) {
}
/**
* Constructs a <code>StringBooleanMap</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/StringBooleanMap} obj Optional instance to populate.
* @return {module:model/StringBooleanMap} The populated <code>StringBooleanMap</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new StringBooleanMap();
ApiClient.constructFromObject(data, obj, 'Boolean');
}
return obj;
}
}
export default StringBooleanMap;

View File

@@ -1,115 +0,0 @@
/**
* OpenAPI 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The TypeHolderDefault model module.
* @module model/TypeHolderDefault
* @version 1.0.0
*/
class TypeHolderDefault {
/**
* Constructs a new <code>TypeHolderDefault</code>.
* @alias module:model/TypeHolderDefault
* @param stringItem {String}
* @param numberItem {Number}
* @param integerItem {Number}
* @param boolItem {Boolean}
* @param arrayItem {Array.<Number>}
*/
constructor(stringItem, numberItem, integerItem, boolItem, arrayItem) {
TypeHolderDefault.initialize(this, stringItem, numberItem, integerItem, boolItem, arrayItem);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, stringItem, numberItem, integerItem, boolItem, arrayItem) {
obj['string_item'] = stringItem;
obj['number_item'] = numberItem;
obj['integer_item'] = integerItem;
obj['bool_item'] = boolItem;
obj['array_item'] = arrayItem;
}
/**
* Constructs a <code>TypeHolderDefault</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/TypeHolderDefault} obj Optional instance to populate.
* @return {module:model/TypeHolderDefault} The populated <code>TypeHolderDefault</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new TypeHolderDefault();
if (data.hasOwnProperty('string_item')) {
obj['string_item'] = ApiClient.convertToType(data['string_item'], 'String');
}
if (data.hasOwnProperty('number_item')) {
obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number');
}
if (data.hasOwnProperty('integer_item')) {
obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number');
}
if (data.hasOwnProperty('bool_item')) {
obj['bool_item'] = ApiClient.convertToType(data['bool_item'], 'Boolean');
}
if (data.hasOwnProperty('array_item')) {
obj['array_item'] = ApiClient.convertToType(data['array_item'], ['Number']);
}
}
return obj;
}
}
/**
* @member {String} string_item
* @default 'what'
*/
TypeHolderDefault.prototype['string_item'] = 'what';
/**
* @member {Number} number_item
*/
TypeHolderDefault.prototype['number_item'] = undefined;
/**
* @member {Number} integer_item
*/
TypeHolderDefault.prototype['integer_item'] = undefined;
/**
* @member {Boolean} bool_item
* @default true
*/
TypeHolderDefault.prototype['bool_item'] = true;
/**
* @member {Array.<Number>} array_item
*/
TypeHolderDefault.prototype['array_item'] = undefined;
export default TypeHolderDefault;

View File

@@ -1,113 +0,0 @@
/**
* OpenAPI 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
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
import ApiClient from '../ApiClient';
/**
* The TypeHolderExample model module.
* @module model/TypeHolderExample
* @version 1.0.0
*/
class TypeHolderExample {
/**
* Constructs a new <code>TypeHolderExample</code>.
* @alias module:model/TypeHolderExample
* @param stringItem {String}
* @param numberItem {Number}
* @param integerItem {Number}
* @param boolItem {Boolean}
* @param arrayItem {Array.<Number>}
*/
constructor(stringItem, numberItem, integerItem, boolItem, arrayItem) {
TypeHolderExample.initialize(this, stringItem, numberItem, integerItem, boolItem, arrayItem);
}
/**
* Initializes the fields of this object.
* This method is used by the constructors of any subclasses, in order to implement multiple inheritance (mix-ins).
* Only for internal use.
*/
static initialize(obj, stringItem, numberItem, integerItem, boolItem, arrayItem) {
obj['string_item'] = stringItem;
obj['number_item'] = numberItem;
obj['integer_item'] = integerItem;
obj['bool_item'] = boolItem;
obj['array_item'] = arrayItem;
}
/**
* Constructs a <code>TypeHolderExample</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/TypeHolderExample} obj Optional instance to populate.
* @return {module:model/TypeHolderExample} The populated <code>TypeHolderExample</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new TypeHolderExample();
if (data.hasOwnProperty('string_item')) {
obj['string_item'] = ApiClient.convertToType(data['string_item'], 'String');
}
if (data.hasOwnProperty('number_item')) {
obj['number_item'] = ApiClient.convertToType(data['number_item'], 'Number');
}
if (data.hasOwnProperty('integer_item')) {
obj['integer_item'] = ApiClient.convertToType(data['integer_item'], 'Number');
}
if (data.hasOwnProperty('bool_item')) {
obj['bool_item'] = ApiClient.convertToType(data['bool_item'], 'Boolean');
}
if (data.hasOwnProperty('array_item')) {
obj['array_item'] = ApiClient.convertToType(data['array_item'], ['Number']);
}
}
return obj;
}
}
/**
* @member {String} string_item
*/
TypeHolderExample.prototype['string_item'] = undefined;
/**
* @member {Number} number_item
*/
TypeHolderExample.prototype['number_item'] = undefined;
/**
* @member {Number} integer_item
*/
TypeHolderExample.prototype['integer_item'] = undefined;
/**
* @member {Boolean} bool_item
*/
TypeHolderExample.prototype['bool_item'] = undefined;
/**
* @member {Array.<Number>} array_item
*/
TypeHolderExample.prototype['array_item'] = undefined;
export default TypeHolderExample;