-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunnerconfigurationschema.go
495 lines (419 loc) · 17.5 KB
/
runnerconfigurationschema.go
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
package gitpod
import (
"context"
"net/http"
"github.com/gitpod-io/gitpod-sdk-go/internal/apijson"
"github.com/gitpod-io/gitpod-sdk-go/internal/param"
"github.com/gitpod-io/gitpod-sdk-go/internal/requestconfig"
"github.com/gitpod-io/gitpod-sdk-go/option"
)
// RunnerConfigurationSchemaService contains methods and other services that help
// with interacting with the gitpod API.
//
// Note, unlike clients, this service does not read variables from the environment
// automatically. You should not instantiate this service directly, and instead use
// the [NewRunnerConfigurationSchemaService] method instead.
type RunnerConfigurationSchemaService struct {
Options []option.RequestOption
}
// NewRunnerConfigurationSchemaService generates a new service that applies the
// given options to each request. These options are applied after the parent
// client's options (if there is one), and before any request-specific options.
func NewRunnerConfigurationSchemaService(opts ...option.RequestOption) (r *RunnerConfigurationSchemaService) {
r = &RunnerConfigurationSchemaService{}
r.Options = opts
return
}
// Gets the latest runner configuration schema.
//
// Use this method to:
//
// - View available settings
// - Check configuration options
// - Validate configurations
//
// ### Examples
//
// - Get schema:
//
// Retrieves configuration schema for a runner.
//
// ```yaml
// runnerId: "d2c94c27-3b76-4a42-b88c-95a85e392c68"
// ```
func (r *RunnerConfigurationSchemaService) Get(ctx context.Context, body RunnerConfigurationSchemaGetParams, opts ...option.RequestOption) (res *RunnerConfigurationSchemaGetResponse, err error) {
opts = append(r.Options[:], opts...)
path := "gitpod.v1.RunnerConfigurationService/GetRunnerConfigurationSchema"
err = requestconfig.ExecuteNewRequest(ctx, http.MethodPost, path, body, &res, opts...)
return
}
type RunnerConfigurationSchema struct {
EnvironmentClasses []RunnerConfigurationSchemaEnvironmentClass `json:"environmentClasses"`
RunnerConfig []RunnerConfigurationSchemaRunnerConfig `json:"runnerConfig"`
Scm []RunnerConfigurationSchemaScm `json:"scm"`
// The schema version
Version string `json:"version"`
JSON runnerConfigurationSchemaJSON `json:"-"`
}
// runnerConfigurationSchemaJSON contains the JSON metadata for the struct
// [RunnerConfigurationSchema]
type runnerConfigurationSchemaJSON struct {
EnvironmentClasses apijson.Field
RunnerConfig apijson.Field
Scm apijson.Field
Version apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchema) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaEnvironmentClass struct {
ID string `json:"id"`
Bool RunnerConfigurationSchemaEnvironmentClassesBool `json:"bool"`
Description string `json:"description"`
Display RunnerConfigurationSchemaEnvironmentClassesDisplay `json:"display"`
Enum RunnerConfigurationSchemaEnvironmentClassesEnum `json:"enum"`
Int RunnerConfigurationSchemaEnvironmentClassesInt `json:"int"`
Name string `json:"name"`
Required bool `json:"required"`
Secret bool `json:"secret"`
String RunnerConfigurationSchemaEnvironmentClassesString `json:"string"`
JSON runnerConfigurationSchemaEnvironmentClassJSON `json:"-"`
}
// runnerConfigurationSchemaEnvironmentClassJSON contains the JSON metadata for the
// struct [RunnerConfigurationSchemaEnvironmentClass]
type runnerConfigurationSchemaEnvironmentClassJSON struct {
ID apijson.Field
Bool apijson.Field
Description apijson.Field
Display apijson.Field
Enum apijson.Field
Int apijson.Field
Name apijson.Field
Required apijson.Field
Secret apijson.Field
String apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaEnvironmentClass) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaEnvironmentClassJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaEnvironmentClassesBool struct {
Default bool `json:"default"`
JSON runnerConfigurationSchemaEnvironmentClassesBoolJSON `json:"-"`
}
// runnerConfigurationSchemaEnvironmentClassesBoolJSON contains the JSON metadata
// for the struct [RunnerConfigurationSchemaEnvironmentClassesBool]
type runnerConfigurationSchemaEnvironmentClassesBoolJSON struct {
Default apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaEnvironmentClassesBool) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaEnvironmentClassesBoolJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaEnvironmentClassesDisplay struct {
Default string `json:"default"`
JSON runnerConfigurationSchemaEnvironmentClassesDisplayJSON `json:"-"`
}
// runnerConfigurationSchemaEnvironmentClassesDisplayJSON contains the JSON
// metadata for the struct [RunnerConfigurationSchemaEnvironmentClassesDisplay]
type runnerConfigurationSchemaEnvironmentClassesDisplayJSON struct {
Default apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaEnvironmentClassesDisplay) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaEnvironmentClassesDisplayJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaEnvironmentClassesEnum struct {
Default string `json:"default"`
Values []string `json:"values"`
JSON runnerConfigurationSchemaEnvironmentClassesEnumJSON `json:"-"`
}
// runnerConfigurationSchemaEnvironmentClassesEnumJSON contains the JSON metadata
// for the struct [RunnerConfigurationSchemaEnvironmentClassesEnum]
type runnerConfigurationSchemaEnvironmentClassesEnumJSON struct {
Default apijson.Field
Values apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaEnvironmentClassesEnum) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaEnvironmentClassesEnumJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaEnvironmentClassesInt struct {
Default int64 `json:"default"`
Max int64 `json:"max"`
Min int64 `json:"min"`
JSON runnerConfigurationSchemaEnvironmentClassesIntJSON `json:"-"`
}
// runnerConfigurationSchemaEnvironmentClassesIntJSON contains the JSON metadata
// for the struct [RunnerConfigurationSchemaEnvironmentClassesInt]
type runnerConfigurationSchemaEnvironmentClassesIntJSON struct {
Default apijson.Field
Max apijson.Field
Min apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaEnvironmentClassesInt) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaEnvironmentClassesIntJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaEnvironmentClassesString struct {
Default string `json:"default"`
Pattern string `json:"pattern"`
JSON runnerConfigurationSchemaEnvironmentClassesStringJSON `json:"-"`
}
// runnerConfigurationSchemaEnvironmentClassesStringJSON contains the JSON metadata
// for the struct [RunnerConfigurationSchemaEnvironmentClassesString]
type runnerConfigurationSchemaEnvironmentClassesStringJSON struct {
Default apijson.Field
Pattern apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaEnvironmentClassesString) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaEnvironmentClassesStringJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaRunnerConfig struct {
ID string `json:"id"`
Bool RunnerConfigurationSchemaRunnerConfigBool `json:"bool"`
Description string `json:"description"`
Display RunnerConfigurationSchemaRunnerConfigDisplay `json:"display"`
Enum RunnerConfigurationSchemaRunnerConfigEnum `json:"enum"`
Int RunnerConfigurationSchemaRunnerConfigInt `json:"int"`
Name string `json:"name"`
Required bool `json:"required"`
Secret bool `json:"secret"`
String RunnerConfigurationSchemaRunnerConfigString `json:"string"`
JSON runnerConfigurationSchemaRunnerConfigJSON `json:"-"`
}
// runnerConfigurationSchemaRunnerConfigJSON contains the JSON metadata for the
// struct [RunnerConfigurationSchemaRunnerConfig]
type runnerConfigurationSchemaRunnerConfigJSON struct {
ID apijson.Field
Bool apijson.Field
Description apijson.Field
Display apijson.Field
Enum apijson.Field
Int apijson.Field
Name apijson.Field
Required apijson.Field
Secret apijson.Field
String apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaRunnerConfig) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaRunnerConfigJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaRunnerConfigBool struct {
Default bool `json:"default"`
JSON runnerConfigurationSchemaRunnerConfigBoolJSON `json:"-"`
}
// runnerConfigurationSchemaRunnerConfigBoolJSON contains the JSON metadata for the
// struct [RunnerConfigurationSchemaRunnerConfigBool]
type runnerConfigurationSchemaRunnerConfigBoolJSON struct {
Default apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaRunnerConfigBool) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaRunnerConfigBoolJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaRunnerConfigDisplay struct {
Default string `json:"default"`
JSON runnerConfigurationSchemaRunnerConfigDisplayJSON `json:"-"`
}
// runnerConfigurationSchemaRunnerConfigDisplayJSON contains the JSON metadata for
// the struct [RunnerConfigurationSchemaRunnerConfigDisplay]
type runnerConfigurationSchemaRunnerConfigDisplayJSON struct {
Default apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaRunnerConfigDisplay) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaRunnerConfigDisplayJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaRunnerConfigEnum struct {
Default string `json:"default"`
Values []string `json:"values"`
JSON runnerConfigurationSchemaRunnerConfigEnumJSON `json:"-"`
}
// runnerConfigurationSchemaRunnerConfigEnumJSON contains the JSON metadata for the
// struct [RunnerConfigurationSchemaRunnerConfigEnum]
type runnerConfigurationSchemaRunnerConfigEnumJSON struct {
Default apijson.Field
Values apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaRunnerConfigEnum) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaRunnerConfigEnumJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaRunnerConfigInt struct {
Default int64 `json:"default"`
Max int64 `json:"max"`
Min int64 `json:"min"`
JSON runnerConfigurationSchemaRunnerConfigIntJSON `json:"-"`
}
// runnerConfigurationSchemaRunnerConfigIntJSON contains the JSON metadata for the
// struct [RunnerConfigurationSchemaRunnerConfigInt]
type runnerConfigurationSchemaRunnerConfigIntJSON struct {
Default apijson.Field
Max apijson.Field
Min apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaRunnerConfigInt) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaRunnerConfigIntJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaRunnerConfigString struct {
Default string `json:"default"`
Pattern string `json:"pattern"`
JSON runnerConfigurationSchemaRunnerConfigStringJSON `json:"-"`
}
// runnerConfigurationSchemaRunnerConfigStringJSON contains the JSON metadata for
// the struct [RunnerConfigurationSchemaRunnerConfigString]
type runnerConfigurationSchemaRunnerConfigStringJSON struct {
Default apijson.Field
Pattern apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaRunnerConfigString) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaRunnerConfigStringJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaScm struct {
DefaultHosts []string `json:"defaultHosts"`
Name string `json:"name"`
OAuth RunnerConfigurationSchemaScmOAuth `json:"oauth"`
Pat RunnerConfigurationSchemaScmPat `json:"pat"`
ScmID string `json:"scmId"`
JSON runnerConfigurationSchemaScmJSON `json:"-"`
}
// runnerConfigurationSchemaScmJSON contains the JSON metadata for the struct
// [RunnerConfigurationSchemaScm]
type runnerConfigurationSchemaScmJSON struct {
DefaultHosts apijson.Field
Name apijson.Field
OAuth apijson.Field
Pat apijson.Field
ScmID apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaScm) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaScmJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaScmOAuth struct {
// callback_url is the URL the OAuth app will redirect to after the user has
// authenticated.
CallbackURL string `json:"callbackUrl"`
JSON runnerConfigurationSchemaScmOAuthJSON `json:"-"`
}
// runnerConfigurationSchemaScmOAuthJSON contains the JSON metadata for the struct
// [RunnerConfigurationSchemaScmOAuth]
type runnerConfigurationSchemaScmOAuthJSON struct {
CallbackURL apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaScmOAuth) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaScmOAuthJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaScmPat struct {
// description is a human-readable description of the PAT.
Description string `json:"description"`
// docs_link is a link to the documentation on how to create a PAT for this SCM
// system.
DocsLink string `json:"docsLink"`
JSON runnerConfigurationSchemaScmPatJSON `json:"-"`
}
// runnerConfigurationSchemaScmPatJSON contains the JSON metadata for the struct
// [RunnerConfigurationSchemaScmPat]
type runnerConfigurationSchemaScmPatJSON struct {
Description apijson.Field
DocsLink apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaScmPat) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaScmPatJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaGetResponse struct {
Schema RunnerConfigurationSchema `json:"schema"`
JSON runnerConfigurationSchemaGetResponseJSON `json:"-"`
}
// runnerConfigurationSchemaGetResponseJSON contains the JSON metadata for the
// struct [RunnerConfigurationSchemaGetResponse]
type runnerConfigurationSchemaGetResponseJSON struct {
Schema apijson.Field
raw string
ExtraFields map[string]apijson.Field
}
func (r *RunnerConfigurationSchemaGetResponse) UnmarshalJSON(data []byte) (err error) {
return apijson.UnmarshalRoot(data, r)
}
func (r runnerConfigurationSchemaGetResponseJSON) RawJSON() string {
return r.raw
}
type RunnerConfigurationSchemaGetParams struct {
RunnerID param.Field[string] `json:"runnerId" format:"uuid"`
}
func (r RunnerConfigurationSchemaGetParams) MarshalJSON() (data []byte, err error) {
return apijson.MarshalRoot(r)
}