// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>An assessment of a content policy for a guardrail.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct GuardrailContentPolicyAssessment {
    /// <p>The content policy filters.</p>
    pub filters: ::std::vec::Vec<crate::types::GuardrailContentFilter>,
}
impl GuardrailContentPolicyAssessment {
    /// <p>The content policy filters.</p>
    pub fn filters(&self) -> &[crate::types::GuardrailContentFilter] {
        use std::ops::Deref;
        self.filters.deref()
    }
}
impl GuardrailContentPolicyAssessment {
    /// Creates a new builder-style object to manufacture [`GuardrailContentPolicyAssessment`](crate::types::GuardrailContentPolicyAssessment).
    pub fn builder() -> crate::types::builders::GuardrailContentPolicyAssessmentBuilder {
        crate::types::builders::GuardrailContentPolicyAssessmentBuilder::default()
    }
}

/// A builder for [`GuardrailContentPolicyAssessment`](crate::types::GuardrailContentPolicyAssessment).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct GuardrailContentPolicyAssessmentBuilder {
    pub(crate) filters: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailContentFilter>>,
}
impl GuardrailContentPolicyAssessmentBuilder {
    /// Appends an item to `filters`.
    ///
    /// To override the contents of this collection use [`set_filters`](Self::set_filters).
    ///
    /// <p>The content policy filters.</p>
    pub fn filters(mut self, input: crate::types::GuardrailContentFilter) -> Self {
        let mut v = self.filters.unwrap_or_default();
        v.push(input);
        self.filters = ::std::option::Option::Some(v);
        self
    }
    /// <p>The content policy filters.</p>
    pub fn set_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GuardrailContentFilter>>) -> Self {
        self.filters = input;
        self
    }
    /// <p>The content policy filters.</p>
    pub fn get_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GuardrailContentFilter>> {
        &self.filters
    }
    /// Consumes the builder and constructs a [`GuardrailContentPolicyAssessment`](crate::types::GuardrailContentPolicyAssessment).
    /// This method will fail if any of the following fields are not set:
    /// - [`filters`](crate::types::builders::GuardrailContentPolicyAssessmentBuilder::filters)
    pub fn build(self) -> ::std::result::Result<crate::types::GuardrailContentPolicyAssessment, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::types::GuardrailContentPolicyAssessment {
            filters: self.filters.ok_or_else(|| {
                ::aws_smithy_types::error::operation::BuildError::missing_field(
                    "filters",
                    "filters was not specified but it is required when building GuardrailContentPolicyAssessment",
                )
            })?,
        })
    }
}
