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>A map of key and value pairs to use to tag your cluster.</p>
9 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
10 /// <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>
11 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
12 pub client_token: ::std::option::Option<::std::string::String>,
13 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
14 pub multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
15}
16impl CreateClusterInput {
17 /// <p>If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.</p>
18 pub fn deletion_protection_enabled(&self) -> ::std::option::Option<bool> {
19 self.deletion_protection_enabled
20 }
21 /// <p>A map of key and value pairs to use to tag your cluster.</p>
22 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
23 self.tags.as_ref()
24 }
25 /// <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>
26 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
27 pub fn client_token(&self) -> ::std::option::Option<&str> {
28 self.client_token.as_deref()
29 }
30 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
31 pub fn multi_region_properties(&self) -> ::std::option::Option<&crate::types::MultiRegionProperties> {
32 self.multi_region_properties.as_ref()
33 }
34}
35impl CreateClusterInput {
36 /// Creates a new builder-style object to manufacture [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
37 pub fn builder() -> crate::operation::create_cluster::builders::CreateClusterInputBuilder {
38 crate::operation::create_cluster::builders::CreateClusterInputBuilder::default()
39 }
40}
41
42/// A builder for [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
43#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
44#[non_exhaustive]
45pub struct CreateClusterInputBuilder {
46 pub(crate) deletion_protection_enabled: ::std::option::Option<bool>,
47 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
48 pub(crate) client_token: ::std::option::Option<::std::string::String>,
49 pub(crate) multi_region_properties: ::std::option::Option<crate::types::MultiRegionProperties>,
50}
51impl CreateClusterInputBuilder {
52 /// <p>If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.</p>
53 pub fn deletion_protection_enabled(mut self, input: bool) -> Self {
54 self.deletion_protection_enabled = ::std::option::Option::Some(input);
55 self
56 }
57 /// <p>If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.</p>
58 pub fn set_deletion_protection_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
59 self.deletion_protection_enabled = input;
60 self
61 }
62 /// <p>If enabled, you can't delete your cluster. You must first disable this property before you can delete your cluster.</p>
63 pub fn get_deletion_protection_enabled(&self) -> &::std::option::Option<bool> {
64 &self.deletion_protection_enabled
65 }
66 /// Adds a key-value pair to `tags`.
67 ///
68 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
69 ///
70 /// <p>A map of key and value pairs to use to tag your cluster.</p>
71 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
72 let mut hash_map = self.tags.unwrap_or_default();
73 hash_map.insert(k.into(), v.into());
74 self.tags = ::std::option::Option::Some(hash_map);
75 self
76 }
77 /// <p>A map of key and value pairs to use to tag your cluster.</p>
78 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
79 self.tags = input;
80 self
81 }
82 /// <p>A map of key and value pairs to use to tag your cluster.</p>
83 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
84 &self.tags
85 }
86 /// <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>
87 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
88 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89 self.client_token = ::std::option::Option::Some(input.into());
90 self
91 }
92 /// <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>
93 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
94 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95 self.client_token = input;
96 self
97 }
98 /// <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>
99 /// <p>If you don't specify a client token, the Amazon Web Services SDK automatically generates one.</p>
100 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
101 &self.client_token
102 }
103 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
104 pub fn multi_region_properties(mut self, input: crate::types::MultiRegionProperties) -> Self {
105 self.multi_region_properties = ::std::option::Option::Some(input);
106 self
107 }
108 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
109 pub fn set_multi_region_properties(mut self, input: ::std::option::Option<crate::types::MultiRegionProperties>) -> Self {
110 self.multi_region_properties = input;
111 self
112 }
113 /// <p>The configuration settings when creating a multi-Region cluster, including the witness region and linked cluster properties.</p>
114 pub fn get_multi_region_properties(&self) -> &::std::option::Option<crate::types::MultiRegionProperties> {
115 &self.multi_region_properties
116 }
117 /// Consumes the builder and constructs a [`CreateClusterInput`](crate::operation::create_cluster::CreateClusterInput).
118 pub fn build(
119 self,
120 ) -> ::std::result::Result<crate::operation::create_cluster::CreateClusterInput, ::aws_smithy_types::error::operation::BuildError> {
121 ::std::result::Result::Ok(crate::operation::create_cluster::CreateClusterInput {
122 deletion_protection_enabled: self.deletion_protection_enabled,
123 tags: self.tags,
124 client_token: self.client_token,
125 multi_region_properties: self.multi_region_properties,
126 })
127 }
128}