aws-sdk-assurance 1.0.0

AWS SDK for AWS Assurance
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateProjectInput {
    /// <p>The ARN of this governance environment.</p>
    pub environment_arn: ::std::option::Option<::std::string::String>,
    /// <p>The name of the project.</p>
    pub project: ::std::option::Option<::std::string::String>,
    /// <p>The filters that determine which resources are in scope.</p>
    pub resource_filters: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CreateProjectInput {
    /// <p>The ARN of this governance environment.</p>
    pub fn environment_arn(&self) -> ::std::option::Option<&str> {
        self.environment_arn.as_deref()
    }
    /// <p>The name of the project.</p>
    pub fn project(&self) -> ::std::option::Option<&str> {
        self.project.as_deref()
    }
    /// <p>The filters that determine which resources are in scope.</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 `.resource_filters.is_none()`.
    pub fn resource_filters(&self) -> &[::std::string::String] {
        self.resource_filters.as_deref().unwrap_or_default()
    }
}
impl CreateProjectInput {
    /// Creates a new builder-style object to manufacture [`CreateProjectInput`](crate::operation::create_project::CreateProjectInput).
    pub fn builder() -> crate::operation::create_project::builders::CreateProjectInputBuilder {
        crate::operation::create_project::builders::CreateProjectInputBuilder::default()
    }
}

/// A builder for [`CreateProjectInput`](crate::operation::create_project::CreateProjectInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateProjectInputBuilder {
    pub(crate) environment_arn: ::std::option::Option<::std::string::String>,
    pub(crate) project: ::std::option::Option<::std::string::String>,
    pub(crate) resource_filters: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
}
impl CreateProjectInputBuilder {
    /// <p>The ARN of this governance environment.</p>
    /// This field is required.
    pub fn environment_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.environment_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN of this governance environment.</p>
    pub fn set_environment_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.environment_arn = input;
        self
    }
    /// <p>The ARN of this governance environment.</p>
    pub fn get_environment_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.environment_arn
    }
    /// <p>The name of the project.</p>
    /// This field is required.
    pub fn project(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.project = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the project.</p>
    pub fn set_project(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.project = input;
        self
    }
    /// <p>The name of the project.</p>
    pub fn get_project(&self) -> &::std::option::Option<::std::string::String> {
        &self.project
    }
    /// Appends an item to `resource_filters`.
    ///
    /// To override the contents of this collection use [`set_resource_filters`](Self::set_resource_filters).
    ///
    /// <p>The filters that determine which resources are in scope.</p>
    pub fn resource_filters(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.resource_filters.unwrap_or_default();
        v.push(input.into());
        self.resource_filters = ::std::option::Option::Some(v);
        self
    }
    /// <p>The filters that determine which resources are in scope.</p>
    pub fn set_resource_filters(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.resource_filters = input;
        self
    }
    /// <p>The filters that determine which resources are in scope.</p>
    pub fn get_resource_filters(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.resource_filters
    }
    /// Consumes the builder and constructs a [`CreateProjectInput`](crate::operation::create_project::CreateProjectInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_project::CreateProjectInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_project::CreateProjectInput {
            environment_arn: self.environment_arn,
            project: self.project,
            resource_filters: self.resource_filters,
        })
    }
}