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

export interface IReq_ListObjects extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_ListObjects
> {
  method: 'listObjects';
  request: {
    identity: data.IIdentity;
    bucketName: string;
    prefix?: string;
    delimiter?: string;
    maxKeys?: number;
  };
  response: {
    result: data.IObjectListResult;
  };
}

export interface IReq_DeleteObject extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_DeleteObject
> {
  method: 'deleteObject';
  request: {
    identity: data.IIdentity;
    bucketName: string;
    key: string;
  };
  response: {
    ok: boolean;
  };
}

export interface IReq_GetObject extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_GetObject
> {
  method: 'getObject';
  request: {
    identity: data.IIdentity;
    bucketName: string;
    key: string;
  };
  response: {
    content: string;
    contentType: string;
    size: number;
    lastModified: string;
  };
}

export interface IReq_PutObject extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_PutObject
> {
  method: 'putObject';
  request: {
    identity: data.IIdentity;
    bucketName: string;
    key: string;
    base64Content: string;
    contentType: string;
  };
  response: {
    ok: boolean;
  };
}

export interface IReq_DeletePrefix extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_DeletePrefix
> {
  method: 'deletePrefix';
  request: {
    identity: data.IIdentity;
    bucketName: string;
    prefix: string;
  };
  response: {
    ok: boolean;
  };
}

export interface IReq_GetObjectUrl extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_GetObjectUrl
> {
  method: 'getObjectUrl';
  request: {
    identity: data.IIdentity;
    bucketName: string;
    key: string;
  };
  response: {
    url: string;
  };
}

export interface IReq_MoveObject extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_MoveObject
> {
  method: 'moveObject';
  request: {
    identity: data.IIdentity;
    bucketName: string;
    sourceKey: string;
    destKey: string;
  };
  response: {
    success: boolean;
    error?: string;
  };
}

export interface IReq_MovePrefix extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_MovePrefix
> {
  method: 'movePrefix';
  request: {
    identity: data.IIdentity;
    bucketName: string;
    sourcePrefix: string;
    destPrefix: string;
  };
  response: {
    success: boolean;
    movedCount?: number;
    error?: string;
  };
}
