nominal-api-conjure 0.1377.0

Conjure HTTP API bindings for the Nominal platform
Documentation
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct PropertyKeyWithCount {
    #[serde(rename = "propertyKey")]
    property_key: super::super::super::api::PropertyName,
    #[serde(rename = "documentCount")]
    document_count: i32,
    #[serde(rename = "valueCount")]
    value_count: i32,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::StringPropertySummary>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "string", skip_serializing_if = "Option::is_none", default)]
    string: Option<Box<super::StringPropertySummary>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::NumericPropertySummary>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "numeric", skip_serializing_if = "Option::is_none", default)]
    numeric: Option<Box<super::NumericPropertySummary>>,
}
impl PropertyKeyWithCount {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        property_key: super::super::super::api::PropertyName,
        document_count: i32,
        value_count: i32,
    ) -> Self {
        Self::builder()
            .property_key(property_key)
            .document_count(document_count)
            .value_count(value_count)
            .build()
    }
    #[inline]
    pub fn property_key(&self) -> &super::super::super::api::PropertyName {
        &self.property_key
    }
    /// Number of documents with either a string or numeric value for this key.
    #[inline]
    pub fn document_count(&self) -> i32 {
        self.document_count
    }
    /// Number of distinct string values. Numeric values are intentionally excluded.
    #[deprecated(
        note = "Retained for backward compatibility. Use string.distinctValueCount instead."
    )]
    #[inline]
    pub fn value_count(&self) -> i32 {
        self.value_count
    }
    /// Present when this key has string values.
    #[inline]
    pub fn string(&self) -> Option<&super::StringPropertySummary> {
        self.string.as_ref().map(|o| &**o)
    }
    /// Present when this key has numeric values.
    #[inline]
    pub fn numeric(&self) -> Option<&super::NumericPropertySummary> {
        self.numeric.as_ref().map(|o| &**o)
    }
}