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