Copyright | (c) 2013-2023 Brendan Hay |
---|---|
License | Mozilla Public License, v. 2.0. |
Maintainer | Brendan Hay |
Stability | auto-generated |
Portability | non-portable (GHC extensions) |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
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_delimiter :: Lens' ListObjects (Maybe Delimiter)
- listObjects_encodingType :: Lens' ListObjects (Maybe EncodingType)
- listObjects_expectedBucketOwner :: Lens' ListObjects (Maybe Text)
- listObjects_marker :: Lens' ListObjects (Maybe Text)
- listObjects_maxKeys :: Lens' ListObjects (Maybe Int)
- listObjects_prefix :: Lens' ListObjects (Maybe Text)
- listObjects_requestPayer :: Lens' ListObjects (Maybe RequestPayer)
- listObjects_bucket :: Lens' ListObjects BucketName
- data ListObjectsResponse = ListObjectsResponse' {
- commonPrefixes :: Maybe [CommonPrefix]
- contents :: Maybe [Object]
- delimiter :: Maybe Delimiter
- encodingType :: Maybe EncodingType
- isTruncated :: Maybe Bool
- marker :: Maybe Text
- maxKeys :: Maybe Int
- name :: Maybe BucketName
- nextMarker :: Maybe Text
- prefix :: Maybe Text
- httpStatus :: Int
- newListObjectsResponse :: Int -> ListObjectsResponse
- listObjectsResponse_commonPrefixes :: Lens' ListObjectsResponse (Maybe [CommonPrefix])
- listObjectsResponse_contents :: Lens' ListObjectsResponse (Maybe [Object])
- listObjectsResponse_delimiter :: Lens' ListObjectsResponse (Maybe Delimiter)
- listObjectsResponse_encodingType :: Lens' ListObjectsResponse (Maybe EncodingType)
- listObjectsResponse_isTruncated :: Lens' ListObjectsResponse (Maybe Bool)
- listObjectsResponse_marker :: Lens' ListObjectsResponse (Maybe Text)
- listObjectsResponse_maxKeys :: Lens' ListObjectsResponse (Maybe Int)
- listObjectsResponse_name :: Lens' ListObjectsResponse (Maybe BucketName)
- listObjectsResponse_nextMarker :: Lens' ListObjectsResponse (Maybe Text)
- listObjectsResponse_prefix :: Lens' ListObjectsResponse (Maybe Text)
- 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:
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_encodingType :: Lens' ListObjects (Maybe EncodingType) Source #
Undocumented member.
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.
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: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_name :: Lens' ListObjectsResponse (Maybe BucketName) Source #
The bucket name.
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.
listObjectsResponse_httpStatus :: Lens' ListObjectsResponse Int Source #
The response's http status code.