putBackupVaultAccessPolicy method

Future<void> putBackupVaultAccessPolicy({
  1. required String backupVaultName,
  2. String? policy,
})

Sets a resource-based policy that is used to manage access permissions on the target backup vault. Requires a backup vault name and an access policy document in JSON format.

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

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 policy : The backup vault access policy document in JSON format.

Implementation

Future<void> putBackupVaultAccessPolicy({
  required String backupVaultName,
  String? policy,
}) async {
  ArgumentError.checkNotNull(backupVaultName, 'backupVaultName');
  final $payload = <String, dynamic>{
    if (policy != null) 'Policy': policy,
  };
  await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/backup-vaults/${Uri.encodeComponent(backupVaultName)}/access-policy',
    exceptionFnMap: _exceptionFns,
  );
}