aws_sdk_iotsitewise/operation/update_gateway_capability_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_gateway_capability_configuration::_update_gateway_capability_configuration_output::UpdateGatewayCapabilityConfigurationOutputBuilder;
3
4pub use crate::operation::update_gateway_capability_configuration::_update_gateway_capability_configuration_input::UpdateGatewayCapabilityConfigurationInputBuilder;
5
6impl crate::operation::update_gateway_capability_configuration::builders::UpdateGatewayCapabilityConfigurationInputBuilder {
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_gateway_capability_configuration::UpdateGatewayCapabilityConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_gateway_capability_configuration::UpdateGatewayCapabilityConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_gateway_capability_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateGatewayCapabilityConfiguration`.
24///
25/// <p>Updates a gateway capability configuration or defines a new capability configuration. Each gateway capability defines data sources for a gateway.</p>
26/// <p>Important workflow notes:</p>
27/// <p>Each gateway capability defines data sources for a gateway. This is the namespace of the gateway capability.</p>
28/// <p>. The namespace follows the format <code>service:capability:version</code>, where:</p>
29/// <ul>
30/// <li>
31/// <p><code>service</code> - The service providing the capability, or <code>iotsitewise</code>.</p></li>
32/// <li>
33/// <p><code>capability</code> - The specific capability type. Options include: <code>opcuacollector</code> for the OPC UA data source collector, or <code>publisher</code> for data publisher capability.</p></li>
34/// <li>
35/// <p><code>version</code> - The version number of the capability. Option include <code>2</code> for Classic streams, V2 gateways, and <code>3</code> for MQTT-enabled, V3 gateways.</p></li>
36/// </ul>
37/// <p>After updating a capability configuration, the sync status becomes <code>OUT_OF_SYNC</code> until the gateway processes the configuration.Use <code>DescribeGatewayCapabilityConfiguration</code> to check the sync status and verify the configuration was applied.</p>
38/// <p>A gateway can have multiple capability configurations with different namespaces.</p>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct UpdateGatewayCapabilityConfigurationFluentBuilder {
41    handle: ::std::sync::Arc<crate::client::Handle>,
42    inner: crate::operation::update_gateway_capability_configuration::builders::UpdateGatewayCapabilityConfigurationInputBuilder,
43    config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46    crate::client::customize::internal::CustomizableSend<
47        crate::operation::update_gateway_capability_configuration::UpdateGatewayCapabilityConfigurationOutput,
48        crate::operation::update_gateway_capability_configuration::UpdateGatewayCapabilityConfigurationError,
49    > for UpdateGatewayCapabilityConfigurationFluentBuilder
50{
51    fn send(
52        self,
53        config_override: crate::config::Builder,
54    ) -> crate::client::customize::internal::BoxFuture<
55        crate::client::customize::internal::SendResult<
56            crate::operation::update_gateway_capability_configuration::UpdateGatewayCapabilityConfigurationOutput,
57            crate::operation::update_gateway_capability_configuration::UpdateGatewayCapabilityConfigurationError,
58        >,
59    > {
60        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61    }
62}
63impl UpdateGatewayCapabilityConfigurationFluentBuilder {
64    /// Creates a new `UpdateGatewayCapabilityConfigurationFluentBuilder`.
65    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66        Self {
67            handle,
68            inner: ::std::default::Default::default(),
69            config_override: ::std::option::Option::None,
70        }
71    }
72    /// Access the UpdateGatewayCapabilityConfiguration as a reference.
73    pub fn as_input(&self) -> &crate::operation::update_gateway_capability_configuration::builders::UpdateGatewayCapabilityConfigurationInputBuilder {
74        &self.inner
75    }
76    /// Sends the request and returns the response.
77    ///
78    /// If an error occurs, an `SdkError` will be returned with additional details that
79    /// can be matched against.
80    ///
81    /// By default, any retryable failures will be retried twice. Retry behavior
82    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83    /// set when configuring the client.
84    pub async fn send(
85        self,
86    ) -> ::std::result::Result<
87        crate::operation::update_gateway_capability_configuration::UpdateGatewayCapabilityConfigurationOutput,
88        ::aws_smithy_runtime_api::client::result::SdkError<
89            crate::operation::update_gateway_capability_configuration::UpdateGatewayCapabilityConfigurationError,
90            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91        >,
92    > {
93        let input = self
94            .inner
95            .build()
96            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97        let runtime_plugins =
98            crate::operation::update_gateway_capability_configuration::UpdateGatewayCapabilityConfiguration::operation_runtime_plugins(
99                self.handle.runtime_plugins.clone(),
100                &self.handle.conf,
101                self.config_override,
102            );
103        crate::operation::update_gateway_capability_configuration::UpdateGatewayCapabilityConfiguration::orchestrate(&runtime_plugins, input).await
104    }
105
106    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
107    pub fn customize(
108        self,
109    ) -> crate::client::customize::CustomizableOperation<
110        crate::operation::update_gateway_capability_configuration::UpdateGatewayCapabilityConfigurationOutput,
111        crate::operation::update_gateway_capability_configuration::UpdateGatewayCapabilityConfigurationError,
112        Self,
113    > {
114        crate::client::customize::CustomizableOperation::new(self)
115    }
116    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
117        self.set_config_override(::std::option::Option::Some(config_override.into()));
118        self
119    }
120
121    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
122        self.config_override = config_override;
123        self
124    }
125    /// <p>The ID of the gateway to be updated.</p>
126    pub fn gateway_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.gateway_id(input.into());
128        self
129    }
130    /// <p>The ID of the gateway to be updated.</p>
131    pub fn set_gateway_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_gateway_id(input);
133        self
134    }
135    /// <p>The ID of the gateway to be updated.</p>
136    pub fn get_gateway_id(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_gateway_id()
138    }
139    /// <p>The namespace of the gateway capability configuration to be updated. For example, if you configure OPC UA sources for an MQTT-enabled gateway, your OPC-UA capability configuration has the namespace <code>iotsitewise:opcuacollector:3</code>.</p>
140    pub fn capability_namespace(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
141        self.inner = self.inner.capability_namespace(input.into());
142        self
143    }
144    /// <p>The namespace of the gateway capability configuration to be updated. For example, if you configure OPC UA sources for an MQTT-enabled gateway, your OPC-UA capability configuration has the namespace <code>iotsitewise:opcuacollector:3</code>.</p>
145    pub fn set_capability_namespace(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
146        self.inner = self.inner.set_capability_namespace(input);
147        self
148    }
149    /// <p>The namespace of the gateway capability configuration to be updated. For example, if you configure OPC UA sources for an MQTT-enabled gateway, your OPC-UA capability configuration has the namespace <code>iotsitewise:opcuacollector:3</code>.</p>
150    pub fn get_capability_namespace(&self) -> &::std::option::Option<::std::string::String> {
151        self.inner.get_capability_namespace()
152    }
153    /// <p>The JSON document that defines the configuration for the gateway capability. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/configure-sources.html#configure-source-cli">Configuring data sources (CLI)</a> in the <i>IoT SiteWise User Guide</i>.</p>
154    pub fn capability_configuration(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.capability_configuration(input.into());
156        self
157    }
158    /// <p>The JSON document that defines the configuration for the gateway capability. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/configure-sources.html#configure-source-cli">Configuring data sources (CLI)</a> in the <i>IoT SiteWise User Guide</i>.</p>
159    pub fn set_capability_configuration(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_capability_configuration(input);
161        self
162    }
163    /// <p>The JSON document that defines the configuration for the gateway capability. For more information, see <a href="https://docs.aws.amazon.com/iot-sitewise/latest/userguide/configure-sources.html#configure-source-cli">Configuring data sources (CLI)</a> in the <i>IoT SiteWise User Guide</i>.</p>
164    pub fn get_capability_configuration(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_capability_configuration()
166    }
167}