aws_sdk_s3tables/operation/create_namespace/
_create_namespace_input.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 CreateNamespaceInput {
6    /// <p>The Amazon Resource Name (ARN) of the table bucket to create the namespace in.</p>
7    pub table_bucket_arn: ::std::option::Option<::std::string::String>,
8    /// <p>A name for the namespace.</p>
9    pub namespace: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10}
11impl CreateNamespaceInput {
12    /// <p>The Amazon Resource Name (ARN) of the table bucket to create the namespace in.</p>
13    pub fn table_bucket_arn(&self) -> ::std::option::Option<&str> {
14        self.table_bucket_arn.as_deref()
15    }
16    /// <p>A name for the namespace.</p>
17    ///
18    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.namespace.is_none()`.
19    pub fn namespace(&self) -> &[::std::string::String] {
20        self.namespace.as_deref().unwrap_or_default()
21    }
22}
23impl CreateNamespaceInput {
24    /// Creates a new builder-style object to manufacture [`CreateNamespaceInput`](crate::operation::create_namespace::CreateNamespaceInput).
25    pub fn builder() -> crate::operation::create_namespace::builders::CreateNamespaceInputBuilder {
26        crate::operation::create_namespace::builders::CreateNamespaceInputBuilder::default()
27    }
28}
29
30/// A builder for [`CreateNamespaceInput`](crate::operation::create_namespace::CreateNamespaceInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct CreateNamespaceInputBuilder {
34    pub(crate) table_bucket_arn: ::std::option::Option<::std::string::String>,
35    pub(crate) namespace: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
36}
37impl CreateNamespaceInputBuilder {
38    /// <p>The Amazon Resource Name (ARN) of the table bucket to create the namespace in.</p>
39    /// This field is required.
40    pub fn table_bucket_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.table_bucket_arn = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The Amazon Resource Name (ARN) of the table bucket to create the namespace in.</p>
45    pub fn set_table_bucket_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.table_bucket_arn = input;
47        self
48    }
49    /// <p>The Amazon Resource Name (ARN) of the table bucket to create the namespace in.</p>
50    pub fn get_table_bucket_arn(&self) -> &::std::option::Option<::std::string::String> {
51        &self.table_bucket_arn
52    }
53    /// Appends an item to `namespace`.
54    ///
55    /// To override the contents of this collection use [`set_namespace`](Self::set_namespace).
56    ///
57    /// <p>A name for the namespace.</p>
58    pub fn namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        let mut v = self.namespace.unwrap_or_default();
60        v.push(input.into());
61        self.namespace = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>A name for the namespace.</p>
65    pub fn set_namespace(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
66        self.namespace = input;
67        self
68    }
69    /// <p>A name for the namespace.</p>
70    pub fn get_namespace(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
71        &self.namespace
72    }
73    /// Consumes the builder and constructs a [`CreateNamespaceInput`](crate::operation::create_namespace::CreateNamespaceInput).
74    pub fn build(
75        self,
76    ) -> ::std::result::Result<crate::operation::create_namespace::CreateNamespaceInput, ::aws_smithy_types::error::operation::BuildError> {
77        ::std::result::Result::Ok(crate::operation::create_namespace::CreateNamespaceInput {
78            table_bucket_arn: self.table_bucket_arn,
79            namespace: self.namespace,
80        })
81    }
82}