deleteClusterPolicy method
Deletes the resource-based policy attached to a cluster. This removes all access permissions defined by the policy, reverting to default access controls.
May throw ConflictException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter expectedPolicyVersion :
The expected version of the policy to delete. This parameter ensures that
you're deleting the correct version of the policy and helps prevent
accidental deletions.
Implementation
Future<DeleteClusterPolicyOutput> deleteClusterPolicy({
required String identifier,
String? clientToken,
String? expectedPolicyVersion,
}) async {
final $query = <String, List<String>>{
if (clientToken != null) 'client-token': [clientToken],
if (expectedPolicyVersion != null)
'expected-policy-version': [expectedPolicyVersion],
};
final response = await _protocol.send(
payload: null,
method: 'DELETE',
requestUri: '/cluster/${Uri.encodeComponent(identifier)}/policy',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return DeleteClusterPolicyOutput.fromJson(response);
}