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

export interface IReq_ListBuckets extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_ListBuckets
> {
  method: 'listBuckets';
  request: {
    identity: data.IIdentity;
  };
  response: {
    buckets: data.IBucketInfo[];
  };
}

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

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

export interface IReq_GetBucketPolicy extends plugins.typedrequestInterfaces.implementsTR<
  plugins.typedrequestInterfaces.ITypedRequest,
  IReq_GetBucketPolicy
> {
  method: 'getBucketPolicy';
  request: {
    identity: data.IIdentity;
    bucketName: string;
  };
  response: {
    policy: string | null;
  };
}

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

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