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