aws_sdk_keyspaces/operation/get_keyspace/
_get_keyspace_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetKeyspaceOutput {
6 pub keyspace_name: ::std::string::String,
8 pub resource_arn: ::std::string::String,
10 pub replication_strategy: crate::types::Rs,
12 pub replication_regions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14 pub replication_group_statuses: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationGroupStatus>>,
16 _request_id: Option<String>,
17}
18impl GetKeyspaceOutput {
19 pub fn keyspace_name(&self) -> &str {
21 use std::ops::Deref;
22 self.keyspace_name.deref()
23 }
24 pub fn resource_arn(&self) -> &str {
26 use std::ops::Deref;
27 self.resource_arn.deref()
28 }
29 pub fn replication_strategy(&self) -> &crate::types::Rs {
31 &self.replication_strategy
32 }
33 pub fn replication_regions(&self) -> &[::std::string::String] {
37 self.replication_regions.as_deref().unwrap_or_default()
38 }
39 pub fn replication_group_statuses(&self) -> &[crate::types::ReplicationGroupStatus] {
43 self.replication_group_statuses.as_deref().unwrap_or_default()
44 }
45}
46impl ::aws_types::request_id::RequestId for GetKeyspaceOutput {
47 fn request_id(&self) -> Option<&str> {
48 self._request_id.as_deref()
49 }
50}
51impl GetKeyspaceOutput {
52 pub fn builder() -> crate::operation::get_keyspace::builders::GetKeyspaceOutputBuilder {
54 crate::operation::get_keyspace::builders::GetKeyspaceOutputBuilder::default()
55 }
56}
57
58#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
60#[non_exhaustive]
61pub struct GetKeyspaceOutputBuilder {
62 pub(crate) keyspace_name: ::std::option::Option<::std::string::String>,
63 pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
64 pub(crate) replication_strategy: ::std::option::Option<crate::types::Rs>,
65 pub(crate) replication_regions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
66 pub(crate) replication_group_statuses: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationGroupStatus>>,
67 _request_id: Option<String>,
68}
69impl GetKeyspaceOutputBuilder {
70 pub fn keyspace_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
73 self.keyspace_name = ::std::option::Option::Some(input.into());
74 self
75 }
76 pub fn set_keyspace_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
78 self.keyspace_name = input;
79 self
80 }
81 pub fn get_keyspace_name(&self) -> &::std::option::Option<::std::string::String> {
83 &self.keyspace_name
84 }
85 pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
88 self.resource_arn = ::std::option::Option::Some(input.into());
89 self
90 }
91 pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
93 self.resource_arn = input;
94 self
95 }
96 pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
98 &self.resource_arn
99 }
100 pub fn replication_strategy(mut self, input: crate::types::Rs) -> Self {
103 self.replication_strategy = ::std::option::Option::Some(input);
104 self
105 }
106 pub fn set_replication_strategy(mut self, input: ::std::option::Option<crate::types::Rs>) -> Self {
108 self.replication_strategy = input;
109 self
110 }
111 pub fn get_replication_strategy(&self) -> &::std::option::Option<crate::types::Rs> {
113 &self.replication_strategy
114 }
115 pub fn replication_regions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 let mut v = self.replication_regions.unwrap_or_default();
122 v.push(input.into());
123 self.replication_regions = ::std::option::Option::Some(v);
124 self
125 }
126 pub fn set_replication_regions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
128 self.replication_regions = input;
129 self
130 }
131 pub fn get_replication_regions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
133 &self.replication_regions
134 }
135 pub fn replication_group_statuses(mut self, input: crate::types::ReplicationGroupStatus) -> Self {
141 let mut v = self.replication_group_statuses.unwrap_or_default();
142 v.push(input);
143 self.replication_group_statuses = ::std::option::Option::Some(v);
144 self
145 }
146 pub fn set_replication_group_statuses(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ReplicationGroupStatus>>) -> Self {
148 self.replication_group_statuses = input;
149 self
150 }
151 pub fn get_replication_group_statuses(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ReplicationGroupStatus>> {
153 &self.replication_group_statuses
154 }
155 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
156 self._request_id = Some(request_id.into());
157 self
158 }
159
160 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
161 self._request_id = request_id;
162 self
163 }
164 pub fn build(self) -> ::std::result::Result<crate::operation::get_keyspace::GetKeyspaceOutput, ::aws_smithy_types::error::operation::BuildError> {
170 ::std::result::Result::Ok(crate::operation::get_keyspace::GetKeyspaceOutput {
171 keyspace_name: self.keyspace_name.ok_or_else(|| {
172 ::aws_smithy_types::error::operation::BuildError::missing_field(
173 "keyspace_name",
174 "keyspace_name was not specified but it is required when building GetKeyspaceOutput",
175 )
176 })?,
177 resource_arn: self.resource_arn.ok_or_else(|| {
178 ::aws_smithy_types::error::operation::BuildError::missing_field(
179 "resource_arn",
180 "resource_arn was not specified but it is required when building GetKeyspaceOutput",
181 )
182 })?,
183 replication_strategy: self.replication_strategy.ok_or_else(|| {
184 ::aws_smithy_types::error::operation::BuildError::missing_field(
185 "replication_strategy",
186 "replication_strategy was not specified but it is required when building GetKeyspaceOutput",
187 )
188 })?,
189 replication_regions: self.replication_regions,
190 replication_group_statuses: self.replication_group_statuses,
191 _request_id: self._request_id,
192 })
193 }
194}