| 1 | import { ApiProperty } from '@nestjs/swagger'; |
| 2 | import { IsArray, IsNumber |
| 3 | import { Type } |
| 4 | |
| 5 | export class RepositoryLanguageDTO |
| 6 | @ApiProperty({ example |
| 7 | @IsString() |
| 8 | language: string; |
| 9 | |
| 10 | @ApiProperty({ |
| 11 | description: 'Total size of the files in this language.', |
| 12 | example: 128_400, |
| 13 | }) |
| 14 | @IsNumber() |
| 15 | bytes: number; |
| 16 | |
| 17 | @ApiProperty({ |
| 18 | description: 'Share of the counted bytes, 0-100.', |
| 19 | example: 72.4, |
| 20 | }) |
| 21 | @IsNumber() |
| 22 | percent: number; |
| 23 | } |
| 24 | |
| 25 | export class GetRepositoryLanguagesResponseDTO |
| 26 | @ApiProperty({ |
| 27 | type: [RepositoryLanguageDTO], |
| 28 | description: 'Languages on the default branch, largest first.', |
| 29 | }) |
| 30 | @IsArray() |
| 31 | @ValidateNested({ each |
| 32 | @Type(() => |
| 33 | languages: RepositoryLanguageDTO |
| 34 | } |