File

src/models/dto/register-model.dto.ts

Index

Properties

Properties

authInfo
Type : any
Decorators :
@IsJSON()
@IsOptional()
@ApiPropertyOptional()
metricType
Type : MetricType
Decorators :
@IsNotEmpty()
@ApiProperty()
@IsEnum(MetricType, {each: true})
modelUrl
Type : string
Decorators :
@IsString()
@IsOptional()
@ApiPropertyOptional()
name
Type : string
Decorators :
@IsNotEmpty()
@IsString()
@ApiProperty({required: true})
projectID
Type : number
Decorators :
@IsNotEmpty()
@IsNumber()
@ApiProperty({required: true})
provider
Type : string
Decorators :
@IsNotEmpty()
@IsString()
@ApiProperty({required: true})
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import {
  IsEnum,
  IsJSON,
  IsNotEmpty,
  IsNumber,
  IsOptional,
  IsString,
} from "class-validator";
import { MetricType } from "../entities/model.entity";

export class RegisterModelDto {
  @IsNotEmpty()
  @IsNumber()
  @ApiProperty({ required: true })
  projectID: number;

  @IsNotEmpty()
  @IsString()
  @ApiProperty({ required: true })
  name: string;

  @IsString()
  @IsOptional()
  @ApiPropertyOptional()
  modelUrl: string;

  @IsJSON()
  @IsOptional()
  @ApiPropertyOptional()
  authInfo: any;

  @IsNotEmpty()
  @IsString()
  @ApiProperty({ required: true })
  provider: string;

  @IsNotEmpty()
  @ApiProperty()
  @IsEnum(MetricType, { each: true })
  metricType: MetricType;
}

export class RegisterModelRequestDto {
  @IsNotEmpty()
  @IsNumber()
  @ApiProperty({ required: true })
  projectID: number;

  @IsNotEmpty()
  @IsString()
  @ApiProperty({ required: true })
  requestTo: string;

  @IsNotEmpty()
  @IsString()
  @ApiProperty({ required: true })
  requestedBy: string;

  @IsNotEmpty()
  @IsString()
  @ApiProperty({ required: true })
  description: string;
}

results matching ""

    No results matching ""