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