/// Retry parameters serve as integration-level defaults that can be overridden at runtime.
///
/// Server-side validation enforces:
/// - defaultRequestTimeoutSeconds maximum of 120
/// - defaultMaxRetryIntervalSeconds must be >= defaultRetryIntervalSeconds when both are provided
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    Copy
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct WebhookDeliveryConfig {
    #[builder(default, into)]
    #[serde(
        rename = "defaultRequestTimeoutSeconds",
        skip_serializing_if = "Option::is_none",
        default
    )]
    default_request_timeout_seconds: Option<i32>,
    #[builder(default, into)]
    #[serde(
        rename = "defaultMaxRetries",
        skip_serializing_if = "Option::is_none",
        default
    )]
    default_max_retries: Option<i32>,
    #[builder(default, into)]
    #[serde(
        rename = "defaultRetryIntervalSeconds",
        skip_serializing_if = "Option::is_none",
        default
    )]
    default_retry_interval_seconds: Option<i32>,
    #[builder(default, into)]
    #[serde(
        rename = "defaultExponentialBackoff",
        skip_serializing_if = "Option::is_none",
        default
    )]
    default_exponential_backoff: Option<bool>,
    #[builder(default, into)]
    #[serde(
        rename = "defaultMaxRetryIntervalSeconds",
        skip_serializing_if = "Option::is_none",
        default
    )]
    default_max_retry_interval_seconds: Option<i32>,
    #[builder(default, into)]
    #[serde(
        rename = "defaultDeliveryTimeoutSeconds",
        skip_serializing_if = "Option::is_none",
        default
    )]
    default_delivery_timeout_seconds: Option<i32>,
}
impl WebhookDeliveryConfig {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new() -> Self {
        Self::builder().build()
    }
    /// Default HTTP request timeout in seconds (server default 10, range 5-120)
    #[inline]
    pub fn default_request_timeout_seconds(&self) -> Option<i32> {
        self.default_request_timeout_seconds.as_ref().map(|o| *o)
    }
    /// Default maximum delivery attempts before failing (server default 3, range 0-10)
    #[inline]
    pub fn default_max_retries(&self) -> Option<i32> {
        self.default_max_retries.as_ref().map(|o| *o)
    }
    /// Default initial interval between retry attempts in seconds (server default 15, range 5-300)
    #[inline]
    pub fn default_retry_interval_seconds(&self) -> Option<i32> {
        self.default_retry_interval_seconds.as_ref().map(|o| *o)
    }
    /// Whether to apply exponential backoff to retry intervals (server default true)
    #[inline]
    pub fn default_exponential_backoff(&self) -> Option<bool> {
        self.default_exponential_backoff.as_ref().map(|o| *o)
    }
    /// Default maximum interval between retries when using exponential backoff in seconds (server default 300, range 5-3600)
    #[inline]
    pub fn default_max_retry_interval_seconds(&self) -> Option<i32> {
        self.default_max_retry_interval_seconds.as_ref().map(|o| *o)
    }
    /// Default overall delivery timeout in seconds before giving up (server default 600, range 10-86400)
    #[inline]
    pub fn default_delivery_timeout_seconds(&self) -> Option<i32> {
        self.default_delivery_timeout_seconds.as_ref().map(|o| *o)
    }
}
