square_api_client/models/
search_customers_sort.rs

1//! Model struct for SearchCustomersSort type
2
3use crate::models::enums::{SortCustomersField, SortOrder};
4use serde::Serialize;
5/// Sorting criteria for a `SearchCustomers` request.
6///
7/// Results can only be sorted by a timestamp field.
8#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize)]
9pub struct SearchCustomersSort {
10    /// The field to sort by.
11    ///
12    /// **Important:** When using a [DateTimeFilter](SearchCustomersDateTimeFilter), `sort_field` must
13    /// match the timestamp field that the `DateTimeFilter` uses to filter. For example, if you set
14    /// your `sort_field` to `CREATED_AT` and you use a `DateTimeFilter`, your `DateTimeFilter` must
15    /// filter for customers by their `CREATED_AT` date. If this field does not match the timestamp
16    /// field in `DateTimeFilter`, `SearchCustomers` returns an error.
17    ///
18    /// Default: `CREATED_AT`.
19    pub sort_field: Option<SortCustomersField>,
20    /// The chronological order in which results are returned. Defaults to DESC.
21    pub sort_order: Option<SortOrder>,
22}