aws_sdk_iotfleetwise/operation/register_account/
_register_account_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct RegisterAccountOutput {
6    /// <p>The status of registering your Amazon Web Services account, IAM role, and Timestream resources.</p>
7    pub register_account_status: crate::types::RegistrationStatus,
8    /// <p>The registered Amazon Timestream resources that Amazon Web Services IoT FleetWise edge agent software can transfer your vehicle data to.</p>
9    pub timestream_resources: ::std::option::Option<crate::types::TimestreamResources>,
10    /// <p>The registered IAM resource that allows Amazon Web Services IoT FleetWise to send data to Amazon Timestream.</p>
11    pub iam_resources: ::std::option::Option<crate::types::IamResources>,
12    /// <p>The time the account was registered, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
13    pub creation_time: ::aws_smithy_types::DateTime,
14    /// <p>The time this registration was last updated, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
15    pub last_modification_time: ::aws_smithy_types::DateTime,
16    _request_id: Option<String>,
17}
18impl RegisterAccountOutput {
19    /// <p>The status of registering your Amazon Web Services account, IAM role, and Timestream resources.</p>
20    pub fn register_account_status(&self) -> &crate::types::RegistrationStatus {
21        &self.register_account_status
22    }
23    /// <p>The registered Amazon Timestream resources that Amazon Web Services IoT FleetWise edge agent software can transfer your vehicle data to.</p>
24    pub fn timestream_resources(&self) -> ::std::option::Option<&crate::types::TimestreamResources> {
25        self.timestream_resources.as_ref()
26    }
27    /// <p>The registered IAM resource that allows Amazon Web Services IoT FleetWise to send data to Amazon Timestream.</p>
28    pub fn iam_resources(&self) -> ::std::option::Option<&crate::types::IamResources> {
29        self.iam_resources.as_ref()
30    }
31    /// <p>The time the account was registered, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
32    pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
33        &self.creation_time
34    }
35    /// <p>The time this registration was last updated, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
36    pub fn last_modification_time(&self) -> &::aws_smithy_types::DateTime {
37        &self.last_modification_time
38    }
39}
40impl ::aws_types::request_id::RequestId for RegisterAccountOutput {
41    fn request_id(&self) -> Option<&str> {
42        self._request_id.as_deref()
43    }
44}
45impl RegisterAccountOutput {
46    /// Creates a new builder-style object to manufacture [`RegisterAccountOutput`](crate::operation::register_account::RegisterAccountOutput).
47    pub fn builder() -> crate::operation::register_account::builders::RegisterAccountOutputBuilder {
48        crate::operation::register_account::builders::RegisterAccountOutputBuilder::default()
49    }
50}
51
52/// A builder for [`RegisterAccountOutput`](crate::operation::register_account::RegisterAccountOutput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct RegisterAccountOutputBuilder {
56    pub(crate) register_account_status: ::std::option::Option<crate::types::RegistrationStatus>,
57    pub(crate) timestream_resources: ::std::option::Option<crate::types::TimestreamResources>,
58    pub(crate) iam_resources: ::std::option::Option<crate::types::IamResources>,
59    pub(crate) creation_time: ::std::option::Option<::aws_smithy_types::DateTime>,
60    pub(crate) last_modification_time: ::std::option::Option<::aws_smithy_types::DateTime>,
61    _request_id: Option<String>,
62}
63impl RegisterAccountOutputBuilder {
64    /// <p>The status of registering your Amazon Web Services account, IAM role, and Timestream resources.</p>
65    /// This field is required.
66    pub fn register_account_status(mut self, input: crate::types::RegistrationStatus) -> Self {
67        self.register_account_status = ::std::option::Option::Some(input);
68        self
69    }
70    /// <p>The status of registering your Amazon Web Services account, IAM role, and Timestream resources.</p>
71    pub fn set_register_account_status(mut self, input: ::std::option::Option<crate::types::RegistrationStatus>) -> Self {
72        self.register_account_status = input;
73        self
74    }
75    /// <p>The status of registering your Amazon Web Services account, IAM role, and Timestream resources.</p>
76    pub fn get_register_account_status(&self) -> &::std::option::Option<crate::types::RegistrationStatus> {
77        &self.register_account_status
78    }
79    /// <p>The registered Amazon Timestream resources that Amazon Web Services IoT FleetWise edge agent software can transfer your vehicle data to.</p>
80    pub fn timestream_resources(mut self, input: crate::types::TimestreamResources) -> Self {
81        self.timestream_resources = ::std::option::Option::Some(input);
82        self
83    }
84    /// <p>The registered Amazon Timestream resources that Amazon Web Services IoT FleetWise edge agent software can transfer your vehicle data to.</p>
85    pub fn set_timestream_resources(mut self, input: ::std::option::Option<crate::types::TimestreamResources>) -> Self {
86        self.timestream_resources = input;
87        self
88    }
89    /// <p>The registered Amazon Timestream resources that Amazon Web Services IoT FleetWise edge agent software can transfer your vehicle data to.</p>
90    pub fn get_timestream_resources(&self) -> &::std::option::Option<crate::types::TimestreamResources> {
91        &self.timestream_resources
92    }
93    /// <p>The registered IAM resource that allows Amazon Web Services IoT FleetWise to send data to Amazon Timestream.</p>
94    /// This field is required.
95    pub fn iam_resources(mut self, input: crate::types::IamResources) -> Self {
96        self.iam_resources = ::std::option::Option::Some(input);
97        self
98    }
99    /// <p>The registered IAM resource that allows Amazon Web Services IoT FleetWise to send data to Amazon Timestream.</p>
100    pub fn set_iam_resources(mut self, input: ::std::option::Option<crate::types::IamResources>) -> Self {
101        self.iam_resources = input;
102        self
103    }
104    /// <p>The registered IAM resource that allows Amazon Web Services IoT FleetWise to send data to Amazon Timestream.</p>
105    pub fn get_iam_resources(&self) -> &::std::option::Option<crate::types::IamResources> {
106        &self.iam_resources
107    }
108    /// <p>The time the account was registered, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
109    /// This field is required.
110    pub fn creation_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
111        self.creation_time = ::std::option::Option::Some(input);
112        self
113    }
114    /// <p>The time the account was registered, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
115    pub fn set_creation_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
116        self.creation_time = input;
117        self
118    }
119    /// <p>The time the account was registered, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
120    pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
121        &self.creation_time
122    }
123    /// <p>The time this registration was last updated, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
124    /// This field is required.
125    pub fn last_modification_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
126        self.last_modification_time = ::std::option::Option::Some(input);
127        self
128    }
129    /// <p>The time this registration was last updated, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
130    pub fn set_last_modification_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
131        self.last_modification_time = input;
132        self
133    }
134    /// <p>The time this registration was last updated, in seconds since epoch (January 1, 1970 at midnight UTC time).</p>
135    pub fn get_last_modification_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
136        &self.last_modification_time
137    }
138    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
139        self._request_id = Some(request_id.into());
140        self
141    }
142
143    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
144        self._request_id = request_id;
145        self
146    }
147    /// Consumes the builder and constructs a [`RegisterAccountOutput`](crate::operation::register_account::RegisterAccountOutput).
148    /// This method will fail if any of the following fields are not set:
149    /// - [`register_account_status`](crate::operation::register_account::builders::RegisterAccountOutputBuilder::register_account_status)
150    /// - [`creation_time`](crate::operation::register_account::builders::RegisterAccountOutputBuilder::creation_time)
151    /// - [`last_modification_time`](crate::operation::register_account::builders::RegisterAccountOutputBuilder::last_modification_time)
152    pub fn build(
153        self,
154    ) -> ::std::result::Result<crate::operation::register_account::RegisterAccountOutput, ::aws_smithy_types::error::operation::BuildError> {
155        ::std::result::Result::Ok(crate::operation::register_account::RegisterAccountOutput {
156            register_account_status: self.register_account_status.ok_or_else(|| {
157                ::aws_smithy_types::error::operation::BuildError::missing_field(
158                    "register_account_status",
159                    "register_account_status was not specified but it is required when building RegisterAccountOutput",
160                )
161            })?,
162            timestream_resources: self.timestream_resources,
163            iam_resources: self.iam_resources,
164            creation_time: self.creation_time.ok_or_else(|| {
165                ::aws_smithy_types::error::operation::BuildError::missing_field(
166                    "creation_time",
167                    "creation_time was not specified but it is required when building RegisterAccountOutput",
168                )
169            })?,
170            last_modification_time: self.last_modification_time.ok_or_else(|| {
171                ::aws_smithy_types::error::operation::BuildError::missing_field(
172                    "last_modification_time",
173                    "last_modification_time was not specified but it is required when building RegisterAccountOutput",
174                )
175            })?,
176            _request_id: self._request_id,
177        })
178    }
179}