aws-sdk-networksecuritymanager 1.2.0

AWS SDK for AWS Network Security Manager Customer API
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 CreateDeploymentInput {
    /// <p>A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
    /// <p>The name of the deployment.</p>
    pub deployment_name: ::std::option::Option<::std::string::String>,
    /// <p>A description of the deployment.</p>
    pub deployment_description: ::std::option::Option<::std::string::String>,
    /// <p>The configuration settings for the deployment.</p>
    pub deployment_configuration: ::std::option::Option<crate::types::DeploymentConfiguration>,
    /// <p>The policies associated with the deployment.</p>
    pub associated_policy_list: ::std::option::Option<::std::vec::Vec<crate::types::PolicyReference>>,
    /// <p>The scope associated with the deployment. A deployment has exactly one scope.</p>
    pub associated_scope_list: ::std::option::Option<::std::vec::Vec<crate::types::ScopeReference>>,
    /// <p>Specifies whether to publish the resource. When <code>true</code>, the resource is saved in published (<code>ACTIVE</code>) state. When <code>false</code>, it is saved as a draft (<code>DRAFT</code>). Default: <code>true</code>.</p>
    pub is_published: ::std::option::Option<bool>,
    /// <p>The tags to add to the resource when it is created.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateDeploymentInput {
    /// <p>A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
    /// <p>The name of the deployment.</p>
    pub fn deployment_name(&self) -> ::std::option::Option<&str> {
        self.deployment_name.as_deref()
    }
    /// <p>A description of the deployment.</p>
    pub fn deployment_description(&self) -> ::std::option::Option<&str> {
        self.deployment_description.as_deref()
    }
    /// <p>The configuration settings for the deployment.</p>
    pub fn deployment_configuration(&self) -> ::std::option::Option<&crate::types::DeploymentConfiguration> {
        self.deployment_configuration.as_ref()
    }
    /// <p>The policies associated with the deployment.</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_policy_list.is_none()`.
    pub fn associated_policy_list(&self) -> &[crate::types::PolicyReference] {
        self.associated_policy_list.as_deref().unwrap_or_default()
    }
    /// <p>The scope associated with the deployment. A deployment has exactly one 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 `.associated_scope_list.is_none()`.
    pub fn associated_scope_list(&self) -> &[crate::types::ScopeReference] {
        self.associated_scope_list.as_deref().unwrap_or_default()
    }
    /// <p>Specifies whether to publish the resource. When <code>true</code>, the resource is saved in published (<code>ACTIVE</code>) state. When <code>false</code>, it is saved as a draft (<code>DRAFT</code>). Default: <code>true</code>.</p>
    pub fn is_published(&self) -> ::std::option::Option<bool> {
        self.is_published
    }
    /// <p>The tags to add to the resource when it is created.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
}
impl CreateDeploymentInput {
    /// Creates a new builder-style object to manufacture [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
    pub fn builder() -> crate::operation::create_deployment::builders::CreateDeploymentInputBuilder {
        crate::operation::create_deployment::builders::CreateDeploymentInputBuilder::default()
    }
}

