aws_sdk_keyspaces/operation/create_keyspace/_create_keyspace_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 CreateKeyspaceInput {
6 /// <p>The name of the keyspace to be created.</p>
7 pub keyspace_name: ::std::option::Option<::std::string::String>,
8 /// <p>A list of key-value pair tags to be attached to the keyspace.</p>
9 /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html">Adding tags and labels to Amazon Keyspaces resources</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
10 pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
11 /// <p>The replication specification of the keyspace includes:</p>
12 /// <ul>
13 /// <li>
14 /// <p><code>replicationStrategy</code> - the required value is <code>SINGLE_REGION</code> or <code>MULTI_REGION</code>.</p></li>
15 /// <li>
16 /// <p><code>regionList</code> - if the <code>replicationStrategy</code> is <code>MULTI_REGION</code>, the <code>regionList</code> requires the current Region and at least one additional Amazon Web Services Region where the keyspace is going to be replicated in.</p></li>
17 /// </ul>
18 pub replication_specification: ::std::option::Option<crate::types::ReplicationSpecification>,
19}
20impl CreateKeyspaceInput {
21 /// <p>The name of the keyspace to be created.</p>
22 pub fn keyspace_name(&self) -> ::std::option::Option<&str> {
23 self.keyspace_name.as_deref()
24 }
25 /// <p>A list of key-value pair tags to be attached to the keyspace.</p>
26 /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html">Adding tags and labels to Amazon Keyspaces resources</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
27 ///
28 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
29 pub fn tags(&self) -> &[crate::types::Tag] {
30 self.tags.as_deref().unwrap_or_default()
31 }
32 /// <p>The replication specification of the keyspace includes:</p>
33 /// <ul>
34 /// <li>
35 /// <p><code>replicationStrategy</code> - the required value is <code>SINGLE_REGION</code> or <code>MULTI_REGION</code>.</p></li>
36 /// <li>
37 /// <p><code>regionList</code> - if the <code>replicationStrategy</code> is <code>MULTI_REGION</code>, the <code>regionList</code> requires the current Region and at least one additional Amazon Web Services Region where the keyspace is going to be replicated in.</p></li>
38 /// </ul>
39 pub fn replication_specification(&self) -> ::std::option::Option<&crate::types::ReplicationSpecification> {
40 self.replication_specification.as_ref()
41 }
42}
43impl CreateKeyspaceInput {
44 /// Creates a new builder-style object to manufacture [`CreateKeyspaceInput`](crate::operation::create_keyspace::CreateKeyspaceInput).
45 pub fn builder() -> crate::operation::create_keyspace::builders::CreateKeyspaceInputBuilder {
46 crate::operation::create_keyspace::builders::CreateKeyspaceInputBuilder::default()
47 }
48}
49
50/// A builder for [`CreateKeyspaceInput`](crate::operation::create_keyspace::CreateKeyspaceInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct CreateKeyspaceInputBuilder {
54 pub(crate) keyspace_name: ::std::option::Option<::std::string::String>,
55 pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
56 pub(crate) replication_specification: ::std::option::Option<crate::types::ReplicationSpecification>,
57}
58impl CreateKeyspaceInputBuilder {
59 /// <p>The name of the keyspace to be created.</p>
60 /// This field is required.
61 pub fn keyspace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62 self.keyspace_name = ::std::option::Option::Some(input.into());
63 self
64 }
65 /// <p>The name of the keyspace to be created.</p>
66 pub fn set_keyspace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.keyspace_name = input;
68 self
69 }
70 /// <p>The name of the keyspace to be created.</p>
71 pub fn get_keyspace_name(&self) -> &::std::option::Option<::std::string::String> {
72 &self.keyspace_name
73 }
74 /// Appends an item to `tags`.
75 ///
76 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
77 ///
78 /// <p>A list of key-value pair tags to be attached to the keyspace.</p>
79 /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html">Adding tags and labels to Amazon Keyspaces resources</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
80 pub fn tags(mut self, input: crate::types::Tag) -> Self {
81 let mut v = self.tags.unwrap_or_default();
82 v.push(input);
83 self.tags = ::std::option::Option::Some(v);
84 self
85 }
86 /// <p>A list of key-value pair tags to be attached to the keyspace.</p>
87 /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html">Adding tags and labels to Amazon Keyspaces resources</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
88 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
89 self.tags = input;
90 self
91 }
92 /// <p>A list of key-value pair tags to be attached to the keyspace.</p>
93 /// <p>For more information, see <a href="https://docs.aws.amazon.com/keyspaces/latest/devguide/tagging-keyspaces.html">Adding tags and labels to Amazon Keyspaces resources</a> in the <i>Amazon Keyspaces Developer Guide</i>.</p>
94 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
95 &self.tags
96 }
97 /// <p>The replication specification of the keyspace includes:</p>
98 /// <ul>
99 /// <li>
100 /// <p><code>replicationStrategy</code> - the required value is <code>SINGLE_REGION</code> or <code>MULTI_REGION</code>.</p></li>
101 /// <li>
102 /// <p><code>regionList</code> - if the <code>replicationStrategy</code> is <code>MULTI_REGION</code>, the <code>regionList</code> requires the current Region and at least one additional Amazon Web Services Region where the keyspace is going to be replicated in.</p></li>
103 /// </ul>
104 pub fn replication_specification(mut self, input: crate::types::ReplicationSpecification) -> Self {
105 self.replication_specification = ::std::option::Option::Some(input);
106 self
107 }
108 /// <p>The replication specification of the keyspace includes:</p>
109 /// <ul>
110 /// <li>
111 /// <p><code>replicationStrategy</code> - the required value is <code>SINGLE_REGION</code> or <code>MULTI_REGION</code>.</p></li>
112 /// <li>
113 /// <p><code>regionList</code> - if the <code>replicationStrategy</code> is <code>MULTI_REGION</code>, the <code>regionList</code> requires the current Region and at least one additional Amazon Web Services Region where the keyspace is going to be replicated in.</p></li>
114 /// </ul>
115 pub fn set_replication_specification(mut self, input: ::std::option::Option<crate::types::ReplicationSpecification>) -> Self {
116 self.replication_specification = input;
117 self
118 }
119 /// <p>The replication specification of the keyspace includes:</p>
120 /// <ul>
121 /// <li>
122 /// <p><code>replicationStrategy</code> - the required value is <code>SINGLE_REGION</code> or <code>MULTI_REGION</code>.</p></li>
123 /// <li>
124 /// <p><code>regionList</code> - if the <code>replicationStrategy</code> is <code>MULTI_REGION</code>, the <code>regionList</code> requires the current Region and at least one additional Amazon Web Services Region where the keyspace is going to be replicated in.</p></li>
125 /// </ul>
126 pub fn get_replication_specification(&self) -> &::std::option::Option<crate::types::ReplicationSpecification> {
127 &self.replication_specification
128 }
129 /// Consumes the builder and constructs a [`CreateKeyspaceInput`](crate::operation::create_keyspace::CreateKeyspaceInput).
130 pub fn build(
131 self,
132 ) -> ::std::result::Result<crate::operation::create_keyspace::CreateKeyspaceInput, ::aws_smithy_types::error::operation::BuildError> {
133 ::std::result::Result::Ok(crate::operation::create_keyspace::CreateKeyspaceInput {
134 keyspace_name: self.keyspace_name,
135 tags: self.tags,
136 replication_specification: self.replication_specification,
137 })
138 }
139}