aws_sdk_firehose/operation/update_destination/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_destination::_update_destination_output::UpdateDestinationOutputBuilder;
3
4pub use crate::operation::update_destination::_update_destination_input::UpdateDestinationInputBuilder;
5
6impl crate::operation::update_destination::builders::UpdateDestinationInputBuilder {
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_destination::UpdateDestinationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_destination::UpdateDestinationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_destination();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateDestination`.
24///
25/// <p>Updates the specified destination of the specified Firehose stream.</p>
26/// <p>Use this operation to change the destination type (for example, to replace the Amazon S3 destination with Amazon Redshift) or change the parameters associated with a destination (for example, to change the bucket name of the Amazon S3 destination). The update might not occur immediately. The target Firehose stream remains active while the configurations are updated, so data writes to the Firehose stream can continue during this process. The updated configurations are usually effective within a few minutes.</p>
27/// <p>Switching between Amazon OpenSearch Service and other services is not supported. For an Amazon OpenSearch Service destination, you can only update to another Amazon OpenSearch Service destination.</p>
28/// <p>If the destination type is the same, Firehose merges the configuration parameters specified with the destination configuration that already exists on the delivery stream. If any of the parameters are not specified in the call, the existing values are retained. For example, in the Amazon S3 destination, if <code>EncryptionConfiguration</code> is not specified, then the existing <code>EncryptionConfiguration</code> is maintained on the destination.</p>
29/// <p>If the destination type is not the same, for example, changing the destination from Amazon S3 to Amazon Redshift, Firehose does not merge any parameters. In this case, all parameters must be specified.</p>
30/// <p>Firehose uses <code>CurrentDeliveryStreamVersionId</code> to avoid race conditions and conflicting merges. This is a required field, and the service updates the configuration only if the existing configuration has a version ID that matches. After the update is applied successfully, the version ID is updated, and can be retrieved using <code>DescribeDeliveryStream</code>. Use the new version ID to set <code>CurrentDeliveryStreamVersionId</code> in the next call.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct UpdateDestinationFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::update_destination::builders::UpdateDestinationInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::update_destination::UpdateDestinationOutput,
40        crate::operation::update_destination::UpdateDestinationError,
41    > for UpdateDestinationFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::update_destination::UpdateDestinationOutput,
49            crate::operation::update_destination::UpdateDestinationError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl UpdateDestinationFluentBuilder {
56    /// Creates a new `UpdateDestinationFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the UpdateDestination as a reference.
65    pub fn as_input(&self) -> &crate::operation::update_destination::builders::UpdateDestinationInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::update_destination::UpdateDestinationOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::update_destination::UpdateDestinationError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::update_destination::UpdateDestination::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::update_destination::UpdateDestination::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::update_destination::UpdateDestinationOutput,
102        crate::operation::update_destination::UpdateDestinationError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// <p>The name of the Firehose stream.</p>
117    pub fn delivery_stream_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
118        self.inner = self.inner.delivery_stream_name(input.into());
119        self
120    }
121    /// <p>The name of the Firehose stream.</p>
122    pub fn set_delivery_stream_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
123        self.inner = self.inner.set_delivery_stream_name(input);
124        self
125    }
126    /// <p>The name of the Firehose stream.</p>
127    pub fn get_delivery_stream_name(&self) -> &::std::option::Option<::std::string::String> {
128        self.inner.get_delivery_stream_name()
129    }
130    /// <p>Obtain this value from the <code>VersionId</code> result of <code>DeliveryStreamDescription</code>. This value is required, and helps the service perform conditional operations. For example, if there is an interleaving update and this value is null, then the update destination fails. After the update is successful, the <code>VersionId</code> value is updated. The service then performs a merge of the old configuration with the new configuration.</p>
131    pub fn current_delivery_stream_version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.inner = self.inner.current_delivery_stream_version_id(input.into());
133        self
134    }
135    /// <p>Obtain this value from the <code>VersionId</code> result of <code>DeliveryStreamDescription</code>. This value is required, and helps the service perform conditional operations. For example, if there is an interleaving update and this value is null, then the update destination fails. After the update is successful, the <code>VersionId</code> value is updated. The service then performs a merge of the old configuration with the new configuration.</p>
136    pub fn set_current_delivery_stream_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.inner = self.inner.set_current_delivery_stream_version_id(input);
138        self
139    }
140    /// <p>Obtain this value from the <code>VersionId</code> result of <code>DeliveryStreamDescription</code>. This value is required, and helps the service perform conditional operations. For example, if there is an interleaving update and this value is null, then the update destination fails. After the update is successful, the <code>VersionId</code> value is updated. The service then performs a merge of the old configuration with the new configuration.</p>
141    pub fn get_current_delivery_stream_version_id(&self) -> &::std::option::Option<::std::string::String> {
142        self.inner.get_current_delivery_stream_version_id()
143    }
144    /// <p>The ID of the destination.</p>
145    pub fn destination_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.inner = self.inner.destination_id(input.into());
147        self
148    }
149    /// <p>The ID of the destination.</p>
150    pub fn set_destination_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.inner = self.inner.set_destination_id(input);
152        self
153    }
154    /// <p>The ID of the destination.</p>
155    pub fn get_destination_id(&self) -> &::std::option::Option<::std::string::String> {
156        self.inner.get_destination_id()
157    }
158    /// <p>\[Deprecated\] Describes an update for a destination in Amazon S3.</p>
159    #[deprecated]
160    pub fn s3_destination_update(mut self, input: crate::types::S3DestinationUpdate) -> Self {
161        self.inner = self.inner.s3_destination_update(input);
162        self
163    }
164    /// <p>\[Deprecated\] Describes an update for a destination in Amazon S3.</p>
165    #[deprecated]
166    pub fn set_s3_destination_update(mut self, input: ::std::option::Option<crate::types::S3DestinationUpdate>) -> Self {
167        self.inner = self.inner.set_s3_destination_update(input);
168        self
169    }
170    /// <p>\[Deprecated\] Describes an update for a destination in Amazon S3.</p>
171    #[deprecated]
172    pub fn get_s3_destination_update(&self) -> &::std::option::Option<crate::types::S3DestinationUpdate> {
173        self.inner.get_s3_destination_update()
174    }
175    /// <p>Describes an update for a destination in Amazon S3.</p>
176    pub fn extended_s3_destination_update(mut self, input: crate::types::ExtendedS3DestinationUpdate) -> Self {
177        self.inner = self.inner.extended_s3_destination_update(input);
178        self
179    }
180    /// <p>Describes an update for a destination in Amazon S3.</p>
181    pub fn set_extended_s3_destination_update(mut self, input: ::std::option::Option<crate::types::ExtendedS3DestinationUpdate>) -> Self {
182        self.inner = self.inner.set_extended_s3_destination_update(input);
183        self
184    }
185    /// <p>Describes an update for a destination in Amazon S3.</p>
186    pub fn get_extended_s3_destination_update(&self) -> &::std::option::Option<crate::types::ExtendedS3DestinationUpdate> {
187        self.inner.get_extended_s3_destination_update()
188    }
189    /// <p>Describes an update for a destination in Amazon Redshift.</p>
190    pub fn redshift_destination_update(mut self, input: crate::types::RedshiftDestinationUpdate) -> Self {
191        self.inner = self.inner.redshift_destination_update(input);
192        self
193    }
194    /// <p>Describes an update for a destination in Amazon Redshift.</p>
195    pub fn set_redshift_destination_update(mut self, input: ::std::option::Option<crate::types::RedshiftDestinationUpdate>) -> Self {
196        self.inner = self.inner.set_redshift_destination_update(input);
197        self
198    }
199    /// <p>Describes an update for a destination in Amazon Redshift.</p>
200    pub fn get_redshift_destination_update(&self) -> &::std::option::Option<crate::types::RedshiftDestinationUpdate> {
201        self.inner.get_redshift_destination_update()
202    }
203    /// <p>Describes an update for a destination in Amazon OpenSearch Service.</p>
204    pub fn elasticsearch_destination_update(mut self, input: crate::types::ElasticsearchDestinationUpdate) -> Self {
205        self.inner = self.inner.elasticsearch_destination_update(input);
206        self
207    }
208    /// <p>Describes an update for a destination in Amazon OpenSearch Service.</p>
209    pub fn set_elasticsearch_destination_update(mut self, input: ::std::option::Option<crate::types::ElasticsearchDestinationUpdate>) -> Self {
210        self.inner = self.inner.set_elasticsearch_destination_update(input);
211        self
212    }
213    /// <p>Describes an update for a destination in Amazon OpenSearch Service.</p>
214    pub fn get_elasticsearch_destination_update(&self) -> &::std::option::Option<crate::types::ElasticsearchDestinationUpdate> {
215        self.inner.get_elasticsearch_destination_update()
216    }
217    /// <p>Describes an update for a destination in Amazon OpenSearch Service.</p>
218    pub fn amazonopensearchservice_destination_update(mut self, input: crate::types::AmazonopensearchserviceDestinationUpdate) -> Self {
219        self.inner = self.inner.amazonopensearchservice_destination_update(input);
220        self
221    }
222    /// <p>Describes an update for a destination in Amazon OpenSearch Service.</p>
223    pub fn set_amazonopensearchservice_destination_update(
224        mut self,
225        input: ::std::option::Option<crate::types::AmazonopensearchserviceDestinationUpdate>,
226    ) -> Self {
227        self.inner = self.inner.set_amazonopensearchservice_destination_update(input);
228        self
229    }
230    /// <p>Describes an update for a destination in Amazon OpenSearch Service.</p>
231    pub fn get_amazonopensearchservice_destination_update(&self) -> &::std::option::Option<crate::types::AmazonopensearchserviceDestinationUpdate> {
232        self.inner.get_amazonopensearchservice_destination_update()
233    }
234    /// <p>Describes an update for a destination in Splunk.</p>
235    pub fn splunk_destination_update(mut self, input: crate::types::SplunkDestinationUpdate) -> Self {
236        self.inner = self.inner.splunk_destination_update(input);
237        self
238    }
239    /// <p>Describes an update for a destination in Splunk.</p>
240    pub fn set_splunk_destination_update(mut self, input: ::std::option::Option<crate::types::SplunkDestinationUpdate>) -> Self {
241        self.inner = self.inner.set_splunk_destination_update(input);
242        self
243    }
244    /// <p>Describes an update for a destination in Splunk.</p>
245    pub fn get_splunk_destination_update(&self) -> &::std::option::Option<crate::types::SplunkDestinationUpdate> {
246        self.inner.get_splunk_destination_update()
247    }
248    /// <p>Describes an update to the specified HTTP endpoint destination.</p>
249    pub fn http_endpoint_destination_update(mut self, input: crate::types::HttpEndpointDestinationUpdate) -> Self {
250        self.inner = self.inner.http_endpoint_destination_update(input);
251        self
252    }
253    /// <p>Describes an update to the specified HTTP endpoint destination.</p>
254    pub fn set_http_endpoint_destination_update(mut self, input: ::std::option::Option<crate::types::HttpEndpointDestinationUpdate>) -> Self {
255        self.inner = self.inner.set_http_endpoint_destination_update(input);
256        self
257    }
258    /// <p>Describes an update to the specified HTTP endpoint destination.</p>
259    pub fn get_http_endpoint_destination_update(&self) -> &::std::option::Option<crate::types::HttpEndpointDestinationUpdate> {
260        self.inner.get_http_endpoint_destination_update()
261    }
262    /// <p>Describes an update for a destination in the Serverless offering for Amazon OpenSearch Service.</p>
263    pub fn amazon_open_search_serverless_destination_update(mut self, input: crate::types::AmazonOpenSearchServerlessDestinationUpdate) -> Self {
264        self.inner = self.inner.amazon_open_search_serverless_destination_update(input);
265        self
266    }
267    /// <p>Describes an update for a destination in the Serverless offering for Amazon OpenSearch Service.</p>
268    pub fn set_amazon_open_search_serverless_destination_update(
269        mut self,
270        input: ::std::option::Option<crate::types::AmazonOpenSearchServerlessDestinationUpdate>,
271    ) -> Self {
272        self.inner = self.inner.set_amazon_open_search_serverless_destination_update(input);
273        self
274    }
275    /// <p>Describes an update for a destination in the Serverless offering for Amazon OpenSearch Service.</p>
276    pub fn get_amazon_open_search_serverless_destination_update(
277        &self,
278    ) -> &::std::option::Option<crate::types::AmazonOpenSearchServerlessDestinationUpdate> {
279        self.inner.get_amazon_open_search_serverless_destination_update()
280    }
281    /// <p>Update to the Snowflake destination configuration settings.</p>
282    pub fn snowflake_destination_update(mut self, input: crate::types::SnowflakeDestinationUpdate) -> Self {
283        self.inner = self.inner.snowflake_destination_update(input);
284        self
285    }
286    /// <p>Update to the Snowflake destination configuration settings.</p>
287    pub fn set_snowflake_destination_update(mut self, input: ::std::option::Option<crate::types::SnowflakeDestinationUpdate>) -> Self {
288        self.inner = self.inner.set_snowflake_destination_update(input);
289        self
290    }
291    /// <p>Update to the Snowflake destination configuration settings.</p>
292    pub fn get_snowflake_destination_update(&self) -> &::std::option::Option<crate::types::SnowflakeDestinationUpdate> {
293        self.inner.get_snowflake_destination_update()
294    }
295    /// <p>Describes an update for a destination in Apache Iceberg Tables.</p>
296    pub fn iceberg_destination_update(mut self, input: crate::types::IcebergDestinationUpdate) -> Self {
297        self.inner = self.inner.iceberg_destination_update(input);
298        self
299    }
300    /// <p>Describes an update for a destination in Apache Iceberg Tables.</p>
301    pub fn set_iceberg_destination_update(mut self, input: ::std::option::Option<crate::types::IcebergDestinationUpdate>) -> Self {
302        self.inner = self.inner.set_iceberg_destination_update(input);
303        self
304    }
305    /// <p>Describes an update for a destination in Apache Iceberg Tables.</p>
306    pub fn get_iceberg_destination_update(&self) -> &::std::option::Option<crate::types::IcebergDestinationUpdate> {
307        self.inner.get_iceberg_destination_update()
308    }
309}