aws_sdk_s3control/operation/delete_bucket_replication/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_bucket_replication::_delete_bucket_replication_output::DeleteBucketReplicationOutputBuilder;
3
4pub use crate::operation::delete_bucket_replication::_delete_bucket_replication_input::DeleteBucketReplicationInputBuilder;
5
6impl crate::operation::delete_bucket_replication::builders::DeleteBucketReplicationInputBuilder {
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::delete_bucket_replication::DeleteBucketReplicationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_bucket_replication::DeleteBucketReplicationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_bucket_replication();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteBucketReplication`.
24///
25/// <note>
26/// <p>This operation deletes an Amazon S3 on Outposts bucket's replication configuration. To delete an S3 bucket's replication configuration, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketReplication.html">DeleteBucketReplication</a> in the <i>Amazon S3 API Reference</i>.</p>
27/// </note>
28/// <p>Deletes the replication configuration from the specified S3 on Outposts bucket.</p>
29/// <p>To use this operation, you must have permissions to perform the <code>s3-outposts:PutReplicationConfiguration</code> action. The Outposts bucket owner has this permission by default and can grant it to others. For more information about permissions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsIAM.html">Setting up IAM with S3 on Outposts</a> and <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsBucketPolicy.html">Managing access to S3 on Outposts buckets</a> in the <i>Amazon S3 User Guide</i>.</p><note>
30/// <p>It can take a while to propagate <code>PUT</code> or <code>DELETE</code> requests for a replication configuration to all S3 on Outposts systems. Therefore, the replication configuration that's returned by a <code>GET</code> request soon after a <code>PUT</code> or <code>DELETE</code> request might return a more recent result than what's on the Outpost. If an Outpost is offline, the delay in updating the replication configuration on that Outpost can be significant.</p>
31/// </note>
32/// <p>All Amazon S3 on Outposts REST API requests for this action require an additional parameter of <code>x-amz-outpost-id</code> to be passed with the request. In addition, you must use an S3 on Outposts endpoint hostname prefix instead of <code>s3-control</code>. For an example of the request syntax for Amazon S3 on Outposts that uses the S3 on Outposts endpoint hostname prefix and the <code>x-amz-outpost-id</code> derived by using the access point ARN, see the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketReplication.html#API_control_DeleteBucketReplication_Examples">Examples</a> section.</p>
33/// <p>For information about S3 replication on Outposts configuration, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsReplication.html">Replicating objects for S3 on Outposts</a> in the <i>Amazon S3 User Guide</i>.</p>
34/// <p>The following operations are related to <code>DeleteBucketReplication</code>:</p>
35/// <ul>
36/// <li>
37/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketReplication.html">PutBucketReplication</a></p></li>
38/// <li>
39/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketReplication.html">GetBucketReplication</a></p></li>
40/// </ul><important>
41/// <p>You must URL encode any signed header values that contain spaces. For example, if your header value is <code>my file.txt</code>, containing two spaces after <code>my</code>, you must URL encode this value to <code>my%20%20file.txt</code>.</p>
42/// </important>
43#[derive(::std::clone::Clone, ::std::fmt::Debug)]
44pub struct DeleteBucketReplicationFluentBuilder {
45    handle: ::std::sync::Arc<crate::client::Handle>,
46    inner: crate::operation::delete_bucket_replication::builders::DeleteBucketReplicationInputBuilder,
47    config_override: ::std::option::Option<crate::config::Builder>,
48}
49impl
50    crate::client::customize::internal::CustomizableSend<
51        crate::operation::delete_bucket_replication::DeleteBucketReplicationOutput,
52        crate::operation::delete_bucket_replication::DeleteBucketReplicationError,
53    > for DeleteBucketReplicationFluentBuilder
54{
55    fn send(
56        self,
57        config_override: crate::config::Builder,
58    ) -> crate::client::customize::internal::BoxFuture<
59        crate::client::customize::internal::SendResult<
60            crate::operation::delete_bucket_replication::DeleteBucketReplicationOutput,
61            crate::operation::delete_bucket_replication::DeleteBucketReplicationError,
62        >,
63    > {
64        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
65    }
66}
67impl DeleteBucketReplicationFluentBuilder {
68    /// Creates a new `DeleteBucketReplicationFluentBuilder`.
69    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
70        Self {
71            handle,
72            inner: ::std::default::Default::default(),
73            config_override: ::std::option::Option::None,
74        }
75    }
76    /// Access the DeleteBucketReplication as a reference.
77    pub fn as_input(&self) -> &crate::operation::delete_bucket_replication::builders::DeleteBucketReplicationInputBuilder {
78        &self.inner
79    }
80    /// Sends the request and returns the response.
81    ///
82    /// If an error occurs, an `SdkError` will be returned with additional details that
83    /// can be matched against.
84    ///
85    /// By default, any retryable failures will be retried twice. Retry behavior
86    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
87    /// set when configuring the client.
88    pub async fn send(
89        self,
90    ) -> ::std::result::Result<
91        crate::operation::delete_bucket_replication::DeleteBucketReplicationOutput,
92        ::aws_smithy_runtime_api::client::result::SdkError<
93            crate::operation::delete_bucket_replication::DeleteBucketReplicationError,
94            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
95        >,
96    > {
97        let input = self
98            .inner
99            .build()
100            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
101        let runtime_plugins = crate::operation::delete_bucket_replication::DeleteBucketReplication::operation_runtime_plugins(
102            self.handle.runtime_plugins.clone(),
103            &self.handle.conf,
104            self.config_override,
105        );
106        crate::operation::delete_bucket_replication::DeleteBucketReplication::orchestrate(&runtime_plugins, input).await
107    }
108
109    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
110    pub fn customize(
111        self,
112    ) -> crate::client::customize::CustomizableOperation<
113        crate::operation::delete_bucket_replication::DeleteBucketReplicationOutput,
114        crate::operation::delete_bucket_replication::DeleteBucketReplicationError,
115        Self,
116    > {
117        crate::client::customize::CustomizableOperation::new(self)
118    }
119    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
120        self.set_config_override(::std::option::Option::Some(config_override.into()));
121        self
122    }
123
124    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
125        self.config_override = config_override;
126        self
127    }
128    /// <p>The Amazon Web Services account ID of the Outposts bucket to delete the replication configuration for.</p>
129    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130        self.inner = self.inner.account_id(input.into());
131        self
132    }
133    /// <p>The Amazon Web Services account ID of the Outposts bucket to delete the replication configuration for.</p>
134    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135        self.inner = self.inner.set_account_id(input);
136        self
137    }
138    /// <p>The Amazon Web Services account ID of the Outposts bucket to delete the replication configuration for.</p>
139    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_account_id()
141    }
142    /// <p>Specifies the S3 on Outposts bucket to delete the replication configuration for.</p>
143    /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
144    /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
145    /// :
146    /// <account-id>
147    /// :outpost/
148    /// <outpost-id>
149    /// /bucket/
150    /// <my-bucket-name></my-bucket-name>
151    /// </outpost-id>
152    /// </account-id>
153    /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</p>
154    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.bucket(input.into());
156        self
157    }
158    /// <p>Specifies the S3 on Outposts bucket to delete the replication configuration for.</p>
159    /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
160    /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
161    /// :
162    /// <account-id>
163    /// :outpost/
164    /// <outpost-id>
165    /// /bucket/
166    /// <my-bucket-name></my-bucket-name>
167    /// </outpost-id>
168    /// </account-id>
169    /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</p>
170    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
171        self.inner = self.inner.set_bucket(input);
172        self
173    }
174    /// <p>Specifies the S3 on Outposts bucket to delete the replication configuration for.</p>
175    /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
176    /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
177    /// :
178    /// <account-id>
179    /// :outpost/
180    /// <outpost-id>
181    /// /bucket/
182    /// <my-bucket-name></my-bucket-name>
183    /// </outpost-id>
184    /// </account-id>
185    /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</p>
186    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
187        self.inner.get_bucket()
188    }
189}