#[derive(
Debug,
Clone,
conjure_object::serde::Serialize,
conjure_object::serde::Deserialize,
PartialEq,
Eq,
PartialOrd,
Ord,
Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct HealthCheckResult {
#[serde(rename = "type")]
type_: super::CheckType,
#[serde(rename = "state")]
state: super::HealthState,
#[builder(default, into)]
#[serde(rename = "message", skip_serializing_if = "Option::is_none", default)]
message: Option<String>,
#[builder(
default,
map(
key(type = String, into),
value(
custom(
type = impl
conjure_object::serde::Serialize,
convert = |v|conjure_object::Any::new(
v
).expect("value failed to serialize")
)
)
)
)]
#[serde(
rename = "params",
skip_serializing_if = "std::collections::BTreeMap::is_empty",
default
)]
params: std::collections::BTreeMap<String, conjure_object::Any>,
}
impl HealthCheckResult {
#[inline]
pub fn new(type_: super::CheckType, state: super::HealthState) -> Self {
Self::builder().type_(type_).state(state).build()
}
#[inline]
pub fn type_(&self) -> &super::CheckType {
&self.type_
}
#[inline]
pub fn state(&self) -> &super::HealthState {
&self.state
}
#[inline]
pub fn message(&self) -> Option<&str> {
self.message.as_ref().map(|o| &**o)
}
#[inline]
pub fn params(&self) -> &std::collections::BTreeMap<String, conjure_object::Any> {
&self.params
}
}