UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

121 lines (99 loc) 3.5 kB
/** * 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 Merchant model module. * @module model/Merchant */ /** * Constructs a new <code>Merchant</code>. * Represents a Square seller. * @alias module:model/Merchant * @class * @param country {String} The country code associated with the merchant account, in ISO 3166 format. See [Country](#type-country) for possible values */ var exports = function(country) { var _this = this; _this['country'] = country; }; /** * Constructs a <code>Merchant</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/Merchant} obj Optional instance to populate. * @return {module:model/Merchant} The populated <code>Merchant</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('business_name')) { obj['business_name'] = ApiClient.convertToType(data['business_name'], '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('status')) { obj['status'] = ApiClient.convertToType(data['status'], 'String'); } if (data.hasOwnProperty('main_location_id')) { obj['main_location_id'] = ApiClient.convertToType(data['main_location_id'], 'String'); } } return obj; } /** * The Square-issued ID of the merchant. * @member {String} id */ exports.prototype['id'] = undefined; /** * The business name of the merchant. * @member {String} business_name */ exports.prototype['business_name'] = undefined; /** * The country code associated with the merchant account, in ISO 3166 format. See [Country](#type-country) for possible values * @member {String} country */ exports.prototype['country'] = undefined; /** * The language code associated with the merchant account, in BCP 47 format. * @member {String} language_code */ exports.prototype['language_code'] = undefined; /** * The currency associated with the merchant account, in ISO 4217 format. See [Currency](#type-currency) for possible values * @member {String} currency */ exports.prototype['currency'] = undefined; /** * The merchant status, active or inactive. See [MerchantStatus](#type-merchantstatus) for possible values * @member {String} status */ exports.prototype['status'] = undefined; /** * The ID of the main `Location` for this merchant. * @member {String} main_location_id */ exports.prototype['main_location_id'] = undefined; module.exports = exports;