aws_sdk_s3/operation/delete_object/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::delete_object::_delete_object_output::DeleteObjectOutputBuilder;
3
4pub use crate::operation::delete_object::_delete_object_input::DeleteObjectInputBuilder;
5
6impl crate::operation::delete_object::builders::DeleteObjectInputBuilder {
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_object::DeleteObjectOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::delete_object::DeleteObjectError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.delete_object();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `DeleteObject`.
24///
25/// <p>Removes an object from a bucket. The behavior depends on the bucket's versioning state:</p>
26/// <ul>
27/// <li>
28/// <p>If bucket versioning is not enabled, the operation permanently deletes the object.</p></li>
29/// <li>
30/// <p>If bucket versioning is enabled, the operation inserts a delete marker, which becomes the current version of the object. To permanently delete an object in a versioned bucket, you must include the object’s <code>versionId</code> in the request. For more information about versioning-enabled buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectVersions.html">Deleting object versions from a versioning-enabled bucket</a>.</p></li>
31/// <li>
32/// <p>If bucket versioning is suspended, the operation removes the object that has a null <code>versionId</code>, if there is one, and inserts a delete marker that becomes the current version of the object. If there isn't an object with a null <code>versionId</code>, and all versions of the object have a <code>versionId</code>, Amazon S3 does not remove the object and only inserts a delete marker. To permanently delete an object that has a <code>versionId</code>, you must include the object’s <code>versionId</code> in the request. For more information about versioning-suspended buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/DeletingObjectsfromVersioningSuspendedBuckets.html">Deleting objects from versioning-suspended buckets</a>.</p></li>
33/// </ul><note>
34/// <ul>
35/// <li>
36/// <p><b>Directory buckets</b> - S3 Versioning isn't enabled and supported for directory buckets. For this API operation, only the <code>null</code> value of the version ID is supported by directory buckets. You can only specify <code>null</code> to the <code>versionId</code> query parameter in the request.</p></li>
37/// <li>
38/// <p><b>Directory buckets</b> - For directory buckets, you must make requests for this API operation to the Zonal endpoint. These endpoints support virtual-hosted-style requests in the format <code>https://<i>amzn-s3-demo-bucket</i>.s3express-<i>zone-id</i>.<i>region-code</i>.amazonaws.com/<i>key-name</i> </code>. Path-style requests are not supported. For more information about endpoints in Availability Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/endpoint-directory-buckets-AZ.html">Regional and Zonal endpoints for directory buckets in Availability Zones</a> in the <i>Amazon S3 User Guide</i>. For more information about endpoints in Local Zones, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-lzs-for-directory-buckets.html">Concepts for directory buckets in Local Zones</a> in the <i>Amazon S3 User Guide</i>.</p></li>
39/// </ul>
40/// </note>
41/// <p>To remove a specific version, you must use the <code>versionId</code> query parameter. Using this query parameter permanently deletes the version. If the object deleted is a delete marker, Amazon S3 sets the response header <code>x-amz-delete-marker</code> to true.</p>
42/// <p>If the object you want to delete is in a bucket where the bucket versioning configuration is MFA Delete enabled, you must include the <code>x-amz-mfa</code> request header in the DELETE <code>versionId</code> request. Requests that include <code>x-amz-mfa</code> must use HTTPS. For more information about MFA Delete, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMFADelete.html">Using MFA Delete</a> in the <i>Amazon S3 User Guide</i>. To see sample requests that use versioning, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectDELETE.html#ExampleVersionObjectDelete">Sample Request</a>.</p><note>
43/// <p><b>Directory buckets</b> - MFA delete is not supported by directory buckets.</p>
44/// </note>
45/// <p>You can delete objects by explicitly calling DELETE Object or calling (<a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html">PutBucketLifecycle</a>) to enable Amazon S3 to remove them for you. If you want to block users or accounts from removing or deleting objects from your bucket, you must deny them the <code>s3:DeleteObject</code>, <code>s3:DeleteObjectVersion</code>, and <code>s3:PutLifeCycleConfiguration</code> actions.</p><note>
46/// <p><b>Directory buckets</b> - S3 Lifecycle is not supported by directory buckets.</p>
47/// </note>
48/// <dl>
49/// <dt>
50/// Permissions
51/// </dt>
52/// <dd>
53/// <ul>
54/// <li>
55/// <p><b>General purpose bucket permissions</b> - The following permissions are required in your policies when your <code>DeleteObjects</code> request includes specific headers.</p>
56/// <ul>
57/// <li>
58/// <p><b> <code>s3:DeleteObject</code> </b> - To delete an object from a bucket, you must always have the <code>s3:DeleteObject</code> permission.</p></li>
59/// <li>
60/// <p><b> <code>s3:DeleteObjectVersion</code> </b> - To delete a specific version of an object from a versioning-enabled bucket, you must have the <code>s3:DeleteObjectVersion</code> permission.</p><note>
61/// <p>If the <code>s3:DeleteObject</code> or <code>s3:DeleteObjectVersion</code> permissions are explicitly denied in your bucket policy, attempts to delete any unversioned objects result in a <code>403 Access Denied</code> error.</p>
62/// </note></li>
63/// </ul></li>
64/// <li>
65/// <p><b>Directory bucket permissions</b> - To grant access to this API operation on a directory bucket, we recommend that you use the <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html"> <code>CreateSession</code> </a> API operation for session-based authorization. Specifically, you grant the <code>s3express:CreateSession</code> permission to the directory bucket in a bucket policy or an IAM identity-based policy. Then, you make the <code>CreateSession</code> API call on the bucket to obtain a session token. With the session token in your request header, you can make API requests to this operation. After the session token expires, you make another <code>CreateSession</code> API call to generate a new session token for use. Amazon Web Services CLI or SDKs create session and refresh the session token automatically to avoid service interruptions when a session expires. For more information about authorization, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateSession.html"> <code>CreateSession</code> </a>.</p></li>
66/// </ul>
67/// </dd>
68/// <dt>
69/// HTTP Host header syntax
70/// </dt>
71/// <dd>
72/// <p><b>Directory buckets </b> - The HTTP Host header syntax is <code> <i>Bucket-name</i>.s3express-<i>zone-id</i>.<i>region-code</i>.amazonaws.com</code>.</p>
73/// </dd>
74/// </dl>
75/// <p>The following action is related to <code>DeleteObject</code>:</p>
76/// <ul>
77/// <li>
78/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html">PutObject</a></p></li>
79/// </ul><important>
80/// <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>
81/// </important> <note>
82/// <p>The <code>If-Match</code> header is supported for both general purpose and directory buckets. <code>IfMatchLastModifiedTime</code> and <code>IfMatchSize</code> is only supported for directory buckets.</p>
83/// </note>
84#[derive(::std::clone::Clone, ::std::fmt::Debug)]
85pub struct DeleteObjectFluentBuilder {
86 handle: ::std::sync::Arc<crate::client::Handle>,
87 inner: crate::operation::delete_object::builders::DeleteObjectInputBuilder,
88 config_override: ::std::option::Option<crate::config::Builder>,
89}
90impl
91 crate::client::customize::internal::CustomizableSend<
92 crate::operation::delete_object::DeleteObjectOutput,
93 crate::operation::delete_object::DeleteObjectError,
94 > for DeleteObjectFluentBuilder
95{
96 fn send(
97 self,
98 config_override: crate::config::Builder,
99 ) -> crate::client::customize::internal::BoxFuture<
100 crate::client::customize::internal::SendResult<
101 crate::operation::delete_object::DeleteObjectOutput,
102 crate::operation::delete_object::DeleteObjectError,
103 >,
104 > {
105 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
106 }
107}
108impl DeleteObjectFluentBuilder {
109 /// Creates a new `DeleteObjectFluentBuilder`.
110 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
111 Self {
112 handle,
113 inner: ::std::default::Default::default(),
114 config_override: ::std::option::Option::None,
115 }
116 }
117 /// Access the DeleteObject as a reference.
118 pub fn as_input(&self) -> &crate::operation::delete_object::builders::DeleteObjectInputBuilder {
119 &self.inner
120 }
121 /// Sends the request and returns the response.
122 ///
123 /// If an error occurs, an `SdkError` will be returned with additional details that
124 /// can be matched against.
125 ///
126 /// By default, any retryable failures will be retried twice. Retry behavior
127 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
128 /// set when configuring the client.
129 pub async fn send(
130 self,
131 ) -> ::std::result::Result<
132 crate::operation::delete_object::DeleteObjectOutput,
133 ::aws_smithy_runtime_api::client::result::SdkError<
134 crate::operation::delete_object::DeleteObjectError,
135 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
136 >,
137 > {
138 let input = self
139 .inner
140 .build()
141 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
142 let runtime_plugins = crate::operation::delete_object::DeleteObject::operation_runtime_plugins(
143 self.handle.runtime_plugins.clone(),
144 &self.handle.conf,
145 self.config_override,
146 );
147 crate::operation::delete_object::DeleteObject::orchestrate(&runtime_plugins, input).await
148 }
149
150 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
151 pub fn customize(
152 self,
153 ) -> crate::client::customize::CustomizableOperation<
154 crate::operation::delete_object::DeleteObjectOutput,
155 crate::operation::delete_object::DeleteObjectError,
156 Self,
157 > {
158 crate::client::customize::CustomizableOperation::new(self)
159 }
160 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
161 self.set_config_override(::std::option::Option::Some(config_override.into()));
162 self
163 }
164
165 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
166 self.config_override = config_override;
167 self
168 }
169 ///
170 /// Creates a presigned request for this operation.
171 ///
172 /// The `presigning_config` provides additional presigning-specific config values, such as the
173 /// amount of time the request should be valid for after creation.
174 ///
175 /// Presigned requests can be given to other users or applications to access a resource or perform
176 /// an operation without having access to the AWS security credentials.
177 ///
178 /// _Important:_ If you're using credentials that can expire, such as those from STS AssumeRole or SSO, then
179 /// the presigned request can only be valid for as long as the credentials used to create it are.
180 ///
181 #[allow(unused_mut)]
182 pub async fn presigned(
183 mut self,
184 presigning_config: crate::presigning::PresigningConfig,
185 ) -> ::std::result::Result<
186 crate::presigning::PresignedRequest,
187 ::aws_smithy_runtime_api::client::result::SdkError<
188 crate::operation::delete_object::DeleteObjectError,
189 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
190 >,
191 > {
192 let runtime_plugins = crate::operation::delete_object::DeleteObject::operation_runtime_plugins(
193 self.handle.runtime_plugins.clone(),
194 &self.handle.conf,
195 self.config_override,
196 )
197 .with_client_plugin(crate::presigning_interceptors::SigV4PresigningRuntimePlugin::new(
198 presigning_config,
199 ::aws_sigv4::http_request::SignableBody::UnsignedPayload,
200 ));
201
202 let input = self
203 .inner
204 .build()
205 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
206 let mut context = crate::operation::delete_object::DeleteObject::orchestrate_with_stop_point(
207 &runtime_plugins,
208 input,
209 ::aws_smithy_runtime::client::orchestrator::StopPoint::BeforeTransmit,
210 )
211 .await
212 .map_err(|err| {
213 err.map_service_error(|err| {
214 err.downcast::<crate::operation::delete_object::DeleteObjectError>()
215 .expect("correct error type")
216 })
217 })?;
218 let request = context.take_request().expect("request set before transmit");
219 crate::presigning::PresignedRequest::new(request).map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)
220 }
221 /// <p>The bucket name of the bucket containing the object.</p>
222 /// <p><b>Directory buckets</b> - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format <code> <i>Bucket-name</i>.s3express-<i>zone-id</i>.<i>region-code</i>.amazonaws.com</code>. Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>amzn-s3-demo-bucket</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i>.</p>
223 /// <p><b>Access points</b> - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.s3-accesspoint.<i>Region</i>.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html">Using access points</a> in the <i>Amazon S3 User Guide</i>.</p><note>
224 /// <p>Object Lambda access points are not supported by directory buckets.</p>
225 /// </note>
226 /// <p><b>S3 on Outposts</b> - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form <code> <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com</code>. When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">What is S3 on Outposts?</a> in the <i>Amazon S3 User Guide</i>.</p>
227 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
228 self.inner = self.inner.bucket(input.into());
229 self
230 }
231 /// <p>The bucket name of the bucket containing the object.</p>
232 /// <p><b>Directory buckets</b> - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format <code> <i>Bucket-name</i>.s3express-<i>zone-id</i>.<i>region-code</i>.amazonaws.com</code>. Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>amzn-s3-demo-bucket</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i>.</p>
233 /// <p><b>Access points</b> - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.s3-accesspoint.<i>Region</i>.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html">Using access points</a> in the <i>Amazon S3 User Guide</i>.</p><note>
234 /// <p>Object Lambda access points are not supported by directory buckets.</p>
235 /// </note>
236 /// <p><b>S3 on Outposts</b> - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form <code> <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com</code>. When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">What is S3 on Outposts?</a> in the <i>Amazon S3 User Guide</i>.</p>
237 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
238 self.inner = self.inner.set_bucket(input);
239 self
240 }
241 /// <p>The bucket name of the bucket containing the object.</p>
242 /// <p><b>Directory buckets</b> - When you use this operation with a directory bucket, you must use virtual-hosted-style requests in the format <code> <i>Bucket-name</i>.s3express-<i>zone-id</i>.<i>region-code</i>.amazonaws.com</code>. Path-style requests are not supported. Directory bucket names must be unique in the chosen Zone (Availability Zone or Local Zone). Bucket names must follow the format <code> <i>bucket-base-name</i>--<i>zone-id</i>--x-s3</code> (for example, <code> <i>amzn-s3-demo-bucket</i>--<i>usw2-az1</i>--x-s3</code>). For information about bucket naming restrictions, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-bucket-naming-rules.html">Directory bucket naming rules</a> in the <i>Amazon S3 User Guide</i>.</p>
243 /// <p><b>Access points</b> - When you use this action with an access point for general purpose buckets, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. When you use this action with an access point for directory buckets, you must provide the access point name in place of the bucket name. When using the access point ARN, you must direct requests to the access point hostname. The access point hostname takes the form <i>AccessPointName</i>-<i>AccountId</i>.s3-accesspoint.<i>Region</i>.amazonaws.com. When using this action with an access point through the Amazon Web Services SDKs, you provide the access point ARN in place of the bucket name. For more information about access point ARNs, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html">Using access points</a> in the <i>Amazon S3 User Guide</i>.</p><note>
244 /// <p>Object Lambda access points are not supported by directory buckets.</p>
245 /// </note>
246 /// <p><b>S3 on Outposts</b> - When you use this action with S3 on Outposts, you must direct requests to the S3 on Outposts hostname. The S3 on Outposts hostname takes the form <code> <i>AccessPointName</i>-<i>AccountId</i>.<i>outpostID</i>.s3-outposts.<i>Region</i>.amazonaws.com</code>. When you use this action with S3 on Outposts, the destination bucket must be the Outposts access point ARN or the access point alias. For more information about S3 on Outposts, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html">What is S3 on Outposts?</a> in the <i>Amazon S3 User Guide</i>.</p>
247 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
248 self.inner.get_bucket()
249 }
250 /// <p>Key name of the object to delete.</p>
251 pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
252 self.inner = self.inner.key(input.into());
253 self
254 }
255 /// <p>Key name of the object to delete.</p>
256 pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
257 self.inner = self.inner.set_key(input);
258 self
259 }
260 /// <p>Key name of the object to delete.</p>
261 pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
262 self.inner.get_key()
263 }
264 /// <p>The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. Required to permanently delete a versioned object if versioning is configured with MFA delete enabled.</p><note>
265 /// <p>This functionality is not supported for directory buckets.</p>
266 /// </note>
267 pub fn mfa(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
268 self.inner = self.inner.mfa(input.into());
269 self
270 }
271 /// <p>The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. Required to permanently delete a versioned object if versioning is configured with MFA delete enabled.</p><note>
272 /// <p>This functionality is not supported for directory buckets.</p>
273 /// </note>
274 pub fn set_mfa(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
275 self.inner = self.inner.set_mfa(input);
276 self
277 }
278 /// <p>The concatenation of the authentication device's serial number, a space, and the value that is displayed on your authentication device. Required to permanently delete a versioned object if versioning is configured with MFA delete enabled.</p><note>
279 /// <p>This functionality is not supported for directory buckets.</p>
280 /// </note>
281 pub fn get_mfa(&self) -> &::std::option::Option<::std::string::String> {
282 self.inner.get_mfa()
283 }
284 /// <p>Version ID used to reference a specific version of the object.</p><note>
285 /// <p>For directory buckets in this API operation, only the <code>null</code> value of the version ID is supported.</p>
286 /// </note>
287 pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
288 self.inner = self.inner.version_id(input.into());
289 self
290 }
291 /// <p>Version ID used to reference a specific version of the object.</p><note>
292 /// <p>For directory buckets in this API operation, only the <code>null</code> value of the version ID is supported.</p>
293 /// </note>
294 pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
295 self.inner = self.inner.set_version_id(input);
296 self
297 }
298 /// <p>Version ID used to reference a specific version of the object.</p><note>
299 /// <p>For directory buckets in this API operation, only the <code>null</code> value of the version ID is supported.</p>
300 /// </note>
301 pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
302 self.inner.get_version_id()
303 }
304 /// <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 corresponding charges to copy the object. 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>
305 /// <p>This functionality is not supported for directory buckets.</p>
306 /// </note>
307 pub fn request_payer(mut self, input: crate::types::RequestPayer) -> Self {
308 self.inner = self.inner.request_payer(input);
309 self
310 }
311 /// <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 corresponding charges to copy the object. 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>
312 /// <p>This functionality is not supported for directory buckets.</p>
313 /// </note>
314 pub fn set_request_payer(mut self, input: ::std::option::Option<crate::types::RequestPayer>) -> Self {
315 self.inner = self.inner.set_request_payer(input);
316 self
317 }
318 /// <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 corresponding charges to copy the object. 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>
319 /// <p>This functionality is not supported for directory buckets.</p>
320 /// </note>
321 pub fn get_request_payer(&self) -> &::std::option::Option<crate::types::RequestPayer> {
322 self.inner.get_request_payer()
323 }
324 /// <p>Indicates whether S3 Object Lock should bypass Governance-mode restrictions to process this operation. To use this header, you must have the <code>s3:BypassGovernanceRetention</code> permission.</p><note>
325 /// <p>This functionality is not supported for directory buckets.</p>
326 /// </note>
327 pub fn bypass_governance_retention(mut self, input: bool) -> Self {
328 self.inner = self.inner.bypass_governance_retention(input);
329 self
330 }
331 /// <p>Indicates whether S3 Object Lock should bypass Governance-mode restrictions to process this operation. To use this header, you must have the <code>s3:BypassGovernanceRetention</code> permission.</p><note>
332 /// <p>This functionality is not supported for directory buckets.</p>
333 /// </note>
334 pub fn set_bypass_governance_retention(mut self, input: ::std::option::Option<bool>) -> Self {
335 self.inner = self.inner.set_bypass_governance_retention(input);
336 self
337 }
338 /// <p>Indicates whether S3 Object Lock should bypass Governance-mode restrictions to process this operation. To use this header, you must have the <code>s3:BypassGovernanceRetention</code> permission.</p><note>
339 /// <p>This functionality is not supported for directory buckets.</p>
340 /// </note>
341 pub fn get_bypass_governance_retention(&self) -> &::std::option::Option<bool> {
342 self.inner.get_bypass_governance_retention()
343 }
344 /// <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>
345 pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
346 self.inner = self.inner.expected_bucket_owner(input.into());
347 self
348 }
349 /// <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>
350 pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
351 self.inner = self.inner.set_expected_bucket_owner(input);
352 self
353 }
354 /// <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>
355 pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
356 self.inner.get_expected_bucket_owner()
357 }
358 /// <p>Deletes the object if the ETag (entity tag) value provided during the delete operation matches the ETag of the object in S3. If the ETag values do not match, the operation returns a <code>412 Precondition Failed</code> error.</p>
359 /// <p>Expects the ETag value as a string. <code>If-Match</code> does accept a string value of an '*' (asterisk) character to denote a match of any ETag.</p>
360 /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
361 pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
362 self.inner = self.inner.if_match(input.into());
363 self
364 }
365 /// <p>Deletes the object if the ETag (entity tag) value provided during the delete operation matches the ETag of the object in S3. If the ETag values do not match, the operation returns a <code>412 Precondition Failed</code> error.</p>
366 /// <p>Expects the ETag value as a string. <code>If-Match</code> does accept a string value of an '*' (asterisk) character to denote a match of any ETag.</p>
367 /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
368 pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
369 self.inner = self.inner.set_if_match(input);
370 self
371 }
372 /// <p>Deletes the object if the ETag (entity tag) value provided during the delete operation matches the ETag of the object in S3. If the ETag values do not match, the operation returns a <code>412 Precondition Failed</code> error.</p>
373 /// <p>Expects the ETag value as a string. <code>If-Match</code> does accept a string value of an '*' (asterisk) character to denote a match of any ETag.</p>
374 /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
375 pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
376 self.inner.get_if_match()
377 }
378 /// <p>If present, the object is deleted only if its modification times matches the provided <code>Timestamp</code>. If the <code>Timestamp</code> values do not match, the operation returns a <code>412 Precondition Failed</code> error. If the <code>Timestamp</code> matches or if the object doesn’t exist, the operation returns a <code>204 Success (No Content)</code> response.</p><note>
379 /// <p>This functionality is only supported for directory buckets.</p>
380 /// </note>
381 pub fn if_match_last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
382 self.inner = self.inner.if_match_last_modified_time(input);
383 self
384 }
385 /// <p>If present, the object is deleted only if its modification times matches the provided <code>Timestamp</code>. If the <code>Timestamp</code> values do not match, the operation returns a <code>412 Precondition Failed</code> error. If the <code>Timestamp</code> matches or if the object doesn’t exist, the operation returns a <code>204 Success (No Content)</code> response.</p><note>
386 /// <p>This functionality is only supported for directory buckets.</p>
387 /// </note>
388 pub fn set_if_match_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
389 self.inner = self.inner.set_if_match_last_modified_time(input);
390 self
391 }
392 /// <p>If present, the object is deleted only if its modification times matches the provided <code>Timestamp</code>. If the <code>Timestamp</code> values do not match, the operation returns a <code>412 Precondition Failed</code> error. If the <code>Timestamp</code> matches or if the object doesn’t exist, the operation returns a <code>204 Success (No Content)</code> response.</p><note>
393 /// <p>This functionality is only supported for directory buckets.</p>
394 /// </note>
395 pub fn get_if_match_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
396 self.inner.get_if_match_last_modified_time()
397 }
398 /// <p>If present, the object is deleted only if its size matches the provided size in bytes. If the <code>Size</code> value does not match, the operation returns a <code>412 Precondition Failed</code> error. If the <code>Size</code> matches or if the object doesn’t exist, the operation returns a <code>204 Success (No Content)</code> response.</p><note>
399 /// <p>This functionality is only supported for directory buckets.</p>
400 /// </note> <important>
401 /// <p>You can use the <code>If-Match</code>, <code>x-amz-if-match-last-modified-time</code> and <code>x-amz-if-match-size</code> conditional headers in conjunction with each-other or individually.</p>
402 /// </important>
403 pub fn if_match_size(mut self, input: i64) -> Self {
404 self.inner = self.inner.if_match_size(input);
405 self
406 }
407 /// <p>If present, the object is deleted only if its size matches the provided size in bytes. If the <code>Size</code> value does not match, the operation returns a <code>412 Precondition Failed</code> error. If the <code>Size</code> matches or if the object doesn’t exist, the operation returns a <code>204 Success (No Content)</code> response.</p><note>
408 /// <p>This functionality is only supported for directory buckets.</p>
409 /// </note> <important>
410 /// <p>You can use the <code>If-Match</code>, <code>x-amz-if-match-last-modified-time</code> and <code>x-amz-if-match-size</code> conditional headers in conjunction with each-other or individually.</p>
411 /// </important>
412 pub fn set_if_match_size(mut self, input: ::std::option::Option<i64>) -> Self {
413 self.inner = self.inner.set_if_match_size(input);
414 self
415 }
416 /// <p>If present, the object is deleted only if its size matches the provided size in bytes. If the <code>Size</code> value does not match, the operation returns a <code>412 Precondition Failed</code> error. If the <code>Size</code> matches or if the object doesn’t exist, the operation returns a <code>204 Success (No Content)</code> response.</p><note>
417 /// <p>This functionality is only supported for directory buckets.</p>
418 /// </note> <important>
419 /// <p>You can use the <code>If-Match</code>, <code>x-amz-if-match-last-modified-time</code> and <code>x-amz-if-match-size</code> conditional headers in conjunction with each-other or individually.</p>
420 /// </important>
421 pub fn get_if_match_size(&self) -> &::std::option::Option<i64> {
422 self.inner.get_if_match_size()
423 }
424}
425
426impl crate::client::customize::internal::CustomizablePresigned<crate::operation::delete_object::DeleteObjectError> for DeleteObjectFluentBuilder {
427 fn presign(
428 self,
429 config_override: crate::config::Builder,
430 presigning_config: crate::presigning::PresigningConfig,
431 ) -> crate::client::customize::internal::BoxFuture<
432 crate::client::customize::internal::SendResult<crate::presigning::PresignedRequest, crate::operation::delete_object::DeleteObjectError>,
433 > {
434 ::std::boxed::Box::pin(async move { self.config_override(config_override).presigned(presigning_config).await })
435 }
436}