getResourcePolicy method

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

Gets a resource policy that is identified by its resource ARN.

May throw InvalidInputException. May throw ResourceNotFoundException.

Parameter resourceArn : The ARN of the resource that is associated with the resource policy.

Implementation

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

  return GetResourcePolicyOutput.fromJson(jsonResponse.body);
}