aws_sdk_quicksight/types/
_tree_map_visual.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A tree map.</p>
4/// <p>For more information, see <a href="https://docs.aws.amazon.com/quicksight/latest/user/tree-map.html">Using tree maps</a> in the <i>Amazon Quick Suite User Guide</i>.</p>
5#[non_exhaustive]
6#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
7pub struct TreeMapVisual {
8    /// <p>The unique identifier of a visual. This identifier must be unique within the context of a dashboard, template, or analysis. Two dashboards, analyses, or templates can have visuals with the same identifiers..</p>
9    pub visual_id: ::std::string::String,
10    /// <p>The title that is displayed on the visual.</p>
11    pub title: ::std::option::Option<crate::types::VisualTitleLabelOptions>,
12    /// <p>The subtitle that is displayed on the visual.</p>
13    pub subtitle: ::std::option::Option<crate::types::VisualSubtitleLabelOptions>,
14    /// <p>The configuration settings of the visual.</p>
15    pub chart_configuration: ::std::option::Option<crate::types::TreeMapConfiguration>,
16    /// <p>The list of custom actions that are configured for a visual.</p>
17    pub actions: ::std::option::Option<::std::vec::Vec<crate::types::VisualCustomAction>>,
18    /// <p>The column hierarchy that is used during drill-downs and drill-ups.</p>
19    pub column_hierarchies: ::std::option::Option<::std::vec::Vec<crate::types::ColumnHierarchy>>,
20    /// <p>The alt text for the visual.</p>
21    pub visual_content_alt_text: ::std::option::Option<::std::string::String>,
22}
23impl TreeMapVisual {
24    /// <p>The unique identifier of a visual. This identifier must be unique within the context of a dashboard, template, or analysis. Two dashboards, analyses, or templates can have visuals with the same identifiers..</p>
25    pub fn visual_id(&self) -> &str {
26        use std::ops::Deref;
27        self.visual_id.deref()
28    }
29    /// <p>The title that is displayed on the visual.</p>
30    pub fn title(&self) -> ::std::option::Option<&crate::types::VisualTitleLabelOptions> {
31        self.title.as_ref()
32    }
33    /// <p>The subtitle that is displayed on the visual.</p>
34    pub fn subtitle(&self) -> ::std::option::Option<&crate::types::VisualSubtitleLabelOptions> {
35        self.subtitle.as_ref()
36    }
37    /// <p>The configuration settings of the visual.</p>
38    pub fn chart_configuration(&self) -> ::std::option::Option<&crate::types::TreeMapConfiguration> {
39        self.chart_configuration.as_ref()
40    }
41    /// <p>The list of custom actions that are configured for a visual.</p>
42    ///
43    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.actions.is_none()`.
44    pub fn actions(&self) -> &[crate::types::VisualCustomAction] {
45        self.actions.as_deref().unwrap_or_default()
46    }
47    /// <p>The column hierarchy that is used during drill-downs and drill-ups.</p>
48    ///
49    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.column_hierarchies.is_none()`.
50    pub fn column_hierarchies(&self) -> &[crate::types::ColumnHierarchy] {
51        self.column_hierarchies.as_deref().unwrap_or_default()
52    }
53    /// <p>The alt text for the visual.</p>
54    pub fn visual_content_alt_text(&self) -> ::std::option::Option<&str> {
55        self.visual_content_alt_text.as_deref()
56    }
57}
58impl TreeMapVisual {
59    /// Creates a new builder-style object to manufacture [`TreeMapVisual`](crate::types::TreeMapVisual).
60    pub fn builder() -> crate::types::builders::TreeMapVisualBuilder {
61        crate::types::builders::TreeMapVisualBuilder::default()
62    }
63}
64
65/// A builder for [`TreeMapVisual`](crate::types::TreeMapVisual).
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
67#[non_exhaustive]
68pub struct TreeMapVisualBuilder {
69    pub(crate) visual_id: ::std::option::Option<::std::string::String>,
70    pub(crate) title: ::std::option::Option<crate::types::VisualTitleLabelOptions>,
71    pub(crate) subtitle: ::std::option::Option<crate::types::VisualSubtitleLabelOptions>,
72    pub(crate) chart_configuration: ::std::option::Option<crate::types::TreeMapConfiguration>,
73    pub(crate) actions: ::std::option::Option<::std::vec::Vec<crate::types::VisualCustomAction>>,
74    pub(crate) column_hierarchies: ::std::option::Option<::std::vec::Vec<crate::types::ColumnHierarchy>>,
75    pub(crate) visual_content_alt_text: ::std::option::Option<::std::string::String>,
76}
77impl TreeMapVisualBuilder {
78    /// <p>The unique identifier of a visual. This identifier must be unique within the context of a dashboard, template, or analysis. Two dashboards, analyses, or templates can have visuals with the same identifiers..</p>
79    /// This field is required.
80    pub fn visual_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.visual_id = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The unique identifier of a visual. This identifier must be unique within the context of a dashboard, template, or analysis. Two dashboards, analyses, or templates can have visuals with the same identifiers..</p>
85    pub fn set_visual_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.visual_id = input;
87        self
88    }
89    /// <p>The unique identifier of a visual. This identifier must be unique within the context of a dashboard, template, or analysis. Two dashboards, analyses, or templates can have visuals with the same identifiers..</p>
90    pub fn get_visual_id(&self) -> &::std::option::Option<::std::string::String> {
91        &self.visual_id
92    }
93    /// <p>The title that is displayed on the visual.</p>
94    pub fn title(mut self, input: crate::types::VisualTitleLabelOptions) -> Self {
95        self.title = ::std::option::Option::Some(input);
96        self
97    }
98    /// <p>The title that is displayed on the visual.</p>
99    pub fn set_title(mut self, input: ::std::option::Option<crate::types::VisualTitleLabelOptions>) -> Self {
100        self.title = input;
101        self
102    }
103    /// <p>The title that is displayed on the visual.</p>
104    pub fn get_title(&self) -> &::std::option::Option<crate::types::VisualTitleLabelOptions> {
105        &self.title
106    }
107    /// <p>The subtitle that is displayed on the visual.</p>
108    pub fn subtitle(mut self, input: crate::types::VisualSubtitleLabelOptions) -> Self {
109        self.subtitle = ::std::option::Option::Some(input);
110        self
111    }
112    /// <p>The subtitle that is displayed on the visual.</p>
113    pub fn set_subtitle(mut self, input: ::std::option::Option<crate::types::VisualSubtitleLabelOptions>) -> Self {
114        self.subtitle = input;
115        self
116    }
117    /// <p>The subtitle that is displayed on the visual.</p>
118    pub fn get_subtitle(&self) -> &::std::option::Option<crate::types::VisualSubtitleLabelOptions> {
119        &self.subtitle
120    }
121    /// <p>The configuration settings of the visual.</p>
122    pub fn chart_configuration(mut self, input: crate::types::TreeMapConfiguration) -> Self {
123        self.chart_configuration = ::std::option::Option::Some(input);
124        self
125    }
126    /// <p>The configuration settings of the visual.</p>
127    pub fn set_chart_configuration(mut self, input: ::std::option::Option<crate::types::TreeMapConfiguration>) -> Self {
128        self.chart_configuration = input;
129        self
130    }
131    /// <p>The configuration settings of the visual.</p>
132    pub fn get_chart_configuration(&self) -> &::std::option::Option<crate::types::TreeMapConfiguration> {
133        &self.chart_configuration
134    }
135    /// Appends an item to `actions`.
136    ///
137    /// To override the contents of this collection use [`set_actions`](Self::set_actions).
138    ///
139    /// <p>The list of custom actions that are configured for a visual.</p>
140    pub fn actions(mut self, input: crate::types::VisualCustomAction) -> Self {
141        let mut v = self.actions.unwrap_or_default();
142        v.push(input);
143        self.actions = ::std::option::Option::Some(v);
144        self
145    }
146    /// <p>The list of custom actions that are configured for a visual.</p>
147    pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::VisualCustomAction>>) -> Self {
148        self.actions = input;
149        self
150    }
151    /// <p>The list of custom actions that are configured for a visual.</p>
152    pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VisualCustomAction>> {
153        &self.actions
154    }
155    /// Appends an item to `column_hierarchies`.
156    ///
157    /// To override the contents of this collection use [`set_column_hierarchies`](Self::set_column_hierarchies).
158    ///
159    /// <p>The column hierarchy that is used during drill-downs and drill-ups.</p>
160    pub fn column_hierarchies(mut self, input: crate::types::ColumnHierarchy) -> Self {
161        let mut v = self.column_hierarchies.unwrap_or_default();
162        v.push(input);
163        self.column_hierarchies = ::std::option::Option::Some(v);
164        self
165    }
166    /// <p>The column hierarchy that is used during drill-downs and drill-ups.</p>
167    pub fn set_column_hierarchies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ColumnHierarchy>>) -> Self {
168        self.column_hierarchies = input;
169        self
170    }
171    /// <p>The column hierarchy that is used during drill-downs and drill-ups.</p>
172    pub fn get_column_hierarchies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ColumnHierarchy>> {
173        &self.column_hierarchies
174    }
175    /// <p>The alt text for the visual.</p>
176    pub fn visual_content_alt_text(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
177        self.visual_content_alt_text = ::std::option::Option::Some(input.into());
178        self
179    }
180    /// <p>The alt text for the visual.</p>
181    pub fn set_visual_content_alt_text(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
182        self.visual_content_alt_text = input;
183        self
184    }
185    /// <p>The alt text for the visual.</p>
186    pub fn get_visual_content_alt_text(&self) -> &::std::option::Option<::std::string::String> {
187        &self.visual_content_alt_text
188    }
189    /// Consumes the builder and constructs a [`TreeMapVisual`](crate::types::TreeMapVisual).
190    /// This method will fail if any of the following fields are not set:
191    /// - [`visual_id`](crate::types::builders::TreeMapVisualBuilder::visual_id)
192    pub fn build(self) -> ::std::result::Result<crate::types::TreeMapVisual, ::aws_smithy_types::error::operation::BuildError> {
193        ::std::result::Result::Ok(crate::types::TreeMapVisual {
194            visual_id: self.visual_id.ok_or_else(|| {
195                ::aws_smithy_types::error::operation::BuildError::missing_field(
196                    "visual_id",
197                    "visual_id was not specified but it is required when building TreeMapVisual",
198                )
199            })?,
200            title: self.title,
201            subtitle: self.subtitle,
202            chart_configuration: self.chart_configuration,
203            actions: self.actions,
204            column_hierarchies: self.column_hierarchies,
205            visual_content_alt_text: self.visual_content_alt_text,
206        })
207    }
208}