libZSservicesZSamazonka-s3ZSamazonka-s3
Copyright(c) 2013-2021 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay <brendan.g.hay+amazonka@gmail.com>
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellNone

Amazonka.S3.ListObjects

Description

Returns some or all (up to 1,000) of the objects in a bucket. You can use the request parameters as selection criteria to return a subset of the objects in a bucket. A 200 OK response can contain valid or invalid XML. Be sure to design your application to parse the contents of the response and handle it appropriately.

This action has been revised. We recommend that you use the newer version, ListObjectsV2, when developing applications. For backward compatibility, Amazon S3 continues to support ListObjects.

The following operations are related to ListObjects:

This operation returns paginated results.

Synopsis

Creating a Request

data ListObjects Source #

See: newListObjects smart constructor.

Constructors

ListObjects' 

Fields

  • prefix :: Maybe Text

    Limits the response to keys that begin with the specified prefix.

  • encodingType :: Maybe EncodingType
     
  • requestPayer :: Maybe RequestPayer

    Confirms that the requester knows that she or he will be charged for the list objects request. Bucket owners need not specify this parameter in their requests.

  • marker :: Maybe Text

    Marker is where you want Amazon S3 to start listing from. Amazon S3 starts listing after this specified key. Marker can be any key in the bucket.

  • maxKeys :: Maybe Int

    Sets the maximum number of keys returned in the response. By default the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more.

  • delimiter :: Maybe Delimiter

    A delimiter is a character you use to group keys.

  • expectedBucketOwner :: Maybe Text

    The account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.

  • bucket :: BucketName

    The name of the bucket containing the objects.

    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 using 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 S3 on Outposts in the Amazon S3 User Guide.

Instances

Instances details
Eq ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Read ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Show ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Generic ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Associated Types

type Rep ListObjects :: Type -> Type #

NFData ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Methods

rnf :: ListObjects -> () #

Hashable ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

AWSPager ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

AWSRequest ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Associated Types

type AWSResponse ListObjects #

ToHeaders ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Methods

toHeaders :: ListObjects -> [Header] #

ToPath ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

ToQuery ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

type Rep ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

type AWSResponse ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

newListObjects Source #

Create a value of ListObjects with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:prefix:ListObjects', listObjects_prefix - Limits the response to keys that begin with the specified prefix.

$sel:encodingType:ListObjects', listObjects_encodingType - Undocumented member.

$sel:requestPayer:ListObjects', listObjects_requestPayer - Confirms that the requester knows that she or he will be charged for the list objects request. Bucket owners need not specify this parameter in their requests.

$sel:marker:ListObjects', listObjects_marker - Marker is where you want Amazon S3 to start listing from. Amazon S3 starts listing after this specified key. Marker can be any key in the bucket.

$sel:maxKeys:ListObjects', listObjects_maxKeys - Sets the maximum number of keys returned in the response. By default the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more.

$sel:delimiter:ListObjects', listObjects_delimiter - A delimiter is a character you use to group keys.

$sel:expectedBucketOwner:ListObjects', listObjects_expectedBucketOwner - The account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.

$sel:bucket:ListObjects', listObjects_bucket - The name of the bucket containing the objects.

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 using 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 S3 on Outposts in the Amazon S3 User Guide.

Request Lenses

listObjects_prefix :: Lens' ListObjects (Maybe Text) Source #

Limits the response to keys that begin with the specified prefix.

listObjects_requestPayer :: Lens' ListObjects (Maybe RequestPayer) Source #

Confirms that the requester knows that she or he will be charged for the list objects request. Bucket owners need not specify this parameter in their requests.

listObjects_marker :: Lens' ListObjects (Maybe Text) Source #

Marker is where you want Amazon S3 to start listing from. Amazon S3 starts listing after this specified key. Marker can be any key in the bucket.

listObjects_maxKeys :: Lens' ListObjects (Maybe Int) Source #

Sets the maximum number of keys returned in the response. By default the action returns up to 1,000 key names. The response might contain fewer keys but will never contain more.

listObjects_delimiter :: Lens' ListObjects (Maybe Delimiter) Source #

A delimiter is a character you use to group keys.

listObjects_expectedBucketOwner :: Lens' ListObjects (Maybe Text) Source #

The account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.

listObjects_bucket :: Lens' ListObjects BucketName Source #

The name of the bucket containing the objects.

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 using 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 S3 on Outposts in the Amazon S3 User Guide.

Destructuring the Response

data ListObjectsResponse Source #

See: newListObjectsResponse smart constructor.

Constructors

ListObjectsResponse' 

Fields

  • contents :: Maybe [Object]

    Metadata about each object returned.

  • prefix :: Maybe Text

    Keys that begin with the indicated prefix.

  • commonPrefixes :: Maybe [CommonPrefix]

    All of the keys (up to 1,000) rolled up in a common prefix count as a single return when calculating the number of returns.

    A response can contain CommonPrefixes only if you specify a delimiter.

    CommonPrefixes contains all (if there are any) keys between Prefix and the next occurrence of the string specified by the delimiter.

    CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix.

    For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix is notes/summer/. All of the keys that roll up into a common prefix count as a single return when calculating the number of returns.

  • encodingType :: Maybe EncodingType

    Encoding type used by Amazon S3 to encode object keys in the response.

  • name :: Maybe BucketName

    The bucket name.

  • marker :: Maybe Text

    Indicates where in the bucket listing begins. Marker is included in the response if it was sent with the request.

  • nextMarker :: Maybe Text

    When response is truncated (the IsTruncated element value in the response is true), you can use the key name in this field as marker in the subsequent request to get next set of objects. Amazon S3 lists objects in alphabetical order Note: This element is returned only if you have delimiter request parameter specified. If response does not include the NextMarker and it is truncated, you can use the value of the last Key in the response as the marker in the subsequent request to get the next set of object keys.

  • maxKeys :: Maybe Int

    The maximum number of keys returned in the response body.

  • isTruncated :: Maybe Bool

    A flag that indicates whether Amazon S3 returned all of the results that satisfied the search criteria.

  • delimiter :: Maybe Delimiter

    Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against the MaxKeys value.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Eq ListObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Read ListObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Show ListObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Generic ListObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Associated Types

