Skip to main content

nominal_api/conjure/objects/scout/internal/search/api/
boolean_field.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 BooleanField {
16    #[builder(into)]
17    #[serde(rename = "name")]
18    name: String,
19    #[serde(rename = "value")]
20    value: bool,
21}
22impl BooleanField {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(name: impl Into<String>, value: bool) -> Self {
26        Self::builder().name(name).value(value).build()
27    }
28    #[inline]
29    pub fn name(&self) -> &str {
30        &*self.name
31    }
32    #[inline]
33    pub fn value(&self) -> bool {
34        self.value
35    }
36}