Skip to main content

nominal_api/conjure/objects/scout/metadata/
property_value_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 PropertyValueWithCount {
16    #[builder(into)]
17    #[serde(rename = "propertyValue")]
18    property_value: String,
19    #[serde(rename = "documentCount")]
20    document_count: i32,
21}
22impl PropertyValueWithCount {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(property_value: impl Into<String>, document_count: i32) -> Self {
26        Self::builder()
27            .property_value(property_value)
28            .document_count(document_count)
29            .build()
30    }
31    #[inline]
32    pub fn property_value(&self) -> &str {
33        &*self.property_value
34    }
35    #[inline]
36    pub fn document_count(&self) -> i32 {
37        self.document_count
38    }
39}