aws_sdk_quicksight/types/
_parameter_text_field_control.rs

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