updateResiliencyPolicy method
Updates a resiliency policy.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter policyArn :
Amazon Resource Name (ARN) of the resiliency policy. The format for this
ARN is:
arn:partition:resiliencehub:region:account:resiliency-policy/policy-id.
For more information about ARNs, see
Amazon Resource Names (ARNs) in the Amazon Web Services General
Reference guide.
Parameter dataLocationConstraint :
Specifies a high-level geographical location constraint for where your
resilience policy data can be stored.
Parameter policy :
Resiliency policy to be created, including the recovery time objective
(RTO) and recovery point objective (RPO) in seconds.
Parameter policyDescription :
Description of the resiliency policy.
Parameter policyName :
Name of the resiliency policy.
Parameter tier :
The tier for this resiliency policy, ranging from the highest severity
(MissionCritical) to lowest (NonCritical).
Implementation
Future<UpdateResiliencyPolicyResponse> updateResiliencyPolicy({
required String policyArn,
DataLocationConstraint? dataLocationConstraint,
Map<DisruptionType, FailurePolicy>? policy,
String? policyDescription,
String? policyName,
ResiliencyPolicyTier? tier,
}) async {
final $payload = <String, dynamic>{
'policyArn': policyArn,
if (dataLocationConstraint != null)
'dataLocationConstraint': dataLocationConstraint.value,
if (policy != null) 'policy': policy.map((k, e) => MapEntry(k.value, e)),
if (policyDescription != null) 'policyDescription': policyDescription,
if (policyName != null) 'policyName': policyName,
if (tier != null) 'tier': tier.value,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/update-resiliency-policy',
exceptionFnMap: _exceptionFns,
);
return UpdateResiliencyPolicyResponse.fromJson(response);
}