importPolicy method
Imports a V1 policy into V2, mapping RTO/RPO values from V1 scenarios.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter availabilitySlo :
The availability SLO to set on the imported policy.
Parameter multiAzDisasterRecoveryApproach :
The multi-AZ disaster recovery approach for the imported policy.
Parameter multiRegionDisasterRecoveryApproach :
The multi-Region disaster recovery approach for the imported policy.
Implementation
Future<ImportPolicyResponse> importPolicy({
required String v1PolicyArn,
AvailabilitySlo? availabilitySlo,
String? clientToken,
String? kmsKeyId,
MultiAzDisasterRecoveryApproach? multiAzDisasterRecoveryApproach,
MultiRegionDisasterRecoveryApproach? multiRegionDisasterRecoveryApproach,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'v1PolicyArn': v1PolicyArn,
if (availabilitySlo != null) 'availabilitySlo': availabilitySlo,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (kmsKeyId != null) 'kmsKeyId': kmsKeyId,
if (multiAzDisasterRecoveryApproach != null)
'multiAzDisasterRecoveryApproach':
multiAzDisasterRecoveryApproach.value,
if (multiRegionDisasterRecoveryApproach != null)
'multiRegionDisasterRecoveryApproach':
multiRegionDisasterRecoveryApproach.value,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/v2/import-policy',
exceptionFnMap: _exceptionFns,
);
return ImportPolicyResponse.fromJson(response);
}