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

export interface IReq_GetBackups extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_GetBackups
> {
  method: 'getBackups';
  request: {
    identity: data.IIdentity;
  };
  response: {
    backups: data.IBackup[];
  };
}

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

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

export interface IReq_RestoreBackup extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_RestoreBackup
> {
  method: 'restoreBackup';
  request: {
    identity: data.IIdentity;
    backupId: number;
    options: data.IRestoreOptions;
  };
  response: {
    result: data.IRestoreResult;
  };
}

export interface IReq_DownloadBackup extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_DownloadBackup
> {
  method: 'downloadBackup';
  request: {
    identity: data.IIdentity;
    backupId: number;
  };
  response: {
    downloadUrl: string;
    filename: string;
  };
}
