#[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 TestWebhookRequest {
#[serde(rename = "integrationRid")]
integration_rid: super::super::super::super::integrations::api::IntegrationRid,
#[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>,
#[builder(default, into)]
#[serde(rename = "eventType", skip_serializing_if = "Option::is_none", default)]
event_type: Option<String>,
}
impl TestWebhookRequest {
#[inline]
pub fn new(
integration_rid: super::super::super::super::integrations::api::IntegrationRid,
template: impl Into<String>,
) -> Self {
Self::builder().integration_rid(integration_rid).template(template).build()
}
#[inline]
pub fn integration_rid(
&self,
) -> &super::super::super::super::integrations::api::IntegrationRid {
&self.integration_rid
}
#[inline]
pub fn template(&self) -> &str {
&*self.template
}
#[inline]
pub fn sample_context(
&self,
) -> &std::collections::BTreeMap<String, conjure_object::Any> {
&self.sample_context
}
#[inline]
pub fn event_type(&self) -> Option<&str> {
self.event_type.as_ref().map(|o| &**o)
}
}