Skip to main content

aws_sdk_timestreamwrite/types/
_multi_measure_attribute_mapping.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p></p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct MultiMeasureAttributeMapping {
7    /// <p></p>
8    pub source_column: ::std::string::String,
9    /// <p></p>
10    pub target_multi_measure_attribute_name: ::std::option::Option<::std::string::String>,
11    /// <p></p>
12    pub measure_value_type: ::std::option::Option<crate::types::ScalarMeasureValueType>,
13}
14impl MultiMeasureAttributeMapping {
15    /// <p></p>
16    pub fn source_column(&self) -> &str {
17        use std::ops::Deref;
18        self.source_column.deref()
19    }
20    /// <p></p>
21    pub fn target_multi_measure_attribute_name(&self) -> ::std::option::Option<&str> {
22        self.target_multi_measure_attribute_name.as_deref()
23    }
24    /// <p></p>
25    pub fn measure_value_type(&self) -> ::std::option::Option<&crate::types::ScalarMeasureValueType> {
26        self.measure_value_type.as_ref()
27    }
28}
29impl MultiMeasureAttributeMapping {
30    /// Creates a new builder-style object to manufacture [`MultiMeasureAttributeMapping`](crate::types::MultiMeasureAttributeMapping).
31    pub fn builder() -> crate::types::builders::MultiMeasureAttributeMappingBuilder {
32        crate::types::builders::MultiMeasureAttributeMappingBuilder::default()
33    }
34}
35
36/// A builder for [`MultiMeasureAttributeMapping`](crate::types::MultiMeasureAttributeMapping).
37#[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    /// <p></p>
46    /// This field is required.
47    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    /// <p></p>
52    pub fn set_source_column(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53        self.source_column = input;
54        self
55    }
56    /// <p></p>
57    pub fn get_source_column(&self) -> &::std::option::Option<::std::string::String> {
58        &self.source_column
59    }
60    /// <p></p>
61    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    /// <p></p>
66    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    /// <p></p>
71    pub fn get_target_multi_measure_attribute_name(&self) -> &::std::option::Option<::std::string::String> {
72        &self.target_multi_measure_attribute_name
73    }
74    /// <p></p>
75    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    /// <p></p>
80    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    /// <p></p>
85    pub fn get_measure_value_type(&self) -> &::std::option::Option<crate::types::ScalarMeasureValueType> {
86        &self.measure_value_type
87    }
88    /// Consumes the builder and constructs a [`MultiMeasureAttributeMapping`](crate::types::MultiMeasureAttributeMapping).
89    /// This method will fail if any of the following fields are not set:
90    /// - [`source_column`](crate::types::builders::MultiMeasureAttributeMappingBuilder::source_column)
91    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}