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 /// <p>An optional resource-based policy document in JSON format that defines access permissions for the cluster.</p>
18 pub policy: ::std::option::Option<::std::string::String>,
19 /// <p>An optional field that controls whether to bypass the lockout prevention check. When set to true, this parameter allows you to apply a policy that might lock you out of the cluster. Use with caution.</p>
20 pub bypass_policy_lockout_safety_check: ::std::option::Option<bool>,
21}
22impl CreateClusterInput {
23 /// <p>If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.</p>
24 pub fn deletion_protection_enabled(&self) -> ::std::option::Option<bool> {
25 self.deletion_protection_enabled
26 }
27 /// <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>
28 pub fn kms_encryption_key(&self) -> ::std::option::Option<&str> {
29 self.kms_encryption_key.as_deref()
30 }
31 /// <p>A map of key and value pairs to use to tag your cluster.</p>
32 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
33 self.tags.as_ref()
34 }
35 /// <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>
36 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
37 pub fn client_token(&self) -> ::std::option::Option<&str> {
38 self.client_token.as_deref()
39 }
40 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
41 pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
42 self.multi_region_properties.as_ref()
43 }
44 /// <p>An optional resource-based policy document in JSON format that defines access permissions for the cluster.</p>
45 pub fn policy(&self) -> ::std::option::Option<&str> {
46 self.policy.as_deref()
47 }
48 /// <p>An optional field that controls whether to bypass the lockout prevention check. When set to true, this parameter allows you to apply a policy that might lock you out of the cluster. Use with caution.</p>
49 pub fn bypass_policy_lockout_safety_check(&self) -> ::std::option::Option<bool> {
50 self.bypass_policy_lockout_safety_check
51 }
52}
53impl CreateClusterInput {
54 /// Creates a new builder-style object to manufacture [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
55 pub fn builder() -> crate::operation::create_cluster::builders::CreateClusterInputBuilder {
56 crate::operation::create_cluster::builders::CreateClusterInputBuilder::default()
57 }
58}
59
60/// A builder for [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct CreateClusterInputBuilder {
64 pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
65 pub(crate) kms_encryption_key: ::std::option::Option<::std::string::String>,
66 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
67 pub(crate) client_token: ::std::option::Option<::std::string::String>,
68 pub(crate) multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
69 pub(crate) policy: ::std::option::Option<::std::string::String>,
70 pub(crate) bypass_policy_lockout_safety_check: ::std::option::Option<bool>,
71}
72impl CreateClusterInputBuilder {
73 /// <p>If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.</p>
74 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
75 self.deletion_protection_enabled = ::std::option::Option::Some(input);
76 self
77 }
78 /// <p>If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.</p>
79 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
80 self.deletion_protection_enabled = input;
81 self
82 }
83 /// <p>If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.</p>
84 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
85 &self.deletion_protection_enabled
86 }
87 /// <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>
88 pub fn kms_encryption_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.kms_encryption_key = ::std::option::Option::Some(input.into());
90 self
91 }
92 /// <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>
93 pub fn set_kms_encryption_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94 self.kms_encryption_key = input;
95 self
96 }
97 /// <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>
98 pub fn get_kms_encryption_key(&self) -> &::std::option::Option<::std::string::String> {
99 &self.kms_encryption_key
100 }
101 /// Adds a key-value pair to `tags`.
102 ///
103 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
104 ///
105 /// <p>A map of key and value pairs to use to tag your cluster.</p>
106 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
107 let mut hash_map = self.tags.unwrap_or_default();
108 hash_map.insert(k.into(), v.into());
109 self.tags = ::std::option::Option::Some(hash_map);
110 self
111 }
112 /// <p>A map of key and value pairs to use to tag your cluster.</p>
113 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
114 self.tags = input;
115 self
116 }
117 /// <p>A map of key and value pairs to use to tag your cluster.</p>
118 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
119 &self.tags
120 }
121 /// <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>
122 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
123 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124 self.client_token = ::std::option::Option::Some(input.into());
125 self
126 }
127 /// <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>
128 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
129 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130 self.client_token = input;
131 self
132 }
133 /// <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>
134 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
135 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
136 &self.client_token
137 }
138 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
139 pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
140 self.multi_region_properties = ::std::option::Option::Some(input);
141 self
142 }
143 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
144 pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
145 self.multi_region_properties = input;
146 self
147 }
148 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
149 pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
150 &self.multi_region_properties
151 }
152 /// <p>An optional resource-based policy document in JSON format that defines access permissions for the cluster.</p>
153 pub fn policy(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154 self.policy = ::std::option::Option::Some(input.into());
155 self
156 }
157 /// <p>An optional resource-based policy document in JSON format that defines access permissions for the cluster.</p>
158 pub fn set_policy(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159 self.policy = input;
160 self
161 }
162 /// <p>An optional resource-based policy document in JSON format that defines access permissions for the cluster.</p>
163 pub fn get_policy(&self) -> &::std::option::Option<::std::string::String> {
164 &self.policy
165 }
166 /// <p>An optional field that controls whether to bypass the lockout prevention check. When set to true, this parameter allows you to apply a policy that might lock you out of the cluster. Use with caution.</p>
167 pub fn bypass_policy_lockout_safety_check(mut self, input: bool) -> Self {
168 self.bypass_policy_lockout_safety_check = ::std::option::Option::Some(input);
169 self
170 }
171 /// <p>An optional field that controls whether to bypass the lockout prevention check. When set to true, this parameter allows you to apply a policy that might lock you out of the cluster. Use with caution.</p>
172 pub fn set_bypass_policy_lockout_safety_check(mut self, input: ::std::option::Option<bool>) -> Self {
173 self.bypass_policy_lockout_safety_check = input;
174 self
175 }
176 /// <p>An optional field that controls whether to bypass the lockout prevention check. When set to true, this parameter allows you to apply a policy that might lock you out of the cluster. Use with caution.</p>
177 pub fn get_bypass_policy_lockout_safety_check(&self) -> &::std::option::Option<bool> {
178 &self.bypass_policy_lockout_safety_check
179 }
180 /// Consumes the builder and constructs a [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
181 pub fn build(
182 self,
183 ) -> ::std::result::Result<crate::operation::create_cluster::CreateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
184 ::std::result::Result::Ok(crate::operation::create_cluster::CreateClusterInput {
185 deletion_protection_enabled: self.deletion_protection_enabled,
186 kms_encryption_key: self.kms_encryption_key,
187 tags: self.tags,
188 client_token: self.client_token,
189 multi_region_properties: self.multi_region_properties,
190 policy: self.policy,
191 bypass_policy_lockout_safety_check: self.bypass_policy_lockout_safety_check,
192 })
193 }
194}