aws_sdk_iotsitewise/operation/create_asset_model_composite_model/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_asset_model_composite_model::_create_asset_model_composite_model_output::CreateAssetModelCompositeModelOutputBuilder;
3
4pub use crate::operation::create_asset_model_composite_model::_create_asset_model_composite_model_input::CreateAssetModelCompositeModelInputBuilder;
5
6impl crate::operation::create_asset_model_composite_model::builders::CreateAssetModelCompositeModelInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_asset_model_composite_model();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateAssetModelCompositeModel`.
24///
25/// <p>Creates a custom composite model from specified property and hierarchy definitions. There are two types of custom composite models, <code>inline</code> and <code>component-model-based</code>.</p>
26/// <p>Use component-model-based custom composite models to define standard, reusable components. A component-model-based custom composite model consists of a name, a description, and the ID of the component model it references. A component-model-based custom composite model has no properties of its own; its referenced component model provides its associated properties to any created assets. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/custom-composite-models.html">Custom composite models (Components)</a> in the <i>IoT SiteWise User Guide</i>.</p>
27/// <p>Use inline custom composite models to organize the properties of an asset model. The properties of inline custom composite models are local to the asset model where they are included and can't be used to create multiple assets.</p>
28/// <p>To create a component-model-based model, specify the <code>composedAssetModelId</code> of an existing asset model with <code>assetModelType</code> of <code>COMPONENT_MODEL</code>.</p>
29/// <p>To create an inline model, specify the <code>assetModelCompositeModelProperties</code> and don't include an <code>composedAssetModelId</code>.</p>
30#[derive(::std::clone::Clone, ::std::fmt::Debug)]
31pub struct CreateAssetModelCompositeModelFluentBuilder {
32    handle: ::std::sync::Arc<crate::client::Handle>,
33    inner: crate::operation::create_asset_model_composite_model::builders::CreateAssetModelCompositeModelInputBuilder,
34    config_override: ::std::option::Option<crate::config::Builder>,
35}
36impl
37    crate::client::customize::internal::CustomizableSend<
38        crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelOutput,
39        crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelError,
40    > for CreateAssetModelCompositeModelFluentBuilder
41{
42    fn send(
43        self,
44        config_override: crate::config::Builder,
45    ) -> crate::client::customize::internal::BoxFuture<
46        crate::client::customize::internal::SendResult<
47            crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelOutput,
48            crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelError,
49        >,
50    > {
51        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
52    }
53}
54impl CreateAssetModelCompositeModelFluentBuilder {
55    /// Creates a new `CreateAssetModelCompositeModelFluentBuilder`.
56    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
57        Self {
58            handle,
59            inner: ::std::default::Default::default(),
60            config_override: ::std::option::Option::None,
61        }
62    }
63    /// Access the CreateAssetModelCompositeModel as a reference.
64    pub fn as_input(&self) -> &crate::operation::create_asset_model_composite_model::builders::CreateAssetModelCompositeModelInputBuilder {
65        &self.inner
66    }
67    /// Sends the request and returns the response.
68    ///
69    /// If an error occurs, an `SdkError` will be returned with additional details that
70    /// can be matched against.
71    ///
72    /// By default, any retryable failures will be retried twice. Retry behavior
73    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
74    /// set when configuring the client.
75    pub async fn send(
76        self,
77    ) -> ::std::result::Result<
78        crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelOutput,
79        ::aws_smithy_runtime_api::client::result::SdkError<
80            crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelError,
81            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
82        >,
83    > {
84        let input = self
85            .inner
86            .build()
87            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
88        let runtime_plugins = crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModel::operation_runtime_plugins(
89            self.handle.runtime_plugins.clone(),
90            &self.handle.conf,
91            self.config_override,
92        );
93        crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModel::orchestrate(&runtime_plugins, input).await
94    }
95
96    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
97    pub fn customize(
98        self,
99    ) -> crate::client::customize::CustomizableOperation<
100        crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelOutput,
101        crate::operation::create_asset_model_composite_model::CreateAssetModelCompositeModelError,
102        Self,
103    > {
104        crate::client::customize::CustomizableOperation::new(self)
105    }
106    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
107        self.set_config_override(::std::option::Option::Some(config_override.into()));
108        self
109    }
110
111    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
112        self.config_override = config_override;
113        self
114    }
115    /// <p>The ID of the asset model this composite model is a part of.</p>
116    pub fn asset_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117        self.inner = self.inner.asset_model_id(input.into());
118        self
119    }
120    /// <p>The ID of the asset model this composite model is a part of.</p>
121    pub fn set_asset_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.inner = self.inner.set_asset_model_id(input);
123        self
124    }
125    /// <p>The ID of the asset model this composite model is a part of.</p>
126    pub fn get_asset_model_id(&self) -> &::std::option::Option<::std::string::String> {
127        self.inner.get_asset_model_id()
128    }
129    /// <p>An external ID to assign to the composite model.</p>
130    /// <p>If the composite model is a derived composite model, or one nested inside a component model, you can only set the external ID using <code>UpdateAssetModelCompositeModel</code> and specifying the derived ID of the model or property from the created model it's a part of.</p>
131    pub fn asset_model_composite_model_external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.asset_model_composite_model_external_id(input.into());
133        self
134    }
135    /// <p>An external ID to assign to the composite model.</p>
136    /// <p>If the composite model is a derived composite model, or one nested inside a component model, you can only set the external ID using <code>UpdateAssetModelCompositeModel</code> and specifying the derived ID of the model or property from the created model it's a part of.</p>
137    pub fn set_asset_model_composite_model_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.inner = self.inner.set_asset_model_composite_model_external_id(input);
139        self
140    }
141    /// <p>An external ID to assign to the composite model.</p>
142    /// <p>If the composite model is a derived composite model, or one nested inside a component model, you can only set the external ID using <code>UpdateAssetModelCompositeModel</code> and specifying the derived ID of the model or property from the created model it's a part of.</p>
143    pub fn get_asset_model_composite_model_external_id(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_asset_model_composite_model_external_id()
145    }
146    /// <p>The ID of the parent composite model in this asset model relationship.</p>
147    pub fn parent_asset_model_composite_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.parent_asset_model_composite_model_id(input.into());
149        self
150    }
151    /// <p>The ID of the parent composite model in this asset model relationship.</p>
152    pub fn set_parent_asset_model_composite_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.inner = self.inner.set_parent_asset_model_composite_model_id(input);
154        self
155    }
156    /// <p>The ID of the parent composite model in this asset model relationship.</p>
157    pub fn get_parent_asset_model_composite_model_id(&self) -> &::std::option::Option<::std::string::String> {
158        self.inner.get_parent_asset_model_composite_model_id()
159    }
160    /// <p>The ID of the composite model. IoT SiteWise automatically generates a unique ID for you, so this parameter is never required. However, if you prefer to supply your own ID instead, you can specify it here in UUID format. If you specify your own ID, it must be globally unique.</p>
161    pub fn asset_model_composite_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.inner = self.inner.asset_model_composite_model_id(input.into());
163        self
164    }
165    /// <p>The ID of the composite model. IoT SiteWise automatically generates a unique ID for you, so this parameter is never required. However, if you prefer to supply your own ID instead, you can specify it here in UUID format. If you specify your own ID, it must be globally unique.</p>
166    pub fn set_asset_model_composite_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.inner = self.inner.set_asset_model_composite_model_id(input);
168        self
169    }
170    /// <p>The ID of the composite model. IoT SiteWise automatically generates a unique ID for you, so this parameter is never required. However, if you prefer to supply your own ID instead, you can specify it here in UUID format. If you specify your own ID, it must be globally unique.</p>
171    pub fn get_asset_model_composite_model_id(&self) -> &::std::option::Option<::std::string::String> {
172        self.inner.get_asset_model_composite_model_id()
173    }
174    /// <p>A description for the composite model.</p>
175    pub fn asset_model_composite_model_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.inner = self.inner.asset_model_composite_model_description(input.into());
177        self
178    }
179    /// <p>A description for the composite model.</p>
180    pub fn set_asset_model_composite_model_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.inner = self.inner.set_asset_model_composite_model_description(input);
182        self
183    }
184    /// <p>A description for the composite model.</p>
185    pub fn get_asset_model_composite_model_description(&self) -> &::std::option::Option<::std::string::String> {
186        self.inner.get_asset_model_composite_model_description()
187    }
188    /// <p>A unique name for the composite model.</p>
189    pub fn asset_model_composite_model_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190        self.inner = self.inner.asset_model_composite_model_name(input.into());
191        self
192    }
193    /// <p>A unique name for the composite model.</p>
194    pub fn set_asset_model_composite_model_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195        self.inner = self.inner.set_asset_model_composite_model_name(input);
196        self
197    }
198    /// <p>A unique name for the composite model.</p>
199    pub fn get_asset_model_composite_model_name(&self) -> &::std::option::Option<::std::string::String> {
200        self.inner.get_asset_model_composite_model_name()
201    }
202    /// <p>The composite model type. Valid values are <code>AWS/ALARM</code>, <code>CUSTOM</code>, or <code> AWS/L4E_ANOMALY</code>.</p>
203    pub fn asset_model_composite_model_type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204        self.inner = self.inner.asset_model_composite_model_type(input.into());
205        self
206    }
207    /// <p>The composite model type. Valid values are <code>AWS/ALARM</code>, <code>CUSTOM</code>, or <code> AWS/L4E_ANOMALY</code>.</p>
208    pub fn set_asset_model_composite_model_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209        self.inner = self.inner.set_asset_model_composite_model_type(input);
210        self
211    }
212    /// <p>The composite model type. Valid values are <code>AWS/ALARM</code>, <code>CUSTOM</code>, or <code> AWS/L4E_ANOMALY</code>.</p>
213    pub fn get_asset_model_composite_model_type(&self) -> &::std::option::Option<::std::string::String> {
214        self.inner.get_asset_model_composite_model_type()
215    }
216    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
217    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
218        self.inner = self.inner.client_token(input.into());
219        self
220    }
221    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
222    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
223        self.inner = self.inner.set_client_token(input);
224        self
225    }
226    /// <p>A unique case-sensitive identifier that you can provide to ensure the idempotency of the request. Don't reuse this client token if a new idempotent request is required.</p>
227    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
228        self.inner.get_client_token()
229    }
230    /// <p>The ID of a component model which is reused to create this composite model.</p>
231    pub fn composed_asset_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232        self.inner = self.inner.composed_asset_model_id(input.into());
233        self
234    }
235    /// <p>The ID of a component model which is reused to create this composite model.</p>
236    pub fn set_composed_asset_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
237        self.inner = self.inner.set_composed_asset_model_id(input);
238        self
239    }
240    /// <p>The ID of a component model which is reused to create this composite model.</p>
241    pub fn get_composed_asset_model_id(&self) -> &::std::option::Option<::std::string::String> {
242        self.inner.get_composed_asset_model_id()
243    }
244    ///
245    /// Appends an item to `assetModelCompositeModelProperties`.
246    ///
247    /// To override the contents of this collection use [`set_asset_model_composite_model_properties`](Self::set_asset_model_composite_model_properties).
248    ///
249    /// <p>The property definitions of the composite model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/custom-composite-models.html#inline-composite-models"> Inline custom composite models</a> in the <i>IoT SiteWise User Guide</i>.</p>
250    /// <p>You can specify up to 200 properties per composite model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html">Quotas</a> in the <i>IoT SiteWise User Guide</i>.</p>
251    pub fn asset_model_composite_model_properties(mut self, input: crate::types::AssetModelPropertyDefinition) -> Self {
252        self.inner = self.inner.asset_model_composite_model_properties(input);
253        self
254    }
255    /// <p>The property definitions of the composite model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/custom-composite-models.html#inline-composite-models"> Inline custom composite models</a> in the <i>IoT SiteWise User Guide</i>.</p>
256    /// <p>You can specify up to 200 properties per composite model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html">Quotas</a> in the <i>IoT SiteWise User Guide</i>.</p>
257    pub fn set_asset_model_composite_model_properties(
258        mut self,
259        input: ::std::option::Option<::std::vec::Vec<crate::types::AssetModelPropertyDefinition>>,
260    ) -> Self {
261        self.inner = self.inner.set_asset_model_composite_model_properties(input);
262        self
263    }
264    /// <p>The property definitions of the composite model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/custom-composite-models.html#inline-composite-models"> Inline custom composite models</a> in the <i>IoT SiteWise User Guide</i>.</p>
265    /// <p>You can specify up to 200 properties per composite model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/quotas.html">Quotas</a> in the <i>IoT SiteWise User Guide</i>.</p>
266    pub fn get_asset_model_composite_model_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetModelPropertyDefinition>> {
267        self.inner.get_asset_model_composite_model_properties()
268    }
269    /// <p>The expected current entity tag (ETag) for the asset model’s latest or active version (specified using <code>matchForVersionType</code>). The create request is rejected if the tag does not match the latest or active version's current entity tag. See <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/opt-locking-for-model.html">Optimistic locking for asset model writes</a> in the <i>IoT SiteWise User Guide</i>.</p>
270    pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
271        self.inner = self.inner.if_match(input.into());
272        self
273    }
274    /// <p>The expected current entity tag (ETag) for the asset model’s latest or active version (specified using <code>matchForVersionType</code>). The create request is rejected if the tag does not match the latest or active version's current entity tag. See <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/opt-locking-for-model.html">Optimistic locking for asset model writes</a> in the <i>IoT SiteWise User Guide</i>.</p>
275    pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
276        self.inner = self.inner.set_if_match(input);
277        self
278    }
279    /// <p>The expected current entity tag (ETag) for the asset model’s latest or active version (specified using <code>matchForVersionType</code>). The create request is rejected if the tag does not match the latest or active version's current entity tag. See <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/opt-locking-for-model.html">Optimistic locking for asset model writes</a> in the <i>IoT SiteWise User Guide</i>.</p>
280    pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
281        self.inner.get_if_match()
282    }
283    /// <p>Accepts <b>*</b> to reject the create request if an active version (specified using <code>matchForVersionType</code> as <code>ACTIVE</code>) already exists for the asset model.</p>
284    pub fn if_none_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
285        self.inner = self.inner.if_none_match(input.into());
286        self
287    }
288    /// <p>Accepts <b>*</b> to reject the create request if an active version (specified using <code>matchForVersionType</code> as <code>ACTIVE</code>) already exists for the asset model.</p>
289    pub fn set_if_none_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
290        self.inner = self.inner.set_if_none_match(input);
291        self
292    }
293    /// <p>Accepts <b>*</b> to reject the create request if an active version (specified using <code>matchForVersionType</code> as <code>ACTIVE</code>) already exists for the asset model.</p>
294    pub fn get_if_none_match(&self) -> &::std::option::Option<::std::string::String> {
295        self.inner.get_if_none_match()
296    }
297    /// <p>Specifies the asset model version type (<code>LATEST</code> or <code>ACTIVE</code>) used in conjunction with <code>If-Match</code> or <code>If-None-Match</code> headers to determine the target ETag for the create operation.</p>
298    pub fn match_for_version_type(mut self, input: crate::types::AssetModelVersionType) -> Self {
299        self.inner = self.inner.match_for_version_type(input);
300        self
301    }
302    /// <p>Specifies the asset model version type (<code>LATEST</code> or <code>ACTIVE</code>) used in conjunction with <code>If-Match</code> or <code>If-None-Match</code> headers to determine the target ETag for the create operation.</p>
303    pub fn set_match_for_version_type(mut self, input: ::std::option::Option<crate::types::AssetModelVersionType>) -> Self {
304        self.inner = self.inner.set_match_for_version_type(input);
305        self
306    }
307    /// <p>Specifies the asset model version type (<code>LATEST</code> or <code>ACTIVE</code>) used in conjunction with <code>If-Match</code> or <code>If-None-Match</code> headers to determine the target ETag for the create operation.</p>
308    pub fn get_match_for_version_type(&self) -> &::std::option::Option<crate::types::AssetModelVersionType> {
309        self.inner.get_match_for_version_type()
310    }
311}