updatePolicy method
Updates an existing resilience policy.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter availabilitySlo :
The updated availability SLO for the policy.
Parameter dataRecovery :
The updated data recovery targets for the policy.
Parameter multiAz :
The updated multi-AZ disaster recovery targets for the policy.
Parameter multiRegion :
The updated multi-Region disaster recovery targets for the policy.
Implementation
Future<UpdatePolicyResponse> updatePolicy({
required String policyArn,
AvailabilitySlo? availabilitySlo,
DataRecoveryTargets? dataRecovery,
String? description,
MultiAzTargets? multiAz,
MultiRegionTargets? multiRegion,
}) async {
final $payload = <String, dynamic>{
'policyArn': policyArn,
if (availabilitySlo != null) 'availabilitySlo': availabilitySlo,
if (dataRecovery != null) 'dataRecovery': dataRecovery,
if (description != null) 'description': description,
if (multiAz != null) 'multiAz': multiAz,
if (multiRegion != null) 'multiRegion': multiRegion,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v2/update-policy',
exceptionFnMap: _exceptionFns,
);
return UpdatePolicyResponse.fromJson(response);
}