aws_sdk_s3tables/operation/get_namespace/
_get_namespace_output.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 GetNamespaceOutput {
6    /// <p>The name of the namespace.</p>
7    pub namespace: ::std::vec::Vec<::std::string::String>,
8    /// <p>The date and time the namespace was created at.</p>
9    pub created_at: ::aws_smithy_types::DateTime,
10    /// <p>The ID of the account that created the namespace.</p>
11    pub created_by: ::std::string::String,
12    /// <p>The ID of the account that owns the namespcace.</p>
13    pub owner_account_id: ::std::string::String,
14    /// <p>The unique identifier of the namespace.</p>
15    pub namespace_id: ::std::option::Option<::std::string::String>,
16    /// <p>The unique identifier of the table bucket containing this namespace.</p>
17    pub table_bucket_id: ::std::option::Option<::std::string::String>,
18    _request_id: Option<String>,
19}
20impl GetNamespaceOutput {
21    /// <p>The name of the namespace.</p>
22    pub fn namespace(&self) -> &[::std::string::String] {
23        use std::ops::Deref;
24        self.namespace.deref()
25    }
26    /// <p>The date and time the namespace was created at.</p>
27    pub fn created_at(&self) -> &::aws_smithy_types::DateTime {
28        &self.created_at
29    }
30    /// <p>The ID of the account that created the namespace.</p>
31    pub fn created_by(&self) -> &str {
32        use std::ops::Deref;
33        self.created_by.deref()
34    }
35    /// <p>The ID of the account that owns the namespcace.</p>
36    pub fn owner_account_id(&self) -> &str {
37        use std::ops::Deref;
38        self.owner_account_id.deref()
39    }
40    /// <p>The unique identifier of the namespace.</p>
41    pub fn namespace_id(&self) -> ::std::option::Option<&str> {
42        self.namespace_id.as_deref()
43    }
44    /// <p>The unique identifier of the table bucket containing this namespace.</p>
45    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    /// Creates a new builder-style object to manufacture [`GetNamespaceOutput`](crate::operation::get_namespace::GetNamespaceOutput).
56    pub fn builder() -> crate::operation::get_namespace::builders::GetNamespaceOutputBuilder {
57        crate::operation::get_namespace::builders::GetNamespaceOutputBuilder::default()
58    }
59}
60
61/// A builder for [`GetNamespaceOutput`](crate::operation::get_namespace::GetNamespaceOutput).
62#[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    /// Appends an item to `namespace`.
75    ///
76    /// To override the contents of this collection use [`set_namespace`](Self::set_namespace).
77    ///
78    /// <p>The name of the namespace.</p>
79    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    /// <p>The name of the namespace.</p>
86    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    /// <p>The name of the namespace.</p>
91    pub fn get_namespace(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
92        &self.namespace
93    }
94    /// <p>The date and time the namespace was created at.</p>
95    /// This field is required.
96    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    /// <p>The date and time the namespace was created at.</p>
101    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    /// <p>The date and time the namespace was created at.</p>
106    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
107        &self.created_at
108    }
109    /// <p>The ID of the account that created the namespace.</p>
110    /// This field is required.
111    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    /// <p>The ID of the account that created the namespace.</p>
116    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117        self.created_by = input;
118        self
119    }
120    /// <p>The ID of the account that created the namespace.</p>
121    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
122        &self.created_by
123    }
124    /// <p>The ID of the account that owns the namespcace.</p>
125    /// This field is required.
126    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    /// <p>The ID of the account that owns the namespcace.</p>
131    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    /// <p>The ID of the account that owns the namespcace.</p>
136    pub fn get_owner_account_id(&self) -> &::std::option::Option<::std::string::String> {
137        &self.owner_account_id
138    }
139    /// <p>The unique identifier of the namespace.</p>
140    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    /// <p>The unique identifier of the namespace.</p>
145    pub fn set_namespace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.namespace_id = input;
147        self
148    }
149    /// <p>The unique identifier of the namespace.</p>
150    pub fn get_namespace_id(&self) -> &::std::option::Option<::std::string::String> {
151        &self.namespace_id
152    }
153    /// <p>The unique identifier of the table bucket containing this namespace.</p>
154    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    /// <p>The unique identifier of the table bucket containing this namespace.</p>
159    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    /// <p>The unique identifier of the table bucket containing this namespace.</p>
164    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    /// Consumes the builder and constructs a [`GetNamespaceOutput`](crate::operation::get_namespace::GetNamespaceOutput).
177    /// This method will fail if any of the following fields are not set:
178    /// - [`namespace`](crate::operation::get_namespace::builders::GetNamespaceOutputBuilder::namespace)
179    /// - [`created_at`](crate::operation::get_namespace::builders::GetNamespaceOutputBuilder::created_at)
180    /// - [`created_by`](crate::operation::get_namespace::builders::GetNamespaceOutputBuilder::created_by)
181    /// - [`owner_account_id`](crate::operation::get_namespace::builders::GetNamespaceOutputBuilder::owner_account_id)
182    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}