/// Configuration for creating an advanced webhook integration. Signing key is generated by the server.
#[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 CreateSecureWebhookIntegrationRequest {
    #[builder(into)]
    #[serde(rename = "name")]
    name: String,
    #[builder(default, into)]
    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
    description: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
    workspace: Option<conjure_object::ResourceIdentifier>,
    #[builder(custom(type = super::SecureWebhookIntegration, convert = Box::new))]
    #[serde(rename = "integration")]
    integration: Box<super::SecureWebhookIntegration>,
}
impl CreateSecureWebhookIntegrationRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        name: impl Into<String>,
        integration: super::SecureWebhookIntegration,
    ) -> Self {
        Self::builder().name(name).integration(integration).build()
    }
    #[inline]
    pub fn name(&self) -> &str {
        &*self.name
    }
    #[inline]
    pub fn description(&self) -> Option<&str> {
        self.description.as_ref().map(|o| &**o)
    }
    /// The workspace in which to create the integration. If not provided, the integration will be created in the default workspace for
    /// the user's organization, if the default workspace for the organization is configured.
    #[inline]
    pub fn workspace(&self) -> Option<&conjure_object::ResourceIdentifier> {
        self.workspace.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn integration(&self) -> &super::SecureWebhookIntegration {
        &*self.integration
    }
}
