/
model_build.go
619 lines (520 loc) · 14.2 KB
/
model_build.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
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
/*
BuildBeaver Dynamic Build API - OpenAPI 3.0
This is the BuildBeaver Dynamic Build API.
API version: 0.3.00
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package client
import (
"encoding/json"
"time"
)
// checks if the Build type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Build{}
// Build struct for Build
type Build struct {
// A link to the Build resource on the BuildBeaver server
Url string `json:"url"`
Id string `json:"id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
DeletedAt *time.Time `json:"deleted_at,omitempty"`
Etag string `json:"etag"`
// Name of the build, in URL format. Build names are typically numbers converted to strings.
Name string `json:"name"`
// RepoID of the repo being built.
RepoId string `json:"repo_id"`
// CommitID that is being built.
CommitId string `json:"commit_id"`
// LogDescriptorID for the log for this build.
LogDescriptorId string `json:"log_descriptor_id"`
// Ref is the git ref the build is for (e.g. branch or tag).
Ref string `json:"ref"`
// Status reflects where the build is in the queue.
Status string `json:"status"`
Timings WorkflowTimings `json:"timings"`
// Error is set if the build finished with an error (or nil if the build succeeded).
Error *string `json:"error,omitempty"`
Opts BuildOptions `json:"opts"`
// URL of the log for this build.
LogDescriptorUrl string `json:"log_descriptor_url"`
// URL to use for searching for artifacts from this build.
ArtifactSearchUrl string `json:"artifact_search_url"`
AdditionalProperties map[string]interface{}
}
type _Build Build
// NewBuild instantiates a new Build object
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed
func NewBuild(url string, id string, createdAt time.Time, updatedAt time.Time, etag string, name string, repoId string, commitId string, logDescriptorId string, ref string, status string, timings WorkflowTimings, opts BuildOptions, logDescriptorUrl string, artifactSearchUrl string) *Build {
this := Build{}
this.Url = url
this.Id = id
this.CreatedAt = createdAt
this.UpdatedAt = updatedAt
this.Etag = etag
this.Name = name
this.RepoId = repoId
this.CommitId = commitId
this.LogDescriptorId = logDescriptorId
this.Ref = ref
this.Status = status
this.Timings = timings
this.Opts = opts
this.LogDescriptorUrl = logDescriptorUrl
this.ArtifactSearchUrl = artifactSearchUrl
return &this
}
// NewBuildWithDefaults instantiates a new Build object
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set
func NewBuildWithDefaults() *Build {
this := Build{}
return &this
}
// GetUrl returns the Url field value
func (o *Build) GetUrl() string {
if o == nil {
var ret string
return ret
}
return o.Url
}
// GetUrlOk returns a tuple with the Url field value
// and a boolean to check if the value has been set.
func (o *Build) GetUrlOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Url, true
}
// SetUrl sets field value
func (o *Build) SetUrl(v string) {
o.Url = v
}
// GetId returns the Id field value
func (o *Build) GetId() string {
if o == nil {
var ret string
return ret
}
return o.Id
}
// GetIdOk returns a tuple with the Id field value
// and a boolean to check if the value has been set.
func (o *Build) GetIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Id, true
}
// SetId sets field value
func (o *Build) SetId(v string) {
o.Id = v
}
// GetCreatedAt returns the CreatedAt field value
func (o *Build) GetCreatedAt() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.CreatedAt
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value
// and a boolean to check if the value has been set.
func (o *Build) GetCreatedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.CreatedAt, true
}
// SetCreatedAt sets field value
func (o *Build) SetCreatedAt(v time.Time) {
o.CreatedAt = v
}
// GetUpdatedAt returns the UpdatedAt field value
func (o *Build) GetUpdatedAt() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.UpdatedAt
}
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value
// and a boolean to check if the value has been set.
func (o *Build) GetUpdatedAtOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.UpdatedAt, true
}
// SetUpdatedAt sets field value
func (o *Build) SetUpdatedAt(v time.Time) {
o.UpdatedAt = v
}
// GetDeletedAt returns the DeletedAt field value if set, zero value otherwise.
func (o *Build) GetDeletedAt() time.Time {
if o == nil || IsNil(o.DeletedAt) {
var ret time.Time
return ret
}
return *o.DeletedAt
}
// GetDeletedAtOk returns a tuple with the DeletedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Build) GetDeletedAtOk() (*time.Time, bool) {
if o == nil || IsNil(o.DeletedAt) {
return nil, false
}
return o.DeletedAt, true
}
// HasDeletedAt returns a boolean if a field has been set.
func (o *Build) HasDeletedAt() bool {
if o != nil && !IsNil(o.DeletedAt) {
return true
}
return false
}
// SetDeletedAt gets a reference to the given time.Time and assigns it to the DeletedAt field.
func (o *Build) SetDeletedAt(v time.Time) {
o.DeletedAt = &v
}
// GetEtag returns the Etag field value
func (o *Build) GetEtag() string {
if o == nil {
var ret string
return ret
}
return o.Etag
}
// GetEtagOk returns a tuple with the Etag field value
// and a boolean to check if the value has been set.
func (o *Build) GetEtagOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Etag, true
}
// SetEtag sets field value
func (o *Build) SetEtag(v string) {
o.Etag = v
}
// GetName returns the Name field value
func (o *Build) GetName() string {
if o == nil {
var ret string
return ret
}
return o.Name
}
// GetNameOk returns a tuple with the Name field value
// and a boolean to check if the value has been set.
func (o *Build) GetNameOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Name, true
}
// SetName sets field value
func (o *Build) SetName(v string) {
o.Name = v
}
// GetRepoId returns the RepoId field value
func (o *Build) GetRepoId() string {
if o == nil {
var ret string
return ret
}
return o.RepoId
}
// GetRepoIdOk returns a tuple with the RepoId field value
// and a boolean to check if the value has been set.
func (o *Build) GetRepoIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.RepoId, true
}
// SetRepoId sets field value
func (o *Build) SetRepoId(v string) {
o.RepoId = v
}
// GetCommitId returns the CommitId field value
func (o *Build) GetCommitId() string {
if o == nil {
var ret string
return ret
}
return o.CommitId
}
// GetCommitIdOk returns a tuple with the CommitId field value
// and a boolean to check if the value has been set.
func (o *Build) GetCommitIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.CommitId, true
}
// SetCommitId sets field value
func (o *Build) SetCommitId(v string) {
o.CommitId = v
}
// GetLogDescriptorId returns the LogDescriptorId field value
func (o *Build) GetLogDescriptorId() string {
if o == nil {
var ret string
return ret
}
return o.LogDescriptorId
}
// GetLogDescriptorIdOk returns a tuple with the LogDescriptorId field value
// and a boolean to check if the value has been set.
func (o *Build) GetLogDescriptorIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.LogDescriptorId, true
}
// SetLogDescriptorId sets field value
func (o *Build) SetLogDescriptorId(v string) {
o.LogDescriptorId = v
}
// GetRef returns the Ref field value
func (o *Build) GetRef() string {
if o == nil {
var ret string
return ret
}
return o.Ref
}
// GetRefOk returns a tuple with the Ref field value
// and a boolean to check if the value has been set.
func (o *Build) GetRefOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Ref, true
}
// SetRef sets field value
func (o *Build) SetRef(v string) {
o.Ref = v
}
// GetStatus returns the Status field value
func (o *Build) GetStatus() string {
if o == nil {
var ret string
return ret
}
return o.Status
}
// GetStatusOk returns a tuple with the Status field value
// and a boolean to check if the value has been set.
func (o *Build) GetStatusOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Status, true
}
// SetStatus sets field value
func (o *Build) SetStatus(v string) {
o.Status = v
}
// GetTimings returns the Timings field value
func (o *Build) GetTimings() WorkflowTimings {
if o == nil {
var ret WorkflowTimings
return ret
}
return o.Timings
}
// GetTimingsOk returns a tuple with the Timings field value
// and a boolean to check if the value has been set.
func (o *Build) GetTimingsOk() (*WorkflowTimings, bool) {
if o == nil {
return nil, false
}
return &o.Timings, true
}
// SetTimings sets field value
func (o *Build) SetTimings(v WorkflowTimings) {
o.Timings = v
}
// GetError returns the Error field value if set, zero value otherwise.
func (o *Build) GetError() string {
if o == nil || IsNil(o.Error) {
var ret string
return ret
}
return *o.Error
}
// GetErrorOk returns a tuple with the Error field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Build) GetErrorOk() (*string, bool) {
if o == nil || IsNil(o.Error) {
return nil, false
}
return o.Error, true
}
// HasError returns a boolean if a field has been set.
func (o *Build) HasError() bool {
if o != nil && !IsNil(o.Error) {
return true
}
return false
}
// SetError gets a reference to the given string and assigns it to the Error field.
func (o *Build) SetError(v string) {
o.Error = &v
}
// GetOpts returns the Opts field value
func (o *Build) GetOpts() BuildOptions {
if o == nil {
var ret BuildOptions
return ret
}
return o.Opts
}
// GetOptsOk returns a tuple with the Opts field value
// and a boolean to check if the value has been set.
func (o *Build) GetOptsOk() (*BuildOptions, bool) {
if o == nil {
return nil, false
}
return &o.Opts, true
}
// SetOpts sets field value
func (o *Build) SetOpts(v BuildOptions) {
o.Opts = v
}
// GetLogDescriptorUrl returns the LogDescriptorUrl field value
func (o *Build) GetLogDescriptorUrl() string {
if o == nil {
var ret string
return ret
}
return o.LogDescriptorUrl
}
// GetLogDescriptorUrlOk returns a tuple with the LogDescriptorUrl field value
// and a boolean to check if the value has been set.
func (o *Build) GetLogDescriptorUrlOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.LogDescriptorUrl, true
}
// SetLogDescriptorUrl sets field value
func (o *Build) SetLogDescriptorUrl(v string) {
o.LogDescriptorUrl = v
}
// GetArtifactSearchUrl returns the ArtifactSearchUrl field value
func (o *Build) GetArtifactSearchUrl() string {
if o == nil {
var ret string
return ret
}
return o.ArtifactSearchUrl
}
// GetArtifactSearchUrlOk returns a tuple with the ArtifactSearchUrl field value
// and a boolean to check if the value has been set.
func (o *Build) GetArtifactSearchUrlOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ArtifactSearchUrl, true
}
// SetArtifactSearchUrl sets field value
func (o *Build) SetArtifactSearchUrl(v string) {
o.ArtifactSearchUrl = v
}
func (o Build) MarshalJSON() ([]byte, error) {
toSerialize,err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Build) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["url"] = o.Url
toSerialize["id"] = o.Id
toSerialize["created_at"] = o.CreatedAt
toSerialize["updated_at"] = o.UpdatedAt
if !IsNil(o.DeletedAt) {
toSerialize["deleted_at"] = o.DeletedAt
}
toSerialize["etag"] = o.Etag
toSerialize["name"] = o.Name
toSerialize["repo_id"] = o.RepoId
toSerialize["commit_id"] = o.CommitId
toSerialize["log_descriptor_id"] = o.LogDescriptorId
toSerialize["ref"] = o.Ref
toSerialize["status"] = o.Status
toSerialize["timings"] = o.Timings
if !IsNil(o.Error) {
toSerialize["error"] = o.Error
}
toSerialize["opts"] = o.Opts
toSerialize["log_descriptor_url"] = o.LogDescriptorUrl
toSerialize["artifact_search_url"] = o.ArtifactSearchUrl
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Build) UnmarshalJSON(bytes []byte) (err error) {
varBuild := _Build{}
if err = json.Unmarshal(bytes, &varBuild); err == nil {
*o = Build(varBuild)
}
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
delete(additionalProperties, "url")
delete(additionalProperties, "id")
delete(additionalProperties, "created_at")
delete(additionalProperties, "updated_at")
delete(additionalProperties, "deleted_at")
delete(additionalProperties, "etag")
delete(additionalProperties, "name")
delete(additionalProperties, "repo_id")
delete(additionalProperties, "commit_id")
delete(additionalProperties, "log_descriptor_id")
delete(additionalProperties, "ref")
delete(additionalProperties, "status")
delete(additionalProperties, "timings")
delete(additionalProperties, "error")
delete(additionalProperties, "opts")
delete(additionalProperties, "log_descriptor_url")
delete(additionalProperties, "artifact_search_url")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableBuild struct {
value *Build
isSet bool
}
func (v NullableBuild) Get() *Build {
return v.value
}
func (v *NullableBuild) Set(val *Build) {
v.value = val
v.isSet = true
}
func (v NullableBuild) IsSet() bool {
return v.isSet
}
func (v *NullableBuild) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBuild(val *Build) *NullableBuild {
return &NullableBuild{value: val, isSet: true}
}
func (v NullableBuild) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBuild) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}