aws_sdk_iotsitewise/operation/update_asset_model/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_asset_model::_update_asset_model_output::UpdateAssetModelOutputBuilder;
3
4pub use crate::operation::update_asset_model::_update_asset_model_input::UpdateAssetModelInputBuilder;
5
6impl crate::operation::update_asset_model::builders::UpdateAssetModelInputBuilder {
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::UpdateAssetModelOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_asset_model::UpdateAssetModelError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_asset_model();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateAssetModel`.
24///
25/// <p>Updates an asset 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 an 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 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>UpdateAssetModel</code> request with the entire existing property removed.</p></li>
31/// <li>
32/// <p>Submit a second <code>UpdateAssetModel</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 UpdateAssetModelFluentBuilder {
37 handle: ::std::sync::Arc<crate::client::Handle>,
38 inner: crate::operation::update_asset_model::builders::UpdateAssetModelInputBuilder,
39 config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42 crate::client::customize::internal::CustomizableSend<
43 crate::operation::update_asset_model::UpdateAssetModelOutput,
44 crate::operation::update_asset_model::UpdateAssetModelError,
45 > for UpdateAssetModelFluentBuilder
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::UpdateAssetModelOutput,
53 crate::operation::update_asset_model::UpdateAssetModelError,
54 >,
55 > {
56 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57 }
58}
59impl UpdateAssetModelFluentBuilder {
60 /// Creates a new `UpdateAssetModelFluentBuilder`.
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 UpdateAssetModel as a reference.
69 pub fn as_input(&self) -> &crate::operation::update_asset_model::builders::UpdateAssetModelInputBuilder {
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::UpdateAssetModelOutput,
84 ::aws_smithy_runtime_api::client::result::SdkError<
85 crate::operation::update_asset_model::UpdateAssetModelError,
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::UpdateAssetModel::operation_runtime_plugins(
94 self.handle.runtime_plugins.clone(),
95 &self.handle.conf,
96 self.config_override,
97 );
98 crate::operation::update_asset_model::UpdateAssetModel::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::UpdateAssetModelOutput,
106 crate::operation::update_asset_model::UpdateAssetModelError,
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 to update. This can be either the actual ID in UUID format, or else <code>externalId:</code> followed by the external ID, if it has one. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references">Referencing objects with external IDs</a> in the <i>IoT SiteWise User Guide</i>.</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 to update. This can be either the actual ID in UUID format, or else <code>externalId:</code> followed by the external ID, if it has one. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references">Referencing objects with external IDs</a> in the <i>IoT SiteWise User Guide</i>.</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 to update. This can be either the actual ID in UUID format, or else <code>externalId:</code> followed by the external ID, if it has one. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-id-references">Referencing objects with external IDs</a> in the <i>IoT SiteWise User Guide</i>.</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>An external ID to assign to the asset model. The asset model must not already have an external ID. The external ID must be unique within your Amazon Web Services account. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids">Using external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
135 pub fn asset_model_external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136 self.inner = self.inner.asset_model_external_id(input.into());
137 self
138 }
139 /// <p>An external ID to assign to the asset model. The asset model must not already have an external ID. The external ID must be unique within your Amazon Web Services account. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids">Using external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
140 pub fn set_asset_model_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141 self.inner = self.inner.set_asset_model_external_id(input);
142 self
143 }
144 /// <p>An external ID to assign to the asset model. The asset model must not already have an external ID. The external ID must be unique within your Amazon Web Services account. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/object-ids.html#external-ids">Using external IDs</a> in the <i>IoT SiteWise User Guide</i>.</p>
145 pub fn get_asset_model_external_id(&self) -> &::std::option::Option<::std::string::String> {
146 self.inner.get_asset_model_external_id()
147 }
148 /// <p>A unique name for the asset model.</p>
149 pub fn asset_model_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150 self.inner = self.inner.asset_model_name(input.into());
151 self
152 }
153 /// <p>A unique name for the asset model.</p>
154 pub fn set_asset_model_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155 self.inner = self.inner.set_asset_model_name(input);
156 self
157 }
158 /// <p>A unique name for the asset model.</p>
159 pub fn get_asset_model_name(&self) -> &::std::option::Option<::std::string::String> {
160 self.inner.get_asset_model_name()
161 }
162 /// <p>A description for the asset model.</p>
163 pub fn asset_model_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164 self.inner = self.inner.asset_model_description(input.into());
165 self
166 }
167 /// <p>A description for the asset model.</p>
168 pub fn set_asset_model_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169 self.inner = self.inner.set_asset_model_description(input);
170 self
171 }
172 /// <p>A description for the asset model.</p>
173 pub fn get_asset_model_description(&self) -> &::std::option::Option<::std::string::String> {
174 self.inner.get_asset_model_description()
175 }
176 ///
177 /// Appends an item to `assetModelProperties`.
178 ///
179 /// To override the contents of this collection use [`set_asset_model_properties`](Self::set_asset_model_properties).
180 ///
181 /// <p>The updated property definitions of the asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-properties.html">Asset properties</a> in the <i>IoT SiteWise User Guide</i>.</p>
182 /// <p>You can specify up to 200 properties per asset 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>
183 pub fn asset_model_properties(mut self, input: crate::types::AssetModelProperty) -> Self {
184 self.inner = self.inner.asset_model_properties(input);
185 self
186 }
187 /// <p>The updated property definitions of the asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-properties.html">Asset properties</a> in the <i>IoT SiteWise User Guide</i>.</p>
188 /// <p>You can specify up to 200 properties per asset 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>
189 pub fn set_asset_model_properties(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssetModelProperty>>) -> Self {
190 self.inner = self.inner.set_asset_model_properties(input);
191 self
192 }
193 /// <p>The updated property definitions of the asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-properties.html">Asset properties</a> in the <i>IoT SiteWise User Guide</i>.</p>
194 /// <p>You can specify up to 200 properties per asset 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>
195 pub fn get_asset_model_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetModelProperty>> {
196 self.inner.get_asset_model_properties()
197 }
198 ///
199 /// Appends an item to `assetModelHierarchies`.
200 ///
201 /// To override the contents of this collection use [`set_asset_model_hierarchies`](Self::set_asset_model_hierarchies).
202 ///
203 /// <p>The updated hierarchy definitions of the asset model. Each hierarchy specifies an asset model whose assets can be children of any other assets created from this asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html">Asset hierarchies</a> in the <i>IoT SiteWise User Guide</i>.</p>
204 /// <p>You can specify up to 10 hierarchies per asset 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>
205 pub fn asset_model_hierarchies(mut self, input: crate::types::AssetModelHierarchy) -> Self {
206 self.inner = self.inner.asset_model_hierarchies(input);
207 self
208 }
209 /// <p>The updated hierarchy definitions of the asset model. Each hierarchy specifies an asset model whose assets can be children of any other assets created from this asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html">Asset hierarchies</a> in the <i>IoT SiteWise User Guide</i>.</p>
210 /// <p>You can specify up to 10 hierarchies per asset 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 set_asset_model_hierarchies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssetModelHierarchy>>) -> Self {
212 self.inner = self.inner.set_asset_model_hierarchies(input);
213 self
214 }
215 /// <p>The updated hierarchy definitions of the asset model. Each hierarchy specifies an asset model whose assets can be children of any other assets created from this asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/asset-hierarchies.html">Asset hierarchies</a> in the <i>IoT SiteWise User Guide</i>.</p>
216 /// <p>You can specify up to 10 hierarchies per asset 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 get_asset_model_hierarchies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetModelHierarchy>> {
218 self.inner.get_asset_model_hierarchies()
219 }
220 ///
221 /// Appends an item to `assetModelCompositeModels`.
222 ///
223 /// To override the contents of this collection use [`set_asset_model_composite_models`](Self::set_asset_model_composite_models).
224 ///
225 /// <p>The composite models that are part of this asset model. It groups properties (such as attributes, measurements, transforms, and metrics) and child composite models that model parts of your industrial equipment. Each composite model has a type that defines the properties that the composite model supports. Use composite models to define alarms on this asset model.</p><note>
226 /// <p>When creating custom composite models, you need to use <a href="https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_CreateAssetModelCompositeModel.html">CreateAssetModelCompositeModel</a>. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/create-custom-composite-models.html">Creating custom composite models (Components)</a> in the <i>IoT SiteWise User Guide</i>.</p>
227 /// </note>
228 pub fn asset_model_composite_models(mut self, input: crate::types::AssetModelCompositeModel) -> Self {
229 self.inner = self.inner.asset_model_composite_models(input);
230 self
231 }
232 /// <p>The composite models that are part of this asset model. It groups properties (such as attributes, measurements, transforms, and metrics) and child composite models that model parts of your industrial equipment. Each composite model has a type that defines the properties that the composite model supports. Use composite models to define alarms on this asset model.</p><note>
233 /// <p>When creating custom composite models, you need to use <a href="https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_CreateAssetModelCompositeModel.html">CreateAssetModelCompositeModel</a>. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/create-custom-composite-models.html">Creating custom composite models (Components)</a> in the <i>IoT SiteWise User Guide</i>.</p>
234 /// </note>
235 pub fn set_asset_model_composite_models(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssetModelCompositeModel>>) -> Self {
236 self.inner = self.inner.set_asset_model_composite_models(input);
237 self
238 }
239 /// <p>The composite models that are part of this asset model. It groups properties (such as attributes, measurements, transforms, and metrics) and child composite models that model parts of your industrial equipment. Each composite model has a type that defines the properties that the composite model supports. Use composite models to define alarms on this asset model.</p><note>
240 /// <p>When creating custom composite models, you need to use <a href="https://docs.aws.amazon.com/iot-sitewise/latest/APIReference/API_CreateAssetModelCompositeModel.html">CreateAssetModelCompositeModel</a>. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/create-custom-composite-models.html">Creating custom composite models (Components)</a> in the <i>IoT SiteWise User Guide</i>.</p>
241 /// </note>
242 pub fn get_asset_model_composite_models(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetModelCompositeModel>> {
243 self.inner.get_asset_model_composite_models()
244 }
245 /// <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>
246 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
247 self.inner = self.inner.client_token(input.into());
248 self
249 }
250 /// <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>
251 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
252 self.inner = self.inner.set_client_token(input);
253 self
254 }
255 /// <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>
256 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
257 self.inner.get_client_token()
258 }
259 /// <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>
260 pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
261 self.inner = self.inner.if_match(input.into());
262 self
263 }
264 /// <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>
265 pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
266 self.inner = self.inner.set_if_match(input);
267 self
268 }
269 /// <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>
270 pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
271 self.inner.get_if_match()
272 }
273 /// <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>
274 pub fn if_none_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
275 self.inner = self.inner.if_none_match(input.into());
276 self
277 }
278 /// <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>
279 pub fn set_if_none_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
280 self.inner = self.inner.set_if_none_match(input);
281 self
282 }
283 /// <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>
284 pub fn get_if_none_match(&self) -> &::std::option::Option<::std::string::String> {
285 self.inner.get_if_none_match()
286 }
287 /// <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>
288 pub fn match_for_version_type(mut self, input: crate::types::AssetModelVersionType) -> Self {
289 self.inner = self.inner.match_for_version_type(input);
290 self
291 }
292 /// <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>
293 pub fn set_match_for_version_type(mut self, input: ::std::option::Option<crate::types::AssetModelVersionType>) -> Self {
294 self.inner = self.inner.set_match_for_version_type(input);
295 self
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 update operation.</p>
298 pub fn get_match_for_version_type(&self) -> &::std::option::Option<crate::types::AssetModelVersionType> {
299 self.inner.get_match_for_version_type()
300 }
301}