getContainerPolicy method

Future<GetContainerPolicyOutput> getContainerPolicy({
  1. required String containerName,
})

Retrieves the access policy for the specified container. For information about the data that is included in an access policy, see the AWS Identity and Access Management User Guide.

May throw ContainerInUseException. May throw ContainerNotFoundException. May throw PolicyNotFoundException. May throw InternalServerError.

Parameter containerName : The name of the container.

Implementation

Future<GetContainerPolicyOutput> getContainerPolicy({
  required String containerName,
}) async {
  ArgumentError.checkNotNull(containerName, 'containerName');
  _s.validateStringLength(
    'containerName',
    containerName,
    1,
    255,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'MediaStore_20170901.GetContainerPolicy'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ContainerName': containerName,
    },
  );

  return GetContainerPolicyOutput.fromJson(jsonResponse.body);
}