aws_sdk_quicksight/types/
_string_parameter_declaration.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct StringParameterDeclaration {
7 pub parameter_value_type: crate::types::ParameterValueType,
9 pub name: ::std::string::String,
11 pub default_values: ::std::option::Option<crate::types::StringDefaultValues>,
13 pub value_when_unset: ::std::option::Option<crate::types::StringValueWhenUnsetConfiguration>,
15 pub mapped_data_set_parameters: ::std::option::Option<::std::vec::Vec<crate::types::MappedDataSetParameter>>,
17}
18impl StringParameterDeclaration {
19 pub fn parameter_value_type(&self) -> &crate::types::ParameterValueType {
21 &self.parameter_value_type
22 }
23 pub fn name(&self) -> &str {
25 use std::ops::Deref;
26 self.name.deref()
27 }
28 pub fn default_values(&self) -> ::std::option::Option<&crate::types::StringDefaultValues> {
30 self.default_values.as_ref()
31 }
32 pub fn value_when_unset(&self) -> ::std::option::Option<&crate::types::StringValueWhenUnsetConfiguration> {
34 self.value_when_unset.as_ref()
35 }
36 pub fn mapped_data_set_parameters(&self) -> &[crate::types::MappedDataSetParameter] {
40 self.mapped_data_set_parameters.as_deref().unwrap_or_default()
41 }
42}
43impl StringParameterDeclaration {
44 pub fn builder() -> crate::types::builders::StringParameterDeclarationBuilder {
46 crate::types::builders::StringParameterDeclarationBuilder::default()
47 }
48}
49
50#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct StringParameterDeclarationBuilder {
54 pub(crate) parameter_value_type: ::std::option::Option<crate::types::ParameterValueType>,
55 pub(crate) name: ::std::option::Option<::std::string::String>,
56 pub(crate) default_values: ::std::option::Option<crate::types::StringDefaultValues>,
57 pub(crate) value_when_unset: ::std::option::Option<crate::types::StringValueWhenUnsetConfiguration>,
58 pub(crate) mapped_data_set_parameters: ::std::option::Option<::std::vec::Vec<crate::types::MappedDataSetParameter>>,
59}
60impl StringParameterDeclarationBuilder {
61 pub fn parameter_value_type(mut self, input: crate::types::ParameterValueType) -> Self {
64 self.parameter_value_type = ::std::option::Option::Some(input);
65 self
66 }
67 pub fn set_parameter_value_type(mut self, input: ::std::option::Option<crate::types::ParameterValueType>) -> Self {
69 self.parameter_value_type = input;
70 self
71 }
72 pub fn get_parameter_value_type(&self) -> &::std::option::Option<crate::types::ParameterValueType> {
74 &self.parameter_value_type
75 }
76 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
79 self.name = ::std::option::Option::Some(input.into());
80 self
81 }
82 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
84 self.name = input;
85 self
86 }
87 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
89 &self.name
90 }
91 pub fn default_values(mut self, input: crate::types::StringDefaultValues) -> Self {
93 self.default_values = ::std::option::Option::Some(input);
94 self
95 }
96 pub fn set_default_values(mut self, input: ::std::option::Option<crate::types::StringDefaultValues>) -> Self {
98 self.default_values = input;
99 self
100 }
101 pub fn get_default_values(&self) -> &::std::option::Option<crate::types::StringDefaultValues> {
103 &self.default_values
104 }
105 pub fn value_when_unset(mut self, input: crate::types::StringValueWhenUnsetConfiguration) -> Self {
107 self.value_when_unset = ::std::option::Option::Some(input);
108 self
109 }
110 pub fn set_value_when_unset(mut self, input: ::std::option::Option<crate::types::StringValueWhenUnsetConfiguration>) -> Self {
112 self.value_when_unset = input;
113 self
114 }
115 pub fn get_value_when_unset(&self) -> &::std::option::Option<crate::types::StringValueWhenUnsetConfiguration> {
117 &self.value_when_unset
118 }
119 pub fn mapped_data_set_parameters(mut self, input: crate::types::MappedDataSetParameter) -> Self {
125 let mut v = self.mapped_data_set_parameters.unwrap_or_default();
126 v.push(input);
127 self.mapped_data_set_parameters = ::std::option::Option::Some(v);
128 self
129 }
130 pub fn set_mapped_data_set_parameters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MappedDataSetParameter>>) -> Self {
132 self.mapped_data_set_parameters = input;
133 self
134 }
135 pub fn get_mapped_data_set_parameters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MappedDataSetParameter>> {
137 &self.mapped_data_set_parameters
138 }
139 pub fn build(self) -> ::std::result::Result<crate::types::StringParameterDeclaration, ::aws_smithy_types::error::operation::BuildError> {
144 ::std::result::Result::Ok(crate::types::StringParameterDeclaration {
145 parameter_value_type: self.parameter_value_type.ok_or_else(|| {
146 ::aws_smithy_types::error::operation::BuildError::missing_field(
147 "parameter_value_type",
148 "parameter_value_type was not specified but it is required when building StringParameterDeclaration",
149 )
150 })?,
151 name: self.name.ok_or_else(|| {
152 ::aws_smithy_types::error::operation::BuildError::missing_field(
153 "name",
154 "name was not specified but it is required when building StringParameterDeclaration",
155 )
156 })?,
157 default_values: self.default_values,
158 value_when_unset: self.value_when_unset,
159 mapped_data_set_parameters: self.mapped_data_set_parameters,
160 })
161 }
162}