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

export interface IReq_GetDnsRecords extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_GetDnsRecords
> {
  method: 'getDnsRecords';
  request: {
    identity: data.IIdentity;
  };
  response: {
    records: data.IDnsRecord[];
  };
}

export interface IReq_CreateDnsRecord extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_CreateDnsRecord
> {
  method: 'createDnsRecord';
  request: {
    identity: data.IIdentity;
    domain: string;
    type: 'A' | 'AAAA' | 'CNAME';
    value: string;
  };
  response: {
    record: data.IDnsRecord;
  };
}

export interface IReq_DeleteDnsRecord extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_DeleteDnsRecord
> {
  method: 'deleteDnsRecord';
  request: {
    identity: data.IIdentity;
    domain: string;
  };
  response: {
    ok: boolean;
  };
}

export interface IReq_SyncDns extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_SyncDns
> {
  method: 'syncDns';
  request: {
    identity: data.IIdentity;
  };
  response: {
    records: data.IDnsRecord[];
  };
}

export interface IReq_GetGatewayDnsRecords extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_GetGatewayDnsRecords
> {
  method: 'getGatewayDnsRecords';
  request: {
    identity: data.IIdentity;
  };
  response: {
    records: data.IGatewayDnsRecord[];
  };
}
