UNPKG

square-connect

Version:

JavaScript client library for the Square Connect v2 API

140 lines (115 loc) 5.13 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 CustomAttributeFilter = require('./CustomAttributeFilter'); /** * The SearchCatalogItemsRequest model module. * Note: This model is in beta. * @module model/SearchCatalogItemsRequest */ /** * Constructs a new <code>SearchCatalogItemsRequest</code>. * Defines the request body for the [SearchCatalogItems](#endpoint-Catalog-SearchCatalogItems) endpoint. * @alias module:model/SearchCatalogItemsRequest * @class */ var exports = function() { var _this = this; }; /** * Constructs a <code>SearchCatalogItemsRequest</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/SearchCatalogItemsRequest} obj Optional instance to populate. * @return {module:model/SearchCatalogItemsRequest} The populated <code>SearchCatalogItemsRequest</code> instance. */ exports.constructFromObject = function(data, obj) { if (data) { obj = obj || new exports(); if (data.hasOwnProperty('text_filter')) { obj['text_filter'] = ApiClient.convertToType(data['text_filter'], 'String'); } if (data.hasOwnProperty('category_ids')) { obj['category_ids'] = ApiClient.convertToType(data['category_ids'], ['String']); } if (data.hasOwnProperty('stock_levels')) { obj['stock_levels'] = ApiClient.convertToType(data['stock_levels'], ['String']); } if (data.hasOwnProperty('enabled_location_ids')) { obj['enabled_location_ids'] = ApiClient.convertToType(data['enabled_location_ids'], ['String']); } if (data.hasOwnProperty('cursor')) { obj['cursor'] = ApiClient.convertToType(data['cursor'], 'String'); } if (data.hasOwnProperty('limit')) { obj['limit'] = ApiClient.convertToType(data['limit'], 'Number'); } if (data.hasOwnProperty('sort_order')) { obj['sort_order'] = ApiClient.convertToType(data['sort_order'], 'String'); } if (data.hasOwnProperty('product_types')) { obj['product_types'] = ApiClient.convertToType(data['product_types'], ['String']); } if (data.hasOwnProperty('custom_attribute_filters')) { obj['custom_attribute_filters'] = ApiClient.convertToType(data['custom_attribute_filters'], [CustomAttributeFilter]); } } return obj; } /** * The text filter expression to return items or item variations containing specified text in the `name`, `description`, or `abbreviation` attribute value of an item, or in the `name`, `sku`, or `upc` attribute value of an item variation. * @member {String} text_filter */ exports.prototype['text_filter'] = undefined; /** * The category id query expression to return items containing the specified category IDs. * @member {Array.<String>} category_ids */ exports.prototype['category_ids'] = undefined; /** * The stock-level query expression to return item variations with the specified stock levels. See [SearchCatalogItemsRequestStockLevel](#type-searchcatalogitemsrequeststocklevel) for possible values * @member {Array.<String>} stock_levels */ exports.prototype['stock_levels'] = undefined; /** * The enabled-location query expression to return items and item variations having specified enabled locations. * @member {Array.<String>} enabled_location_ids */ exports.prototype['enabled_location_ids'] = undefined; /** * The pagination token, returned in the previous response, used to fetch the next batch of pending results. * @member {String} cursor */ exports.prototype['cursor'] = undefined; /** * The maximum number of results to return per page. The default value is 100. * @member {Number} limit */ exports.prototype['limit'] = undefined; /** * The order to sort the results by item names. The default sort order is ascending (`ASC`). See [SortOrder](#type-sortorder) for possible values * @member {String} sort_order */ exports.prototype['sort_order'] = undefined; /** * The product types query expression to return items or item variations having the specified product types. See [CatalogItemProductType](#type-catalogitemproducttype) for possible values * @member {Array.<String>} product_types */ exports.prototype['product_types'] = undefined; /** * The customer-attribute filter to return items or item variations matching the specified custom attribute expressions. A maximum number of 10 custom attribute expressions are supported in a single call to the `SearchCatalogItems` endpoint. * @member {Array.<module:model/CustomAttributeFilter>} custom_attribute_filters */ exports.prototype['custom_attribute_filters'] = undefined; module.exports = exports;