1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct DescribeAssetOutput {
/// <p>The ID of the asset, in UUID format.</p>
pub asset_id: ::std::string::String,
/// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the asset, which has the following format.</p>
/// <p> <code>arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId}</code> </p>
pub asset_arn: ::std::string::String,
/// <p>The name of the asset.</p>
pub asset_name: ::std::string::String,
/// <p>The ID of the asset model that was used to create the asset.</p>
pub asset_model_id: ::std::string::String,
/// <p>The list of asset properties for the asset.</p>
/// <p>This object doesn't include properties that you define in composite models. You can find composite model properties in the <code>assetCompositeModels</code> object.</p>
pub asset_properties: ::std::vec::Vec<crate::types::AssetProperty>,
/// <p>A list of asset hierarchies that each contain a <code>hierarchyId</code>. A hierarchy specifies allowed parent/child asset relationships.</p>
pub asset_hierarchies: ::std::vec::Vec<crate::types::AssetHierarchy>,
/// <p>The composite models for the asset.</p>
pub asset_composite_models: ::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModel>>,
/// <p>The date the asset was created, in Unix epoch time.</p>
pub asset_creation_date: ::aws_smithy_types::DateTime,
/// <p>The date the asset was last updated, in Unix epoch time.</p>
pub asset_last_update_date: ::aws_smithy_types::DateTime,
/// <p>The current status of the asset, which contains a state and any error message.</p>
pub asset_status: ::std::option::Option<crate::types::AssetStatus>,
/// <p>A description for the asset.</p>
pub asset_description: ::std::option::Option<::std::string::String>,
/// <p>The list of the immediate child custom composite model summaries for the asset.</p>
pub asset_composite_model_summaries: ::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModelSummary>>,
/// <p>The external ID of the asset, if any.</p>
pub asset_external_id: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl DescribeAssetOutput {
/// <p>The ID of the asset, in UUID format.</p>
pub fn asset_id(&self) -> &str {
use std::ops::Deref;
self.asset_id.deref()
}
/// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the asset, which has the following format.</p>
/// <p> <code>arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId}</code> </p>
pub fn asset_arn(&self) -> &str {
use std::ops::Deref;
self.asset_arn.deref()
}
/// <p>The name of the asset.</p>
pub fn asset_name(&self) -> &str {
use std::ops::Deref;
self.asset_name.deref()
}
/// <p>The ID of the asset model that was used to create the asset.</p>
pub fn asset_model_id(&self) -> &str {
use std::ops::Deref;
self.asset_model_id.deref()
}
/// <p>The list of asset properties for the asset.</p>
/// <p>This object doesn't include properties that you define in composite models. You can find composite model properties in the <code>assetCompositeModels</code> object.</p>
pub fn asset_properties(&self) -> &[crate::types::AssetProperty] {
use std::ops::Deref;
self.asset_properties.deref()
}
/// <p>A list of asset hierarchies that each contain a <code>hierarchyId</code>. A hierarchy specifies allowed parent/child asset relationships.</p>
pub fn asset_hierarchies(&self) -> &[crate::types::AssetHierarchy] {
use std::ops::Deref;
self.asset_hierarchies.deref()
}
/// <p>The composite models for the asset.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.asset_composite_models.is_none()`.
pub fn asset_composite_models(&self) -> &[crate::types::AssetCompositeModel] {
self.asset_composite_models.as_deref().unwrap_or_default()
}
/// <p>The date the asset was created, in Unix epoch time.</p>
pub fn asset_creation_date(&self) -> &::aws_smithy_types::DateTime {
&self.asset_creation_date
}
/// <p>The date the asset was last updated, in Unix epoch time.</p>
pub fn asset_last_update_date(&self) -> &::aws_smithy_types::DateTime {
&self.asset_last_update_date
}
/// <p>The current status of the asset, which contains a state and any error message.</p>
pub fn asset_status(&self) -> ::std::option::Option<&crate::types::AssetStatus> {
self.asset_status.as_ref()
}
/// <p>A description for the asset.</p>
pub fn asset_description(&self) -> ::std::option::Option<&str> {
self.asset_description.as_deref()
}
/// <p>The list of the immediate child custom composite model summaries for the asset.</p>
///
/// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.asset_composite_model_summaries.is_none()`.
pub fn asset_composite_model_summaries(&self) -> &[crate::types::AssetCompositeModelSummary] {
self.asset_composite_model_summaries.as_deref().unwrap_or_default()
}
/// <p>The external ID of the asset, if any.</p>
pub fn asset_external_id(&self) -> ::std::option::Option<&str> {
self.asset_external_id.as_deref()
}
}
impl ::aws_types::request_id::RequestId for DescribeAssetOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl DescribeAssetOutput {
/// Creates a new builder-style object to manufacture [`DescribeAssetOutput`](crate::operation::describe_asset::DescribeAssetOutput).
pub fn builder() -> crate::operation::describe_asset::builders::DescribeAssetOutputBuilder {
crate::operation::describe_asset::builders::DescribeAssetOutputBuilder::default()
}
}
/// A builder for [`DescribeAssetOutput`](crate::operation::describe_asset::DescribeAssetOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct DescribeAssetOutputBuilder {
pub(crate) asset_id: ::std::option::Option<::std::string::String>,
pub(crate) asset_arn: ::std::option::Option<::std::string::String>,
pub(crate) asset_name: ::std::option::Option<::std::string::String>,
pub(crate) asset_model_id: ::std::option::Option<::std::string::String>,
pub(crate) asset_properties: ::std::option::Option<::std::vec::Vec<crate::types::AssetProperty>>,
pub(crate) asset_hierarchies: ::std::option::Option<::std::vec::Vec<crate::types::AssetHierarchy>>,
pub(crate) asset_composite_models: ::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModel>>,
pub(crate) asset_creation_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) asset_last_update_date: ::std::option::Option<::aws_smithy_types::DateTime>,
pub(crate) asset_status: ::std::option::Option<crate::types::AssetStatus>,
pub(crate) asset_description: ::std::option::Option<::std::string::String>,
pub(crate) asset_composite_model_summaries: ::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModelSummary>>,
pub(crate) asset_external_id: ::std::option::Option<::std::string::String>,
_request_id: Option<String>,
}
impl DescribeAssetOutputBuilder {
/// <p>The ID of the asset, in UUID format.</p>
/// This field is required.
pub fn asset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.asset_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the asset, in UUID format.</p>
pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.asset_id = input;
self
}
/// <p>The ID of the asset, in UUID format.</p>
pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
&self.asset_id
}
/// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the asset, which has the following format.</p>
/// <p> <code>arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId}</code> </p>
/// This field is required.
pub fn asset_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.asset_arn = ::std::option::Option::Some(input.into());
self
}
/// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the asset, which has the following format.</p>
/// <p> <code>arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId}</code> </p>
pub fn set_asset_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.asset_arn = input;
self
}
/// <p>The <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">ARN</a> of the asset, which has the following format.</p>
/// <p> <code>arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId}</code> </p>
pub fn get_asset_arn(&self) -> &::std::option::Option<::std::string::String> {
&self.asset_arn
}
/// <p>The name of the asset.</p>
/// This field is required.
pub fn asset_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.asset_name = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the asset.</p>
pub fn set_asset_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.asset_name = input;
self
}
/// <p>The name of the asset.</p>
pub fn get_asset_name(&self) -> &::std::option::Option<::std::string::String> {
&self.asset_name
}
/// <p>The ID of the asset model that was used to create the asset.</p>
/// This field is required.
pub fn asset_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.asset_model_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the asset model that was used to create the asset.</p>
pub fn set_asset_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.asset_model_id = input;
self
}
/// <p>The ID of the asset model that was used to create the asset.</p>
pub fn get_asset_model_id(&self) -> &::std::option::Option<::std::string::String> {
&self.asset_model_id
}
/// Appends an item to `asset_properties`.
///
/// To override the contents of this collection use [`set_asset_properties`](Self::set_asset_properties).
///
/// <p>The list of asset properties for the asset.</p>
/// <p>This object doesn't include properties that you define in composite models. You can find composite model properties in the <code>assetCompositeModels</code> object.</p>
pub fn asset_properties(mut self, input: crate::types::AssetProperty) -> Self {
let mut v = self.asset_properties.unwrap_or_default();
v.push(input);
self.asset_properties = ::std::option::Option::Some(v);
self
}
/// <p>The list of asset properties for the asset.</p>
/// <p>This object doesn't include properties that you define in composite models. You can find composite model properties in the <code>assetCompositeModels</code> object.</p>
pub fn set_asset_properties(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssetProperty>>) -> Self {
self.asset_properties = input;
self
}
/// <p>The list of asset properties for the asset.</p>
/// <p>This object doesn't include properties that you define in composite models. You can find composite model properties in the <code>assetCompositeModels</code> object.</p>
pub fn get_asset_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetProperty>> {
&self.asset_properties
}
/// Appends an item to `asset_hierarchies`.
///
/// To override the contents of this collection use [`set_asset_hierarchies`](Self::set_asset_hierarchies).
///
/// <p>A list of asset hierarchies that each contain a <code>hierarchyId</code>. A hierarchy specifies allowed parent/child asset relationships.</p>
pub fn asset_hierarchies(mut self, input: crate::types::AssetHierarchy) -> Self {
let mut v = self.asset_hierarchies.unwrap_or_default();
v.push(input);
self.asset_hierarchies = ::std::option::Option::Some(v);
self
}
/// <p>A list of asset hierarchies that each contain a <code>hierarchyId</code>. A hierarchy specifies allowed parent/child asset relationships.</p>
pub fn set_asset_hierarchies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssetHierarchy>>) -> Self {
self.asset_hierarchies = input;
self
}
/// <p>A list of asset hierarchies that each contain a <code>hierarchyId</code>. A hierarchy specifies allowed parent/child asset relationships.</p>
pub fn get_asset_hierarchies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetHierarchy>> {
&self.asset_hierarchies
}
/// Appends an item to `asset_composite_models`.
///
/// To override the contents of this collection use [`set_asset_composite_models`](Self::set_asset_composite_models).
///
/// <p>The composite models for the asset.</p>
pub fn asset_composite_models(mut self, input: crate::types::AssetCompositeModel) -> Self {
let mut v = self.asset_composite_models.unwrap_or_default();
v.push(input);
self.asset_composite_models = ::std::option::Option::Some(v);
self
}
/// <p>The composite models for the asset.</p>
pub fn set_asset_composite_models(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModel>>) -> Self {
self.asset_composite_models = input;
self
}
/// <p>The composite models for the asset.</p>
pub fn get_asset_composite_models(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModel>> {
&self.asset_composite_models
}
/// <p>The date the asset was created, in Unix epoch time.</p>
/// This field is required.
pub fn asset_creation_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.asset_creation_date = ::std::option::Option::Some(input);
self
}
/// <p>The date the asset was created, in Unix epoch time.</p>
pub fn set_asset_creation_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.asset_creation_date = input;
self
}
/// <p>The date the asset was created, in Unix epoch time.</p>
pub fn get_asset_creation_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.asset_creation_date
}
/// <p>The date the asset was last updated, in Unix epoch time.</p>
/// This field is required.
pub fn asset_last_update_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.asset_last_update_date = ::std::option::Option::Some(input);
self
}
/// <p>The date the asset was last updated, in Unix epoch time.</p>
pub fn set_asset_last_update_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.asset_last_update_date = input;
self
}
/// <p>The date the asset was last updated, in Unix epoch time.</p>
pub fn get_asset_last_update_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
&self.asset_last_update_date
}
/// <p>The current status of the asset, which contains a state and any error message.</p>
/// This field is required.
pub fn asset_status(mut self, input: crate::types::AssetStatus) -> Self {
self.asset_status = ::std::option::Option::Some(input);
self
}
/// <p>The current status of the asset, which contains a state and any error message.</p>
pub fn set_asset_status(mut self, input: ::std::option::Option<crate::types::AssetStatus>) -> Self {
self.asset_status = input;
self
}
/// <p>The current status of the asset, which contains a state and any error message.</p>
pub fn get_asset_status(&self) -> &::std::option::Option<crate::types::AssetStatus> {
&self.asset_status
}
/// <p>A description for the asset.</p>
pub fn asset_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.asset_description = ::std::option::Option::Some(input.into());
self
}
/// <p>A description for the asset.</p>
pub fn set_asset_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.asset_description = input;
self
}
/// <p>A description for the asset.</p>
pub fn get_asset_description(&self) -> &::std::option::Option<::std::string::String> {
&self.asset_description
}
/// Appends an item to `asset_composite_model_summaries`.
///
/// To override the contents of this collection use [`set_asset_composite_model_summaries`](Self::set_asset_composite_model_summaries).
///
/// <p>The list of the immediate child custom composite model summaries for the asset.</p>
pub fn asset_composite_model_summaries(mut self, input: crate::types::AssetCompositeModelSummary) -> Self {
let mut v = self.asset_composite_model_summaries.unwrap_or_default();
v.push(input);
self.asset_composite_model_summaries = ::std::option::Option::Some(v);
self
}
/// <p>The list of the immediate child custom composite model summaries for the asset.</p>
pub fn set_asset_composite_model_summaries(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModelSummary>>,
) -> Self {
self.asset_composite_model_summaries = input;
self
}
/// <p>The list of the immediate child custom composite model summaries for the asset.</p>
pub fn get_asset_composite_model_summaries(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetCompositeModelSummary>> {
&self.asset_composite_model_summaries
}
/// <p>The external ID of the asset, if any.</p>
pub fn asset_external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.asset_external_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The external ID of the asset, if any.</p>
pub fn set_asset_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.asset_external_id = input;
self
}
/// <p>The external ID of the asset, if any.</p>
pub fn get_asset_external_id(&self) -> &::std::option::Option<::std::string::String> {
&self.asset_external_id
}
pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
self._request_id = Some(request_id.into());
self
}
pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
self._request_id = request_id;
self
}
/// Consumes the builder and constructs a [`DescribeAssetOutput`](crate::operation::describe_asset::DescribeAssetOutput).
/// This method will fail if any of the following fields are not set:
/// - [`asset_id`](crate::operation::describe_asset::builders::DescribeAssetOutputBuilder::asset_id)
/// - [`asset_arn`](crate::operation::describe_asset::builders::DescribeAssetOutputBuilder::asset_arn)
/// - [`asset_name`](crate::operation::describe_asset::builders::DescribeAssetOutputBuilder::asset_name)
/// - [`asset_model_id`](crate::operation::describe_asset::builders::DescribeAssetOutputBuilder::asset_model_id)
/// - [`asset_properties`](crate::operation::describe_asset::builders::DescribeAssetOutputBuilder::asset_properties)
/// - [`asset_hierarchies`](crate::operation::describe_asset::builders::DescribeAssetOutputBuilder::asset_hierarchies)
/// - [`asset_creation_date`](crate::operation::describe_asset::builders::DescribeAssetOutputBuilder::asset_creation_date)
/// - [`asset_last_update_date`](crate::operation::describe_asset::builders::DescribeAssetOutputBuilder::asset_last_update_date)
pub fn build(
self,
) -> ::std::result::Result<crate::operation::describe_asset::DescribeAssetOutput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::describe_asset::DescribeAssetOutput {
asset_id: self.asset_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"asset_id",
"asset_id was not specified but it is required when building DescribeAssetOutput",
)
})?,
asset_arn: self.asset_arn.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"asset_arn",
"asset_arn was not specified but it is required when building DescribeAssetOutput",
)
})?,
asset_name: self.asset_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"asset_name",
"asset_name was not specified but it is required when building DescribeAssetOutput",
)
})?,
asset_model_id: self.asset_model_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"asset_model_id",
"asset_model_id was not specified but it is required when building DescribeAssetOutput",
)
})?,
asset_properties: self.asset_properties.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"asset_properties",
"asset_properties was not specified but it is required when building DescribeAssetOutput",
)
})?,
asset_hierarchies: self.asset_hierarchies.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"asset_hierarchies",
"asset_hierarchies was not specified but it is required when building DescribeAssetOutput",
)
})?,
asset_composite_models: self.asset_composite_models,
asset_creation_date: self.asset_creation_date.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"asset_creation_date",
"asset_creation_date was not specified but it is required when building DescribeAssetOutput",
)
})?,
asset_last_update_date: self.asset_last_update_date.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"asset_last_update_date",
"asset_last_update_date was not specified but it is required when building DescribeAssetOutput",
)
})?,
asset_status: self.asset_status,
asset_description: self.asset_description,
asset_composite_model_summaries: self.asset_composite_model_summaries,
asset_external_id: self.asset_external_id,
_request_id: self._request_id,
})
}
}