aws_sdk_s3tables/operation/put_table_replication/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::put_table_replication::_put_table_replication_output::PutTableReplicationOutputBuilder;
3
4pub use crate::operation::put_table_replication::_put_table_replication_input::PutTableReplicationInputBuilder;
5
6impl crate::operation::put_table_replication::builders::PutTableReplicationInputBuilder {
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::put_table_replication::PutTableReplicationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::put_table_replication::PutTableReplicationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.put_table_replication();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `PutTableReplication`.
24///
25/// <p>Creates or updates the replication configuration for a specific table. This operation allows you to define table-level replication independently of bucket-level replication, providing granular control over which tables are replicated and where.</p>
26/// <dl>
27/// <dt>
28/// Permissions
29/// </dt>
30/// <dd>
31/// <ul>
32/// <li>
33/// <p>You must have the <code>s3tables:PutTableReplication</code> permission to use this operation. The IAM role specified in the configuration must have permissions to read from the source table and write to all destination tables.</p></li>
34/// <li>
35/// <p>You must also have the following permissions:</p>
36/// <ul>
37/// <li>
38/// <p><code>s3tables:GetTable</code> permission on the source table being replicated.</p></li>
39/// <li>
40/// <p><code>s3tables:CreateTable</code> permission for the destination.</p></li>
41/// <li>
42/// <p><code>s3tables:CreateNamespace</code> permission for the destination.</p></li>
43/// <li>
44/// <p><code>s3tables:GetTableMaintenanceConfig</code> permission for the source table.</p></li>
45/// <li>
46/// <p><code>s3tables:PutTableMaintenanceConfig</code> permission for the destination table.</p></li>
47/// </ul></li>
48/// <li>
49/// <p>You must have <code>iam:PassRole</code> permission with condition allowing roles to be passed to <code>replication.s3tables.amazonaws.com</code>.</p></li>
50/// </ul>
51/// </dd>
52/// </dl>
53#[derive(::std::clone::Clone, ::std::fmt::Debug)]
54pub struct PutTableReplicationFluentBuilder {
55    handle: ::std::sync::Arc<crate::client::Handle>,
56    inner: crate::operation::put_table_replication::builders::PutTableReplicationInputBuilder,
57    config_override: ::std::option::Option<crate::config::Builder>,
58}
59impl
60    crate::client::customize::internal::CustomizableSend<
61        crate::operation::put_table_replication::PutTableReplicationOutput,
62        crate::operation::put_table_replication::PutTableReplicationError,
63    > for PutTableReplicationFluentBuilder
64{
65    fn send(
66        self,
67        config_override: crate::config::Builder,
68    ) -> crate::client::customize::internal::BoxFuture<
69        crate::client::customize::internal::SendResult<
70            crate::operation::put_table_replication::PutTableReplicationOutput,
71            crate::operation::put_table_replication::PutTableReplicationError,
72        >,
73    > {
74        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
75    }
76}
77impl PutTableReplicationFluentBuilder {
78    /// Creates a new `PutTableReplicationFluentBuilder`.
79    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
80        Self {
81            handle,
82            inner: ::std::default::Default::default(),
83            config_override: ::std::option::Option::None,
84        }
85    }
86    /// Access the PutTableReplication as a reference.
87    pub fn as_input(&self) -> &crate::operation::put_table_replication::builders::PutTableReplicationInputBuilder {
88        &self.inner
89    }
90    /// Sends the request and returns the response.
91    ///
92    /// If an error occurs, an `SdkError` will be returned with additional details that
93    /// can be matched against.
94    ///
95    /// By default, any retryable failures will be retried twice. Retry behavior
96    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
97    /// set when configuring the client.
98    pub async fn send(
99        self,
100    ) -> ::std::result::Result<
101        crate::operation::put_table_replication::PutTableReplicationOutput,
102        ::aws_smithy_runtime_api::client::result::SdkError<
103            crate::operation::put_table_replication::PutTableReplicationError,
104            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
105        >,
106    > {
107        let input = self
108            .inner
109            .build()
110            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
111        let runtime_plugins = crate::operation::put_table_replication::PutTableReplication::operation_runtime_plugins(
112            self.handle.runtime_plugins.clone(),
113            &self.handle.conf,
114            self.config_override,
115        );
116        crate::operation::put_table_replication::PutTableReplication::orchestrate(&runtime_plugins, input).await
117    }
118
119    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
120    pub fn customize(
121        self,
122    ) -> crate::client::customize::CustomizableOperation<
123        crate::operation::put_table_replication::PutTableReplicationOutput,
124        crate::operation::put_table_replication::PutTableReplicationError,
125        Self,
126    > {
127        crate::client::customize::CustomizableOperation::new(self)
128    }
129    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
130        self.set_config_override(::std::option::Option::Some(config_override.into()));
131        self
132    }
133
134    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
135        self.config_override = config_override;
136        self
137    }
138    /// <p>The Amazon Resource Name (ARN) of the source table.</p>
139    pub fn table_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.table_arn(input.into());
141        self
142    }
143    /// <p>The Amazon Resource Name (ARN) of the source table.</p>
144    pub fn set_table_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_table_arn(input);
146        self
147    }
148    /// <p>The Amazon Resource Name (ARN) of the source table.</p>
149    pub fn get_table_arn(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_table_arn()
151    }
152    /// <p>A version token from a previous GetTableReplication call. Use this token to ensure you're updating the expected version of the configuration.</p>
153    pub fn version_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.inner = self.inner.version_token(input.into());
155        self
156    }
157    /// <p>A version token from a previous GetTableReplication call. Use this token to ensure you're updating the expected version of the configuration.</p>
158    pub fn set_version_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
159        self.inner = self.inner.set_version_token(input);
160        self
161    }
162    /// <p>A version token from a previous GetTableReplication call. Use this token to ensure you're updating the expected version of the configuration.</p>
163    pub fn get_version_token(&self) -> &::std::option::Option<::std::string::String> {
164        self.inner.get_version_token()
165    }
166    /// <p>The replication configuration to apply to the table, including the IAM role and replication rules.</p>
167    pub fn configuration(mut self, input: crate::types::TableReplicationConfiguration) -> Self {
168        self.inner = self.inner.configuration(input);
169        self
170    }
171    /// <p>The replication configuration to apply to the table, including the IAM role and replication rules.</p>
172    pub fn set_configuration(mut self, input: ::std::option::Option<crate::types::TableReplicationConfiguration>) -> Self {
173        self.inner = self.inner.set_configuration(input);
174        self
175    }
176    /// <p>The replication configuration to apply to the table, including the IAM role and replication rules.</p>
177    pub fn get_configuration(&self) -> &::std::option::Option<crate::types::TableReplicationConfiguration> {
178        self.inner.get_configuration()
179    }
180}