aws_sdk_dsql/operation/create_cluster/_create_cluster_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateClusterInput {
6 /// <p>If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.</p>
7 pub deletion_protection_enabled: ::std::option::Option<bool>,
8 /// <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
9 pub kms_encryption_key: ::std::option::Option<::std::string::String>,
10 /// <p>A map of key and value pairs to use to tag your cluster.</p>
11 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
12 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
13 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
14 pub client_token: ::std::option::Option<::std::string::String>,
15 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
16 pub multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
17}
18impl CreateClusterInput {
19 /// <p>If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.</p>
20 pub fn deletion_protection_enabled(&self) -> ::std::option::Option<bool> {
21 self.deletion_protection_enabled
22 }
23 /// <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
24 pub fn kms_encryption_key(&self) -> ::std::option::Option<&str> {
25 self.kms_encryption_key.as_deref()
26 }
27 /// <p>A map of key and value pairs to use to tag your cluster.</p>
28 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
29 self.tags.as_ref()
30 }
31 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
32 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
33 pub fn client_token(&self) -> ::std::option::Option<&str> {
34 self.client_token.as_deref()
35 }
36 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
37 pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
38 self.multi_region_properties.as_ref()
39 }
40}
41impl CreateClusterInput {
42 /// Creates a new builder-style object to manufacture [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
43 pub fn builder() -> crate::operation::create_cluster::builders::CreateClusterInputBuilder {
44 crate::operation::create_cluster::builders::CreateClusterInputBuilder::default()
45 }
46}
47
48/// A builder for [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct CreateClusterInputBuilder {
52 pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
53 pub(crate) kms_encryption_key: ::std::option::Option<::std::string::String>,
54 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
55 pub(crate) client_token: ::std::option::Option<::std::string::String>,
56 pub(crate) multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
57}
58impl CreateClusterInputBuilder {
59 /// <p>If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.</p>
60 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
61 self.deletion_protection_enabled = ::std::option::Option::Some(input);
62 self
63 }
64 /// <p>If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.</p>
65 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
66 self.deletion_protection_enabled = input;
67 self
68 }
69 /// <p>If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.</p>
70 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
71 &self.deletion_protection_enabled
72 }
73 /// <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
74 pub fn kms_encryption_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75 self.kms_encryption_key = ::std::option::Option::Some(input.into());
76 self
77 }
78 /// <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
79 pub fn set_kms_encryption_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80 self.kms_encryption_key = input;
81 self
82 }
83 /// <p>The KMS key that encrypts and protects the data on your cluster. You can specify the ARN, ID, or alias of an existing key or have Amazon Web Services create a default key for you.</p>
84 pub fn get_kms_encryption_key(&self) -> &::std::option::Option<::std::string::String> {
85 &self.kms_encryption_key
86 }
87 /// Adds a key-value pair to `tags`.
88 ///
89 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
90 ///
91 /// <p>A map of key and value pairs to use to tag your cluster.</p>
92 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
93 let mut hash_map = self.tags.unwrap_or_default();
94 hash_map.insert(k.into(), v.into());
95 self.tags = ::std::option::Option::Some(hash_map);
96 self
97 }
98 /// <p>A map of key and value pairs to use to tag your cluster.</p>
99 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
100 self.tags = input;
101 self
102 }
103 /// <p>A map of key and value pairs to use to tag your cluster.</p>
104 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
105 &self.tags
106 }
107 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
108 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
109 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110 self.client_token = ::std::option::Option::Some(input.into());
111 self
112 }
113 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
114 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
115 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.client_token = input;
117 self
118 }
119 /// <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Idempotency ensures that an API request completes only once. With an idempotent request, if the original request completes successfully, the subsequent retries with the same client token return the result from the original successful request and they have no additional effect.</p>
120 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
121 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
122 &self.client_token
123 }
124 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
125 pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
126 self.multi_region_properties = ::std::option::Option::Some(input);
127 self
128 }
129 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
130 pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
131 self.multi_region_properties = input;
132 self
133 }
134 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
135 pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
136 &self.multi_region_properties
137 }
138 /// Consumes the builder and constructs a [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
139 pub fn build(
140 self,
141 ) -> ::std::result::Result<crate::operation::create_cluster::CreateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
142 ::std::result::Result::Ok(crate::operation::create_cluster::CreateClusterInput {
143 deletion_protection_enabled: self.deletion_protection_enabled,
144 kms_encryption_key: self.kms_encryption_key,
145 tags: self.tags,
146 client_token: self.client_token,
147 multi_region_properties: self.multi_region_properties,
148 })
149 }
150}