1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_bucket_request_payment::_get_bucket_request_payment_output::GetBucketRequestPaymentOutputBuilder;
34pub use crate::operation::get_bucket_request_payment::_get_bucket_request_payment_input::GetBucketRequestPaymentInputBuilder;
56impl crate::operation::get_bucket_request_payment::builders::GetBucketRequestPaymentInputBuilder {
7/// Sends a request with this input using the given client.
8pub async fn send_with(
9self,
10 client: &crate::Client,
11 ) -> ::std::result::Result<
12crate::operation::get_bucket_request_payment::GetBucketRequestPaymentOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14crate::operation::get_bucket_request_payment::GetBucketRequestPaymentError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18let mut fluent_builder = client.get_bucket_request_payment();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21}
22}
23/// Fluent builder constructing a request to `GetBucketRequestPayment`.
24///
25/// <note>
26/// <p>This operation is not supported for directory buckets.</p>
27/// </note>
28/// <p>Returns the request payment configuration of a bucket. To use this version of the operation, you must be the bucket owner. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/RequesterPaysBuckets.html">Requester Pays Buckets</a>.</p>
29/// <p>The following operations are related to <code>GetBucketRequestPayment</code>:</p>
30/// <ul>
31/// <li>
32/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html">ListObjects</a></p></li>
33/// </ul>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct GetBucketRequestPaymentFluentBuilder {
36 handle: ::std::sync::Arc<crate::client::Handle>,
37 inner: crate::operation::get_bucket_request_payment::builders::GetBucketRequestPaymentInputBuilder,
38 config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41crate::client::customize::internal::CustomizableSend<
42crate::operation::get_bucket_request_payment::GetBucketRequestPaymentOutput,
43crate::operation::get_bucket_request_payment::GetBucketRequestPaymentError,
44 > for GetBucketRequestPaymentFluentBuilder
45{
46fn send(
47self,
48 config_override: crate::config::Builder,
49 ) -> crate::client::customize::internal::BoxFuture<
50crate::client::customize::internal::SendResult<
51crate::operation::get_bucket_request_payment::GetBucketRequestPaymentOutput,
52crate::operation::get_bucket_request_payment::GetBucketRequestPaymentError,
53 >,
54 > {
55 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56 }
57}
58impl GetBucketRequestPaymentFluentBuilder {
59/// Creates a new `GetBucketRequestPaymentFluentBuilder`.
60pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61Self {
62 handle,
63 inner: ::std::default::Default::default(),
64 config_override: ::std::option::Option::None,
65 }
66 }
67/// Access the GetBucketRequestPayment as a reference.
68pub fn as_input(&self) -> &crate::operation::get_bucket_request_payment::builders::GetBucketRequestPaymentInputBuilder {
69&self.inner
70 }
71/// Sends the request and returns the response.
72 ///
73 /// If an error occurs, an `SdkError` will be returned with additional details that
74 /// can be matched against.
75 ///
76 /// By default, any retryable failures will be retried twice. Retry behavior
77 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78 /// set when configuring the client.
79pub async fn send(
80self,
81 ) -> ::std::result::Result<
82crate::operation::get_bucket_request_payment::GetBucketRequestPaymentOutput,
83 ::aws_smithy_runtime_api::client::result::SdkError<
84crate::operation::get_bucket_request_payment::GetBucketRequestPaymentError,
85 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86 >,
87 > {
88let input = self
89.inner
90 .build()
91 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92let runtime_plugins = crate::operation::get_bucket_request_payment::GetBucketRequestPayment::operation_runtime_plugins(
93self.handle.runtime_plugins.clone(),
94&self.handle.conf,
95self.config_override,
96 );
97crate::operation::get_bucket_request_payment::GetBucketRequestPayment::orchestrate(&runtime_plugins, input).await
98}
99100/// Consumes this builder, creating a customizable operation that can be modified before being sent.
101pub fn customize(
102self,
103 ) -> crate::client::customize::CustomizableOperation<
104crate::operation::get_bucket_request_payment::GetBucketRequestPaymentOutput,
105crate::operation::get_bucket_request_payment::GetBucketRequestPaymentError,
106Self,
107 > {
108crate::client::customize::CustomizableOperation::new(self)
109 }
110pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111self.set_config_override(::std::option::Option::Some(config_override.into()));
112self
113}
114115pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116self.config_override = config_override;
117self
118}
119/// <p>The name of the bucket for which to get the payment request configuration</p>
120pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121self.inner = self.inner.bucket(input.into());
122self
123}
124/// <p>The name of the bucket for which to get the payment request configuration</p>
125pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126self.inner = self.inner.set_bucket(input);
127self
128}
129/// <p>The name of the bucket for which to get the payment request configuration</p>
130pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
131self.inner.get_bucket()
132 }
133/// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
134pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135self.inner = self.inner.expected_bucket_owner(input.into());
136self
137}
138/// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
139pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
140self.inner = self.inner.set_expected_bucket_owner(input);
141self
142}
143/// <p>The account ID of the expected bucket owner. If the account ID that you provide does not match the actual owner of the bucket, the request fails with the HTTP status code <code>403 Forbidden</code> (access denied).</p>
144pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
145self.inner.get_expected_bucket_owner()
146 }
147}