#[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 {
#[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()
}
#[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
}
#[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)
}
#[inline]
pub fn condition(&self) -> Option<&super::UnresolvedCheckCondition> {
self.condition.as_ref().map(|o| &**o)
}
}