type Rep ListObjectsResponse :: Type -> Type #

NFData ListObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Methods

rnf :: ListObjectsResponse -> () #

type Rep ListObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.ListObjects

newListObjectsResponse Source #

Create a value of ListObjectsResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:contents:ListObjectsResponse', listObjectsResponse_contents - Metadata about each object returned.

$sel:prefix:ListObjects', listObjectsResponse_prefix - Keys that begin with the indicated prefix.

$sel:commonPrefixes:ListObjectsResponse', listObjectsResponse_commonPrefixes - All of the keys (up to 1,000) rolled up in a common prefix count as a single return when calculating the number of returns.

A response can contain CommonPrefixes only if you specify a delimiter.

CommonPrefixes contains all (if there are any) keys between Prefix and the next occurrence of the string specified by the delimiter.

CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix.

For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix is notes/summer/. All of the keys that roll up into a common prefix count as a single return when calculating the number of returns.

$sel:encodingType:ListObjects', listObjectsResponse_encodingType - Encoding type used by Amazon S3 to encode object keys in the response.

$sel:name:ListObjectsResponse', listObjectsResponse_name - The bucket name.

$sel:marker:ListObjects', listObjectsResponse_marker - Indicates where in the bucket listing begins. Marker is included in the response if it was sent with the request.

$sel:nextMarker:ListObjectsResponse', listObjectsResponse_nextMarker - When response is truncated (the IsTruncated element value in the response is true), you can use the key name in this field as marker in the subsequent request to get next set of objects. Amazon S3 lists objects in alphabetical order Note: This element is returned only if you have delimiter request parameter specified. If response does not include the NextMarker and it is truncated, you can use the value of the last Key in the response as the marker in the subsequent request to get the next set of object keys.

$sel:maxKeys:ListObjects', listObjectsResponse_maxKeys - The maximum number of keys returned in the response body.

$sel:isTruncated:ListObjectsResponse', listObjectsResponse_isTruncated - A flag that indicates whether Amazon S3 returned all of the results that satisfied the search criteria.

$sel:delimiter:ListObjects', listObjectsResponse_delimiter - Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against the MaxKeys value.

$sel:httpStatus:ListObjectsResponse', listObjectsResponse_httpStatus - The response's http status code.

Response Lenses

listObjectsResponse_contents :: Lens' ListObjectsResponse (Maybe [Object]) Source #

Metadata about each object returned.

listObjectsResponse_prefix :: Lens' ListObjectsResponse (Maybe Text) Source #

Keys that begin with the indicated prefix.

listObjectsResponse_commonPrefixes :: Lens' ListObjectsResponse (Maybe [CommonPrefix]) Source #

All of the keys (up to 1,000) rolled up in a common prefix count as a single return when calculating the number of returns.

A response can contain CommonPrefixes only if you specify a delimiter.

CommonPrefixes contains all (if there are any) keys between Prefix and the next occurrence of the string specified by the delimiter.

CommonPrefixes lists keys that act like subdirectories in the directory specified by Prefix.

For example, if the prefix is notes/ and the delimiter is a slash (/) as in notes/summer/july, the common prefix is notes/summer/. All of the keys that roll up into a common prefix count as a single return when calculating the number of returns.

listObjectsResponse_encodingType :: Lens' ListObjectsResponse (Maybe EncodingType) Source #

Encoding type used by Amazon S3 to encode object keys in the response.

listObjectsResponse_marker :: Lens' ListObjectsResponse (Maybe Text) Source #

Indicates where in the bucket listing begins. Marker is included in the response if it was sent with the request.

listObjectsResponse_nextMarker :: Lens' ListObjectsResponse (Maybe Text) Source #

When response is truncated (the IsTruncated element value in the response is true), you can use the key name in this field as marker in the subsequent request to get next set of objects. Amazon S3 lists objects in alphabetical order Note: This element is returned only if you have delimiter request parameter specified. If response does not include the NextMarker and it is truncated, you can use the value of the last Key in the response as the marker in the subsequent request to get the next set of object keys.

listObjectsResponse_maxKeys :: Lens' ListObjectsResponse (Maybe Int) Source #

The maximum number of keys returned in the response body.

listObjectsResponse_isTruncated :: Lens' ListObjectsResponse (Maybe Bool) Source #

A flag that indicates whether Amazon S3 returned all of the results that satisfied the search criteria.

listObjectsResponse_delimiter :: Lens' ListObjectsResponse (Maybe Delimiter) Source #

Causes keys that contain the same string between the prefix and the first occurrence of the delimiter to be rolled up into a single result element in the CommonPrefixes collection. These rolled-up keys are not returned elsewhere in the response. Each rolled-up result counts as only one return against the MaxKeys value.