Skip to main content

aws_sdk_s3/operation/get_object_annotation/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_object_annotation::_get_object_annotation_input::GetObjectAnnotationInputBuilder;
3
4pub use crate::operation::get_object_annotation::_get_object_annotation_output::GetObjectAnnotationOutputBuilder;
5
6impl crate::operation::get_object_annotation::builders::GetObjectAnnotationInputBuilder {
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::get_object_annotation::GetObjectAnnotationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_object_annotation::GetObjectAnnotationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_object_annotation();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetObjectAnnotation`.
24///
25/// <p>Retrieves an annotation from an Amazon S3 object. To use this operation, you must have the <code>s3:GetObjectAnnotation</code> permission.</p>
26/// <p>If checksum mode is enabled via the <code>x-amz-checksum-mode</code> header, Amazon S3 returns the stored checksum in the response headers for client-side validation.</p><note>
27/// <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>
28/// </note>
29/// <p>The following operations are related to <code>GetObjectAnnotation</code>:</p>
30/// <ul>
31/// <li>
32/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectAnnotation.html">PutObjectAnnotation</a></p></li>
33/// <li>
34/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectAnnotations.html">ListObjectAnnotations</a></p></li>
35/// <li>
36/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectAnnotation.html">DeleteObjectAnnotation</a></p></li>
37/// </ul>
38#[derive(::std::clone::Clone, ::std::fmt::Debug)]
39pub struct GetObjectAnnotationFluentBuilder {
40    handle: ::std::sync::Arc<crate::client::Handle>,
41    inner: crate::operation::get_object_annotation::builders::GetObjectAnnotationInputBuilder,
42    config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl
45    crate::client::customize::internal::CustomizableSend<
46        crate::operation::get_object_annotation::GetObjectAnnotationOutput,
47        crate::operation::get_object_annotation::GetObjectAnnotationError,
48    > for GetObjectAnnotationFluentBuilder
49{
50    fn send(
51        self,
52        config_override: crate::config::Builder,
53    ) -> crate::client::customize::internal::BoxFuture<
54        crate::client::customize::internal::SendResult<
55            crate::operation::get_object_annotation::GetObjectAnnotationOutput,
56            crate::operation::get_object_annotation::GetObjectAnnotationError,
57        >,
58    > {
59        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60    }
61}
62impl GetObjectAnnotationFluentBuilder {
63    /// Creates a new `GetObjectAnnotationFluentBuilder`.
64    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
65        Self {
66            handle,
67            inner: ::std::default::Default::default(),
68            config_override: ::std::option::Option::None,
69        }
70    }
71    /// Access the GetObjectAnnotation as a reference.
72    pub fn as_input(&self) -> &crate::operation::get_object_annotation::builders::GetObjectAnnotationInputBuilder {
73        &self.inner
74    }
75    /// Sends the request and returns the response.
76    ///
77    /// If an error occurs, an `SdkError` will be returned with additional details that
78    /// can be matched against.
79    ///
80    /// By default, any retryable failures will be retried twice. Retry behavior
81    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
82    /// set when configuring the client.
83    pub async fn send(
84        self,
85    ) -> ::std::result::Result<
86        crate::operation::get_object_annotation::GetObjectAnnotationOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::get_object_annotation::GetObjectAnnotationError,
89            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
90        >,
91    > {
92        let input = self
93            .inner
94            .build()
95            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
96        let runtime_plugins = crate::operation::get_object_annotation::GetObjectAnnotation::operation_runtime_plugins(
97            self.handle.runtime_plugins.clone(),
98            &self.handle.conf,
99            self.config_override,
100        );
101        crate::operation::get_object_annotation::GetObjectAnnotation::orchestrate(&runtime_plugins, input).await
102    }
103
104    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
105    pub fn customize(
106        self,
107    ) -> crate::client::customize::CustomizableOperation<
108        crate::operation::get_object_annotation::GetObjectAnnotationOutput,
109        crate::operation::get_object_annotation::GetObjectAnnotationError,
110        Self,
111    > {
112        crate::client::customize::CustomizableOperation::new(self)
113    }
114    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
115        self.set_config_override(::std::option::Option::Some(config_override.into()));
116        self
117    }
118
119    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
120        self.config_override = config_override;
121        self
122    }
123    /// <p>The name of the bucket that contains the object.</p>
124    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
125        self.inner = self.inner.bucket(input.into());
126        self
127    }
128    /// <p>The name of the bucket that contains the object.</p>
129    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.inner = self.inner.set_bucket(input);
131        self
132    }
133    /// <p>The name of the bucket that contains the object.</p>
134    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_bucket()
136    }
137    /// <p>The object key.</p>
138    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
139        self.inner = self.inner.key(input.into());
140        self
141    }
142    /// <p>The object key.</p>
143    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
144        self.inner = self.inner.set_key(input);
145        self
146    }
147    /// <p>The object key.</p>
148    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
149        self.inner.get_key()
150    }
151    /// <p>The name of the annotation to retrieve.</p>
152    /// <p>Length Constraints: Minimum length of 1. Maximum length of 512 bytes.</p>
153    pub fn annotation_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
154        self.inner = self.inner.annotation_name(input.into());
155        self
156    }
157    /// <p>The name of the annotation to retrieve.</p>
158    /// <p>Length Constraints: Minimum length of 1. Maximum length of 512 bytes.</p>
159    pub fn set_annotation_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_annotation_name(input);
161        self
162    }
163    /// <p>The name of the annotation to retrieve.</p>
164    /// <p>Length Constraints: Minimum length of 1. Maximum length of 512 bytes.</p>
165    pub fn get_annotation_name(&self) -> &::std::option::Option<::std::string::String> {
166        self.inner.get_annotation_name()
167    }
168    /// <p>The version ID of the object.</p>
169    pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.inner = self.inner.version_id(input.into());
171        self
172    }
173    /// <p>The version ID of the object.</p>
174    pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175        self.inner = self.inner.set_version_id(input);
176        self
177    }
178    /// <p>The version ID of the object.</p>
179    pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
180        self.inner.get_version_id()
181    }
182    /// <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>
183    /// <p>This functionality is not supported for directory buckets.</p>
184    /// </note>
185    pub fn request_payer(mut self, input: crate::types::RequestPayer) -> Self {
186        self.inner = self.inner.request_payer(input);
187        self
188    }
189    /// <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>
190    /// <p>This functionality is not supported for directory buckets.</p>
191    /// </note>
192    pub fn set_request_payer(mut self, input: ::std::option::Option<crate::types::RequestPayer>) -> Self {
193        self.inner = self.inner.set_request_payer(input);
194        self
195    }
196    /// <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>
197    /// <p>This functionality is not supported for directory buckets.</p>
198    /// </note>
199    pub fn get_request_payer(&self) -> &::std::option::Option<crate::types::RequestPayer> {
200        self.inner.get_request_payer()
201    }
202    /// <p>The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with an HTTP 403 (Access Denied) error.</p>
203    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204        self.inner = self.inner.expected_bucket_owner(input.into());
205        self
206    }
207    /// <p>The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with an HTTP 403 (Access Denied) error.</p>
208    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209        self.inner = self.inner.set_expected_bucket_owner(input);
210        self
211    }
212    /// <p>The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with an HTTP 403 (Access Denied) error.</p>
213    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
214        self.inner.get_expected_bucket_owner()
215    }
216    /// <p>Set to <code>ENABLED</code> to validate the checksum of the annotation payload on retrieval.</p>
217    pub fn checksum_mode(mut self, input: crate::types::ChecksumMode) -> Self {
218        self.inner = self.inner.checksum_mode(input);
219        self
220    }
221    /// <p>Set to <code>ENABLED</code> to validate the checksum of the annotation payload on retrieval.</p>
222    pub fn set_checksum_mode(mut self, input: ::std::option::Option<crate::types::ChecksumMode>) -> Self {
223        self.inner = self.inner.set_checksum_mode(input);
224        self
225    }
226    /// <p>Set to <code>ENABLED</code> to validate the checksum of the annotation payload on retrieval.</p>
227    pub fn get_checksum_mode(&self) -> &::std::option::Option<crate::types::ChecksumMode> {
228        self.inner.get_checksum_mode()
229    }
230}