aws-sdk-securityagent 1.4.0

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

/// <p>Input for creating a new agent space.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateAgentSpaceInput {
    /// <p>The name of the agent space.</p>
    pub name: ::std::option::Option<::std::string::String>,
    /// <p>A description of the agent space.</p>
    pub description: ::std::option::Option<::std::string::String>,
    /// <p>The AWS resources to associate with the agent space.</p>
    pub aws_resources: ::std::option::Option<crate::types::AwsResources>,
    /// <p>The list of target domain identifiers to associate with the agent space.</p>
    pub target_domain_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The code review settings for the agent space.</p>
    pub code_review_settings: ::std::option::Option<crate::types::CodeReviewSettings>,
    /// <p>The identifier of the AWS KMS key to use for encrypting data in the agent space.</p>
    pub kms_key_id: ::std::option::Option<::std::string::String>,
    /// <p>The tags to associate with the agent space.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateAgentSpaceInput {
    /// <p>The name of the agent space.</p>
    pub fn name(&self) -> ::std::option::Option<&str> {
        self.name.as_deref()
    }
    /// <p>A description of the agent space.</p>
    pub fn description(&self) -> ::std::option::Option<&str> {
        self.description.as_deref()
    }
    /// <p>The AWS resources to associate with the agent space.</p>
    pub fn aws_resources(&self) -> ::std::option::Option<&crate::types::AwsResources> {
        self.aws_resources.as_ref()
    }
    /// <p>The list of target domain identifiers to associate with the agent space.</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 `.target_domain_ids.is_none()`.
    pub fn target_domain_ids(&self) -> &[::std::string::String] {
        self.target_domain_ids.as_deref().unwrap_or_default()
    }
    /// <p>The code review settings for the agent space.</p>
    pub fn code_review_settings(&self) -> ::std::option::Option<&crate::types::CodeReviewSettings> {
        self.code_review_settings.as_ref()
    }
    /// <p>The identifier of the AWS KMS key to use for encrypting data in the agent space.</p>
    pub fn kms_key_id(&self) -> ::std::option::Option<&str> {
        self.kms_key_id.as_deref()
    }
    /// <p>The tags to associate with the agent space.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl CreateAgentSpaceInput {
    /// Creates a new builder-style object to manufacture [`CreateAgentSpaceInput`](crate::operation::create_agent_space::CreateAgentSpaceInput).
    pub fn builder() -> crate::operation::create_agent_space::builders::CreateAgentSpaceInputBuilder {
        crate::operation::create_agent_space::builders::CreateAgentSpaceInputBuilder::default()
    }
}

/// A builder for [`CreateAgentSpaceInput`](crate::operation::create_agent_space::CreateAgentSpaceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateAgentSpaceInputBuilder {
    pub(crate) name: ::std::option::Option<::std::string::String>,
    pub(crate) description: ::std::option::Option<::std::string::String>,
    pub(crate) aws_resources: ::std::option::Option<crate::types::AwsResources>,
    pub(crate) target_domain_ids: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) code_review_settings: ::std::option::Option<crate::types::CodeReviewSettings>,
    pub(crate) kms_key_id: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateAgentSpaceInputBuilder {
    /// <p>The name of the agent space.</p>
    /// This field is required.
    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the agent space.</p>
    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.name = input;
        self
    }
    /// <p>The name of the agent space.</p>
    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.name
    }
    /// <p>A description of the agent space.</p>
    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the agent space.</p>
    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.description = input;
        self
    }
    /// <p>A description of the agent space.</p>
    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.description
    }
    /// <p>The AWS resources to associate with the agent space.</p>
    pub fn aws_resources(mut self, input: crate::types::AwsResources) -> Self {
        self.aws_resources = ::std::option::Option::Some(input);
        self
    }
    /// <p>The AWS resources to associate with the agent space.</p>
    pub fn set_aws_resources(mut self, input: ::std::option::Option<crate::types::AwsResources>) -> Self {
        self.aws_resources = input;
        self
    }
    /// <p>The AWS resources to associate with the agent space.</p>
    pub fn get_aws_resources(&self) -> &::std::option::Option<crate::types::AwsResources> {
        &self.aws_resources
    }
    /// Appends an item to `target_domain_ids`.
    ///
    /// To override the contents of this collection use [`set_target_domain_ids`](Self::set_target_domain_ids).
    ///
    /// <p>The list of target domain identifiers to associate with the agent space.</p>
    pub fn target_domain_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.target_domain_ids.unwrap_or_default();
        v.push(input.into());
        self.target_domain_ids = ::std::option::Option::Some(v);
        self
    }
    /// <p>The list of target domain identifiers to associate with the agent space.</p>
    pub fn set_target_domain_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.target_domain_ids = input;
        self
    }
    /// <p>The list of target domain identifiers to associate with the agent space.</p>
    pub fn get_target_domain_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.target_domain_ids
    }
    /// <p>The code review settings for the agent space.</p>
    pub fn code_review_settings(mut self, input: crate::types::CodeReviewSettings) -> Self {
        self.code_review_settings = ::std::option::Option::Some(input);
        self
    }
    /// <p>The code review settings for the agent space.</p>
    pub fn set_code_review_settings(mut self, input: ::std::option::Option<crate::types::CodeReviewSettings>) -> Self {
        self.code_review_settings = input;
        self
    }
    /// <p>The code review settings for the agent space.</p>
    pub fn get_code_review_settings(&self) -> &::std::option::Option<crate::types::CodeReviewSettings> {
        &self.code_review_settings
    }
    /// <p>The identifier of the AWS KMS key to use for encrypting data in the agent space.</p>
    pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kms_key_id = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier of the AWS KMS key to use for encrypting data in the agent space.</p>
    pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kms_key_id = input;
        self
    }
    /// <p>The identifier of the AWS KMS key to use for encrypting data in the agent space.</p>
    pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
        &self.kms_key_id
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags to associate with the agent space.</p>
    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut hash_map = self.tags.unwrap_or_default();
        hash_map.insert(k.into(), v.into());
        self.tags = ::std::option::Option::Some(hash_map);
        self
    }
    /// <p>The tags to associate with the agent space.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>The tags to associate with the agent space.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateAgentSpaceInput`](crate::operation::create_agent_space::CreateAgentSpaceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_agent_space::CreateAgentSpaceInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_agent_space::CreateAgentSpaceInput {
            name: self.name,
            description: self.description,
            aws_resources: self.aws_resources,
            target_domain_ids: self.target_domain_ids,
            code_review_settings: self.code_review_settings,
            kms_key_id: self.kms_key_id,
            tags: self.tags,
        })
    }
}