(function(root, factory) {
if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support module.exports, like Node.
module.exports = factory(require('../ApiClient'), require('./InvocationContext'), require('../CommonUtil'), require('../ResponseWrapper'), require('./Base'), require('../OrbipayApiError'));
}
}(this, function(ApiClient, InvocationContext, CommonUtil, ResponseWrapper, Base, OrbipayApiError) {
'use strict';
/**
* The Address wrapper module.
* @module wrappers/Address
*/
var exports = function(address_line1, address_line2, address_city, address_state, address_country, address_zip1, address_zip2) {
var _this = this;
Base.call(_this);
_this['address_line1'] = address_line1;
_this['address_line2'] = address_line2;
_this['address_city'] = address_city;
_this['address_state'] = address_state;
_this['address_country'] = address_country;
_this['address_zip1'] = address_zip1;
_this['address_zip2'] = address_zip2;
};
/**
* Constructs a <code>Address</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:wrappers/Address} obj Optional instance to populate.
* @return {module:wrappers/Address} The populated <code>Address</code> instance.
*/
exports.constructFromObject = function (data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('address_line1')) {
obj['address_line1'] = data['address_line1'];
}
if (data.hasOwnProperty('address_line2')) {
obj['address_line2'] = data['address_line2'];
}
if (data.hasOwnProperty('address_city')) {
obj['address_city'] = data['address_city'];
}
if (data.hasOwnProperty('address_state')) {
obj['address_state'] = data['address_state'];
}
if (data.hasOwnProperty('address_country')) {
obj['address_country'] = data['address_country'];
}
if (data.hasOwnProperty('address_zip1')) {
obj['address_zip1'] = data['address_zip1'];
}
if (data.hasOwnProperty('address_zip2')) {
obj['address_zip2'] = data['address_zip2'];
}
}
return obj;
};
exports.prototype = Object.create(Base.prototype);
exports.prototype.constructor = exports;
/**
* Line one of the address.
* @member {String} address_line1
*/
exports.prototype['address_line1'] = undefined;
/**
* Line two of the address.
* @member {String} address_line2
*/
exports.prototype['address_line2'] = undefined;
/**
* City of the address.
* @member {String} address_city
*/
exports.prototype['address_city'] = undefined;
/**
* The state or province code as per ISO_3166-2.
* @member {String} address_state
*/
exports.prototype['address_state'] = undefined;
/**
* The 3 letter country code as per ISO 3166-1 (alpha-3).
* @member {String} address_country
*/
exports.prototype['address_country'] = undefined;
/**
* The first part of the postal code for the address as per the system followed in the appropriate country where it belongs. In the case of US, it's the 5 digit postal code used by the US Postal Service.
* @member {String} address_zip1
*/
exports.prototype['address_zip1'] = undefined;
/**
* The 4 digit add-on code used, in addition to the 5 digit postal code, by the US Postal Service.This is not applicable and will be ignored in the case of non-US addresses.
* @member {String} address_zip2
*/
exports.prototype['address_zip2'] = undefined;
return exports;
}));