aws_sdk_iotsitewise/operation/create_asset_model/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_asset_model::_create_asset_model_output::CreateAssetModelOutputBuilder;
3
4pub use crate::operation::create_asset_model::_create_asset_model_input::CreateAssetModelInputBuilder;
5
6impl crate::operation::create_asset_model::builders::CreateAssetModelInputBuilder {
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::CreateAssetModelOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::create_asset_model::CreateAssetModelError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.create_asset_model();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `CreateAssetModel`.
24///
25/// <p>Creates an asset model from specified property and hierarchy definitions. You create assets from asset models. With asset models, you can easily create assets of the same type that have standardized definitions. Each asset created from a model inherits the asset model's property and hierarchy definitions. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/define-models.html">Defining asset models</a> in the <i>IoT SiteWise User Guide</i>.</p>
26/// <p>You can create three types of asset models, <code>ASSET_MODEL</code>, <code>COMPONENT_MODEL</code>, or an <code>INTERFACE</code>.</p>
27/// <ul>
28/// <li>
29/// <p><b>ASSET_MODEL</b> – (default) An asset model that you can use to create assets. Can't be included as a component in another asset model.</p></li>
30/// <li>
31/// <p><b>COMPONENT_MODEL</b> – A reusable component that you can include in the composite models of other asset models. You can't create assets directly from this type of asset model.</p></li>
32/// <li>
33/// <p><b>INTERFACE</b> – An interface is a type of model that defines a standard structure that can be applied to different asset models.</p></li>
34/// </ul>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct CreateAssetModelFluentBuilder {
37 handle: ::std::sync::Arc<crate::client::Handle>,
38 inner: crate::operation::create_asset_model::builders::CreateAssetModelInputBuilder,
39 config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42 crate::client::customize::internal::CustomizableSend<
43 crate::operation::create_asset_model::CreateAssetModelOutput,
44 crate::operation::create_asset_model::CreateAssetModelError,
45 > for CreateAssetModelFluentBuilder
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::create_asset_model::CreateAssetModelOutput,
53 crate::operation::create_asset_model::CreateAssetModelError,
54 >,
55 > {
56 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57 }
58}
59impl CreateAssetModelFluentBuilder {
60 /// Creates a new `CreateAssetModelFluentBuilder`.
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 CreateAssetModel as a reference.
69 pub fn as_input(&self) -> &crate::operation::create_asset_model::builders::CreateAssetModelInputBuilder {
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::create_asset_model::CreateAssetModelOutput,
84 ::aws_smithy_runtime_api::client::result::SdkError<
85 crate::operation::create_asset_model::CreateAssetModelError,
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::create_asset_model::CreateAssetModel::operation_runtime_plugins(
94 self.handle.runtime_plugins.clone(),
95 &self.handle.conf,
96 self.config_override,
97 );
98 crate::operation::create_asset_model::CreateAssetModel::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::create_asset_model::CreateAssetModelOutput,
106 crate::operation::create_asset_model::CreateAssetModelError,
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>A unique name for the asset model.</p>
121 pub fn asset_model_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122 self.inner = self.inner.asset_model_name(input.into());
123 self
124 }
125 /// <p>A unique name for the asset model.</p>
126 pub fn set_asset_model_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127 self.inner = self.inner.set_asset_model_name(input);
128 self
129 }
130 /// <p>A unique name for the asset model.</p>
131 pub fn get_asset_model_name(&self) -> &::std::option::Option<::std::string::String> {
132 self.inner.get_asset_model_name()
133 }
134 /// <p>The type of asset model.</p>
135 /// <ul>
136 /// <li>
137 /// <p><b>ASSET_MODEL</b> – (default) An asset model that you can use to create assets. Can't be included as a component in another asset model.</p></li>
138 /// <li>
139 /// <p><b>COMPONENT_MODEL</b> – A reusable component that you can include in the composite models of other asset models. You can't create assets directly from this type of asset model.</p></li>
140 /// </ul>
141 pub fn asset_model_type(mut self, input: crate::types::AssetModelType) -> Self {
142 self.inner = self.inner.asset_model_type(input);
143 self
144 }
145 /// <p>The type of asset model.</p>
146 /// <ul>
147 /// <li>
148 /// <p><b>ASSET_MODEL</b> – (default) An asset model that you can use to create assets. Can't be included as a component in another asset model.</p></li>
149 /// <li>
150 /// <p><b>COMPONENT_MODEL</b> – A reusable component that you can include in the composite models of other asset models. You can't create assets directly from this type of asset model.</p></li>
151 /// </ul>
152 pub fn set_asset_model_type(mut self, input: ::std::option::Option<crate::types::AssetModelType>) -> Self {
153 self.inner = self.inner.set_asset_model_type(input);
154 self
155 }
156 /// <p>The type of asset model.</p>
157 /// <ul>
158 /// <li>
159 /// <p><b>ASSET_MODEL</b> – (default) An asset model that you can use to create assets. Can't be included as a component in another asset model.</p></li>
160 /// <li>
161 /// <p><b>COMPONENT_MODEL</b> – A reusable component that you can include in the composite models of other asset models. You can't create assets directly from this type of asset model.</p></li>
162 /// </ul>
163 pub fn get_asset_model_type(&self) -> &::std::option::Option<crate::types::AssetModelType> {
164 self.inner.get_asset_model_type()
165 }
166 /// <p>The ID to assign to the asset model, if desired. 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>
167 pub fn asset_model_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
168 self.inner = self.inner.asset_model_id(input.into());
169 self
170 }
171 /// <p>The ID to assign to the asset model, if desired. 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>
172 pub fn set_asset_model_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
173 self.inner = self.inner.set_asset_model_id(input);
174 self
175 }
176 /// <p>The ID to assign to the asset model, if desired. 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>
177 pub fn get_asset_model_id(&self) -> &::std::option::Option<::std::string::String> {
178 self.inner.get_asset_model_id()
179 }
180 /// <p>An external ID to assign to the asset model. 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>
181 pub fn asset_model_external_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
182 self.inner = self.inner.asset_model_external_id(input.into());
183 self
184 }
185 /// <p>An external ID to assign to the asset model. 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>
186 pub fn set_asset_model_external_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
187 self.inner = self.inner.set_asset_model_external_id(input);
188 self
189 }
190 /// <p>An external ID to assign to the asset model. 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>
191 pub fn get_asset_model_external_id(&self) -> &::std::option::Option<::std::string::String> {
192 self.inner.get_asset_model_external_id()
193 }
194 /// <p>A description for the asset model.</p>
195 pub fn asset_model_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
196 self.inner = self.inner.asset_model_description(input.into());
197 self
198 }
199 /// <p>A description for the asset model.</p>
200 pub fn set_asset_model_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
201 self.inner = self.inner.set_asset_model_description(input);
202 self
203 }
204 /// <p>A description for the asset model.</p>
205 pub fn get_asset_model_description(&self) -> &::std::option::Option<::std::string::String> {
206 self.inner.get_asset_model_description()
207 }
208 ///
209 /// Appends an item to `assetModelProperties`.
210 ///
211 /// To override the contents of this collection use [`set_asset_model_properties`](Self::set_asset_model_properties).
212 ///
213 /// <p>The 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>
214 /// <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>
215 pub fn asset_model_properties(mut self, input: crate::types::AssetModelPropertyDefinition) -> Self {
216 self.inner = self.inner.asset_model_properties(input);
217 self
218 }
219 /// <p>The 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>
220 /// <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>
221 pub fn set_asset_model_properties(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssetModelPropertyDefinition>>) -> Self {
222 self.inner = self.inner.set_asset_model_properties(input);
223 self
224 }
225 /// <p>The 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>
226 /// <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>
227 pub fn get_asset_model_properties(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetModelPropertyDefinition>> {
228 self.inner.get_asset_model_properties()
229 }
230 ///
231 /// Appends an item to `assetModelHierarchies`.
232 ///
233 /// To override the contents of this collection use [`set_asset_model_hierarchies`](Self::set_asset_model_hierarchies).
234 ///
235 /// <p>The 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>
236 /// <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>
237 pub fn asset_model_hierarchies(mut self, input: crate::types::AssetModelHierarchyDefinition) -> Self {
238 self.inner = self.inner.asset_model_hierarchies(input);
239 self
240 }
241 /// <p>The 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>
242 /// <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>
243 pub fn set_asset_model_hierarchies(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AssetModelHierarchyDefinition>>) -> Self {
244 self.inner = self.inner.set_asset_model_hierarchies(input);
245 self
246 }
247 /// <p>The 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>
248 /// <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>
249 pub fn get_asset_model_hierarchies(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetModelHierarchyDefinition>> {
250 self.inner.get_asset_model_hierarchies()
251 }
252 ///
253 /// Appends an item to `assetModelCompositeModels`.
254 ///
255 /// To override the contents of this collection use [`set_asset_model_composite_models`](Self::set_asset_model_composite_models).
256 ///
257 /// <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>
258 /// <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>
259 /// </note>
260 pub fn asset_model_composite_models(mut self, input: crate::types::AssetModelCompositeModelDefinition) -> Self {
261 self.inner = self.inner.asset_model_composite_models(input);
262 self
263 }
264 /// <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>
265 /// <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>
266 /// </note>
267 pub fn set_asset_model_composite_models(
268 mut self,
269 input: ::std::option::Option<::std::vec::Vec<crate::types::AssetModelCompositeModelDefinition>>,
270 ) -> Self {
271 self.inner = self.inner.set_asset_model_composite_models(input);
272 self
273 }
274 /// <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>
275 /// <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>
276 /// </note>
277 pub fn get_asset_model_composite_models(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AssetModelCompositeModelDefinition>> {
278 self.inner.get_asset_model_composite_models()
279 }
280 /// <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>
281 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
282 self.inner = self.inner.client_token(input.into());
283 self
284 }
285 /// <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>
286 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
287 self.inner = self.inner.set_client_token(input);
288 self
289 }
290 /// <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>
291 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
292 self.inner.get_client_token()
293 }
294 ///
295 /// Adds a key-value pair to `tags`.
296 ///
297 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
298 ///
299 /// <p>A list of key-value pairs that contain metadata for the asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
300 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
301 self.inner = self.inner.tags(k.into(), v.into());
302 self
303 }
304 /// <p>A list of key-value pairs that contain metadata for the asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
305 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
306 self.inner = self.inner.set_tags(input);
307 self
308 }
309 /// <p>A list of key-value pairs that contain metadata for the asset model. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/tag-resources.html">Tagging your IoT SiteWise resources</a> in the <i>IoT SiteWise User Guide</i>.</p>
310 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
311 self.inner.get_tags()
312 }
313}