-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathcreate-job.dto.ts
52 lines (47 loc) · 1.27 KB
/
create-job.dto.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { ApiProperty, ApiTags } from "@nestjs/swagger";
import { IsEmail, IsObject, IsOptional, IsString } from "class-validator";
@ApiTags("jobs")
export class CreateJobDto {
@ApiProperty({
type: String,
required: true,
description: "Valid job type as defined in configuration.",
})
@IsString()
readonly type: string;
@ApiProperty({
type: Object,
required: true,
description: "Job's parameters as defined by job template in configuration",
})
@IsObject()
readonly jobParams: Record<string, unknown>;
@ApiProperty({
type: String,
required: false,
description:
"User that this job belongs to. Applicable only if requesting user has dequate permissions level",
})
@IsString()
@IsOptional()
readonly ownerUser: string;
@ApiProperty({
type: String,
required: false,
description:
"Group that this job belongs to. Applicable only if requesting user has dequate permissions level",
})
@IsString()
@IsOptional()
readonly ownerGroup: string;
@ApiProperty({
type: String,
required: false,
default: "",
description:
"Email to contact regarding this job. If the job is submitted anonymously, an email has to be provided",
})
@IsEmail()
@IsOptional()
readonly contactEmail: string;
}