putBackupVaultNotifications method

Future<void> putBackupVaultNotifications({
  1. required List<BackupVaultEvent> backupVaultEvents,
  2. required String backupVaultName,
  3. required String sNSTopicArn,
})

Turns on notifications on a backup vault for the specified topic and events.

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

Parameter backupVaultEvents : An array of events that indicate the status of jobs to back up resources to the backup vault.

Parameter backupVaultName : The name of a logical 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 sNSTopicArn : The Amazon Resource Name (ARN) that specifies the topic for a backup vault’s events; for example, arn:aws:sns:us-west-2:111122223333:MyVaultTopic.

Implementation

Future<void> putBackupVaultNotifications({
  required List<BackupVaultEvent> backupVaultEvents,
  required String backupVaultName,
  required String sNSTopicArn,
}) async {
  ArgumentError.checkNotNull(backupVaultEvents, 'backupVaultEvents');
  ArgumentError.checkNotNull(backupVaultName, 'backupVaultName');
  ArgumentError.checkNotNull(sNSTopicArn, 'sNSTopicArn');
  final $payload = <String, dynamic>{
    'BackupVaultEvents': backupVaultEvents.map((e) => e.toValue()).toList(),
    'SNSTopicArn': sNSTopicArn,
  };
  await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/backup-vaults/${Uri.encodeComponent(backupVaultName)}/notification-configuration',
    exceptionFnMap: _exceptionFns,
  );
}