getSchedule static method
Reads the automated backup schedule of the project's database.
When no schedule is set, the project's plan type is read as well, so that the caller can tell an unset schedule apart from a plan without backups. It is null if the plan could not be determined.
Implementation
static Future<BackupScheduleView> getSchedule(
final Client cloudApiClient, {
required final String projectId,
}) async {
late final BackupSchedule? schedule;
try {
schedule = await cloudApiClient.database.getBackupSchedule(
cloudCapsuleId: projectId,
);
} on Exception catch (e, s) {
throw FailureException.nested(e, s, 'Failed to get backup schedule');
}
return (
projectId: projectId,
schedule: schedule,
planType: schedule == null
? await ProjectCommands.readPlanType(
cloudApiClient,
projectId: projectId,
)
: null,
);
}