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