aws_sdk_dynamodb/operation/update_time_to_live/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_time_to_live::_update_time_to_live_output::UpdateTimeToLiveOutputBuilder;
3
4pub use crate::operation::update_time_to_live::_update_time_to_live_input::UpdateTimeToLiveInputBuilder;
5
6impl crate::operation::update_time_to_live::builders::UpdateTimeToLiveInputBuilder {
7                    /// Sends a request with this input using the given client.
8                    pub async fn send_with(self, client: &crate::Client) -> ::std::result::Result<
9                        crate::operation::update_time_to_live::UpdateTimeToLiveOutput,
10                        ::aws_smithy_runtime_api::client::result::SdkError<
11                            crate::operation::update_time_to_live::UpdateTimeToLiveError,
12                            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse
13                        >
14                    > {
15                        let mut fluent_builder = client.update_time_to_live();
16                        fluent_builder.inner = self;
17                        fluent_builder.send().await
18                    }
19                }
20/// Fluent builder constructing a request to `UpdateTimeToLive`.
21/// 
22/// <p>The <code>UpdateTimeToLive</code> method enables or disables Time to Live (TTL) for the specified table. A successful <code>UpdateTimeToLive</code> call returns the current <code>TimeToLiveSpecification</code>. It can take up to one hour for the change to fully process. Any additional <code>UpdateTimeToLive</code> calls for the same table during this one hour duration result in a <code>ValidationException</code>.</p>
23/// <p>TTL compares the current time in epoch time format to the time stored in the TTL attribute of an item. If the epoch time value stored in the attribute is less than the current time, the item is marked as expired and subsequently deleted.</p><note>
24/// <p>The epoch time format is the number of seconds elapsed since 12:00:00 AM January 1, 1970 UTC.</p>
25/// </note>
26/// <p>DynamoDB deletes expired items on a best-effort basis to ensure availability of throughput for other data operations.</p><important>
27/// <p>DynamoDB typically deletes expired items within two days of expiration. The exact duration within which an item gets deleted after expiration is specific to the nature of the workload. Items that have expired and not been deleted will still show up in reads, queries, and scans.</p>
28/// </important>
29/// <p>As items are deleted, they are removed from any local secondary index and global secondary index immediately in the same eventually consistent way as a standard delete operation.</p>
30/// <p>For more information, see <a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/TTL.html">Time To Live</a> in the Amazon DynamoDB Developer Guide.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct UpdateTimeToLiveFluentBuilder {
33                handle: ::std::sync::Arc<crate::client::Handle>,
34                inner: crate::operation::update_time_to_live::builders::UpdateTimeToLiveInputBuilder,
35config_override: ::std::option::Option<crate::config::Builder>,
36            }
37impl
38                crate::client::customize::internal::CustomizableSend<
39                    crate::operation::update_time_to_live::UpdateTimeToLiveOutput,
40                    crate::operation::update_time_to_live::UpdateTimeToLiveError,
41                > for UpdateTimeToLiveFluentBuilder
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_time_to_live::UpdateTimeToLiveOutput,
49                        crate::operation::update_time_to_live::UpdateTimeToLiveError,
50                    >,
51                > {
52                    ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53                }
54            }
55impl UpdateTimeToLiveFluentBuilder {
56    /// Creates a new `UpdateTimeToLiveFluentBuilder`.
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 UpdateTimeToLive as a reference.
65                    pub fn as_input(&self) -> &crate::operation::update_time_to_live::builders::UpdateTimeToLiveInputBuilder {
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. Note: retries are enabled by default when using
76                    /// `aws_config::load_from_env()` or when using `BehaviorVersion::v2025_01_17()` or later.
77                    pub async fn send(self) -> ::std::result::Result<crate::operation::update_time_to_live::UpdateTimeToLiveOutput, ::aws_smithy_runtime_api::client::result::SdkError<crate::operation::update_time_to_live::UpdateTimeToLiveError, ::aws_smithy_runtime_api::client::orchestrator::HttpResponse>> {
78                        let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
79                        let runtime_plugins = crate::operation::update_time_to_live::UpdateTimeToLive::operation_runtime_plugins(
80                            self.handle.runtime_plugins.clone(),
81                            &self.handle.conf,
82                            self.config_override,
83                        );
84                        crate::operation::update_time_to_live::UpdateTimeToLive::orchestrate(&runtime_plugins, input).await
85                    }
86    
87                    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
88                    pub fn customize(
89                        self,
90                    ) -> crate::client::customize::CustomizableOperation<crate::operation::update_time_to_live::UpdateTimeToLiveOutput, crate::operation::update_time_to_live::UpdateTimeToLiveError, Self> {
91                        crate::client::customize::CustomizableOperation::new(self)
92                    }
93    pub(crate) fn config_override(
94                            mut self,
95                            config_override: impl ::std::convert::Into<crate::config::Builder>,
96                        ) -> Self {
97                            self.set_config_override(::std::option::Option::Some(config_override.into()));
98                            self
99                        }
100    
101                        pub(crate) fn set_config_override(
102                            &mut self,
103                            config_override: ::std::option::Option<crate::config::Builder>,
104                        ) -> &mut Self {
105                            self.config_override = config_override;
106                            self
107                        }
108    /// <p>The name of the table to be configured. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
109    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
110                    self.inner = self.inner.table_name(input.into());
111                    self
112                }
113    /// <p>The name of the table to be configured. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
114    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
115                    self.inner = self.inner.set_table_name(input);
116                    self
117                }
118    /// <p>The name of the table to be configured. You can also provide the Amazon Resource Name (ARN) of the table in this parameter.</p>
119    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
120                    self.inner.get_table_name()
121                }
122    /// <p>Represents the settings used to enable or disable Time to Live for the specified table.</p>
123    pub fn time_to_live_specification(mut self, input: crate::types::TimeToLiveSpecification) -> Self {
124                    self.inner = self.inner.time_to_live_specification(input);
125                    self
126                }
127    /// <p>Represents the settings used to enable or disable Time to Live for the specified table.</p>
128    pub fn set_time_to_live_specification(mut self, input: ::std::option::Option<crate::types::TimeToLiveSpecification>) -> Self {
129                    self.inner = self.inner.set_time_to_live_specification(input);
130                    self
131                }
132    /// <p>Represents the settings used to enable or disable Time to Live for the specified table.</p>
133    pub fn get_time_to_live_specification(&self) -> &::std::option::Option<crate::types::TimeToLiveSpecification> {
134                    self.inner.get_time_to_live_specification()
135                }
136}
137