listObjectVersions
inline suspend fun S3Client.listObjectVersions(crossinline block: ListObjectVersionsRequest.Builder.() -> Unit): ListObjectVersionsResponse
This operation is not supported by directory buckets.
Returns metadata about all versions of the objects in a bucket. You can also use request parameters as selection criteria to return metadata about a subset of all the object versions.
To use this operation, you must have permission to perform the s3:ListBucketVersions
action. Be aware of the name difference.
A 200 OK
response can contain valid or invalid XML. Make sure to design your application to parse the contents of the response and handle it appropriately.
To use this operation, you must have READ access to the bucket.
The following operations are related to ListObjectVersions
:
Samples
fun main() {
//sampleStart
// The following example return versions of an object with specific key name prefix. The request limits
// the number of items returned to two. If there are are more than two object version, S3 returns
// NextToken in the response. You can specify this token value in your next request to fetch next set of object
// versions.
val resp = s3Client.listObjectVersions {
bucket = "examplebucket"
prefix = "HappyFace.jpg"
}
//sampleEnd
}