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.
76 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>> {
77 let input = self.inner.build().map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
78 let runtime_plugins = crate::operation::update_time_to_live::UpdateTimeToLive::operation_runtime_plugins(
79 self.handle.runtime_plugins.clone(),
80 &self.handle.conf,
81 self.config_override,
82 );
83 crate::operation::update_time_to_live::UpdateTimeToLive::orchestrate(&runtime_plugins, input).await
84 }
85
86 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
87 pub fn customize(
88 self,
89 ) -> crate::client::customize::CustomizableOperation<crate::operation::update_time_to_live::UpdateTimeToLiveOutput, crate::operation::update_time_to_live::UpdateTimeToLiveError, Self> {
90 crate::client::customize::CustomizableOperation::new(self)
91 }
92 pub(crate) fn config_override(
93 mut self,
94 config_override: impl ::std::convert::Into<crate::config::Builder>,
95 ) -> Self {
96 self.set_config_override(::std::option::Option::Some(config_override.into()));
97 self
98 }
99
100 pub(crate) fn set_config_override(
101 &mut self,
102 config_override: ::std::option::Option<crate::config::Builder>,
103 ) -> &mut Self {
104 self.config_override = config_override;
105 self
106 }
107 /// <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>
108 pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
109 self.inner = self.inner.table_name(input.into());
110 self
111 }
112 /// <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>
113 pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
114 self.inner = self.inner.set_table_name(input);
115 self
116 }
117 /// <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>
118 pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
119 self.inner.get_table_name()
120 }
121 /// <p>Represents the settings used to enable or disable Time to Live for the specified table.</p>
122 pub fn time_to_live_specification(mut self, input: crate::types::TimeToLiveSpecification) -> Self {
123 self.inner = self.inner.time_to_live_specification(input);
124 self
125 }
126 /// <p>Represents the settings used to enable or disable Time to Live for the specified table.</p>
127 pub fn set_time_to_live_specification(mut self, input: ::std::option::Option<crate::types::TimeToLiveSpecification>) -> Self {
128 self.inner = self.inner.set_time_to_live_specification(input);
129 self
130 }
131 /// <p>Represents the settings used to enable or disable Time to Live for the specified table.</p>
132 pub fn get_time_to_live_specification(&self) -> &::std::option::Option<crate::types::TimeToLiveSpecification> {
133 self.inner.get_time_to_live_specification()
134 }
135}
136