nominal-api-conjure 0.1452.0

Conjure HTTP API bindings for the Nominal platform
Documentation
/// A labeled action the user can select from a visualization's action menu.
#[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 VizActionOption {
    #[builder(into)]
    #[serde(rename = "label")]
    label: String,
    #[builder(custom(type = super::VizAction, convert = Box::new))]
    #[serde(rename = "action")]
    action: Box<super::VizAction>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::CommandConfirmation>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "confirmation", skip_serializing_if = "Option::is_none", default)]
    confirmation: Option<Box<super::CommandConfirmation>>,
}
impl VizActionOption {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(label: impl Into<String>, action: super::VizAction) -> Self {
        Self::builder().label(label).action(action).build()
    }
    /// Menu label; must be non-empty and at most 128 characters.
    #[inline]
    pub fn label(&self) -> &str {
        &*self.label
    }
    #[inline]
    pub fn action(&self) -> &super::VizAction {
        &*self.action
    }
    /// If present, require explicit confirmation after selection and before execution.
    #[inline]
    pub fn confirmation(&self) -> Option<&super::CommandConfirmation> {
        self.confirmation.as_ref().map(|o| &**o)
    }
}