aws_sdk_iotsitewise/operation/update_asset_model_composite_model/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_asset_model_composite_model::_update_asset_model_composite_model_output::UpdateAssetModelCompositeModelOutputBuilder;
3
4pub use crate::operation::update_asset_model_composite_model::_update_asset_model_composite_model_input::UpdateAssetModelCompositeModelInputBuilder;
5
6impl crate::operation::update_asset_model_composite_model::builders::UpdateAssetModelCompositeModelInputBuilder {
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::update_asset_model_composite_model::UpdateAssetModelCompositeModelOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_asset_model_composite_model::UpdateAssetModelCompositeModelError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_asset_model_composite_model();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateAssetModelCompositeModel`.
24///
25/// <p>Updates a composite model and all of the assets that were created from the model. Each asset created from the model inherits the updated asset model's property and hierarchy definitions. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/update-assets-and-models.html">Updating assets and models</a> in the <i>IoT SiteWise User Guide</i>.</p><important>
26/// <p>If you remove a property from a composite asset model, IoT SiteWise deletes all previous data for that property. You can’t change the type or data type of an existing property.</p>
27/// <p>To replace an existing composite asset model property with a new one with the same <code>name</code>, do the following:</p>
28/// <ol>
29/// <li>
30/// <p>Submit an <code>UpdateAssetModelCompositeModel</code> request with the entire existing property removed.</p></li>
31/// <li>
32/// <p>Submit a second <code>UpdateAssetModelCompositeModel</code> request that includes the new property. The new asset property will have the same <code>name</code> as the previous one and IoT SiteWise will generate a new unique <code>id</code>.</p></li>
33/// </ol>
34/// </important>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct UpdateAssetModelCompositeModelFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::update_asset_model_composite_model::builders::UpdateAssetModelCompositeModelInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::update_asset_model_composite_model::UpdateAssetModelCompositeModelOutput,
44        crate::operation::update_asset_model_composite_model::UpdateAssetModelCompositeModelError,
45    > for UpdateAssetModelCompositeModelFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::update_asset_model_composite_model::UpdateAssetModelCompositeModelOutput,
53            crate::operation::update_asset_model_composite_model::UpdateAssetModelCompositeModelError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl UpdateAssetModelCompositeModelFluentBuilder {
60    /// Creates a new `UpdateAssetModelCompositeModelFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the UpdateAssetModelCompositeModel as a reference.
69    pub fn as_input(&self) -> &crate::operation::update_asset_model_composite_model::builders::UpdateAssetModelCompositeModelInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::update_asset_model_composite_model::UpdateAssetModelCompositeModelOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::update_asset_model_composite_model::UpdateAssetModelCompositeModelError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::update_asset_model_composite_model::UpdateAssetModelCompositeModel::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::update_asset_model_composite_model::UpdateAssetModelCompositeModel::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::update_asset_model_composite_model::UpdateAssetModelCompositeModelOutput,
106        crate::operation::update_asset_model_composite_model::UpdateAssetModelCompositeModelError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>The ID of the asset model, in UUID format.</p>
121    pub fn asset_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.asset_model_id(input.into());
123        self
124    }
125    /// <p>The ID of the asset model, in UUID format.</p>
126    pub fn set_asset_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_asset_model_id(input);
128        self
129    }
130    /// <p>The ID of the asset model, in UUID format.</p>
131    pub fn get_asset_model_id(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_asset_model_id()
133    }
134    /// <p>The ID of a composite model on this asset model.</p>
135    pub fn asset_model_composite_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.asset_model_composite_model_id(input.into());
137        self
138    }
139    /// <p>The ID of a composite model on this asset model.</p>
140    pub fn set_asset_model_composite_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.inner = self.inner.set_asset_model_composite_model_id(input);
142        self
143    }
144    /// <p>The ID of a composite model on this asset model.</p>
145    pub fn get_asset_model_composite_model_id(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_asset_model_composite_model_id()
147    }
148    /// <p>An external ID to assign to the asset model. You can only set the external ID of the asset model if it wasn't set when it was created, or you're setting it to the exact same thing as when it was created.</p>
149    pub fn asset_model_composite_model_external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.inner = self.inner.asset_model_composite_model_external_id(input.into());
151        self
152    }
153    /// <p>An external ID to assign to the asset model. You can only set the external ID of the asset model if it wasn't set when it was created, or you're setting it to the exact same thing as when it was created.</p>
154    pub fn set_asset_model_composite_model_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.inner = self.inner.set_asset_model_composite_model_external_id(input);
156        self
157    }
158    /// <p>An external ID to assign to the asset model. You can only set the external ID of the asset model if it wasn't set when it was created, or you're setting it to the exact same thing as when it was created.</p>
159    pub fn get_asset_model_composite_model_external_id(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_asset_model_composite_model_external_id()
161    }
162    /// <p>A description for the composite model.</p>
163    pub fn asset_model_composite_model_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.inner = self.inner.asset_model_composite_model_description(input.into());
165        self
166    }
167    /// <p>A description for the composite model.</p>
168    pub fn set_asset_model_composite_model_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169        self.inner = self.inner.set_asset_model_composite_model_description(input);
170        self
171    }
172    /// <p>A description for the composite model.</p>
173    pub fn get_asset_model_composite_model_description(&self) -> &::std::option::Option<::std::string::String> {
174        self.inner.get_asset_model_composite_model_description()
175    }
176    /// <p>A unique name for the composite model.</p>
177    pub fn asset_model_composite_model_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.inner = self.inner.asset_model_composite_model_name(input.into());
179        self
180    }
181    /// <p>A unique name for the composite model.</p>
182    pub fn set_asset_model_composite_model_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.inner = self.inner.set_asset_model_composite_model_name(input);
184        self
185    }
186    /// <p>A unique name for the composite model.</p>
187    pub fn get_asset_model_composite_model_name(&self) -> &::std::option::Option<::std::string::String> {
188        self.inner.get_asset_model_composite_model_name()
189    }
190    /// <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>
191    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.inner = self.inner.client_token(input.into());
193        self
194    }
195    /// <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>
196    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.inner = self.inner.set_client_token(input);
198        self
199    }
200    /// <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>
201    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
202        self.inner.get_client_token()
203    }
204    ///
205    /// Appends an item to `assetModelCompositeModelProperties`.
206    ///
207    /// To override the contents of this collection use [`set_asset_model_composite_model_properties`](Self::set_asset_model_composite_model_properties).
208    ///
209    /// <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>
210    /// <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>
211    pub fn asset_model_composite_model_properties(mut self, input: crate::types::AssetModelProperty) -> Self {
212        self.inner = self.inner.asset_model_composite_model_properties(input);
213        self
214    }
215    /// <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>
216    /// <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>
217    pub fn set_asset_model_composite_model_properties(
218        mut self,
219        input: ::std::option::Option<::std::vec::Vec<crate::types::AssetModelProperty>>,
220    ) -> Self {
221        self.inner = self.inner.set_asset_model_composite_model_properties(input);
222        self
223    }
224    /// <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>
225    /// <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>
226    pub fn get_asset_model_composite_model_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetModelProperty>> {
227        self.inner.get_asset_model_composite_model_properties()
228    }
229    /// <p>The expected current entity tag (ETag) for the asset model’s latest or active version (specified using <code>matchForVersionType</code>). The update 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>
230    pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231        self.inner = self.inner.if_match(input.into());
232        self
233    }
234    /// <p>The expected current entity tag (ETag) for the asset model’s latest or active version (specified using <code>matchForVersionType</code>). The update 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>
235    pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236        self.inner = self.inner.set_if_match(input);
237        self
238    }
239    /// <p>The expected current entity tag (ETag) for the asset model’s latest or active version (specified using <code>matchForVersionType</code>). The update 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>
240    pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
241        self.inner.get_if_match()
242    }
243    /// <p>Accepts <b>*</b> to reject the update request if an active version (specified using <code>matchForVersionType</code> as <code>ACTIVE</code>) already exists for the asset model.</p>
244    pub fn if_none_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
245        self.inner = self.inner.if_none_match(input.into());
246        self
247    }
248    /// <p>Accepts <b>*</b> to reject the update request if an active version (specified using <code>matchForVersionType</code> as <code>ACTIVE</code>) already exists for the asset model.</p>
249    pub fn set_if_none_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
250        self.inner = self.inner.set_if_none_match(input);
251        self
252    }
253    /// <p>Accepts <b>*</b> to reject the update request if an active version (specified using <code>matchForVersionType</code> as <code>ACTIVE</code>) already exists for the asset model.</p>
254    pub fn get_if_none_match(&self) -> &::std::option::Option<::std::string::String> {
255        self.inner.get_if_none_match()
256    }
257    /// <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 update operation.</p>
258    pub fn match_for_version_type(mut self, input: crate::types::AssetModelVersionType) -> Self {
259        self.inner = self.inner.match_for_version_type(input);
260        self
261    }
262    /// <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 update operation.</p>
263    pub fn set_match_for_version_type(mut self, input: ::std::option::Option<crate::types::AssetModelVersionType>) -> Self {
264        self.inner = self.inner.set_match_for_version_type(input);
265        self
266    }
267    /// <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 update operation.</p>
268    pub fn get_match_for_version_type(&self) -> &::std::option::Option<crate::types::AssetModelVersionType> {
269        self.inner.get_match_for_version_type()
270    }
271}