aws-sdk-supplychain 1.97.0

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

/// <p>The request parameters for CreateInstance.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateInstanceInput {
    /// <p>The AWS Supply Chain instance name.</p>
    pub instance_name: ::std::option::Option<::std::string::String>,
    /// <p>The AWS Supply Chain instance description.</p>
    pub instance_description: ::std::option::Option<::std::string::String>,
    /// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon Web Services owned KMS key. If you don't provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key.</p>
    pub kms_key_arn: ::std::option::Option<::std::string::String>,
    /// <p>The DNS subdomain of the web app. This would be "example" in the URL "example.scn.global.on.aws". You can set this to a custom value, as long as the domain isn't already being used by someone else. The name may only include alphanumeric characters and hyphens.</p>
    pub web_app_dns_domain: ::std::option::Option<::std::string::String>,
    /// <p>The Amazon Web Services tags of an instance to be created.</p>
    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    /// <p>The client token for idempotency.</p>
    pub client_token: ::std::option::Option<::std::string::String>,
}
impl CreateInstanceInput {
    /// <p>The AWS Supply Chain instance name.</p>
    pub fn instance_name(&self) -> ::std::option::Option<&str> {
        self.instance_name.as_deref()
    }
    /// <p>The AWS Supply Chain instance description.</p>
    pub fn instance_description(&self) -> ::std::option::Option<&str> {
        self.instance_description.as_deref()
    }
    /// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon Web Services owned KMS key. If you don't provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key.</p>
    pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
        self.kms_key_arn.as_deref()
    }
    /// <p>The DNS subdomain of the web app. This would be "example" in the URL "example.scn.global.on.aws". You can set this to a custom value, as long as the domain isn't already being used by someone else. The name may only include alphanumeric characters and hyphens.</p>
    pub fn web_app_dns_domain(&self) -> ::std::option::Option<&str> {
        self.web_app_dns_domain.as_deref()
    }
    /// <p>The Amazon Web Services tags of an instance to be created.</p>
    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        self.tags.as_ref()
    }
    /// <p>The client token for idempotency.</p>
    pub fn client_token(&self) -> ::std::option::Option<&str> {
        self.client_token.as_deref()
    }
}
impl CreateInstanceInput {
    /// Creates a new builder-style object to manufacture [`CreateInstanceInput`](crate::operation::create_instance::CreateInstanceInput).
    pub fn builder() -> crate::operation::create_instance::builders::CreateInstanceInputBuilder {
        crate::operation::create_instance::builders::CreateInstanceInputBuilder::default()
    }
}

/// A builder for [`CreateInstanceInput`](crate::operation::create_instance::CreateInstanceInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateInstanceInputBuilder {
    pub(crate) instance_name: ::std::option::Option<::std::string::String>,
    pub(crate) instance_description: ::std::option::Option<::std::string::String>,
    pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
    pub(crate) web_app_dns_domain: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
    pub(crate) client_token: ::std::option::Option<::std::string::String>,
}
impl CreateInstanceInputBuilder {
    /// <p>The AWS Supply Chain instance name.</p>
    pub fn instance_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The AWS Supply Chain instance name.</p>
    pub fn set_instance_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_name = input;
        self
    }
    /// <p>The AWS Supply Chain instance name.</p>
    pub fn get_instance_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_name
    }
    /// <p>The AWS Supply Chain instance description.</p>
    pub fn instance_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.instance_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The AWS Supply Chain instance description.</p>
    pub fn set_instance_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.instance_description = input;
        self
    }
    /// <p>The AWS Supply Chain instance description.</p>
    pub fn get_instance_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.instance_description
    }
    /// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon Web Services owned KMS key. If you don't provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key.</p>
    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.kms_key_arn = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon Web Services owned KMS key. If you don't provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key.</p>
    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.kms_key_arn = input;
        self
    }
    /// <p>The ARN (Amazon Resource Name) of the Key Management Service (KMS) key you provide for encryption. This is required if you do not want to use the Amazon Web Services owned KMS key. If you don't provide anything here, AWS Supply Chain uses the Amazon Web Services owned KMS key.</p>
    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
        &self.kms_key_arn
    }
    /// <p>The DNS subdomain of the web app. This would be "example" in the URL "example.scn.global.on.aws". You can set this to a custom value, as long as the domain isn't already being used by someone else. The name may only include alphanumeric characters and hyphens.</p>
    pub fn web_app_dns_domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.web_app_dns_domain = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The DNS subdomain of the web app. This would be "example" in the URL "example.scn.global.on.aws". You can set this to a custom value, as long as the domain isn't already being used by someone else. The name may only include alphanumeric characters and hyphens.</p>
    pub fn set_web_app_dns_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.web_app_dns_domain = input;
        self
    }
    /// <p>The DNS subdomain of the web app. This would be "example" in the URL "example.scn.global.on.aws". You can set this to a custom value, as long as the domain isn't already being used by someone else. The name may only include alphanumeric characters and hyphens.</p>
    pub fn get_web_app_dns_domain(&self) -> &::std::option::Option<::std::string::String> {
        &self.web_app_dns_domain
    }
    /// Adds a key-value pair to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>The Amazon Web Services tags of an instance to be 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 Amazon Web Services tags of an instance to be 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 Amazon Web Services tags of an instance to be created.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
        &self.tags
    }
    /// <p>The client token for idempotency.</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>The client token for idempotency.</p>
    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.client_token = input;
        self
    }
    /// <p>The client token for idempotency.</p>
    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
        &self.client_token
    }
    /// Consumes the builder and constructs a [`CreateInstanceInput`](crate::operation::create_instance::CreateInstanceInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_instance::CreateInstanceInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::create_instance::CreateInstanceInput {
            instance_name: self.instance_name,
            instance_description: self.instance_description,
            kms_key_arn: self.kms_key_arn,
            web_app_dns_domain: self.web_app_dns_domain,
            tags: self.tags,
            client_token: self.client_token,
        })
    }
}