#[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 MissingModuleVariable {
#[serde(rename = "variableName")]
variable_name: super::super::super::super::super::objects::scout::compute::api::VariableName,
#[builder(
default,
custom(
type = impl
Into<Option<super::super::super::super::super::objects::scout::compute::api::Context>>,
convert = |v|v.into().map(Box::new)
)
)]
#[serde(rename = "context", skip_serializing_if = "Option::is_none", default)]
context: Option<
Box<super::super::super::super::super::objects::scout::compute::api::Context>,
>,
}
impl MissingModuleVariable {
#[inline]
pub fn new(
variable_name: super::super::super::super::super::objects::scout::compute::api::VariableName,
) -> Self {
Self::builder().variable_name(variable_name).build()
}
#[inline]
pub fn variable_name(
&self,
) -> &super::super::super::super::super::objects::scout::compute::api::VariableName {
&self.variable_name
}
#[inline]
pub fn context(
&self,
) -> Option<
&super::super::super::super::super::objects::scout::compute::api::Context,
> {
self.context.as_ref().map(|o| &**o)
}
}
impl conjure_error::ErrorType for MissingModuleVariable {
#[inline]
fn code() -> conjure_error::ErrorCode {
conjure_error::ErrorCode::InvalidArgument
}
#[inline]
fn name() -> &'static str {
"Compute:MissingModuleVariable"
}
#[inline]
fn safe_args() -> &'static [&'static str] {
&[]
}
}