48 lines
1.0 KiB
TypeScript
48 lines
1.0 KiB
TypeScript
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
|
|
import { IsBoolean, IsNumber, IsOptional, IsString } from "class-validator";
|
|
|
|
export class CreateMailboxDto {
|
|
@ApiProperty({
|
|
description: "Mailbox path with slashes as folder separators",
|
|
example: "Important/Work",
|
|
})
|
|
@IsString()
|
|
path: string;
|
|
|
|
@ApiPropertyOptional({
|
|
description: "Retention time in milliseconds for messages in this mailbox",
|
|
example: 2592000000,
|
|
})
|
|
@IsOptional()
|
|
@IsNumber()
|
|
retention?: number;
|
|
}
|
|
|
|
export class UpdateMailboxDto {
|
|
@ApiPropertyOptional({
|
|
description: "New mailbox path if renaming",
|
|
example: "Renamed Folder",
|
|
})
|
|
@IsOptional()
|
|
@IsString()
|
|
path?: string;
|
|
|
|
@ApiPropertyOptional({
|
|
description: "New retention time in milliseconds",
|
|
example: 5184000000,
|
|
})
|
|
@IsOptional()
|
|
@IsNumber()
|
|
retention?: number;
|
|
}
|
|
|
|
export class MailboxQueryDto {
|
|
@ApiPropertyOptional({
|
|
description: "Include message counters in results",
|
|
default: false,
|
|
})
|
|
@IsOptional()
|
|
@IsBoolean()
|
|
counters?: boolean;
|
|
}
|