Skip to main content

aws_sdk_s3/operation/delete_object_annotation/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_object_annotation::_delete_object_annotation_input::DeleteObjectAnnotationInputBuilder;
3
4pub use crate::operation::delete_object_annotation::_delete_object_annotation_output::DeleteObjectAnnotationOutputBuilder;
5
6impl crate::operation::delete_object_annotation::builders::DeleteObjectAnnotationInputBuilder {
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_object_annotation::DeleteObjectAnnotationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::delete_object_annotation::DeleteObjectAnnotationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.delete_object_annotation();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DeleteObjectAnnotation`.
24///
25/// <p>Deletes a specific annotation from an Amazon S3 object. Use the <code>x-amz-object-if-match</code> header to perform a conditional delete that only succeeds if the object's ETag matches the provided value, preventing race conditions during concurrent updates.</p>
26/// <p>Deleting an annotation is permanent. Annotations are not independently versioned, so there is no delete marker or way to recover a deleted annotation.</p>
27/// <p>To use this operation, you must have the <code>s3:DeleteObjectAnnotation</code> permission. If the object is protected by Object Lock in governance mode, you must also include the <code>x-amz-bypass-governance-retention</code> header.</p><note>
28/// <p>Annotations are not supported by the following features: S3 Inventory Reports, API Gateway, S3 Storage Lens, Amazon S3 File Gateway, Amazon FSx, S3 on Outposts, and S3 Express One Zone (directory buckets).</p>
29/// </note>
30/// <p>The following operations are related to <code>DeleteObjectAnnotation</code>:</p>
31/// <ul>
32/// <li>
33/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectAnnotation.html">PutObjectAnnotation</a></p></li>
34/// <li>
35/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAnnotation.html">GetObjectAnnotation</a></p></li>
36/// <li>
37/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectAnnotations.html">ListObjectAnnotations</a></p></li>
38/// </ul>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct DeleteObjectAnnotationFluentBuilder {
41    handle: ::std::sync::Arc<crate::client::Handle>,
42    inner: crate::operation::delete_object_annotation::builders::DeleteObjectAnnotationInputBuilder,
43    config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46    crate::client::customize::internal::CustomizableSend<
47        crate::operation::delete_object_annotation::DeleteObjectAnnotationOutput,
48        crate::operation::delete_object_annotation::DeleteObjectAnnotationError,
49    > for DeleteObjectAnnotationFluentBuilder
50{
51    fn send(
52        self,
53        config_override: crate::config::Builder,
54    ) -> crate::client::customize::internal::BoxFuture<
55        crate::client::customize::internal::SendResult<
56            crate::operation::delete_object_annotation::DeleteObjectAnnotationOutput,
57            crate::operation::delete_object_annotation::DeleteObjectAnnotationError,
58        >,
59    > {
60        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61    }
62}
63impl DeleteObjectAnnotationFluentBuilder {
64    /// Creates a new `DeleteObjectAnnotationFluentBuilder`.
65    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66        Self {
67            handle,
68            inner: ::std::default::Default::default(),
69            config_override: ::std::option::Option::None,
70        }
71    }
72    /// Access the DeleteObjectAnnotation as a reference.
73    pub fn as_input(&self) -> &crate::operation::delete_object_annotation::builders::DeleteObjectAnnotationInputBuilder {
74        &self.inner
75    }
76    /// Sends the request and returns the response.
77    ///
78    /// If an error occurs, an `SdkError` will be returned with additional details that
79    /// can be matched against.
80    ///
81    /// By default, any retryable failures will be retried twice. Retry behavior
82    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83    /// set when configuring the client.
84    pub async fn send(
85        self,
86    ) -> ::std::result::Result<
87        crate::operation::delete_object_annotation::DeleteObjectAnnotationOutput,
88        ::aws_smithy_runtime_api::client::result::SdkError<
89            crate::operation::delete_object_annotation::DeleteObjectAnnotationError,
90            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91        >,
92    > {
93        let input = self
94            .inner
95            .build()
96            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97        let runtime_plugins = crate::operation::delete_object_annotation::DeleteObjectAnnotation::operation_runtime_plugins(
98            self.handle.runtime_plugins.clone(),
99            &self.handle.conf,
100            self.config_override,
101        );
102        crate::operation::delete_object_annotation::DeleteObjectAnnotation::orchestrate(&runtime_plugins, input).await
103    }
104
105    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106    pub fn customize(
107        self,
108    ) -> crate::client::customize::CustomizableOperation<
109        crate::operation::delete_object_annotation::DeleteObjectAnnotationOutput,
110        crate::operation::delete_object_annotation::DeleteObjectAnnotationError,
111        Self,
112    > {
113        crate::client::customize::CustomizableOperation::new(self)
114    }
115    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116        self.set_config_override(::std::option::Option::Some(config_override.into()));
117        self
118    }
119
120    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121        self.config_override = config_override;
122        self
123    }
124    /// <p>The name of the bucket that contains the object.</p>
125    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126        self.inner = self.inner.bucket(input.into());
127        self
128    }
129    /// <p>The name of the bucket that contains the object.</p>
130    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131        self.inner = self.inner.set_bucket(input);
132        self
133    }
134    /// <p>The name of the bucket that contains the object.</p>
135    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
136        self.inner.get_bucket()
137    }
138    /// <p>The object key.</p>
139    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
140        self.inner = self.inner.key(input.into());
141        self
142    }
143    /// <p>The object key.</p>
144    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
145        self.inner = self.inner.set_key(input);
146        self
147    }
148    /// <p>The object key.</p>
149    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
150        self.inner.get_key()
151    }
152    /// <p>The name of the annotation to delete. Annotation names are UTF-8 encoded and cannot start with <code>aws</code> or <code>s3</code> (case-insensitive).</p>
153    /// <p>Length Constraints: Minimum length of 1. Maximum length of 512 bytes.</p>
154    pub fn annotation_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.annotation_name(input.into());
156        self
157    }
158    /// <p>The name of the annotation to delete. Annotation names are UTF-8 encoded and cannot start with <code>aws</code> or <code>s3</code> (case-insensitive).</p>
159    /// <p>Length Constraints: Minimum length of 1. Maximum length of 512 bytes.</p>
160    pub fn set_annotation_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161        self.inner = self.inner.set_annotation_name(input);
162        self
163    }
164    /// <p>The name of the annotation to delete. Annotation names are UTF-8 encoded and cannot start with <code>aws</code> or <code>s3</code> (case-insensitive).</p>
165    /// <p>Length Constraints: Minimum length of 1. Maximum length of 512 bytes.</p>
166    pub fn get_annotation_name(&self) -> &::std::option::Option<::std::string::String> {
167        self.inner.get_annotation_name()
168    }
169    /// <p>The version ID of the object.</p>
170    pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
171        self.inner = self.inner.version_id(input.into());
172        self
173    }
174    /// <p>The version ID of the object.</p>
175    pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
176        self.inner = self.inner.set_version_id(input);
177        self
178    }
179    /// <p>The version ID of the object.</p>
180    pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
181        self.inner.get_version_id()
182    }
183    /// <p>Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html">Downloading Objects in Requester Pays Buckets</a> in the <i>Amazon S3 User Guide</i>.</p><note>
184    /// <p>This functionality is not supported for directory buckets.</p>
185    /// </note>
186    pub fn request_payer(mut self, input: crate::types::RequestPayer) -> Self {
187        self.inner = self.inner.request_payer(input);
188        self
189    }
190    /// <p>Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html">Downloading Objects in Requester Pays Buckets</a> in the <i>Amazon S3 User Guide</i>.</p><note>
191    /// <p>This functionality is not supported for directory buckets.</p>
192    /// </note>
193    pub fn set_request_payer(mut self, input: ::std::option::Option<crate::types::RequestPayer>) -> Self {
194        self.inner = self.inner.set_request_payer(input);
195        self
196    }
197    /// <p>Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. If either the source or destination S3 bucket has Requester Pays enabled, the requester will pay for the corresponding charges. For information about downloading objects from Requester Pays buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html">Downloading Objects in Requester Pays Buckets</a> in the <i>Amazon S3 User Guide</i>.</p><note>
198    /// <p>This functionality is not supported for directory buckets.</p>
199    /// </note>
200    pub fn get_request_payer(&self) -> &::std::option::Option<crate::types::RequestPayer> {
201        self.inner.get_request_payer()
202    }
203    /// <p>The account ID of the expected bucket owner.</p>
204    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205        self.inner = self.inner.expected_bucket_owner(input.into());
206        self
207    }
208    /// <p>The account ID of the expected bucket owner.</p>
209    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210        self.inner = self.inner.set_expected_bucket_owner(input);
211        self
212    }
213    /// <p>The account ID of the expected bucket owner.</p>
214    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
215        self.inner.get_expected_bucket_owner()
216    }
217    /// <p>If specified, the operation only succeeds if the object's ETag matches the provided value.</p>
218    pub fn object_if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
219        self.inner = self.inner.object_if_match(input.into());
220        self
221    }
222    /// <p>If specified, the operation only succeeds if the object's ETag matches the provided value.</p>
223    pub fn set_object_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
224        self.inner = self.inner.set_object_if_match(input);
225        self
226    }
227    /// <p>If specified, the operation only succeeds if the object's ETag matches the provided value.</p>
228    pub fn get_object_if_match(&self) -> &::std::option::Option<::std::string::String> {
229        self.inner.get_object_if_match()
230    }
231}