Skip to main content

aws_sdk_quicksight/types/
_pivot_table_field_collapse_state_target.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The target of a pivot table field collapse state.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct PivotTableFieldCollapseStateTarget {
7    /// <p>The field ID of the pivot table that the collapse state needs to be set to.</p>
8    pub field_id: ::std::option::Option<::std::string::String>,
9    /// <p>The data path of the pivot table's header. Used to set the collapse state.</p>
10    pub field_data_path_values: ::std::option::Option<::std::vec::Vec<crate::types::DataPathValue>>,
11}
12impl PivotTableFieldCollapseStateTarget {
13    /// <p>The field ID of the pivot table that the collapse state needs to be set to.</p>
14    pub fn field_id(&self) -> ::std::option::Option<&str> {
15        self.field_id.as_deref()
16    }
17    /// <p>The data path of the pivot table's header. Used to set the collapse state.</p>
18    ///
19    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.field_data_path_values.is_none()`.
20    pub fn field_data_path_values(&self) -> &[crate::types::DataPathValue] {
21        self.field_data_path_values.as_deref().unwrap_or_default()
22    }
23}
24impl PivotTableFieldCollapseStateTarget {
25    /// Creates a new builder-style object to manufacture [`PivotTableFieldCollapseStateTarget`](crate::types::PivotTableFieldCollapseStateTarget).
26    pub fn builder() -> crate::types::builders::PivotTableFieldCollapseStateTargetBuilder {
27        crate::types::builders::PivotTableFieldCollapseStateTargetBuilder::default()
28    }
29}
30
31/// A builder for [`PivotTableFieldCollapseStateTarget`](crate::types::PivotTableFieldCollapseStateTarget).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct PivotTableFieldCollapseStateTargetBuilder {
35    pub(crate) field_id: ::std::option::Option<::std::string::String>,
36    pub(crate) field_data_path_values: ::std::option::Option<::std::vec::Vec<crate::types::DataPathValue>>,
37}
38impl PivotTableFieldCollapseStateTargetBuilder {
39    /// <p>The field ID of the pivot table that the collapse state needs to be set to.</p>
40    pub fn field_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.field_id = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>The field ID of the pivot table that the collapse state needs to be set to.</p>
45    pub fn set_field_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.field_id = input;
47        self
48    }
49    /// <p>The field ID of the pivot table that the collapse state needs to be set to.</p>
50    pub fn get_field_id(&self) -> &::std::option::Option<::std::string::String> {
51        &self.field_id
52    }
53    /// Appends an item to `field_data_path_values`.
54    ///
55    /// To override the contents of this collection use [`set_field_data_path_values`](Self::set_field_data_path_values).
56    ///
57    /// <p>The data path of the pivot table's header. Used to set the collapse state.</p>
58    pub fn field_data_path_values(mut self, input: crate::types::DataPathValue) -> Self {
59        let mut v = self.field_data_path_values.unwrap_or_default();
60        v.push(input);
61        self.field_data_path_values = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>The data path of the pivot table's header. Used to set the collapse state.</p>
65    pub fn set_field_data_path_values(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::DataPathValue>>) -> Self {
66        self.field_data_path_values = input;
67        self
68    }
69    /// <p>The data path of the pivot table's header. Used to set the collapse state.</p>
70    pub fn get_field_data_path_values(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DataPathValue>> {
71        &self.field_data_path_values
72    }
73    /// Consumes the builder and constructs a [`PivotTableFieldCollapseStateTarget`](crate::types::PivotTableFieldCollapseStateTarget).
74    pub fn build(self) -> crate::types::PivotTableFieldCollapseStateTarget {
75        crate::types::PivotTableFieldCollapseStateTarget {
76            field_id: self.field_id,
77            field_data_path_values: self.field_data_path_values,
78        }
79    }
80}