aws_sdk_quicksight/operation/create_topic/
_create_topic_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 CreateTopicInput {
6    /// <p>The ID of the Amazon Web Services account that you want to create a topic in.</p>
7    pub aws_account_id: ::std::option::Option<::std::string::String>,
8    /// <p>The ID for the topic that you want to create. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
9    pub topic_id: ::std::option::Option<::std::string::String>,
10    /// <p>The definition of a topic to create.</p>
11    pub topic: ::std::option::Option<crate::types::TopicDetails>,
12    /// <p>Contains a map of the key-value pairs for the resource tag or tags that are assigned to the dataset.</p>
13    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
14    /// <p>The Folder ARN of the folder that you want the topic to reside in.</p>
15    pub folder_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
16}
17impl CreateTopicInput {
18    /// <p>The ID of the Amazon Web Services account that you want to create a topic in.</p>
19    pub fn aws_account_id(&self) -> ::std::option::Option<&str> {
20        self.aws_account_id.as_deref()
21    }
22    /// <p>The ID for the topic that you want to create. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
23    pub fn topic_id(&self) -> ::std::option::Option<&str> {
24        self.topic_id.as_deref()
25    }
26    /// <p>The definition of a topic to create.</p>
27    pub fn topic(&self) -> ::std::option::Option<&crate::types::TopicDetails> {
28        self.topic.as_ref()
29    }
30    /// <p>Contains a map of the key-value pairs for the resource tag or tags that are assigned to the dataset.</p>
31    ///
32    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tags.is_none()`.
33    pub fn tags(&self) -> &[crate::types::Tag] {
34        self.tags.as_deref().unwrap_or_default()
35    }
36    /// <p>The Folder ARN of the folder that you want the topic to reside in.</p>
37    ///
38    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.folder_arns.is_none()`.
39    pub fn folder_arns(&self) -> &[::std::string::String] {
40        self.folder_arns.as_deref().unwrap_or_default()
41    }
42}
43impl CreateTopicInput {
44    /// Creates a new builder-style object to manufacture [`CreateTopicInput`](crate::operation::create_topic::CreateTopicInput).
45    pub fn builder() -> crate::operation::create_topic::builders::CreateTopicInputBuilder {
46        crate::operation::create_topic::builders::CreateTopicInputBuilder::default()
47    }
48}
49
50/// A builder for [`CreateTopicInput`](crate::operation::create_topic::CreateTopicInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct CreateTopicInputBuilder {
54    pub(crate) aws_account_id: ::std::option::Option<::std::string::String>,
55    pub(crate) topic_id: ::std::option::Option<::std::string::String>,
56    pub(crate) topic: ::std::option::Option<crate::types::TopicDetails>,
57    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
58    pub(crate) folder_arns: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
59}
60impl CreateTopicInputBuilder {
61    /// <p>The ID of the Amazon Web Services account that you want to create a topic in.</p>
62    /// This field is required.
63    pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        self.aws_account_id = ::std::option::Option::Some(input.into());
65        self
66    }
67    /// <p>The ID of the Amazon Web Services account that you want to create a topic in.</p>
68    pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69        self.aws_account_id = input;
70        self
71    }
72    /// <p>The ID of the Amazon Web Services account that you want to create a topic in.</p>
73    pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
74        &self.aws_account_id
75    }
76    /// <p>The ID for the topic that you want to create. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
77    /// This field is required.
78    pub fn topic_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79        self.topic_id = ::std::option::Option::Some(input.into());
80        self
81    }
82    /// <p>The ID for the topic that you want to create. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
83    pub fn set_topic_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84        self.topic_id = input;
85        self
86    }
87    /// <p>The ID for the topic that you want to create. This ID is unique per Amazon Web Services Region for each Amazon Web Services account.</p>
88    pub fn get_topic_id(&self) -> &::std::option::Option<::std::string::String> {
89        &self.topic_id
90    }
91    /// <p>The definition of a topic to create.</p>
92    /// This field is required.
93    pub fn topic(mut self, input: crate::types::TopicDetails) -> Self {
94        self.topic = ::std::option::Option::Some(input);
95        self
96    }
97    /// <p>The definition of a topic to create.</p>
98    pub fn set_topic(mut self, input: ::std::option::Option<crate::types::TopicDetails>) -> Self {
99        self.topic = input;
100        self
101    }
102    /// <p>The definition of a topic to create.</p>
103    pub fn get_topic(&self) -> &::std::option::Option<crate::types::TopicDetails> {
104        &self.topic
105    }
106    /// Appends an item to `tags`.
107    ///
108    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
109    ///
110    /// <p>Contains a map of the key-value pairs for the resource tag or tags that are assigned to the dataset.</p>
111    pub fn tags(mut self, input: crate::types::Tag) -> Self {
112        let mut v = self.tags.unwrap_or_default();
113        v.push(input);
114        self.tags = ::std::option::Option::Some(v);
115        self
116    }
117    /// <p>Contains a map of the key-value pairs for the resource tag or tags that are assigned to the dataset.</p>
118    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
119        self.tags = input;
120        self
121    }
122    /// <p>Contains a map of the key-value pairs for the resource tag or tags that are assigned to the dataset.</p>
123    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
124        &self.tags
125    }
126    /// Appends an item to `folder_arns`.
127    ///
128    /// To override the contents of this collection use [`set_folder_arns`](Self::set_folder_arns).
129    ///
130    /// <p>The Folder ARN of the folder that you want the topic to reside in.</p>
131    pub fn folder_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        let mut v = self.folder_arns.unwrap_or_default();
133        v.push(input.into());
134        self.folder_arns = ::std::option::Option::Some(v);
135        self
136    }
137    /// <p>The Folder ARN of the folder that you want the topic to reside in.</p>
138    pub fn set_folder_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
139        self.folder_arns = input;
140        self
141    }
142    /// <p>The Folder ARN of the folder that you want the topic to reside in.</p>
143    pub fn get_folder_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
144        &self.folder_arns
145    }
146    /// Consumes the builder and constructs a [`CreateTopicInput`](crate::operation::create_topic::CreateTopicInput).
147    pub fn build(self) -> ::std::result::Result<crate::operation::create_topic::CreateTopicInput, ::aws_smithy_types::error::operation::BuildError> {
148        ::std::result::Result::Ok(crate::operation::create_topic::CreateTopicInput {
149            aws_account_id: self.aws_account_id,
150            topic_id: self.topic_id,
151            topic: self.topic,
152            tags: self.tags,
153            folder_arns: self.folder_arns,
154        })
155    }
156}