aws_sdk_quicksight/types/_histogram_aggregated_field_wells.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The field well configuration of a histogram.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct HistogramAggregatedFieldWells {
7 /// <p>The value field wells of a histogram. Values are aggregated by <code>COUNT</code> or <code>DISTINCT_COUNT</code>.</p>
8 pub values: ::std::option::Option<::std::vec::Vec<crate::types::MeasureField>>,
9}
10impl HistogramAggregatedFieldWells {
11 /// <p>The value field wells of a histogram. Values are aggregated by <code>COUNT</code> or <code>DISTINCT_COUNT</code>.</p>
12 ///
13 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.values.is_none()`.
14 pub fn values(&self) -> &[crate::types::MeasureField] {
15 self.values.as_deref().unwrap_or_default()
16 }
17}
18impl HistogramAggregatedFieldWells {
19 /// Creates a new builder-style object to manufacture [`HistogramAggregatedFieldWells`](crate::types::HistogramAggregatedFieldWells).
20 pub fn builder() -> crate::types::builders::HistogramAggregatedFieldWellsBuilder {
21 crate::types::builders::HistogramAggregatedFieldWellsBuilder::default()
22 }
23}
24
25/// A builder for [`HistogramAggregatedFieldWells`](crate::types::HistogramAggregatedFieldWells).
26#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
27#[non_exhaustive]
28pub struct HistogramAggregatedFieldWellsBuilder {
29 pub(crate) values: ::std::option::Option<::std::vec::Vec<crate::types::MeasureField>>,
30}
31impl HistogramAggregatedFieldWellsBuilder {
32 /// Appends an item to `values`.
33 ///
34 /// To override the contents of this collection use [`set_values`](Self::set_values).
35 ///
36 /// <p>The value field wells of a histogram. Values are aggregated by <code>COUNT</code> or <code>DISTINCT_COUNT</code>.</p>
37 pub fn values(mut self, input: crate::types::MeasureField) -> Self {
38 let mut v = self.values.unwrap_or_default();
39 v.push(input);
40 self.values = ::std::option::Option::Some(v);
41 self
42 }
43 /// <p>The value field wells of a histogram. Values are aggregated by <code>COUNT</code> or <code>DISTINCT_COUNT</code>.</p>
44 pub fn set_values(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MeasureField>>) -> Self {
45 self.values = input;
46 self
47 }
48 /// <p>The value field wells of a histogram. Values are aggregated by <code>COUNT</code> or <code>DISTINCT_COUNT</code>.</p>
49 pub fn get_values(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MeasureField>> {
50 &self.values
51 }
52 /// Consumes the builder and constructs a [`HistogramAggregatedFieldWells`](crate::types::HistogramAggregatedFieldWells).
53 pub fn build(self) -> crate::types::HistogramAggregatedFieldWells {
54 crate::types::HistogramAggregatedFieldWells { values: self.values }
55 }
56}