aws_sdk_quicksight/types/
_legend_options.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The options for the legend setup of a visual.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct LegendOptions {
7    /// <p>Determines whether or not the legend is visible.</p>
8    pub visibility: ::std::option::Option<crate::types::Visibility>,
9    /// <p>The custom title for the legend.</p>
10    pub title: ::std::option::Option<crate::types::LabelOptions>,
11    /// <p>The positions for the legend. Choose one of the following options:</p>
12    /// <ul>
13    /// <li>
14    /// <p><code>AUTO</code></p></li>
15    /// <li>
16    /// <p><code>RIGHT</code></p></li>
17    /// <li>
18    /// <p><code>BOTTOM</code></p></li>
19    /// <li>
20    /// <p><code>LEFT</code></p></li>
21    /// </ul>
22    pub position: ::std::option::Option<crate::types::LegendPosition>,
23    /// <p>The width of the legend. If this value is omitted, a default width is used when rendering.</p>
24    pub width: ::std::option::Option<::std::string::String>,
25    /// <p>The height of the legend. If this value is omitted, a default height is used when rendering.</p>
26    pub height: ::std::option::Option<::std::string::String>,
27    /// <p>Configures the display properties of the given text.</p>
28    pub value_font_configuration: ::std::option::Option<crate::types::FontConfiguration>,
29}
30impl LegendOptions {
31    /// <p>Determines whether or not the legend is visible.</p>
32    pub fn visibility(&self) -> ::std::option::Option<&crate::types::Visibility> {
33        self.visibility.as_ref()
34    }
35    /// <p>The custom title for the legend.</p>
36    pub fn title(&self) -> ::std::option::Option<&crate::types::LabelOptions> {
37        self.title.as_ref()
38    }
39    /// <p>The positions for the legend. Choose one of the following options:</p>
40    /// <ul>
41    /// <li>
42    /// <p><code>AUTO</code></p></li>
43    /// <li>
44    /// <p><code>RIGHT</code></p></li>
45    /// <li>
46    /// <p><code>BOTTOM</code></p></li>
47    /// <li>
48    /// <p><code>LEFT</code></p></li>
49    /// </ul>
50    pub fn position(&self) -> ::std::option::Option<&crate::types::LegendPosition> {
51        self.position.as_ref()
52    }
53    /// <p>The width of the legend. If this value is omitted, a default width is used when rendering.</p>
54    pub fn width(&self) -> ::std::option::Option<&str> {
55        self.width.as_deref()
56    }
57    /// <p>The height of the legend. If this value is omitted, a default height is used when rendering.</p>
58    pub fn height(&self) -> ::std::option::Option<&str> {
59        self.height.as_deref()
60    }
61    /// <p>Configures the display properties of the given text.</p>
62    pub fn value_font_configuration(&self) -> ::std::option::Option<&crate::types::FontConfiguration> {
63        self.value_font_configuration.as_ref()
64    }
65}
66impl LegendOptions {
67    /// Creates a new builder-style object to manufacture [`LegendOptions`](crate::types::LegendOptions).
68    pub fn builder() -> crate::types::builders::LegendOptionsBuilder {
69        crate::types::builders::LegendOptionsBuilder::default()
70    }
71}
72
73/// A builder for [`LegendOptions`](crate::types::LegendOptions).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
75#[non_exhaustive]
76pub struct LegendOptionsBuilder {
77    pub(crate) visibility: ::std::option::Option<crate::types::Visibility>,
78    pub(crate) title: ::std::option::Option<crate::types::LabelOptions>,
79    pub(crate) position: ::std::option::Option<crate::types::LegendPosition>,
80    pub(crate) width: ::std::option::Option<::std::string::String>,
81    pub(crate) height: ::std::option::Option<::std::string::String>,
82    pub(crate) value_font_configuration: ::std::option::Option<crate::types::FontConfiguration>,
83}
84impl LegendOptionsBuilder {
85    /// <p>Determines whether or not the legend is visible.</p>
86    pub fn visibility(mut self, input: crate::types::Visibility) -> Self {
87        self.visibility = ::std::option::Option::Some(input);
88        self
89    }
90    /// <p>Determines whether or not the legend is visible.</p>
91    pub fn set_visibility(mut self, input: ::std::option::Option<crate::types::Visibility>) -> Self {
92        self.visibility = input;
93        self
94    }
95    /// <p>Determines whether or not the legend is visible.</p>
96    pub fn get_visibility(&self) -> &::std::option::Option<crate::types::Visibility> {
97        &self.visibility
98    }
99    /// <p>The custom title for the legend.</p>
100    pub fn title(mut self, input: crate::types::LabelOptions) -> Self {
101        self.title = ::std::option::Option::Some(input);
102        self
103    }
104    /// <p>The custom title for the legend.</p>
105    pub fn set_title(mut self, input: ::std::option::Option<crate::types::LabelOptions>) -> Self {
106        self.title = input;
107        self
108    }
109    /// <p>The custom title for the legend.</p>
110    pub fn get_title(&self) -> &::std::option::Option<crate::types::LabelOptions> {
111        &self.title
112    }
113    /// <p>The positions for the legend. Choose one of the following options:</p>
114    /// <ul>
115    /// <li>
116    /// <p><code>AUTO</code></p></li>
117    /// <li>
118    /// <p><code>RIGHT</code></p></li>
119    /// <li>
120    /// <p><code>BOTTOM</code></p></li>
121    /// <li>
122    /// <p><code>LEFT</code></p></li>
123    /// </ul>
124    pub fn position(mut self, input: crate::types::LegendPosition) -> Self {
125        self.position = ::std::option::Option::Some(input);
126        self
127    }
128    /// <p>The positions for the legend. Choose one of the following options:</p>
129    /// <ul>
130    /// <li>
131    /// <p><code>AUTO</code></p></li>
132    /// <li>
133    /// <p><code>RIGHT</code></p></li>
134    /// <li>
135    /// <p><code>BOTTOM</code></p></li>
136    /// <li>
137    /// <p><code>LEFT</code></p></li>
138    /// </ul>
139    pub fn set_position(mut self, input: ::std::option::Option<crate::types::LegendPosition>) -> Self {
140        self.position = input;
141        self
142    }
143    /// <p>The positions for the legend. Choose one of the following options:</p>
144    /// <ul>
145    /// <li>
146    /// <p><code>AUTO</code></p></li>
147    /// <li>
148    /// <p><code>RIGHT</code></p></li>
149    /// <li>
150    /// <p><code>BOTTOM</code></p></li>
151    /// <li>
152    /// <p><code>LEFT</code></p></li>
153    /// </ul>
154    pub fn get_position(&self) -> &::std::option::Option<crate::types::LegendPosition> {
155        &self.position
156    }
157    /// <p>The width of the legend. If this value is omitted, a default width is used when rendering.</p>
158    pub fn width(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.width = ::std::option::Option::Some(input.into());
160        self
161    }
162    /// <p>The width of the legend. If this value is omitted, a default width is used when rendering.</p>
163    pub fn set_width(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.width = input;
165        self
166    }
167    /// <p>The width of the legend. If this value is omitted, a default width is used when rendering.</p>
168    pub fn get_width(&self) -> &::std::option::Option<::std::string::String> {
169        &self.width
170    }
171    /// <p>The height of the legend. If this value is omitted, a default height is used when rendering.</p>
172    pub fn height(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
173        self.height = ::std::option::Option::Some(input.into());
174        self
175    }
176    /// <p>The height of the legend. If this value is omitted, a default height is used when rendering.</p>
177    pub fn set_height(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
178        self.height = input;
179        self
180    }
181    /// <p>The height of the legend. If this value is omitted, a default height is used when rendering.</p>
182    pub fn get_height(&self) -> &::std::option::Option<::std::string::String> {
183        &self.height
184    }
185    /// <p>Configures the display properties of the given text.</p>
186    pub fn value_font_configuration(mut self, input: crate::types::FontConfiguration) -> Self {
187        self.value_font_configuration = ::std::option::Option::Some(input);
188        self
189    }
190    /// <p>Configures the display properties of the given text.</p>
191    pub fn set_value_font_configuration(mut self, input: ::std::option::Option<crate::types::FontConfiguration>) -> Self {
192        self.value_font_configuration = input;
193        self
194    }
195    /// <p>Configures the display properties of the given text.</p>
196    pub fn get_value_font_configuration(&self) -> &::std::option::Option<crate::types::FontConfiguration> {
197        &self.value_font_configuration
198    }
199    /// Consumes the builder and constructs a [`LegendOptions`](crate::types::LegendOptions).
200    pub fn build(self) -> crate::types::LegendOptions {
201        crate::types::LegendOptions {
202            visibility: self.visibility,
203            title: self.title,
204            position: self.position,
205            width: self.width,
206            height: self.height,
207            value_font_configuration: self.value_font_configuration,
208        }
209    }
210}