waha / src /structures /profile.dto.ts
NitinBot002's picture
Upload 384 files
4327358 verified
import { ApiExtraModels, ApiProperty, getSchemaPath } from '@nestjs/swagger';
import { BinaryFile, RemoteFile } from '@waha/structures/files.dto';
import { ChatIdProperty } from '@waha/structures/properties.dto';
import { IsNotEmpty, IsString } from 'class-validator';
export class MyProfile {
@ChatIdProperty()
id: string;
name: string;
@ApiProperty({
example: 'https://example.com/picture.jpg',
})
picture: string | null;
}
export class ProfileNameRequest {
@IsString()
@IsNotEmpty()
@ApiProperty({
example: 'My New Name',
})
name: string;
}
export class ProfileStatusRequest {
@IsString()
@IsNotEmpty()
@ApiProperty({
example: 'πŸŽ‰ Hey there! I am using WhatsApp πŸŽ‰',
})
status: string;
}
@ApiExtraModels(RemoteFile, BinaryFile)
export class ProfilePictureRequest {
@ApiProperty({
oneOf: [
{ $ref: getSchemaPath(RemoteFile) },
{ $ref: getSchemaPath(BinaryFile) },
],
})
file: BinaryFile | RemoteFile;
}