aws_sdk_iotmanagedintegrations/operation/send_connector_event/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::send_connector_event::_send_connector_event_output::SendConnectorEventOutputBuilder;
3
4pub use crate::operation::send_connector_event::_send_connector_event_input::SendConnectorEventInputBuilder;
5
6impl crate::operation::send_connector_event::builders::SendConnectorEventInputBuilder {
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::send_connector_event::SendConnectorEventOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::send_connector_event::SendConnectorEventError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.send_connector_event();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SendConnectorEvent`.
24///
25/// <p>Relays third-party device events for a connector such as a new device or a device state change event.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct SendConnectorEventFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::send_connector_event::builders::SendConnectorEventInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::send_connector_event::SendConnectorEventOutput,
35        crate::operation::send_connector_event::SendConnectorEventError,
36    > for SendConnectorEventFluentBuilder
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::send_connector_event::SendConnectorEventOutput,
44            crate::operation::send_connector_event::SendConnectorEventError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl SendConnectorEventFluentBuilder {
51    /// Creates a new `SendConnectorEventFluentBuilder`.
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 SendConnectorEvent as a reference.
60    pub fn as_input(&self) -> &crate::operation::send_connector_event::builders::SendConnectorEventInputBuilder {
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::send_connector_event::SendConnectorEventOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::send_connector_event::SendConnectorEventError,
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::send_connector_event::SendConnectorEvent::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::send_connector_event::SendConnectorEvent::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::send_connector_event::SendConnectorEventOutput,
97        crate::operation::send_connector_event::SendConnectorEventError,
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 id of the connector between the third-party cloud provider and IoT managed integrations.</p>
112    pub fn connector_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.connector_id(input.into());
114        self
115    }
116    /// <p>The id of the connector between the third-party cloud provider and IoT managed integrations.</p>
117    pub fn set_connector_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_connector_id(input);
119        self
120    }
121    /// <p>The id of the connector between the third-party cloud provider and IoT managed integrations.</p>
122    pub fn get_connector_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_connector_id()
124    }
125    /// <p>The id of the third-party cloud provider.</p>
126    pub fn user_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.user_id(input.into());
128        self
129    }
130    /// <p>The id of the third-party cloud provider.</p>
131    pub fn set_user_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_user_id(input);
133        self
134    }
135    /// <p>The id of the third-party cloud provider.</p>
136    pub fn get_user_id(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_user_id()
138    }
139    /// <p>The Open Connectivity Foundation (OCF) operation requested to be performed on the managed thing.</p><note>
140    /// <p>The field op can have a value of "I" or "U". The field "cn" will contain the capability types.</p>
141    /// </note>
142    pub fn operation(mut self, input: crate::types::ConnectorEventOperation) -> Self {
143        self.inner = self.inner.operation(input);
144        self
145    }
146    /// <p>The Open Connectivity Foundation (OCF) operation requested to be performed on the managed thing.</p><note>
147    /// <p>The field op can have a value of "I" or "U". The field "cn" will contain the capability types.</p>
148    /// </note>
149    pub fn set_operation(mut self, input: ::std::option::Option<crate::types::ConnectorEventOperation>) -> Self {
150        self.inner = self.inner.set_operation(input);
151        self
152    }
153    /// <p>The Open Connectivity Foundation (OCF) operation requested to be performed on the managed thing.</p><note>
154    /// <p>The field op can have a value of "I" or "U". The field "cn" will contain the capability types.</p>
155    /// </note>
156    pub fn get_operation(&self) -> &::std::option::Option<crate::types::ConnectorEventOperation> {
157        self.inner.get_operation()
158    }
159    /// <p>The Open Connectivity Foundation (OCF) security specification version for the operation being requested on the managed thing. For more information, see <a href="https://openconnectivity.org/specs/OCF_Security_Specification_v1.0.0.pdf">OCF Security Specification</a>.</p>
160    pub fn operation_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.inner = self.inner.operation_version(input.into());
162        self
163    }
164    /// <p>The Open Connectivity Foundation (OCF) security specification version for the operation being requested on the managed thing. For more information, see <a href="https://openconnectivity.org/specs/OCF_Security_Specification_v1.0.0.pdf">OCF Security Specification</a>.</p>
165    pub fn set_operation_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.inner = self.inner.set_operation_version(input);
167        self
168    }
169    /// <p>The Open Connectivity Foundation (OCF) security specification version for the operation being requested on the managed thing. For more information, see <a href="https://openconnectivity.org/specs/OCF_Security_Specification_v1.0.0.pdf">OCF Security Specification</a>.</p>
170    pub fn get_operation_version(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_operation_version()
172    }
173    /// <p>The status code of the Open Connectivity Foundation (OCF) operation being performed on the managed thing.</p>
174    pub fn status_code(mut self, input: i32) -> Self {
175        self.inner = self.inner.status_code(input);
176        self
177    }
178    /// <p>The status code of the Open Connectivity Foundation (OCF) operation being performed on the managed thing.</p>
179    pub fn set_status_code(mut self, input: ::std::option::Option<i32>) -> Self {
180        self.inner = self.inner.set_status_code(input);
181        self
182    }
183    /// <p>The status code of the Open Connectivity Foundation (OCF) operation being performed on the managed thing.</p>
184    pub fn get_status_code(&self) -> &::std::option::Option<i32> {
185        self.inner.get_status_code()
186    }
187    /// <p>The device state change event payload.</p>
188    /// <p>This parameter will include the following three fields:</p>
189    /// <ul>
190    /// <li>
191    /// <p><code>uri</code>: <code>schema auc://&lt;PARTNER-DEVICE-ID&gt;/ResourcePath</code> (The <code>Resourcepath</code> corresponds to an OCF resource.)</p></li>
192    /// <li>
193    /// <p><code>op</code>: For device state changes, this field must populate as <code>n+d</code>.</p></li>
194    /// <li>
195    /// <p><code>cn</code>: The content depends on the OCF resource referenced in <code>ResourcePath</code>.</p></li>
196    /// </ul>
197    pub fn message(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
198        self.inner = self.inner.message(input.into());
199        self
200    }
201    /// <p>The device state change event payload.</p>
202    /// <p>This parameter will include the following three fields:</p>
203    /// <ul>
204    /// <li>
205    /// <p><code>uri</code>: <code>schema auc://&lt;PARTNER-DEVICE-ID&gt;/ResourcePath</code> (The <code>Resourcepath</code> corresponds to an OCF resource.)</p></li>
206    /// <li>
207    /// <p><code>op</code>: For device state changes, this field must populate as <code>n+d</code>.</p></li>
208    /// <li>
209    /// <p><code>cn</code>: The content depends on the OCF resource referenced in <code>ResourcePath</code>.</p></li>
210    /// </ul>
211    pub fn set_message(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.inner = self.inner.set_message(input);
213        self
214    }
215    /// <p>The device state change event payload.</p>
216    /// <p>This parameter will include the following three fields:</p>
217    /// <ul>
218    /// <li>
219    /// <p><code>uri</code>: <code>schema auc://&lt;PARTNER-DEVICE-ID&gt;/ResourcePath</code> (The <code>Resourcepath</code> corresponds to an OCF resource.)</p></li>
220    /// <li>
221    /// <p><code>op</code>: For device state changes, this field must populate as <code>n+d</code>.</p></li>
222    /// <li>
223    /// <p><code>cn</code>: The content depends on the OCF resource referenced in <code>ResourcePath</code>.</p></li>
224    /// </ul>
225    pub fn get_message(&self) -> &::std::option::Option<::std::string::String> {
226        self.inner.get_message()
227    }
228    /// <p>The id for the device discovery job.</p>
229    pub fn device_discovery_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230        self.inner = self.inner.device_discovery_id(input.into());
231        self
232    }
233    /// <p>The id for the device discovery job.</p>
234    pub fn set_device_discovery_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235        self.inner = self.inner.set_device_discovery_id(input);
236        self
237    }
238    /// <p>The id for the device discovery job.</p>
239    pub fn get_device_discovery_id(&self) -> &::std::option::Option<::std::string::String> {
240        self.inner.get_device_discovery_id()
241    }
242    /// <p>The third-party device id as defined by the connector. This device id must not contain personal identifiable information (PII).</p><note>
243    /// <p>This parameter is used for cloud-to-cloud devices only.</p>
244    /// </note>
245    pub fn connector_device_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
246        self.inner = self.inner.connector_device_id(input.into());
247        self
248    }
249    /// <p>The third-party device id as defined by the connector. This device id must not contain personal identifiable information (PII).</p><note>
250    /// <p>This parameter is used for cloud-to-cloud devices only.</p>
251    /// </note>
252    pub fn set_connector_device_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
253        self.inner = self.inner.set_connector_device_id(input);
254        self
255    }
256    /// <p>The third-party device id as defined by the connector. This device id must not contain personal identifiable information (PII).</p><note>
257    /// <p>This parameter is used for cloud-to-cloud devices only.</p>
258    /// </note>
259    pub fn get_connector_device_id(&self) -> &::std::option::Option<::std::string::String> {
260        self.inner.get_connector_device_id()
261    }
262    /// <p>The trace request identifier. This is generated by IoT managed integrations and can be used to trace this command and its related operations in CloudWatch.</p>
263    pub fn trace_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
264        self.inner = self.inner.trace_id(input.into());
265        self
266    }
267    /// <p>The trace request identifier. This is generated by IoT managed integrations and can be used to trace this command and its related operations in CloudWatch.</p>
268    pub fn set_trace_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
269        self.inner = self.inner.set_trace_id(input);
270        self
271    }
272    /// <p>The trace request identifier. This is generated by IoT managed integrations and can be used to trace this command and its related operations in CloudWatch.</p>
273    pub fn get_trace_id(&self) -> &::std::option::Option<::std::string::String> {
274        self.inner.get_trace_id()
275    }
276    ///
277    /// Appends an item to `Devices`.
278    ///
279    /// To override the contents of this collection use [`set_devices`](Self::set_devices).
280    ///
281    /// <p>The list of devices.</p>
282    pub fn devices(mut self, input: crate::types::Device) -> Self {
283        self.inner = self.inner.devices(input);
284        self
285    }
286    /// <p>The list of devices.</p>
287    pub fn set_devices(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Device>>) -> Self {
288        self.inner = self.inner.set_devices(input);
289        self
290    }
291    /// <p>The list of devices.</p>
292    pub fn get_devices(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Device>> {
293        self.inner.get_devices()
294    }
295    /// <p>The device endpoint.</p>
296    pub fn matter_endpoint(mut self, input: crate::types::MatterEndpoint) -> Self {
297        self.inner = self.inner.matter_endpoint(input);
298        self
299    }
300    /// <p>The device endpoint.</p>
301    pub fn set_matter_endpoint(mut self, input: ::std::option::Option<crate::types::MatterEndpoint>) -> Self {
302        self.inner = self.inner.set_matter_endpoint(input);
303        self
304    }
305    /// <p>The device endpoint.</p>
306    pub fn get_matter_endpoint(&self) -> &::std::option::Option<crate::types::MatterEndpoint> {
307        self.inner.get_matter_endpoint()
308    }
309}