deleteProject static method
Future<void>
deleteProject(
- Client cloudApiClient, {
- required CommandLogger logger,
- 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,
);
}