Skip to main content

aws_sdk_quicksight/types/
_pivot_table_field_options.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The field options for a pivot table visual.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PivotTableFieldOptions {
7    /// <p>The selected field options for the pivot table field options.</p>
8    pub selected_field_options: ::std::option::Option<::std::vec::Vec<crate::types::PivotTableFieldOption>>,
9    /// <p>The data path options for the pivot table field options.</p>
10    pub data_path_options: ::std::option::Option<::std::vec::Vec<crate::types::PivotTableDataPathOption>>,
11    /// <p>The collapse state options for the pivot table field options.</p>
12    pub collapse_state_options: ::std::option::Option<::std::vec::Vec<crate::types::PivotTableFieldCollapseStateOption>>,
13}
14impl PivotTableFieldOptions {
15    /// <p>The selected field options for the pivot table field options.</p>
16    ///
17    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.selected_field_options.is_none()`.
18    pub fn selected_field_options(&self) -> &[crate::types::PivotTableFieldOption] {
19        self.selected_field_options.as_deref().unwrap_or_default()
20    }
21    /// <p>The data path options for the pivot table field options.</p>
22    ///
23    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.data_path_options.is_none()`.
24    pub fn data_path_options(&self) -> &[crate::types::PivotTableDataPathOption] {
25        self.data_path_options.as_deref().unwrap_or_default()
26    }
27    /// <p>The collapse state options for the pivot table field options.</p>
28    ///
29    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.collapse_state_options.is_none()`.
30    pub fn collapse_state_options(&self) -> &[crate::types::PivotTableFieldCollapseStateOption] {
31        self.collapse_state_options.as_deref().unwrap_or_default()
32    }
33}
34impl PivotTableFieldOptions {
35    /// Creates a new builder-style object to manufacture [`PivotTableFieldOptions`](crate::types::PivotTableFieldOptions).
36    pub fn builder() -> crate::types::builders::PivotTableFieldOptionsBuilder {
37        crate::types::builders::PivotTableFieldOptionsBuilder::default()
38    }
39}
40
41/// A builder for [`PivotTableFieldOptions`](crate::types::PivotTableFieldOptions).
42#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
43#[non_exhaustive]
44pub struct PivotTableFieldOptionsBuilder {
45    pub(crate) selected_field_options: ::std::option::Option<::std::vec::Vec<crate::types::PivotTableFieldOption>>,
46    pub(crate) data_path_options: ::std::option::Option<::std::vec::Vec<crate::types::PivotTableDataPathOption>>,
47    pub(crate) collapse_state_options: ::std::option::Option<::std::vec::Vec<crate::types::PivotTableFieldCollapseStateOption>>,
48}
49impl PivotTableFieldOptionsBuilder {
50    /// Appends an item to `selected_field_options`.
51    ///
52    /// To override the contents of this collection use [`set_selected_field_options`](Self::set_selected_field_options).
53    ///
54    /// <p>The selected field options for the pivot table field options.</p>
55    pub fn selected_field_options(mut self, input: crate::types::PivotTableFieldOption) -> Self {
56        let mut v = self.selected_field_options.unwrap_or_default();
57        v.push(input);
58        self.selected_field_options = ::std::option::Option::Some(v);
59        self
60    }
61    /// <p>The selected field options for the pivot table field options.</p>
62    pub fn set_selected_field_options(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PivotTableFieldOption>>) -> Self {
63        self.selected_field_options = input;
64        self
65    }
66    /// <p>The selected field options for the pivot table field options.</p>
67    pub fn get_selected_field_options(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PivotTableFieldOption>> {
68        &self.selected_field_options
69    }
70    /// Appends an item to `data_path_options`.
71    ///
72    /// To override the contents of this collection use [`set_data_path_options`](Self::set_data_path_options).
73    ///
74    /// <p>The data path options for the pivot table field options.</p>
75    pub fn data_path_options(mut self, input: crate::types::PivotTableDataPathOption) -> Self {
76        let mut v = self.data_path_options.unwrap_or_default();
77        v.push(input);
78        self.data_path_options = ::std::option::Option::Some(v);
79        self
80    }
81    /// <p>The data path options for the pivot table field options.</p>
82    pub fn set_data_path_options(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PivotTableDataPathOption>>) -> Self {
83        self.data_path_options = input;
84        self
85    }
86    /// <p>The data path options for the pivot table field options.</p>
87    pub fn get_data_path_options(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PivotTableDataPathOption>> {
88        &self.data_path_options
89    }
90    /// Appends an item to `collapse_state_options`.
91    ///
92    /// To override the contents of this collection use [`set_collapse_state_options`](Self::set_collapse_state_options).
93    ///
94    /// <p>The collapse state options for the pivot table field options.</p>
95    pub fn collapse_state_options(mut self, input: crate::types::PivotTableFieldCollapseStateOption) -> Self {
96        let mut v = self.collapse_state_options.unwrap_or_default();
97        v.push(input);
98        self.collapse_state_options = ::std::option::Option::Some(v);
99        self
100    }
101    /// <p>The collapse state options for the pivot table field options.</p>
102    pub fn set_collapse_state_options(
103        mut self,
104        input: ::std::option::Option<::std::vec::Vec<crate::types::PivotTableFieldCollapseStateOption>>,
105    ) -> Self {
106        self.collapse_state_options = input;
107        self
108    }
109    /// <p>The collapse state options for the pivot table field options.</p>
110    pub fn get_collapse_state_options(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PivotTableFieldCollapseStateOption>> {
111        &self.collapse_state_options
112    }
113    /// Consumes the builder and constructs a [`PivotTableFieldOptions`](crate::types::PivotTableFieldOptions).
114    pub fn build(self) -> crate::types::PivotTableFieldOptions {
115        crate::types::PivotTableFieldOptions {
116            selected_field_options: self.selected_field_options,
117            data_path_options: self.data_path_options,
118            collapse_state_options: self.collapse_state_options,
119        }
120    }
121}