/// Request to send a message via secure webhook with optional per-request overrides.
/// Request overrides take precedence over integration's stored configuration.
#[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 SendSecureWebhookMessageRequest {
    #[builder(into)]
    #[serde(rename = "payload")]
    payload: String,
    #[builder(default, into)]
    #[serde(rename = "customHeaders", skip_serializing_if = "Option::is_none", default)]
    custom_headers: Option<std::collections::BTreeMap<String, String>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::WebhookDeliveryConfig>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "deliveryConfig", skip_serializing_if = "Option::is_none", default)]
    delivery_config: Option<Box<super::WebhookDeliveryConfig>>,
}
impl SendSecureWebhookMessageRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(payload: impl Into<String>) -> Self {
        Self::builder().payload(payload).build()
    }
    /// JSON payload to send. Will be signed with HMAC-SHA256 using the integration's signing key.
    /// Validated before signing to ensure well-formed JSON.
    #[inline]
    pub fn payload(&self) -> &str {
        &*self.payload
    }
    /// Optional custom headers to override integration's stored customHeaders for this request.
    /// Must not include blocked headers (Authorization, Cookie, X-API-Key, X-Auth-Token, Proxy-Authorization, X-Nominal-*).
    /// Merged with integration headers, request overrides take precedence.
    #[inline]
    pub fn custom_headers(&self) -> Option<&std::collections::BTreeMap<String, String>> {
        self.custom_headers.as_ref().map(|o| &*o)
    }
    /// Optional delivery configuration to override integration's stored deliveryConfig for this request.
    /// Merged with integration config, request overrides take precedence.
    /// Cross-field constraints (e.g., maxRetryInterval >= retryInterval) validated on merged result.
    #[inline]
    pub fn delivery_config(&self) -> Option<&super::WebhookDeliveryConfig> {
        self.delivery_config.as_ref().map(|o| &**o)
    }
}
