square-connect
Version:
JavaScript client library for the Square Connect v2 API
130 lines (106 loc) • 4.24 kB
JavaScript
/**
* Square Connect API
* Client library for accessing the Square Connect APIs
*
* OpenAPI spec version: 2.0
* Contact: developers@squareup.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.3.0-SNAPSHOT
*
*/
var ApiClient = require('../ApiClient');
/**
* The CatalogCustomAttributeValue model module.
* Note: This model is in beta.
* @module model/CatalogCustomAttributeValue
*/
/**
* Constructs a new <code>CatalogCustomAttributeValue</code>.
* An instance of a custom attribute. Custom attributes can be defined and added to `ITEM` and `ITEM_VARIATION` type catalog objects. [Read more about custom attributes](/catalog-api/add-custom-attributes).
* @alias module:model/CatalogCustomAttributeValue
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>CatalogCustomAttributeValue</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/CatalogCustomAttributeValue} obj Optional instance to populate.
* @return {module:model/CatalogCustomAttributeValue} The populated <code>CatalogCustomAttributeValue</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('string_value')) {
obj['string_value'] = ApiClient.convertToType(data['string_value'], 'String');
}
if (data.hasOwnProperty('custom_attribute_definition_id')) {
obj['custom_attribute_definition_id'] = ApiClient.convertToType(data['custom_attribute_definition_id'], 'String');
}
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
}
if (data.hasOwnProperty('number_value')) {
obj['number_value'] = ApiClient.convertToType(data['number_value'], 'String');
}
if (data.hasOwnProperty('boolean_value')) {
obj['boolean_value'] = ApiClient.convertToType(data['boolean_value'], 'Boolean');
}
if (data.hasOwnProperty('selection_uid_values')) {
obj['selection_uid_values'] = ApiClient.convertToType(data['selection_uid_values'], ['String']);
}
if (data.hasOwnProperty('key')) {
obj['key'] = ApiClient.convertToType(data['key'], 'String');
}
}
return obj;
}
/**
* The name of the custom attribute.
* @member {String} name
*/
exports.prototype['name'] = undefined;
/**
* The string value of the custom attribute. Populated if `type` = `STRING`.
* @member {String} string_value
*/
exports.prototype['string_value'] = undefined;
/**
* __Read-only.__ The id of the `CatalogCustomAttributeDefinition` this value belongs to.
* @member {String} custom_attribute_definition_id
*/
exports.prototype['custom_attribute_definition_id'] = undefined;
/**
* __Read-only.__ A copy of type from the associated `CatalogCustomAttributeDefinition`. See [CatalogCustomAttributeDefinitionType](#type-catalogcustomattributedefinitiontype) for possible values
* @member {String} type
*/
exports.prototype['type'] = undefined;
/**
* Populated if `type` = `NUMBER`. Contains a string representation of a decimal number, using a `.` as the decimal separator.
* @member {String} number_value
*/
exports.prototype['number_value'] = undefined;
/**
* A `true` or `false` value. Populated if `type` = `BOOLEAN`.
* @member {Boolean} boolean_value
*/
exports.prototype['boolean_value'] = undefined;
/**
* One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`.
* @member {Array.<String>} selection_uid_values
*/
exports.prototype['selection_uid_values'] = undefined;
/**
* __Read-only.__ A copy of key from the associated `CatalogCustomAttributeDefinition`.
* @member {String} key
*/
exports.prototype['key'] = undefined;
module.exports = exports;