square_api_client/models/
search_catalog_objects_request.rs

1//! Request struct for the Search Catalog Objects API
2
3use serde::Serialize;
4
5use super::{enums::CatalogObjectType, CatalogQuery, DateTime};
6
7/// This is a model struct for SearchCatalogObjectsRequest type.
8#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)]
9pub struct SearchCatalogObjectsRequest {
10    /// The pagination cursor returned in the previous response. Leave unset for an initial request.
11    /// See [Pagination](https://developer.squareup.com/docs/basics/api101/pagination) for more
12    /// information.
13    pub cursor: Option<String>,
14    /// The desired set of object types to appear in the search results.
15    ///
16    /// If this is unspecified, the operation returns objects of all the top level types at the
17    /// version of the Square API used to make the request. Object types that are nested onto other
18    /// object types are not included in the defaults.
19    ///
20    /// At the current API version the default object types are: ITEM, CATEGORY, TAX, DISCOUNT,
21    /// MODIFIER_LIST, DINING_OPTION, TAX_EXEMPTION, SERVICE_CHARGE, PRICING_RULE, PRODUCT_SET,
22    /// TIME_PERIOD, MEASUREMENT_UNIT, SUBSCRIPTION_PLAN, ITEM_OPTION, CUSTOM_ATTRIBUTE_DEFINITION,
23    /// QUICK_AMOUNT_SETTINGS.
24    pub object_types: Option<Vec<CatalogObjectType>>,
25    /// If `true`, deleted objects will be included in the results. Deleted objects will have their
26    /// `is_deleted` field set to `true`.
27    pub include_deleted_objects: Option<bool>,
28    /// If `true`, the response will include additional objects that are related to the requested
29    /// objects. Related objects are objects that are referenced by object ID by the objects in the
30    /// response. This is helpful if the objects are being fetched for immediate display to a user.
31    /// This process only goes one level deep. Objects referenced by the related objects will not be
32    /// included. For example:
33    ///
34    /// If the `objects` field of the response contains a CatalogItem, its associated
35    /// CatalogCategory objects, CatalogTax objects, CatalogImage objects and CatalogModifierLists
36    /// will be returned in the `related_objects` field of the response. If the `objects` field of
37    /// the response contains a CatalogItemVariation, its parent CatalogItem will be returned in the
38    /// `related_objects` field of the response.
39    ///
40    /// Default value: `false`
41    pub include_related_objects: Option<bool>,
42    /// Return objects modified after this timestamp. The timestamp is exclusive - objects with a
43    /// timestamp equal to `begin_time` will not be included in the response.
44    pub begin_time: Option<DateTime>,
45    /// A query to be used to filter or sort the results. If no query is specified, the entire
46    /// catalog will be returned.
47    pub query: Option<CatalogQuery>,
48    /// A limit on the number of results to be returned in a single page. The limit is advisory -
49    /// the implementation may return more or fewer results. If the supplied limit is negative,
50    /// zero, or is higher than the maximum limit of 1,000, it will be ignored.
51    pub limit: Option<i32>,
52}