square-connect
Version:
JavaScript client library for the Square Connect v2 API
157 lines (131 loc) • 4.51 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 DeviceCode model module.
* @module model/DeviceCode
*/
/**
* Constructs a new <code>DeviceCode</code>.
*
* @alias module:model/DeviceCode
* @class
* @param productType {String} The targeting product type of the device code. See [ProductType](#type-producttype) for possible values
*/
var exports = function(productType) {
var _this = this;
_this['product_type'] = productType;
};
/**
* Constructs a <code>DeviceCode</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/DeviceCode} obj Optional instance to populate.
* @return {module:model/DeviceCode} The populated <code>DeviceCode</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('code')) {
obj['code'] = ApiClient.convertToType(data['code'], 'String');
}
if (data.hasOwnProperty('device_id')) {
obj['device_id'] = ApiClient.convertToType(data['device_id'], 'String');
}
if (data.hasOwnProperty('product_type')) {
obj['product_type'] = ApiClient.convertToType(data['product_type'], 'String');
}
if (data.hasOwnProperty('location_id')) {
obj['location_id'] = ApiClient.convertToType(data['location_id'], 'String');
}
if (data.hasOwnProperty('status')) {
obj['status'] = ApiClient.convertToType(data['status'], 'String');
}
if (data.hasOwnProperty('pair_by')) {
obj['pair_by'] = ApiClient.convertToType(data['pair_by'], 'String');
}
if (data.hasOwnProperty('created_at')) {
obj['created_at'] = ApiClient.convertToType(data['created_at'], 'String');
}
if (data.hasOwnProperty('status_changed_at')) {
obj['status_changed_at'] = ApiClient.convertToType(data['status_changed_at'], 'String');
}
if (data.hasOwnProperty('paired_at')) {
obj['paired_at'] = ApiClient.convertToType(data['paired_at'], 'String');
}
}
return obj;
}
/**
* The unique id for this device code.
* @member {String} id
*/
exports.prototype['id'] = undefined;
/**
* An optional user-defined name for the device code.
* @member {String} name
*/
exports.prototype['name'] = undefined;
/**
* The unique code that can be used to login.
* @member {String} code
*/
exports.prototype['code'] = undefined;
/**
* The unique id of the device that used this code. Populated when the device is paired up.
* @member {String} device_id
*/
exports.prototype['device_id'] = undefined;
/**
* The targeting product type of the device code. See [ProductType](#type-producttype) for possible values
* @member {String} product_type
*/
exports.prototype['product_type'] = undefined;
/**
* The location assigned to this code.
* @member {String} location_id
*/
exports.prototype['location_id'] = undefined;
/**
* The pairing status of the device code. See [DeviceCodeStatus](#type-devicecodestatus) for possible values
* @member {String} status
*/
exports.prototype['status'] = undefined;
/**
* When this DeviceCode will expire and no longer login. Timestamp in RFC 3339 format.
* @member {String} pair_by
*/
exports.prototype['pair_by'] = undefined;
/**
* When this DeviceCode was created. Timestamp in RFC 3339 format.
* @member {String} created_at
*/
exports.prototype['created_at'] = undefined;
/**
* When this DeviceCode's status was last changed. Timestamp in RFC 3339 format.
* @member {String} status_changed_at
*/
exports.prototype['status_changed_at'] = undefined;
/**
* When this DeviceCode was paired. Timestamp in RFC 3339 format.
* @member {String} paired_at
*/
exports.prototype['paired_at'] = undefined;
module.exports = exports;