deleteProjectPolicy method

Future<void> deleteProjectPolicy({
  1. required String policyName,
  2. required String projectArn,
  3. String? policyRevisionId,
})
Deletes an existing project policy.

To get a list of project policies attached to a project, call ListProjectPolicies. To attach a project policy to a project, call PutProjectPolicy.

This operation requires permissions to perform the rekognition:DeleteProjectPolicy action.

May throw AccessDeniedException. May throw InternalServerError. May throw InvalidParameterException. May throw InvalidPolicyRevisionIdException. May throw ProvisionedThroughputExceededException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter policyName : The name of the policy that you want to delete.

Parameter projectArn : The Amazon Resource Name (ARN) of the project that the project policy you want to delete is attached to.

Parameter policyRevisionId : The ID of the project policy revision that you want to delete.

Implementation

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