File

src/user/dtos/create-user-highlight.dto.ts

Index

Properties

Properties

Public highlight
Type : string
Decorators :
@ApiProperty({description: 'Highlight Text', type: String, example: My first PR to Open Sauced!})
@IsString()
@MinLength(3)
@MaxLength(500)
Public Optional shipped_at
Type : string
Decorators :
@ApiPropertyOptional({description: 'Shipped Date', type: String, example: 2023-01-19 13:24:51.000000})
@IsDateString()
@IsOptional()
Public taggedRepos
Type : string[]
Decorators :
@ApiProperty({description: 'An array of full-names of tagged repositories', example: undefined, type: 'string', isArray: true})
@IsArray()
@IsString({each: true})
Public Optional title
Type : string
Decorators :
@ApiPropertyOptional({description: 'Highlight Title', type: String, example: My first PR!})
@IsOptional()
@IsString()
Public type
Type : string
Default value : "pull_request"
Decorators :
@ApiProperty({description: 'Highlight type', type: String, example: 'pull_request'})
@IsString()
@IsIn(['pull_request', 'blog_post', 'issue', 'milestone', 'release'])
Public url
Type : string
Decorators :
@ApiProperty({description: 'Highlight PR URL', type: String, example: 'github.com/open-sauced/insights/pull/1'})
@IsString()
import { ApiProperty, ApiPropertyOptional } from "@nestjs/swagger";
import { IsArray, IsDateString, IsIn, IsOptional, IsString, MaxLength, MinLength } from "class-validator";

export class CreateUserHighlightDto {
  @ApiProperty({
    description: "Highlight PR URL",
    type: String,
    example: "github.com/open-sauced/insights/pull/1",
  })
  @IsString()
  public url: string;

  @ApiPropertyOptional({
    description: "Highlight Title",
    type: String,
    example: `My first PR!`,
  })
  @IsOptional()
  @IsString()
  public title?: string;

  @ApiProperty({
    description: "Highlight Text",
    type: String,
    example: `My first PR to Open Sauced!`,
  })
  @IsString()
  @MinLength(3)
  @MaxLength(500)
  public highlight: string;

  @ApiPropertyOptional({
    description: "Shipped Date",
    type: String,
    example: `2023-01-19 13:24:51.000000`,
  })
  @IsDateString()
  @IsOptional()
  public shipped_at?: string;

  @ApiProperty({
    description: "Highlight type",
    type: String,
    example: "pull_request",
  })
  @IsString()
  @IsIn(["pull_request", "blog_post", "issue", "milestone", "release"])
  public type = "pull_request";

  @ApiProperty({
    description: "An array of full-names of tagged repositories",
    example: ["open-sauced/insights", "open-sauced/ai"],
    type: "string",
    isArray: true,
  })
  @IsArray()
  @IsString({ each: true })
  public taggedRepos: string[];
}

results matching ""

    No results matching ""