getResourcePolicy method

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

Returns the resource-based policy attached to an Amazon Web Services Payment Cryptography key.

Cross-account use: This operation can't be used across different Amazon Web Services accounts.

Related operations:

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

Parameter resourceArn : The KeyARN of the key whose resource-based policy you want to retrieve.

Implementation

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

  return GetResourcePolicyOutput.fromJson(jsonResponse.body);
}