aws_sdk_s3/operation/delete_object/_delete_object_input.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct DeleteObjectInput {
6 /// <p>The bucket name of the bucket containing the object.</p>
7 /// <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>
8 /// <p><b>Access points</b> - When you use this action with an access point, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. 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>
9 /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
10 /// </note>
11 /// <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>
12 pub bucket: ::std::option::Option<::std::string::String>,
13 /// <p>Key name of the object to delete.</p>
14 pub key: ::std::option::Option<::std::string::String>,
15 /// <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>
16 /// <p>This functionality is not supported for directory buckets.</p>
17 /// </note>
18 pub mfa: ::std::option::Option<::std::string::String>,
19 /// <p>Version ID used to reference a specific version of the object.</p><note>
20 /// <p>For directory buckets in this API operation, only the <code>null</code> value of the version ID is supported.</p>
21 /// </note>
22 pub version_id: ::std::option::Option<::std::string::String>,
23 /// <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>
24 /// <p>This functionality is not supported for directory buckets.</p>
25 /// </note>
26 pub request_payer: ::std::option::Option<crate::types::RequestPayer>,
27 /// <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>
28 /// <p>This functionality is not supported for directory buckets.</p>
29 /// </note>
30 pub bypass_governance_retention: ::std::option::Option<bool>,
31 /// <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>
32 pub expected_bucket_owner: ::std::option::Option<::std::string::String>,
33 /// <p>The <code>If-Match</code> header field makes the request method conditional on ETags. If the ETag value does not match, the operation returns a <code>412 Precondition Failed</code> error. If the ETag matches or if the object doesn't exist, the operation will return a <code>204 Success (No Content) response</code>.</p>
34 /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p><note>
35 /// <p>This functionality is only supported for directory buckets.</p>
36 /// </note>
37 pub if_match: ::std::option::Option<::std::string::String>,
38 /// <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>
39 /// <p>This functionality is only supported for directory buckets.</p>
40 /// </note>
41 pub if_match_last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
42 /// <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>
43 /// <p>This functionality is only supported for directory buckets.</p>
44 /// </note> <important>
45 /// <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>
46 /// </important>
47 pub if_match_size: ::std::option::Option<i64>,
48}
49impl DeleteObjectInput {
50 /// <p>The bucket name of the bucket containing the object.</p>
51 /// <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>
52 /// <p><b>Access points</b> - When you use this action with an access point, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. 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>
53 /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
54 /// </note>
55 /// <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>
56 pub fn bucket(&self) -> ::std::option::Option<&str> {
57 self.bucket.as_deref()
58 }
59 /// <p>Key name of the object to delete.</p>
60 pub fn key(&self) -> ::std::option::Option<&str> {
61 self.key.as_deref()
62 }
63 /// <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>
64 /// <p>This functionality is not supported for directory buckets.</p>
65 /// </note>
66 pub fn mfa(&self) -> ::std::option::Option<&str> {
67 self.mfa.as_deref()
68 }
69 /// <p>Version ID used to reference a specific version of the object.</p><note>
70 /// <p>For directory buckets in this API operation, only the <code>null</code> value of the version ID is supported.</p>
71 /// </note>
72 pub fn version_id(&self) -> ::std::option::Option<&str> {
73 self.version_id.as_deref()
74 }
75 /// <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>
76 /// <p>This functionality is not supported for directory buckets.</p>
77 /// </note>
78 pub fn request_payer(&self) -> ::std::option::Option<&crate::types::RequestPayer> {
79 self.request_payer.as_ref()
80 }
81 /// <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>
82 /// <p>This functionality is not supported for directory buckets.</p>
83 /// </note>
84 pub fn bypass_governance_retention(&self) -> ::std::option::Option<bool> {
85 self.bypass_governance_retention
86 }
87 /// <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>
88 pub fn expected_bucket_owner(&self) -> ::std::option::Option<&str> {
89 self.expected_bucket_owner.as_deref()
90 }
91 /// <p>The <code>If-Match</code> header field makes the request method conditional on ETags. If the ETag value does not match, the operation returns a <code>412 Precondition Failed</code> error. If the ETag matches or if the object doesn't exist, the operation will return a <code>204 Success (No Content) response</code>.</p>
92 /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p><note>
93 /// <p>This functionality is only supported for directory buckets.</p>
94 /// </note>
95 pub fn if_match(&self) -> ::std::option::Option<&str> {
96 self.if_match.as_deref()
97 }
98 /// <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>
99 /// <p>This functionality is only supported for directory buckets.</p>
100 /// </note>
101 pub fn if_match_last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
102 self.if_match_last_modified_time.as_ref()
103 }
104 /// <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>
105 /// <p>This functionality is only supported for directory buckets.</p>
106 /// </note> <important>
107 /// <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>
108 /// </important>
109 pub fn if_match_size(&self) -> ::std::option::Option<i64> {
110 self.if_match_size
111 }
112}
113impl DeleteObjectInput {
114 /// Creates a new builder-style object to manufacture [`DeleteObjectInput`](crate::operation::delete_object::DeleteObjectInput).
115 pub fn builder() -> crate::operation::delete_object::builders::DeleteObjectInputBuilder {
116 crate::operation::delete_object::builders::DeleteObjectInputBuilder::default()
117 }
118}
119
120/// A builder for [`DeleteObjectInput`](crate::operation::delete_object::DeleteObjectInput).
121#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
122#[non_exhaustive]
123pub struct DeleteObjectInputBuilder {
124 pub(crate) bucket: ::std::option::Option<::std::string::String>,
125 pub(crate) key: ::std::option::Option<::std::string::String>,
126 pub(crate) mfa: ::std::option::Option<::std::string::String>,
127 pub(crate) version_id: ::std::option::Option<::std::string::String>,
128 pub(crate) request_payer: ::std::option::Option<crate::types::RequestPayer>,
129 pub(crate) bypass_governance_retention: ::std::option::Option<bool>,
130 pub(crate) expected_bucket_owner: ::std::option::Option<::std::string::String>,
131 pub(crate) if_match: ::std::option::Option<::std::string::String>,
132 pub(crate) if_match_last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
133 pub(crate) if_match_size: ::std::option::Option<i64>,
134}
135impl DeleteObjectInputBuilder {
136 /// <p>The bucket name of the bucket containing the object.</p>
137 /// <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>
138 /// <p><b>Access points</b> - When you use this action with an access point, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. 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>
139 /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
140 /// </note>
141 /// <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>
142 /// This field is required.
143 pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.bucket = ::std::option::Option::Some(input.into());
145 self
146 }
147 /// <p>The bucket name of the bucket containing the object.</p>
148 /// <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>
149 /// <p><b>Access points</b> - When you use this action with an access point, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. 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>
150 /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
151 /// </note>
152 /// <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>
153 pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
154 self.bucket = input;
155 self
156 }
157 /// <p>The bucket name of the bucket containing the object.</p>
158 /// <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>
159 /// <p><b>Access points</b> - When you use this action with an access point, you must provide the alias of the access point in place of the bucket name or specify the access point ARN. 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>
160 /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
161 /// </note>
162 /// <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>
163 pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
164 &self.bucket
165 }
166 /// <p>Key name of the object to delete.</p>
167 /// This field is required.
168 pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
169 self.key = ::std::option::Option::Some(input.into());
170 self
171 }
172 /// <p>Key name of the object to delete.</p>
173 pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
174 self.key = input;
175 self
176 }
177 /// <p>Key name of the object to delete.</p>
178 pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
179 &self.key
180 }
181 /// <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>
182 /// <p>This functionality is not supported for directory buckets.</p>
183 /// </note>
184 pub fn mfa(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
185 self.mfa = ::std::option::Option::Some(input.into());
186 self
187 }
188 /// <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>
189 /// <p>This functionality is not supported for directory buckets.</p>
190 /// </note>
191 pub fn set_mfa(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
192 self.mfa = input;
193 self
194 }
195 /// <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>
196 /// <p>This functionality is not supported for directory buckets.</p>
197 /// </note>
198 pub fn get_mfa(&self) -> &::std::option::Option<::std::string::String> {
199 &self.mfa
200 }
201 /// <p>Version ID used to reference a specific version of the object.</p><note>
202 /// <p>For directory buckets in this API operation, only the <code>null</code> value of the version ID is supported.</p>
203 /// </note>
204 pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205 self.version_id = ::std::option::Option::Some(input.into());
206 self
207 }
208 /// <p>Version ID used to reference a specific version of the object.</p><note>
209 /// <p>For directory buckets in this API operation, only the <code>null</code> value of the version ID is supported.</p>
210 /// </note>
211 pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212 self.version_id = input;
213 self
214 }
215 /// <p>Version ID used to reference a specific version of the object.</p><note>
216 /// <p>For directory buckets in this API operation, only the <code>null</code> value of the version ID is supported.</p>
217 /// </note>
218 pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
219 &self.version_id
220 }
221 /// <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>
222 /// <p>This functionality is not supported for directory buckets.</p>
223 /// </note>
224 pub fn request_payer(mut self, input: crate::types::RequestPayer) -> Self {
225 self.request_payer = ::std::option::Option::Some(input);
226 self
227 }
228 /// <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>
229 /// <p>This functionality is not supported for directory buckets.</p>
230 /// </note>
231 pub fn set_request_payer(mut self, input: ::std::option::Option<crate::types::RequestPayer>) -> Self {
232 self.request_payer = input;
233 self
234 }
235 /// <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>
236 /// <p>This functionality is not supported for directory buckets.</p>
237 /// </note>
238 pub fn get_request_payer(&self) -> &::std::option::Option<crate::types::RequestPayer> {
239 &self.request_payer
240 }
241 /// <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>
242 /// <p>This functionality is not supported for directory buckets.</p>
243 /// </note>
244 pub fn bypass_governance_retention(mut self, input: bool) -> Self {
245 self.bypass_governance_retention = ::std::option::Option::Some(input);
246 self
247 }
248 /// <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>
249 /// <p>This functionality is not supported for directory buckets.</p>
250 /// </note>
251 pub fn set_bypass_governance_retention(mut self, input: ::std::option::Option<bool>) -> Self {
252 self.bypass_governance_retention = input;
253 self
254 }
255 /// <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>
256 /// <p>This functionality is not supported for directory buckets.</p>
257 /// </note>
258 pub fn get_bypass_governance_retention(&self) -> &::std::option::Option<bool> {
259 &self.bypass_governance_retention
260 }
261 /// <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>
262 pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
263 self.expected_bucket_owner = ::std::option::Option::Some(input.into());
264 self
265 }
266 /// <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>
267 pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268 self.expected_bucket_owner = input;
269 self
270 }
271 /// <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>
272 pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
273 &self.expected_bucket_owner
274 }
275 /// <p>The <code>If-Match</code> header field makes the request method conditional on ETags. If the ETag value does not match, the operation returns a <code>412 Precondition Failed</code> error. If the ETag matches or if the object doesn't exist, the operation will return a <code>204 Success (No Content) response</code>.</p>
276 /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p><note>
277 /// <p>This functionality is only supported for directory buckets.</p>
278 /// </note>
279 pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
280 self.if_match = ::std::option::Option::Some(input.into());
281 self
282 }
283 /// <p>The <code>If-Match</code> header field makes the request method conditional on ETags. If the ETag value does not match, the operation returns a <code>412 Precondition Failed</code> error. If the ETag matches or if the object doesn't exist, the operation will return a <code>204 Success (No Content) response</code>.</p>
284 /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p><note>
285 /// <p>This functionality is only supported for directory buckets.</p>
286 /// </note>
287 pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
288 self.if_match = input;
289 self
290 }
291 /// <p>The <code>If-Match</code> header field makes the request method conditional on ETags. If the ETag value does not match, the operation returns a <code>412 Precondition Failed</code> error. If the ETag matches or if the object doesn't exist, the operation will return a <code>204 Success (No Content) response</code>.</p>
292 /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p><note>
293 /// <p>This functionality is only supported for directory buckets.</p>
294 /// </note>
295 pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
296 &self.if_match
297 }
298 /// <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>
299 /// <p>This functionality is only supported for directory buckets.</p>
300 /// </note>
301 pub fn if_match_last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
302 self.if_match_last_modified_time = ::std::option::Option::Some(input);
303 self
304 }
305 /// <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>
306 /// <p>This functionality is only supported for directory buckets.</p>
307 /// </note>
308 pub fn set_if_match_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
309 self.if_match_last_modified_time = input;
310 self
311 }
312 /// <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>
313 /// <p>This functionality is only supported for directory buckets.</p>
314 /// </note>
315 pub fn get_if_match_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
316 &self.if_match_last_modified_time
317 }
318 /// <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>
319 /// <p>This functionality is only supported for directory buckets.</p>
320 /// </note> <important>
321 /// <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>
322 /// </important>
323 pub fn if_match_size(mut self, input: i64) -> Self {
324 self.if_match_size = ::std::option::Option::Some(input);
325 self
326 }
327 /// <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>
328 /// <p>This functionality is only supported for directory buckets.</p>
329 /// </note> <important>
330 /// <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>
331 /// </important>
332 pub fn set_if_match_size(mut self, input: ::std::option::Option<i64>) -> Self {
333 self.if_match_size = input;
334 self
335 }
336 /// <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>
337 /// <p>This functionality is only supported for directory buckets.</p>
338 /// </note> <important>
339 /// <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>
340 /// </important>
341 pub fn get_if_match_size(&self) -> &::std::option::Option<i64> {
342 &self.if_match_size
343 }
344 /// Consumes the builder and constructs a [`DeleteObjectInput`](crate::operation::delete_object::DeleteObjectInput).
345 pub fn build(
346 self,
347 ) -> ::std::result::Result<crate::operation::delete_object::DeleteObjectInput, ::aws_smithy_types::error::operation::BuildError> {
348 ::std::result::Result::Ok(crate::operation::delete_object::DeleteObjectInput {
349 bucket: self.bucket,
350 key: self.key,
351 mfa: self.mfa,
352 version_id: self.version_id,
353 request_payer: self.request_payer,
354 bypass_governance_retention: self.bypass_governance_retention,
355 expected_bucket_owner: self.expected_bucket_owner,
356 if_match: self.if_match,
357 if_match_last_modified_time: self.if_match_last_modified_time,
358 if_match_size: self.if_match_size,
359 })
360 }
361}