aws_sdk_s3tables/operation/create_namespace/
_create_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 CreateNamespaceOutput {
6    /// <p>The Amazon Resource Name (ARN) of the table bucket the namespace was created in.</p>
7    pub table_bucket_arn: ::std::string::String,
8    /// <p>The name of the namespace.</p>
9    pub namespace: ::std::vec::Vec<::std::string::String>,
10    _request_id: Option<String>,
11}
12impl CreateNamespaceOutput {
13    /// <p>The Amazon Resource Name (ARN) of the table bucket the namespace was created in.</p>
14    pub fn table_bucket_arn(&self) -> &str {
15        use std::ops::Deref;
16        self.table_bucket_arn.deref()
17    }
18    /// <p>The name of the namespace.</p>
19    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    /// Creates a new builder-style object to manufacture [`CreateNamespaceOutput`](crate::operation::create_namespace::CreateNamespaceOutput).
31    pub fn builder() -> crate::operation::create_namespace::builders::CreateNamespaceOutputBuilder {
32        crate::operation::create_namespace::builders::CreateNamespaceOutputBuilder::default()
33    }
34}
35
36/// A builder for [`CreateNamespaceOutput`](crate::operation::create_namespace::CreateNamespaceOutput).
37#[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    /// <p>The Amazon Resource Name (ARN) of the table bucket the namespace was created in.</p>
46    /// This field is required.
47    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    /// <p>The Amazon Resource Name (ARN) of the table bucket the namespace was created in.</p>
52    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    /// <p>The Amazon Resource Name (ARN) of the table bucket the namespace was created in.</p>
57    pub fn get_table_bucket_arn(&self) -> &::std::option::Option<::std::string::String> {
58        &self.table_bucket_arn
59    }
60    /// Appends an item to `namespace`.
61    ///
62    /// To override the contents of this collection use [`set_namespace`](Self::set_namespace).
63    ///
64    /// <p>The name of the namespace.</p>
65    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    /// <p>The name of the namespace.</p>
72    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    /// <p>The name of the namespace.</p>
77    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    /// Consumes the builder and constructs a [`CreateNamespaceOutput`](crate::operation::create_namespace::CreateNamespaceOutput).
90    /// This method will fail if any of the following fields are not set:
91    /// - [`table_bucket_arn`](crate::operation::create_namespace::builders::CreateNamespaceOutputBuilder::table_bucket_arn)
92    /// - [`namespace`](crate::operation::create_namespace::builders::CreateNamespaceOutputBuilder::namespace)
93    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}