/// Request to validate a Handlebars webhook template
#[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 ValidateTemplateRequest {
    #[builder(into)]
    #[serde(rename = "template")]
    template: 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 = "sampleContext",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    sample_context: std::collections::BTreeMap<String, conjure_object::Any>,
}
impl ValidateTemplateRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(template: impl Into<String>) -> Self {
        Self::builder().template(template).build()
    }
    /// Handlebars template string to validate
    #[inline]
    pub fn template(&self) -> &str {
        &*self.template
    }
    /// Sample variable values for template evaluation
    #[inline]
    pub fn sample_context(
        &self,
    ) -> &std::collections::BTreeMap<String, conjure_object::Any> {
        &self.sample_context
    }
}
