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
// 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 CreateAssetModelCompositeModelOutput {
/// <p>The ID of the composed asset model. You can use this ID when you call other IoT SiteWise APIs.</p>
pub asset_model_composite_model_id: ::std::string::String,
/// <p>The path to the composite model listing the parent composite models.</p>
pub asset_model_composite_model_path: ::std::vec::Vec<crate::types::AssetModelCompositeModelPathSegment>,
/// <p>Contains current status information for an asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-and-model-states.html">Asset and model states</a> in the <i>IoT SiteWise User Guide</i>.</p>
pub asset_model_status: ::std::option::Option<crate::types::AssetModelStatus>,
_request_id: Option<String>,
}
impl CreateAssetModelCompositeModelOutput {
/// <p>The ID of the composed asset model. You can use this ID when you call other IoT SiteWise APIs.</p>
pub fn asset_model_composite_model_id(&self) -> &str {
use std::ops::Deref;
self.asset_model_composite_model_id.deref()
}
/// <p>The path to the composite model listing the parent composite models.</p>
pub fn asset_model_composite_model_path(&self) -> &[crate::types::AssetModelCompositeModelPathSegment] {
use std::ops::Deref;
self.asset_model_composite_model_path.deref()
}
/// <p>Contains current status information for an asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-and-model-states.html">Asset and model states</a> in the <i>IoT SiteWise User Guide</i>.</p>
pub fn asset_model_status(&self) -> ::std::option::Option<&crate::types::AssetModelStatus> {
self.asset_model_status.as_ref()
}
}
impl ::aws_types::request_id::RequestId for CreateAssetModelCompositeModelOutput {
fn request_id(&self) -> Option<&str> {
self._request_id.as_deref()
}
}
impl CreateAssetModelCompositeModelOutput {
/// Creates a new builder-style object to manufacture [`CreateAssetModelCompositeModelOutput`](crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelOutput).
pub fn builder() -> crate::operation::create_asset_model_composite_model::builders::CreateAssetModelCompositeModelOutputBuilder {
crate::operation::create_asset_model_composite_model::builders::CreateAssetModelCompositeModelOutputBuilder::default()
}
}
/// A builder for [`CreateAssetModelCompositeModelOutput`](crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelOutput).
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CreateAssetModelCompositeModelOutputBuilder {
pub(crate) asset_model_composite_model_id: ::std::option::Option<::std::string::String>,
pub(crate) asset_model_composite_model_path: ::std::option::Option<::std::vec::Vec<crate::types::AssetModelCompositeModelPathSegment>>,
pub(crate) asset_model_status: ::std::option::Option<crate::types::AssetModelStatus>,
_request_id: Option<String>,
}
impl CreateAssetModelCompositeModelOutputBuilder {
/// <p>The ID of the composed asset model. You can use this ID when you call other IoT SiteWise APIs.</p>
/// This field is required.
pub fn asset_model_composite_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.asset_model_composite_model_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The ID of the composed asset model. You can use this ID when you call other IoT SiteWise APIs.</p>
pub fn set_asset_model_composite_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.asset_model_composite_model_id = input;
self
}
/// <p>The ID of the composed asset model. You can use this ID when you call other IoT SiteWise APIs.</p>
pub fn get_asset_model_composite_model_id(&self) -> &::std::option::Option<::std::string::String> {
&self.asset_model_composite_model_id
}
/// Appends an item to `asset_model_composite_model_path`.
///
/// To override the contents of this collection use [`set_asset_model_composite_model_path`](Self::set_asset_model_composite_model_path).
///
/// <p>The path to the composite model listing the parent composite models.</p>
pub fn asset_model_composite_model_path(mut self, input: crate::types::AssetModelCompositeModelPathSegment) -> Self {
let mut v = self.asset_model_composite_model_path.unwrap_or_default();
v.push(input);
self.asset_model_composite_model_path = ::std::option::Option::Some(v);
self
}
/// <p>The path to the composite model listing the parent composite models.</p>
pub fn set_asset_model_composite_model_path(
mut self,
input: ::std::option::Option<::std::vec::Vec<crate::types::AssetModelCompositeModelPathSegment>>,
) -> Self {
self.asset_model_composite_model_path = input;
self
}
/// <p>The path to the composite model listing the parent composite models.</p>
pub fn get_asset_model_composite_model_path(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetModelCompositeModelPathSegment>> {
&self.asset_model_composite_model_path
}
/// <p>Contains current status information for an asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-and-model-states.html">Asset and model states</a> in the <i>IoT SiteWise User Guide</i>.</p>
/// This field is required.
pub fn asset_model_status(mut self, input: crate::types::AssetModelStatus) -> Self {
self.asset_model_status = ::std::option::Option::Some(input);
self
}
/// <p>Contains current status information for an asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-and-model-states.html">Asset and model states</a> in the <i>IoT SiteWise User Guide</i>.</p>
pub fn set_asset_model_status(mut self, input: ::std::option::Option<crate::types::AssetModelStatus>) -> Self {
self.asset_model_status = input;
self
}
/// <p>Contains current status information for an asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-and-model-states.html">Asset and model states</a> in the <i>IoT SiteWise User Guide</i>.</p>
pub fn get_asset_model_status(&self) -> &::std::option::Option<crate::types::AssetModelStatus> {
&self.asset_model_status
}
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 [`CreateAssetModelCompositeModelOutput`](crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelOutput).
/// This method will fail if any of the following fields are not set:
/// - [`asset_model_composite_model_id`](crate::operation::create_asset_model_composite_model::builders::CreateAssetModelCompositeModelOutputBuilder::asset_model_composite_model_id)
/// - [`asset_model_composite_model_path`](crate::operation::create_asset_model_composite_model::builders::CreateAssetModelCompositeModelOutputBuilder::asset_model_composite_model_path)
pub fn build(
self,
) -> ::std::result::Result<
crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelOutput,
::aws_smithy_types::error::operation::BuildError,
> {
::std::result::Result::Ok(
crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelOutput {
asset_model_composite_model_id: self.asset_model_composite_model_id.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"asset_model_composite_model_id",
"asset_model_composite_model_id was not specified but it is required when building CreateAssetModelCompositeModelOutput",
)
})?,
asset_model_composite_model_path: self.asset_model_composite_model_path.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"asset_model_composite_model_path",
"asset_model_composite_model_path was not specified but it is required when building CreateAssetModelCompositeModelOutput",
)
})?,
asset_model_status: self.asset_model_status,
_request_id: self._request_id,
},
)
}
}