nominal-api-conjure 0.1434.0

Conjure HTTP 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 ButtonVizDefinitionV1 {
    #[builder(into)]
    #[serde(rename = "label")]
    label: String,
    #[builder(custom(type = super::ButtonAction, convert = Box::new))]
    #[serde(rename = "action")]
    action: Box<super::ButtonAction>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::ButtonConfirmation>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "confirmation", skip_serializing_if = "Option::is_none", default)]
    confirmation: Option<Box<super::ButtonConfirmation>>,
}
impl ButtonVizDefinitionV1 {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(label: impl Into<String>, action: super::ButtonAction) -> Self {
        Self::builder().label(label).action(action).build()
    }
    /// The text rendered on the button.
    #[inline]
    pub fn label(&self) -> &str {
        &*self.label
    }
    #[inline]
    pub fn action(&self) -> &super::ButtonAction {
        &*self.action
    }
    /// If present, the frontend must show a confirmation dialog and
    /// receive an explicit confirmation before performing the action.
    #[inline]
    pub fn confirmation(&self) -> Option<&super::ButtonConfirmation> {
        self.confirmation.as_ref().map(|o| &**o)
    }
}