square-connect
Version:
JavaScript client library for the Square Connect v2 API
192 lines (161 loc) • 6.1 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 Address model module.
* @module model/Address
*/
/**
* Constructs a new <code>Address</code>.
* Represents a physical address.
* @alias module:model/Address
* @class
*/
var exports = function() {
var _this = this;
};
/**
* 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:model/Address} obj Optional instance to populate.
* @return {module:model/Address} The populated <code>Address</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('address_line_1')) {
obj['address_line_1'] = ApiClient.convertToType(data['address_line_1'], 'String');
}
if (data.hasOwnProperty('address_line_2')) {
obj['address_line_2'] = ApiClient.convertToType(data['address_line_2'], 'String');
}
if (data.hasOwnProperty('address_line_3')) {
obj['address_line_3'] = ApiClient.convertToType(data['address_line_3'], 'String');
}
if (data.hasOwnProperty('locality')) {
obj['locality'] = ApiClient.convertToType(data['locality'], 'String');
}
if (data.hasOwnProperty('sublocality')) {
obj['sublocality'] = ApiClient.convertToType(data['sublocality'], 'String');
}
if (data.hasOwnProperty('sublocality_2')) {
obj['sublocality_2'] = ApiClient.convertToType(data['sublocality_2'], 'String');
}
if (data.hasOwnProperty('sublocality_3')) {
obj['sublocality_3'] = ApiClient.convertToType(data['sublocality_3'], 'String');
}
if (data.hasOwnProperty('administrative_district_level_1')) {
obj['administrative_district_level_1'] = ApiClient.convertToType(data['administrative_district_level_1'], 'String');
}
if (data.hasOwnProperty('administrative_district_level_2')) {
obj['administrative_district_level_2'] = ApiClient.convertToType(data['administrative_district_level_2'], 'String');
}
if (data.hasOwnProperty('administrative_district_level_3')) {
obj['administrative_district_level_3'] = ApiClient.convertToType(data['administrative_district_level_3'], 'String');
}
if (data.hasOwnProperty('postal_code')) {
obj['postal_code'] = ApiClient.convertToType(data['postal_code'], 'String');
}
if (data.hasOwnProperty('country')) {
obj['country'] = ApiClient.convertToType(data['country'], 'String');
}
if (data.hasOwnProperty('first_name')) {
obj['first_name'] = ApiClient.convertToType(data['first_name'], 'String');
}
if (data.hasOwnProperty('last_name')) {
obj['last_name'] = ApiClient.convertToType(data['last_name'], 'String');
}
if (data.hasOwnProperty('organization')) {
obj['organization'] = ApiClient.convertToType(data['organization'], 'String');
}
}
return obj;
}
/**
* The first line of the address. Fields that start with `address_line` provide the address's most specific details, like street number, street name, and building name. They do *not* provide less specific details like city, state/province, or country (these details are provided in other fields).
* @member {String} address_line_1
*/
exports.prototype['address_line_1'] = undefined;
/**
* The second line of the address, if any.
* @member {String} address_line_2
*/
exports.prototype['address_line_2'] = undefined;
/**
* The third line of the address, if any.
* @member {String} address_line_3
*/
exports.prototype['address_line_3'] = undefined;
/**
* The city or town of the address.
* @member {String} locality
*/
exports.prototype['locality'] = undefined;
/**
* A civil region within the address's `locality`, if any.
* @member {String} sublocality
*/
exports.prototype['sublocality'] = undefined;
/**
* A civil region within the address's `sublocality`, if any.
* @member {String} sublocality_2
*/
exports.prototype['sublocality_2'] = undefined;
/**
* A civil region within the address's `sublocality_2`, if any.
* @member {String} sublocality_3
*/
exports.prototype['sublocality_3'] = undefined;
/**
* A civil entity within the address's country. In the US, this is the state.
* @member {String} administrative_district_level_1
*/
exports.prototype['administrative_district_level_1'] = undefined;
/**
* A civil entity within the address's `administrative_district_level_1`. In the US, this is the county.
* @member {String} administrative_district_level_2
*/
exports.prototype['administrative_district_level_2'] = undefined;
/**
* A civil entity within the address's `administrative_district_level_2`, if any.
* @member {String} administrative_district_level_3
*/
exports.prototype['administrative_district_level_3'] = undefined;
/**
* The address's postal code.
* @member {String} postal_code
*/
exports.prototype['postal_code'] = undefined;
/**
* The address's country, in ISO 3166-1-alpha-2 format. See [Country](#type-country) for possible values
* @member {String} country
*/
exports.prototype['country'] = undefined;
/**
* Optional first name when it's representing recipient.
* @member {String} first_name
*/
exports.prototype['first_name'] = undefined;
/**
* Optional last name when it's representing recipient.
* @member {String} last_name
*/
exports.prototype['last_name'] = undefined;
/**
* Optional organization name when it's representing recipient.
* @member {String} organization
*/
exports.prototype['organization'] = undefined;
module.exports = exports;