aws_sdk_iotfleetwise/operation/register_account/
_register_account_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct RegisterAccountOutput {
6 pub register_account_status: crate::types::RegistrationStatus,
8 pub timestream_resources: ::std::option::Option<crate::types::TimestreamResources>,
10 pub iam_resources: ::std::option::Option<crate::types::IamResources>,
12 pub creation_time: ::aws_smithy_types::DateTime,
14 pub last_modification_time: ::aws_smithy_types::DateTime,
16 _request_id: Option<String>,
17}
18impl RegisterAccountOutput {
19 pub fn register_account_status(&self) -> &crate::types::RegistrationStatus {
21 &self.register_account_status
22 }
23 pub fn timestream_resources(&self) -> ::std::option::Option<&crate::types::TimestreamResources> {
25 self.timestream_resources.as_ref()
26 }
27 pub fn iam_resources(&self) -> ::std::option::Option<&crate::types::IamResources> {
29 self.iam_resources.as_ref()
30 }
31 pub fn creation_time(&self) -> &::aws_smithy_types::DateTime {
33 &self.creation_time
34 }
35 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 pub fn builder() -> crate::operation::register_account::builders::RegisterAccountOutputBuilder {
48 crate::operation::register_account::builders::RegisterAccountOutputBuilder::default()
49 }
50}
51
52#[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 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 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 pub fn get_register_account_status(&self) -> &::std::option::Option<crate::types::RegistrationStatus> {
77 &self.register_account_status
78 }
79 pub fn timestream_resources(mut self, input: crate::types::TimestreamResources) -> Self {
81 self.timestream_resources = ::std::option::Option::Some(input);
82 self
83 }
84 pub fn set_timestream_resources(mut self, input: ::std::option::Option<crate::types::TimestreamResources>) -> Self {
86 self.timestream_resources = input;
87 self
88 }
89 pub fn get_timestream_resources(&self) -> &::std::option::Option<crate::types::TimestreamResources> {
91 &self.timestream_resources
92 }
93 pub fn iam_resources(mut self, input: crate::types::IamResources) -> Self {
96 self.iam_resources = ::std::option::Option::Some(input);
97 self
98 }
99 pub fn set_iam_resources(mut self, input: ::std::option::Option<crate::types::IamResources>) -> Self {
101 self.iam_resources = input;
102 self
103 }
104 pub fn get_iam_resources(&self) -> &::std::option::Option<crate::types::IamResources> {
106 &self.iam_resources
107 }
108 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 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 pub fn get_creation_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
121 &self.creation_time
122 }
123 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 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 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 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}