getResourcePolicy method

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

Retrieves a specified resource policy.

May throw EntityNotFoundException. May throw InternalServiceException. May throw InvalidInputException. May throw OperationTimeoutException.

Parameter resourceArn : The ARN of the Glue resource for which to retrieve the resource policy. If not supplied, the Data Catalog resource policy is returned. Use GetResourcePolicies to view all existing resource policies. For more information see Specifying Glue Resource ARNs.

Implementation

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

  return GetResourcePolicyResponse.fromJson(jsonResponse.body);
}