aws-sdk-securityhub 1.109.0

AWS SDK for AWS SecurityHub
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>This object typically provides details about a control finding, such as applicable standards and the status of control checks. While finding providers can add custom content in <code>Compliance</code> object fields, they are typically used to review details of Security Hub CSPM control findings.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Compliance {
    /// <p>Typically summarizes the result of a control check.</p>
    /// <p>For Security Hub CSPM controls, valid values for <code>Status</code> are as follows.</p>
    /// <ul>
    /// <li>
    /// <ul>
    /// <li>
    /// <p><code>PASSED</code> - Standards check passed for all evaluated resources.</p></li>
    /// <li>
    /// <p><code>WARNING</code> - Some information is missing or this check is not supported for your configuration.</p></li>
    /// <li>
    /// <p><code>FAILED</code> - Standards check failed for at least one evaluated resource.</p></li>
    /// <li>
    /// <p><code>NOT_AVAILABLE</code> - Check could not be performed due to a service outage, API error, or because the result of the Config evaluation was <code>NOT_APPLICABLE</code>. If the Config evaluation result was <code>NOT_APPLICABLE</code> for a Security Hub CSPM control, Security Hub CSPM automatically archives the finding after 3 days.</p></li>
    /// </ul></li>
    /// </ul>
    pub status: ::std::option::Option<crate::types::ComplianceStatus>,
    /// <p>Typically provides the industry or regulatory framework requirements that are related to a control. The check for that control is aligned with these requirements.</p>
    /// <p>Array Members: Maximum number of 32 items.</p>
    pub related_requirements: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>Typically used to provide a list of reasons for the value of <code>Status</code>.</p>
    pub status_reasons: ::std::option::Option<::std::vec::Vec<crate::types::StatusReason>>,
    /// <p>Typically provides the unique identifier of a control across standards. For Security Hub CSPM controls, this field consists of an Amazon Web Services service and a unique number, such as <code>APIGateway.5</code>.</p>
    pub security_control_id: ::std::option::Option<::std::string::String>,
    /// <p>Typically provides an array of enabled security standards in which a security control is currently enabled.</p>
    pub associated_standards: ::std::option::Option<::std::vec::Vec<crate::types::AssociatedStandard>>,
    /// <p>Typically an object that includes security control parameter names and values.</p>
    pub security_control_parameters: ::std::option::Option<::std::vec::Vec<crate::types::SecurityControlParameter>>,
}
impl Compliance {
    /// <p>Typically summarizes the result of a control check.</p>
    /// <p>For Security Hub CSPM controls, valid values for <code>Status</code> are as follows.</p>
    /// <ul>
    /// <li>
    /// <ul>
    /// <li>
    /// <p><code>PASSED</code> - Standards check passed for all evaluated resources.</p></li>
    /// <li>
    /// <p><code>WARNING</code> - Some information is missing or this check is not supported for your configuration.</p></li>
    /// <li>
    /// <p><code>FAILED</code> - Standards check failed for at least one evaluated resource.</p></li>
    /// <li>
    /// <p><code>NOT_AVAILABLE</code> - Check could not be performed due to a service outage, API error, or because the result of the Config evaluation was <code>NOT_APPLICABLE</code>. If the Config evaluation result was <code>NOT_APPLICABLE</code> for a Security Hub CSPM control, Security Hub CSPM automatically archives the finding after 3 days.</p></li>
    /// </ul></li>
    /// </ul>
    pub fn status(&self) -> ::std::option::Option<&crate::types::ComplianceStatus> {
        self.status.as_ref()
    }
    /// <p>Typically provides the industry or regulatory framework requirements that are related to a control. The check for that control is aligned with these requirements.</p>
    /// <p>Array Members: Maximum number of 32 items.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.related_requirements.is_none()`.
    pub fn related_requirements(&self) -> &[::std::string::String] {
        self.related_requirements.as_deref().unwrap_or_default()
    }
    /// <p>Typically used to provide a list of reasons for the value of <code>Status</code>.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.status_reasons.is_none()`.
    pub fn status_reasons(&self) -> &[crate::types::StatusReason] {
        self.status_reasons.as_deref().unwrap_or_default()
    }
    /// <p>Typically provides the unique identifier of a control across standards. For Security Hub CSPM controls, this field consists of an Amazon Web Services service and a unique number, such as <code>APIGateway.5</code>.</p>
    pub fn security_control_id(&self) -> ::std::option::Option<&str> {
        self.security_control_id.as_deref()
    }
    /// <p>Typically provides an array of enabled security standards in which a security control is currently enabled.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.associated_standards.is_none()`.
    pub fn associated_standards(&self) -> &[crate::types::AssociatedStandard] {
        self.associated_standards.as_deref().unwrap_or_default()
    }
    /// <p>Typically an object that includes security control parameter names and values.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.security_control_parameters.is_none()`.
    pub fn security_control_parameters(&self) -> &[crate::types::SecurityControlParameter] {
        self.security_control_parameters.as_deref().unwrap_or_default()
    }
}
impl Compliance {
    /// Creates a new builder-style object to manufacture [`Compliance`](crate::types::Compliance).
    pub fn builder() -> crate::types::builders::ComplianceBuilder {
        crate::types::builders::ComplianceBuilder::default()
    }
}

