aws_sdk_quicksight/types/
_table_field_option.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The options for a table field.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TableFieldOption {
7    /// <p>The field ID for a table field.</p>
8    pub field_id: ::std::string::String,
9    /// <p>The width for a table field.</p>
10    pub width: ::std::option::Option<::std::string::String>,
11    /// <p>The custom label for a table field.</p>
12    pub custom_label: ::std::option::Option<::std::string::String>,
13    /// <p>The visibility of a table field.</p>
14    pub visibility: ::std::option::Option<crate::types::Visibility>,
15    /// <p>The URL configuration for a table field.</p>
16    pub url_styling: ::std::option::Option<crate::types::TableFieldUrlConfiguration>,
17}
18impl TableFieldOption {
19    /// <p>The field ID for a table field.</p>
20    pub fn field_id(&self) -> &str {
21        use std::ops::Deref;
22        self.field_id.deref()
23    }
24    /// <p>The width for a table field.</p>
25    pub fn width(&self) -> ::std::option::Option<&str> {
26        self.width.as_deref()
27    }
28    /// <p>The custom label for a table field.</p>
29    pub fn custom_label(&self) -> ::std::option::Option<&str> {
30        self.custom_label.as_deref()
31    }
32    /// <p>The visibility of a table field.</p>
33    pub fn visibility(&self) -> ::std::option::Option<&crate::types::Visibility> {
34        self.visibility.as_ref()
35    }
36    /// <p>The URL configuration for a table field.</p>
37    pub fn url_styling(&self) -> ::std::option::Option<&crate::types::TableFieldUrlConfiguration> {
38        self.url_styling.as_ref()
39    }
40}
41impl TableFieldOption {
42    /// Creates a new builder-style object to manufacture [`TableFieldOption`](crate::types::TableFieldOption).
43    pub fn builder() -> crate::types::builders::TableFieldOptionBuilder {
44        crate::types::builders::TableFieldOptionBuilder::default()
45    }
46}
47
48/// A builder for [`TableFieldOption`](crate::types::TableFieldOption).
49#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
50#[non_exhaustive]
51pub struct TableFieldOptionBuilder {
52    pub(crate) field_id: ::std::option::Option<::std::string::String>,
53    pub(crate) width: ::std::option::Option<::std::string::String>,
54    pub(crate) custom_label: ::std::option::Option<::std::string::String>,
55    pub(crate) visibility: ::std::option::Option<crate::types::Visibility>,
56    pub(crate) url_styling: ::std::option::Option<crate::types::TableFieldUrlConfiguration>,
57}
58impl TableFieldOptionBuilder {
59    /// <p>The field ID for a table field.</p>
60    /// This field is required.
61    pub fn field_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62        self.field_id = ::std::option::Option::Some(input.into());
63        self
64    }
65    /// <p>The field ID for a table field.</p>
66    pub fn set_field_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67        self.field_id = input;
68        self
69    }
70    /// <p>The field ID for a table field.</p>
71    pub fn get_field_id(&self) -> &::std::option::Option<::std::string::String> {
72        &self.field_id
73    }
74    /// <p>The width for a table field.</p>
75    pub fn width(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76        self.width = ::std::option::Option::Some(input.into());
77        self
78    }
79    /// <p>The width for a table field.</p>
80    pub fn set_width(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81        self.width = input;
82        self
83    }
84    /// <p>The width for a table field.</p>
85    pub fn get_width(&self) -> &::std::option::Option<::std::string::String> {
86        &self.width
87    }
88    /// <p>The custom label for a table field.</p>
89    pub fn custom_label(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90        self.custom_label = ::std::option::Option::Some(input.into());
91        self
92    }
93    /// <p>The custom label for a table field.</p>
94    pub fn set_custom_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95        self.custom_label = input;
96        self
97    }
98    /// <p>The custom label for a table field.</p>
99    pub fn get_custom_label(&self) -> &::std::option::Option<::std::string::String> {
100        &self.custom_label
101    }
102    /// <p>The visibility of a table field.</p>
103    pub fn visibility(mut self, input: crate::types::Visibility) -> Self {
104        self.visibility = ::std::option::Option::Some(input);
105        self
106    }
107    /// <p>The visibility of a table field.</p>
108    pub fn set_visibility(mut self, input: ::std::option::Option<crate::types::Visibility>) -> Self {
109        self.visibility = input;
110        self
111    }
112    /// <p>The visibility of a table field.</p>
113    pub fn get_visibility(&self) -> &::std::option::Option<crate::types::Visibility> {
114        &self.visibility
115    }
116    /// <p>The URL configuration for a table field.</p>
117    pub fn url_styling(mut self, input: crate::types::TableFieldUrlConfiguration) -> Self {
118        self.url_styling = ::std::option::Option::Some(input);
119        self
120    }
121    /// <p>The URL configuration for a table field.</p>
122    pub fn set_url_styling(mut self, input: ::std::option::Option<crate::types::TableFieldUrlConfiguration>) -> Self {
123        self.url_styling = input;
124        self
125    }
126    /// <p>The URL configuration for a table field.</p>
127    pub fn get_url_styling(&self) -> &::std::option::Option<crate::types::TableFieldUrlConfiguration> {
128        &self.url_styling
129    }
130    /// Consumes the builder and constructs a [`TableFieldOption`](crate::types::TableFieldOption).
131    /// This method will fail if any of the following fields are not set:
132    /// - [`field_id`](crate::types::builders::TableFieldOptionBuilder::field_id)
133    pub fn build(self) -> ::std::result::Result<crate::types::TableFieldOption, ::aws_smithy_types::error::operation::BuildError> {
134        ::std::result::Result::Ok(crate::types::TableFieldOption {
135            field_id: self.field_id.ok_or_else(|| {
136                ::aws_smithy_types::error::operation::BuildError::missing_field(
137                    "field_id",
138                    "field_id was not specified but it is required when building TableFieldOption",
139                )
140            })?,
141            width: self.width,
142            custom_label: self.custom_label,
143            visibility: self.visibility,
144            url_styling: self.url_styling,
145        })
146    }
147}