UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

85 lines (66 loc) 2.61 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'); var Error = require('./Error'); /** * The CreateMobileAuthorizationCodeResponse model module. * @module model/CreateMobileAuthorizationCodeResponse */ /** * Constructs a new <code>CreateMobileAuthorizationCodeResponse</code>. * Defines the fields that are included in the response body of a request to the __CreateMobileAuthorizationCode__ endpoint. * @alias module:model/CreateMobileAuthorizationCodeResponse * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>CreateMobileAuthorizationCodeResponse</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/CreateMobileAuthorizationCodeResponse} obj Optional instance to populate. * @return {module:model/CreateMobileAuthorizationCodeResponse} The populated <code>CreateMobileAuthorizationCodeResponse</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('authorization_code')) { obj['authorization_code'] = ApiClient.convertToType(data['authorization_code'], 'String'); } if (data.hasOwnProperty('expires_at')) { obj['expires_at'] = ApiClient.convertToType(data['expires_at'], 'String'); } if (data.hasOwnProperty('error')) { obj['error'] = Error.constructFromObject(data['error']); } } return obj; } /** * Generated authorization code that connects a mobile application instance to a Square account. * @member {String} authorization_code */ exports.prototype['authorization_code'] = undefined; /** * The timestamp when `authorization_code` expires in [RFC 3339](https://tools.ietf.org/html/rfc3339) format, e.g., \"2016-09-04T23:59:33.123Z\". * @member {String} expires_at */ exports.prototype['expires_at'] = undefined; /** * An error object that provides details about how creation of authorization code failed. * @member {module:model/Error} error */ exports.prototype['error'] = undefined; module.exports = exports;