square-connect
Version:
JavaScript client library for the Square Connect v2 API
103 lines (82 loc) • 3.7 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 SearchOrdersQuery = require('./SearchOrdersQuery');
/**
* The SearchOrdersRequest model module.
* @module model/SearchOrdersRequest
*/
/**
* Constructs a new <code>SearchOrdersRequest</code>.
* The request does not have any required fields. When given no query criteria, SearchOrders will return all results for all of the merchant’s locations. When fetching additional pages using a `cursor`, the `query` must be equal to the `query` used to fetch the first page of results.
* @alias module:model/SearchOrdersRequest
* @class
*/
var exports = function() {
var _this = this;
};
/**
* Constructs a <code>SearchOrdersRequest</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/SearchOrdersRequest} obj Optional instance to populate.
* @return {module:model/SearchOrdersRequest} The populated <code>SearchOrdersRequest</code> instance.
*/
exports.constructFromObject = function(data, obj) {
if (data) {
obj = obj || new exports();
if (data.hasOwnProperty('location_ids')) {
obj['location_ids'] = ApiClient.convertToType(data['location_ids'], ['String']);
}
if (data.hasOwnProperty('cursor')) {
obj['cursor'] = ApiClient.convertToType(data['cursor'], 'String');
}
if (data.hasOwnProperty('query')) {
obj['query'] = SearchOrdersQuery.constructFromObject(data['query']);
}
if (data.hasOwnProperty('limit')) {
obj['limit'] = ApiClient.convertToType(data['limit'], 'Number');
}
if (data.hasOwnProperty('return_entries')) {
obj['return_entries'] = ApiClient.convertToType(data['return_entries'], 'Boolean');
}
}
return obj;
}
/**
* The location IDs for the orders to query. All locations must belong to the same merchant. Min: 1 location IDs. Max: 10 location IDs.
* @member {Array.<String>} location_ids
*/
exports.prototype['location_ids'] = undefined;
/**
* A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for your original query. See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more information.
* @member {String} cursor
*/
exports.prototype['cursor'] = undefined;
/**
* Query conditions used to filter or sort the results. Note that when fetching additional pages using a cursor, the query must be equal to the query used to fetch the first page of results.
* @member {module:model/SearchOrdersQuery} query
*/
exports.prototype['query'] = undefined;
/**
* Maximum number of results to be returned in a single page. It is possible to receive fewer results than the specified limit on a given page. Default: `500`
* @member {Number} limit
*/
exports.prototype['limit'] = undefined;
/**
* Boolean that controls the format of the search results. If `true`, SearchOrders will return ``OrderEntry`` objects. If `false`, SearchOrders will return complete Order objects. Default: `false`.
* @member {Boolean} return_entries
*/
exports.prototype['return_entries'] = undefined;
module.exports = exports;