startCopyJob method

Future<StartCopyJobOutput> startCopyJob({
  1. required String destinationBackupVaultArn,
  2. required String iamRoleArn,
  3. required String recoveryPointArn,
  4. required String sourceBackupVaultName,
  5. String? idempotencyToken,
  6. Lifecycle? lifecycle,
})

Starts a job to create a one-time copy of the specified resource.

May throw ResourceNotFoundException. May throw InvalidParameterValueException. May throw MissingParameterValueException. May throw ServiceUnavailableException. May throw LimitExceededException.

Parameter destinationBackupVaultArn : An Amazon Resource Name (ARN) that uniquely identifies a destination backup vault to copy to; for example, arn:aws:backup:us-east-1:123456789012:vault:aBackupVault.

Parameter iamRoleArn : Specifies the IAM role ARN used to copy the target recovery point; for example, arn:aws:iam::123456789012:role/S3Access.

Parameter recoveryPointArn : An ARN that uniquely identifies a recovery point to use for the copy job; for example, arn:aws:backup:us-east-1:123456789012:recovery-point:1EB3B5E7-9EB0-435A-A80B-108B488B0D45.

Parameter sourceBackupVaultName : The name of a logical source container where backups are stored. Backup vaults are identified by names that are unique to the account used to create them and the AWS Region where they are created. They consist of lowercase letters, numbers, and hyphens.

Parameter idempotencyToken : A customer chosen string that can be used to distinguish between calls to StartCopyJob.

Implementation

Future<StartCopyJobOutput> startCopyJob({
  required String destinationBackupVaultArn,
  required String iamRoleArn,
  required String recoveryPointArn,
  required String sourceBackupVaultName,
  String? idempotencyToken,
  Lifecycle? lifecycle,
}) async {
  ArgumentError.checkNotNull(
      destinationBackupVaultArn, 'destinationBackupVaultArn');
  ArgumentError.checkNotNull(iamRoleArn, 'iamRoleArn');
  ArgumentError.checkNotNull(recoveryPointArn, 'recoveryPointArn');
  ArgumentError.checkNotNull(sourceBackupVaultName, 'sourceBackupVaultName');
  final $payload = <String, dynamic>{
    'DestinationBackupVaultArn': destinationBackupVaultArn,
    'IamRoleArn': iamRoleArn,
    'RecoveryPointArn': recoveryPointArn,
    'SourceBackupVaultName': sourceBackupVaultName,
    if (idempotencyToken != null) 'IdempotencyToken': idempotencyToken,
    if (lifecycle != null) 'Lifecycle': lifecycle,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/copy-jobs',
    exceptionFnMap: _exceptionFns,
  );
  return StartCopyJobOutput.fromJson(response);
}