square-connect
Version:
JavaScript client library for the Square Connect v2 API
294 lines (252 loc) • 10.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');
var Address = require('./Address');
var BusinessHours = require('./BusinessHours');
var Coordinates = require('./Coordinates');
/**
* The Location model module.
* @module model/Location
*/
/**
* Constructs a new <code>Location</code>.
*
* @alias module:model/Location
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>Location</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/Location} obj Optional instance to populate.
* @return {module:model/Location} The populated <code>Location</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('id')) {
obj['id'] = ApiClient.convertToType(data['id'], 'String');
}
if (data.hasOwnProperty('name')) {
obj['name'] = ApiClient.convertToType(data['name'], 'String');
}
if (data.hasOwnProperty('address')) {
obj['address'] = Address.constructFromObject(data['address']);
}
if (data.hasOwnProperty('timezone')) {
obj['timezone'] = ApiClient.convertToType(data['timezone'], 'String');
}
if (data.hasOwnProperty('capabilities')) {
obj['capabilities'] = ApiClient.convertToType(data['capabilities'], ['String']);
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
if (data.hasOwnProperty('created_at')) {
obj['created_at'] = ApiClient.convertToType(data['created_at'], 'String');
}
if (data.hasOwnProperty('merchant_id')) {
obj['merchant_id'] = ApiClient.convertToType(data['merchant_id'], 'String');
}
if (data.hasOwnProperty('country')) {
obj['country'] = ApiClient.convertToType(data['country'], 'String');
}
if (data.hasOwnProperty('language_code')) {
obj['language_code'] = ApiClient.convertToType(data['language_code'], 'String');
}
if (data.hasOwnProperty('currency')) {
obj['currency'] = ApiClient.convertToType(data['currency'], 'String');
}
if (data.hasOwnProperty('phone_number')) {
obj['phone_number'] = ApiClient.convertToType(data['phone_number'], 'String');
}
if (data.hasOwnProperty('business_name')) {
obj['business_name'] = ApiClient.convertToType(data['business_name'], 'String');
}
if (data.hasOwnProperty('type')) {
obj['type'] = ApiClient.convertToType(data['type'], 'String');
}
if (data.hasOwnProperty('website_url')) {
obj['website_url'] = ApiClient.convertToType(data['website_url'], 'String');
}
if (data.hasOwnProperty('business_hours')) {
obj['business_hours'] = BusinessHours.constructFromObject(data['business_hours']);
}
if (data.hasOwnProperty('business_email')) {
obj['business_email'] = ApiClient.convertToType(data['business_email'], 'String');
}
if (data.hasOwnProperty('description')) {
obj['description'] = ApiClient.convertToType(data['description'], 'String');
}
if (data.hasOwnProperty('twitter_username')) {
obj['twitter_username'] = ApiClient.convertToType(data['twitter_username'], 'String');
}
if (data.hasOwnProperty('instagram_username')) {
obj['instagram_username'] = ApiClient.convertToType(data['instagram_username'], 'String');
}
if (data.hasOwnProperty('facebook_url')) {
obj['facebook_url'] = ApiClient.convertToType(data['facebook_url'], 'String');
}
if (data.hasOwnProperty('coordinates')) {
obj['coordinates'] = Coordinates.constructFromObject(data['coordinates']);
}
if (data.hasOwnProperty('logo_url')) {
obj['logo_url'] = ApiClient.convertToType(data['logo_url'], 'String');
}
if (data.hasOwnProperty('pos_background_url')) {
obj['pos_background_url'] = ApiClient.convertToType(data['pos_background_url'], 'String');
}
if (data.hasOwnProperty('mcc')) {
obj['mcc'] = ApiClient.convertToType(data['mcc'], 'String');
}
if (data.hasOwnProperty('full_format_logo_url')) {
obj['full_format_logo_url'] = ApiClient.convertToType(data['full_format_logo_url'], 'String');
}
}
return obj;
}
/**
* The Square-issued ID of the location.
* @member {String} id
*/
exports.prototype['id'] = undefined;
/**
* The name of the location. This information appears in the dashboard as the nickname.
* @member {String} name
*/
exports.prototype['name'] = undefined;
/**
* The physical address of the location.
* @member {module:model/Address} address
*/
exports.prototype['address'] = undefined;
/**
* The [IANA Timezone](https://www.iana.org/time-zones) identifier for the timezone of the location.
* @member {String} timezone
*/
exports.prototype['timezone'] = undefined;
/**
* The Square features that are enabled for the location. See `LocationCapability` for possible values. See [LocationCapability](#type-locationcapability) for possible values
* @member {Array.<String>} capabilities
*/
exports.prototype['capabilities'] = undefined;
/**
* The status of the location, either active or inactive. See [LocationStatus](#type-locationstatus) for possible values
* @member {String} status
*/
exports.prototype['status'] = undefined;
/**
* The time when the location was created, in RFC 3339 format.
* @member {String} created_at
*/
exports.prototype['created_at'] = undefined;
/**
* The ID of the merchant that owns the location.
* @member {String} merchant_id
*/
exports.prototype['merchant_id'] = undefined;
/**
* The country of the location, in ISO 3166-1-alpha-2 format. See `Country` for possible values. See [Country](#type-country) for possible values
* @member {String} country
*/
exports.prototype['country'] = undefined;
/**
* The language associated with the location, in [BCP 47 format](https://tools.ietf.org/html/bcp47#appendix-A).
* @member {String} language_code
*/
exports.prototype['language_code'] = undefined;
/**
* The currency used for all transactions at this location, in ISO 4217 format. See `Currency` for possible values. See [Currency](#type-currency) for possible values
* @member {String} currency
*/
exports.prototype['currency'] = undefined;
/**
* The phone number of the location in human readable format.
* @member {String} phone_number
*/
exports.prototype['phone_number'] = undefined;
/**
* The business name of the location This is the name visible to the customers of the location. For example, this name appears on customer receipts.
* @member {String} business_name
*/
exports.prototype['business_name'] = undefined;
/**
* The type of the location, either physical or mobile. See [LocationType](#type-locationtype) for possible values
* @member {String} type
*/
exports.prototype['type'] = undefined;
/**
* The website URL of the location.
* @member {String} website_url
*/
exports.prototype['website_url'] = undefined;
/**
* Represents the hours of operation for the location.
* @member {module:model/BusinessHours} business_hours
*/
exports.prototype['business_hours'] = undefined;
/**
* The email of the location. This email is visible to the customers of the location. For example, the email appears on customer receipts.
* @member {String} business_email
*/
exports.prototype['business_email'] = undefined;
/**
* The description of the location.
* @member {String} description
*/
exports.prototype['description'] = undefined;
/**
* The Twitter username of the location without the '@' symbol.
* @member {String} twitter_username
*/
exports.prototype['twitter_username'] = undefined;
/**
* The Instagram username of the location without the '@' symbol.
* @member {String} instagram_username
*/
exports.prototype['instagram_username'] = undefined;
/**
* The Facebook profile URL of the location. The URL should begin with 'facebook.com/'.
* @member {String} facebook_url
*/
exports.prototype['facebook_url'] = undefined;
/**
* The physical coordinates (latitude and longitude) of the location.
* @member {module:model/Coordinates} coordinates
*/
exports.prototype['coordinates'] = undefined;
/**
* The URL of the logo image for the location. The Seller must choose this logo in the Seller dashboard (Receipts section) for the logo to appear on transactions (such as receipts, invoices) that Square generates on behalf of the Seller. This image should have an aspect ratio close to 1:1 and is recommended to be at least 200x200 pixels.
* @member {String} logo_url
*/
exports.prototype['logo_url'] = undefined;
/**
* The URL of the Point of Sale background image for the location.
* @member {String} pos_background_url
*/
exports.prototype['pos_background_url'] = undefined;
/**
* The merchant category code (MCC) of the location, as standardized by ISO 18245. The MCC describes the kind of goods or services sold at the location.
* @member {String} mcc
*/
exports.prototype['mcc'] = undefined;
/**
* The URL of a full-format logo image for the location. The Seller must choose this logo in the Seller dashboard (Receipts section) for the logo to appear on transactions (such as receipts, invoices) that Square generates on behalf of the Seller. This image can have an aspect ratio of 2:1 or greater and is recommended to be at least 1280x648 pixels.
* @member {String} full_format_logo_url
*/
exports.prototype['full_format_logo_url'] = undefined;
module.exports = exports;