UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

86 lines (67 loc) 2.76 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 CustomerSegment = require('./CustomerSegment'); var Error = require('./Error'); /** * The ListCustomerSegmentsResponse model module. * @module model/ListCustomerSegmentsResponse */ /** * Constructs a new <code>ListCustomerSegmentsResponse</code>. * Defines the fields included in the response body for requests to __ListCustomerSegments__. One of &#x60;errors&#x60; or &#x60;segments&#x60; is present in a given response (never both). * @alias module:model/ListCustomerSegmentsResponse * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>ListCustomerSegmentsResponse</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/ListCustomerSegmentsResponse} obj Optional instance to populate. * @return {module:model/ListCustomerSegmentsResponse} The populated <code>ListCustomerSegmentsResponse</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('errors')) { obj['errors'] = ApiClient.convertToType(data['errors'], [Error]); } if (data.hasOwnProperty('segments')) { obj['segments'] = ApiClient.convertToType(data['segments'], [CustomerSegment]); } if (data.hasOwnProperty('cursor')) { obj['cursor'] = ApiClient.convertToType(data['cursor'], 'String'); } } return obj; } /** * Any errors that occurred during the request. * @member {Array.<module:model/Error>} errors */ exports.prototype['errors'] = undefined; /** * The list of customer segments belonging to the associated Square account. * @member {Array.<module:model/CustomerSegment>} segments */ exports.prototype['segments'] = undefined; /** * A pagination cursor to be used in subsequent calls to __ListCustomerSegments__ to retrieve the next set of query results. Only present only if the request succeeded and additional results are available. See the [Pagination guide](https://developer.squareup.com/docs/docs/working-with-apis/pagination) for more information. * @member {String} cursor */ exports.prototype['cursor'] = undefined; module.exports = exports;