aws_sdk_redshift/operation/register_namespace/
_register_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 RegisterNamespaceInput {
6    /// <p>The unique identifier of the cluster or serverless namespace that you want to register.</p>
7    pub namespace_identifier: ::std::option::Option<crate::types::NamespaceIdentifierUnion>,
8    /// <p>An array containing the ID of the consumer account that you want to register the namespace to.</p>
9    pub consumer_identifiers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10}
11impl RegisterNamespaceInput {
12    /// <p>The unique identifier of the cluster or serverless namespace that you want to register.</p>
13    pub fn namespace_identifier(&self) -> ::std::option::Option<&crate::types::NamespaceIdentifierUnion> {
14        self.namespace_identifier.as_ref()
15    }
16    /// <p>An array containing the ID of the consumer account that you want to register the namespace to.</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 `.consumer_identifiers.is_none()`.
19    pub fn consumer_identifiers(&self) -> &[::std::string::String] {
20        self.consumer_identifiers.as_deref().unwrap_or_default()
21    }
22}
23impl RegisterNamespaceInput {
24    /// Creates a new builder-style object to manufacture [`RegisterNamespaceInput`](crate::operation::register_namespace::RegisterNamespaceInput).
25    pub fn builder() -> crate::operation::register_namespace::builders::RegisterNamespaceInputBuilder {
26        crate::operation::register_namespace::builders::RegisterNamespaceInputBuilder::default()
27    }
28}
29
30/// A builder for [`RegisterNamespaceInput`](crate::operation::register_namespace::RegisterNamespaceInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct RegisterNamespaceInputBuilder {
34    pub(crate) namespace_identifier: ::std::option::Option<crate::types::NamespaceIdentifierUnion>,
35    pub(crate) consumer_identifiers: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
36}
37impl RegisterNamespaceInputBuilder {
38    /// <p>The unique identifier of the cluster or serverless namespace that you want to register.</p>
39    /// This field is required.
40    pub fn namespace_identifier(mut self, input: crate::types::NamespaceIdentifierUnion) -> Self {
41        self.namespace_identifier = ::std::option::Option::Some(input);
42        self
43    }
44    /// <p>The unique identifier of the cluster or serverless namespace that you want to register.</p>
45    pub fn set_namespace_identifier(mut self, input: ::std::option::Option<crate::types::NamespaceIdentifierUnion>) -> Self {
46        self.namespace_identifier = input;
47        self
48    }
49    /// <p>The unique identifier of the cluster or serverless namespace that you want to register.</p>
50    pub fn get_namespace_identifier(&self) -> &::std::option::Option<crate::types::NamespaceIdentifierUnion> {
51        &self.namespace_identifier
52    }
53    /// Appends an item to `consumer_identifiers`.
54    ///
55    /// To override the contents of this collection use [`set_consumer_identifiers`](Self::set_consumer_identifiers).
56    ///
57    /// <p>An array containing the ID of the consumer account that you want to register the namespace to.</p>
58    pub fn consumer_identifiers(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        let mut v = self.consumer_identifiers.unwrap_or_default();
60        v.push(input.into());
61        self.consumer_identifiers = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>An array containing the ID of the consumer account that you want to register the namespace to.</p>
65    pub fn set_consumer_identifiers(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
66        self.consumer_identifiers = input;
67        self
68    }
69    /// <p>An array containing the ID of the consumer account that you want to register the namespace to.</p>
70    pub fn get_consumer_identifiers(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
71        &self.consumer_identifiers
72    }
73    /// Consumes the builder and constructs a [`RegisterNamespaceInput`](crate::operation::register_namespace::RegisterNamespaceInput).
74    pub fn build(
75        self,
76    ) -> ::std::result::Result<crate::operation::register_namespace::RegisterNamespaceInput, ::aws_smithy_types::error::operation::BuildError> {
77        ::std::result::Result::Ok(crate::operation::register_namespace::RegisterNamespaceInput {
78            namespace_identifier: self.namespace_identifier,
79            consumer_identifiers: self.consumer_identifiers,
80        })
81    }
82}