aws_sdk_quicksight/types/
_table_field_option.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TableFieldOption {
7 pub field_id: ::std::string::String,
9 pub width: ::std::option::Option<::std::string::String>,
11 pub custom_label: ::std::option::Option<::std::string::String>,
13 pub visibility: ::std::option::Option<crate::types::Visibility>,
15 pub url_styling: ::std::option::Option<crate::types::TableFieldUrlConfiguration>,
17}
18impl TableFieldOption {
19 pub fn field_id(&self) -> &str {
21 use std::ops::Deref;
22 self.field_id.deref()
23 }
24 pub fn width(&self) -> ::std::option::Option<&str> {
26 self.width.as_deref()
27 }
28 pub fn custom_label(&self) -> ::std::option::Option<&str> {
30 self.custom_label.as_deref()
31 }
32 pub fn visibility(&self) -> ::std::option::Option<&crate::types::Visibility> {
34 self.visibility.as_ref()
35 }
36 pub fn url_styling(&self) -> ::std::option::Option<&crate::types::TableFieldUrlConfiguration> {
38 self.url_styling.as_ref()
39 }
40}
41impl TableFieldOption {
42 pub fn builder() -> crate::types::builders::TableFieldOptionBuilder {
44 crate::types::builders::TableFieldOptionBuilder::default()
45 }
46}
47
48#[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 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 pub fn set_field_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.field_id = input;
68 self
69 }
70 pub fn get_field_id(&self) -> &::std::option::Option<::std::string::String> {
72 &self.field_id
73 }
74 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 pub fn set_width(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.width = input;
82 self
83 }
84 pub fn get_width(&self) -> &::std::option::Option<::std::string::String> {
86 &self.width
87 }
88 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 pub fn set_custom_label(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95 self.custom_label = input;
96 self
97 }
98 pub fn get_custom_label(&self) -> &::std::option::Option<::std::string::String> {
100 &self.custom_label
101 }
102 pub fn visibility(mut self, input: crate::types::Visibility) -> Self {
104 self.visibility = ::std::option::Option::Some(input);
105 self
106 }
107 pub fn set_visibility(mut self, input: ::std::option::Option<crate::types::Visibility>) -> Self {
109 self.visibility = input;
110 self
111 }
112 pub fn get_visibility(&self) -> &::std::option::Option<crate::types::Visibility> {
114 &self.visibility
115 }
116 pub fn url_styling(mut self, input: crate::types::TableFieldUrlConfiguration) -> Self {
118 self.url_styling = ::std::option::Option::Some(input);
119 self
120 }
121 pub fn set_url_styling(mut self, input: ::std::option::Option<crate::types::TableFieldUrlConfiguration>) -> Self {
123 self.url_styling = input;
124 self
125 }
126 pub fn get_url_styling(&self) -> &::std::option::Option<crate::types::TableFieldUrlConfiguration> {
128 &self.url_styling
129 }
130 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}