deleteResourcePolicy method

Future<void> deleteResourcePolicy({
  1. required String resourceArn,
  2. String? policyRevisionId,
})

Deletes a resource-based policy that is attached to a custom model.

May throw InternalServerException. May throw InvalidRequestException. May throw ResourceNotFoundException.

Parameter resourceArn : The Amazon Resource Name (ARN) of the custom model version that has the policy to delete.

Parameter policyRevisionId : The revision ID of the policy to delete.

Implementation

Future<void> deleteResourcePolicy({
  required String resourceArn,
  String? policyRevisionId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Comprehend_20171127.DeleteResourcePolicy'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ResourceArn': resourceArn,
      if (policyRevisionId != null) 'PolicyRevisionId': policyRevisionId,
    },
  );
}