putBackupPolicy method

Future<BackupPolicyDescription> putBackupPolicy({
  1. required BackupPolicy backupPolicy,
  2. required String fileSystemId,
})

Updates the file system's backup policy. Use this action to start or stop automatic backups of the file system.

May throw BadRequest. May throw FileSystemNotFound. May throw IncorrectFileSystemLifeCycleState. May throw InternalServerError. May throw ValidationException.

Parameter backupPolicy : The backup policy included in the PutBackupPolicy request.

Parameter fileSystemId : Specifies which EFS file system to update the backup policy for.

Implementation

Future<BackupPolicyDescription> putBackupPolicy({
  required BackupPolicy backupPolicy,
  required String fileSystemId,
}) async {
  ArgumentError.checkNotNull(backupPolicy, 'backupPolicy');
  ArgumentError.checkNotNull(fileSystemId, 'fileSystemId');
  _s.validateStringLength(
    'fileSystemId',
    fileSystemId,
    0,
    128,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    'BackupPolicy': backupPolicy,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/2015-02-01/file-systems/${Uri.encodeComponent(fileSystemId)}/backup-policy',
    exceptionFnMap: _exceptionFns,
  );
  return BackupPolicyDescription.fromJson(response);
}