getResourcePolicy method

Future<GetResourcePolicyResponse> getResourcePolicy({
  1. required String resourceArn,
})

Returns the resource-based policy document attached to the resource in JSON format.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the billing view resource to which the policy is attached to.

Implementation

Future<GetResourcePolicyResponse> getResourcePolicy({
  required String resourceArn,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSBilling.GetResourcePolicy'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'resourceArn': resourceArn,
    },
  );

  return GetResourcePolicyResponse.fromJson(jsonResponse.body);
}