/// A builder for [`Compliance`](crate::types::Compliance).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ComplianceBuilder {
    pub(crate) status: ::std::option::Option<crate::types::ComplianceStatus>,
    pub(crate) related_requirements: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) status_reasons: ::std::option::Option<::std::vec::Vec<crate::types::StatusReason>>,
    pub(crate) security_control_id: ::std::option::Option<::std::string::String>,
    pub(crate) associated_standards: ::std::option::Option<::std::vec::Vec<crate::types::AssociatedStandard>>,
    pub(crate) security_control_parameters: ::std::option::Option<::std::vec::Vec<crate::types::SecurityControlParameter>>,
}
impl ComplianceBuilder {
    /// <p>Typically summarizes the result of a control check.</p>
    /// <p>For Security Hub CSPM controls, valid values for <code>Status</code> are as follows.</p>
    /// <ul>
    /// <li>
    /// <ul>
    /// <li>
    /// <p><code>PASSED</code> - Standards check passed for all evaluated resources.</p></li>
    /// <li>
    /// <p><code>WARNING</code> - Some information is missing or this check is not supported for your configuration.</p></li>
    /// <li>
    /// <p><code>FAILED</code> - Standards check failed for at least one evaluated resource.</p></li>
    /// <li>
    /// <p><code>NOT_AVAILABLE</code> - Check could not be performed due to a service outage, API error, or because the result of the Config evaluation was <code>NOT_APPLICABLE</code>. If the Config evaluation result was <code>NOT_APPLICABLE</code> for a Security Hub CSPM control, Security Hub CSPM automatically archives the finding after 3 days.</p></li>
    /// </ul></li>
    /// </ul>
    pub fn status(mut self, input: crate::types::ComplianceStatus) -> Self {
        self.status = ::std::option::Option::Some(input);
        self
    }
    /// <p>Typically summarizes the result of a control check.</p>
    /// <p>For Security Hub CSPM controls, valid values for <code>Status</code> are as follows.</p>
    /// <ul>
    /// <li>
    /// <ul>
    /// <li>
    /// <p><code>PASSED</code> - Standards check passed for all evaluated resources.</p></li>
    /// <li>
    /// <p><code>WARNING</code> - Some information is missing or this check is not supported for your configuration.</p></li>
    /// <li>
    /// <p><code>FAILED</code> - Standards check failed for at least one evaluated resource.</p></li>
    /// <li>
    /// <p><code>NOT_AVAILABLE</code> - Check could not be performed due to a service outage, API error, or because the result of the Config evaluation was <code>NOT_APPLICABLE</code>. If the Config evaluation result was <code>NOT_APPLICABLE</code> for a Security Hub CSPM control, Security Hub CSPM automatically archives the finding after 3 days.</p></li>
    /// </ul></li>
    /// </ul>
    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ComplianceStatus>) -> Self {
        self.status = input;
        self
    }
    /// <p>Typically summarizes the result of a control check.</p>
    /// <p>For Security Hub CSPM controls, valid values for <code>Status</code> are as follows.</p>
    /// <ul>
    /// <li>
    /// <ul>
    /// <li>
    /// <p><code>PASSED</code> - Standards check passed for all evaluated resources.</p></li>
    /// <li>
    /// <p><code>WARNING</code> - Some information is missing or this check is not supported for your configuration.</p></li>
    /// <li>
    /// <p><code>FAILED</code> - Standards check failed for at least one evaluated resource.</p></li>
    /// <li>
    /// <p><code>NOT_AVAILABLE</code> - Check could not be performed due to a service outage, API error, or because the result of the Config evaluation was <code>NOT_APPLICABLE</code>. If the Config evaluation result was <code>NOT_APPLICABLE</code> for a Security Hub CSPM control, Security Hub CSPM automatically archives the finding after 3 days.</p></li>
    /// </ul></li>
    /// </ul>
    pub fn get_status(&self) -> &::std::option::Option<crate::types::ComplianceStatus> {
        &self.status
    }
    /// Appends an item to `related_requirements`.
    ///
    /// To override the contents of this collection use [`set_related_requirements`](Self::set_related_requirements).
    ///
    /// <p>Typically provides the industry or regulatory framework requirements that are related to a control. The check for that control is aligned with these requirements.</p>
    /// <p>Array Members: Maximum number of 32 items.</p>
    pub fn related_requirements(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.related_requirements.unwrap_or_default();
        v.push(input.into());
        self.related_requirements = ::std::option::Option::Some(v);
        self
    }
    /// <p>Typically provides the industry or regulatory framework requirements that are related to a control. The check for that control is aligned with these requirements.</p>
    /// <p>Array Members: Maximum number of 32 items.</p>
    pub fn set_related_requirements(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.related_requirements = input;
        self
    }
    /// <p>Typically provides the industry or regulatory framework requirements that are related to a control. The check for that control is aligned with these requirements.</p>
    /// <p>Array Members: Maximum number of 32 items.</p>
    pub fn get_related_requirements(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.related_requirements
    }
    /// Appends an item to `status_reasons`.
    ///
    /// To override the contents of this collection use [`set_status_reasons`](Self::set_status_reasons).
    ///
    /// <p>Typically used to provide a list of reasons for the value of <code>Status</code>.</p>
    pub fn status_reasons(mut self, input: crate::types::StatusReason) -> Self {
        let mut v = self.status_reasons.unwrap_or_default();
        v.push(input);
        self.status_reasons = ::std::option::Option::Some(v);
        self
    }
    /// <p>Typically used to provide a list of reasons for the value of <code>Status</code>.</p>
    pub fn set_status_reasons(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::StatusReason>>) -> Self {
        self.status_reasons = input;
        self
    }
    /// <p>Typically used to provide a list of reasons for the value of <code>Status</code>.</p>
    pub fn get_status_reasons(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::StatusReason>> {
        &self.status_reasons
    }
    /// <p>Typically provides the unique identifier of a control across standards. For Security Hub CSPM controls, this field consists of an Amazon Web Services service and a unique number, such as <code>APIGateway.5</code>.</p>
    pub fn security_control_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.security_control_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>Typically provides the unique identifier of a control across standards. For Security Hub CSPM controls, this field consists of an Amazon Web Services service and a unique number, such as <code>APIGateway.5</code>.</p>
    pub fn set_security_control_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.security_control_id = input;
        self
    }
    /// <p>Typically provides the unique identifier of a control across standards. For Security Hub CSPM controls, this field consists of an Amazon Web Services service and a unique number, such as <code>APIGateway.5</code>.</p>
    pub fn get_security_control_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.security_control_id
    }
    /// Appends an item to `associated_standards`.
    ///
    /// To override the contents of this collection use [`set_associated_standards`](Self::set_associated_standards).
    ///
    /// <p>Typically provides an array of enabled security standards in which a security control is currently enabled.</p>
    pub fn associated_standards(mut self, input: crate::types::AssociatedStandard) -> Self {
        let mut v = self.associated_standards.unwrap_or_default();
        v.push(input);
        self.associated_standards = ::std::option::Option::Some(v);
        self
    }
    /// <p>Typically provides an array of enabled security standards in which a security control is currently enabled.</p>
    pub fn set_associated_standards(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssociatedStandard>>) -> Self {
        self.associated_standards = input;
        self
    }
    /// <p>Typically provides an array of enabled security standards in which a security control is currently enabled.</p>
    pub fn get_associated_standards(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssociatedStandard>> {
        &self.associated_standards
    }
    /// Appends an item to `security_control_parameters`.
    ///
    /// To override the contents of this collection use [`set_security_control_parameters`](Self::set_security_control_parameters).
    ///
    /// <p>Typically an object that includes security control parameter names and values.</p>
    pub fn security_control_parameters(mut self, input: crate::types::SecurityControlParameter) -> Self {
        let mut v = self.security_control_parameters.unwrap_or_default();
        v.push(input);
        self.security_control_parameters = ::std::option::Option::Some(v);
        self
    }
    /// <p>Typically an object that includes security control parameter names and values.</p>
    pub fn set_security_control_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::SecurityControlParameter>>) -> Self {
        self.security_control_parameters = input;
        self
    }
    /// <p>Typically an object that includes security control parameter names and values.</p>
    pub fn get_security_control_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::SecurityControlParameter>> {
        &self.security_control_parameters
    }
    /// Consumes the builder and constructs a [`Compliance`](crate::types::Compliance).
    pub fn build(self) -> crate::types::Compliance {
        crate::types::Compliance {
            status: self.status,
            related_requirements: self.related_requirements,
            status_reasons: self.status_reasons,
            security_control_id: self.security_control_id,
            associated_standards: self.associated_standards,
            security_control_parameters: self.security_control_parameters,
        }
    }
}