amazonka-s3-2.0: Amazon Simple Storage Service SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

  • delimiter :: Maybe Delimiter

    A delimiter is a character you use to group keys.

  • encodingType :: Maybe EncodingType
     
  • expectedBucketOwner :: Maybe Text

    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).

  • 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.

  • prefix :: Maybe Text

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

  • 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.

  • 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 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.

Instances

Instances details
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

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 #

Generic ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Associated Types

type Rep ListObjects :: Type -> Type #

Read ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Show ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

NFData ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Methods

rnf :: ListObjects -> () #

Eq ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Hashable ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

type AWSResponse ListObjects Source # 
Instance details

Defined in Amazonka.S3.ListObjects

type Rep 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:

ListObjects, listObjects_delimiter - A delimiter is a character you use to group keys.

ListObjects, listObjects_encodingType - Undocumented member.

$sel:expectedBucketOwner:ListObjects', listObjects_expectedBucketOwner - 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).

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.

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.

ListObjects, listObjects_prefix - Limits the response to keys that begin with the specified prefix.

$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.

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 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.

Request Lenses

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 fails with the HTTP status code 403 Forbidden (access denied).

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_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_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 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.

Destructuring the Response

data ListObjectsResponse Source #

See: newListObjectsResponse smart constructor.

Constructors

ListObjectsResponse' 

Fields

  • 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.

  • contents :: Maybe [Object]

    Metadata about each object returned.

  • 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.

  • encodingType :: Maybe EncodingType

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

  • isTruncated :: Maybe Bool

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

  • marker :: Maybe Text

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

  • maxKeys :: Maybe Int

    The maximum number of keys returned in the response body.

  • name :: Maybe BucketName

    The bucket name.

  • 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.

  • prefix :: Maybe Text

    Keys that begin with the indicated prefix.

  • httpStatus :: Int

    The response's http status code.

Instances

Instances details
Generic ListObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Associated Types

type Rep ListObjectsResponse :: Type -> Type #

Read ListObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Show ListObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.ListObjects

NFData ListObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.ListObjects

Methods

rnf :: ListObjectsResponse -> () #

Eq ListObjectsResponse Source # 
Instance details

Defined in Amazonka.S3.ListObjects

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: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:contents:ListObjectsResponse', listObjectsResponse_contents - Metadata about each object returned.

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.

ListObjects, listObjectsResponse_encodingType - Encoding type used by Amazon S3 to encode object keys in the response.

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

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

ListObjects, listObjectsResponse_maxKeys - The maximum number of keys returned in the response body.

ListObjectsResponse, listObjectsResponse_name - The bucket name.

$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.

ListObjects, listObjectsResponse_prefix - Keys that begin with the indicated prefix.

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

Response Lenses

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_contents :: Lens' ListObjectsResponse (Maybe [Object]) Source #

Metadata about each object returned.

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.

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

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

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_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_maxKeys :: Lens' ListObjectsResponse (Maybe Int) Source #

The maximum number of keys returned in the response body.

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_prefix :: Lens' ListObjectsResponse (Maybe Text) Source #

Keys that begin with the indicated prefix.