aws_sdk_s3tables/operation/create_namespace/
_create_namespace_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateNamespaceOutput {
6 pub table_bucket_arn: ::std::string::String,
8 pub namespace: ::std::vec::Vec<::std::string::String>,
10 _request_id: Option<String>,
11}
12impl CreateNamespaceOutput {
13 pub fn table_bucket_arn(&self) -> &str {
15 use std::ops::Deref;
16 self.table_bucket_arn.deref()
17 }
18 pub fn namespace(&self) -> &[::std::string::String] {
20 use std::ops::Deref;
21 self.namespace.deref()
22 }
23}
24impl ::aws_types::request_id::RequestId for CreateNamespaceOutput {
25 fn request_id(&self) -> Option<&str> {
26 self._request_id.as_deref()
27 }
28}
29impl CreateNamespaceOutput {
30 pub fn builder() -> crate::operation::create_namespace::builders::CreateNamespaceOutputBuilder {
32 crate::operation::create_namespace::builders::CreateNamespaceOutputBuilder::default()
33 }
34}
35
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct CreateNamespaceOutputBuilder {
40 pub(crate) table_bucket_arn: ::std::option::Option<::std::string::String>,
41 pub(crate) namespace: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
42 _request_id: Option<String>,
43}
44impl CreateNamespaceOutputBuilder {
45 pub fn table_bucket_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48 self.table_bucket_arn = ::std::option::Option::Some(input.into());
49 self
50 }
51 pub fn set_table_bucket_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53 self.table_bucket_arn = input;
54 self
55 }
56 pub fn get_table_bucket_arn(&self) -> &::std::option::Option<::std::string::String> {
58 &self.table_bucket_arn
59 }
60 pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66 let mut v = self.namespace.unwrap_or_default();
67 v.push(input.into());
68 self.namespace = ::std::option::Option::Some(v);
69 self
70 }
71 pub fn set_namespace(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
73 self.namespace = input;
74 self
75 }
76 pub fn get_namespace(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
78 &self.namespace
79 }
80 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
81 self._request_id = Some(request_id.into());
82 self
83 }
84
85 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
86 self._request_id = request_id;
87 self
88 }
89 pub fn build(
94 self,
95 ) -> ::std::result::Result<crate::operation::create_namespace::CreateNamespaceOutput, ::aws_smithy_types::error::operation::BuildError> {
96 ::std::result::Result::Ok(crate::operation::create_namespace::CreateNamespaceOutput {
97 table_bucket_arn: self.table_bucket_arn.ok_or_else(|| {
98 ::aws_smithy_types::error::operation::BuildError::missing_field(
99 "table_bucket_arn",
100 "table_bucket_arn was not specified but it is required when building CreateNamespaceOutput",
101 )
102 })?,
103 namespace: self.namespace.ok_or_else(|| {
104 ::aws_smithy_types::error::operation::BuildError::missing_field(
105 "namespace",
106 "namespace was not specified but it is required when building CreateNamespaceOutput",
107 )
108 })?,
109 _request_id: self._request_id,
110 })
111 }
112}