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

export interface IReq_GetPlatformServices extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_GetPlatformServices
> {
  method: 'getPlatformServices';
  request: {
    identity: data.IIdentity;
  };
  response: {
    platformServices: data.IPlatformService[];
  };
}

export interface IReq_GetPlatformService extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_GetPlatformService
> {
  method: 'getPlatformService';
  request: {
    identity: data.IIdentity;
    serviceType: data.TPlatformServiceType;
  };
  response: {
    platformService: data.IPlatformService;
  };
}

export interface IReq_StartPlatformService extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_StartPlatformService
> {
  method: 'startPlatformService';
  request: {
    identity: data.IIdentity;
    serviceType: data.TPlatformServiceType;
  };
  response: {
    platformService: data.IPlatformService;
  };
}

export interface IReq_StopPlatformService extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_StopPlatformService
> {
  method: 'stopPlatformService';
  request: {
    identity: data.IIdentity;
    serviceType: data.TPlatformServiceType;
  };
  response: {
    platformService: data.IPlatformService;
  };
}

export interface IReq_GetPlatformServiceStats extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_GetPlatformServiceStats
> {
  method: 'getPlatformServiceStats';
  request: {
    identity: data.IIdentity;
    serviceType: data.TPlatformServiceType;
  };
  response: {
    stats: data.IContainerStats;
  };
}

export interface IReq_GetPlatformServiceLogs extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_GetPlatformServiceLogs
> {
  method: 'getPlatformServiceLogs';
  request: {
    identity: data.IIdentity;
    serviceType: data.TPlatformServiceType;
    tail?: number;
  };
  response: {
    logs: data.ILogEntry[];
  };
}

export interface IReq_PushPlatformServiceLog extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_PushPlatformServiceLog
> {
  method: 'pushPlatformServiceLog';
  request: {
    serviceType: data.TPlatformServiceType;
    entry: {
      timestamp: string;
      level: string;
      message: string;
    };
  };
  response: {};
}
