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>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct GetAccessPointPolicyFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::get_access_point_policy::builders::GetAccessPointPolicyInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::get_access_point_policy::GetAccessPointPolicyOutput,
42        crate::operation::get_access_point_policy::GetAccessPointPolicyError,
43    > for GetAccessPointPolicyFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::get_access_point_policy::GetAccessPointPolicyOutput,
51            crate::operation::get_access_point_policy::GetAccessPointPolicyError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl GetAccessPointPolicyFluentBuilder {
58    /// Creates a new `GetAccessPointPolicyFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the GetAccessPointPolicy as a reference.
67    pub fn as_input(&self) -> &crate::operation::get_access_point_policy::builders::GetAccessPointPolicyInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::get_access_point_policy::GetAccessPointPolicyOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::get_access_point_policy::GetAccessPointPolicyError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::get_access_point_policy::GetAccessPointPolicy::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::get_access_point_policy::GetAccessPointPolicy::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::get_access_point_policy::GetAccessPointPolicyOutput,
104        crate::operation::get_access_point_policy::GetAccessPointPolicyError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <p>The account ID for the account that owns the specified access point.</p>
119    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.account_id(input.into());
121        self
122    }
123    /// <p>The account ID for the account that owns the specified access point.</p>
124    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_account_id(input);
126        self
127    }
128    /// <p>The account ID for the account that owns the specified access point.</p>
129    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_account_id()
131    }
132    /// <p>The name of the access point whose policy you want to retrieve.</p>
133    /// <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>
134    /// <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>
135    /// :
136    /// <account-id>
137    /// :outpost/
138    /// <outpost-id>
139    /// /accesspoint/
140    /// <my-accesspoint-name></my-accesspoint-name>
141    /// </outpost-id>
142    /// </account-id>
143    /// </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>
144    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
145        self.inner = self.inner.name(input.into());
146        self
147    }
148    /// <p>The name of the access point whose policy you want to retrieve.</p>
149    /// <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>
150    /// <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>
151    /// :
152    /// <account-id>
153    /// :outpost/
154    /// <outpost-id>
155    /// /accesspoint/
156    /// <my-accesspoint-name></my-accesspoint-name>
157    /// </outpost-id>
158    /// </account-id>
159    /// </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>
160    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
161        self.inner = self.inner.set_name(input);
162        self
163    }
164    /// <p>The name of the access point whose policy you want to retrieve.</p>
165    /// <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>
166    /// <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>
167    /// :
168    /// <account-id>
169    /// :outpost/
170    /// <outpost-id>
171    /// /accesspoint/
172    /// <my-accesspoint-name></my-accesspoint-name>
173    /// </outpost-id>
174    /// </account-id>
175    /// </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>
176    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_name()
178    }
179}