| 1 | import { ApiProperty } from '@nestjs/swagger'; |
| 2 | import { Type } |
| 3 | import { IsInt, IsOptional |
| 4 | |
| 5 | export class StorageLimitUsageDTO |
| 6 | @ApiProperty({ description |
| 7 | @IsInt() |
| 8 | usedBytes: number; |
| 9 | |
| 10 | @ApiProperty({ |
| 11 | type: Number, |
| 12 | nullable: true, |
| 13 | description: '`null` when no quota applies.', |
| 14 | }) |
| 15 | @IsInt() |
| 16 | @IsOptional() |
| 17 | quotaBytes: number |
| 18 | } |
| 19 | |
| 20 | export class StorageUsageDTO |
| 21 | @ApiProperty({ |
| 22 | description: |
| 23 | "Bytes of pushed git data and merged pull requests' heads in repositories that are not forks, leaving out Git LFS objects, release assets and attachments.", |
| 24 | }) |
| 25 | @IsInt() |
| 26 | usedBytes: number; |
| 27 | |
| 28 | @ApiProperty({ |
| 29 | type: Number, |
| 30 | nullable: true, |
| 31 | description: '`null` when no quota applies.', |
| 32 | }) |
| 33 | @IsInt() |
| 34 | @IsOptional() |
| 35 | quotaBytes: number |
| 36 | |
| 37 | @ApiProperty({ description |
| 38 | @IsInt() |
| 39 | maxAssetBytes: number; |
| 40 | |
| 41 | @ApiProperty({ |
| 42 | type: StorageLimitUsageDTO, |
| 43 | description: |
| 44 | 'Everything forks hold, Git LFS objects and release assets included.', |
| 45 | }) |
| 46 | @ValidateNested() |
| 47 | @Type(() => |
| 48 | fork: StorageLimitUsageDTO |
| 49 | |
| 50 | @ApiProperty({ |
| 51 | type: StorageLimitUsageDTO, |
| 52 | description: 'Git LFS objects in repositories that are not forks.', |
| 53 | }) |
| 54 | @ValidateNested() |
| 55 | @Type(() => |
| 56 | lfs: StorageLimitUsageDTO |
| 57 | |
| 58 | @ApiProperty({ |
| 59 | type: StorageLimitUsageDTO, |
| 60 | description: |
| 61 | 'Release assets in repositories that are not forks, and for a user, files they attached to issues, pull requests and comments anywhere. Includes uploads in progress.', |
| 62 | }) |
| 63 | @ValidateNested() |
| 64 | @Type(() => |
| 65 | asset: StorageLimitUsageDTO |
| 66 | } |