Skip to main content

nominal_api/conjure/objects/scout/metadata/
property_key_with_count.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 PropertyKeyWithCount {
16    #[builder(into)]
17    #[serde(rename = "propertyKey")]
18    property_key: String,
19    #[serde(rename = "documentCount")]
20    document_count: i32,
21    #[serde(rename = "valueCount")]
22    value_count: i32,
23}
24impl PropertyKeyWithCount {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new(
28        property_key: impl Into<String>,
29        document_count: i32,
30        value_count: i32,
31    ) -> Self {
32        Self::builder()
33            .property_key(property_key)
34            .document_count(document_count)
35            .value_count(value_count)
36            .build()
37    }
38    #[inline]
39    pub fn property_key(&self) -> &str {
40        &*self.property_key
41    }
42    #[inline]
43    pub fn document_count(&self) -> i32 {
44        self.document_count
45    }
46    #[inline]
47    pub fn value_count(&self) -> i32 {
48        self.value_count
49    }
50}