aws_sdk_timestreamwrite/types/
_multi_measure_attribute_mapping.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct MultiMeasureAttributeMapping {
7 pub source_column: ::std::string::String,
9 pub target_multi_measure_attribute_name: ::std::option::Option<::std::string::String>,
11 pub measure_value_type: ::std::option::Option<crate::types::ScalarMeasureValueType>,
13}
14impl MultiMeasureAttributeMapping {
15 pub fn source_column(&self) -> &str {
17 use std::ops::Deref;
18 self.source_column.deref()
19 }
20 pub fn target_multi_measure_attribute_name(&self) -> ::std::option::Option<&str> {
22 self.target_multi_measure_attribute_name.as_deref()
23 }
24 pub fn measure_value_type(&self) -> ::std::option::Option<&crate::types::ScalarMeasureValueType> {
26 self.measure_value_type.as_ref()
27 }
28}
29impl MultiMeasureAttributeMapping {
30 pub fn builder() -> crate::types::builders::MultiMeasureAttributeMappingBuilder {
32 crate::types::builders::MultiMeasureAttributeMappingBuilder::default()
33 }
34}
35
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct MultiMeasureAttributeMappingBuilder {
40 pub(crate) source_column: ::std::option::Option<::std::string::String>,
41 pub(crate) target_multi_measure_attribute_name: ::std::option::Option<::std::string::String>,
42 pub(crate) measure_value_type: ::std::option::Option<crate::types::ScalarMeasureValueType>,
43}
44impl MultiMeasureAttributeMappingBuilder {
45 pub fn source_column(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48 self.source_column = ::std::option::Option::Some(input.into());
49 self
50 }
51 pub fn set_source_column(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53 self.source_column = input;
54 self
55 }
56 pub fn get_source_column(&self) -> &::std::option::Option<::std::string::String> {
58 &self.source_column
59 }
60 pub fn target_multi_measure_attribute_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62 self.target_multi_measure_attribute_name = ::std::option::Option::Some(input.into());
63 self
64 }
65 pub fn set_target_multi_measure_attribute_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.target_multi_measure_attribute_name = input;
68 self
69 }
70 pub fn get_target_multi_measure_attribute_name(&self) -> &::std::option::Option<::std::string::String> {
72 &self.target_multi_measure_attribute_name
73 }
74 pub fn measure_value_type(mut self, input: crate::types::ScalarMeasureValueType) -> Self {
76 self.measure_value_type = ::std::option::Option::Some(input);
77 self
78 }
79 pub fn set_measure_value_type(mut self, input: ::std::option::Option<crate::types::ScalarMeasureValueType>) -> Self {
81 self.measure_value_type = input;
82 self
83 }
84 pub fn get_measure_value_type(&self) -> &::std::option::Option<crate::types::ScalarMeasureValueType> {
86 &self.measure_value_type
87 }
88 pub fn build(self) -> ::std::result::Result<crate::types::MultiMeasureAttributeMapping, ::aws_smithy_types::error::operation::BuildError> {
92 ::std::result::Result::Ok(crate::types::MultiMeasureAttributeMapping {
93 source_column: self.source_column.ok_or_else(|| {
94 ::aws_smithy_types::error::operation::BuildError::missing_field(
95 "source_column",
96 "source_column was not specified but it is required when building MultiMeasureAttributeMapping",
97 )
98 })?,
99 target_multi_measure_attribute_name: self.target_multi_measure_attribute_name,
100 measure_value_type: self.measure_value_type,
101 })
102 }
103}