nominal-api 0.1239.0

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 CreateCheckRequest {
    #[builder(default, into)]
    #[serde(
        rename = "checkLineageRid",
        skip_serializing_if = "Option::is_none",
        default
    )]
    check_lineage_rid: Option<conjure_object::Uuid>,
    #[builder(into)]
    #[serde(rename = "title")]
    title: String,
    #[builder(into)]
    #[serde(rename = "description")]
    description: String,
    #[builder(default, into)]
    #[serde(
        rename = "autoGeneratedTitle",
        skip_serializing_if = "Option::is_none",
        default
    )]
    auto_generated_title: Option<String>,
    #[builder(default, into)]
    #[serde(
        rename = "autoGeneratedDescription",
        skip_serializing_if = "Option::is_none",
        default
    )]
    auto_generated_description: Option<String>,
    #[serde(rename = "priority")]
    priority: super::super::super::api::Priority,
    #[builder(default, into)]
    #[serde(
        rename = "generatedEventType",
        skip_serializing_if = "Option::is_none",
        default
    )]
    generated_event_type: Option<super::super::super::super::event::EventType>,
    #[builder(default, into)]
    #[serde(
        rename = "generatedEventLabels",
        skip_serializing_if = "Option::is_none",
        default
    )]
    generated_event_labels: Option<
        std::collections::BTreeSet<super::super::super::super::api::Label>,
    >,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::UnresolvedCheckCondition>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "condition", skip_serializing_if = "Option::is_none", default)]
    condition: Option<Box<super::UnresolvedCheckCondition>>,
}
impl CreateCheckRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        title: impl Into<String>,
        description: impl Into<String>,
        priority: super::super::super::api::Priority,
    ) -> Self {
        Self::builder().title(title).description(description).priority(priority).build()
    }
    /// Identifies the lineage of checks this check belongs to. If not specified, a new lineage will be created.
    /// This is named checkLineageRid for historical reasons but is actually a UUID.
    #[inline]
    pub fn check_lineage_rid(&self) -> Option<conjure_object::Uuid> {
        self.check_lineage_rid.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn title(&self) -> &str {
        &*self.title
    }
    #[inline]
    pub fn description(&self) -> &str {
        &*self.description
    }
    #[inline]
    pub fn auto_generated_title(&self) -> Option<&str> {
        self.auto_generated_title.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn auto_generated_description(&self) -> Option<&str> {
        self.auto_generated_description.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn priority(&self) -> &super::super::super::api::Priority {
        &self.priority
    }
    /// The event type that will be used for events generated from an execution of this check.
    /// If the check is executed through a data review, the event will have this type.
    /// Defaults to ERROR.
    #[inline]
    pub fn generated_event_type(
        &self,
    ) -> Option<&super::super::super::super::event::EventType> {
        self.generated_event_type.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn generated_event_labels(
        &self,
    ) -> Option<&std::collections::BTreeSet<super::super::super::super::api::Label>> {
        self.generated_event_labels.as_ref().map(|o| &*o)
    }
    /// This field should not be omitted.
    #[inline]
    pub fn condition(&self) -> Option<&super::UnresolvedCheckCondition> {
        self.condition.as_ref().map(|o| &**o)
    }
}