pub struct Builder { /* private fields */ }
Expand description

A builder for HeadObjectInput.

Implementations§

The name of the bucket containing the object.

When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.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 Using access points in the Amazon S3 User Guide.

When using 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 AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this action with S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts in the Amazon S3 User Guide.

Examples found in repository?
src/client.rs (line 9123)
9122
9123
9124
9125
        pub fn bucket(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.bucket(input.into());
            self
        }

The name of the bucket containing the object.

When using this action with an access point, you must direct requests to the access point hostname. The access point hostname takes the form AccessPointName-AccountId.s3-accesspoint.Region.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 Using access points in the Amazon S3 User Guide.

When using 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 AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using this action with S3 on Outposts through the Amazon Web Services SDKs, you provide the Outposts bucket ARN in place of the bucket name. For more information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts in the Amazon S3 User Guide.

Examples found in repository?
src/client.rs (line 9130)
9129
9130
9131
9132
        pub fn set_bucket(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_bucket(input);
            self
        }

Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error.

Examples found in repository?
src/client.rs (line 9135)
9134
9135
9136
9137
        pub fn if_match(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.if_match(input.into());
            self
        }

Return the object only if its entity tag (ETag) is the same as the one specified; otherwise, return a 412 (precondition failed) error.

Examples found in repository?
src/client.rs (line 9140)
9139
9140
9141
9142
        pub fn set_if_match(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_if_match(input);
            self
        }

Return the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error.

Examples found in repository?
src/client.rs (line 9145)
9144
9145
9146
9147
        pub fn if_modified_since(mut self, input: aws_smithy_types::DateTime) -> Self {
            self.inner = self.inner.if_modified_since(input);
            self
        }

Return the object only if it has been modified since the specified time; otherwise, return a 304 (not modified) error.

Examples found in repository?
src/client.rs (line 9153)
9149
9150
9151
9152
9153
9154
9155
        pub fn set_if_modified_since(
            mut self,
            input: std::option::Option<aws_smithy_types::DateTime>,
        ) -> Self {
            self.inner = self.inner.set_if_modified_since(input);
            self
        }

Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error.

Examples found in repository?
src/client.rs (line 9158)
9157
9158
9159
9160
        pub fn if_none_match(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.if_none_match(input.into());
            self
        }

Return the object only if its entity tag (ETag) is different from the one specified; otherwise, return a 304 (not modified) error.

Examples found in repository?
src/client.rs (line 9166)
9162
9163
9164
9165
9166
9167
9168
        pub fn set_if_none_match(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_if_none_match(input);
            self
        }

Return the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error.

Examples found in repository?
src/client.rs (line 9171)
9170
9171
9172
9173
        pub fn if_unmodified_since(mut self, input: aws_smithy_types::DateTime) -> Self {
            self.inner = self.inner.if_unmodified_since(input);
            self
        }

Return the object only if it has not been modified since the specified time; otherwise, return a 412 (precondition failed) error.

Examples found in repository?
src/client.rs (line 9179)
9175
9176
9177
9178
9179
9180
9181
        pub fn set_if_unmodified_since(
            mut self,
            input: std::option::Option<aws_smithy_types::DateTime>,
        ) -> Self {
            self.inner = self.inner.set_if_unmodified_since(input);
            self
        }

The object key.

Examples found in repository?
src/client.rs (line 9184)
9183
9184
9185
9186
        pub fn key(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.key(input.into());
            self
        }

The object key.

Examples found in repository?
src/client.rs (line 9189)
9188
9189
9190
9191
        pub fn set_key(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_key(input);
            self
        }

Because HeadObject returns only the metadata for an object, this parameter has no effect.

Examples found in repository?
src/client.rs (line 9194)
9193
9194
9195
9196
        pub fn range(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.range(input.into());
            self
        }

Because HeadObject returns only the metadata for an object, this parameter has no effect.

Examples found in repository?
src/client.rs (line 9199)
9198
9199
9200
9201
        pub fn set_range(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_range(input);
            self
        }

VersionId used to reference a specific version of the object.

Examples found in repository?
src/client.rs (line 9204)
9203
9204
9205
9206
        pub fn version_id(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.version_id(input.into());
            self
        }

VersionId used to reference a specific version of the object.

Examples found in repository?
src/client.rs (line 9209)
9208
9209
9210
9211
        pub fn set_version_id(mut self, input: std::option::Option<std::string::String>) -> Self {
            self.inner = self.inner.set_version_id(input);
            self
        }

Specifies the algorithm to use to when encrypting the object (for example, AES256).

Examples found in repository?
src/client.rs (line 9214)
9213
9214
9215
9216
        pub fn sse_customer_algorithm(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.sse_customer_algorithm(input.into());
            self
        }

Specifies the algorithm to use to when encrypting the object (for example, AES256).

Examples found in repository?
src/client.rs (line 9222)
9218
9219
9220
9221
9222
9223
9224
        pub fn set_sse_customer_algorithm(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_sse_customer_algorithm(input);
            self
        }

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 x-amz-server-side-encryption-customer-algorithm header.

