aws_sdk_iotfleetwise/types/_timestream_config.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The Amazon Timestream table where the Amazon Web Services IoT FleetWise campaign sends data. Timestream stores and organizes data to optimize query processing time and to reduce storage costs. For more information, see <a href="https://docs.aws.amazon.com/timestream/latest/developerguide/data-modeling.html">Data modeling</a> in the <i>Amazon Timestream Developer Guide</i>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct TimestreamConfig {
7 /// <p>The Amazon Resource Name (ARN) of the Amazon Timestream table.</p>
8 pub timestream_table_arn: ::std::string::String,
9 /// <p>The Amazon Resource Name (ARN) of the task execution role that grants Amazon Web Services IoT FleetWise permission to deliver data to the Amazon Timestream table.</p>
10 pub execution_role_arn: ::std::string::String,
11}
12impl TimestreamConfig {
13 /// <p>The Amazon Resource Name (ARN) of the Amazon Timestream table.</p>
14 pub fn timestream_table_arn(&self) -> &str {
15 use std::ops::Deref;
16 self.timestream_table_arn.deref()
17 }
18 /// <p>The Amazon Resource Name (ARN) of the task execution role that grants Amazon Web Services IoT FleetWise permission to deliver data to the Amazon Timestream table.</p>
19 pub fn execution_role_arn(&self) -> &str {
20 use std::ops::Deref;
21 self.execution_role_arn.deref()
22 }
23}
24impl TimestreamConfig {
25 /// Creates a new builder-style object to manufacture [`TimestreamConfig`](crate::types::TimestreamConfig).
26 pub fn builder() -> crate::types::builders::TimestreamConfigBuilder {
27 crate::types::builders::TimestreamConfigBuilder::default()
28 }
29}
30
31/// A builder for [`TimestreamConfig`](crate::types::TimestreamConfig).
32#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct TimestreamConfigBuilder {
35 pub(crate) timestream_table_arn: ::std::option::Option<::std::string::String>,
36 pub(crate) execution_role_arn: ::std::option::Option<::std::string::String>,
37}
38impl TimestreamConfigBuilder {
39 /// <p>The Amazon Resource Name (ARN) of the Amazon Timestream table.</p>
40 /// This field is required.
41 pub fn timestream_table_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
42 self.timestream_table_arn = ::std::option::Option::Some(input.into());
43 self
44 }
45 /// <p>The Amazon Resource Name (ARN) of the Amazon Timestream table.</p>
46 pub fn set_timestream_table_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
47 self.timestream_table_arn = input;
48 self
49 }
50 /// <p>The Amazon Resource Name (ARN) of the Amazon Timestream table.</p>
51 pub fn get_timestream_table_arn(&self) -> &::std::option::Option<::std::string::String> {
52 &self.timestream_table_arn
53 }
54 /// <p>The Amazon Resource Name (ARN) of the task execution role that grants Amazon Web Services IoT FleetWise permission to deliver data to the Amazon Timestream table.</p>
55 /// This field is required.
56 pub fn execution_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57 self.execution_role_arn = ::std::option::Option::Some(input.into());
58 self
59 }
60 /// <p>The Amazon Resource Name (ARN) of the task execution role that grants Amazon Web Services IoT FleetWise permission to deliver data to the Amazon Timestream table.</p>
61 pub fn set_execution_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62 self.execution_role_arn = input;
63 self
64 }
65 /// <p>The Amazon Resource Name (ARN) of the task execution role that grants Amazon Web Services IoT FleetWise permission to deliver data to the Amazon Timestream table.</p>
66 pub fn get_execution_role_arn(&self) -> &::std::option::Option<::std::string::String> {
67 &self.execution_role_arn
68 }
69 /// Consumes the builder and constructs a [`TimestreamConfig`](crate::types::TimestreamConfig).
70 /// This method will fail if any of the following fields are not set:
71 /// - [`timestream_table_arn`](crate::types::builders::TimestreamConfigBuilder::timestream_table_arn)
72 /// - [`execution_role_arn`](crate::types::builders::TimestreamConfigBuilder::execution_role_arn)
73 pub fn build(self) -> ::std::result::Result<crate::types::TimestreamConfig, ::aws_smithy_types::error::operation::BuildError> {
74 ::std::result::Result::Ok(crate::types::TimestreamConfig {
75 timestream_table_arn: self.timestream_table_arn.ok_or_else(|| {
76 ::aws_smithy_types::error::operation::BuildError::missing_field(
77 "timestream_table_arn",
78 "timestream_table_arn was not specified but it is required when building TimestreamConfig",
79 )
80 })?,
81 execution_role_arn: self.execution_role_arn.ok_or_else(|| {
82 ::aws_smithy_types::error::operation::BuildError::missing_field(
83 "execution_role_arn",
84 "execution_role_arn was not specified but it is required when building TimestreamConfig",
85 )
86 })?,
87 })
88 }
89}