Skip to main content

aws_sdk_quicksight/types/
_filter_drop_down_control.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A control to display a dropdown list with buttons that are used to select a single value.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct FilterDropDownControl {
7    /// <p>The ID of the <code>FilterDropDownControl</code>.</p>
8    pub filter_control_id: ::std::string::String,
9    /// <p>The title of the <code>FilterDropDownControl</code>.</p>
10    pub title: ::std::string::String,
11    /// <p>The source filter ID of the <code>FilterDropDownControl</code>.</p>
12    pub source_filter_id: ::std::string::String,
13    /// <p>The display options of the <code>FilterDropDownControl</code>.</p>
14    pub display_options: ::std::option::Option<crate::types::DropDownControlDisplayOptions>,
15    /// <p>The type of the <code>FilterDropDownControl</code>. Choose one of the following options:</p>
16    /// <ul>
17    /// <li>
18    /// <p><code>MULTI_SELECT</code>: The user can select multiple entries from a dropdown menu.</p></li>
19    /// <li>
20    /// <p><code>SINGLE_SELECT</code>: The user can select a single entry from a dropdown menu.</p></li>
21    /// </ul>
22    pub r#type: ::std::option::Option<crate::types::SheetControlListType>,
23    /// <p>A list of selectable values that are used in a control.</p>
24    pub selectable_values: ::std::option::Option<crate::types::FilterSelectableValues>,
25    /// <p>The values that are displayed in a control can be configured to only show values that are valid based on what's selected in other controls.</p>
26    pub cascading_control_configuration: ::std::option::Option<crate::types::CascadingControlConfiguration>,
27    /// <p>The visibility configuration of the Apply button on a <code>FilterDropDownControl</code>.</p>
28    pub commit_mode: ::std::option::Option<crate::types::CommitMode>,
29}
30impl FilterDropDownControl {
31    /// <p>The ID of the <code>FilterDropDownControl</code>.</p>
32    pub fn filter_control_id(&self) -> &str {
33        use std::ops::Deref;
34        self.filter_control_id.deref()
35    }
36    /// <p>The title of the <code>FilterDropDownControl</code>.</p>
37    pub fn title(&self) -> &str {
38        use std::ops::Deref;
39        self.title.deref()
40    }
41    /// <p>The source filter ID of the <code>FilterDropDownControl</code>.</p>
42    pub fn source_filter_id(&self) -> &str {
43        use std::ops::Deref;
44        self.source_filter_id.deref()
45    }
46    /// <p>The display options of the <code>FilterDropDownControl</code>.</p>
47    pub fn display_options(&self) -> ::std::option::Option<&crate::types::DropDownControlDisplayOptions> {
48        self.display_options.as_ref()
49    }
50    /// <p>The type of the <code>FilterDropDownControl</code>. Choose one of the following options:</p>
51    /// <ul>
52    /// <li>
53    /// <p><code>MULTI_SELECT</code>: The user can select multiple entries from a dropdown menu.</p></li>
54    /// <li>
55    /// <p><code>SINGLE_SELECT</code>: The user can select a single entry from a dropdown menu.</p></li>
56    /// </ul>
57    pub fn r#type(&self) -> ::std::option::Option<&crate::types::SheetControlListType> {
58        self.r#type.as_ref()
59    }
60    /// <p>A list of selectable values that are used in a control.</p>
61    pub fn selectable_values(&self) -> ::std::option::Option<&crate::types::FilterSelectableValues> {
62        self.selectable_values.as_ref()
63    }
64    /// <p>The values that are displayed in a control can be configured to only show values that are valid based on what's selected in other controls.</p>
65    pub fn cascading_control_configuration(&self) -> ::std::option::Option<&crate::types::CascadingControlConfiguration> {
66        self.cascading_control_configuration.as_ref()
67    }
68    /// <p>The visibility configuration of the Apply button on a <code>FilterDropDownControl</code>.</p>
69    pub fn commit_mode(&self) -> ::std::option::Option<&crate::types::CommitMode> {
70        self.commit_mode.as_ref()
71    }
72}
73impl FilterDropDownControl {
74    /// Creates a new builder-style object to manufacture [`FilterDropDownControl`](crate::types::FilterDropDownControl).
75    pub fn builder() -> crate::types::builders::FilterDropDownControlBuilder {
76        crate::types::builders::FilterDropDownControlBuilder::default()
77    }
78}
79
80/// A builder for [`FilterDropDownControl`](crate::types::FilterDropDownControl).
81#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
82#[non_exhaustive]
83pub struct FilterDropDownControlBuilder {
84    pub(crate) filter_control_id: ::std::option::Option<::std::string::String>,
85    pub(crate) title: ::std::option::Option<::std::string::String>,
86    pub(crate) source_filter_id: ::std::option::Option<::std::string::String>,
87    pub(crate) display_options: ::std::option::Option<crate::types::DropDownControlDisplayOptions>,
88    pub(crate) r#type: ::std::option::Option<crate::types::SheetControlListType>,
89    pub(crate) selectable_values: ::std::option::Option<crate::types::FilterSelectableValues>,
90    pub(crate) cascading_control_configuration: ::std::option::Option<crate::types::CascadingControlConfiguration>,
91    pub(crate) commit_mode: ::std::option::Option<crate::types::CommitMode>,
92}
93impl FilterDropDownControlBuilder {
94    /// <p>The ID of the <code>FilterDropDownControl</code>.</p>
95    /// This field is required.
96    pub fn filter_control_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.filter_control_id = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>The ID of the <code>FilterDropDownControl</code>.</p>
101    pub fn set_filter_control_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.filter_control_id = input;
103        self
104    }
105    /// <p>The ID of the <code>FilterDropDownControl</code>.</p>
106    pub fn get_filter_control_id(&self) -> &::std::option::Option<::std::string::String> {
107        &self.filter_control_id
108    }
109    /// <p>The title of the <code>FilterDropDownControl</code>.</p>
110    /// This field is required.
111    pub fn title(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
112        self.title = ::std::option::Option::Some(input.into());
113        self
114    }
115    /// <p>The title of the <code>FilterDropDownControl</code>.</p>
116    pub fn set_title(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
117        self.title = input;
118        self
119    }
120    /// <p>The title of the <code>FilterDropDownControl</code>.</p>
121    pub fn get_title(&self) -> &::std::option::Option<::std::string::String> {
122        &self.title
123    }
124    /// <p>The source filter ID of the <code>FilterDropDownControl</code>.</p>
125    /// This field is required.
126    pub fn source_filter_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.source_filter_id = ::std::option::Option::Some(input.into());
128        self
129    }
130    /// <p>The source filter ID of the <code>FilterDropDownControl</code>.</p>
131    pub fn set_source_filter_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.source_filter_id = input;
133        self
134    }
135    /// <p>The source filter ID of the <code>FilterDropDownControl</code>.</p>
136    pub fn get_source_filter_id(&self) -> &::std::option::Option<::std::string::String> {
137        &self.source_filter_id
138    }
139    /// <p>The display options of the <code>FilterDropDownControl</code>.</p>
140    pub fn display_options(mut self, input: crate::types::DropDownControlDisplayOptions) -> Self {
141        self.display_options = ::std::option::Option::Some(input);
142        self
143    }
144    /// <p>The display options of the <code>FilterDropDownControl</code>.</p>
145    pub fn set_display_options(mut self, input: ::std::option::Option<crate::types::DropDownControlDisplayOptions>) -> Self {
146        self.display_options = input;
147        self
148    }
149    /// <p>The display options of the <code>FilterDropDownControl</code>.</p>
150    pub fn get_display_options(&self) -> &::std::option::Option<crate::types::DropDownControlDisplayOptions> {
151        &self.display_options
152    }
153    /// <p>The type of the <code>FilterDropDownControl</code>. Choose one of the following options:</p>
154    /// <ul>
155    /// <li>
156    /// <p><code>MULTI_SELECT</code>: The user can select multiple entries from a dropdown menu.</p></li>
157    /// <li>
158    /// <p><code>SINGLE_SELECT</code>: The user can select a single entry from a dropdown menu.</p></li>
159    /// </ul>
160    pub fn r#type(mut self, input: crate::types::SheetControlListType) -> Self {
161        self.r#type = ::std::option::Option::Some(input);
162        self
163    }
164    /// <p>The type of the <code>FilterDropDownControl</code>. Choose one of the following options:</p>
165    /// <ul>
166    /// <li>
167    /// <p><code>MULTI_SELECT</code>: The user can select multiple entries from a dropdown menu.</p></li>
168    /// <li>
169    /// <p><code>SINGLE_SELECT</code>: The user can select a single entry from a dropdown menu.</p></li>
170    /// </ul>
171    pub fn set_type(mut self, input: ::std::option::Option<crate::types::SheetControlListType>) -> Self {
172        self.r#type = input;
173        self
174    }
175    /// <p>The type of the <code>FilterDropDownControl</code>. Choose one of the following options:</p>
176    /// <ul>
177    /// <li>
178    /// <p><code>MULTI_SELECT</code>: The user can select multiple entries from a dropdown menu.</p></li>
179    /// <li>
180    /// <p><code>SINGLE_SELECT</code>: The user can select a single entry from a dropdown menu.</p></li>
181    /// </ul>
182    pub fn get_type(&self) -> &::std::option::Option<crate::types::SheetControlListType> {
183        &self.r#type
184    }
185    /// <p>A list of selectable values that are used in a control.</p>
186    pub fn selectable_values(mut self, input: crate::types::FilterSelectableValues) -> Self {
187        self.selectable_values = ::std::option::Option::Some(input);
188        self
189    }
190    /// <p>A list of selectable values that are used in a control.</p>
191    pub fn set_selectable_values(mut self, input: ::std::option::Option<crate::types::FilterSelectableValues>) -> Self {
192        self.selectable_values = input;
193        self
194    }
195    /// <p>A list of selectable values that are used in a control.</p>
196    pub fn get_selectable_values(&self) -> &::std::option::Option<crate::types::FilterSelectableValues> {
197        &self.selectable_values
198    }
199    /// <p>The values that are displayed in a control can be configured to only show values that are valid based on what's selected in other controls.</p>
200    pub fn cascading_control_configuration(mut self, input: crate::types::CascadingControlConfiguration) -> Self {
201        self.cascading_control_configuration = ::std::option::Option::Some(input);
202        self
203    }
204    /// <p>The values that are displayed in a control can be configured to only show values that are valid based on what's selected in other controls.</p>
205    pub fn set_cascading_control_configuration(mut self, input: ::std::option::Option<crate::types::CascadingControlConfiguration>) -> Self {
206        self.cascading_control_configuration = input;
207        self
208    }
209    /// <p>The values that are displayed in a control can be configured to only show values that are valid based on what's selected in other controls.</p>
210    pub fn get_cascading_control_configuration(&self) -> &::std::option::Option<crate::types::CascadingControlConfiguration> {
211        &self.cascading_control_configuration
212    }
213    /// <p>The visibility configuration of the Apply button on a <code>FilterDropDownControl</code>.</p>
214    pub fn commit_mode(mut self, input: crate::types::CommitMode) -> Self {
215        self.commit_mode = ::std::option::Option::Some(input);
216        self
217    }
218    /// <p>The visibility configuration of the Apply button on a <code>FilterDropDownControl</code>.</p>
219    pub fn set_commit_mode(mut self, input: ::std::option::Option<crate::types::CommitMode>) -> Self {
220        self.commit_mode = input;
221        self
222    }
223    /// <p>The visibility configuration of the Apply button on a <code>FilterDropDownControl</code>.</p>
224    pub fn get_commit_mode(&self) -> &::std::option::Option<crate::types::CommitMode> {
225        &self.commit_mode
226    }
227    /// Consumes the builder and constructs a [`FilterDropDownControl`](crate::types::FilterDropDownControl).
228    /// This method will fail if any of the following fields are not set:
229    /// - [`filter_control_id`](crate::types::builders::FilterDropDownControlBuilder::filter_control_id)
230    /// - [`title`](crate::types::builders::FilterDropDownControlBuilder::title)
231    /// - [`source_filter_id`](crate::types::builders::FilterDropDownControlBuilder::source_filter_id)
232    pub fn build(self) -> ::std::result::Result<crate::types::FilterDropDownControl, ::aws_smithy_types::error::operation::BuildError> {
233        ::std::result::Result::Ok(crate::types::FilterDropDownControl {
234            filter_control_id: self.filter_control_id.ok_or_else(|| {
235                ::aws_smithy_types::error::operation::BuildError::missing_field(
236                    "filter_control_id",
237                    "filter_control_id was not specified but it is required when building FilterDropDownControl",
238                )
239            })?,
240            title: self.title.ok_or_else(|| {
241                ::aws_smithy_types::error::operation::BuildError::missing_field(
242                    "title",
243                    "title was not specified but it is required when building FilterDropDownControl",
244                )
245            })?,
246            source_filter_id: self.source_filter_id.ok_or_else(|| {
247                ::aws_smithy_types::error::operation::BuildError::missing_field(
248                    "source_filter_id",
249                    "source_filter_id was not specified but it is required when building FilterDropDownControl",
250                )
251            })?,
252            display_options: self.display_options,
253            r#type: self.r#type,
254            selectable_values: self.selectable_values,
255            cascading_control_configuration: self.cascading_control_configuration,
256            commit_mode: self.commit_mode,
257        })
258    }
259}