infusionsoft-nodejs
Version:
A NodeJS SDK automatically generated from Infusionsoft API Swagger definitions.
214 lines (177 loc) • 6.11 kB
JavaScript
/**
* Infusionsoft REST API
* No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
*
* OpenAPI spec version: V1.0
*
*
* 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.
*
*/
import ApiClient from '../ApiClient';
import ProductOptionValue from './ProductOptionValue';
/**
* The ProductOption model module.
* @module model/ProductOption
* @version V1.0
*/
export default class ProductOption {
/**
* Constructs a new <code>ProductOption</code>.
* @alias module:model/ProductOption
* @class
*/
constructor() {
}
/**
* Constructs a <code>ProductOption</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/ProductOption} obj Optional instance to populate.
* @return {module:model/ProductOption} The populated <code>ProductOption</code> instance.
*/
static constructFromObject(data, obj) {
if (data) {
obj = obj || new ProductOption();
if (data.hasOwnProperty('allow_spaces')) {
obj['allow_spaces'] = ApiClient.convertToType(data['allow_spaces'], 'Boolean');
}
if (data.hasOwnProperty('can_contain_character')) {
obj['can_contain_character'] = ApiClient.convertToType(data['can_contain_character'], 'Boolean');
}
if (data.hasOwnProperty('can_contain_number')) {
obj['can_contain_number'] = ApiClient.convertToType(data['can_contain_number'], 'Boolean');
}
if (data.hasOwnProperty('can_end_with_character')) {
obj['can_end_with_character'] = ApiClient.convertToType(data['can_end_with_character'], 'Boolean');
}
if (data.hasOwnProperty('can_end_with_number')) {
obj['can_end_with_number'] = ApiClient.convertToType(data['can_end_with_number'], 'Boolean');
}
if (data.hasOwnProperty('can_start_with_character')) {
obj['can_start_with_character'] = ApiClient.convertToType(data['can_start_with_character'], 'Boolean');
}
if (data.hasOwnProperty('can_start_with_number')) {
obj['can_start_with_number'] = ApiClient.convertToType(data['can_start_with_number'], 'Boolean');
}
if (data.hasOwnProperty('display_index')) {
obj['display_index'] = ApiClient.convertToType(data['display_index'], 'Number');
}
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'Number');
}
if (data.hasOwnProperty('label')) {
obj['label'] = ApiClient.convertToType(data['label'], 'String');
}
if (data.hasOwnProperty('max_chars')) {
obj['max_chars'] = ApiClient.convertToType(data['max_chars'], 'Number');
}
if (data.hasOwnProperty('min_chars')) {
obj['min_chars'] = ApiClient.convertToType(data['min_chars'], 'Number');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('required')) {
obj['required'] = ApiClient.convertToType(data['required'], 'Boolean');
}
if (data.hasOwnProperty('text_message')) {
obj['text_message'] = ApiClient.convertToType(data['text_message'], 'String');
}
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
}
if (data.hasOwnProperty('values')) {
obj['values'] = ApiClient.convertToType(data['values'], [ProductOptionValue]);
}
}
return obj;
}
/**
* @member {Boolean} allow_spaces
*/
allow_spaces = undefined;
/**
* @member {Boolean} can_contain_character
*/
can_contain_character = undefined;
/**
* @member {Boolean} can_contain_number
*/
can_contain_number = undefined;
/**
* @member {Boolean} can_end_with_character
*/
can_end_with_character = undefined;
/**
* @member {Boolean} can_end_with_number
*/
can_end_with_number = undefined;
/**
* @member {Boolean} can_start_with_character
*/
can_start_with_character = undefined;
/**
* @member {Boolean} can_start_with_number
*/
can_start_with_number = undefined;
/**
* @member {Number} display_index
*/
display_index = undefined;
/**
* @member {Number} id
*/
id = undefined;
/**
* @member {String} label
*/
label = undefined;
/**
* @member {Number} max_chars
*/
max_chars = undefined;
/**
* @member {Number} min_chars
*/
min_chars = undefined;
/**
* @member {String} name
*/
name = undefined;
/**
* @member {Boolean} required
*/
required = undefined;
/**
* @member {String} text_message
*/
text_message = undefined;
/**
* @member {module:model/ProductOption.TypeEnum} type
*/
type = undefined;
/**
* @member {Array.<module:model/ProductOptionValue>} values
*/
values = undefined;
/**
* Allowed values for the <code>type</code> property.
* @enum {String}
* @readonly
*/
static TypeEnum = {
/**
* value: "FixedList"
* @const
*/
"FixedList": "FixedList",
/**
* value: "Variable"
* @const
*/
"Variable": "Variable"
};
}