-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRunner.php
131 lines (126 loc) · 3.49 KB
/
Runner.php
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
declare(strict_types=1);
namespace ApiClients\Client\GitHubEnterprise\Schema;
use EventSauce\ObjectHydrator\MapFrom;
final readonly class Runner
{
public const SCHEMA_JSON = '{
"title": "Self hosted runners",
"required": [
"id",
"name",
"os",
"status",
"busy",
"labels"
],
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "The ID of the runner.",
"examples": [
5
]
},
"runner_group_id": {
"type": "integer",
"description": "The ID of the runner group.",
"examples": [
1
]
},
"name": {
"type": "string",
"description": "The name of the runner.",
"examples": [
"iMac"
]
},
"os": {
"type": "string",
"description": "The Operating System of the runner.",
"examples": [
"macos"
]
},
"status": {
"type": "string",
"description": "The status of the runner.",
"examples": [
"online"
]
},
"busy": {
"type": "boolean"
},
"labels": {
"type": "array",
"items": {
"title": "Self hosted runner label",
"required": [
"name"
],
"type": "object",
"properties": {
"id": {
"type": "integer",
"description": "Unique identifier of the label."
},
"name": {
"type": "string",
"description": "Name of the label."
},
"type": {
"enum": [
"read-only",
"custom"
],
"type": "string",
"description": "The type of label. Read-only labels are applied automatically when the runner is configured."
}
},
"description": "A label for a self hosted runner"
}
},
"ephemeral": {
"type": "boolean"
}
},
"description": "A self hosted runner"
}';
public const SCHEMA_TITLE = 'Self hosted runners';
public const SCHEMA_DESCRIPTION = 'A self hosted runner';
public const SCHEMA_EXAMPLE_DATA = '{
"id": 5,
"runner_group_id": 1,
"name": "iMac",
"os": "macos",
"status": "online",
"busy": false,
"labels": [
{
"id": 2,
"name": "generated",
"type": "custom"
},
{
"id": 2,
"name": "generated",
"type": "custom"
}
],
"ephemeral": false
}';
/**
* id: The ID of the runner.
* runnerGroupId: The ID of the runner group.
* name: The name of the runner.
* os: The Operating System of the runner.
* status: The status of the runner.
*/
public function __construct(public int $id, #[MapFrom('runner_group_id')]
public int|null $runnerGroupId, public string $name, public string $os, public string $status, public bool $busy, public array $labels, public bool|null $ephemeral,)
{
}
}