Copyright | (c) 2013-2021 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay <brendan.g.hay+amazonka@gmail.com> |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | None |
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
- data ListObjects = ListObjects' {}
- newListObjects :: BucketName -> ListObjects
- listObjects_prefix :: Lens' ListObjects (Maybe Text)
- listObjects_encodingType :: Lens' ListObjects (Maybe EncodingType)
- listObjects_requestPayer :: Lens' ListObjects (Maybe RequestPayer)
- listObjects_marker :: Lens' ListObjects (Maybe Text)
- listObjects_maxKeys :: Lens' ListObjects (Maybe Int)
- listObjects_delimiter :: Lens' ListObjects (Maybe Delimiter)
- listObjects_expectedBucketOwner :: Lens' ListObjects (Maybe Text)
- listObjects_bucket :: Lens' ListObjects BucketName
- data ListObjectsResponse = ListObjectsResponse' {
- contents :: Maybe [Object]
- prefix :: Maybe Text
- commonPrefixes :: Maybe [CommonPrefix]
- encodingType :: Maybe EncodingType
- name :: Maybe BucketName
- marker :: Maybe Text
- nextMarker :: Maybe Text
- maxKeys :: Maybe Int
- isTruncated :: Maybe Bool
- delimiter :: Maybe Delimiter
- httpStatus :: Int
- newListObjectsResponse :: Int -> ListObjectsResponse
- listObjectsResponse_contents :: Lens' ListObjectsResponse (Maybe [Object])
- listObjectsResponse_prefix :: Lens' ListObjectsResponse (Maybe Text)
- listObjectsResponse_commonPrefixes :: Lens' ListObjectsResponse (Maybe [CommonPrefix])
- listObjectsResponse_encodingType :: Lens' ListObjectsResponse (Maybe EncodingType)
- listObjectsResponse_name :: Lens' ListObjectsResponse (Maybe BucketName)
- listObjectsResponse_marker :: Lens' ListObjectsResponse (Maybe Text)
- listObjectsResponse_nextMarker :: Lens' ListObjectsResponse (Maybe Text)
- listObjectsResponse_maxKeys :: Lens' ListObjectsResponse (Maybe Int)
- listObjectsResponse_isTruncated :: Lens' ListObjectsResponse (Maybe Bool)
- listObjectsResponse_delimiter :: Lens' ListObjectsResponse (Maybe Delimiter)
- listObjectsResponse_httpStatus :: Lens' ListObjectsResponse Int
Creating a Request
data ListObjects Source #
See: newListObjects
smart constructor.
ListObjects' | |
|
Instances
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_encodingType :: Lens' ListObjects (Maybe EncodingType) Source #
Undocumented member.
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.
ListObjectsResponse' | |
|
Instances
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_name :: Lens' ListObjectsResponse (Maybe BucketName) Source #
The bucket name.
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.
listObjectsResponse_httpStatus :: Lens' ListObjectsResponse Int Source #
The response's http status code.