Examples found in repository?
src/client.rs (line 9227)
9226
9227
9228
9229
        pub fn sse_customer_key(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.sse_customer_key(input.into());
            self
        }

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 x-amz-server-side-encryption-customer-algorithm header.

Examples found in repository?
src/client.rs (line 9235)
9231
9232
9233
9234
9235
9236
9237
        pub fn set_sse_customer_key(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_sse_customer_key(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 9240)
9239
9240
9241
9242
        pub fn sse_customer_key_md5(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.sse_customer_key_md5(input.into());
            self
        }

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.

Examples found in repository?
src/client.rs (line 9248)
9244
9245
9246
9247
9248
9249
9250
        pub fn set_sse_customer_key_md5(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_sse_customer_key_md5(input);
            self
        }

Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.

Examples found in repository?
src/client.rs (line 9253)
9252
9253
9254
9255
        pub fn request_payer(mut self, input: crate::model::RequestPayer) -> Self {
            self.inner = self.inner.request_payer(input);
            self
        }

Confirms that the requester knows that they will be charged for the request. Bucket owners need not specify this parameter in their requests. For information about downloading objects from Requester Pays buckets, see Downloading Objects in Requester Pays Buckets in the Amazon S3 User Guide.

Examples found in repository?
src/client.rs (line 9261)
9257
9258
9259
9260
9261
9262
9263
        pub fn set_request_payer(
            mut self,
            input: std::option::Option<crate::model::RequestPayer>,
        ) -> Self {
            self.inner = self.inner.set_request_payer(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 9266)
9265
9266
9267
9268
        pub fn part_number(mut self, input: i32) -> Self {
            self.inner = self.inner.part_number(input);
            self
        }

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.

Examples found in repository?
src/client.rs (line 9271)
9270
9271
9272
9273
        pub fn set_part_number(mut self, input: std::option::Option<i32>) -> Self {
            self.inner = self.inner.set_part_number(input);
            self
        }

The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).

Examples found in repository?
src/client.rs (line 9276)
9275
9276
9277
9278
        pub fn expected_bucket_owner(mut self, input: impl Into<std::string::String>) -> Self {
            self.inner = self.inner.expected_bucket_owner(input.into());
            self
        }

The account ID of the expected bucket owner. If the bucket is owned by a different account, the request fails with the HTTP status code 403 Forbidden (access denied).

Examples found in repository?
src/client.rs (line 9284)
9280
9281
9282
9283
9284
9285
9286
        pub fn set_expected_bucket_owner(
            mut self,
            input: std::option::Option<std::string::String>,
        ) -> Self {
            self.inner = self.inner.set_expected_bucket_owner(input);
            self
        }

To retrieve the checksum, this parameter must be enabled.

In addition, if you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must have permission to use the kms:Decrypt action for the request to succeed.

Examples found in repository?
src/client.rs (line 9290)
9289
9290
9291
9292
        pub fn checksum_mode(mut self, input: crate::model::ChecksumMode) -> Self {
            self.inner = self.inner.checksum_mode(input);
            self
        }

To retrieve the checksum, this parameter must be enabled.

In addition, if you enable ChecksumMode and the object is encrypted with Amazon Web Services Key Management Service (Amazon Web Services KMS), you must have permission to use the kms:Decrypt action for the request to succeed.

Examples found in repository?
src/client.rs (line 9299)
9295
9296
9297
9298
9299
9300
9301
        pub fn set_checksum_mode(
            mut self,
            input: std::option::Option<crate::model::ChecksumMode>,
        ) -> Self {
            self.inner = self.inner.set_checksum_mode(input);
            self
        }

Consumes the builder and constructs a HeadObjectInput.

Examples found in repository?
src/client.rs (line 9088)
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
        pub async fn customize(
            self,
        ) -> std::result::Result<
            crate::operation::customize::CustomizableOperation<
                crate::operation::HeadObject,
                aws_http::retry::AwsResponseRetryClassifier,
            >,
            aws_smithy_http::result::SdkError<crate::error::HeadObjectError>,
        > {
            let handle = self.handle.clone();
            let operation = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            Ok(crate::operation::customize::CustomizableOperation { handle, operation })
        }

        /// Sends the request and returns the response.
        ///
        /// If an error occurs, an `SdkError` will be returned with additional details that
        /// can be matched against.
        ///
        /// By default, any retryable failures will be retried twice. Retry behavior
        /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
        /// set when configuring the client.
        pub async fn send(
            self,
        ) -> std::result::Result<
            crate::output::HeadObjectOutput,
            aws_smithy_http::result::SdkError<crate::error::HeadObjectError>,
        > {
            let op = self
                .inner
                .build()
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?
                .make_operation(&self.handle.conf)
                .await
                .map_err(aws_smithy_http::result::SdkError::construction_failure)?;
            self.handle.client.call(op).await
        }

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more