aws_sdk_s3tables/operation/get_namespace/
_get_namespace_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetNamespaceOutput {
6 pub namespace: ::std::vec::Vec<::std::string::String>,
8 pub created_at: ::aws_smithy_types::DateTime,
10 pub created_by: ::std::string::String,
12 pub owner_account_id: ::std::string::String,
14 pub namespace_id: ::std::option::Option<::std::string::String>,
16 pub table_bucket_id: ::std::option::Option<::std::string::String>,
18 _request_id: Option<String>,
19}
20impl GetNamespaceOutput {
21 pub fn namespace(&self) -> &[::std::string::String] {
23 use std::ops::Deref;
24 self.namespace.deref()
25 }
26 pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
28 &self.created_at
29 }
30 pub fn created_by(&self) -> &str {
32 use std::ops::Deref;
33 self.created_by.deref()
34 }
35 pub fn owner_account_id(&self) -> &str {
37 use std::ops::Deref;
38 self.owner_account_id.deref()
39 }
40 pub fn namespace_id(&self) -> ::std::option::Option<&str> {
42 self.namespace_id.as_deref()
43 }
44 pub fn table_bucket_id(&self) -> ::std::option::Option<&str> {
46 self.table_bucket_id.as_deref()
47 }
48}
49impl ::aws_types::request_id::RequestId for GetNamespaceOutput {
50 fn request_id(&self) -> Option<&str> {
51 self._request_id.as_deref()
52 }
53}
54impl GetNamespaceOutput {
55 pub fn builder() -> crate::operation::get_namespace::builders::GetNamespaceOutputBuilder {
57 crate::operation::get_namespace::builders::GetNamespaceOutputBuilder::default()
58 }
59}
60
61#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
63#[non_exhaustive]
64pub struct GetNamespaceOutputBuilder {
65 pub(crate) namespace: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
66 pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
67 pub(crate) created_by: ::std::option::Option<::std::string::String>,
68 pub(crate) owner_account_id: ::std::option::Option<::std::string::String>,
69 pub(crate) namespace_id: ::std::option::Option<::std::string::String>,
70 pub(crate) table_bucket_id: ::std::option::Option<::std::string::String>,
71 _request_id: Option<String>,
72}
73impl GetNamespaceOutputBuilder {
74 pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80 let mut v = self.namespace.unwrap_or_default();
81 v.push(input.into());
82 self.namespace = ::std::option::Option::Some(v);
83 self
84 }
85 pub fn set_namespace(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
87 self.namespace = input;
88 self
89 }
90 pub fn get_namespace(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
92 &self.namespace
93 }
94 pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
97 self.created_at = ::std::option::Option::Some(input);
98 self
99 }
100 pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
102 self.created_at = input;
103 self
104 }
105 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
107 &self.created_at
108 }
109 pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112 self.created_by = ::std::option::Option::Some(input.into());
113 self
114 }
115 pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117 self.created_by = input;
118 self
119 }
120 pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
122 &self.created_by
123 }
124 pub fn owner_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127 self.owner_account_id = ::std::option::Option::Some(input.into());
128 self
129 }
130 pub fn set_owner_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132 self.owner_account_id = input;
133 self
134 }
135 pub fn get_owner_account_id(&self) -> &::std::option::Option<::std::string::String> {
137 &self.owner_account_id
138 }
139 pub fn namespace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141 self.namespace_id = ::std::option::Option::Some(input.into());
142 self
143 }
144 pub fn set_namespace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146 self.namespace_id = input;
147 self
148 }
149 pub fn get_namespace_id(&self) -> &::std::option::Option<::std::string::String> {
151 &self.namespace_id
152 }
153 pub fn table_bucket_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155 self.table_bucket_id = ::std::option::Option::Some(input.into());
156 self
157 }
158 pub fn set_table_bucket_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160 self.table_bucket_id = input;
161 self
162 }
163 pub fn get_table_bucket_id(&self) -> &::std::option::Option<::std::string::String> {
165 &self.table_bucket_id
166 }
167 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
168 self._request_id = Some(request_id.into());
169 self
170 }
171
172 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
173 self._request_id = request_id;
174 self
175 }
176 pub fn build(
183 self,
184 ) -> ::std::result::Result<crate::operation::get_namespace::GetNamespaceOutput, ::aws_smithy_types::error::operation::BuildError> {
185 ::std::result::Result::Ok(crate::operation::get_namespace::GetNamespaceOutput {
186 namespace: self.namespace.ok_or_else(|| {
187 ::aws_smithy_types::error::operation::BuildError::missing_field(
188 "namespace",
189 "namespace was not specified but it is required when building GetNamespaceOutput",
190 )
191 })?,
192 created_at: self.created_at.ok_or_else(|| {
193 ::aws_smithy_types::error::operation::BuildError::missing_field(
194 "created_at",
195 "created_at was not specified but it is required when building GetNamespaceOutput",
196 )
197 })?,
198 created_by: self.created_by.ok_or_else(|| {
199 ::aws_smithy_types::error::operation::BuildError::missing_field(
200 "created_by",
201 "created_by was not specified but it is required when building GetNamespaceOutput",
202 )
203 })?,
204 owner_account_id: self.owner_account_id.ok_or_else(|| {
205 ::aws_smithy_types::error::operation::BuildError::missing_field(
206 "owner_account_id",
207 "owner_account_id was not specified but it is required when building GetNamespaceOutput",
208 )
209 })?,
210 namespace_id: self.namespace_id,
211 table_bucket_id: self.table_bucket_id,
212 _request_id: self._request_id,
213 })
214 }
215}