getBucketMetadataConfiguration method

Future<GetBucketMetadataConfigurationOutput> getBucketMetadataConfiguration({
  1. required String bucket,
  2. String? expectedBucketOwner,
})

Retrieves the S3 Metadata configuration for a general purpose bucket. For more information, see Accelerating data discovery with S3 Metadata in the Amazon S3 User Guide.

Permissions
To use this operation, you must have the s3:GetBucketMetadataTableConfiguration permission. For more information, see Setting up permissions for configuring metadata tables in the Amazon S3 User Guide.
The following operations are related to GetBucketMetadataConfiguration:

Parameter bucket : The general purpose bucket that corresponds to the metadata configuration that you want to retrieve.

Parameter expectedBucketOwner : The expected owner of the general purpose bucket that you want to retrieve the metadata table configuration for.

Implementation

Future<GetBucketMetadataConfigurationOutput> getBucketMetadataConfiguration({
  required String bucket,
  String? expectedBucketOwner,
}) async {
  final headers = <String, String>{
    if (expectedBucketOwner != null)
      'x-amz-expected-bucket-owner': expectedBucketOwner.toString(),
  };
  final $result = await _protocol.sendRaw(
    method: 'GET',
    requestUri: '/${Uri.encodeComponent(bucket)}?metadataConfiguration',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
  final $elem = await _s.xmlFromResponse($result);
  return GetBucketMetadataConfigurationOutput(
    getBucketMetadataConfigurationResult:
        GetBucketMetadataConfigurationResult.fromXml($elem),
  );
}