runWithOutput method

  1. @override
Future<void> runWithOutput(
  1. Configuration<DbBackupCreateOption> commandConfig,
  2. CommandOutput output
)
override

Runs this command with prepared configuration and output.

Subclasses should override this method.

Implementation

@override
Future<void> runWithOutput(
  final Configuration<DbBackupCreateOption> commandConfig,
  final CommandOutput output,
) async {
  final projectId = commandConfig.value(DbBackupCreateOption.projectId);
  final utc = commandConfig.value(DbBackupCreateOption.utc);

  await renderCommand(
    output,
    operation: () => DbBackupOperations.createSnapshot(
      runner.serviceProvider.cloudApiClient,
      projectId: projectId,
      name: commandConfig.optionalValue(DbBackupCreateOption.name),
      expireIn: commandConfig.optionalValue(DbBackupCreateOption.expireIn),
    ),
    textOutputUi: BackupSnapshotCreateTextUi(utc: utc),
  );
}