import * as plugins from '../plugins.js';
import * as data from '../data/index.js';

export interface IReq_GetBackupSchedules extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_GetBackupSchedules
> {
  method: 'getBackupSchedules';
  request: {
    identity: data.IIdentity;
  };
  response: {
    schedules: data.IBackupSchedule[];
  };
}

export interface IReq_CreateBackupSchedule extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_CreateBackupSchedule
> {
  method: 'createBackupSchedule';
  request: {
    identity: data.IIdentity;
    scheduleConfig: data.IBackupScheduleCreate;
  };
  response: {
    schedule: data.IBackupSchedule;
  };
}

export interface IReq_GetBackupSchedule extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_GetBackupSchedule
> {
  method: 'getBackupSchedule';
  request: {
    identity: data.IIdentity;
    scheduleId: number;
  };
  response: {
    schedule: data.IBackupSchedule;
  };
}

export interface IReq_UpdateBackupSchedule extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_UpdateBackupSchedule
> {
  method: 'updateBackupSchedule';
  request: {
    identity: data.IIdentity;
    scheduleId: number;
    updates: data.IBackupScheduleUpdate;
  };
  response: {
    schedule: data.IBackupSchedule;
  };
}

export interface IReq_DeleteBackupSchedule extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_DeleteBackupSchedule
> {
  method: 'deleteBackupSchedule';
  request: {
    identity: data.IIdentity;
    scheduleId: number;
  };
  response: {
    ok: boolean;
  };
}

export interface IReq_TriggerBackupSchedule extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_TriggerBackupSchedule
> {
  method: 'triggerBackupSchedule';
  request: {
    identity: data.IIdentity;
    scheduleId: number;
  };
  response: {
    backup: data.IBackup;
  };
}
