deleteProject static method

Future<void> deleteProject(
  1. Client cloudApiClient, {
  2. required CommandLogger logger,
  3. required String projectId,
})

Implementation

static Future<void> deleteProject(
  final Client cloudApiClient, {
  required final CommandLogger logger,
  required final String projectId,
}) async {
  final shouldDelete = await logger.confirm(
    'Are you sure you want to delete the project "$projectId"?',
    defaultValue: false,
  );

  if (!shouldDelete) {
    throw UserAbortException();
  }

  try {
    await cloudApiClient.projects.deleteProject(cloudProjectId: projectId);
  } on Exception catch (e, s) {
    throw FailureException.nested(
        e, s, 'Request to delete the project failed');
  }

  logger.success(
    'Deleted the project "$projectId".',
    newParagraph: true,
  );
}