Skip to main content

aws_sdk_supplychain/operation/create_instance/
_create_instance_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The request parameters for CreateInstance.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateInstanceInput {
7    /// <p>The AWS Supply Chain instance name.</p>
8    pub instance_name: ::std::option::Option<::std::string::String>,
9    /// <p>The AWS Supply Chain instance description.</p>
10    pub instance_description: ::std::option::Option<::std::string::String>,
11    /// <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>
12    pub kms_key_arn: ::std::option::Option<::std::string::String>,
13    /// <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>
14    pub web_app_dns_domain: ::std::option::Option<::std::string::String>,
15    /// <p>The Amazon Web Services tags of an instance to be created.</p>
16    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
17    /// <p>The client token for idempotency.</p>
18    pub client_token: ::std::option::Option<::std::string::String>,
19}
20impl CreateInstanceInput {
21    /// <p>The AWS Supply Chain instance name.</p>
22    pub fn instance_name(&self) -> ::std::option::Option<&str> {
23        self.instance_name.as_deref()
24    }
25    /// <p>The AWS Supply Chain instance description.</p>
26    pub fn instance_description(&self) -> ::std::option::Option<&str> {
27        self.instance_description.as_deref()
28    }
29    /// <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>
30    pub fn kms_key_arn(&self) -> ::std::option::Option<&str> {
31        self.kms_key_arn.as_deref()
32    }
33    /// <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>
34    pub fn web_app_dns_domain(&self) -> ::std::option::Option<&str> {
35        self.web_app_dns_domain.as_deref()
36    }
37    /// <p>The Amazon Web Services tags of an instance to be created.</p>
38    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
39        self.tags.as_ref()
40    }
41    /// <p>The client token for idempotency.</p>
42    pub fn client_token(&self) -> ::std::option::Option<&str> {
43        self.client_token.as_deref()
44    }
45}
46impl CreateInstanceInput {
47    /// Creates a new builder-style object to manufacture [`CreateInstanceInput`](crate::operation::create_instance::CreateInstanceInput).
48    pub fn builder() -> crate::operation::create_instance::builders::CreateInstanceInputBuilder {
49        crate::operation::create_instance::builders::CreateInstanceInputBuilder::default()
50    }
51}
52
53/// A builder for [`CreateInstanceInput`](crate::operation::create_instance::CreateInstanceInput).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct CreateInstanceInputBuilder {
57    pub(crate) instance_name: ::std::option::Option<::std::string::String>,
58    pub(crate) instance_description: ::std::option::Option<::std::string::String>,
59    pub(crate) kms_key_arn: ::std::option::Option<::std::string::String>,
60    pub(crate) web_app_dns_domain: ::std::option::Option<::std::string::String>,
61    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
62    pub(crate) client_token: ::std::option::Option<::std::string::String>,
63}
64impl CreateInstanceInputBuilder {
65    /// <p>The AWS Supply Chain instance name.</p>
66    pub fn instance_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.instance_name = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The AWS Supply Chain instance name.</p>
71    pub fn set_instance_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.instance_name = input;
73        self
74    }
75    /// <p>The AWS Supply Chain instance name.</p>
76    pub fn get_instance_name(&self) -> &::std::option::Option<::std::string::String> {
77        &self.instance_name
78    }
79    /// <p>The AWS Supply Chain instance description.</p>
80    pub fn instance_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.instance_description = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The AWS Supply Chain instance description.</p>
85    pub fn set_instance_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.instance_description = input;
87        self
88    }
89    /// <p>The AWS Supply Chain instance description.</p>
90    pub fn get_instance_description(&self) -> &::std::option::Option<::std::string::String> {
91        &self.instance_description
92    }
93    /// <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>
94    pub fn kms_key_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
95        self.kms_key_arn = ::std::option::Option::Some(input.into());
96        self
97    }
98    /// <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>
99    pub fn set_kms_key_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
100        self.kms_key_arn = input;
101        self
102    }
103    /// <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>
104    pub fn get_kms_key_arn(&self) -> &::std::option::Option<::std::string::String> {
105        &self.kms_key_arn
106    }
107    /// <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>
108    pub fn web_app_dns_domain(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109        self.web_app_dns_domain = ::std::option::Option::Some(input.into());
110        self
111    }
112    /// <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>
113    pub fn set_web_app_dns_domain(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114        self.web_app_dns_domain = input;
115        self
116    }
117    /// <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>
118    pub fn get_web_app_dns_domain(&self) -> &::std::option::Option<::std::string::String> {
119        &self.web_app_dns_domain
120    }
121    /// Adds a key-value pair to `tags`.
122    ///
123    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
124    ///
125    /// <p>The Amazon Web Services tags of an instance to be created.</p>
126    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
127        let mut hash_map = self.tags.unwrap_or_default();
128        hash_map.insert(k.into(), v.into());
129        self.tags = ::std::option::Option::Some(hash_map);
130        self
131    }
132    /// <p>The Amazon Web Services tags of an instance to be created.</p>
133    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
134        self.tags = input;
135        self
136    }
137    /// <p>The Amazon Web Services tags of an instance to be created.</p>
138    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
139        &self.tags
140    }
141    /// <p>The client token for idempotency.</p>
142    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
143        self.client_token = ::std::option::Option::Some(input.into());
144        self
145    }
146    /// <p>The client token for idempotency.</p>
147    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
148        self.client_token = input;
149        self
150    }
151    /// <p>The client token for idempotency.</p>
152    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
153        &self.client_token
154    }
155    /// Consumes the builder and constructs a [`CreateInstanceInput`](crate::operation::create_instance::CreateInstanceInput).
156    pub fn build(
157        self,
158    ) -> ::std::result::Result<crate::operation::create_instance::CreateInstanceInput, ::aws_smithy_types::error::operation::BuildError> {
159        ::std::result::Result::Ok(crate::operation::create_instance::CreateInstanceInput {
160            instance_name: self.instance_name,
161            instance_description: self.instance_description,
162            kms_key_arn: self.kms_key_arn,
163            web_app_dns_domain: self.web_app_dns_domain,
164            tags: self.tags,
165            client_token: self.client_token,
166        })
167    }
168}