squareup/models/
customer_custom_attribute_filter_value.rs

1//! Model struct for CustomerCustomAttributeFilterValue type
2
3use crate::models::{
4    CustomerAddressFilter, FilterValue, FloatNumberRange, SearchCustomersTextFilter, TimeRange,
5};
6use serde::Serialize;
7
8/// A type-specific filter used in a custom attribute filter to search based on
9/// the value of a customer-related custom attribute.
10#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)]
11pub struct CustomerCustomAttributeFilterValue {
12    /// A filter for a query based on the value of an Email-type custom attribute. This
13    /// filter is case-insensitive and can include exact or fuzzy, but not both.
14    ///
15    /// For an exact match, provide the complete email address.
16    ///
17    /// For a fuzzy match, provide a query expression containing one or more query tokens
18    /// to match against the email address. Square removes any punctuation (including
19    /// periods (.), underscores (_), and the @ symbol) and tokenizes the email addresses
20    /// on spaces. A match is found if a tokenized email address contains all the tokens
21    /// in the search query, irrespective of the token order. For example, Steven gmail
22    /// matches steven.jones@gmail.com and mygmail@stevensbakery.com.
23    pub email: Option<SearchCustomersTextFilter>,
24    /// A filter for a query based on the value of a PhoneNumber-type custom attribute. This
25    /// filter is case-insensitive and can include exact or fuzzy, but not both.
26    ///
27    /// For an exact match, provide the complete phone number. This is always an E.164-compliant
28    /// phone number that starts with the + sign followed by the country code and subscriber
29    /// number. For example, the format for a US phone number is +12061112222.
30    ///
31    /// For a fuzzy match, provide a query expression containing one or more query tokens to
32    /// match against the phone number. Square removes any punctuation and tokenizes the
33    /// expression on spaces. A match is found if a tokenized phone number contains all the
34    /// tokens in the search query, irrespective of the token order. For example, 415 123 45
35    /// is tokenized to 415, 123, and 45, which matches +14151234567 and +12345674158, but
36    /// does not match +1234156780. Similarly, the expression 415 matches +14151234567,
37    /// +12345674158, and +1234156780.
38    pub phone: Option<SearchCustomersTextFilter>,
39    /// A filter for a query based on the value of a String-type custom attribute. This filter
40    /// is case-insensitive and can include exact or fuzzy, but not both.
41    ///
42    /// For an exact match, provide the complete string.
43    ///
44    /// For a fuzzy match, provide a query expression containing one or more query tokens in
45    /// any order that contain complete words to match against the string. Square tokenizes
46    /// the expression using a grammar-based tokenizer. For example, the expressions quick
47    /// brown, brown quick, and quick fox match "The quick brown fox jumps over the lazy dog".
48    /// However, quick foxes and qui do not match.
49    pub text: Option<SearchCustomersTextFilter>,
50    /// A filter for a query based on the display name for a Selection-type custom attribute value.
51    /// This filter is case-sensitive and can contain any, all, or both. The none condition is not
52    /// supported.
53    ///
54    /// Provide the display name of each item that you want to search for. To find the display
55    /// names for the selection, use the Customer Custom Attributes API
56    /// to retrieve the corresponding custom attribute definition and then check the
57    /// schema.items.names field. For more information, see Search based on selection.
58    ///
59    /// Note that when a Selection-type custom attribute is assigned to a customer profile,
60    /// the custom attribute value is a list of one or more UUIDs (sourced from the
61    /// schema.items.enum field) that map to the item names. These UUIDs are unique per seller.
62    pub selection: Option<FilterValue>,
63    /// A filter for a query based on the value of a Date-type custom attribute.
64    ///
65    /// Provide a date range for this filter using start_at, end_at, or both. Range boundaries
66    /// are inclusive. Dates can be specified in YYYY-MM-DD format or as RFC 3339 timestamps.
67    ///
68    /// Examples for January 25th, 2020 6:25:34pm Pacific Standard Time:
69    ///
70    /// UTC: 2020-01-26T02:25:34Z
71    ///
72    /// Pacific Standard Time with UTC offset: 2020-01-25T18:25:34-08:00
73    pub date: Option<TimeRange>,
74    /// A filter for a query based on the value of a Number-type custom attribute, which can be
75    /// an integer or a decimal with up to 5 digits of precision.
76    ///
77    /// Provide a numerical range for this filter using start_at, end_at, or both. Range
78    /// boundaries are inclusive. Numbers are specified as decimals or integers. The absolute
79    /// value of range boundaries must not exceed (2^63-1)/10^5, or 92233720368547.
80    pub number: Option<FloatNumberRange>,
81    /// A filter for a query based on the value of a Boolean-type custom attribute.
82    pub boolean: Option<bool>,
83    /// A filter for a query based on the value of an Address-type custom attribute. The filter
84    /// can include postal_code, country, or both.
85    pub address: Option<CustomerAddressFilter>,
86}