aws_sdk_s3control/operation/get_access_point_policy/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_access_point_policy::_get_access_point_policy_output::GetAccessPointPolicyOutputBuilder;
3
4pub use crate::operation::get_access_point_policy::_get_access_point_policy_input::GetAccessPointPolicyInputBuilder;
5
6impl crate::operation::get_access_point_policy::builders::GetAccessPointPolicyInputBuilder {
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_access_point_policy::GetAccessPointPolicyOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_access_point_policy::GetAccessPointPolicyError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_access_point_policy();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetAccessPointPolicy`.
24///
25/// <p>Returns the access point policy associated with the specified access point.</p>
26/// <p>The following actions are related to <code>GetAccessPointPolicy</code>:</p>
27/// <ul>
28/// <li>
29/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html">PutAccessPointPolicy</a></p></li>
30/// <li>
31/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicy.html">DeleteAccessPointPolicy</a></p></li>
32/// </ul><important>
33/// <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>
34/// </important>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct GetAccessPointPolicyFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::get_access_point_policy::builders::GetAccessPointPolicyInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::get_access_point_policy::GetAccessPointPolicyOutput,
44        crate::operation::get_access_point_policy::GetAccessPointPolicyError,
45    > for GetAccessPointPolicyFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::get_access_point_policy::GetAccessPointPolicyOutput,
53            crate::operation::get_access_point_policy::GetAccessPointPolicyError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl GetAccessPointPolicyFluentBuilder {
60    /// Creates a new `GetAccessPointPolicyFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the GetAccessPointPolicy as a reference.
69    pub fn as_input(&self) -> &crate::operation::get_access_point_policy::builders::GetAccessPointPolicyInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::get_access_point_policy::GetAccessPointPolicyOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::get_access_point_policy::GetAccessPointPolicyError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::get_access_point_policy::GetAccessPointPolicy::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::get_access_point_policy::GetAccessPointPolicy::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::get_access_point_policy::GetAccessPointPolicyOutput,
106        crate::operation::get_access_point_policy::GetAccessPointPolicyError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <p>The account ID for the account that owns the specified access point.</p>
121    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.account_id(input.into());
123        self
124    }
125    /// <p>The account ID for the account that owns the specified access point.</p>
126    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_account_id(input);
128        self
129    }
130    /// <p>The account ID for the account that owns the specified access point.</p>
131    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_account_id()
133    }
134    /// <p>The name of the access point whose policy you want to retrieve.</p>
135    /// <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>
136    /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the access point accessed in the format <code>arn:aws:s3-outposts:<region>
137    /// :
138    /// <account-id>
139    /// :outpost/
140    /// <outpost-id>
141    /// /accesspoint/
142    /// <my-accesspoint-name></my-accesspoint-name>
143    /// </outpost-id>
144    /// </account-id>
145    /// </region></code>. For example, to access the access point <code>reports-ap</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/accesspoint/reports-ap</code>. The value must be URL encoded.</p>
146    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.inner = self.inner.name(input.into());
148        self
149    }
150    /// <p>The name of the access point whose policy you want to retrieve.</p>
151    /// <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>
152    /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the access point accessed in the format <code>arn:aws:s3-outposts:<region>
153    /// :
154    /// <account-id>
155    /// :outpost/
156    /// <outpost-id>
157    /// /accesspoint/
158    /// <my-accesspoint-name></my-accesspoint-name>
159    /// </outpost-id>
160    /// </account-id>
161    /// </region></code>. For example, to access the access point <code>reports-ap</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/accesspoint/reports-ap</code>. The value must be URL encoded.</p>
162    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
163        self.inner = self.inner.set_name(input);
164        self
165    }
166    /// <p>The name of the access point whose policy you want to retrieve.</p>
167    /// <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>
168    /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the access point accessed in the format <code>arn:aws:s3-outposts:<region>
169    /// :
170    /// <account-id>
171    /// :outpost/
172    /// <outpost-id>
173    /// /accesspoint/
174    /// <my-accesspoint-name></my-accesspoint-name>
175    /// </outpost-id>
176    /// </account-id>
177    /// </region></code>. For example, to access the access point <code>reports-ap</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/accesspoint/reports-ap</code>. The value must be URL encoded.</p>
178    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
179        self.inner.get_name()
180    }
181}