putClusterPolicy method
Creates or updates the MSK cluster policy specified by the cluster Amazon Resource Name (ARN) in the request.
May throw BadRequestException.
May throw ForbiddenException.
May throw InternalServerErrorException.
Parameter clusterArn :
The Amazon Resource Name (ARN) of the cluster.
Parameter policy :
The policy.
Parameter currentVersion :
The policy version.
Implementation
Future<PutClusterPolicyResponse> putClusterPolicy({
required String clusterArn,
required String policy,
String? currentVersion,
}) async {
final $payload = <String, dynamic>{
'policy': policy,
if (currentVersion != null) 'currentVersion': currentVersion,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/v1/clusters/${Uri.encodeComponent(clusterArn)}/policy',
exceptionFnMap: _exceptionFns,
);
return PutClusterPolicyResponse.fromJson(response);
}