aws_sdk_iotmanagedintegrations/operation/create_managed_thing/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_managed_thing::_create_managed_thing_output::CreateManagedThingOutputBuilder;
3
4pub use crate::operation::create_managed_thing::_create_managed_thing_input::CreateManagedThingInputBuilder;
5
6impl crate::operation::create_managed_thing::builders::CreateManagedThingInputBuilder {
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_managed_thing::CreateManagedThingOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_managed_thing::CreateManagedThingError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_managed_thing();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateManagedThing`.
24///
25/// <p>Creates a managed thing. A managed thing contains the device identifier, protocol supported, and capabilities of the device in a data model format defined by Managed integrations.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateManagedThingFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_managed_thing::builders::CreateManagedThingInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_managed_thing::CreateManagedThingOutput,
35        crate::operation::create_managed_thing::CreateManagedThingError,
36    > for CreateManagedThingFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_managed_thing::CreateManagedThingOutput,
44            crate::operation::create_managed_thing::CreateManagedThingError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateManagedThingFluentBuilder {
51    /// Creates a new `CreateManagedThingFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateManagedThing as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_managed_thing::builders::CreateManagedThingInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_managed_thing::CreateManagedThingOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_managed_thing::CreateManagedThingError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_managed_thing::CreateManagedThing::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_managed_thing::CreateManagedThing::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_managed_thing::CreateManagedThingOutput,
97        crate::operation::create_managed_thing::CreateManagedThingError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The type of device used. This will be the hub controller, cloud device, or AWS IoT device.</p>
112    pub fn role(mut self, input: crate::types::Role) -> Self {
113        self.inner = self.inner.role(input);
114        self
115    }
116    /// <p>The type of device used. This will be the hub controller, cloud device, or AWS IoT device.</p>
117    pub fn set_role(mut self, input: ::std::option::Option<crate::types::Role>) -> Self {
118        self.inner = self.inner.set_role(input);
119        self
120    }
121    /// <p>The type of device used. This will be the hub controller, cloud device, or AWS IoT device.</p>
122    pub fn get_role(&self) -> &::std::option::Option<crate::types::Role> {
123        self.inner.get_role()
124    }
125    /// <p>Owner of the device, usually an indication of whom the device belongs to. This value should not contain personal identifiable information.</p>
126    pub fn owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.owner(input.into());
128        self
129    }
130    /// <p>Owner of the device, usually an indication of whom the device belongs to. This value should not contain personal identifiable information.</p>
131    pub fn set_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_owner(input);
133        self
134    }
135    /// <p>Owner of the device, usually an indication of whom the device belongs to. This value should not contain personal identifiable information.</p>
136    pub fn get_owner(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_owner()
138    }
139    /// <p>The identifier of the credential for the managed thing.</p>
140    pub fn credential_locker_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.credential_locker_id(input.into());
142        self
143    }
144    /// <p>The identifier of the credential for the managed thing.</p>
145    pub fn set_credential_locker_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_credential_locker_id(input);
147        self
148    }
149    /// <p>The identifier of the credential for the managed thing.</p>
150    pub fn get_credential_locker_id(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_credential_locker_id()
152    }
153    /// <p>The authentication material defining the device connectivity setup requests. The authentication materials used are the device bar code.</p>
154    pub fn authentication_material(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.authentication_material(input.into());
156        self
157    }
158    /// <p>The authentication material defining the device connectivity setup requests. The authentication materials used are the device bar code.</p>
159    pub fn set_authentication_material(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_authentication_material(input);
161        self
162    }
163    /// <p>The authentication material defining the device connectivity setup requests. The authentication materials used are the device bar code.</p>
164    pub fn get_authentication_material(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_authentication_material()
166    }
167    /// <p>The type of authentication material used for device connectivity setup requests.</p>
168    pub fn authentication_material_type(mut self, input: crate::types::AuthMaterialType) -> Self {
169        self.inner = self.inner.authentication_material_type(input);
170        self
171    }
172    /// <p>The type of authentication material used for device connectivity setup requests.</p>
173    pub fn set_authentication_material_type(mut self, input: ::std::option::Option<crate::types::AuthMaterialType>) -> Self {
174        self.inner = self.inner.set_authentication_material_type(input);
175        self
176    }
177    /// <p>The type of authentication material used for device connectivity setup requests.</p>
178    pub fn get_authentication_material_type(&self) -> &::std::option::Option<crate::types::AuthMaterialType> {
179        self.inner.get_authentication_material_type()
180    }
181    /// <p>The serial number of the device.</p>
182    pub fn serial_number(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.inner = self.inner.serial_number(input.into());
184        self
185    }
186    /// <p>The serial number of the device.</p>
187    pub fn set_serial_number(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.inner = self.inner.set_serial_number(input);
189        self
190    }
191    /// <p>The serial number of the device.</p>
192    pub fn get_serial_number(&self) -> &::std::option::Option<::std::string::String> {
193        self.inner.get_serial_number()
194    }
195    /// <p>The brand of the device.</p>
196    pub fn brand(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.inner = self.inner.brand(input.into());
198        self
199    }
200    /// <p>The brand of the device.</p>
201    pub fn set_brand(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.inner = self.inner.set_brand(input);
203        self
204    }
205    /// <p>The brand of the device.</p>
206    pub fn get_brand(&self) -> &::std::option::Option<::std::string::String> {
207        self.inner.get_brand()
208    }
209    /// <p>The model of the device.</p>
210    pub fn model(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.inner = self.inner.model(input.into());
212        self
213    }
214    /// <p>The model of the device.</p>
215    pub fn set_model(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.inner = self.inner.set_model(input);
217        self
218    }
219    /// <p>The model of the device.</p>
220    pub fn get_model(&self) -> &::std::option::Option<::std::string::String> {
221        self.inner.get_model()
222    }
223    /// <p>The name of the managed thing representing the physical device.</p>
224    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
225        self.inner = self.inner.name(input.into());
226        self
227    }
228    /// <p>The name of the managed thing representing the physical device.</p>
229    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
230        self.inner = self.inner.set_name(input);
231        self
232    }
233    /// <p>The name of the managed thing representing the physical device.</p>
234    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
235        self.inner.get_name()
236    }
237    /// <p>A report of the capabilities for the managed thing.</p>
238    pub fn capability_report(mut self, input: crate::types::CapabilityReport) -> Self {
239        self.inner = self.inner.capability_report(input);
240        self
241    }
242    /// <p>A report of the capabilities for the managed thing.</p>
243    pub fn set_capability_report(mut self, input: ::std::option::Option<crate::types::CapabilityReport>) -> Self {
244        self.inner = self.inner.set_capability_report(input);
245        self
246    }
247    /// <p>A report of the capabilities for the managed thing.</p>
248    pub fn get_capability_report(&self) -> &::std::option::Option<crate::types::CapabilityReport> {
249        self.inner.get_capability_report()
250    }
251    ///
252    /// Appends an item to `CapabilitySchemas`.
253    ///
254    /// To override the contents of this collection use [`set_capability_schemas`](Self::set_capability_schemas).
255    ///
256    /// <p>The capability schemas that define the functionality and features supported by the managed thing, including device capabilities and their associated properties.</p>
257    pub fn capability_schemas(mut self, input: crate::types::CapabilitySchemaItem) -> Self {
258        self.inner = self.inner.capability_schemas(input);
259        self
260    }
261    /// <p>The capability schemas that define the functionality and features supported by the managed thing, including device capabilities and their associated properties.</p>
262    pub fn set_capability_schemas(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CapabilitySchemaItem>>) -> Self {
263        self.inner = self.inner.set_capability_schemas(input);
264        self
265    }
266    /// <p>The capability schemas that define the functionality and features supported by the managed thing, including device capabilities and their associated properties.</p>
267    pub fn get_capability_schemas(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CapabilitySchemaItem>> {
268        self.inner.get_capability_schemas()
269    }
270    /// <p>The capabilities of the device such as light bulb.</p>
271    pub fn capabilities(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
272        self.inner = self.inner.capabilities(input.into());
273        self
274    }
275    /// <p>The capabilities of the device such as light bulb.</p>
276    pub fn set_capabilities(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
277        self.inner = self.inner.set_capabilities(input);
278        self
279    }
280    /// <p>The capabilities of the device such as light bulb.</p>
281    pub fn get_capabilities(&self) -> &::std::option::Option<::std::string::String> {
282        self.inner.get_capabilities()
283    }
284    /// <p>An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.</p>
285    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
286        self.inner = self.inner.client_token(input.into());
287        self
288    }
289    /// <p>An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.</p>
290    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
291        self.inner = self.inner.set_client_token(input);
292        self
293    }
294    /// <p>An idempotency token. If you retry a request that completed successfully initially using the same client token and parameters, then the retry attempt will succeed without performing any further actions.</p>
295    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
296        self.inner.get_client_token()
297    }
298    /// <p>The classification of the managed thing such as light bulb or thermostat.</p>
299    pub fn classification(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
300        self.inner = self.inner.classification(input.into());
301        self
302    }
303    /// <p>The classification of the managed thing such as light bulb or thermostat.</p>
304    pub fn set_classification(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
305        self.inner = self.inner.set_classification(input);
306        self
307    }
308    /// <p>The classification of the managed thing such as light bulb or thermostat.</p>
309    pub fn get_classification(&self) -> &::std::option::Option<::std::string::String> {
310        self.inner.get_classification()
311    }
312    ///
313    /// Adds a key-value pair to `Tags`.
314    ///
315    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
316    ///
317    /// <p>A set of key/value pairs that are used to manage the managed thing.</p>
318    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
319        self.inner = self.inner.tags(k.into(), v.into());
320        self
321    }
322    /// <p>A set of key/value pairs that are used to manage the managed thing.</p>
323    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
324        self.inner = self.inner.set_tags(input);
325        self
326    }
327    /// <p>A set of key/value pairs that are used to manage the managed thing.</p>
328    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
329        self.inner.get_tags()
330    }
331    ///
332    /// Adds a key-value pair to `MetaData`.
333    ///
334    /// To override the contents of this collection use [`set_meta_data`](Self::set_meta_data).
335    ///
336    /// <p>The metadata for the managed thing.</p><note>
337    /// <p>The <code>managedThing</code> <code>metadata</code> parameter is used for associating attributes with a <code>managedThing</code> that can be used for grouping over-the-air (OTA) tasks. Name value pairs in <code>metadata</code> can be used in the <code>OtaTargetQueryString</code> parameter for the <code>CreateOtaTask</code> API operation.</p>
338    /// </note>
339    pub fn meta_data(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
340        self.inner = self.inner.meta_data(k.into(), v.into());
341        self
342    }
343    /// <p>The metadata for the managed thing.</p><note>
344    /// <p>The <code>managedThing</code> <code>metadata</code> parameter is used for associating attributes with a <code>managedThing</code> that can be used for grouping over-the-air (OTA) tasks. Name value pairs in <code>metadata</code> can be used in the <code>OtaTargetQueryString</code> parameter for the <code>CreateOtaTask</code> API operation.</p>
345    /// </note>
346    pub fn set_meta_data(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
347        self.inner = self.inner.set_meta_data(input);
348        self
349    }
350    /// <p>The metadata for the managed thing.</p><note>
351    /// <p>The <code>managedThing</code> <code>metadata</code> parameter is used for associating attributes with a <code>managedThing</code> that can be used for grouping over-the-air (OTA) tasks. Name value pairs in <code>metadata</code> can be used in the <code>OtaTargetQueryString</code> parameter for the <code>CreateOtaTask</code> API operation.</p>
352    /// </note>
353    pub fn get_meta_data(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
354        self.inner.get_meta_data()
355    }
356}