-
Notifications
You must be signed in to change notification settings - Fork 1.2k
/
Copy pathcloudbuild-gen.go
3648 lines (3190 loc) · 148 KB
/
cloudbuild-gen.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
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2021 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package cloudbuild provides access to the Cloud Build API.
//
// For product documentation, see: https://cloud.google.com/cloud-build/docs/
//
// Creating a client
//
// Usage example:
//
// import "google.golang.org/api/cloudbuild/v1alpha1"
// ...
// ctx := context.Background()
// cloudbuildService, err := cloudbuild.NewService(ctx)
//
// In this example, Google Application Default Credentials are used for authentication.
//
// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
//
// Other authentication options
//
// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
//
// cloudbuildService, err := cloudbuild.NewService(ctx, option.WithAPIKey("AIza..."))
//
// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
//
// config := &oauth2.Config{...}
// // ...
// token, err := config.Exchange(ctx, ...)
// cloudbuildService, err := cloudbuild.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
//
// See https://godoc.org/google.golang.org/api/option/ for details on options.
package cloudbuild // import "google.golang.org/api/cloudbuild/v1alpha1"
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"net/url"
"strconv"
"strings"
googleapi "google.golang.org/api/googleapi"
gensupport "google.golang.org/api/internal/gensupport"
option "google.golang.org/api/option"
internaloption "google.golang.org/api/option/internaloption"
htransport "google.golang.org/api/transport/http"
)
// Always reference these packages, just in case the auto-generated code
// below doesn't.
var _ = bytes.NewBuffer
var _ = strconv.Itoa
var _ = fmt.Sprintf
var _ = json.NewDecoder
var _ = io.Copy
var _ = url.Parse
var _ = gensupport.MarshalJSON
var _ = googleapi.Version
var _ = errors.New
var _ = strings.Replace
var _ = context.Canceled
var _ = internaloption.WithDefaultEndpoint
const apiId = "cloudbuild:v1alpha1"
const apiName = "cloudbuild"
const apiVersion = "v1alpha1"
const basePath = "https://cloudbuild.googleapis.com/"
const mtlsBasePath = "https://cloudbuild.mtls.googleapis.com/"
// OAuth2 scopes used by this API.
const (
// See, edit, configure, and delete your Google Cloud data and see the
// email address for your Google Account.
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
)
// NewService creates a new Service.
func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
scopesOption := option.WithScopes(
"https://www.googleapis.com/auth/cloud-platform",
)
// NOTE: prepend, so we don't override user-specified scopes.
opts = append([]option.ClientOption{scopesOption}, opts...)
opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
client, endpoint, err := htransport.NewClient(ctx, opts...)
if err != nil {
return nil, err
}
s, err := New(client)
if err != nil {
return nil, err
}
if endpoint != "" {
s.BasePath = endpoint
}
return s, nil
}
// New creates a new Service. It uses the provided http.Client for requests.
//
// Deprecated: please use NewService instead.
// To provide a custom HTTP client, use option.WithHTTPClient.
// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
func New(client *http.Client) (*Service, error) {
if client == nil {
return nil, errors.New("client is nil")
}
s := &Service{client: client, BasePath: basePath}
s.Projects = NewProjectsService(s)
return s, nil
}
type Service struct {
client *http.Client
BasePath string // API endpoint base URL
UserAgent string // optional additional User-Agent fragment
Projects *ProjectsService
}
func (s *Service) userAgent() string {
if s.UserAgent == "" {
return googleapi.UserAgent
}
return googleapi.UserAgent + " " + s.UserAgent
}
func NewProjectsService(s *Service) *ProjectsService {
rs := &ProjectsService{s: s}
rs.Locations = NewProjectsLocationsService(s)
rs.WorkerPools = NewProjectsWorkerPoolsService(s)
return rs
}
type ProjectsService struct {
s *Service
Locations *ProjectsLocationsService
WorkerPools *ProjectsWorkerPoolsService
}
func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
rs := &ProjectsLocationsService{s: s}
rs.Operations = NewProjectsLocationsOperationsService(s)
return rs
}
type ProjectsLocationsService struct {
s *Service
Operations *ProjectsLocationsOperationsService
}
func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService {
rs := &ProjectsLocationsOperationsService{s: s}
return rs
}
type ProjectsLocationsOperationsService struct {
s *Service
}
func NewProjectsWorkerPoolsService(s *Service) *ProjectsWorkerPoolsService {
rs := &ProjectsWorkerPoolsService{s: s}
return rs
}
type ProjectsWorkerPoolsService struct {
s *Service
}
// ApprovalConfig: ApprovalConfig describes configuration for manual
// approval of a build.
type ApprovalConfig struct {
// ApprovalRequired: Whether or not approval is needed. If this is set
// on a build, it will become pending when created, and will need to be
// explicitly approved to start.
ApprovalRequired bool `json:"approvalRequired,omitempty"`
// ForceSendFields is a list of field names (e.g. "ApprovalRequired") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ApprovalRequired") to
// include in API requests with the JSON null value. By default, fields
// with empty values are omitted from API requests. However, any field
// with an empty value appearing in NullFields will be sent to the
// server as null. It is an error if a field in this list has a
// non-empty value. This may be used to include null fields in Patch
// requests.
NullFields []string `json:"-"`
}
func (s *ApprovalConfig) MarshalJSON() ([]byte, error) {
type NoMethod ApprovalConfig
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ApprovalResult: ApprovalResult describes the decision and associated
// metadata of a manual approval of a build.
type ApprovalResult struct {
// ApprovalTime: Output only. The time when the approval decision was
// made.
ApprovalTime string `json:"approvalTime,omitempty"`
// ApproverAccount: Output only. Email of the user that called the
// ApproveBuild API to approve or reject a build at the time that the
// API was called.
ApproverAccount string `json:"approverAccount,omitempty"`
// Comment: Optional. An optional comment for this manual approval
// result.
Comment string `json:"comment,omitempty"`
// Decision: Required. The decision of this manual approval.
//
// Possible values:
// "DECISION_UNSPECIFIED" - Default enum type. This should not be
// used.
// "APPROVED" - Build is approved.
// "REJECTED" - Build is rejected.
Decision string `json:"decision,omitempty"`
// Url: Optional. An optional URL tied to this manual approval result.
// This field is essentially the same as comment, except that it will be
// rendered by the UI differently. An example use case is a link to an
// external job that approved this Build.
Url string `json:"url,omitempty"`
// ForceSendFields is a list of field names (e.g. "ApprovalTime") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "ApprovalTime") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ApprovalResult) MarshalJSON() ([]byte, error) {
type NoMethod ApprovalResult
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ArtifactObjects: Files in the workspace to upload to Cloud Storage
// upon successful completion of all build steps.
type ArtifactObjects struct {
// Location: Cloud Storage bucket and optional object path, in the form
// "gs://bucket/path/to/somewhere/". (see Bucket Name Requirements
// (https://cloud.google.com/storage/docs/bucket-naming#requirements)).
// Files in the workspace matching any path pattern will be uploaded to
// Cloud Storage with this location as a prefix.
Location string `json:"location,omitempty"`
// Paths: Path globs used to match files in the build's workspace.
Paths []string `json:"paths,omitempty"`
// Timing: Output only. Stores timing information for pushing all
// artifact objects.
Timing *TimeSpan `json:"timing,omitempty"`
// ForceSendFields is a list of field names (e.g. "Location") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Location") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ArtifactObjects) MarshalJSON() ([]byte, error) {
type NoMethod ArtifactObjects
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// ArtifactResult: An artifact that was uploaded during a build. This is
// a single record in the artifact manifest JSON file.
type ArtifactResult struct {
// FileHash: The file hash of the artifact.
FileHash []*FileHashes `json:"fileHash,omitempty"`
// Location: The path of an artifact in a Google Cloud Storage bucket,
// with the generation number. For example,
// `gs://mybucket/path/to/output.jar#generation`.
Location string `json:"location,omitempty"`
// ForceSendFields is a list of field names (e.g. "FileHash") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "FileHash") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *ArtifactResult) MarshalJSON() ([]byte, error) {
type NoMethod ArtifactResult
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Artifacts: Artifacts produced by a build that should be uploaded upon
// successful completion of all build steps.
type Artifacts struct {
// Images: A list of images to be pushed upon the successful completion
// of all build steps. The images will be pushed using the builder
// service account's credentials. The digests of the pushed images will
// be stored in the Build resource's results field. If any of the images
// fail to be pushed, the build is marked FAILURE.
Images []string `json:"images,omitempty"`
// Objects: A list of objects to be uploaded to Cloud Storage upon
// successful completion of all build steps. Files in the workspace
// matching specified paths globs will be uploaded to the specified
// Cloud Storage location using the builder service account's
// credentials. The location and generation of the uploaded objects will
// be stored in the Build resource's results field. If any objects fail
// to be pushed, the build is marked FAILURE.
Objects *ArtifactObjects `json:"objects,omitempty"`
// ForceSendFields is a list of field names (e.g. "Images") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Images") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Artifacts) MarshalJSON() ([]byte, error) {
type NoMethod Artifacts
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// Build: A build resource in the Cloud Build API. At a high level, a
// `Build` describes where to find source code, how to build it (for
// example, the builder image to run on the source), and where to store
// the built artifacts. Fields can include the following variables,
// which will be expanded when the build is created: - $PROJECT_ID: the
// project ID of the build. - $PROJECT_NUMBER: the project number of the
// build. - $LOCATION: the location/region of the build. - $BUILD_ID:
// the autogenerated ID of the build. - $REPO_NAME: the source
// repository name specified by RepoSource. - $BRANCH_NAME: the branch
// name specified by RepoSource. - $TAG_NAME: the tag name specified by
// RepoSource. - $REVISION_ID or $COMMIT_SHA: the commit SHA specified
// by RepoSource or resolved from the specified branch or tag. -
// $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA.
type Build struct {
// Approval: Output only. Describes this build's approval configuration,
// status, and result.
Approval *BuildApproval `json:"approval,omitempty"`
// Artifacts: Artifacts produced by the build that should be uploaded
// upon successful completion of all build steps.
Artifacts *Artifacts `json:"artifacts,omitempty"`
// AvailableSecrets: Secrets and secret environment variables.
AvailableSecrets *Secrets `json:"availableSecrets,omitempty"`
// BuildTriggerId: Output only. The ID of the `BuildTrigger` that
// triggered this build, if it was triggered automatically.
BuildTriggerId string `json:"buildTriggerId,omitempty"`
// CreateTime: Output only. Time at which the request to create the
// build was received.
CreateTime string `json:"createTime,omitempty"`
// FailureInfo: Output only. Contains information about the build when
// status=FAILURE.
FailureInfo *FailureInfo `json:"failureInfo,omitempty"`
// FinishTime: Output only. Time at which execution of the build was
// finished. The difference between finish_time and start_time is the
// duration of the build's execution.
FinishTime string `json:"finishTime,omitempty"`
// Id: Output only. Unique identifier of the build.
Id string `json:"id,omitempty"`
// Images: A list of images to be pushed upon the successful completion
// of all build steps. The images are pushed using the builder service
// account's credentials. The digests of the pushed images will be
// stored in the `Build` resource's results field. If any of the images
// fail to be pushed, the build status is marked `FAILURE`.
Images []string `json:"images,omitempty"`
// LogUrl: Output only. URL to logs for this build in Google Cloud
// Console.
LogUrl string `json:"logUrl,omitempty"`
// LogsBucket: Google Cloud Storage bucket where logs should be written
// (see Bucket Name Requirements
// (https://cloud.google.com/storage/docs/bucket-naming#requirements)).
// Logs file names will be of the format
// `${logs_bucket}/log-${build_id}.txt`.
LogsBucket string `json:"logsBucket,omitempty"`
// Name: Output only. The 'Build' name with format:
// `projects/{project}/locations/{location}/builds/{build}`, where
// {build} is a unique identifier generated by the service.
Name string `json:"name,omitempty"`
// Options: Special options for this build.
Options *BuildOptions `json:"options,omitempty"`
// ProjectId: Output only. ID of the project.
ProjectId string `json:"projectId,omitempty"`
// QueueTtl: TTL in queue for this build. If provided and the build is
// enqueued longer than this value, the build will expire and the build
// status will be `EXPIRED`. The TTL starts ticking from create_time.
QueueTtl string `json:"queueTtl,omitempty"`
// Results: Output only. Results of the build.
Results *Results `json:"results,omitempty"`
// Secrets: Secrets to decrypt using Cloud Key Management Service. Note:
// Secret Manager is the recommended technique for managing sensitive
// data with Cloud Build. Use `available_secrets` to configure builds to
// access secrets from Secret Manager. For instructions, see:
// https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets
Secrets []*Secret `json:"secrets,omitempty"`
// ServiceAccount: IAM service account whose credentials will be used at
// build runtime. Must be of the format
// `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. ACCOUNT can be
// email address or uniqueId of the service account.
ServiceAccount string `json:"serviceAccount,omitempty"`
// Source: The location of the source files to build.
Source *Source `json:"source,omitempty"`
// SourceProvenance: Output only. A permanent fixed identifier for
// source.
SourceProvenance *SourceProvenance `json:"sourceProvenance,omitempty"`
// StartTime: Output only. Time at which execution of the build was
// started.
StartTime string `json:"startTime,omitempty"`
// Status: Output only. Status of the build.
//
// Possible values:
// "STATUS_UNKNOWN" - Status of the build is unknown.
// "PENDING" - Build has been created and is pending execution and
// queuing. It has not been queued.
// "QUEUED" - Build or step is queued; work has not yet begun.
// "WORKING" - Build or step is being executed.
// "SUCCESS" - Build or step finished successfully.
// "FAILURE" - Build or step failed to complete successfully.
// "INTERNAL_ERROR" - Build or step failed due to an internal cause.
// "TIMEOUT" - Build or step took longer than was allowed.
// "CANCELLED" - Build or step was canceled by a user.
// "EXPIRED" - Build was enqueued for longer than the value of
// `queue_ttl`.
Status string `json:"status,omitempty"`
// StatusDetail: Output only. Customer-readable message about the
// current status.
StatusDetail string `json:"statusDetail,omitempty"`
// Steps: Required. The operations to be performed on the workspace.
Steps []*BuildStep `json:"steps,omitempty"`
// Substitutions: Substitutions data for `Build` resource.
Substitutions map[string]string `json:"substitutions,omitempty"`
// Tags: Tags for annotation of a `Build`. These are not docker tags.
Tags []string `json:"tags,omitempty"`
// Timeout: Amount of time that this build should be allowed to run, to
// second granularity. If this amount of time elapses, work on the build
// will cease and the build status will be `TIMEOUT`. `timeout` starts
// ticking from `startTime`. Default time is ten minutes.
Timeout string `json:"timeout,omitempty"`
// Timing: Output only. Stores timing information for phases of the
// build. Valid keys are: * BUILD: time to execute all build steps. *
// PUSH: time to push all specified images. * FETCHSOURCE: time to fetch
// source. * SETUPBUILD: time to set up build. If the build does not
// specify source or images, these keys will not be included.
Timing map[string]TimeSpan `json:"timing,omitempty"`
// Warnings: Output only. Non-fatal problems encountered during the
// execution of the build.
Warnings []*Warning `json:"warnings,omitempty"`
// ForceSendFields is a list of field names (e.g. "Approval") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Approval") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *Build) MarshalJSON() ([]byte, error) {
type NoMethod Build
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BuildApproval: BuildApproval describes a build's approval
// configuration, state, and result.
type BuildApproval struct {
// Config: Output only. Configuration for manual approval of this build.
Config *ApprovalConfig `json:"config,omitempty"`
// Result: Output only. Result of manual approval for this Build.
Result *ApprovalResult `json:"result,omitempty"`
// State: Output only. The state of this build's approval.
//
// Possible values:
// "STATE_UNSPECIFIED" - Default enum type. This should not be used.
// "PENDING" - Build approval is pending.
// "APPROVED" - Build approval has been approved.
// "REJECTED" - Build approval has been rejected.
// "CANCELLED" - Build was cancelled while it was still pending
// approval.
State string `json:"state,omitempty"`
// ForceSendFields is a list of field names (e.g. "Config") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Config") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BuildApproval) MarshalJSON() ([]byte, error) {
type NoMethod BuildApproval
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BuildOperationMetadata: Metadata for build operations.
type BuildOperationMetadata struct {
// Build: The build that the operation is tracking.
Build *Build `json:"build,omitempty"`
// ForceSendFields is a list of field names (e.g. "Build") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Build") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BuildOperationMetadata) MarshalJSON() ([]byte, error) {
type NoMethod BuildOperationMetadata
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BuildOptions: Optional arguments to enable specific features of
// builds.
type BuildOptions struct {
// DiskSizeGb: Requested disk size for the VM that runs the build. Note
// that this is *NOT* "disk free"; some of the space will be used by the
// operating system and build utilities. Also note that this is the
// minimum disk size that will be allocated for the build -- the build
// may run with a larger disk than requested. At present, the maximum
// disk size is 1000GB; builds that request more than the maximum are
// rejected with an error.
DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"`
// DynamicSubstitutions: Option to specify whether or not to apply bash
// style string operations to the substitutions. NOTE: this is always
// enabled for triggered builds and cannot be overridden in the build
// configuration file.
DynamicSubstitutions bool `json:"dynamicSubstitutions,omitempty"`
// Env: A list of global environment variable definitions that will
// exist for all build steps in this build. If a variable is defined in
// both globally and in a build step, the variable will use the build
// step value. The elements are of the form "KEY=VALUE" for the
// environment variable "KEY" being given the value "VALUE".
Env []string `json:"env,omitempty"`
// LogStreamingOption: Option to define build log streaming behavior to
// Google Cloud Storage.
//
// Possible values:
// "STREAM_DEFAULT" - Service may automatically determine build log
// streaming behavior.
// "STREAM_ON" - Build logs should be streamed to Google Cloud
// Storage.
// "STREAM_OFF" - Build logs should not be streamed to Google Cloud
// Storage; they will be written when the build is completed.
LogStreamingOption string `json:"logStreamingOption,omitempty"`
// Logging: Option to specify the logging mode, which determines if and
// where build logs are stored.
//
// Possible values:
// "LOGGING_UNSPECIFIED" - The service determines the logging mode.
// The default is `LEGACY`. Do not rely on the default logging behavior
// as it may change in the future.
// "LEGACY" - Cloud Logging and Cloud Storage logging are enabled.
// "GCS_ONLY" - Only Cloud Storage logging is enabled.
// "STACKDRIVER_ONLY" - This option is the same as CLOUD_LOGGING_ONLY.
// "CLOUD_LOGGING_ONLY" - Only Cloud Logging is enabled. Note that
// logs for both the Cloud Console UI and Cloud SDK are based on Cloud
// Storage logs, so neither will provide logs if this option is chosen.
// "NONE" - Turn off all logging. No build logs will be captured.
Logging string `json:"logging,omitempty"`
// MachineType: Compute Engine machine type on which to run the build.
//
// Possible values:
// "UNSPECIFIED" - Standard machine type.
// "N1_HIGHCPU_8" - Highcpu machine with 8 CPUs.
// "N1_HIGHCPU_32" - Highcpu machine with 32 CPUs.
// "E2_HIGHCPU_8" - Highcpu e2 machine with 8 CPUs.
// "E2_HIGHCPU_32" - Highcpu e2 machine with 32 CPUs.
MachineType string `json:"machineType,omitempty"`
// Pool: Optional. Specification for execution on a `WorkerPool`. See
// running builds in a private pool
// (https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool)
// for more information.
Pool *PoolOption `json:"pool,omitempty"`
// RequestedVerifyOption: Requested verifiability options.
//
// Possible values:
// "NOT_VERIFIED" - Not a verifiable build. (default)
// "VERIFIED" - Verified build.
RequestedVerifyOption string `json:"requestedVerifyOption,omitempty"`
// SecretEnv: A list of global environment variables, which are
// encrypted using a Cloud Key Management Service crypto key. These
// values must be specified in the build's `Secret`. These variables
// will be available to all build steps in this build.
SecretEnv []string `json:"secretEnv,omitempty"`
// SourceProvenanceHash: Requested hash for SourceProvenance.
//
// Possible values:
// "NONE" - No hash requested.
// "SHA256" - Use a sha256 hash.
// "MD5" - Use a md5 hash.
SourceProvenanceHash []string `json:"sourceProvenanceHash,omitempty"`
// SubstitutionOption: Option to specify behavior when there is an error
// in the substitution checks. NOTE: this is always set to ALLOW_LOOSE
// for triggered builds and cannot be overridden in the build
// configuration file.
//
// Possible values:
// "MUST_MATCH" - Fails the build if error in substitutions checks,
// like missing a substitution in the template or in the map.
// "ALLOW_LOOSE" - Do not fail the build if error in substitutions
// checks.
SubstitutionOption string `json:"substitutionOption,omitempty"`
// Volumes: Global list of volumes to mount for ALL build steps Each
// volume is created as an empty volume prior to starting the build
// process. Upon completion of the build, volumes and their contents are
// discarded. Global volume names and paths cannot conflict with the
// volumes defined a build step. Using a global volume in a build with
// only one step is not valid as it is indicative of a build request
// with an incorrect configuration.
Volumes []*Volume `json:"volumes,omitempty"`
// WorkerPool: This field deprecated; please use `pool.name` instead.
WorkerPool string `json:"workerPool,omitempty"`
// ForceSendFields is a list of field names (e.g. "DiskSizeGb") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "DiskSizeGb") to include in
// API requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BuildOptions) MarshalJSON() ([]byte, error) {
type NoMethod BuildOptions
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BuildStep: A step in the build pipeline.
type BuildStep struct {
// Args: A list of arguments that will be presented to the step when it
// is started. If the image used to run the step's container has an
// entrypoint, the `args` are used as arguments to that entrypoint. If
// the image does not define an entrypoint, the first element in args is
// used as the entrypoint, and the remainder will be used as arguments.
Args []string `json:"args,omitempty"`
// Dir: Working directory to use when running this step's container. If
// this value is a relative path, it is relative to the build's working
// directory. If this value is absolute, it may be outside the build's
// working directory, in which case the contents of the path may not be
// persisted across build step executions, unless a `volume` for that
// path is specified. If the build specifies a `RepoSource` with `dir`
// and a step with a `dir`, which specifies an absolute path, the
// `RepoSource` `dir` is ignored for the step's execution.
Dir string `json:"dir,omitempty"`
// Entrypoint: Entrypoint to be used instead of the build step image's
// default entrypoint. If unset, the image's default entrypoint is used.
Entrypoint string `json:"entrypoint,omitempty"`
// Env: A list of environment variable definitions to be used when
// running a step. The elements are of the form "KEY=VALUE" for the
// environment variable "KEY" being given the value "VALUE".
Env []string `json:"env,omitempty"`
// Id: Unique identifier for this build step, used in `wait_for` to
// reference this build step as a dependency.
Id string `json:"id,omitempty"`
// Name: Required. The name of the container image that will run this
// particular build step. If the image is available in the host's Docker
// daemon's cache, it will be run directly. If not, the host will
// attempt to pull the image first, using the builder service account's
// credentials if necessary. The Docker daemon's cache will already have
// the latest versions of all of the officially supported build steps
// (https://github.com/GoogleCloudPlatform/cloud-builders
// (https://github.com/GoogleCloudPlatform/cloud-builders)). The Docker
// daemon will also have cached many of the layers for some popular
// images, like "ubuntu", "debian", but they will be refreshed at the
// time you attempt to use them. If you built an image in a previous
// build step, it will be stored in the host's Docker daemon's cache and
// is available to use as the name for a later build step.
Name string `json:"name,omitempty"`
// PullTiming: Output only. Stores timing information for pulling this
// build step's builder image only.
PullTiming *TimeSpan `json:"pullTiming,omitempty"`
// Script: A shell script to be executed in the step. When script is
// provided, the user cannot specify the entrypoint or args.
Script string `json:"script,omitempty"`
// SecretEnv: A list of environment variables which are encrypted using
// a Cloud Key Management Service crypto key. These values must be
// specified in the build's `Secret`.
SecretEnv []string `json:"secretEnv,omitempty"`
// Status: Output only. Status of the build step. At this time, build
// step status is only updated on build completion; step status is not
// updated in real-time as the build progresses.
//
// Possible values:
// "STATUS_UNKNOWN" - Status of the build is unknown.
// "PENDING" - Build has been created and is pending execution and
// queuing. It has not been queued.
// "QUEUED" - Build or step is queued; work has not yet begun.
// "WORKING" - Build or step is being executed.
// "SUCCESS" - Build or step finished successfully.
// "FAILURE" - Build or step failed to complete successfully.
// "INTERNAL_ERROR" - Build or step failed due to an internal cause.
// "TIMEOUT" - Build or step took longer than was allowed.
// "CANCELLED" - Build or step was canceled by a user.
// "EXPIRED" - Build was enqueued for longer than the value of
// `queue_ttl`.
Status string `json:"status,omitempty"`
// Timeout: Time limit for executing this build step. If not defined,
// the step has no time limit and will be allowed to continue to run
// until either it completes or the build itself times out.
Timeout string `json:"timeout,omitempty"`
// Timing: Output only. Stores timing information for executing this
// build step.
Timing *TimeSpan `json:"timing,omitempty"`
// Volumes: List of volumes to mount into the build step. Each volume is
// created as an empty volume prior to execution of the build step. Upon
// completion of the build, volumes and their contents are discarded.
// Using a named volume in only one step is not valid as it is
// indicative of a build request with an incorrect configuration.
Volumes []*Volume `json:"volumes,omitempty"`
// WaitFor: The ID(s) of the step(s) that this build step depends on.
// This build step will not start until all the build steps in
// `wait_for` have completed successfully. If `wait_for` is empty, this
// build step will start when all previous build steps in the
// `Build.Steps` list have completed successfully.
WaitFor []string `json:"waitFor,omitempty"`
// ForceSendFields is a list of field names (e.g. "Args") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Args") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BuildStep) MarshalJSON() ([]byte, error) {
type NoMethod BuildStep
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// BuiltImage: An image built by the pipeline.
type BuiltImage struct {
// Digest: Docker Registry 2.0 digest.
Digest string `json:"digest,omitempty"`
// Name: Name used to push the container image to Google Container
// Registry, as presented to `docker push`.
Name string `json:"name,omitempty"`
// PushTiming: Output only. Stores timing information for pushing the
// specified image.
PushTiming *TimeSpan `json:"pushTiming,omitempty"`
// ForceSendFields is a list of field names (e.g. "Digest") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "Digest") to include in API
// requests with the JSON null value. By default, fields with empty
// values are omitted from API requests. However, any field with an
// empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *BuiltImage) MarshalJSON() ([]byte, error) {
type NoMethod BuiltImage
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CancelOperationRequest: The request message for
// Operations.CancelOperation.
type CancelOperationRequest struct {
}
// CreateGitHubEnterpriseConfigOperationMetadata: Metadata for
// `CreateGithubEnterpriseConfig` operation.
type CreateGitHubEnterpriseConfigOperationMetadata struct {
// CompleteTime: Time the operation was completed.
CompleteTime string `json:"completeTime,omitempty"`
// CreateTime: Time the operation was created.
CreateTime string `json:"createTime,omitempty"`
// GithubEnterpriseConfig: The resource name of the GitHubEnterprise to
// be created. Format:
// `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}`
// .
GithubEnterpriseConfig string `json:"githubEnterpriseConfig,omitempty"`
// ForceSendFields is a list of field names (e.g. "CompleteTime") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CompleteTime") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.
NullFields []string `json:"-"`
}
func (s *CreateGitHubEnterpriseConfigOperationMetadata) MarshalJSON() ([]byte, error) {
type NoMethod CreateGitHubEnterpriseConfigOperationMetadata
raw := NoMethod(*s)
return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
}
// CreateWorkerPoolOperationMetadata: Metadata for the
// `CreateWorkerPool` operation.
type CreateWorkerPoolOperationMetadata struct {
// CompleteTime: Time the operation was completed.
CompleteTime string `json:"completeTime,omitempty"`
// CreateTime: Time the operation was created.
CreateTime string `json:"createTime,omitempty"`
// WorkerPool: The resource name of the `WorkerPool` to create. Format:
// `projects/{project}/locations/{location}/workerPools/{worker_pool}`.
WorkerPool string `json:"workerPool,omitempty"`
// ForceSendFields is a list of field names (e.g. "CompleteTime") to
// unconditionally include in API requests. By default, fields with
// empty or default values are omitted from API requests. However, any
// non-pointer, non-interface field appearing in ForceSendFields will be
// sent to the server regardless of whether the field is empty or not.
// This may be used to include empty fields in Patch requests.
ForceSendFields []string `json:"-"`
// NullFields is a list of field names (e.g. "CompleteTime") to include
// in API requests with the JSON null value. By default, fields with
// empty values are omitted from API requests. However, any field with
// an empty value appearing in NullFields will be sent to the server as
// null. It is an error if a field in this list has a non-empty value.
// This may be used to include null fields in Patch requests.