Skip to main content

aws_sdk_s3/operation/list_object_annotations/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_object_annotations::_list_object_annotations_input::ListObjectAnnotationsInputBuilder;
3
4pub use crate::operation::list_object_annotations::_list_object_annotations_output::ListObjectAnnotationsOutputBuilder;
5
6impl crate::operation::list_object_annotations::builders::ListObjectAnnotationsInputBuilder {
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::list_object_annotations::ListObjectAnnotationsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_object_annotations::ListObjectAnnotationsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_object_annotations();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListObjectAnnotations`.
24///
25/// <p>Lists the annotations attached to an Amazon S3 object. Results are paginated, with a maximum of 1,000 annotations per object. Use the <code>AnnotationPrefix</code> parameter to filter the results by name prefix.</p>
26/// <p>To use this operation, you must have the <code>s3:ListObjectAnnotations</code> permission.</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>ListObjectAnnotations</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_GetObjectAnnotation.html">GetObjectAnnotation</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 ListObjectAnnotationsFluentBuilder {
40    handle: ::std::sync::Arc<crate::client::Handle>,
41    inner: crate::operation::list_object_annotations::builders::ListObjectAnnotationsInputBuilder,
42    config_override: ::std::option::Option<crate::config::Builder>,
43}
44impl
45    crate::client::customize::internal::CustomizableSend<
46        crate::operation::list_object_annotations::ListObjectAnnotationsOutput,
47        crate::operation::list_object_annotations::ListObjectAnnotationsError,
48    > for ListObjectAnnotationsFluentBuilder
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::list_object_annotations::ListObjectAnnotationsOutput,
56            crate::operation::list_object_annotations::ListObjectAnnotationsError,
57        >,
58    > {
59        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
60    }
61}
62impl ListObjectAnnotationsFluentBuilder {
63    /// Creates a new `ListObjectAnnotationsFluentBuilder`.
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 ListObjectAnnotations as a reference.
72    pub fn as_input(&self) -> &crate::operation::list_object_annotations::builders::ListObjectAnnotationsInputBuilder {
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::list_object_annotations::ListObjectAnnotationsOutput,
87        ::aws_smithy_runtime_api::client::result::SdkError<
88            crate::operation::list_object_annotations::ListObjectAnnotationsError,
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::list_object_annotations::ListObjectAnnotations::operation_runtime_plugins(
97            self.handle.runtime_plugins.clone(),
98            &self.handle.conf,
99            self.config_override,
100        );
101        crate::operation::list_object_annotations::ListObjectAnnotations::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::list_object_annotations::ListObjectAnnotationsOutput,
109        crate::operation::list_object_annotations::ListObjectAnnotationsError,
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    /// Create a paginator for this request
124    ///
125    /// Paginators are used by calling [`send().await`](crate::operation::list_object_annotations::paginator::ListObjectAnnotationsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
126    pub fn into_paginator(self) -> crate::operation::list_object_annotations::paginator::ListObjectAnnotationsPaginator {
127        crate::operation::list_object_annotations::paginator::ListObjectAnnotationsPaginator::new(self.handle, self.inner)
128    }
129    /// <p>The name of the bucket that contains the object.</p>
130    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.inner = self.inner.bucket(input.into());
132        self
133    }
134    /// <p>The name of the bucket that contains the object.</p>
135    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.inner = self.inner.set_bucket(input);
137        self
138    }
139    /// <p>The name of the bucket that contains the object.</p>
140    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
141        self.inner.get_bucket()
142    }
143    /// <p>The object key.</p>
144    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.key(input.into());
146        self
147    }
148    /// <p>The object key.</p>
149    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
150        self.inner = self.inner.set_key(input);
151        self
152    }
153    /// <p>The object key.</p>
154    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
155        self.inner.get_key()
156    }
157    /// <p>The version ID of the object.</p>
158    pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
159        self.inner = self.inner.version_id(input.into());
160        self
161    }
162    /// <p>The version ID of the object.</p>
163    pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
164        self.inner = self.inner.set_version_id(input);
165        self
166    }
167    /// <p>The version ID of the object.</p>
168    pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
169        self.inner.get_version_id()
170    }
171    /// <p>The maximum number of annotations to return in the response. Maximum is 1,000.</p>
172    pub fn max_annotation_results(mut self, input: i32) -> Self {
173        self.inner = self.inner.max_annotation_results(input);
174        self
175    }
176    /// <p>The maximum number of annotations to return in the response. Maximum is 1,000.</p>
177    pub fn set_max_annotation_results(mut self, input: ::std::option::Option<i32>) -> Self {
178        self.inner = self.inner.set_max_annotation_results(input);
179        self
180    }
181    /// <p>The maximum number of annotations to return in the response. Maximum is 1,000.</p>
182    pub fn get_max_annotation_results(&self) -> &::std::option::Option<i32> {
183        self.inner.get_max_annotation_results()
184    }
185    /// <p>Filter results to annotations whose name begins with the specified prefix.</p>
186    pub fn annotation_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
187        self.inner = self.inner.annotation_prefix(input.into());
188        self
189    }
190    /// <p>Filter results to annotations whose name begins with the specified prefix.</p>
191    pub fn set_annotation_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192        self.inner = self.inner.set_annotation_prefix(input);
193        self
194    }
195    /// <p>Filter results to annotations whose name begins with the specified prefix.</p>
196    pub fn get_annotation_prefix(&self) -> &::std::option::Option<::std::string::String> {
197        self.inner.get_annotation_prefix()
198    }
199    /// <p>Continuation token returned by a previous request to retrieve the next page.</p>
200    pub fn continuation_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
201        self.inner = self.inner.continuation_token(input.into());
202        self
203    }
204    /// <p>Continuation token returned by a previous request to retrieve the next page.</p>
205    pub fn set_continuation_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206        self.inner = self.inner.set_continuation_token(input);
207        self
208    }
209    /// <p>Continuation token returned by a previous request to retrieve the next page.</p>
210    pub fn get_continuation_token(&self) -> &::std::option::Option<::std::string::String> {
211        self.inner.get_continuation_token()
212    }
213    /// <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>
214    /// <p>This functionality is not supported for directory buckets.</p>
215    /// </note>
216    pub fn request_payer(mut self, input: crate::types::RequestPayer) -> Self {
217        self.inner = self.inner.request_payer(input);
218        self
219    }
220    /// <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>
221    /// <p>This functionality is not supported for directory buckets.</p>
222    /// </note>
223    pub fn set_request_payer(mut self, input: ::std::option::Option<crate::types::RequestPayer>) -> Self {
224        self.inner = self.inner.set_request_payer(input);
225        self
226    }
227    /// <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>
228    /// <p>This functionality is not supported for directory buckets.</p>
229    /// </note>
230    pub fn get_request_payer(&self) -> &::std::option::Option<crate::types::RequestPayer> {
231        self.inner.get_request_payer()
232    }
233    /// <p>The account ID of the expected bucket owner.</p>
234    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235        self.inner = self.inner.expected_bucket_owner(input.into());
236        self
237    }
238    /// <p>The account ID of the expected bucket owner.</p>
239    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240        self.inner = self.inner.set_expected_bucket_owner(input);
241        self
242    }
243    /// <p>The account ID of the expected bucket owner.</p>
244    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
245        self.inner.get_expected_bucket_owner()
246    }
247}