restoreKey method

Future<RestoreKeyOutput> restoreKey({
  1. required String keyIdentifier,
})

Cancels a scheduled key deletion during the waiting period. Use this operation to restore a Key that is scheduled for deletion.

During the waiting period, the KeyState is DELETE_PENDING and deletePendingTimestamp contains the date and time after which the Key will be deleted. After Key is restored, the KeyState is CREATE_COMPLETE, and the value for deletePendingTimestamp is removed.

Cross-account use: This operation supports cross-account use when the key has a resource-based policy that grants access. For more information, see Resource-based policies.

Related operations:

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ServiceUnavailableException. May throw ThrottlingException. May throw ValidationException.

Parameter keyIdentifier : The KeyARN of the key to be restored within Amazon Web Services Payment Cryptography.

Implementation

Future<RestoreKeyOutput> restoreKey({
  required String keyIdentifier,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'PaymentCryptographyControlPlane.RestoreKey'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'KeyIdentifier': keyIdentifier,
    },
  );

  return RestoreKeyOutput.fromJson(jsonResponse.body);
}