#[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 CreateSimpleWebhookDetails {
#[builder(into)]
#[serde(rename = "webhook")]
webhook: String,
#[builder(default, into)]
#[serde(rename = "secret", skip_serializing_if = "Option::is_none", default)]
secret: Option<String>,
#[builder(default, into)]
#[serde(rename = "contentType", skip_serializing_if = "Option::is_none", default)]
content_type: Option<super::WebhookContentType>,
#[builder(default, into)]
#[serde(rename = "timeoutSeconds", skip_serializing_if = "Option::is_none", default)]
timeout_seconds: Option<i32>,
#[builder(default, into)]
#[serde(rename = "customHeaders", skip_serializing_if = "Option::is_none", default)]
custom_headers: Option<std::collections::BTreeMap<String, String>>,
}
impl CreateSimpleWebhookDetails {
#[inline]
pub fn new(webhook: impl Into<String>) -> Self {
Self::builder().webhook(webhook).build()
}
#[inline]
pub fn webhook(&self) -> &str {
&*self.webhook
}
#[inline]
pub fn secret(&self) -> Option<&str> {
self.secret.as_ref().map(|o| &**o)
}
#[inline]
pub fn content_type(&self) -> Option<&super::WebhookContentType> {
self.content_type.as_ref().map(|o| &*o)
}
#[inline]
pub fn timeout_seconds(&self) -> Option<i32> {
self.timeout_seconds.as_ref().map(|o| *o)
}
#[inline]
pub fn custom_headers(&self) -> Option<&std::collections::BTreeMap<String, String>> {
self.custom_headers.as_ref().map(|o| &*o)
}
}