Skip to main content

nominal_api/conjure/objects/event/
sort_options.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct SortOptions {
16    #[serde(rename = "isDescending")]
17    is_descending: bool,
18    #[serde(rename = "field")]
19    field: super::SortField,
20}
21impl SortOptions {
22    /// Constructs a new instance of the type.
23    #[inline]
24    pub fn new(is_descending: bool, field: super::SortField) -> Self {
25        Self::builder().is_descending(is_descending).field(field).build()
26    }
27    #[inline]
28    pub fn is_descending(&self) -> bool {
29        self.is_descending
30    }
31    #[inline]
32    pub fn field(&self) -> &super::SortField {
33        &self.field
34    }
35}