import { IsBoolean, IsIn, IsOptional, IsString } from 'class-validator';

export class UpdateStorageSettingsDto {
  @IsBoolean()
  enabled!: boolean;

  @IsIn(['local', 'aliyun', 'tencent', 'qiniu', 's3', 'minio'])
  provider!: 'local' | 'aliyun' | 'tencent' | 'qiniu' | 's3' | 'minio';

  @IsOptional()
  @IsString()
  accessKeyId?: string;

  @IsOptional()
  @IsString()
  accessKeySecret?: string;

  @IsOptional()
  @IsString()
  bucket?: string;

  @IsOptional()
  @IsString()
  region?: string;

  @IsOptional()
  @IsString()
  endpoint?: string;

  @IsOptional()
  @IsString()
  domain?: string;

  @IsOptional()
  @IsString()
  folder?: string;

  @IsOptional()
  @IsBoolean()
  isPrivate?: boolean;
}

export interface StorageSettingsVo {
  enabled: boolean;
  provider: 'local' | 'aliyun' | 'tencent' | 'qiniu' | 's3' | 'minio';
  accessKeyId?: string;
  accessKeySecret?: string;
  bucket?: string;
  region?: string;
  endpoint?: string;
  domain?: string;
  folder?: string;
  isPrivate?: boolean;
}