aws_sdk_s3/operation/head_object/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::head_object::_head_object_output::HeadObjectOutputBuilder;
3
4pub use crate::operation::head_object::_head_object_input::HeadObjectInputBuilder;
5
6impl HeadObjectInputBuilder {
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::head_object::HeadObjectOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::head_object::HeadObjectError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.head_object();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `HeadObject`.
24///
25/// <p>The <code>HEAD</code> operation retrieves metadata from an object without returning the object itself. This operation is useful if you're interested only in an object's metadata.</p>
26/// <p>A <code>HEAD</code> request has the same options as a <code>GET</code> operation on an object. The response is identical to the <code>GET</code> response except that there is no response body. Because of this, if the <code>HEAD</code> request generates an error, it returns a generic code, such as <code>400 Bad Request</code>, <code>403 Forbidden</code>, <code>404 Not Found</code>, <code>405 Method Not Allowed</code>, <code>412 Precondition Failed</code>, or <code>304 Not Modified</code>. It's not possible to retrieve the exact exception of these error codes.</p>
27/// <p>Request headers are limited to 8 KB in size. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html">Common Request Headers</a>.</p><note>
28/// <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>bucket_name</i>.s3express-<i>az_id</i>.<i>region</i>.amazonaws.com/<i>key-name</i> </code>. Path-style requests are not supported. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html">Regional and Zonal endpoints</a> in the <i>Amazon S3 User Guide</i>.</p>
29/// </note>
30/// <dl>
31/// <dt>
32/// Permissions
33/// </dt>
34/// <dd>
35/// <p></p>
36/// <ul>
37/// <li>
38/// <p><b>General purpose bucket permissions</b> - To use <code>HEAD</code>, you must have the <code>s3:GetObject</code> permission. You need the relevant read object (or version) permission for this operation. For more information, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/list_amazons3.html">Actions, resources, and condition keys for Amazon S3</a> in the <i>Amazon S3 User Guide</i>.</p>
39/// <p>If the object you request doesn't exist, the error that Amazon S3 returns depends on whether you also have the <code>s3:ListBucket</code> permission.</p>
40/// <ul>
41/// <li>
42/// <p>If you have the <code>s3:ListBucket</code> permission on the bucket, Amazon S3 returns an HTTP status code <code>404 Not Found</code> error.</p></li>
43/// <li>
44/// <p>If you don’t have the <code>s3:ListBucket</code> permission, Amazon S3 returns an HTTP status code <code>403 Forbidden</code> error.</p></li>
45/// </ul></li>
46/// <li>
47/// <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>
48/// </ul>
49/// </dd>
50/// <dt>
51/// Encryption
52/// </dt>
53/// <dd>
54/// <note>
55/// <p>Encryption request headers, like <code>x-amz-server-side-encryption</code>, should not be sent for <code>HEAD</code> requests if your object uses server-side encryption with Key Management Service (KMS) keys (SSE-KMS), dual-layer server-side encryption with Amazon Web Services KMS keys (DSSE-KMS), or server-side encryption with Amazon S3 managed encryption keys (SSE-S3). The <code>x-amz-server-side-encryption</code> header is used when you <code>PUT</code> an object to S3 and want to specify the encryption method. If you include this header in a <code>HEAD</code> request for an object that uses these types of keys, you’ll get an HTTP <code>400 Bad Request</code> error. It's because the encryption method can't be changed when you retrieve the object.</p>
56/// </note>
57/// <p>If you encrypt an object by using server-side encryption with customer-provided encryption keys (SSE-C) when you store the object in Amazon S3, then when you retrieve the metadata from the object, you must use the following headers to provide the encryption key for the server to be able to retrieve the object's metadata. The headers are:</p>
58/// <ul>
59/// <li>
60/// <p><code>x-amz-server-side-encryption-customer-algorithm</code></p></li>
61/// <li>
62/// <p><code>x-amz-server-side-encryption-customer-key</code></p></li>
63/// <li>
64/// <p><code>x-amz-server-side-encryption-customer-key-MD5</code></p></li>
65/// </ul>
66/// <p>For more information about SSE-C, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html">Server-Side Encryption (Using Customer-Provided Encryption Keys)</a> in the <i>Amazon S3 User Guide</i>.</p><note>
67/// <p><b>Directory bucket permissions</b> - For directory buckets, only server-side encryption with Amazon S3 managed keys (SSE-S3) (<code>AES256</code>) is supported.</p>
68/// </note>
69/// </dd>
70/// <dt>
71/// Versioning
72/// </dt>
73/// <dd>
74/// <ul>
75/// <li>
76/// <p>If the current version of the object is a delete marker, Amazon S3 behaves as if the object was deleted and includes <code>x-amz-delete-marker: true</code> in the response.</p></li>
77/// <li>
78/// <p>If the specified version is a delete marker, the response returns a <code>405 Method Not Allowed</code> error and the <code>Last-Modified: timestamp</code> response header.</p></li>
79/// </ul><note>
80/// <ul>
81/// <li>
82/// <p><b>Directory buckets</b> - Delete marker is not supported by directory buckets.</p></li>
83/// <li>
84/// <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>
85/// </ul>
86/// </note>
87/// </dd>
88/// <dt>
89/// HTTP Host header syntax
90/// </dt>
91/// <dd>
92/// <p><b>Directory buckets </b> - The HTTP Host header syntax is <code> <i>Bucket_name</i>.s3express-<i>az_id</i>.<i>region</i>.amazonaws.com</code>.</p>
93/// </dd>
94/// </dl>
95/// <p>The following actions are related to <code>HeadObject</code>:</p>
96/// <ul>
97/// <li>
98/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html">GetObject</a></p></li>
99/// <li>
100/// <p><a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html">GetObjectAttributes</a></p></li>
101/// </ul>
102#[derive(::std::clone::Clone, ::std::fmt::Debug)]
103pub struct HeadObjectFluentBuilder {
104    handle: ::std::sync::Arc<crate::client::Handle>,
105    inner: crate::operation::head_object::builders::HeadObjectInputBuilder,
106    config_override: ::std::option::Option<crate::config::Builder>,
107}
108impl
109    crate::client::customize::internal::CustomizableSend<
110        crate::operation::head_object::HeadObjectOutput,
111        crate::operation::head_object::HeadObjectError,
112    > for HeadObjectFluentBuilder
113{
114    fn send(
115        self,
116        config_override: crate::config::Builder,
117    ) -> crate::client::customize::internal::BoxFuture<
118        crate::client::customize::internal::SendResult<
119            crate::operation::head_object::HeadObjectOutput,
120            crate::operation::head_object::HeadObjectError,
121        >,
122    > {
123        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
124    }
125}
126impl HeadObjectFluentBuilder {
127    /// Creates a new `HeadObject`.
128    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
129        Self {
130            handle,
131            inner: ::std::default::Default::default(),
132            config_override: ::std::option::Option::None,
133        }
134    }
135    /// Access the HeadObject as a reference.
136    pub fn as_input(&self) -> &crate::operation::head_object::builders::HeadObjectInputBuilder {
137        &self.inner
138    }
139    /// Sends the request and returns the response.
140    ///
141    /// If an error occurs, an `SdkError` will be returned with additional details that
142    /// can be matched against.
143    ///
144    /// By default, any retryable failures will be retried twice. Retry behavior
145    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
146    /// set when configuring the client.
147    pub async fn send(
148        self,
149    ) -> ::std::result::Result<
150        crate::operation::head_object::HeadObjectOutput,
151        ::aws_smithy_runtime_api::client::result::SdkError<
152            crate::operation::head_object::HeadObjectError,
153            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
154        >,
155    > {
156        let input = self
157            .inner
158            .build()
159            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
160        let runtime_plugins = crate::operation::head_object::HeadObject::operation_runtime_plugins(
161            self.handle.runtime_plugins.clone(),
162            &self.handle.conf,
163            self.config_override,
164        );
165        crate::operation::head_object::HeadObject::orchestrate(&runtime_plugins, input).await
166    }
167
168    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
169    pub fn customize(
170        self,
171    ) -> crate::client::customize::CustomizableOperation<
172        crate::operation::head_object::HeadObjectOutput,
173        crate::operation::head_object::HeadObjectError,
174        Self,
175    > {
176        crate::client::customize::CustomizableOperation::new(self)
177    }
178    pub(crate) fn config_override(mut self, config_override: impl Into<crate::config::Builder>) -> Self {
179        self.set_config_override(Some(config_override.into()));
180        self
181    }
182
183    pub(crate) fn set_config_override(&mut self, config_override: Option<crate::config::Builder>) -> &mut Self {
184        self.config_override = config_override;
185        self
186    }
187    ///
188    /// Creates a presigned request for this operation.
189    ///
190    /// The `presigning_config` provides additional presigning-specific config values, such as the
191    /// amount of time the request should be valid for after creation.
192    ///
193    /// Presigned requests can be given to other users or applications to access a resource or perform
194    /// an operation without having access to the AWS security credentials.
195    ///
196    /// _Important:_ If you're using credentials that can expire, such as those from STS AssumeRole or SSO, then
197    /// the presigned request can only be valid for as long as the credentials used to create it are.
198    ///
199    #[allow(unused_mut)]
200    pub async fn presigned(
201        mut self,
202        presigning_config: crate::presigning::PresigningConfig,
203    ) -> ::std::result::Result<
204        crate::presigning::PresignedRequest,
205        ::aws_smithy_runtime_api::client::result::SdkError<
206            crate::operation::head_object::HeadObjectError,
207            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
208        >,
209    > {
210        let runtime_plugins = crate::operation::head_object::HeadObject::operation_runtime_plugins(
211            self.handle.runtime_plugins.clone(),
212            &self.handle.conf,
213            self.config_override,
214        )
215        .with_client_plugin(crate::presigning_interceptors::SigV4PresigningRuntimePlugin::new(
216            presigning_config,
217            ::aws_sigv4::http_request::SignableBody::UnsignedPayload,
218        ));
219
220        let input = self
221            .inner
222            .build()
223            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
224        let mut context = crate::operation::head_object::HeadObject::orchestrate_with_stop_point(
225            &runtime_plugins,
226            input,
227            ::aws_smithy_runtime::client::orchestrator::StopPoint::BeforeTransmit,
228        )
229        .await
230        .map_err(|err| {
231            err.map_service_error(|err| {
232                err.downcast::<crate::operation::head_object::HeadObjectError>()
233                    .expect("correct error type")
234            })
235        })?;
236        let request = context.take_request().expect("request set before transmit");
237        crate::presigning::PresignedRequest::new(request).map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)
238    }
239    /// <p>The name of the bucket that contains the object.</p>
240    /// <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>az_id</i>.<i>region</i>.amazonaws.com</code>. Path-style requests are not supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must follow the format <code> <i>bucket_base_name</i>--<i>az-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-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>
241    /// <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>
242    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
243    /// </note>
244    /// <p><b>S3 on Outposts</b> - When you use this action with Amazon 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 through the Amazon Web Services SDKs, you provide the Outposts access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, 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>
245    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
246        self.inner = self.inner.bucket(input.into());
247        self
248    }
249    /// <p>The name of the bucket that contains the object.</p>
250    /// <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>az_id</i>.<i>region</i>.amazonaws.com</code>. Path-style requests are not supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must follow the format <code> <i>bucket_base_name</i>--<i>az-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-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>
251    /// <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>
252    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
253    /// </note>
254    /// <p><b>S3 on Outposts</b> - When you use this action with Amazon 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 through the Amazon Web Services SDKs, you provide the Outposts access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, 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>
255    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
256        self.inner = self.inner.set_bucket(input);
257        self
258    }
259    /// <p>The name of the bucket that contains the object.</p>
260    /// <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>az_id</i>.<i>region</i>.amazonaws.com</code>. Path-style requests are not supported. Directory bucket names must be unique in the chosen Availability Zone. Bucket names must follow the format <code> <i>bucket_base_name</i>--<i>az-id</i>--x-s3</code> (for example, <code> <i>DOC-EXAMPLE-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>
261    /// <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>
262    /// <p>Access points and Object Lambda access points are not supported by directory buckets.</p>
263    /// </note>
264    /// <p><b>S3 on Outposts</b> - When you use this action with Amazon 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 through the Amazon Web Services SDKs, you provide the Outposts access point ARN in place of the bucket name. For more information about S3 on Outposts ARNs, 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>
265    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
266        self.inner.get_bucket()
267    }
268    /// <p>Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error.</p>
269    /// <p>If both of the <code>If-Match</code> and <code>If-Unmodified-Since</code> headers are present in the request as follows:</p>
270    /// <ul>
271    /// <li>
272    /// <p><code>If-Match</code> condition evaluates to <code>true</code>, and;</p></li>
273    /// <li>
274    /// <p><code>If-Unmodified-Since</code> condition evaluates to <code>false</code>;</p></li>
275    /// </ul>
276    /// <p>Then Amazon S3 returns <code>200 OK</code> and the data requested.</p>
277    /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
278    pub fn if_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
279        self.inner = self.inner.if_match(input.into());
280        self
281    }
282    /// <p>Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error.</p>
283    /// <p>If both of the <code>If-Match</code> and <code>If-Unmodified-Since</code> headers are present in the request as follows:</p>
284    /// <ul>
285    /// <li>
286    /// <p><code>If-Match</code> condition evaluates to <code>true</code>, and;</p></li>
287    /// <li>
288    /// <p><code>If-Unmodified-Since</code> condition evaluates to <code>false</code>;</p></li>
289    /// </ul>
290    /// <p>Then Amazon S3 returns <code>200 OK</code> and the data requested.</p>
291    /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
292    pub fn set_if_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
293        self.inner = self.inner.set_if_match(input);
294        self
295    }
296    /// <p>Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error.</p>
297    /// <p>If both of the <code>If-Match</code> and <code>If-Unmodified-Since</code> headers are present in the request as follows:</p>
298    /// <ul>
299    /// <li>
300    /// <p><code>If-Match</code> condition evaluates to <code>true</code>, and;</p></li>
301    /// <li>
302    /// <p><code>If-Unmodified-Since</code> condition evaluates to <code>false</code>;</p></li>
303    /// </ul>
304    /// <p>Then Amazon S3 returns <code>200 OK</code> and the data requested.</p>
305    /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
306    pub fn get_if_match(&self) -> &::std::option::Option<::std::string::String> {
307        self.inner.get_if_match()
308    }
309    /// <p>Return the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error.</p>
310    /// <p>If both of the <code>If-None-Match</code> and <code>If-Modified-Since</code> headers are present in the request as follows:</p>
311    /// <ul>
312    /// <li>
313    /// <p><code>If-None-Match</code> condition evaluates to <code>false</code>, and;</p></li>
314    /// <li>
315    /// <p><code>If-Modified-Since</code> condition evaluates to <code>true</code>;</p></li>
316    /// </ul>
317    /// <p>Then Amazon S3 returns the <code>304 Not Modified</code> response code.</p>
318    /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
319    pub fn if_modified_since(mut self, input: ::aws_smithy_types::DateTime) -> Self {
320        self.inner = self.inner.if_modified_since(input);
321        self
322    }
323    /// <p>Return the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error.</p>
324    /// <p>If both of the <code>If-None-Match</code> and <code>If-Modified-Since</code> headers are present in the request as follows:</p>
325    /// <ul>
326    /// <li>
327    /// <p><code>If-None-Match</code> condition evaluates to <code>false</code>, and;</p></li>
328    /// <li>
329    /// <p><code>If-Modified-Since</code> condition evaluates to <code>true</code>;</p></li>
330    /// </ul>
331    /// <p>Then Amazon S3 returns the <code>304 Not Modified</code> response code.</p>
332    /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
333    pub fn set_if_modified_since(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
334        self.inner = self.inner.set_if_modified_since(input);
335        self
336    }
337    /// <p>Return the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error.</p>
338    /// <p>If both of the <code>If-None-Match</code> and <code>If-Modified-Since</code> headers are present in the request as follows:</p>
339    /// <ul>
340    /// <li>
341    /// <p><code>If-None-Match</code> condition evaluates to <code>false</code>, and;</p></li>
342    /// <li>
343    /// <p><code>If-Modified-Since</code> condition evaluates to <code>true</code>;</p></li>
344    /// </ul>
345    /// <p>Then Amazon S3 returns the <code>304 Not Modified</code> response code.</p>
346    /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
347    pub fn get_if_modified_since(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
348        self.inner.get_if_modified_since()
349    }
350    /// <p>Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error.</p>
351    /// <p>If both of the <code>If-None-Match</code> and <code>If-Modified-Since</code> headers are present in the request as follows:</p>
352    /// <ul>
353    /// <li>
354    /// <p><code>If-None-Match</code> condition evaluates to <code>false</code>, and;</p></li>
355    /// <li>
356    /// <p><code>If-Modified-Since</code> condition evaluates to <code>true</code>;</p></li>
357    /// </ul>
358    /// <p>Then Amazon S3 returns the <code>304 Not Modified</code> response code.</p>
359    /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
360    pub fn if_none_match(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
361        self.inner = self.inner.if_none_match(input.into());
362        self
363    }
364    /// <p>Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error.</p>
365    /// <p>If both of the <code>If-None-Match</code> and <code>If-Modified-Since</code> headers are present in the request as follows:</p>
366    /// <ul>
367    /// <li>
368    /// <p><code>If-None-Match</code> condition evaluates to <code>false</code>, and;</p></li>
369    /// <li>
370    /// <p><code>If-Modified-Since</code> condition evaluates to <code>true</code>;</p></li>
371    /// </ul>
372    /// <p>Then Amazon S3 returns the <code>304 Not Modified</code> response code.</p>
373    /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
374    pub fn set_if_none_match(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
375        self.inner = self.inner.set_if_none_match(input);
376        self
377    }
378    /// <p>Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error.</p>
379    /// <p>If both of the <code>If-None-Match</code> and <code>If-Modified-Since</code> headers are present in the request as follows:</p>
380    /// <ul>
381    /// <li>
382    /// <p><code>If-None-Match</code> condition evaluates to <code>false</code>, and;</p></li>
383    /// <li>
384    /// <p><code>If-Modified-Since</code> condition evaluates to <code>true</code>;</p></li>
385    /// </ul>
386    /// <p>Then Amazon S3 returns the <code>304 Not Modified</code> response code.</p>
387    /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
388    pub fn get_if_none_match(&self) -> &::std::option::Option<::std::string::String> {
389        self.inner.get_if_none_match()
390    }
391    /// <p>Return the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error.</p>
392    /// <p>If both of the <code>If-Match</code> and <code>If-Unmodified-Since</code> headers are present in the request as follows:</p>
393    /// <ul>
394    /// <li>
395    /// <p><code>If-Match</code> condition evaluates to <code>true</code>, and;</p></li>
396    /// <li>
397    /// <p><code>If-Unmodified-Since</code> condition evaluates to <code>false</code>;</p></li>
398    /// </ul>
399    /// <p>Then Amazon S3 returns <code>200 OK</code> and the data requested.</p>
400    /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
401    pub fn if_unmodified_since(mut self, input: ::aws_smithy_types::DateTime) -> Self {
402        self.inner = self.inner.if_unmodified_since(input);
403        self
404    }
405    /// <p>Return the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error.</p>
406    /// <p>If both of the <code>If-Match</code> and <code>If-Unmodified-Since</code> headers are present in the request as follows:</p>
407    /// <ul>
408    /// <li>
409    /// <p><code>If-Match</code> condition evaluates to <code>true</code>, and;</p></li>
410    /// <li>
411    /// <p><code>If-Unmodified-Since</code> condition evaluates to <code>false</code>;</p></li>
412    /// </ul>
413    /// <p>Then Amazon S3 returns <code>200 OK</code> and the data requested.</p>
414    /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
415    pub fn set_if_unmodified_since(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
416        self.inner = self.inner.set_if_unmodified_since(input);
417        self
418    }
419    /// <p>Return the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error.</p>
420    /// <p>If both of the <code>If-Match</code> and <code>If-Unmodified-Since</code> headers are present in the request as follows:</p>
421    /// <ul>
422    /// <li>
423    /// <p><code>If-Match</code> condition evaluates to <code>true</code>, and;</p></li>
424    /// <li>
425    /// <p><code>If-Unmodified-Since</code> condition evaluates to <code>false</code>;</p></li>
426    /// </ul>
427    /// <p>Then Amazon S3 returns <code>200 OK</code> and the data requested.</p>
428    /// <p>For more information about conditional requests, see <a href="https://tools.ietf.org/html/rfc7232">RFC 7232</a>.</p>
429    pub fn get_if_unmodified_since(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
430        self.inner.get_if_unmodified_since()
431    }
432    /// <p>The object key.</p>
433    pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
434        self.inner = self.inner.key(input.into());
435        self
436    }
437    /// <p>The object key.</p>
438    pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
439        self.inner = self.inner.set_key(input);
440        self
441    }
442    /// <p>The object key.</p>
443    pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
444        self.inner.get_key()
445    }
446    /// <p>HeadObject returns only the metadata for an object. If the Range is satisfiable, only the <code>ContentLength</code> is affected in the response. If the Range is not satisfiable, S3 returns a <code>416 - Requested Range Not Satisfiable</code> error.</p>
447    pub fn range(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
448        self.inner = self.inner.range(input.into());
449        self
450    }
451    /// <p>HeadObject returns only the metadata for an object. If the Range is satisfiable, only the <code>ContentLength</code> is affected in the response. If the Range is not satisfiable, S3 returns a <code>416 - Requested Range Not Satisfiable</code> error.</p>
452    pub fn set_range(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
453        self.inner = self.inner.set_range(input);
454        self
455    }
456    /// <p>HeadObject returns only the metadata for an object. If the Range is satisfiable, only the <code>ContentLength</code> is affected in the response. If the Range is not satisfiable, S3 returns a <code>416 - Requested Range Not Satisfiable</code> error.</p>
457    pub fn get_range(&self) -> &::std::option::Option<::std::string::String> {
458        self.inner.get_range()
459    }
460    /// <p>Version ID used to reference a specific version of the object.</p><note>
461    /// <p>For directory buckets in this API operation, only the <code>null</code> value of the version ID is supported.</p>
462    /// </note>
463    pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
464        self.inner = self.inner.version_id(input.into());
465        self
466    }
467    /// <p>Version ID used to reference a specific version of the object.</p><note>
468    /// <p>For directory buckets in this API operation, only the <code>null</code> value of the version ID is supported.</p>
469    /// </note>
470    pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
471        self.inner = self.inner.set_version_id(input);
472        self
473    }
474    /// <p>Version ID used to reference a specific version of the object.</p><note>
475    /// <p>For directory buckets in this API operation, only the <code>null</code> value of the version ID is supported.</p>
476    /// </note>
477    pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
478        self.inner.get_version_id()
479    }
480    /// <p>Specifies the algorithm to use when encrypting the object (for example, AES256).</p><note>
481    /// <p>This functionality is not supported for directory buckets.</p>
482    /// </note>
483    pub fn sse_customer_algorithm(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
484        self.inner = self.inner.sse_customer_algorithm(input.into());
485        self
486    }
487    /// <p>Specifies the algorithm to use when encrypting the object (for example, AES256).</p><note>
488    /// <p>This functionality is not supported for directory buckets.</p>
489    /// </note>
490    pub fn set_sse_customer_algorithm(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
491        self.inner = self.inner.set_sse_customer_algorithm(input);
492        self
493    }
494    /// <p>Specifies the algorithm to use when encrypting the object (for example, AES256).</p><note>
495    /// <p>This functionality is not supported for directory buckets.</p>
496    /// </note>
497    pub fn get_sse_customer_algorithm(&self) -> &::std::option::Option<::std::string::String> {
498        self.inner.get_sse_customer_algorithm()
499    }
500    /// <p>Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the <code>x-amz-server-side-encryption-customer-algorithm</code> header.</p><note>
501    /// <p>This functionality is not supported for directory buckets.</p>
502    /// </note>
503    pub fn sse_customer_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
504        self.inner = self.inner.sse_customer_key(input.into());
505        self
506    }
507    /// <p>Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the <code>x-amz-server-side-encryption-customer-algorithm</code> header.</p><note>
508    /// <p>This functionality is not supported for directory buckets.</p>
509    /// </note>
510    pub fn set_sse_customer_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
511        self.inner = self.inner.set_sse_customer_key(input);
512        self
513    }
514    /// <p>Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data. This value is used to store the object and then it is discarded; Amazon S3 does not store the encryption key. The key must be appropriate for use with the algorithm specified in the <code>x-amz-server-side-encryption-customer-algorithm</code> header.</p><note>
515    /// <p>This functionality is not supported for directory buckets.</p>
516    /// </note>
517    pub fn get_sse_customer_key(&self) -> &::std::option::Option<::std::string::String> {
518        self.inner.get_sse_customer_key()
519    }
520    /// <p>Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.</p><note>
521    /// <p>This functionality is not supported for directory buckets.</p>
522    /// </note>
523    pub fn sse_customer_key_md5(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
524        self.inner = self.inner.sse_customer_key_md5(input.into());
525        self
526    }
527    /// <p>Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.</p><note>
528    /// <p>This functionality is not supported for directory buckets.</p>
529    /// </note>
530    pub fn set_sse_customer_key_md5(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
531        self.inner = self.inner.set_sse_customer_key_md5(input);
532        self
533    }
534    /// <p>Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321. Amazon S3 uses this header for a message integrity check to ensure that the encryption key was transmitted without error.</p><note>
535    /// <p>This functionality is not supported for directory buckets.</p>
536    /// </note>
537    pub fn get_sse_customer_key_md5(&self) -> &::std::option::Option<::std::string::String> {
538        self.inner.get_sse_customer_key_md5()
539    }
540    /// <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>
541    /// <p>This functionality is not supported for directory buckets.</p>
542    /// </note>
543    pub fn request_payer(mut self, input: crate::types::RequestPayer) -> Self {
544        self.inner = self.inner.request_payer(input);
545        self
546    }
547    /// <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>
548    /// <p>This functionality is not supported for directory buckets.</p>
549    /// </note>
550    pub fn set_request_payer(mut self, input: ::std::option::Option<crate::types::RequestPayer>) -> Self {
551        self.inner = self.inner.set_request_payer(input);
552        self
553    }
554    /// <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>
555    /// <p>This functionality is not supported for directory buckets.</p>
556    /// </note>
557    pub fn get_request_payer(&self) -> &::std::option::Option<crate::types::RequestPayer> {
558        self.inner.get_request_payer()
559    }
560    /// <p>Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. Useful querying about the size of the part and the number of parts in this object.</p>
561    pub fn part_number(mut self, input: i32) -> Self {
562        self.inner = self.inner.part_number(input);
563        self
564    }
565    /// <p>Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. Useful querying about the size of the part and the number of parts in this object.</p>
566    pub fn set_part_number(mut self, input: ::std::option::Option<i32>) -> Self {
567        self.inner = self.inner.set_part_number(input);
568        self
569    }
570    /// <p>Part number of the object being read. This is a positive integer between 1 and 10,000. Effectively performs a 'ranged' HEAD request for the part specified. Useful querying about the size of the part and the number of parts in this object.</p>
571    pub fn get_part_number(&self) -> &::std::option::Option<i32> {
572        self.inner.get_part_number()
573    }
574    /// <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>
575    pub fn expected_bucket_owner(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
576        self.inner = self.inner.expected_bucket_owner(input.into());
577        self
578    }
579    /// <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>
580    pub fn set_expected_bucket_owner(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
581        self.inner = self.inner.set_expected_bucket_owner(input);
582        self
583    }
584    /// <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>
585    pub fn get_expected_bucket_owner(&self) -> &::std::option::Option<::std::string::String> {
586        self.inner.get_expected_bucket_owner()
587    }
588    /// <p>To retrieve the checksum, this parameter must be enabled.</p>
589    /// <p>In addition, if you enable <code>ChecksumMode</code> and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must have permission to use the <code>kms:Decrypt</code> action for the request to succeed.</p>
590    pub fn checksum_mode(mut self, input: crate::types::ChecksumMode) -> Self {
591        self.inner = self.inner.checksum_mode(input);
592        self
593    }
594    /// <p>To retrieve the checksum, this parameter must be enabled.</p>
595    /// <p>In addition, if you enable <code>ChecksumMode</code> and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must have permission to use the <code>kms:Decrypt</code> action for the request to succeed.</p>
596    pub fn set_checksum_mode(mut self, input: ::std::option::Option<crate::types::ChecksumMode>) -> Self {
597        self.inner = self.inner.set_checksum_mode(input);
598        self
599    }
600    /// <p>To retrieve the checksum, this parameter must be enabled.</p>
601    /// <p>In addition, if you enable <code>ChecksumMode</code> and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must have permission to use the <code>kms:Decrypt</code> action for the request to succeed.</p>
602    pub fn get_checksum_mode(&self) -> &::std::option::Option<crate::types::ChecksumMode> {
603        self.inner.get_checksum_mode()
604    }
605}
606
607impl crate::client::customize::internal::CustomizablePresigned<crate::operation::head_object::HeadObjectError> for HeadObjectFluentBuilder {
608    fn presign(
609        self,
610        config_override: crate::config::Builder,
611        presigning_config: crate::presigning::PresigningConfig,
612    ) -> crate::client::customize::internal::BoxFuture<
613        crate::client::customize::internal::SendResult<crate::presigning::PresignedRequest, crate::operation::head_object::HeadObjectError>,
614    > {
615        ::std::boxed::Box::pin(async move { self.config_override(config_override).presigned(presigning_config).await })
616    }
617}