nominal-api-conjure 0.1452.0

Conjure HTTP API bindings for the Nominal platform
Documentation
/// Inclusive range on a numeric property. At least one bound is required.
/// BETWEEN: min <= x <= max. An absent bound is unbounded on that side.
/// NOT_BETWEEN: x < min OR x > max. An absent bound drops that side.
/// Both operators require a numeric value for `name`. Missing properties
/// and string values never match.
/// Bounds are closed [min, max] to match the number chip (is between /
/// is not between), not half-open.
#[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 NumericPropertyRangePredicate {
    #[serde(rename = "name")]
    name: super::PropertyName,
    #[builder(default, into)]
    #[serde(rename = "min", skip_serializing_if = "Option::is_none", default)]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    min: Option<f64>,
    #[builder(default, into)]
    #[serde(rename = "max", skip_serializing_if = "Option::is_none", default)]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    max: Option<f64>,
    #[serde(rename = "operator")]
    operator: super::NumericPropertyRangeOperator,
}
impl NumericPropertyRangePredicate {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        name: super::PropertyName,
        operator: super::NumericPropertyRangeOperator,
    ) -> Self {
        Self::builder().name(name).operator(operator).build()
    }
    #[inline]
    pub fn name(&self) -> &super::PropertyName {
        &self.name
    }
    #[inline]
    pub fn min(&self) -> Option<f64> {
        self.min.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn max(&self) -> Option<f64> {
        self.max.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn operator(&self) -> &super::NumericPropertyRangeOperator {
        &self.operator
    }
}