aws_sdk_iotsitewise/operation/describe_asset/
_describe_asset_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DescribeAssetOutput {
6 pub asset_id: ::std::string::String,
8 pub asset_external_id: ::std::option::Option<::std::string::String>,
10 pub asset_arn: ::std::string::String,
13 pub asset_name: ::std::string::String,
15 pub asset_model_id: ::std::string::String,
17 pub asset_properties: ::std::vec::Vec<crate::types::AssetProperty>,
20 pub asset_hierarchies: ::std::vec::Vec<crate::types::AssetHierarchy>,
22 pub asset_composite_models: ::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModel>>,
24 pub asset_creation_date: ::aws_smithy_types::DateTime,
26 pub asset_last_update_date: ::aws_smithy_types::DateTime,
28 pub asset_status: ::std::option::Option<crate::types::AssetStatus>,
30 pub asset_description: ::std::option::Option<::std::string::String>,
32 pub asset_composite_model_summaries: ::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModelSummary>>,
34 _request_id: Option<String>,
35}
36impl DescribeAssetOutput {
37 pub fn asset_id(&self) -> &str {
39 use std::ops::Deref;
40 self.asset_id.deref()
41 }
42 pub fn asset_external_id(&self) -> ::std::option::Option<&str> {
44 self.asset_external_id.as_deref()
45 }
46 pub fn asset_arn(&self) -> &str {
49 use std::ops::Deref;
50 self.asset_arn.deref()
51 }
52 pub fn asset_name(&self) -> &str {
54 use std::ops::Deref;
55 self.asset_name.deref()
56 }
57 pub fn asset_model_id(&self) -> &str {
59 use std::ops::Deref;
60 self.asset_model_id.deref()
61 }
62 pub fn asset_properties(&self) -> &[crate::types::AssetProperty] {
65 use std::ops::Deref;
66 self.asset_properties.deref()
67 }
68 pub fn asset_hierarchies(&self) -> &[crate::types::AssetHierarchy] {
70 use std::ops::Deref;
71 self.asset_hierarchies.deref()
72 }
73 pub fn asset_composite_models(&self) -> &[crate::types::AssetCompositeModel] {
77 self.asset_composite_models.as_deref().unwrap_or_default()
78 }
79 pub fn asset_creation_date(&self) -> &::aws_smithy_types::DateTime {
81 &self.asset_creation_date
82 }
83 pub fn asset_last_update_date(&self) -> &::aws_smithy_types::DateTime {
85 &self.asset_last_update_date
86 }
87 pub fn asset_status(&self) -> ::std::option::Option<&crate::types::AssetStatus> {
89 self.asset_status.as_ref()
90 }
91 pub fn asset_description(&self) -> ::std::option::Option<&str> {
93 self.asset_description.as_deref()
94 }
95 pub fn asset_composite_model_summaries(&self) -> &[crate::types::AssetCompositeModelSummary] {
99 self.asset_composite_model_summaries.as_deref().unwrap_or_default()
100 }
101}
102impl ::aws_types::request_id::RequestId for DescribeAssetOutput {
103 fn request_id(&self) -> Option<&str> {
104 self._request_id.as_deref()
105 }
106}
107impl DescribeAssetOutput {
108 pub fn builder() -> crate::operation::describe_asset::builders::DescribeAssetOutputBuilder {
110 crate::operation::describe_asset::builders::DescribeAssetOutputBuilder::default()
111 }
112}
113
114#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
116#[non_exhaustive]
117pub struct DescribeAssetOutputBuilder {
118 pub(crate) asset_id: ::std::option::Option<::std::string::String>,
119 pub(crate) asset_external_id: ::std::option::Option<::std::string::String>,
120 pub(crate) asset_arn: ::std::option::Option<::std::string::String>,
121 pub(crate) asset_name: ::std::option::Option<::std::string::String>,
122 pub(crate) asset_model_id: ::std::option::Option<::std::string::String>,
123 pub(crate) asset_properties: ::std::option::Option<::std::vec::Vec<crate::types::AssetProperty>>,
124 pub(crate) asset_hierarchies: ::std::option::Option<::std::vec::Vec<crate::types::AssetHierarchy>>,
125 pub(crate) asset_composite_models: ::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModel>>,
126 pub(crate) asset_creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
127 pub(crate) asset_last_update_date: ::std::option::Option<::aws_smithy_types::DateTime>,
128 pub(crate) asset_status: ::std::option::Option<crate::types::AssetStatus>,
129 pub(crate) asset_description: ::std::option::Option<::std::string::String>,
130 pub(crate) asset_composite_model_summaries: ::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModelSummary>>,
131 _request_id: Option<String>,
132}
133impl DescribeAssetOutputBuilder {
134 pub fn asset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137 self.asset_id = ::std::option::Option::Some(input.into());
138 self
139 }
140 pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142 self.asset_id = input;
143 self
144 }
145 pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
147 &self.asset_id
148 }
149 pub fn asset_external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151 self.asset_external_id = ::std::option::Option::Some(input.into());
152 self
153 }
154 pub fn set_asset_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156 self.asset_external_id = input;
157 self
158 }
159 pub fn get_asset_external_id(&self) -> &::std::option::Option<::std::string::String> {
161 &self.asset_external_id
162 }
163 pub fn asset_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167 self.asset_arn = ::std::option::Option::Some(input.into());
168 self
169 }
170 pub fn set_asset_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173 self.asset_arn = input;
174 self
175 }
176 pub fn get_asset_arn(&self) -> &::std::option::Option<::std::string::String> {
179 &self.asset_arn
180 }
181 pub fn asset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184 self.asset_name = ::std::option::Option::Some(input.into());
185 self
186 }
187 pub fn set_asset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189 self.asset_name = input;
190 self
191 }
192 pub fn get_asset_name(&self) -> &::std::option::Option<::std::string::String> {
194 &self.asset_name
195 }
196 pub fn asset_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
199 self.asset_model_id = ::std::option::Option::Some(input.into());
200 self
201 }
202 pub fn set_asset_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
204 self.asset_model_id = input;
205 self
206 }
207 pub fn get_asset_model_id(&self) -> &::std::option::Option<::std::string::String> {
209 &self.asset_model_id
210 }
211 pub fn asset_properties(mut self, input: crate::types::AssetProperty) -> Self {
218 let mut v = self.asset_properties.unwrap_or_default();
219 v.push(input);
220 self.asset_properties = ::std::option::Option::Some(v);
221 self
222 }
223 pub fn set_asset_properties(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssetProperty>>) -> Self {
226 self.asset_properties = input;
227 self
228 }
229 pub fn get_asset_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetProperty>> {
232 &self.asset_properties
233 }
234 pub fn asset_hierarchies(mut self, input: crate::types::AssetHierarchy) -> Self {
240 let mut v = self.asset_hierarchies.unwrap_or_default();
241 v.push(input);
242 self.asset_hierarchies = ::std::option::Option::Some(v);
243 self
244 }
245 pub fn set_asset_hierarchies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssetHierarchy>>) -> Self {
247 self.asset_hierarchies = input;
248 self
249 }
250 pub fn get_asset_hierarchies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetHierarchy>> {
252 &self.asset_hierarchies
253 }
254 pub fn asset_composite_models(mut self, input: crate::types::AssetCompositeModel) -> Self {
260 let mut v = self.asset_composite_models.unwrap_or_default();
261 v.push(input);
262 self.asset_composite_models = ::std::option::Option::Some(v);
263 self
264 }
265 pub fn set_asset_composite_models(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModel>>) -> Self {
267 self.asset_composite_models = input;
268 self
269 }
270 pub fn get_asset_composite_models(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModel>> {
272 &self.asset_composite_models
273 }
274 pub fn asset_creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
277 self.asset_creation_date = ::std::option::Option::Some(input);
278 self
279 }
280 pub fn set_asset_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
282 self.asset_creation_date = input;
283 self
284 }
285 pub fn get_asset_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
287 &self.asset_creation_date
288 }
289 pub fn asset_last_update_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
292 self.asset_last_update_date = ::std::option::Option::Some(input);
293 self
294 }
295 pub fn set_asset_last_update_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
297 self.asset_last_update_date = input;
298 self
299 }
300 pub fn get_asset_last_update_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
302 &self.asset_last_update_date
303 }
304 pub fn asset_status(mut self, input: crate::types::AssetStatus) -> Self {
307 self.asset_status = ::std::option::Option::Some(input);
308 self
309 }
310 pub fn set_asset_status(mut self, input: ::std::option::Option<crate::types::AssetStatus>) -> Self {
312 self.asset_status = input;
313 self
314 }
315 pub fn get_asset_status(&self) -> &::std::option::Option<crate::types::AssetStatus> {
317 &self.asset_status
318 }
319 pub fn asset_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
321 self.asset_description = ::std::option::Option::Some(input.into());
322 self
323 }
324 pub fn set_asset_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
326 self.asset_description = input;
327 self
328 }
329 pub fn get_asset_description(&self) -> &::std::option::Option<::std::string::String> {
331 &self.asset_description
332 }
333 pub fn asset_composite_model_summaries(mut self, input: crate::types::AssetCompositeModelSummary) -> Self {
339 let mut v = self.asset_composite_model_summaries.unwrap_or_default();
340 v.push(input);
341 self.asset_composite_model_summaries = ::std::option::Option::Some(v);
342 self
343 }
344 pub fn set_asset_composite_model_summaries(
346 mut self,
347 input: ::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModelSummary>>,
348 ) -> Self {
349 self.asset_composite_model_summaries = input;
350 self
351 }
352 pub fn get_asset_composite_model_summaries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModelSummary>> {
354 &self.asset_composite_model_summaries
355 }
356 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
357 self._request_id = Some(request_id.into());
358 self
359 }
360
361 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
362 self._request_id = request_id;
363 self
364 }
365 pub fn build(
376 self,
377 ) -> ::std::result::Result<crate::operation::describe_asset::DescribeAssetOutput, ::aws_smithy_types::error::operation::BuildError> {
378 ::std::result::Result::Ok(crate::operation::describe_asset::DescribeAssetOutput {
379 asset_id: self.asset_id.ok_or_else(|| {
380 ::aws_smithy_types::error::operation::BuildError::missing_field(
381 "asset_id",
382 "asset_id was not specified but it is required when building DescribeAssetOutput",
383 )
384 })?,
385 asset_external_id: self.asset_external_id,
386 asset_arn: self.asset_arn.ok_or_else(|| {
387 ::aws_smithy_types::error::operation::BuildError::missing_field(
388 "asset_arn",
389 "asset_arn was not specified but it is required when building DescribeAssetOutput",
390 )
391 })?,
392 asset_name: self.asset_name.ok_or_else(|| {
393 ::aws_smithy_types::error::operation::BuildError::missing_field(
394 "asset_name",
395 "asset_name was not specified but it is required when building DescribeAssetOutput",
396 )
397 })?,
398 asset_model_id: self.asset_model_id.ok_or_else(|| {
399 ::aws_smithy_types::error::operation::BuildError::missing_field(
400 "asset_model_id",
401 "asset_model_id was not specified but it is required when building DescribeAssetOutput",
402 )
403 })?,
404 asset_properties: self.asset_properties.ok_or_else(|| {
405 ::aws_smithy_types::error::operation::BuildError::missing_field(
406 "asset_properties",
407 "asset_properties was not specified but it is required when building DescribeAssetOutput",
408 )
409 })?,
410 asset_hierarchies: self.asset_hierarchies.ok_or_else(|| {
411 ::aws_smithy_types::error::operation::BuildError::missing_field(
412 "asset_hierarchies",
413 "asset_hierarchies was not specified but it is required when building DescribeAssetOutput",
414 )
415 })?,
416 asset_composite_models: self.asset_composite_models,
417 asset_creation_date: self.asset_creation_date.ok_or_else(|| {
418 ::aws_smithy_types::error::operation::BuildError::missing_field(
419 "asset_creation_date",
420 "asset_creation_date was not specified but it is required when building DescribeAssetOutput",
421 )
422 })?,
423 asset_last_update_date: self.asset_last_update_date.ok_or_else(|| {
424 ::aws_smithy_types::error::operation::BuildError::missing_field(
425 "asset_last_update_date",
426 "asset_last_update_date was not specified but it is required when building DescribeAssetOutput",
427 )
428 })?,
429 asset_status: self.asset_status,
430 asset_description: self.asset_description,
431 asset_composite_model_summaries: self.asset_composite_model_summaries,
432 _request_id: self._request_id,
433 })
434 }
435}