bucket/head_object

https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html

Types

pub type Outcome {
  Found
  NotFound
  PreconditionFailed
}

Constructors

  • Found
  • NotFound
  • PreconditionFailed

The parameters for the API request

pub type RequestBuilder {
  RequestBuilder(
    bucket: String,
    key: String,
    if_match: Option(String),
    expected_bucket_owner: Option(String),
  )
}

Constructors

  • RequestBuilder(
      bucket: String,
      key: String,
      if_match: Option(String),
      expected_bucket_owner: Option(String),
    )

Functions

pub fn build(
  builder: RequestBuilder,
  creds: Credentials,
) -> Request(BitArray)
pub fn expected_bucket_owner(
  builder: RequestBuilder,
  expected_bucket_owner: String,
) -> RequestBuilder

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 403 Forbidden (access denied).

pub fn if_match(
  builder: RequestBuilder,
  etag etag: String,
) -> RequestBuilder

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

If both of the If-Match and If-Unmodified-Since headers are present in the request as follows:

If-Match condition evaluates to true, and; If-Unmodified-Since condition evaluates to false; Then Amazon S3 returns 200 OK and the data requested.

For more information about conditional requests, see RFC 7232. https://datatracker.ietf.org/doc/html/rfc7232

pub fn request(
  bucket bucket: String,
  key key: String,
) -> RequestBuilder
pub fn response(
  response: Response(BitArray),
) -> Result(Outcome, BucketError)
Search Document