cybersource-rest-client
Version:
Node.js SDK for the CyberSource REST API
156 lines (130 loc) • 6.89 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', 'model/Tmsv2customersBuyerInformation', 'model/Tmsv2customersClientReferenceInformation', 'model/Tmsv2customersDefaultPaymentInstrument', 'model/Tmsv2customersDefaultShippingAddress', 'model/Tmsv2customersEmbedded', 'model/Tmsv2customersLinks', 'model/Tmsv2customersMerchantDefinedInformation', 'model/Tmsv2customersMetadata', 'model/Tmsv2customersObjectInformation'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./Tmsv2customersBuyerInformation'), require('./Tmsv2customersClientReferenceInformation'), require('./Tmsv2customersDefaultPaymentInstrument'), require('./Tmsv2customersDefaultShippingAddress'), require('./Tmsv2customersEmbedded'), require('./Tmsv2customersLinks'), require('./Tmsv2customersMerchantDefinedInformation'), require('./Tmsv2customersMetadata'), require('./Tmsv2customersObjectInformation'));
} else {
// Browser globals (root is window)
if (!root.CyberSource) {
root.CyberSource = {};
}
root.CyberSource.PostCustomerRequest = factory(root.CyberSource.ApiClient, root.CyberSource.Tmsv2customersBuyerInformation, root.CyberSource.Tmsv2customersClientReferenceInformation, root.CyberSource.Tmsv2customersDefaultPaymentInstrument, root.CyberSource.Tmsv2customersDefaultShippingAddress, root.CyberSource.Tmsv2customersEmbedded, root.CyberSource.Tmsv2customersLinks, root.CyberSource.Tmsv2customersMerchantDefinedInformation, root.CyberSource.Tmsv2customersMetadata, root.CyberSource.Tmsv2customersObjectInformation);
}
}(this, function(ApiClient, Tmsv2customersBuyerInformation, Tmsv2customersClientReferenceInformation, Tmsv2customersDefaultPaymentInstrument, Tmsv2customersDefaultShippingAddress, Tmsv2customersEmbedded, Tmsv2customersLinks, Tmsv2customersMerchantDefinedInformation, Tmsv2customersMetadata, Tmsv2customersObjectInformation) {
'use strict';
/**
* The PostCustomerRequest model module.
* @module model/PostCustomerRequest
* @version 0.0.1
*/
/**
* Constructs a new <code>PostCustomerRequest</code>.
* @alias module:model/PostCustomerRequest
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>PostCustomerRequest</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/PostCustomerRequest} obj Optional instance to populate.
* @return {module:model/PostCustomerRequest} The populated <code>PostCustomerRequest</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('_links')) {
obj['_links'] = Tmsv2customersLinks.constructFromObject(data['_links']);
}
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'String');
}
if (data.hasOwnProperty('objectInformation')) {
obj['objectInformation'] = Tmsv2customersObjectInformation.constructFromObject(data['objectInformation']);
}
if (data.hasOwnProperty('buyerInformation')) {
obj['buyerInformation'] = Tmsv2customersBuyerInformation.constructFromObject(data['buyerInformation']);
}
if (data.hasOwnProperty('clientReferenceInformation')) {
obj['clientReferenceInformation'] = Tmsv2customersClientReferenceInformation.constructFromObject(data['clientReferenceInformation']);
}
if (data.hasOwnProperty('merchantDefinedInformation')) {
obj['merchantDefinedInformation'] = ApiClient.convertToType(data['merchantDefinedInformation'], [Tmsv2customersMerchantDefinedInformation]);
}
if (data.hasOwnProperty('defaultPaymentInstrument')) {
obj['defaultPaymentInstrument'] = Tmsv2customersDefaultPaymentInstrument.constructFromObject(data['defaultPaymentInstrument']);
}
if (data.hasOwnProperty('defaultShippingAddress')) {
obj['defaultShippingAddress'] = Tmsv2customersDefaultShippingAddress.constructFromObject(data['defaultShippingAddress']);
}
if (data.hasOwnProperty('metadata')) {
obj['metadata'] = Tmsv2customersMetadata.constructFromObject(data['metadata']);
}
if (data.hasOwnProperty('_embedded')) {
obj['_embedded'] = Tmsv2customersEmbedded.constructFromObject(data['_embedded']);
}
}
return obj;
}
/**
* @member {module:model/Tmsv2customersLinks} _links
*/
exports.prototype['_links'] = undefined;
/**
* The Id of the Customer Token.
* @member {String} id
*/
exports.prototype['id'] = undefined;
/**
* @member {module:model/Tmsv2customersObjectInformation} objectInformation
*/
exports.prototype['objectInformation'] = undefined;
/**
* @member {module:model/Tmsv2customersBuyerInformation} buyerInformation
*/
exports.prototype['buyerInformation'] = undefined;
/**
* @member {module:model/Tmsv2customersClientReferenceInformation} clientReferenceInformation
*/
exports.prototype['clientReferenceInformation'] = undefined;
/**
* Object containing the custom data that the merchant defines.
* @member {Array.<module:model/Tmsv2customersMerchantDefinedInformation>} merchantDefinedInformation
*/
exports.prototype['merchantDefinedInformation'] = undefined;
/**
* @member {module:model/Tmsv2customersDefaultPaymentInstrument} defaultPaymentInstrument
*/
exports.prototype['defaultPaymentInstrument'] = undefined;
/**
* @member {module:model/Tmsv2customersDefaultShippingAddress} defaultShippingAddress
*/
exports.prototype['defaultShippingAddress'] = undefined;
/**
* @member {module:model/Tmsv2customersMetadata} metadata
*/
exports.prototype['metadata'] = undefined;
/**
* @member {module:model/Tmsv2customersEmbedded} _embedded
*/
exports.prototype['_embedded'] = undefined;
return exports;
}));