getResourcePolicy method

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

Retrieves a specified resource policy.

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

Parameter resourceArn : The ARN of the AWS Glue resource for the resource policy to be retrieved. For more information about AWS Glue resource ARNs, see the AWS Glue ARN string pattern

Implementation

Future<GetResourcePolicyResponse> getResourcePolicy({
  String? resourceArn,
}) async {
  _s.validateStringLength(
    'resourceArn',
    resourceArn,
    1,
    10240,
  );
  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);
}