cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
156 lines (134 loc) • 5 kB
JavaScript
/**
* CyberSource Merged Spec
* All CyberSource API specs merged together. These are available at https://developer.cybersource.com/api/reference/api-reference.html
*
* OpenAPI spec version: 0.0.1
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
*
* Swagger Codegen version: 2.4.38
*
* 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.CyberSource) {
root.CyberSource = {};
}
root.CyberSource.MerchantDefinedFieldCore = factory(root.CyberSource.ApiClient);
}
}(this, function(ApiClient) {
'use strict';
/**
* The MerchantDefinedFieldCore model module.
* @module model/MerchantDefinedFieldCore
* @version 0.0.1
*/
/**
* Constructs a new <code>MerchantDefinedFieldCore</code>.
* @alias module:model/MerchantDefinedFieldCore
* @class
* @param fieldType {String} Possible values: - text - select
* @param label {String}
* @param merchantDefinedDataIndex {Number}
*/
var exports = function(fieldType, label, merchantDefinedDataIndex) {
var _this = this;
_this['fieldType'] = fieldType;
_this['label'] = label;
_this['merchantDefinedDataIndex'] = merchantDefinedDataIndex;
};
/**
* Constructs a <code>MerchantDefinedFieldCore</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/MerchantDefinedFieldCore} obj Optional instance to populate.
* @return {module:model/MerchantDefinedFieldCore} The populated <code>MerchantDefinedFieldCore</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('fieldType')) {
obj['fieldType'] = ApiClient.convertToType(data['fieldType'], 'String');
}
if (data.hasOwnProperty('label')) {
obj['label'] = ApiClient.convertToType(data['label'], 'String');
}
if (data.hasOwnProperty('customerVisible')) {
obj['customerVisible'] = ApiClient.convertToType(data['customerVisible'], 'Boolean');
}
if (data.hasOwnProperty('textMinLength')) {
obj['textMinLength'] = ApiClient.convertToType(data['textMinLength'], 'Number');
}
if (data.hasOwnProperty('textMaxLength')) {
obj['textMaxLength'] = ApiClient.convertToType(data['textMaxLength'], 'Number');
}
if (data.hasOwnProperty('textDefaultValue')) {
obj['textDefaultValue'] = ApiClient.convertToType(data['textDefaultValue'], 'String');
}
if (data.hasOwnProperty('possibleValues')) {
obj['possibleValues'] = ApiClient.convertToType(data['possibleValues'], 'String');
}
if (data.hasOwnProperty('readOnly')) {
obj['readOnly'] = ApiClient.convertToType(data['readOnly'], 'Boolean');
}
if (data.hasOwnProperty('merchantDefinedDataIndex')) {
obj['merchantDefinedDataIndex'] = ApiClient.convertToType(data['merchantDefinedDataIndex'], 'Number');
}
}
return obj;
}
/**
* Possible values: - text - select
* @member {String} fieldType
*/
exports.prototype['fieldType'] = undefined;
/**
* @member {String} label
*/
exports.prototype['label'] = undefined;
/**
* @member {Boolean} customerVisible
* @default false
*/
exports.prototype['customerVisible'] = false;
/**
* Should be used only if fieldType = \"text\"
* @member {Number} textMinLength
*/
exports.prototype['textMinLength'] = undefined;
/**
* Should be used only if fieldType = \"text\"
* @member {Number} textMaxLength
*/
exports.prototype['textMaxLength'] = undefined;
/**
* Should be used only if fieldType = \"text\"
* @member {String} textDefaultValue
*/
exports.prototype['textDefaultValue'] = undefined;
/**
* Should be mandatory and used only if fieldType = \"select\"
* @member {String} possibleValues
*/
exports.prototype['possibleValues'] = undefined;
/**
* @member {Boolean} readOnly
* @default false
*/
exports.prototype['readOnly'] = false;
/**
* @member {Number} merchantDefinedDataIndex
*/
exports.prototype['merchantDefinedDataIndex'] = undefined;
return exports;
}));