getBucketPolicy method

Future<Map<String, dynamic>?> getBucketPolicy(
  1. String bucket
)

Get the bucket policy associated with the specified bucket. If objectPrefix is not empty, the bucket policy will be filtered based on object permissions as well.

Implementation

Future<Map<String, dynamic>?> getBucketPolicy(String bucket) async {
  MinioInvalidBucketNameError.check(bucket);

  final resp = await _client.request(
    method: 'GET',
    bucket: bucket,
    resource: 'policy',
  );

  validate(resp, expect: 200);

  return json.decode(resp.body) as Map<String, dynamic>?;
}