nominal_api/conjure/objects/scout/internal/search/api/
long_field.rs1#[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 LongField {
16 #[builder(into)]
17 #[serde(rename = "name")]
18 name: String,
19 #[serde(rename = "threshold")]
20 threshold: conjure_object::SafeLong,
21 #[serde(rename = "operator")]
22 operator: super::Operator,
23}
24impl LongField {
25 #[inline]
27 pub fn new(
28 name: impl Into<String>,
29 threshold: conjure_object::SafeLong,
30 operator: super::Operator,
31 ) -> Self {
32 Self::builder().name(name).threshold(threshold).operator(operator).build()
33 }
34 #[inline]
35 pub fn name(&self) -> &str {
36 &*self.name
37 }
38 #[inline]
39 pub fn threshold(&self) -> conjure_object::SafeLong {
40 self.threshold
41 }
42 #[inline]
43 pub fn operator(&self) -> &super::Operator {
44 &self.operator
45 }
46}