File

src/upload-center/dtos/request/confirm-upload.dto.ts

Description

ConfirmUploadRequestDto Validates the input data for confirming a file upload.

Index

Properties

Properties

bucket
Type : BufferBucketNames | StreamBucketNames
Decorators :
@ApiProperty({description: 'The bucket name where the file is stored', enum: undefined, example: undefined, required: true})
@IsNotEmpty()
@IsEnum({, })

Data Transfer Object for confirming file upload. Validates the input data for confirming a file upload.

key
Type : string
Decorators :
@ApiProperty({description: 'The key of the file in the storage system', example: 'file-key-12345', required: true})
@IsNotEmpty()
@IsString()

The key of the file in the storage system. Must be a non-empty string.

import { ApiProperty } from '@nestjs/swagger';
import { IsEnum, IsNotEmpty, IsString } from 'class-validator';
import {
  BufferBucketNames,
  StreamBucketNames,
} from 'src/upload-center/enums/bucket-names.enum';

/**
 * ConfirmUploadRequestDto
 * @description Data Transfer Object for confirming file upload.
 * Validates the input data for confirming a file upload.
 */
export class ConfirmUploadRequestDto {
  /**
   * Data Transfer Object for confirming file upload.
   * Validates the input data for confirming a file upload.
   */
  @ApiProperty({
    description: 'The bucket name where the file is stored',
    enum: { ...BufferBucketNames, ...StreamBucketNames },
    example: BufferBucketNames.AVATAR,
    required: true,
  })
  @IsNotEmpty()
  @IsEnum({ ...BufferBucketNames, ...StreamBucketNames })
  bucket: BufferBucketNames | StreamBucketNames;

  /**
   * The key of the file in the storage system.
   * Must be a non-empty string.
   */
  @ApiProperty({
    description: 'The key of the file in the storage system',
    example: 'file-key-12345',
    required: true,
  })
  @IsNotEmpty()
  @IsString()
  key: string;
}

results matching ""

    No results matching ""