- 1 :
- 2 :
- 3 :
(function(root, factory) {
- 4 :
- 5 :
if (typeof module === 'object' && module.exports) {
- 6 :
// CommonJS-like environments that support module.exports, like Node.
- 7 :
module.exports = factory(require('../ApiClient'), require('./InvocationContext'), require('../CommonUtil'), require('../ResponseWrapper'), require('./Base'), require('../OrbipayApiError'));
- 8 :
}
- 9 :
}(this, function(ApiClient, InvocationContext, CommonUtil, ResponseWrapper, Base, OrbipayApiError) {
- 10 :
'use strict';
- 11 :
- 12 :
/**
- 13 :
* The Address wrapper module.
- 14 :
* @module wrappers/Address
- 15 :
*/
- 16 :
var exports = function(address_line1, address_line2, address_city, address_state, address_country, address_zip1, address_zip2) {
- 17 :
var _this = this;
- 18 :
Base.call(_this);
- 19 :
_this['address_line1'] = address_line1;
- 20 :
_this['address_line2'] = address_line2;
- 21 :
_this['address_city'] = address_city;
- 22 :
_this['address_state'] = address_state;
- 23 :
_this['address_country'] = address_country;
- 24 :
_this['address_zip1'] = address_zip1;
- 25 :
_this['address_zip2'] = address_zip2;
- 26 :
};
- 27 :
- 28 :
/**
- 29 :
* Constructs a <code>Address</code> from a plain JavaScript object, optionally creating a new instance.
- 30 :
* Copies all relevant properties from <code>data</code> to <code>obj</code> if supplied or a new instance if not.
- 31 :
* @param {Object} data The plain JavaScript object bearing properties of interest.
- 32 :
* @param {module:wrappers/Address} obj Optional instance to populate.
- 33 :
* @return {module:wrappers/Address} The populated <code>Address</code> instance.
- 34 :
*/
- 35 :
exports.constructFromObject = function (data, obj) {
- 36 :
if (data) {
- 37 :
obj = obj || new exports();
- 38 :
if (data.hasOwnProperty('address_line1')) {
- 39 :
obj['address_line1'] = data['address_line1'];
- 40 :
}
- 41 :
if (data.hasOwnProperty('address_line2')) {
- 42 :
obj['address_line2'] = data['address_line2'];
- 43 :
}
- 44 :
if (data.hasOwnProperty('address_city')) {
- 45 :
obj['address_city'] = data['address_city'];
- 46 :
}
- 47 :
if (data.hasOwnProperty('address_state')) {
- 48 :
obj['address_state'] = data['address_state'];
- 49 :
}
- 50 :
if (data.hasOwnProperty('address_country')) {
- 51 :
obj['address_country'] = data['address_country'];
- 52 :
}
- 53 :
if (data.hasOwnProperty('address_zip1')) {
- 54 :
obj['address_zip1'] = data['address_zip1'];
- 55 :
}
- 56 :
if (data.hasOwnProperty('address_zip2')) {
- 57 :
obj['address_zip2'] = data['address_zip2'];
- 58 :
}
- 59 :
}
- 60 :
return obj;
- 61 :
};
- 62 :
- 63 :
- 64 :
exports.prototype = Object.create(Base.prototype);
- 65 :
exports.prototype.constructor = exports;
- 66 :
- 67 :
/**
- 68 :
* Line one of the address.
- 69 :
* @member {String} address_line1
- 70 :
*/
- 71 :
exports.prototype['address_line1'] = undefined;
- 72 :
/**
- 73 :
* Line two of the address.
- 74 :
* @member {String} address_line2
- 75 :
*/
- 76 :
exports.prototype['address_line2'] = undefined;
- 77 :
/**
- 78 :
* City of the address.
- 79 :
* @member {String} address_city
- 80 :
*/
- 81 :
exports.prototype['address_city'] = undefined;
- 82 :
/**
- 83 :
* The state or province code as per ISO_3166-2.
- 84 :
* @member {String} address_state
- 85 :
*/
- 86 :
exports.prototype['address_state'] = undefined;
- 87 :
/**
- 88 :
* The 3 letter country code as per ISO 3166-1 (alpha-3).
- 89 :
* @member {String} address_country
- 90 :
*/
- 91 :
exports.prototype['address_country'] = undefined;
- 92 :
/**
- 93 :
* The first part of the postal code for the address as per the system followed in the appropriate country where it belongs.
- 94 :
* @member {String} address_zip1
- 95 :
*/
- 96 :
exports.prototype['address_zip1'] = undefined;
- 97 :
/**
- 98 :
* The 4 digit add-on code used, in addition to the 5 digit postal code, by the US Postal Service.
- 99 :
* @member {String} address_zip2
- 100 :
*/
- 101 :
exports.prototype['address_zip2'] = undefined;
- 102 :
- 103 :
- 104 :
- 105 :
- 106 :
return exports;
- 107 :
- 108 :
}));