/// A builder for [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateDeploymentInputBuilder {
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
    pub(crate) deployment_name: ::std::option::Option<::std::string::String>,
    pub(crate) deployment_description: ::std::option::Option<::std::string::String>,
    pub(crate) deployment_configuration: ::std::option::Option<crate::types::DeploymentConfiguration>,
    pub(crate) associated_policy_list: ::std::option::Option<::std::vec::Vec<crate::types::PolicyReference>>,
    pub(crate) associated_scope_list: ::std::option::Option<::std::vec::Vec<crate::types::ScopeReference>>,
    pub(crate) is_published: ::std::option::Option<bool>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl CreateDeploymentInputBuilder {
    /// <p>A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.</p>
    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.client_token = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>A unique, case-sensitive token that you provide to ensure that the operation completes no more than one time. If you retry a request with the same client token and the same parameters, the service returns the result of the original successful request.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// <p>The name of the deployment.</p>
    /// This field is required.
    pub fn deployment_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.deployment_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the deployment.</p>
    pub fn set_deployment_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.deployment_name = input;
        self
    }
    /// <p>The name of the deployment.</p>
    pub fn get_deployment_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.deployment_name
    }
    /// <p>A description of the deployment.</p>
    pub fn deployment_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.deployment_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A description of the deployment.</p>
    pub fn set_deployment_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.deployment_description = input;
        self
    }
    /// <p>A description of the deployment.</p>
    pub fn get_deployment_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.deployment_description
    }
    /// <p>The configuration settings for the deployment.</p>
    /// This field is required.
    pub fn deployment_configuration(mut self, input: crate::types::DeploymentConfiguration) -> Self {
        self.deployment_configuration = ::std::option::Option::Some(input);
        self
    }
    /// <p>The configuration settings for the deployment.</p>
    pub fn set_deployment_configuration(mut self, input: ::std::option::Option<crate::types::DeploymentConfiguration>) -> Self {
        self.deployment_configuration = input;
        self
    }
    /// <p>The configuration settings for the deployment.</p>
    pub fn get_deployment_configuration(&self) -> &::std::option::Option<crate::types::DeploymentConfiguration> {
        &self.deployment_configuration
    }
    /// Appends an item to `associated_policy_list`.
    ///
    /// To override the contents of this collection use [`set_associated_policy_list`](Self::set_associated_policy_list).
    ///
    /// <p>The policies associated with the deployment.</p>
    pub fn associated_policy_list(mut self, input: crate::types::PolicyReference) -> Self {
        let mut v = self.associated_policy_list.unwrap_or_default();
        v.push(input);
        self.associated_policy_list = ::std::option::Option::Some(v);
        self
    }
    /// <p>The policies associated with the deployment.</p>
    pub fn set_associated_policy_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PolicyReference>>) -> Self {
        self.associated_policy_list = input;
        self
    }
    /// <p>The policies associated with the deployment.</p>
    pub fn get_associated_policy_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PolicyReference>> {
        &self.associated_policy_list
    }
    /// Appends an item to `associated_scope_list`.
    ///
    /// To override the contents of this collection use [`set_associated_scope_list`](Self::set_associated_scope_list).
    ///
    /// <p>The scope associated with the deployment. A deployment has exactly one scope.</p>
    pub fn associated_scope_list(mut self, input: crate::types::ScopeReference) -> Self {
        let mut v = self.associated_scope_list.unwrap_or_default();
        v.push(input);
        self.associated_scope_list = ::std::option::Option::Some(v);
        self
    }
    /// <p>The scope associated with the deployment. A deployment has exactly one scope.</p>
    pub fn set_associated_scope_list(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ScopeReference>>) -> Self {
        self.associated_scope_list = input;
        self
    }
    /// <p>The scope associated with the deployment. A deployment has exactly one scope.</p>
    pub fn get_associated_scope_list(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ScopeReference>> {
        &self.associated_scope_list
    }
    /// <p>Specifies whether to publish the resource. When <code>true</code>, the resource is saved in published (<code>ACTIVE</code>) state. When <code>false</code>, it is saved as a draft (<code>DRAFT</code>). Default: <code>true</code>.</p>
    pub fn is_published(mut self, input: bool) -> Self {
        self.is_published = ::std::option::Option::Some(input);
        self
    }
    /// <p>Specifies whether to publish the resource. When <code>true</code>, the resource is saved in published (<code>ACTIVE</code>) state. When <code>false</code>, it is saved as a draft (<code>DRAFT</code>). Default: <code>true</code>.</p>
    pub fn set_is_published(mut self, input: ::std::option::Option<bool>) -> Self {
        self.is_published = input;
        self
    }
    /// <p>Specifies whether to publish the resource. When <code>true</code>, the resource is saved in published (<code>ACTIVE</code>) state. When <code>false</code>, it is saved as a draft (<code>DRAFT</code>). Default: <code>true</code>.</p>
    pub fn get_is_published(&self) -> &::std::option::Option<bool> {
        &self.is_published
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The tags to add to the resource when it is created.</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 add to the resource when it is created.</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 add to the resource when it is created.</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 [`CreateDeploymentInput`](crate::operation::create_deployment::CreateDeploymentInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_deployment::CreateDeploymentInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_deployment::CreateDeploymentInput {
            client_token: self.client_token,
            deployment_name: self.deployment_name,
            deployment_description: self.deployment_description,
            deployment_configuration: self.deployment_configuration,
            associated_policy_list: self.associated_policy_list,
            associated_scope_list: self.associated_scope_list,
            is_published: self.is_published,
            tags: self.tags,
        })
    }
}