1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package cloudbuild provides access to the Cloud Build API. 8// 9// For product documentation, see: https://cloud.google.com/cloud-build/docs/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/cloudbuild/v1alpha1" 16// ... 17// ctx := context.Background() 18// cloudbuildService, err := cloudbuild.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// cloudbuildService, err := cloudbuild.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// cloudbuildService, err := cloudbuild.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package cloudbuild // import "google.golang.org/api/cloudbuild/v1alpha1" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "cloudbuild:v1alpha1" 75const apiName = "cloudbuild" 76const apiVersion = "v1alpha1" 77const basePath = "https://cloudbuild.googleapis.com/" 78const mtlsBasePath = "https://cloudbuild.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // See, edit, configure, and delete your Google Cloud data and see the 83 // email address for your Google Account. 84 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 85) 86 87// NewService creates a new Service. 88func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 89 scopesOption := option.WithScopes( 90 "https://www.googleapis.com/auth/cloud-platform", 91 ) 92 // NOTE: prepend, so we don't override user-specified scopes. 93 opts = append([]option.ClientOption{scopesOption}, opts...) 94 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 95 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 96 client, endpoint, err := htransport.NewClient(ctx, opts...) 97 if err != nil { 98 return nil, err 99 } 100 s, err := New(client) 101 if err != nil { 102 return nil, err 103 } 104 if endpoint != "" { 105 s.BasePath = endpoint 106 } 107 return s, nil 108} 109 110// New creates a new Service. It uses the provided http.Client for requests. 111// 112// Deprecated: please use NewService instead. 113// To provide a custom HTTP client, use option.WithHTTPClient. 114// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 115func New(client *http.Client) (*Service, error) { 116 if client == nil { 117 return nil, errors.New("client is nil") 118 } 119 s := &Service{client: client, BasePath: basePath} 120 s.Projects = NewProjectsService(s) 121 return s, nil 122} 123 124type Service struct { 125 client *http.Client 126 BasePath string // API endpoint base URL 127 UserAgent string // optional additional User-Agent fragment 128 129 Projects *ProjectsService 130} 131 132func (s *Service) userAgent() string { 133 if s.UserAgent == "" { 134 return googleapi.UserAgent 135 } 136 return googleapi.UserAgent + " " + s.UserAgent 137} 138 139func NewProjectsService(s *Service) *ProjectsService { 140 rs := &ProjectsService{s: s} 141 rs.Locations = NewProjectsLocationsService(s) 142 rs.WorkerPools = NewProjectsWorkerPoolsService(s) 143 return rs 144} 145 146type ProjectsService struct { 147 s *Service 148 149 Locations *ProjectsLocationsService 150 151 WorkerPools *ProjectsWorkerPoolsService 152} 153 154func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 155 rs := &ProjectsLocationsService{s: s} 156 rs.Operations = NewProjectsLocationsOperationsService(s) 157 return rs 158} 159 160type ProjectsLocationsService struct { 161 s *Service 162 163 Operations *ProjectsLocationsOperationsService 164} 165 166func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 167 rs := &ProjectsLocationsOperationsService{s: s} 168 return rs 169} 170 171type ProjectsLocationsOperationsService struct { 172 s *Service 173} 174 175func NewProjectsWorkerPoolsService(s *Service) *ProjectsWorkerPoolsService { 176 rs := &ProjectsWorkerPoolsService{s: s} 177 return rs 178} 179 180type ProjectsWorkerPoolsService struct { 181 s *Service 182} 183 184// ApprovalConfig: ApprovalConfig describes configuration for manual 185// approval of a build. 186type ApprovalConfig struct { 187 // ApprovalRequired: Whether or not approval is needed. If this is set 188 // on a build, it will become pending when created, and will need to be 189 // explicitly approved to start. 190 ApprovalRequired bool `json:"approvalRequired,omitempty"` 191 192 // ForceSendFields is a list of field names (e.g. "ApprovalRequired") to 193 // unconditionally include in API requests. By default, fields with 194 // empty or default values are omitted from API requests. However, any 195 // non-pointer, non-interface field appearing in ForceSendFields will be 196 // sent to the server regardless of whether the field is empty or not. 197 // This may be used to include empty fields in Patch requests. 198 ForceSendFields []string `json:"-"` 199 200 // NullFields is a list of field names (e.g. "ApprovalRequired") to 201 // include in API requests with the JSON null value. By default, fields 202 // with empty values are omitted from API requests. However, any field 203 // with an empty value appearing in NullFields will be sent to the 204 // server as null. It is an error if a field in this list has a 205 // non-empty value. This may be used to include null fields in Patch 206 // requests. 207 NullFields []string `json:"-"` 208} 209 210func (s *ApprovalConfig) MarshalJSON() ([]byte, error) { 211 type NoMethod ApprovalConfig 212 raw := NoMethod(*s) 213 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 214} 215 216// ApprovalResult: ApprovalResult describes the decision and associated 217// metadata of a manual approval of a build. 218type ApprovalResult struct { 219 // ApprovalTime: Output only. The time when the approval decision was 220 // made. 221 ApprovalTime string `json:"approvalTime,omitempty"` 222 223 // ApproverAccount: Output only. Email of the user that called the 224 // ApproveBuild API to approve or reject a build at the time that the 225 // API was called. 226 ApproverAccount string `json:"approverAccount,omitempty"` 227 228 // Comment: Optional. An optional comment for this manual approval 229 // result. 230 Comment string `json:"comment,omitempty"` 231 232 // Decision: Required. The decision of this manual approval. 233 // 234 // Possible values: 235 // "DECISION_UNSPECIFIED" - Default enum type. This should not be 236 // used. 237 // "APPROVED" - Build is approved. 238 // "REJECTED" - Build is rejected. 239 Decision string `json:"decision,omitempty"` 240 241 // Url: Optional. An optional URL tied to this manual approval result. 242 // This field is essentially the same as comment, except that it will be 243 // rendered by the UI differently. An example use case is a link to an 244 // external job that approved this Build. 245 Url string `json:"url,omitempty"` 246 247 // ForceSendFields is a list of field names (e.g. "ApprovalTime") to 248 // unconditionally include in API requests. By default, fields with 249 // empty or default values are omitted from API requests. However, any 250 // non-pointer, non-interface field appearing in ForceSendFields will be 251 // sent to the server regardless of whether the field is empty or not. 252 // This may be used to include empty fields in Patch requests. 253 ForceSendFields []string `json:"-"` 254 255 // NullFields is a list of field names (e.g. "ApprovalTime") to include 256 // in API requests with the JSON null value. By default, fields with 257 // empty values are omitted from API requests. However, any field with 258 // an empty value appearing in NullFields will be sent to the server as 259 // null. It is an error if a field in this list has a non-empty value. 260 // This may be used to include null fields in Patch requests. 261 NullFields []string `json:"-"` 262} 263 264func (s *ApprovalResult) MarshalJSON() ([]byte, error) { 265 type NoMethod ApprovalResult 266 raw := NoMethod(*s) 267 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 268} 269 270// ArtifactObjects: Files in the workspace to upload to Cloud Storage 271// upon successful completion of all build steps. 272type ArtifactObjects struct { 273 // Location: Cloud Storage bucket and optional object path, in the form 274 // "gs://bucket/path/to/somewhere/". (see Bucket Name Requirements 275 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 276 // Files in the workspace matching any path pattern will be uploaded to 277 // Cloud Storage with this location as a prefix. 278 Location string `json:"location,omitempty"` 279 280 // Paths: Path globs used to match files in the build's workspace. 281 Paths []string `json:"paths,omitempty"` 282 283 // Timing: Output only. Stores timing information for pushing all 284 // artifact objects. 285 Timing *TimeSpan `json:"timing,omitempty"` 286 287 // ForceSendFields is a list of field names (e.g. "Location") to 288 // unconditionally include in API requests. By default, fields with 289 // empty or default values are omitted from API requests. However, any 290 // non-pointer, non-interface field appearing in ForceSendFields will be 291 // sent to the server regardless of whether the field is empty or not. 292 // This may be used to include empty fields in Patch requests. 293 ForceSendFields []string `json:"-"` 294 295 // NullFields is a list of field names (e.g. "Location") to include in 296 // API requests with the JSON null value. By default, fields with empty 297 // values are omitted from API requests. However, any field with an 298 // empty value appearing in NullFields will be sent to the server as 299 // null. It is an error if a field in this list has a non-empty value. 300 // This may be used to include null fields in Patch requests. 301 NullFields []string `json:"-"` 302} 303 304func (s *ArtifactObjects) MarshalJSON() ([]byte, error) { 305 type NoMethod ArtifactObjects 306 raw := NoMethod(*s) 307 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 308} 309 310// ArtifactResult: An artifact that was uploaded during a build. This is 311// a single record in the artifact manifest JSON file. 312type ArtifactResult struct { 313 // FileHash: The file hash of the artifact. 314 FileHash []*FileHashes `json:"fileHash,omitempty"` 315 316 // Location: The path of an artifact in a Google Cloud Storage bucket, 317 // with the generation number. For example, 318 // `gs://mybucket/path/to/output.jar#generation`. 319 Location string `json:"location,omitempty"` 320 321 // ForceSendFields is a list of field names (e.g. "FileHash") to 322 // unconditionally include in API requests. By default, fields with 323 // empty or default values are omitted from API requests. However, any 324 // non-pointer, non-interface field appearing in ForceSendFields will be 325 // sent to the server regardless of whether the field is empty or not. 326 // This may be used to include empty fields in Patch requests. 327 ForceSendFields []string `json:"-"` 328 329 // NullFields is a list of field names (e.g. "FileHash") to include in 330 // API requests with the JSON null value. By default, fields with empty 331 // values are omitted from API requests. However, any field with an 332 // empty value appearing in NullFields will be sent to the server as 333 // null. It is an error if a field in this list has a non-empty value. 334 // This may be used to include null fields in Patch requests. 335 NullFields []string `json:"-"` 336} 337 338func (s *ArtifactResult) MarshalJSON() ([]byte, error) { 339 type NoMethod ArtifactResult 340 raw := NoMethod(*s) 341 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 342} 343 344// Artifacts: Artifacts produced by a build that should be uploaded upon 345// successful completion of all build steps. 346type Artifacts struct { 347 // Images: A list of images to be pushed upon the successful completion 348 // of all build steps. The images will be pushed using the builder 349 // service account's credentials. The digests of the pushed images will 350 // be stored in the Build resource's results field. If any of the images 351 // fail to be pushed, the build is marked FAILURE. 352 Images []string `json:"images,omitempty"` 353 354 // Objects: A list of objects to be uploaded to Cloud Storage upon 355 // successful completion of all build steps. Files in the workspace 356 // matching specified paths globs will be uploaded to the specified 357 // Cloud Storage location using the builder service account's 358 // credentials. The location and generation of the uploaded objects will 359 // be stored in the Build resource's results field. If any objects fail 360 // to be pushed, the build is marked FAILURE. 361 Objects *ArtifactObjects `json:"objects,omitempty"` 362 363 // ForceSendFields is a list of field names (e.g. "Images") to 364 // unconditionally include in API requests. By default, fields with 365 // empty or default values are omitted from API requests. However, any 366 // non-pointer, non-interface field appearing in ForceSendFields will be 367 // sent to the server regardless of whether the field is empty or not. 368 // This may be used to include empty fields in Patch requests. 369 ForceSendFields []string `json:"-"` 370 371 // NullFields is a list of field names (e.g. "Images") to include in API 372 // requests with the JSON null value. By default, fields with empty 373 // values are omitted from API requests. However, any field with an 374 // empty value appearing in NullFields will be sent to the server as 375 // null. It is an error if a field in this list has a non-empty value. 376 // This may be used to include null fields in Patch requests. 377 NullFields []string `json:"-"` 378} 379 380func (s *Artifacts) MarshalJSON() ([]byte, error) { 381 type NoMethod Artifacts 382 raw := NoMethod(*s) 383 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 384} 385 386// Build: A build resource in the Cloud Build API. At a high level, a 387// `Build` describes where to find source code, how to build it (for 388// example, the builder image to run on the source), and where to store 389// the built artifacts. Fields can include the following variables, 390// which will be expanded when the build is created: - $PROJECT_ID: the 391// project ID of the build. - $PROJECT_NUMBER: the project number of the 392// build. - $LOCATION: the location/region of the build. - $BUILD_ID: 393// the autogenerated ID of the build. - $REPO_NAME: the source 394// repository name specified by RepoSource. - $BRANCH_NAME: the branch 395// name specified by RepoSource. - $TAG_NAME: the tag name specified by 396// RepoSource. - $REVISION_ID or $COMMIT_SHA: the commit SHA specified 397// by RepoSource or resolved from the specified branch or tag. - 398// $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA. 399type Build struct { 400 // Approval: Output only. Describes this build's approval configuration, 401 // status, and result. 402 Approval *BuildApproval `json:"approval,omitempty"` 403 404 // Artifacts: Artifacts produced by the build that should be uploaded 405 // upon successful completion of all build steps. 406 Artifacts *Artifacts `json:"artifacts,omitempty"` 407 408 // AvailableSecrets: Secrets and secret environment variables. 409 AvailableSecrets *Secrets `json:"availableSecrets,omitempty"` 410 411 // BuildTriggerId: Output only. The ID of the `BuildTrigger` that 412 // triggered this build, if it was triggered automatically. 413 BuildTriggerId string `json:"buildTriggerId,omitempty"` 414 415 // CreateTime: Output only. Time at which the request to create the 416 // build was received. 417 CreateTime string `json:"createTime,omitempty"` 418 419 // FailureInfo: Output only. Contains information about the build when 420 // status=FAILURE. 421 FailureInfo *FailureInfo `json:"failureInfo,omitempty"` 422 423 // FinishTime: Output only. Time at which execution of the build was 424 // finished. The difference between finish_time and start_time is the 425 // duration of the build's execution. 426 FinishTime string `json:"finishTime,omitempty"` 427 428 // Id: Output only. Unique identifier of the build. 429 Id string `json:"id,omitempty"` 430 431 // Images: A list of images to be pushed upon the successful completion 432 // of all build steps. The images are pushed using the builder service 433 // account's credentials. The digests of the pushed images will be 434 // stored in the `Build` resource's results field. If any of the images 435 // fail to be pushed, the build status is marked `FAILURE`. 436 Images []string `json:"images,omitempty"` 437 438 // LogUrl: Output only. URL to logs for this build in Google Cloud 439 // Console. 440 LogUrl string `json:"logUrl,omitempty"` 441 442 // LogsBucket: Google Cloud Storage bucket where logs should be written 443 // (see Bucket Name Requirements 444 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 445 // Logs file names will be of the format 446 // `${logs_bucket}/log-${build_id}.txt`. 447 LogsBucket string `json:"logsBucket,omitempty"` 448 449 // Name: Output only. The 'Build' name with format: 450 // `projects/{project}/locations/{location}/builds/{build}`, where 451 // {build} is a unique identifier generated by the service. 452 Name string `json:"name,omitempty"` 453 454 // Options: Special options for this build. 455 Options *BuildOptions `json:"options,omitempty"` 456 457 // ProjectId: Output only. ID of the project. 458 ProjectId string `json:"projectId,omitempty"` 459 460 // QueueTtl: TTL in queue for this build. If provided and the build is 461 // enqueued longer than this value, the build will expire and the build 462 // status will be `EXPIRED`. The TTL starts ticking from create_time. 463 QueueTtl string `json:"queueTtl,omitempty"` 464 465 // Results: Output only. Results of the build. 466 Results *Results `json:"results,omitempty"` 467 468 // Secrets: Secrets to decrypt using Cloud Key Management Service. Note: 469 // Secret Manager is the recommended technique for managing sensitive 470 // data with Cloud Build. Use `available_secrets` to configure builds to 471 // access secrets from Secret Manager. For instructions, see: 472 // https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets 473 Secrets []*Secret `json:"secrets,omitempty"` 474 475 // ServiceAccount: IAM service account whose credentials will be used at 476 // build runtime. Must be of the format 477 // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. ACCOUNT can be 478 // email address or uniqueId of the service account. 479 ServiceAccount string `json:"serviceAccount,omitempty"` 480 481 // Source: The location of the source files to build. 482 Source *Source `json:"source,omitempty"` 483 484 // SourceProvenance: Output only. A permanent fixed identifier for 485 // source. 486 SourceProvenance *SourceProvenance `json:"sourceProvenance,omitempty"` 487 488 // StartTime: Output only. Time at which execution of the build was 489 // started. 490 StartTime string `json:"startTime,omitempty"` 491 492 // Status: Output only. Status of the build. 493 // 494 // Possible values: 495 // "STATUS_UNKNOWN" - Status of the build is unknown. 496 // "PENDING" - Build has been created and is pending execution and 497 // queuing. It has not been queued. 498 // "QUEUED" - Build or step is queued; work has not yet begun. 499 // "WORKING" - Build or step is being executed. 500 // "SUCCESS" - Build or step finished successfully. 501 // "FAILURE" - Build or step failed to complete successfully. 502 // "INTERNAL_ERROR" - Build or step failed due to an internal cause. 503 // "TIMEOUT" - Build or step took longer than was allowed. 504 // "CANCELLED" - Build or step was canceled by a user. 505 // "EXPIRED" - Build was enqueued for longer than the value of 506 // `queue_ttl`. 507 Status string `json:"status,omitempty"` 508 509 // StatusDetail: Output only. Customer-readable message about the 510 // current status. 511 StatusDetail string `json:"statusDetail,omitempty"` 512 513 // Steps: Required. The operations to be performed on the workspace. 514 Steps []*BuildStep `json:"steps,omitempty"` 515 516 // Substitutions: Substitutions data for `Build` resource. 517 Substitutions map[string]string `json:"substitutions,omitempty"` 518 519 // Tags: Tags for annotation of a `Build`. These are not docker tags. 520 Tags []string `json:"tags,omitempty"` 521 522 // Timeout: Amount of time that this build should be allowed to run, to 523 // second granularity. If this amount of time elapses, work on the build 524 // will cease and the build status will be `TIMEOUT`. `timeout` starts 525 // ticking from `startTime`. Default time is ten minutes. 526 Timeout string `json:"timeout,omitempty"` 527 528 // Timing: Output only. Stores timing information for phases of the 529 // build. Valid keys are: * BUILD: time to execute all build steps. * 530 // PUSH: time to push all specified images. * FETCHSOURCE: time to fetch 531 // source. * SETUPBUILD: time to set up build. If the build does not 532 // specify source or images, these keys will not be included. 533 Timing map[string]TimeSpan `json:"timing,omitempty"` 534 535 // Warnings: Output only. Non-fatal problems encountered during the 536 // execution of the build. 537 Warnings []*Warning `json:"warnings,omitempty"` 538 539 // ForceSendFields is a list of field names (e.g. "Approval") to 540 // unconditionally include in API requests. By default, fields with 541 // empty or default values are omitted from API requests. However, any 542 // non-pointer, non-interface field appearing in ForceSendFields will be 543 // sent to the server regardless of whether the field is empty or not. 544 // This may be used to include empty fields in Patch requests. 545 ForceSendFields []string `json:"-"` 546 547 // NullFields is a list of field names (e.g. "Approval") to include in 548 // API requests with the JSON null value. By default, fields with empty 549 // values are omitted from API requests. However, any field with an 550 // empty value appearing in NullFields will be sent to the server as 551 // null. It is an error if a field in this list has a non-empty value. 552 // This may be used to include null fields in Patch requests. 553 NullFields []string `json:"-"` 554} 555 556func (s *Build) MarshalJSON() ([]byte, error) { 557 type NoMethod Build 558 raw := NoMethod(*s) 559 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 560} 561 562// BuildApproval: BuildApproval describes a build's approval 563// configuration, state, and result. 564type BuildApproval struct { 565 // Config: Output only. Configuration for manual approval of this build. 566 Config *ApprovalConfig `json:"config,omitempty"` 567 568 // Result: Output only. Result of manual approval for this Build. 569 Result *ApprovalResult `json:"result,omitempty"` 570 571 // State: Output only. The state of this build's approval. 572 // 573 // Possible values: 574 // "STATE_UNSPECIFIED" - Default enum type. This should not be used. 575 // "PENDING" - Build approval is pending. 576 // "APPROVED" - Build approval has been approved. 577 // "REJECTED" - Build approval has been rejected. 578 // "CANCELLED" - Build was cancelled while it was still pending 579 // approval. 580 State string `json:"state,omitempty"` 581 582 // ForceSendFields is a list of field names (e.g. "Config") to 583 // unconditionally include in API requests. By default, fields with 584 // empty or default values are omitted from API requests. However, any 585 // non-pointer, non-interface field appearing in ForceSendFields will be 586 // sent to the server regardless of whether the field is empty or not. 587 // This may be used to include empty fields in Patch requests. 588 ForceSendFields []string `json:"-"` 589 590 // NullFields is a list of field names (e.g. "Config") to include in API 591 // requests with the JSON null value. By default, fields with empty 592 // values are omitted from API requests. However, any field with an 593 // empty value appearing in NullFields will be sent to the server as 594 // null. It is an error if a field in this list has a non-empty value. 595 // This may be used to include null fields in Patch requests. 596 NullFields []string `json:"-"` 597} 598 599func (s *BuildApproval) MarshalJSON() ([]byte, error) { 600 type NoMethod BuildApproval 601 raw := NoMethod(*s) 602 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 603} 604 605// BuildOperationMetadata: Metadata for build operations. 606type BuildOperationMetadata struct { 607 // Build: The build that the operation is tracking. 608 Build *Build `json:"build,omitempty"` 609 610 // ForceSendFields is a list of field names (e.g. "Build") to 611 // unconditionally include in API requests. By default, fields with 612 // empty or default values are omitted from API requests. However, any 613 // non-pointer, non-interface field appearing in ForceSendFields will be 614 // sent to the server regardless of whether the field is empty or not. 615 // This may be used to include empty fields in Patch requests. 616 ForceSendFields []string `json:"-"` 617 618 // NullFields is a list of field names (e.g. "Build") to include in API 619 // requests with the JSON null value. By default, fields with empty 620 // values are omitted from API requests. However, any field with an 621 // empty value appearing in NullFields will be sent to the server as 622 // null. It is an error if a field in this list has a non-empty value. 623 // This may be used to include null fields in Patch requests. 624 NullFields []string `json:"-"` 625} 626 627func (s *BuildOperationMetadata) MarshalJSON() ([]byte, error) { 628 type NoMethod BuildOperationMetadata 629 raw := NoMethod(*s) 630 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 631} 632 633// BuildOptions: Optional arguments to enable specific features of 634// builds. 635type BuildOptions struct { 636 // DiskSizeGb: Requested disk size for the VM that runs the build. Note 637 // that this is *NOT* "disk free"; some of the space will be used by the 638 // operating system and build utilities. Also note that this is the 639 // minimum disk size that will be allocated for the build -- the build 640 // may run with a larger disk than requested. At present, the maximum 641 // disk size is 1000GB; builds that request more than the maximum are 642 // rejected with an error. 643 DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` 644 645 // DynamicSubstitutions: Option to specify whether or not to apply bash 646 // style string operations to the substitutions. NOTE: this is always 647 // enabled for triggered builds and cannot be overridden in the build 648 // configuration file. 649 DynamicSubstitutions bool `json:"dynamicSubstitutions,omitempty"` 650 651 // Env: A list of global environment variable definitions that will 652 // exist for all build steps in this build. If a variable is defined in 653 // both globally and in a build step, the variable will use the build 654 // step value. The elements are of the form "KEY=VALUE" for the 655 // environment variable "KEY" being given the value "VALUE". 656 Env []string `json:"env,omitempty"` 657 658 // LogStreamingOption: Option to define build log streaming behavior to 659 // Google Cloud Storage. 660 // 661 // Possible values: 662 // "STREAM_DEFAULT" - Service may automatically determine build log 663 // streaming behavior. 664 // "STREAM_ON" - Build logs should be streamed to Google Cloud 665 // Storage. 666 // "STREAM_OFF" - Build logs should not be streamed to Google Cloud 667 // Storage; they will be written when the build is completed. 668 LogStreamingOption string `json:"logStreamingOption,omitempty"` 669 670 // Logging: Option to specify the logging mode, which determines if and 671 // where build logs are stored. 672 // 673 // Possible values: 674 // "LOGGING_UNSPECIFIED" - The service determines the logging mode. 675 // The default is `LEGACY`. Do not rely on the default logging behavior 676 // as it may change in the future. 677 // "LEGACY" - Cloud Logging and Cloud Storage logging are enabled. 678 // "GCS_ONLY" - Only Cloud Storage logging is enabled. 679 // "STACKDRIVER_ONLY" - This option is the same as CLOUD_LOGGING_ONLY. 680 // "CLOUD_LOGGING_ONLY" - Only Cloud Logging is enabled. Note that 681 // logs for both the Cloud Console UI and Cloud SDK are based on Cloud 682 // Storage logs, so neither will provide logs if this option is chosen. 683 // "NONE" - Turn off all logging. No build logs will be captured. 684 Logging string `json:"logging,omitempty"` 685 686 // MachineType: Compute Engine machine type on which to run the build. 687 // 688 // Possible values: 689 // "UNSPECIFIED" - Standard machine type. 690 // "N1_HIGHCPU_8" - Highcpu machine with 8 CPUs. 691 // "N1_HIGHCPU_32" - Highcpu machine with 32 CPUs. 692 // "E2_HIGHCPU_8" - Highcpu e2 machine with 8 CPUs. 693 // "E2_HIGHCPU_32" - Highcpu e2 machine with 32 CPUs. 694 MachineType string `json:"machineType,omitempty"` 695 696 // Pool: Optional. Specification for execution on a `WorkerPool`. See 697 // running builds in a private pool 698 // (https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) 699 // for more information. 700 Pool *PoolOption `json:"pool,omitempty"` 701 702 // RequestedVerifyOption: Requested verifiability options. 703 // 704 // Possible values: 705 // "NOT_VERIFIED" - Not a verifiable build. (default) 706 // "VERIFIED" - Verified build. 707 RequestedVerifyOption string `json:"requestedVerifyOption,omitempty"` 708 709 // SecretEnv: A list of global environment variables, which are 710 // encrypted using a Cloud Key Management Service crypto key. These 711 // values must be specified in the build's `Secret`. These variables 712 // will be available to all build steps in this build. 713 SecretEnv []string `json:"secretEnv,omitempty"` 714 715 // SourceProvenanceHash: Requested hash for SourceProvenance. 716 // 717 // Possible values: 718 // "NONE" - No hash requested. 719 // "SHA256" - Use a sha256 hash. 720 // "MD5" - Use a md5 hash. 721 SourceProvenanceHash []string `json:"sourceProvenanceHash,omitempty"` 722 723 // SubstitutionOption: Option to specify behavior when there is an error 724 // in the substitution checks. NOTE: this is always set to ALLOW_LOOSE 725 // for triggered builds and cannot be overridden in the build 726 // configuration file. 727 // 728 // Possible values: 729 // "MUST_MATCH" - Fails the build if error in substitutions checks, 730 // like missing a substitution in the template or in the map. 731 // "ALLOW_LOOSE" - Do not fail the build if error in substitutions 732 // checks. 733 SubstitutionOption string `json:"substitutionOption,omitempty"` 734 735 // Volumes: Global list of volumes to mount for ALL build steps Each 736 // volume is created as an empty volume prior to starting the build 737 // process. Upon completion of the build, volumes and their contents are 738 // discarded. Global volume names and paths cannot conflict with the 739 // volumes defined a build step. Using a global volume in a build with 740 // only one step is not valid as it is indicative of a build request 741 // with an incorrect configuration. 742 Volumes []*Volume `json:"volumes,omitempty"` 743 744 // WorkerPool: This field deprecated; please use `pool.name` instead. 745 WorkerPool string `json:"workerPool,omitempty"` 746 747 // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to 748 // unconditionally include in API requests. By default, fields with 749 // empty or default values are omitted from API requests. However, any 750 // non-pointer, non-interface field appearing in ForceSendFields will be 751 // sent to the server regardless of whether the field is empty or not. 752 // This may be used to include empty fields in Patch requests. 753 ForceSendFields []string `json:"-"` 754 755 // NullFields is a list of field names (e.g. "DiskSizeGb") to include in 756 // API requests with the JSON null value. By default, fields with empty 757 // values are omitted from API requests. However, any field with an 758 // empty value appearing in NullFields will be sent to the server as 759 // null. It is an error if a field in this list has a non-empty value. 760 // This may be used to include null fields in Patch requests. 761 NullFields []string `json:"-"` 762} 763 764func (s *BuildOptions) MarshalJSON() ([]byte, error) { 765 type NoMethod BuildOptions 766 raw := NoMethod(*s) 767 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 768} 769 770// BuildStep: A step in the build pipeline. 771type BuildStep struct { 772 // Args: A list of arguments that will be presented to the step when it 773 // is started. If the image used to run the step's container has an 774 // entrypoint, the `args` are used as arguments to that entrypoint. If 775 // the image does not define an entrypoint, the first element in args is 776 // used as the entrypoint, and the remainder will be used as arguments. 777 Args []string `json:"args,omitempty"` 778 779 // Dir: Working directory to use when running this step's container. If 780 // this value is a relative path, it is relative to the build's working 781 // directory. If this value is absolute, it may be outside the build's 782 // working directory, in which case the contents of the path may not be 783 // persisted across build step executions, unless a `volume` for that 784 // path is specified. If the build specifies a `RepoSource` with `dir` 785 // and a step with a `dir`, which specifies an absolute path, the 786 // `RepoSource` `dir` is ignored for the step's execution. 787 Dir string `json:"dir,omitempty"` 788 789 // Entrypoint: Entrypoint to be used instead of the build step image's 790 // default entrypoint. If unset, the image's default entrypoint is used. 791 Entrypoint string `json:"entrypoint,omitempty"` 792 793 // Env: A list of environment variable definitions to be used when 794 // running a step. The elements are of the form "KEY=VALUE" for the 795 // environment variable "KEY" being given the value "VALUE". 796 Env []string `json:"env,omitempty"` 797 798 // Id: Unique identifier for this build step, used in `wait_for` to 799 // reference this build step as a dependency. 800 Id string `json:"id,omitempty"` 801 802 // Name: Required. The name of the container image that will run this 803 // particular build step. If the image is available in the host's Docker 804 // daemon's cache, it will be run directly. If not, the host will 805 // attempt to pull the image first, using the builder service account's 806 // credentials if necessary. The Docker daemon's cache will already have 807 // the latest versions of all of the officially supported build steps 808 // (https://github.com/GoogleCloudPlatform/cloud-builders 809 // (https://github.com/GoogleCloudPlatform/cloud-builders)). The Docker 810 // daemon will also have cached many of the layers for some popular 811 // images, like "ubuntu", "debian", but they will be refreshed at the 812 // time you attempt to use them. If you built an image in a previous 813 // build step, it will be stored in the host's Docker daemon's cache and 814 // is available to use as the name for a later build step. 815 Name string `json:"name,omitempty"` 816 817 // PullTiming: Output only. Stores timing information for pulling this 818 // build step's builder image only. 819 PullTiming *TimeSpan `json:"pullTiming,omitempty"` 820 821 // Script: A shell script to be executed in the step. When script is 822 // provided, the user cannot specify the entrypoint or args. 823 Script string `json:"script,omitempty"` 824 825 // SecretEnv: A list of environment variables which are encrypted using 826 // a Cloud Key Management Service crypto key. These values must be 827 // specified in the build's `Secret`. 828 SecretEnv []string `json:"secretEnv,omitempty"` 829 830 // Status: Output only. Status of the build step. At this time, build 831 // step status is only updated on build completion; step status is not 832 // updated in real-time as the build progresses. 833 // 834 // Possible values: 835 // "STATUS_UNKNOWN" - Status of the build is unknown. 836 // "PENDING" - Build has been created and is pending execution and 837 // queuing. It has not been queued. 838 // "QUEUED" - Build or step is queued; work has not yet begun. 839 // "WORKING" - Build or step is being executed. 840 // "SUCCESS" - Build or step finished successfully. 841 // "FAILURE" - Build or step failed to complete successfully. 842 // "INTERNAL_ERROR" - Build or step failed due to an internal cause. 843 // "TIMEOUT" - Build or step took longer than was allowed. 844 // "CANCELLED" - Build or step was canceled by a user. 845 // "EXPIRED" - Build was enqueued for longer than the value of 846 // `queue_ttl`. 847 Status string `json:"status,omitempty"` 848 849 // Timeout: Time limit for executing this build step. If not defined, 850 // the step has no time limit and will be allowed to continue to run 851 // until either it completes or the build itself times out. 852 Timeout string `json:"timeout,omitempty"` 853 854 // Timing: Output only. Stores timing information for executing this 855 // build step. 856 Timing *TimeSpan `json:"timing,omitempty"` 857 858 // Volumes: List of volumes to mount into the build step. Each volume is 859 // created as an empty volume prior to execution of the build step. Upon 860 // completion of the build, volumes and their contents are discarded. 861 // Using a named volume in only one step is not valid as it is 862 // indicative of a build request with an incorrect configuration. 863 Volumes []*Volume `json:"volumes,omitempty"` 864 865 // WaitFor: The ID(s) of the step(s) that this build step depends on. 866 // This build step will not start until all the build steps in 867 // `wait_for` have completed successfully. If `wait_for` is empty, this 868 // build step will start when all previous build steps in the 869 // `Build.Steps` list have completed successfully. 870 WaitFor []string `json:"waitFor,omitempty"` 871 872 // ForceSendFields is a list of field names (e.g. "Args") to 873 // unconditionally include in API requests. By default, fields with 874 // empty or default values are omitted from API requests. However, any 875 // non-pointer, non-interface field appearing in ForceSendFields will be 876 // sent to the server regardless of whether the field is empty or not. 877 // This may be used to include empty fields in Patch requests. 878 ForceSendFields []string `json:"-"` 879 880 // NullFields is a list of field names (e.g. "Args") to include in API 881 // requests with the JSON null value. By default, fields with empty 882 // values are omitted from API requests. However, any field with an 883 // empty value appearing in NullFields will be sent to the server as 884 // null. It is an error if a field in this list has a non-empty value. 885 // This may be used to include null fields in Patch requests. 886 NullFields []string `json:"-"` 887} 888 889func (s *BuildStep) MarshalJSON() ([]byte, error) { 890 type NoMethod BuildStep 891 raw := NoMethod(*s) 892 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 893} 894 895// BuiltImage: An image built by the pipeline. 896type BuiltImage struct { 897 // Digest: Docker Registry 2.0 digest. 898 Digest string `json:"digest,omitempty"` 899 900 // Name: Name used to push the container image to Google Container 901 // Registry, as presented to `docker push`. 902 Name string `json:"name,omitempty"` 903 904 // PushTiming: Output only. Stores timing information for pushing the 905 // specified image. 906 PushTiming *TimeSpan `json:"pushTiming,omitempty"` 907 908 // ForceSendFields is a list of field names (e.g. "Digest") to 909 // unconditionally include in API requests. By default, fields with 910 // empty or default values are omitted from API requests. However, any 911 // non-pointer, non-interface field appearing in ForceSendFields will be 912 // sent to the server regardless of whether the field is empty or not. 913 // This may be used to include empty fields in Patch requests. 914 ForceSendFields []string `json:"-"` 915 916 // NullFields is a list of field names (e.g. "Digest") to include in API 917 // requests with the JSON null value. By default, fields with empty 918 // values are omitted from API requests. However, any field with an 919 // empty value appearing in NullFields will be sent to the server as 920 // null. It is an error if a field in this list has a non-empty value. 921 // This may be used to include null fields in Patch requests. 922 NullFields []string `json:"-"` 923} 924 925func (s *BuiltImage) MarshalJSON() ([]byte, error) { 926 type NoMethod BuiltImage 927 raw := NoMethod(*s) 928 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 929} 930 931// CancelOperationRequest: The request message for 932// Operations.CancelOperation. 933type CancelOperationRequest struct { 934} 935 936// CreateGitHubEnterpriseConfigOperationMetadata: Metadata for 937// `CreateGithubEnterpriseConfig` operation. 938type CreateGitHubEnterpriseConfigOperationMetadata struct { 939 // CompleteTime: Time the operation was completed. 940 CompleteTime string `json:"completeTime,omitempty"` 941 942 // CreateTime: Time the operation was created. 943 CreateTime string `json:"createTime,omitempty"` 944 945 // GithubEnterpriseConfig: The resource name of the GitHubEnterprise to 946 // be created. Format: 947 // `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}` 948 // . 949 GithubEnterpriseConfig string `json:"githubEnterpriseConfig,omitempty"` 950 951 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 952 // unconditionally include in API requests. By default, fields with 953 // empty or default values are omitted from API requests. However, any 954 // non-pointer, non-interface field appearing in ForceSendFields will be 955 // sent to the server regardless of whether the field is empty or not. 956 // This may be used to include empty fields in Patch requests. 957 ForceSendFields []string `json:"-"` 958 959 // NullFields is a list of field names (e.g. "CompleteTime") to include 960 // in API requests with the JSON null value. By default, fields with 961 // empty values are omitted from API requests. However, any field with 962 // an empty value appearing in NullFields will be sent to the server as 963 // null. It is an error if a field in this list has a non-empty value. 964 // This may be used to include null fields in Patch requests. 965 NullFields []string `json:"-"` 966} 967 968func (s *CreateGitHubEnterpriseConfigOperationMetadata) MarshalJSON() ([]byte, error) { 969 type NoMethod CreateGitHubEnterpriseConfigOperationMetadata 970 raw := NoMethod(*s) 971 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 972} 973 974// CreateWorkerPoolOperationMetadata: Metadata for the 975// `CreateWorkerPool` operation. 976type CreateWorkerPoolOperationMetadata struct { 977 // CompleteTime: Time the operation was completed. 978 CompleteTime string `json:"completeTime,omitempty"` 979 980 // CreateTime: Time the operation was created. 981 CreateTime string `json:"createTime,omitempty"` 982 983 // WorkerPool: The resource name of the `WorkerPool` to create. Format: 984 // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. 985 WorkerPool string `json:"workerPool,omitempty"` 986 987 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 988 // unconditionally include in API requests. By default, fields with 989 // empty or default values are omitted from API requests. However, any 990 // non-pointer, non-interface field appearing in ForceSendFields will be 991 // sent to the server regardless of whether the field is empty or not. 992 // This may be used to include empty fields in Patch requests. 993 ForceSendFields []string `json:"-"` 994 995 // NullFields is a list of field names (e.g. "CompleteTime") to include 996 // in API requests with the JSON null value. By default, fields with 997 // empty values are omitted from API requests. However, any field with 998 // an empty value appearing in NullFields will be sent to the server as 999 // null. It is an error if a field in this list has a non-empty value. 1000 // This may be used to include null fields in Patch requests. 1001 NullFields []string `json:"-"` 1002} 1003 1004func (s *CreateWorkerPoolOperationMetadata) MarshalJSON() ([]byte, error) { 1005 type NoMethod CreateWorkerPoolOperationMetadata 1006 raw := NoMethod(*s) 1007 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1008} 1009 1010// DeleteGitHubEnterpriseConfigOperationMetadata: Metadata for 1011// `DeleteGitHubEnterpriseConfig` operation. 1012type DeleteGitHubEnterpriseConfigOperationMetadata struct { 1013 // CompleteTime: Time the operation was completed. 1014 CompleteTime string `json:"completeTime,omitempty"` 1015 1016 // CreateTime: Time the operation was created. 1017 CreateTime string `json:"createTime,omitempty"` 1018 1019 // GithubEnterpriseConfig: The resource name of the GitHubEnterprise to 1020 // be deleted. Format: 1021 // `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}` 1022 // . 1023 GithubEnterpriseConfig string `json:"githubEnterpriseConfig,omitempty"` 1024 1025 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 1026 // unconditionally include in API requests. By default, fields with 1027 // empty or default values are omitted from API requests. However, any 1028 // non-pointer, non-interface field appearing in ForceSendFields will be 1029 // sent to the server regardless of whether the field is empty or not. 1030 // This may be used to include empty fields in Patch requests. 1031 ForceSendFields []string `json:"-"` 1032 1033 // NullFields is a list of field names (e.g. "CompleteTime") to include 1034 // in API requests with the JSON null value. By default, fields with 1035 // empty values are omitted from API requests. However, any field with 1036 // an empty value appearing in NullFields will be sent to the server as 1037 // null. It is an error if a field in this list has a non-empty value. 1038 // This may be used to include null fields in Patch requests. 1039 NullFields []string `json:"-"` 1040} 1041 1042func (s *DeleteGitHubEnterpriseConfigOperationMetadata) MarshalJSON() ([]byte, error) { 1043 type NoMethod DeleteGitHubEnterpriseConfigOperationMetadata 1044 raw := NoMethod(*s) 1045 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1046} 1047 1048// DeleteWorkerPoolOperationMetadata: Metadata for the 1049// `DeleteWorkerPool` operation. 1050type DeleteWorkerPoolOperationMetadata struct { 1051 // CompleteTime: Time the operation was completed. 1052 CompleteTime string `json:"completeTime,omitempty"` 1053 1054 // CreateTime: Time the operation was created. 1055 CreateTime string `json:"createTime,omitempty"` 1056 1057 // WorkerPool: The resource name of the `WorkerPool` being deleted. 1058 // Format: 1059 // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. 1060 WorkerPool string `json:"workerPool,omitempty"` 1061 1062 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 1063 // unconditionally include in API requests. By default, fields with 1064 // empty or default values are omitted from API requests. However, any 1065 // non-pointer, non-interface field appearing in ForceSendFields will be 1066 // sent to the server regardless of whether the field is empty or not. 1067 // This may be used to include empty fields in Patch requests. 1068 ForceSendFields []string `json:"-"` 1069 1070 // NullFields is a list of field names (e.g. "CompleteTime") to include 1071 // in API requests with the JSON null value. By default, fields with 1072 // empty values are omitted from API requests. However, any field with 1073 // an empty value appearing in NullFields will be sent to the server as 1074 // null. It is an error if a field in this list has a non-empty value. 1075 // This may be used to include null fields in Patch requests. 1076 NullFields []string `json:"-"` 1077} 1078 1079func (s *DeleteWorkerPoolOperationMetadata) MarshalJSON() ([]byte, error) { 1080 type NoMethod DeleteWorkerPoolOperationMetadata 1081 raw := NoMethod(*s) 1082 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1083} 1084 1085// Empty: A generic empty message that you can re-use to avoid defining 1086// duplicated empty messages in your APIs. A typical example is to use 1087// it as the request or the response type of an API method. For 1088// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 1089// (google.protobuf.Empty); } The JSON representation for `Empty` is 1090// empty JSON object `{}`. 1091type Empty struct { 1092 // ServerResponse contains the HTTP response code and headers from the 1093 // server. 1094 googleapi.ServerResponse `json:"-"` 1095} 1096 1097// FailureInfo: A fatal problem encountered during the execution of the 1098// build. 1099type FailureInfo struct { 1100 // Detail: Explains the failure issue in more detail using hard-coded 1101 // text. 1102 Detail string `json:"detail,omitempty"` 1103 1104 // Type: The name of the failure. 1105 // 1106 // Possible values: 1107 // "FAILURE_TYPE_UNSPECIFIED" - Type unspecified 1108 // "PUSH_FAILED" - Unable to push the image to the repository. 1109 // "PUSH_IMAGE_NOT_FOUND" - Final image not found. 1110 // "PUSH_NOT_AUTHORIZED" - Unauthorized push of the final image. 1111 // "LOGGING_FAILURE" - Backend logging failures. Should retry. 1112 // "USER_BUILD_STEP" - A build step has failed. 1113 // "FETCH_SOURCE_FAILED" - The source fetching has failed. 1114 Type string `json:"type,omitempty"` 1115 1116 // ForceSendFields is a list of field names (e.g. "Detail") to 1117 // unconditionally include in API requests. By default, fields with 1118 // empty or default values are omitted from API requests. However, any 1119 // non-pointer, non-interface field appearing in ForceSendFields will be 1120 // sent to the server regardless of whether the field is empty or not. 1121 // This may be used to include empty fields in Patch requests. 1122 ForceSendFields []string `json:"-"` 1123 1124 // NullFields is a list of field names (e.g. "Detail") to include in API 1125 // requests with the JSON null value. By default, fields with empty 1126 // values are omitted from API requests. However, any field with an 1127 // empty value appearing in NullFields will be sent to the server as 1128 // null. It is an error if a field in this list has a non-empty value. 1129 // This may be used to include null fields in Patch requests. 1130 NullFields []string `json:"-"` 1131} 1132 1133func (s *FailureInfo) MarshalJSON() ([]byte, error) { 1134 type NoMethod FailureInfo 1135 raw := NoMethod(*s) 1136 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1137} 1138 1139// FileHashes: Container message for hashes of byte content of files, 1140// used in SourceProvenance messages to verify integrity of source input 1141// to the build. 1142type FileHashes struct { 1143 // FileHash: Collection of file hashes. 1144 FileHash []*Hash `json:"fileHash,omitempty"` 1145 1146 // ForceSendFields is a list of field names (e.g. "FileHash") to 1147 // unconditionally include in API requests. By default, fields with 1148 // empty or default values are omitted from API requests. However, any 1149 // non-pointer, non-interface field appearing in ForceSendFields will be 1150 // sent to the server regardless of whether the field is empty or not. 1151 // This may be used to include empty fields in Patch requests. 1152 ForceSendFields []string `json:"-"` 1153 1154 // NullFields is a list of field names (e.g. "FileHash") to include in 1155 // API requests with the JSON null value. By default, fields with empty 1156 // values are omitted from API requests. However, any field with an 1157 // empty value appearing in NullFields will be sent to the server as 1158 // null. It is an error if a field in this list has a non-empty value. 1159 // This may be used to include null fields in Patch requests. 1160 NullFields []string `json:"-"` 1161} 1162 1163func (s *FileHashes) MarshalJSON() ([]byte, error) { 1164 type NoMethod FileHashes 1165 raw := NoMethod(*s) 1166 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1167} 1168 1169// GoogleDevtoolsCloudbuildV2OperationMetadata: Represents the metadata 1170// of the long-running operation. 1171type GoogleDevtoolsCloudbuildV2OperationMetadata struct { 1172 // ApiVersion: Output only. API version used to start the operation. 1173 ApiVersion string `json:"apiVersion,omitempty"` 1174 1175 // CreateTime: Output only. The time the operation was created. 1176 CreateTime string `json:"createTime,omitempty"` 1177 1178 // EndTime: Output only. The time the operation finished running. 1179 EndTime string `json:"endTime,omitempty"` 1180 1181 // RequestedCancellation: Output only. Identifies whether the user has 1182 // requested cancellation of the operation. Operations that have 1183 // successfully been cancelled have Operation.error value with a 1184 // google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. 1185 RequestedCancellation bool `json:"requestedCancellation,omitempty"` 1186 1187 // StatusMessage: Output only. Human-readable status of the operation, 1188 // if any. 1189 StatusMessage string `json:"statusMessage,omitempty"` 1190 1191 // Target: Output only. Server-defined resource path for the target of 1192 // the operation. 1193 Target string `json:"target,omitempty"` 1194 1195 // Verb: Output only. Name of the verb executed by the operation. 1196 Verb string `json:"verb,omitempty"` 1197 1198 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1199 // unconditionally include in API requests. By default, fields with 1200 // empty or default values are omitted from API requests. However, any 1201 // non-pointer, non-interface field appearing in ForceSendFields will be 1202 // sent to the server regardless of whether the field is empty or not. 1203 // This may be used to include empty fields in Patch requests. 1204 ForceSendFields []string `json:"-"` 1205 1206 // NullFields is a list of field names (e.g. "ApiVersion") to include in 1207 // API requests with the JSON null value. By default, fields with empty 1208 // values are omitted from API requests. However, any field with an 1209 // empty value appearing in NullFields will be sent to the server as 1210 // null. It is an error if a field in this list has a non-empty value. 1211 // This may be used to include null fields in Patch requests. 1212 NullFields []string `json:"-"` 1213} 1214 1215func (s *GoogleDevtoolsCloudbuildV2OperationMetadata) MarshalJSON() ([]byte, error) { 1216 type NoMethod GoogleDevtoolsCloudbuildV2OperationMetadata 1217 raw := NoMethod(*s) 1218 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1219} 1220 1221// HTTPDelivery: HTTPDelivery is the delivery configuration for an HTTP 1222// notification. 1223type HTTPDelivery struct { 1224 // Uri: The URI to which JSON-containing HTTP POST requests should be 1225 // sent. 1226 Uri string `json:"uri,omitempty"` 1227 1228 // ForceSendFields is a list of field names (e.g. "Uri") to 1229 // unconditionally include in API requests. By default, fields with 1230 // empty or default values are omitted from API requests. However, any 1231 // non-pointer, non-interface field appearing in ForceSendFields will be 1232 // sent to the server regardless of whether the field is empty or not. 1233 // This may be used to include empty fields in Patch requests. 1234 ForceSendFields []string `json:"-"` 1235 1236 // NullFields is a list of field names (e.g. "Uri") to include in API 1237 // requests with the JSON null value. By default, fields with empty 1238 // values are omitted from API requests. However, any field with an 1239 // empty value appearing in NullFields will be sent to the server as 1240 // null. It is an error if a field in this list has a non-empty value. 1241 // This may be used to include null fields in Patch requests. 1242 NullFields []string `json:"-"` 1243} 1244 1245func (s *HTTPDelivery) MarshalJSON() ([]byte, error) { 1246 type NoMethod HTTPDelivery 1247 raw := NoMethod(*s) 1248 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1249} 1250 1251// Hash: Container message for hash values. 1252type Hash struct { 1253 // Type: The type of hash that was performed. 1254 // 1255 // Possible values: 1256 // "NONE" - No hash requested. 1257 // "SHA256" - Use a sha256 hash. 1258 // "MD5" - Use a md5 hash. 1259 Type string `json:"type,omitempty"` 1260 1261 // Value: The hash value. 1262 Value string `json:"value,omitempty"` 1263 1264 // ForceSendFields is a list of field names (e.g. "Type") to 1265 // unconditionally include in API requests. By default, fields with 1266 // empty or default values are omitted from API requests. However, any 1267 // non-pointer, non-interface field appearing in ForceSendFields will be 1268 // sent to the server regardless of whether the field is empty or not. 1269 // This may be used to include empty fields in Patch requests. 1270 ForceSendFields []string `json:"-"` 1271 1272 // NullFields is a list of field names (e.g. "Type") to include in API 1273 // requests with the JSON null value. By default, fields with empty 1274 // values are omitted from API requests. However, any field with an 1275 // empty value appearing in NullFields will be sent to the server as 1276 // null. It is an error if a field in this list has a non-empty value. 1277 // This may be used to include null fields in Patch requests. 1278 NullFields []string `json:"-"` 1279} 1280 1281func (s *Hash) MarshalJSON() ([]byte, error) { 1282 type NoMethod Hash 1283 raw := NoMethod(*s) 1284 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1285} 1286 1287// InlineSecret: Pairs a set of secret environment variables mapped to 1288// encrypted values with the Cloud KMS key to use to decrypt the value. 1289type InlineSecret struct { 1290 // EnvMap: Map of environment variable name to its encrypted value. 1291 // Secret environment variables must be unique across all of a build's 1292 // secrets, and must be used by at least one build step. Values can be 1293 // at most 64 KB in size. There can be at most 100 secret values across 1294 // all of a build's secrets. 1295 EnvMap map[string]string `json:"envMap,omitempty"` 1296 1297 // KmsKeyName: Resource name of Cloud KMS crypto key to decrypt the 1298 // encrypted value. In format: 1299 // projects/*/locations/*/keyRings/*/cryptoKeys/* 1300 KmsKeyName string `json:"kmsKeyName,omitempty"` 1301 1302 // ForceSendFields is a list of field names (e.g. "EnvMap") to 1303 // unconditionally include in API requests. By default, fields with 1304 // empty or default values are omitted from API requests. However, any 1305 // non-pointer, non-interface field appearing in ForceSendFields will be 1306 // sent to the server regardless of whether the field is empty or not. 1307 // This may be used to include empty fields in Patch requests. 1308 ForceSendFields []string `json:"-"` 1309 1310 // NullFields is a list of field names (e.g. "EnvMap") to include in API 1311 // requests with the JSON null value. By default, fields with empty 1312 // values are omitted from API requests. However, any field with an 1313 // empty value appearing in NullFields will be sent to the server as 1314 // null. It is an error if a field in this list has a non-empty value. 1315 // This may be used to include null fields in Patch requests. 1316 NullFields []string `json:"-"` 1317} 1318 1319func (s *InlineSecret) MarshalJSON() ([]byte, error) { 1320 type NoMethod InlineSecret 1321 raw := NoMethod(*s) 1322 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1323} 1324 1325// ListWorkerPoolsResponse: Response containing existing `WorkerPools`. 1326type ListWorkerPoolsResponse struct { 1327 // WorkerPools: `WorkerPools` for the project. 1328 WorkerPools []*WorkerPool `json:"workerPools,omitempty"` 1329 1330 // ServerResponse contains the HTTP response code and headers from the 1331 // server. 1332 googleapi.ServerResponse `json:"-"` 1333 1334 // ForceSendFields is a list of field names (e.g. "WorkerPools") to 1335 // unconditionally include in API requests. By default, fields with 1336 // empty or default values are omitted from API requests. However, any 1337 // non-pointer, non-interface field appearing in ForceSendFields will be 1338 // sent to the server regardless of whether the field is empty or not. 1339 // This may be used to include empty fields in Patch requests. 1340 ForceSendFields []string `json:"-"` 1341 1342 // NullFields is a list of field names (e.g. "WorkerPools") to include 1343 // in API requests with the JSON null value. By default, fields with 1344 // empty values are omitted from API requests. However, any field with 1345 // an empty value appearing in NullFields will be sent to the server as 1346 // null. It is an error if a field in this list has a non-empty value. 1347 // This may be used to include null fields in Patch requests. 1348 NullFields []string `json:"-"` 1349} 1350 1351func (s *ListWorkerPoolsResponse) MarshalJSON() ([]byte, error) { 1352 type NoMethod ListWorkerPoolsResponse 1353 raw := NoMethod(*s) 1354 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1355} 1356 1357// Network: Network describes the GCP network used to create workers in. 1358type Network struct { 1359 // Network: Network on which the workers are created. "default" network 1360 // is used if empty. 1361 Network string `json:"network,omitempty"` 1362 1363 // ProjectId: Project id containing the defined network and subnetwork. 1364 // For a peered VPC, this will be the same as the project_id in which 1365 // the workers are created. For a shared VPC, this will be the project 1366 // sharing the network with the project_id project in which workers will 1367 // be created. For custom workers with no VPC, this will be the same as 1368 // project_id. 1369 ProjectId string `json:"projectId,omitempty"` 1370 1371 // Subnetwork: Subnetwork on which the workers are created. "default" 1372 // subnetwork is used if empty. 1373 Subnetwork string `json:"subnetwork,omitempty"` 1374 1375 // ForceSendFields is a list of field names (e.g. "Network") to 1376 // unconditionally include in API requests. By default, fields with 1377 // empty or default values are omitted from API requests. However, any 1378 // non-pointer, non-interface field appearing in ForceSendFields will be 1379 // sent to the server regardless of whether the field is empty or not. 1380 // This may be used to include empty fields in Patch requests. 1381 ForceSendFields []string `json:"-"` 1382 1383 // NullFields is a list of field names (e.g. "Network") to include in 1384 // API requests with the JSON null value. By default, fields with empty 1385 // values are omitted from API requests. However, any field with an 1386 // empty value appearing in NullFields will be sent to the server as 1387 // null. It is an error if a field in this list has a non-empty value. 1388 // This may be used to include null fields in Patch requests. 1389 NullFields []string `json:"-"` 1390} 1391 1392func (s *Network) MarshalJSON() ([]byte, error) { 1393 type NoMethod Network 1394 raw := NoMethod(*s) 1395 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1396} 1397 1398// Notification: Notification is the container which holds the data that 1399// is relevant to this particular notification. 1400type Notification struct { 1401 // Filter: The filter string to use for notification filtering. 1402 // Currently, this is assumed to be a CEL program. See 1403 // https://opensource.google/projects/cel for more. 1404 Filter string `json:"filter,omitempty"` 1405 1406 // HttpDelivery: Configuration for HTTP delivery. 1407 HttpDelivery *HTTPDelivery `json:"httpDelivery,omitempty"` 1408 1409 // SlackDelivery: Configuration for Slack delivery. 1410 SlackDelivery *SlackDelivery `json:"slackDelivery,omitempty"` 1411 1412 // SmtpDelivery: Configuration for SMTP (email) delivery. 1413 SmtpDelivery *SMTPDelivery `json:"smtpDelivery,omitempty"` 1414 1415 // StructDelivery: Escape hatch for users to supply custom delivery 1416 // configs. 1417 StructDelivery googleapi.RawMessage `json:"structDelivery,omitempty"` 1418 1419 // ForceSendFields is a list of field names (e.g. "Filter") to 1420 // unconditionally include in API requests. By default, fields with 1421 // empty or default values are omitted from API requests. However, any 1422 // non-pointer, non-interface field appearing in ForceSendFields will be 1423 // sent to the server regardless of whether the field is empty or not. 1424 // This may be used to include empty fields in Patch requests. 1425 ForceSendFields []string `json:"-"` 1426 1427 // NullFields is a list of field names (e.g. "Filter") to include in API 1428 // requests with the JSON null value. By default, fields with empty 1429 // values are omitted from API requests. However, any field with an 1430 // empty value appearing in NullFields will be sent to the server as 1431 // null. It is an error if a field in this list has a non-empty value. 1432 // This may be used to include null fields in Patch requests. 1433 NullFields []string `json:"-"` 1434} 1435 1436func (s *Notification) MarshalJSON() ([]byte, error) { 1437 type NoMethod Notification 1438 raw := NoMethod(*s) 1439 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1440} 1441 1442// NotifierConfig: NotifierConfig is the top-level configuration 1443// message. 1444type NotifierConfig struct { 1445 // ApiVersion: The API version of this configuration format. 1446 ApiVersion string `json:"apiVersion,omitempty"` 1447 1448 // Kind: The type of notifier to use (e.g. SMTPNotifier). 1449 Kind string `json:"kind,omitempty"` 1450 1451 // Metadata: Metadata for referring to/handling/deploying this notifier. 1452 Metadata *NotifierMetadata `json:"metadata,omitempty"` 1453 1454 // Spec: The actual configuration for this notifier. 1455 Spec *NotifierSpec `json:"spec,omitempty"` 1456 1457 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1458 // unconditionally include in API requests. By default, fields with 1459 // empty or default values are omitted from API requests. However, any 1460 // non-pointer, non-interface field appearing in ForceSendFields will be 1461 // sent to the server regardless of whether the field is empty or not. 1462 // This may be used to include empty fields in Patch requests. 1463 ForceSendFields []string `json:"-"` 1464 1465 // NullFields is a list of field names (e.g. "ApiVersion") to include in 1466 // API requests with the JSON null value. By default, fields with empty 1467 // values are omitted from API requests. However, any field with an 1468 // empty value appearing in NullFields will be sent to the server as 1469 // null. It is an error if a field in this list has a non-empty value. 1470 // This may be used to include null fields in Patch requests. 1471 NullFields []string `json:"-"` 1472} 1473 1474func (s *NotifierConfig) MarshalJSON() ([]byte, error) { 1475 type NoMethod NotifierConfig 1476 raw := NoMethod(*s) 1477 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1478} 1479 1480// NotifierMetadata: NotifierMetadata contains the data which can be 1481// used to reference or describe this notifier. 1482type NotifierMetadata struct { 1483 // Name: The human-readable and user-given name for the notifier. For 1484 // example: "repo-merge-email-notifier". 1485 Name string `json:"name,omitempty"` 1486 1487 // Notifier: The string representing the name and version of notifier to 1488 // deploy. Expected to be of the form of "/:". For example: 1489 // "gcr.io/my-project/notifiers/smtp:1.2.34". 1490 Notifier string `json:"notifier,omitempty"` 1491 1492 // ForceSendFields is a list of field names (e.g. "Name") to 1493 // unconditionally include in API requests. By default, fields with 1494 // empty or default values are omitted from API requests. However, any 1495 // non-pointer, non-interface field appearing in ForceSendFields will be 1496 // sent to the server regardless of whether the field is empty or not. 1497 // This may be used to include empty fields in Patch requests. 1498 ForceSendFields []string `json:"-"` 1499 1500 // NullFields is a list of field names (e.g. "Name") to include in API 1501 // requests with the JSON null value. By default, fields with empty 1502 // values are omitted from API requests. However, any field with an 1503 // empty value appearing in NullFields will be sent to the server as 1504 // null. It is an error if a field in this list has a non-empty value. 1505 // This may be used to include null fields in Patch requests. 1506 NullFields []string `json:"-"` 1507} 1508 1509func (s *NotifierMetadata) MarshalJSON() ([]byte, error) { 1510 type NoMethod NotifierMetadata 1511 raw := NoMethod(*s) 1512 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1513} 1514 1515// NotifierSecret: NotifierSecret is the container that maps a secret 1516// name (reference) to its Google Cloud Secret Manager resource path. 1517type NotifierSecret struct { 1518 // Name: Name is the local name of the secret, such as the verbatim 1519 // string "my-smtp-password". 1520 Name string `json:"name,omitempty"` 1521 1522 // Value: Value is interpreted to be a resource path for fetching the 1523 // actual (versioned) secret data for this secret. For example, this 1524 // would be a Google Cloud Secret Manager secret version resource path 1525 // like: "projects/my-project/secrets/my-secret/versions/latest". 1526 Value string `json:"value,omitempty"` 1527 1528 // ForceSendFields is a list of field names (e.g. "Name") to 1529 // unconditionally include in API requests. By default, fields with 1530 // empty or default values are omitted from API requests. However, any 1531 // non-pointer, non-interface field appearing in ForceSendFields will be 1532 // sent to the server regardless of whether the field is empty or not. 1533 // This may be used to include empty fields in Patch requests. 1534 ForceSendFields []string `json:"-"` 1535 1536 // NullFields is a list of field names (e.g. "Name") to include in API 1537 // requests with the JSON null value. By default, fields with empty 1538 // values are omitted from API requests. However, any field with an 1539 // empty value appearing in NullFields will be sent to the server as 1540 // null. It is an error if a field in this list has a non-empty value. 1541 // This may be used to include null fields in Patch requests. 1542 NullFields []string `json:"-"` 1543} 1544 1545func (s *NotifierSecret) MarshalJSON() ([]byte, error) { 1546 type NoMethod NotifierSecret 1547 raw := NoMethod(*s) 1548 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1549} 1550 1551// NotifierSecretRef: NotifierSecretRef contains the reference to a 1552// secret stored in the corresponding NotifierSpec. 1553type NotifierSecretRef struct { 1554 // SecretRef: The value of `secret_ref` should be a `name` that is 1555 // registered in a `Secret` in the `secrets` list of the `Spec`. 1556 SecretRef string `json:"secretRef,omitempty"` 1557 1558 // ForceSendFields is a list of field names (e.g. "SecretRef") to 1559 // unconditionally include in API requests. By default, fields with 1560 // empty or default values are omitted from API requests. However, any 1561 // non-pointer, non-interface field appearing in ForceSendFields will be 1562 // sent to the server regardless of whether the field is empty or not. 1563 // This may be used to include empty fields in Patch requests. 1564 ForceSendFields []string `json:"-"` 1565 1566 // NullFields is a list of field names (e.g. "SecretRef") to include in 1567 // API requests with the JSON null value. By default, fields with empty 1568 // values are omitted from API requests. However, any field with an 1569 // empty value appearing in NullFields will be sent to the server as 1570 // null. It is an error if a field in this list has a non-empty value. 1571 // This may be used to include null fields in Patch requests. 1572 NullFields []string `json:"-"` 1573} 1574 1575func (s *NotifierSecretRef) MarshalJSON() ([]byte, error) { 1576 type NoMethod NotifierSecretRef 1577 raw := NoMethod(*s) 1578 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1579} 1580 1581// NotifierSpec: NotifierSpec is the configuration container for 1582// notifications. 1583type NotifierSpec struct { 1584 // Notification: The configuration of this particular notifier. 1585 Notification *Notification `json:"notification,omitempty"` 1586 1587 // Secrets: Configurations for secret resources used by this particular 1588 // notifier. 1589 Secrets []*NotifierSecret `json:"secrets,omitempty"` 1590 1591 // ForceSendFields is a list of field names (e.g. "Notification") to 1592 // unconditionally include in API requests. By default, fields with 1593 // empty or default values are omitted from API requests. However, any 1594 // non-pointer, non-interface field appearing in ForceSendFields will be 1595 // sent to the server regardless of whether the field is empty or not. 1596 // This may be used to include empty fields in Patch requests. 1597 ForceSendFields []string `json:"-"` 1598 1599 // NullFields is a list of field names (e.g. "Notification") to include 1600 // in API requests with the JSON null value. By default, fields with 1601 // empty values are omitted from API requests. However, any field with 1602 // an empty value appearing in NullFields will be sent to the server as 1603 // null. It is an error if a field in this list has a non-empty value. 1604 // This may be used to include null fields in Patch requests. 1605 NullFields []string `json:"-"` 1606} 1607 1608func (s *NotifierSpec) MarshalJSON() ([]byte, error) { 1609 type NoMethod NotifierSpec 1610 raw := NoMethod(*s) 1611 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1612} 1613 1614// Operation: This resource represents a long-running operation that is 1615// the result of a network API call. 1616type Operation struct { 1617 // Done: If the value is `false`, it means the operation is still in 1618 // progress. If `true`, the operation is completed, and either `error` 1619 // or `response` is available. 1620 Done bool `json:"done,omitempty"` 1621 1622 // Error: The error result of the operation in case of failure or 1623 // cancellation. 1624 Error *Status `json:"error,omitempty"` 1625 1626 // Metadata: Service-specific metadata associated with the operation. It 1627 // typically contains progress information and common metadata such as 1628 // create time. Some services might not provide such metadata. Any 1629 // method that returns a long-running operation should document the 1630 // metadata type, if any. 1631 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1632 1633 // Name: The server-assigned name, which is only unique within the same 1634 // service that originally returns it. If you use the default HTTP 1635 // mapping, the `name` should be a resource name ending with 1636 // `operations/{unique_id}`. 1637 Name string `json:"name,omitempty"` 1638 1639 // Response: The normal response of the operation in case of success. If 1640 // the original method returns no data on success, such as `Delete`, the 1641 // response is `google.protobuf.Empty`. If the original method is 1642 // standard `Get`/`Create`/`Update`, the response should be the 1643 // resource. For other methods, the response should have the type 1644 // `XxxResponse`, where `Xxx` is the original method name. For example, 1645 // if the original method name is `TakeSnapshot()`, the inferred 1646 // response type is `TakeSnapshotResponse`. 1647 Response googleapi.RawMessage `json:"response,omitempty"` 1648 1649 // ServerResponse contains the HTTP response code and headers from the 1650 // server. 1651 googleapi.ServerResponse `json:"-"` 1652 1653 // ForceSendFields is a list of field names (e.g. "Done") to 1654 // unconditionally include in API requests. By default, fields with 1655 // empty or default values are omitted from API requests. However, any 1656 // non-pointer, non-interface field appearing in ForceSendFields will be 1657 // sent to the server regardless of whether the field is empty or not. 1658 // This may be used to include empty fields in Patch requests. 1659 ForceSendFields []string `json:"-"` 1660 1661 // NullFields is a list of field names (e.g. "Done") to include in API 1662 // requests with the JSON null value. By default, fields with empty 1663 // values are omitted from API requests. However, any field with an 1664 // empty value appearing in NullFields will be sent to the server as 1665 // null. It is an error if a field in this list has a non-empty value. 1666 // This may be used to include null fields in Patch requests. 1667 NullFields []string `json:"-"` 1668} 1669 1670func (s *Operation) MarshalJSON() ([]byte, error) { 1671 type NoMethod Operation 1672 raw := NoMethod(*s) 1673 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1674} 1675 1676// OperationMetadata: Represents the metadata of the long-running 1677// operation. 1678type OperationMetadata struct { 1679 // ApiVersion: Output only. API version used to start the operation. 1680 ApiVersion string `json:"apiVersion,omitempty"` 1681 1682 // CancelRequested: Output only. Identifies whether the user has 1683 // requested cancellation of the operation. Operations that have been 1684 // cancelled successfully have Operation.error value with a 1685 // google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. 1686 CancelRequested bool `json:"cancelRequested,omitempty"` 1687 1688 // CreateTime: Output only. The time the operation was created. 1689 CreateTime string `json:"createTime,omitempty"` 1690 1691 // EndTime: Output only. The time the operation finished running. 1692 EndTime string `json:"endTime,omitempty"` 1693 1694 // StatusDetail: Output only. Human-readable status of the operation, if 1695 // any. 1696 StatusDetail string `json:"statusDetail,omitempty"` 1697 1698 // Target: Output only. Server-defined resource path for the target of 1699 // the operation. 1700 Target string `json:"target,omitempty"` 1701 1702 // Verb: Output only. Name of the verb executed by the operation. 1703 Verb string `json:"verb,omitempty"` 1704 1705 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1706 // unconditionally include in API requests. By default, fields with 1707 // empty or default values are omitted from API requests. However, any 1708 // non-pointer, non-interface field appearing in ForceSendFields will be 1709 // sent to the server regardless of whether the field is empty or not. 1710 // This may be used to include empty fields in Patch requests. 1711 ForceSendFields []string `json:"-"` 1712 1713 // NullFields is a list of field names (e.g. "ApiVersion") to include in 1714 // API requests with the JSON null value. By default, fields with empty 1715 // values are omitted from API requests. However, any field with an 1716 // empty value appearing in NullFields will be sent to the server as 1717 // null. It is an error if a field in this list has a non-empty value. 1718 // This may be used to include null fields in Patch requests. 1719 NullFields []string `json:"-"` 1720} 1721 1722func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 1723 type NoMethod OperationMetadata 1724 raw := NoMethod(*s) 1725 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1726} 1727 1728// PoolOption: Details about how a build should be executed on a 1729// `WorkerPool`. See running builds in a private pool 1730// (https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) 1731// for more information. 1732type PoolOption struct { 1733 // Name: The `WorkerPool` resource to execute the build on. You must 1734 // have `cloudbuild.workerpools.use` on the project hosting the 1735 // WorkerPool. Format 1736 // projects/{project}/locations/{location}/workerPools/{workerPoolId} 1737 Name string `json:"name,omitempty"` 1738 1739 // ForceSendFields is a list of field names (e.g. "Name") to 1740 // unconditionally include in API requests. By default, fields with 1741 // empty or default values are omitted from API requests. However, any 1742 // non-pointer, non-interface field appearing in ForceSendFields will be 1743 // sent to the server regardless of whether the field is empty or not. 1744 // This may be used to include empty fields in Patch requests. 1745 ForceSendFields []string `json:"-"` 1746 1747 // NullFields is a list of field names (e.g. "Name") to include in API 1748 // requests with the JSON null value. By default, fields with empty 1749 // values are omitted from API requests. However, any field with an 1750 // empty value appearing in NullFields will be sent to the server as 1751 // null. It is an error if a field in this list has a non-empty value. 1752 // This may be used to include null fields in Patch requests. 1753 NullFields []string `json:"-"` 1754} 1755 1756func (s *PoolOption) MarshalJSON() ([]byte, error) { 1757 type NoMethod PoolOption 1758 raw := NoMethod(*s) 1759 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1760} 1761 1762// ProcessAppManifestCallbackOperationMetadata: Metadata for 1763// `ProcessAppManifestCallback` operation. 1764type ProcessAppManifestCallbackOperationMetadata struct { 1765 // CompleteTime: Time the operation was completed. 1766 CompleteTime string `json:"completeTime,omitempty"` 1767 1768 // CreateTime: Time the operation was created. 1769 CreateTime string `json:"createTime,omitempty"` 1770 1771 // GithubEnterpriseConfig: The resource name of the GitHubEnterprise to 1772 // be created. Format: 1773 // `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}` 1774 // . 1775 GithubEnterpriseConfig string `json:"githubEnterpriseConfig,omitempty"` 1776 1777 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 1778 // unconditionally include in API requests. By default, fields with 1779 // empty or default values are omitted from API requests. However, any 1780 // non-pointer, non-interface field appearing in ForceSendFields will be 1781 // sent to the server regardless of whether the field is empty or not. 1782 // This may be used to include empty fields in Patch requests. 1783 ForceSendFields []string `json:"-"` 1784 1785 // NullFields is a list of field names (e.g. "CompleteTime") to include 1786 // in API requests with the JSON null value. By default, fields with 1787 // empty values are omitted from API requests. However, any field with 1788 // an empty value appearing in NullFields will be sent to the server as 1789 // null. It is an error if a field in this list has a non-empty value. 1790 // This may be used to include null fields in Patch requests. 1791 NullFields []string `json:"-"` 1792} 1793 1794func (s *ProcessAppManifestCallbackOperationMetadata) MarshalJSON() ([]byte, error) { 1795 type NoMethod ProcessAppManifestCallbackOperationMetadata 1796 raw := NoMethod(*s) 1797 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1798} 1799 1800// RepoSource: Location of the source in a Google Cloud Source 1801// Repository. 1802type RepoSource struct { 1803 // BranchName: Regex matching branches to build. The syntax of the 1804 // regular expressions accepted is the syntax accepted by RE2 and 1805 // described at https://github.com/google/re2/wiki/Syntax 1806 BranchName string `json:"branchName,omitempty"` 1807 1808 // CommitSha: Explicit commit SHA to build. 1809 CommitSha string `json:"commitSha,omitempty"` 1810 1811 // Dir: Directory, relative to the source root, in which to run the 1812 // build. This must be a relative path. If a step's `dir` is specified 1813 // and is an absolute path, this value is ignored for that step's 1814 // execution. 1815 Dir string `json:"dir,omitempty"` 1816 1817 // InvertRegex: Only trigger a build if the revision regex does NOT 1818 // match the revision regex. 1819 InvertRegex bool `json:"invertRegex,omitempty"` 1820 1821 // ProjectId: ID of the project that owns the Cloud Source Repository. 1822 // If omitted, the project ID requesting the build is assumed. 1823 ProjectId string `json:"projectId,omitempty"` 1824 1825 // RepoName: Name of the Cloud Source Repository. 1826 RepoName string `json:"repoName,omitempty"` 1827 1828 // Substitutions: Substitutions to use in a triggered build. Should only 1829 // be used with RunBuildTrigger 1830 Substitutions map[string]string `json:"substitutions,omitempty"` 1831 1832 // TagName: Regex matching tags to build. The syntax of the regular 1833 // expressions accepted is the syntax accepted by RE2 and described at 1834 // https://github.com/google/re2/wiki/Syntax 1835 TagName string `json:"tagName,omitempty"` 1836 1837 // ForceSendFields is a list of field names (e.g. "BranchName") to 1838 // unconditionally include in API requests. By default, fields with 1839 // empty or default values are omitted from API requests. However, any 1840 // non-pointer, non-interface field appearing in ForceSendFields will be 1841 // sent to the server regardless of whether the field is empty or not. 1842 // This may be used to include empty fields in Patch requests. 1843 ForceSendFields []string `json:"-"` 1844 1845 // NullFields is a list of field names (e.g. "BranchName") to include in 1846 // API requests with the JSON null value. By default, fields with empty 1847 // values are omitted from API requests. However, any field with an 1848 // empty value appearing in NullFields will be sent to the server as 1849 // null. It is an error if a field in this list has a non-empty value. 1850 // This may be used to include null fields in Patch requests. 1851 NullFields []string `json:"-"` 1852} 1853 1854func (s *RepoSource) MarshalJSON() ([]byte, error) { 1855 type NoMethod RepoSource 1856 raw := NoMethod(*s) 1857 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1858} 1859 1860// Results: Artifacts created by the build pipeline. 1861type Results struct { 1862 // ArtifactManifest: Path to the artifact manifest. Only populated when 1863 // artifacts are uploaded. 1864 ArtifactManifest string `json:"artifactManifest,omitempty"` 1865 1866 // ArtifactTiming: Time to push all non-container artifacts. 1867 ArtifactTiming *TimeSpan `json:"artifactTiming,omitempty"` 1868 1869 // BuildStepImages: List of build step digests, in the order 1870 // corresponding to build step indices. 1871 BuildStepImages []string `json:"buildStepImages,omitempty"` 1872 1873 // BuildStepOutputs: List of build step outputs, produced by builder 1874 // images, in the order corresponding to build step indices. Cloud 1875 // Builders (https://cloud.google.com/cloud-build/docs/cloud-builders) 1876 // can produce this output by writing to `$BUILDER_OUTPUT/output`. Only 1877 // the first 4KB of data is stored. 1878 BuildStepOutputs []string `json:"buildStepOutputs,omitempty"` 1879 1880 // Images: Container images that were built as a part of the build. 1881 Images []*BuiltImage `json:"images,omitempty"` 1882 1883 // NumArtifacts: Number of artifacts uploaded. Only populated when 1884 // artifacts are uploaded. 1885 NumArtifacts int64 `json:"numArtifacts,omitempty,string"` 1886 1887 // ForceSendFields is a list of field names (e.g. "ArtifactManifest") to 1888 // unconditionally include in API requests. By default, fields with 1889 // empty or default values are omitted from API requests. However, any 1890 // non-pointer, non-interface field appearing in ForceSendFields will be 1891 // sent to the server regardless of whether the field is empty or not. 1892 // This may be used to include empty fields in Patch requests. 1893 ForceSendFields []string `json:"-"` 1894 1895 // NullFields is a list of field names (e.g. "ArtifactManifest") to 1896 // include in API requests with the JSON null value. By default, fields 1897 // with empty values are omitted from API requests. However, any field 1898 // with an empty value appearing in NullFields will be sent to the 1899 // server as null. It is an error if a field in this list has a 1900 // non-empty value. This may be used to include null fields in Patch 1901 // requests. 1902 NullFields []string `json:"-"` 1903} 1904 1905func (s *Results) MarshalJSON() ([]byte, error) { 1906 type NoMethod Results 1907 raw := NoMethod(*s) 1908 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1909} 1910 1911// SMTPDelivery: SMTPDelivery is the delivery configuration for an SMTP 1912// (email) notification. 1913type SMTPDelivery struct { 1914 // FromAddress: This is the SMTP account/email that appears in the 1915 // `From:` of the email. If empty, it is assumed to be sender. 1916 FromAddress string `json:"fromAddress,omitempty"` 1917 1918 // Password: The SMTP sender's password. 1919 Password *NotifierSecretRef `json:"password,omitempty"` 1920 1921 // Port: The SMTP port of the server. 1922 Port string `json:"port,omitempty"` 1923 1924 // RecipientAddresses: This is the list of addresses to which we send 1925 // the email (i.e. in the `To:` of the email). 1926 RecipientAddresses []string `json:"recipientAddresses,omitempty"` 1927 1928 // SenderAddress: This is the SMTP account/email that is used to send 1929 // the message. 1930 SenderAddress string `json:"senderAddress,omitempty"` 1931 1932 // Server: The address of the SMTP server. 1933 Server string `json:"server,omitempty"` 1934 1935 // ForceSendFields is a list of field names (e.g. "FromAddress") to 1936 // unconditionally include in API requests. By default, fields with 1937 // empty or default values are omitted from API requests. However, any 1938 // non-pointer, non-interface field appearing in ForceSendFields will be 1939 // sent to the server regardless of whether the field is empty or not. 1940 // This may be used to include empty fields in Patch requests. 1941 ForceSendFields []string `json:"-"` 1942 1943 // NullFields is a list of field names (e.g. "FromAddress") to include 1944 // in API requests with the JSON null value. By default, fields with 1945 // empty values are omitted from API requests. However, any field with 1946 // an empty value appearing in NullFields will be sent to the server as 1947 // null. It is an error if a field in this list has a non-empty value. 1948 // This may be used to include null fields in Patch requests. 1949 NullFields []string `json:"-"` 1950} 1951 1952func (s *SMTPDelivery) MarshalJSON() ([]byte, error) { 1953 type NoMethod SMTPDelivery 1954 raw := NoMethod(*s) 1955 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1956} 1957 1958// Secret: Pairs a set of secret environment variables containing 1959// encrypted values with the Cloud KMS key to use to decrypt the value. 1960// Note: Use `kmsKeyName` with `available_secrets` instead of using 1961// `kmsKeyName` with `secret`. For instructions see: 1962// https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-credentials. 1963type Secret struct { 1964 // KmsKeyName: Cloud KMS key name to use to decrypt these envs. 1965 KmsKeyName string `json:"kmsKeyName,omitempty"` 1966 1967 // SecretEnv: Map of environment variable name to its encrypted value. 1968 // Secret environment variables must be unique across all of a build's 1969 // secrets, and must be used by at least one build step. Values can be 1970 // at most 64 KB in size. There can be at most 100 secret values across 1971 // all of a build's secrets. 1972 SecretEnv map[string]string `json:"secretEnv,omitempty"` 1973 1974 // ForceSendFields is a list of field names (e.g. "KmsKeyName") to 1975 // unconditionally include in API requests. By default, fields with 1976 // empty or default values are omitted from API requests. However, any 1977 // non-pointer, non-interface field appearing in ForceSendFields will be 1978 // sent to the server regardless of whether the field is empty or not. 1979 // This may be used to include empty fields in Patch requests. 1980 ForceSendFields []string `json:"-"` 1981 1982 // NullFields is a list of field names (e.g. "KmsKeyName") to include in 1983 // API requests with the JSON null value. By default, fields with empty 1984 // values are omitted from API requests. However, any field with an 1985 // empty value appearing in NullFields will be sent to the server as 1986 // null. It is an error if a field in this list has a non-empty value. 1987 // This may be used to include null fields in Patch requests. 1988 NullFields []string `json:"-"` 1989} 1990 1991func (s *Secret) MarshalJSON() ([]byte, error) { 1992 type NoMethod Secret 1993 raw := NoMethod(*s) 1994 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1995} 1996 1997// SecretManagerSecret: Pairs a secret environment variable with a 1998// SecretVersion in Secret Manager. 1999type SecretManagerSecret struct { 2000 // Env: Environment variable name to associate with the secret. Secret 2001 // environment variables must be unique across all of a build's secrets, 2002 // and must be used by at least one build step. 2003 Env string `json:"env,omitempty"` 2004 2005 // VersionName: Resource name of the SecretVersion. In format: 2006 // projects/*/secrets/*/versions/* 2007 VersionName string `json:"versionName,omitempty"` 2008 2009 // ForceSendFields is a list of field names (e.g. "Env") to 2010 // unconditionally include in API requests. By default, fields with 2011 // empty or default values are omitted from API requests. However, any 2012 // non-pointer, non-interface field appearing in ForceSendFields will be 2013 // sent to the server regardless of whether the field is empty or not. 2014 // This may be used to include empty fields in Patch requests. 2015 ForceSendFields []string `json:"-"` 2016 2017 // NullFields is a list of field names (e.g. "Env") to include in API 2018 // requests with the JSON null value. By default, fields with empty 2019 // values are omitted from API requests. However, any field with an 2020 // empty value appearing in NullFields will be sent to the server as 2021 // null. It is an error if a field in this list has a non-empty value. 2022 // This may be used to include null fields in Patch requests. 2023 NullFields []string `json:"-"` 2024} 2025 2026func (s *SecretManagerSecret) MarshalJSON() ([]byte, error) { 2027 type NoMethod SecretManagerSecret 2028 raw := NoMethod(*s) 2029 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2030} 2031 2032// Secrets: Secrets and secret environment variables. 2033type Secrets struct { 2034 // Inline: Secrets encrypted with KMS key and the associated secret 2035 // environment variable. 2036 Inline []*InlineSecret `json:"inline,omitempty"` 2037 2038 // SecretManager: Secrets in Secret Manager and associated secret 2039 // environment variable. 2040 SecretManager []*SecretManagerSecret `json:"secretManager,omitempty"` 2041 2042 // ForceSendFields is a list of field names (e.g. "Inline") to 2043 // unconditionally include in API requests. By default, fields with 2044 // empty or default values are omitted from API requests. However, any 2045 // non-pointer, non-interface field appearing in ForceSendFields will be 2046 // sent to the server regardless of whether the field is empty or not. 2047 // This may be used to include empty fields in Patch requests. 2048 ForceSendFields []string `json:"-"` 2049 2050 // NullFields is a list of field names (e.g. "Inline") to include in API 2051 // requests with the JSON null value. By default, fields with empty 2052 // values are omitted from API requests. However, any field with an 2053 // empty value appearing in NullFields will be sent to the server as 2054 // null. It is an error if a field in this list has a non-empty value. 2055 // This may be used to include null fields in Patch requests. 2056 NullFields []string `json:"-"` 2057} 2058 2059func (s *Secrets) MarshalJSON() ([]byte, error) { 2060 type NoMethod Secrets 2061 raw := NoMethod(*s) 2062 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2063} 2064 2065// SlackDelivery: SlackDelivery is the delivery configuration for 2066// delivering Slack messages via webhooks. See Slack webhook 2067// documentation at: https://api.slack.com/messaging/webhooks. 2068type SlackDelivery struct { 2069 // WebhookUri: The secret reference for the Slack webhook URI for 2070 // sending messages to a channel. 2071 WebhookUri *NotifierSecretRef `json:"webhookUri,omitempty"` 2072 2073 // ForceSendFields is a list of field names (e.g. "WebhookUri") to 2074 // unconditionally include in API requests. By default, fields with 2075 // empty or default values are omitted from API requests. However, any 2076 // non-pointer, non-interface field appearing in ForceSendFields will be 2077 // sent to the server regardless of whether the field is empty or not. 2078 // This may be used to include empty fields in Patch requests. 2079 ForceSendFields []string `json:"-"` 2080 2081 // NullFields is a list of field names (e.g. "WebhookUri") to include in 2082 // API requests with the JSON null value. By default, fields with empty 2083 // values are omitted from API requests. However, any field with an 2084 // empty value appearing in NullFields will be sent to the server as 2085 // null. It is an error if a field in this list has a non-empty value. 2086 // This may be used to include null fields in Patch requests. 2087 NullFields []string `json:"-"` 2088} 2089 2090func (s *SlackDelivery) MarshalJSON() ([]byte, error) { 2091 type NoMethod SlackDelivery 2092 raw := NoMethod(*s) 2093 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2094} 2095 2096// Source: Location of the source in a supported storage service. 2097type Source struct { 2098 // RepoSource: If provided, get the source from this location in a Cloud 2099 // Source Repository. 2100 RepoSource *RepoSource `json:"repoSource,omitempty"` 2101 2102 // StorageSource: If provided, get the source from this location in 2103 // Google Cloud Storage. 2104 StorageSource *StorageSource `json:"storageSource,omitempty"` 2105 2106 // StorageSourceManifest: If provided, get the source from this manifest 2107 // in Google Cloud Storage. This feature is in Preview; see description 2108 // here 2109 // (https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). 2110 StorageSourceManifest *StorageSourceManifest `json:"storageSourceManifest,omitempty"` 2111 2112 // ForceSendFields is a list of field names (e.g. "RepoSource") to 2113 // unconditionally include in API requests. By default, fields with 2114 // empty or default values are omitted from API requests. However, any 2115 // non-pointer, non-interface field appearing in ForceSendFields will be 2116 // sent to the server regardless of whether the field is empty or not. 2117 // This may be used to include empty fields in Patch requests. 2118 ForceSendFields []string `json:"-"` 2119 2120 // NullFields is a list of field names (e.g. "RepoSource") to include in 2121 // API requests with the JSON null value. By default, fields with empty 2122 // values are omitted from API requests. However, any field with an 2123 // empty value appearing in NullFields will be sent to the server as 2124 // null. It is an error if a field in this list has a non-empty value. 2125 // This may be used to include null fields in Patch requests. 2126 NullFields []string `json:"-"` 2127} 2128 2129func (s *Source) MarshalJSON() ([]byte, error) { 2130 type NoMethod Source 2131 raw := NoMethod(*s) 2132 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2133} 2134 2135// SourceProvenance: Provenance of the source. Ways to find the original 2136// source, or verify that some source was used for this build. 2137type SourceProvenance struct { 2138 // FileHashes: Output only. Hash(es) of the build source, which can be 2139 // used to verify that the original source integrity was maintained in 2140 // the build. Note that `FileHashes` will only be populated if 2141 // `BuildOptions` has requested a `SourceProvenanceHash`. The keys to 2142 // this map are file paths used as build source and the values contain 2143 // the hash values for those files. If the build source came in a single 2144 // package such as a gzipped tarfile (`.tar.gz`), the `FileHash` will be 2145 // for the single path to that file. 2146 FileHashes map[string]FileHashes `json:"fileHashes,omitempty"` 2147 2148 // ResolvedRepoSource: A copy of the build's `source.repo_source`, if 2149 // exists, with any revisions resolved. 2150 ResolvedRepoSource *RepoSource `json:"resolvedRepoSource,omitempty"` 2151 2152 // ResolvedStorageSource: A copy of the build's `source.storage_source`, 2153 // if exists, with any generations resolved. 2154 ResolvedStorageSource *StorageSource `json:"resolvedStorageSource,omitempty"` 2155 2156 // ResolvedStorageSourceManifest: A copy of the build's 2157 // `source.storage_source_manifest`, if exists, with any revisions 2158 // resolved. This feature is in Preview. 2159 ResolvedStorageSourceManifest *StorageSourceManifest `json:"resolvedStorageSourceManifest,omitempty"` 2160 2161 // ForceSendFields is a list of field names (e.g. "FileHashes") to 2162 // unconditionally include in API requests. By default, fields with 2163 // empty or default values are omitted from API requests. However, any 2164 // non-pointer, non-interface field appearing in ForceSendFields will be 2165 // sent to the server regardless of whether the field is empty or not. 2166 // This may be used to include empty fields in Patch requests. 2167 ForceSendFields []string `json:"-"` 2168 2169 // NullFields is a list of field names (e.g. "FileHashes") to include in 2170 // API requests with the JSON null value. By default, fields with empty 2171 // values are omitted from API requests. However, any field with an 2172 // empty value appearing in NullFields will be sent to the server as 2173 // null. It is an error if a field in this list has a non-empty value. 2174 // This may be used to include null fields in Patch requests. 2175 NullFields []string `json:"-"` 2176} 2177 2178func (s *SourceProvenance) MarshalJSON() ([]byte, error) { 2179 type NoMethod SourceProvenance 2180 raw := NoMethod(*s) 2181 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2182} 2183 2184// Status: The `Status` type defines a logical error model that is 2185// suitable for different programming environments, including REST APIs 2186// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 2187// `Status` message contains three pieces of data: error code, error 2188// message, and error details. You can find out more about this error 2189// model and how to work with it in the API Design Guide 2190// (https://cloud.google.com/apis/design/errors). 2191type Status struct { 2192 // Code: The status code, which should be an enum value of 2193 // google.rpc.Code. 2194 Code int64 `json:"code,omitempty"` 2195 2196 // Details: A list of messages that carry the error details. There is a 2197 // common set of message types for APIs to use. 2198 Details []googleapi.RawMessage `json:"details,omitempty"` 2199 2200 // Message: A developer-facing error message, which should be in 2201 // English. Any user-facing error message should be localized and sent 2202 // in the google.rpc.Status.details field, or localized by the client. 2203 Message string `json:"message,omitempty"` 2204 2205 // ForceSendFields is a list of field names (e.g. "Code") to 2206 // unconditionally include in API requests. By default, fields with 2207 // empty or default values are omitted from API requests. However, any 2208 // non-pointer, non-interface field appearing in ForceSendFields will be 2209 // sent to the server regardless of whether the field is empty or not. 2210 // This may be used to include empty fields in Patch requests. 2211 ForceSendFields []string `json:"-"` 2212 2213 // NullFields is a list of field names (e.g. "Code") to include in API 2214 // requests with the JSON null value. By default, fields with empty 2215 // values are omitted from API requests. However, any field with an 2216 // empty value appearing in NullFields will be sent to the server as 2217 // null. It is an error if a field in this list has a non-empty value. 2218 // This may be used to include null fields in Patch requests. 2219 NullFields []string `json:"-"` 2220} 2221 2222func (s *Status) MarshalJSON() ([]byte, error) { 2223 type NoMethod Status 2224 raw := NoMethod(*s) 2225 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2226} 2227 2228// StorageSource: Location of the source in an archive file in Google 2229// Cloud Storage. 2230type StorageSource struct { 2231 // Bucket: Google Cloud Storage bucket containing the source (see Bucket 2232 // Name Requirements 2233 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 2234 Bucket string `json:"bucket,omitempty"` 2235 2236 // Generation: Google Cloud Storage generation for the object. If the 2237 // generation is omitted, the latest generation will be used. 2238 Generation int64 `json:"generation,omitempty,string"` 2239 2240 // Object: Google Cloud Storage object containing the source. This 2241 // object must be a zipped (`.zip`) or gzipped archive file (`.tar.gz`) 2242 // containing source to build. 2243 Object string `json:"object,omitempty"` 2244 2245 // ForceSendFields is a list of field names (e.g. "Bucket") to 2246 // unconditionally include in API requests. By default, fields with 2247 // empty or default values are omitted from API requests. However, any 2248 // non-pointer, non-interface field appearing in ForceSendFields will be 2249 // sent to the server regardless of whether the field is empty or not. 2250 // This may be used to include empty fields in Patch requests. 2251 ForceSendFields []string `json:"-"` 2252 2253 // NullFields is a list of field names (e.g. "Bucket") to include in API 2254 // requests with the JSON null value. By default, fields with empty 2255 // values are omitted from API requests. However, any field with an 2256 // empty value appearing in NullFields will be sent to the server as 2257 // null. It is an error if a field in this list has a non-empty value. 2258 // This may be used to include null fields in Patch requests. 2259 NullFields []string `json:"-"` 2260} 2261 2262func (s *StorageSource) MarshalJSON() ([]byte, error) { 2263 type NoMethod StorageSource 2264 raw := NoMethod(*s) 2265 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2266} 2267 2268// StorageSourceManifest: Location of the source manifest in Google 2269// Cloud Storage. This feature is in Preview; see description here 2270// (https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). 2271type StorageSourceManifest struct { 2272 // Bucket: Google Cloud Storage bucket containing the source manifest 2273 // (see Bucket Name Requirements 2274 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 2275 Bucket string `json:"bucket,omitempty"` 2276 2277 // Generation: Google Cloud Storage generation for the object. If the 2278 // generation is omitted, the latest generation will be used. 2279 Generation int64 `json:"generation,omitempty,string"` 2280 2281 // Object: Google Cloud Storage object containing the source manifest. 2282 // This object must be a JSON file. 2283 Object string `json:"object,omitempty"` 2284 2285 // ForceSendFields is a list of field names (e.g. "Bucket") to 2286 // unconditionally include in API requests. By default, fields with 2287 // empty or default values are omitted from API requests. However, any 2288 // non-pointer, non-interface field appearing in ForceSendFields will be 2289 // sent to the server regardless of whether the field is empty or not. 2290 // This may be used to include empty fields in Patch requests. 2291 ForceSendFields []string `json:"-"` 2292 2293 // NullFields is a list of field names (e.g. "Bucket") to include in API 2294 // requests with the JSON null value. By default, fields with empty 2295 // values are omitted from API requests. However, any field with an 2296 // empty value appearing in NullFields will be sent to the server as 2297 // null. It is an error if a field in this list has a non-empty value. 2298 // This may be used to include null fields in Patch requests. 2299 NullFields []string `json:"-"` 2300} 2301 2302func (s *StorageSourceManifest) MarshalJSON() ([]byte, error) { 2303 type NoMethod StorageSourceManifest 2304 raw := NoMethod(*s) 2305 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2306} 2307 2308// TimeSpan: Start and end times for a build execution phase. 2309type TimeSpan struct { 2310 // EndTime: End of time span. 2311 EndTime string `json:"endTime,omitempty"` 2312 2313 // StartTime: Start of time span. 2314 StartTime string `json:"startTime,omitempty"` 2315 2316 // ForceSendFields is a list of field names (e.g. "EndTime") to 2317 // unconditionally include in API requests. By default, fields with 2318 // empty or default values are omitted from API requests. However, any 2319 // non-pointer, non-interface field appearing in ForceSendFields will be 2320 // sent to the server regardless of whether the field is empty or not. 2321 // This may be used to include empty fields in Patch requests. 2322 ForceSendFields []string `json:"-"` 2323 2324 // NullFields is a list of field names (e.g. "EndTime") to include in 2325 // API requests with the JSON null value. By default, fields with empty 2326 // values are omitted from API requests. However, any field with an 2327 // empty value appearing in NullFields will be sent to the server as 2328 // null. It is an error if a field in this list has a non-empty value. 2329 // This may be used to include null fields in Patch requests. 2330 NullFields []string `json:"-"` 2331} 2332 2333func (s *TimeSpan) MarshalJSON() ([]byte, error) { 2334 type NoMethod TimeSpan 2335 raw := NoMethod(*s) 2336 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2337} 2338 2339// UpdateGitHubEnterpriseConfigOperationMetadata: Metadata for 2340// `UpdateGitHubEnterpriseConfig` operation. 2341type UpdateGitHubEnterpriseConfigOperationMetadata struct { 2342 // CompleteTime: Time the operation was completed. 2343 CompleteTime string `json:"completeTime,omitempty"` 2344 2345 // CreateTime: Time the operation was created. 2346 CreateTime string `json:"createTime,omitempty"` 2347 2348 // GithubEnterpriseConfig: The resource name of the GitHubEnterprise to 2349 // be updated. Format: 2350 // `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}` 2351 // . 2352 GithubEnterpriseConfig string `json:"githubEnterpriseConfig,omitempty"` 2353 2354 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 2355 // unconditionally include in API requests. By default, fields with 2356 // empty or default values are omitted from API requests. However, any 2357 // non-pointer, non-interface field appearing in ForceSendFields will be 2358 // sent to the server regardless of whether the field is empty or not. 2359 // This may be used to include empty fields in Patch requests. 2360 ForceSendFields []string `json:"-"` 2361 2362 // NullFields is a list of field names (e.g. "CompleteTime") to include 2363 // in API requests with the JSON null value. By default, fields with 2364 // empty values are omitted from API requests. However, any field with 2365 // an empty value appearing in NullFields will be sent to the server as 2366 // null. It is an error if a field in this list has a non-empty value. 2367 // This may be used to include null fields in Patch requests. 2368 NullFields []string `json:"-"` 2369} 2370 2371func (s *UpdateGitHubEnterpriseConfigOperationMetadata) MarshalJSON() ([]byte, error) { 2372 type NoMethod UpdateGitHubEnterpriseConfigOperationMetadata 2373 raw := NoMethod(*s) 2374 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2375} 2376 2377// UpdateWorkerPoolOperationMetadata: Metadata for the 2378// `UpdateWorkerPool` operation. 2379type UpdateWorkerPoolOperationMetadata struct { 2380 // CompleteTime: Time the operation was completed. 2381 CompleteTime string `json:"completeTime,omitempty"` 2382 2383 // CreateTime: Time the operation was created. 2384 CreateTime string `json:"createTime,omitempty"` 2385 2386 // WorkerPool: The resource name of the `WorkerPool` being updated. 2387 // Format: 2388 // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. 2389 WorkerPool string `json:"workerPool,omitempty"` 2390 2391 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 2392 // unconditionally include in API requests. By default, fields with 2393 // empty or default values are omitted from API requests. However, any 2394 // non-pointer, non-interface field appearing in ForceSendFields will be 2395 // sent to the server regardless of whether the field is empty or not. 2396 // This may be used to include empty fields in Patch requests. 2397 ForceSendFields []string `json:"-"` 2398 2399 // NullFields is a list of field names (e.g. "CompleteTime") to include 2400 // in API requests with the JSON null value. By default, fields with 2401 // empty values are omitted from API requests. However, any field with 2402 // an empty value appearing in NullFields will be sent to the server as 2403 // null. It is an error if a field in this list has a non-empty value. 2404 // This may be used to include null fields in Patch requests. 2405 NullFields []string `json:"-"` 2406} 2407 2408func (s *UpdateWorkerPoolOperationMetadata) MarshalJSON() ([]byte, error) { 2409 type NoMethod UpdateWorkerPoolOperationMetadata 2410 raw := NoMethod(*s) 2411 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2412} 2413 2414// Volume: Volume describes a Docker container volume which is mounted 2415// into build steps in order to persist files across build step 2416// execution. 2417type Volume struct { 2418 // Name: Name of the volume to mount. Volume names must be unique per 2419 // build step and must be valid names for Docker volumes. Each named 2420 // volume must be used by at least two build steps. 2421 Name string `json:"name,omitempty"` 2422 2423 // Path: Path at which to mount the volume. Paths must be absolute and 2424 // cannot conflict with other volume paths on the same build step or 2425 // with certain reserved volume paths. 2426 Path string `json:"path,omitempty"` 2427 2428 // ForceSendFields is a list of field names (e.g. "Name") to 2429 // unconditionally include in API requests. By default, fields with 2430 // empty or default values are omitted from API requests. However, any 2431 // non-pointer, non-interface field appearing in ForceSendFields will be 2432 // sent to the server regardless of whether the field is empty or not. 2433 // This may be used to include empty fields in Patch requests. 2434 ForceSendFields []string `json:"-"` 2435 2436 // NullFields is a list of field names (e.g. "Name") to include in API 2437 // requests with the JSON null value. By default, fields with empty 2438 // values are omitted from API requests. However, any field with an 2439 // empty value appearing in NullFields will be sent to the server as 2440 // null. It is an error if a field in this list has a non-empty value. 2441 // This may be used to include null fields in Patch requests. 2442 NullFields []string `json:"-"` 2443} 2444 2445func (s *Volume) MarshalJSON() ([]byte, error) { 2446 type NoMethod Volume 2447 raw := NoMethod(*s) 2448 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2449} 2450 2451// Warning: A non-fatal problem encountered during the execution of the 2452// build. 2453type Warning struct { 2454 // Priority: The priority for this warning. 2455 // 2456 // Possible values: 2457 // "PRIORITY_UNSPECIFIED" - Should not be used. 2458 // "INFO" - e.g. deprecation warnings and alternative feature 2459 // highlights. 2460 // "WARNING" - e.g. automated detection of possible issues with the 2461 // build. 2462 // "ALERT" - e.g. alerts that a feature used in the build is pending 2463 // removal 2464 Priority string `json:"priority,omitempty"` 2465 2466 // Text: Explanation of the warning generated. 2467 Text string `json:"text,omitempty"` 2468 2469 // ForceSendFields is a list of field names (e.g. "Priority") to 2470 // unconditionally include in API requests. By default, fields with 2471 // empty or default values are omitted from API requests. However, any 2472 // non-pointer, non-interface field appearing in ForceSendFields will be 2473 // sent to the server regardless of whether the field is empty or not. 2474 // This may be used to include empty fields in Patch requests. 2475 ForceSendFields []string `json:"-"` 2476 2477 // NullFields is a list of field names (e.g. "Priority") to include in 2478 // API requests with the JSON null value. By default, fields with empty 2479 // values are omitted from API requests. However, any field with an 2480 // empty value appearing in NullFields will be sent to the server as 2481 // null. It is an error if a field in this list has a non-empty value. 2482 // This may be used to include null fields in Patch requests. 2483 NullFields []string `json:"-"` 2484} 2485 2486func (s *Warning) MarshalJSON() ([]byte, error) { 2487 type NoMethod Warning 2488 raw := NoMethod(*s) 2489 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2490} 2491 2492// WorkerConfig: WorkerConfig defines the configuration to be used for a 2493// creating workers in the pool. 2494type WorkerConfig struct { 2495 // DiskSizeGb: Size of the disk attached to the worker, in GB. See 2496 // https://cloud.google.com/compute/docs/disks/ If `0` is specified, 2497 // Cloud Build will use a standard disk size. `disk_size` is overridden 2498 // if you specify a different disk size in `build_options`. In this 2499 // case, a VM with a disk size specified in the `build_options` will be 2500 // created on demand at build time. For more information see 2501 // https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions 2502 DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` 2503 2504 // MachineType: Machine Type of the worker, such as n1-standard-1. See 2505 // https://cloud.google.com/compute/docs/machine-types. If left blank, 2506 // Cloud Build will use a standard unspecified machine to create the 2507 // worker pool. `machine_type` is overridden if you specify a different 2508 // machine type in `build_options`. In this case, the VM specified in 2509 // the `build_options` will be created on demand at build time. For more 2510 // information see 2511 // https://cloud.google.com/cloud-build/docs/speeding-up-builds#using_custom_virtual_machine_sizes 2512 MachineType string `json:"machineType,omitempty"` 2513 2514 // Network: The network definition used to create the worker. If this 2515 // section is left empty, the workers will be created in 2516 // WorkerPool.project_id on the default network. 2517 Network *Network `json:"network,omitempty"` 2518 2519 // Tag: The tag applied to the worker, and the same tag used by the 2520 // firewall rule. It is used to identify the Cloud Build workers among 2521 // other VMs. The default value for tag is `worker`. 2522 Tag string `json:"tag,omitempty"` 2523 2524 // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to 2525 // unconditionally include in API requests. By default, fields with 2526 // empty or default values are omitted from API requests. However, any 2527 // non-pointer, non-interface field appearing in ForceSendFields will be 2528 // sent to the server regardless of whether the field is empty or not. 2529 // This may be used to include empty fields in Patch requests. 2530 ForceSendFields []string `json:"-"` 2531 2532 // NullFields is a list of field names (e.g. "DiskSizeGb") to include in 2533 // API requests with the JSON null value. By default, fields with empty 2534 // values are omitted from API requests. However, any field with an 2535 // empty value appearing in NullFields will be sent to the server as 2536 // null. It is an error if a field in this list has a non-empty value. 2537 // This may be used to include null fields in Patch requests. 2538 NullFields []string `json:"-"` 2539} 2540 2541func (s *WorkerConfig) MarshalJSON() ([]byte, error) { 2542 type NoMethod WorkerConfig 2543 raw := NoMethod(*s) 2544 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2545} 2546 2547// WorkerPool: Configuration for a WorkerPool to run the builds. Workers 2548// are machines that Cloud Build uses to run your builds. By default, 2549// all workers run in a project owned by Cloud Build. To have full 2550// control over the workers that execute your builds -- such as enabling 2551// them to access private resources on your private network -- you can 2552// request Cloud Build to run the workers in your own project by 2553// creating a custom workers pool. 2554type WorkerPool struct { 2555 // CreateTime: Output only. Time at which the request to create the 2556 // `WorkerPool` was received. 2557 CreateTime string `json:"createTime,omitempty"` 2558 2559 // DeleteTime: Output only. Time at which the request to delete the 2560 // `WorkerPool` was received. 2561 DeleteTime string `json:"deleteTime,omitempty"` 2562 2563 // Name: User-defined name of the `WorkerPool`. 2564 Name string `json:"name,omitempty"` 2565 2566 // ProjectId: The project ID of the GCP project for which the 2567 // `WorkerPool` is created. 2568 ProjectId string `json:"projectId,omitempty"` 2569 2570 // Regions: List of regions to create the `WorkerPool`. Regions can't be 2571 // empty. If Cloud Build adds a new GCP region in the future, the 2572 // existing `WorkerPool` will not be enabled in the new region 2573 // automatically; you must add the new region to the `regions` field to 2574 // enable the `WorkerPool` in that region. 2575 // 2576 // Possible values: 2577 // "REGION_UNSPECIFIED" - no region 2578 // "us-central1" - us-central1 region 2579 // "us-west1" - us-west1 region 2580 // "us-east1" - us-east1 region 2581 // "us-east4" - us-east4 region 2582 Regions []string `json:"regions,omitempty"` 2583 2584 // ServiceAccountEmail: Output only. The service account used to manage 2585 // the `WorkerPool`. The service account must have the Compute Instance 2586 // Admin (Beta) permission at the project level. 2587 ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` 2588 2589 // Status: Output only. WorkerPool Status. 2590 // 2591 // Possible values: 2592 // "STATUS_UNSPECIFIED" - Status of the `WorkerPool` is unknown. 2593 // "CREATING" - `WorkerPool` is being created. 2594 // "RUNNING" - `WorkerPool` is running. 2595 // "DELETING" - `WorkerPool` is being deleted: cancelling builds and 2596 // draining workers. 2597 // "DELETED" - `WorkerPool` is deleted. 2598 Status string `json:"status,omitempty"` 2599 2600 // UpdateTime: Output only. Time at which the request to update the 2601 // `WorkerPool` was received. 2602 UpdateTime string `json:"updateTime,omitempty"` 2603 2604 // WorkerConfig: Configuration to be used for a creating workers in the 2605 // `WorkerPool`. 2606 WorkerConfig *WorkerConfig `json:"workerConfig,omitempty"` 2607 2608 // WorkerCount: Total number of workers to be created across all 2609 // requested regions. 2610 WorkerCount int64 `json:"workerCount,omitempty,string"` 2611 2612 // ServerResponse contains the HTTP response code and headers from the 2613 // server. 2614 googleapi.ServerResponse `json:"-"` 2615 2616 // ForceSendFields is a list of field names (e.g. "CreateTime") to 2617 // unconditionally include in API requests. By default, fields with 2618 // empty or default values are omitted from API requests. However, any 2619 // non-pointer, non-interface field appearing in ForceSendFields will be 2620 // sent to the server regardless of whether the field is empty or not. 2621 // This may be used to include empty fields in Patch requests. 2622 ForceSendFields []string `json:"-"` 2623 2624 // NullFields is a list of field names (e.g. "CreateTime") to include in 2625 // API requests with the JSON null value. By default, fields with empty 2626 // values are omitted from API requests. However, any field with an 2627 // empty value appearing in NullFields will be sent to the server as 2628 // null. It is an error if a field in this list has a non-empty value. 2629 // This may be used to include null fields in Patch requests. 2630 NullFields []string `json:"-"` 2631} 2632 2633func (s *WorkerPool) MarshalJSON() ([]byte, error) { 2634 type NoMethod WorkerPool 2635 raw := NoMethod(*s) 2636 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2637} 2638 2639// method id "cloudbuild.projects.locations.operations.cancel": 2640 2641type ProjectsLocationsOperationsCancelCall struct { 2642 s *Service 2643 name string 2644 canceloperationrequest *CancelOperationRequest 2645 urlParams_ gensupport.URLParams 2646 ctx_ context.Context 2647 header_ http.Header 2648} 2649 2650// Cancel: Starts asynchronous cancellation on a long-running operation. 2651// The server makes a best effort to cancel the operation, but success 2652// is not guaranteed. If the server doesn't support this method, it 2653// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use 2654// Operations.GetOperation or other methods to check whether the 2655// cancellation succeeded or whether the operation completed despite 2656// cancellation. On successful cancellation, the operation is not 2657// deleted; instead, it becomes an operation with an Operation.error 2658// value with a google.rpc.Status.code of 1, corresponding to 2659// `Code.CANCELLED`. 2660// 2661// - name: The name of the operation resource to be cancelled. 2662func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall { 2663 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2664 c.name = name 2665 c.canceloperationrequest = canceloperationrequest 2666 return c 2667} 2668 2669// Fields allows partial responses to be retrieved. See 2670// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2671// for more information. 2672func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { 2673 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2674 return c 2675} 2676 2677// Context sets the context to be used in this call's Do method. Any 2678// pending HTTP request will be aborted if the provided context is 2679// canceled. 2680func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { 2681 c.ctx_ = ctx 2682 return c 2683} 2684 2685// Header returns an http.Header that can be modified by the caller to 2686// add HTTP headers to the request. 2687func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { 2688 if c.header_ == nil { 2689 c.header_ = make(http.Header) 2690 } 2691 return c.header_ 2692} 2693 2694func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 2695 reqHeaders := make(http.Header) 2696 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2697 for k, v := range c.header_ { 2698 reqHeaders[k] = v 2699 } 2700 reqHeaders.Set("User-Agent", c.s.userAgent()) 2701 var body io.Reader = nil 2702 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 2703 if err != nil { 2704 return nil, err 2705 } 2706 reqHeaders.Set("Content-Type", "application/json") 2707 c.urlParams_.Set("alt", alt) 2708 c.urlParams_.Set("prettyPrint", "false") 2709 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:cancel") 2710 urls += "?" + c.urlParams_.Encode() 2711 req, err := http.NewRequest("POST", urls, body) 2712 if err != nil { 2713 return nil, err 2714 } 2715 req.Header = reqHeaders 2716 googleapi.Expand(req.URL, map[string]string{ 2717 "name": c.name, 2718 }) 2719 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2720} 2721 2722// Do executes the "cloudbuild.projects.locations.operations.cancel" call. 2723// Exactly one of *Empty or error will be non-nil. Any non-2xx status 2724// code is an error. Response headers are in either 2725// *Empty.ServerResponse.Header or (if a response was returned at all) 2726// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2727// check whether the returned error was because http.StatusNotModified 2728// was returned. 2729func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2730 gensupport.SetOptions(c.urlParams_, opts...) 2731 res, err := c.doRequest("json") 2732 if res != nil && res.StatusCode == http.StatusNotModified { 2733 if res.Body != nil { 2734 res.Body.Close() 2735 } 2736 return nil, &googleapi.Error{ 2737 Code: res.StatusCode, 2738 Header: res.Header, 2739 } 2740 } 2741 if err != nil { 2742 return nil, err 2743 } 2744 defer googleapi.CloseBody(res) 2745 if err := googleapi.CheckResponse(res); err != nil { 2746 return nil, err 2747 } 2748 ret := &Empty{ 2749 ServerResponse: googleapi.ServerResponse{ 2750 Header: res.Header, 2751 HTTPStatusCode: res.StatusCode, 2752 }, 2753 } 2754 target := &ret 2755 if err := gensupport.DecodeResponse(target, res); err != nil { 2756 return nil, err 2757 } 2758 return ret, nil 2759 // { 2760 // "description": "Starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use Operations.GetOperation or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, it becomes an operation with an Operation.error value with a google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`.", 2761 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", 2762 // "httpMethod": "POST", 2763 // "id": "cloudbuild.projects.locations.operations.cancel", 2764 // "parameterOrder": [ 2765 // "name" 2766 // ], 2767 // "parameters": { 2768 // "name": { 2769 // "description": "The name of the operation resource to be cancelled.", 2770 // "location": "path", 2771 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 2772 // "required": true, 2773 // "type": "string" 2774 // } 2775 // }, 2776 // "path": "v1alpha1/{+name}:cancel", 2777 // "request": { 2778 // "$ref": "CancelOperationRequest" 2779 // }, 2780 // "response": { 2781 // "$ref": "Empty" 2782 // }, 2783 // "scopes": [ 2784 // "https://www.googleapis.com/auth/cloud-platform" 2785 // ] 2786 // } 2787 2788} 2789 2790// method id "cloudbuild.projects.locations.operations.get": 2791 2792type ProjectsLocationsOperationsGetCall struct { 2793 s *Service 2794 name string 2795 urlParams_ gensupport.URLParams 2796 ifNoneMatch_ string 2797 ctx_ context.Context 2798 header_ http.Header 2799} 2800 2801// Get: Gets the latest state of a long-running operation. Clients can 2802// use this method to poll the operation result at intervals as 2803// recommended by the API service. 2804// 2805// - name: The name of the operation resource. 2806func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 2807 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2808 c.name = name 2809 return c 2810} 2811 2812// Fields allows partial responses to be retrieved. See 2813// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2814// for more information. 2815func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 2816 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2817 return c 2818} 2819 2820// IfNoneMatch sets the optional parameter which makes the operation 2821// fail if the object's ETag matches the given value. This is useful for 2822// getting updates only after the object has changed since the last 2823// request. Use googleapi.IsNotModified to check whether the response 2824// error from Do is the result of In-None-Match. 2825func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 2826 c.ifNoneMatch_ = entityTag 2827 return c 2828} 2829 2830// Context sets the context to be used in this call's Do method. Any 2831// pending HTTP request will be aborted if the provided context is 2832// canceled. 2833func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 2834 c.ctx_ = ctx 2835 return c 2836} 2837 2838// Header returns an http.Header that can be modified by the caller to 2839// add HTTP headers to the request. 2840func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 2841 if c.header_ == nil { 2842 c.header_ = make(http.Header) 2843 } 2844 return c.header_ 2845} 2846 2847func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 2848 reqHeaders := make(http.Header) 2849 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2850 for k, v := range c.header_ { 2851 reqHeaders[k] = v 2852 } 2853 reqHeaders.Set("User-Agent", c.s.userAgent()) 2854 if c.ifNoneMatch_ != "" { 2855 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2856 } 2857 var body io.Reader = nil 2858 c.urlParams_.Set("alt", alt) 2859 c.urlParams_.Set("prettyPrint", "false") 2860 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 2861 urls += "?" + c.urlParams_.Encode() 2862 req, err := http.NewRequest("GET", urls, body) 2863 if err != nil { 2864 return nil, err 2865 } 2866 req.Header = reqHeaders 2867 googleapi.Expand(req.URL, map[string]string{ 2868 "name": c.name, 2869 }) 2870 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2871} 2872 2873// Do executes the "cloudbuild.projects.locations.operations.get" call. 2874// Exactly one of *Operation or error will be non-nil. Any non-2xx 2875// status code is an error. Response headers are in either 2876// *Operation.ServerResponse.Header or (if a response was returned at 2877// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2878// to check whether the returned error was because 2879// http.StatusNotModified was returned. 2880func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2881 gensupport.SetOptions(c.urlParams_, opts...) 2882 res, err := c.doRequest("json") 2883 if res != nil && res.StatusCode == http.StatusNotModified { 2884 if res.Body != nil { 2885 res.Body.Close() 2886 } 2887 return nil, &googleapi.Error{ 2888 Code: res.StatusCode, 2889 Header: res.Header, 2890 } 2891 } 2892 if err != nil { 2893 return nil, err 2894 } 2895 defer googleapi.CloseBody(res) 2896 if err := googleapi.CheckResponse(res); err != nil { 2897 return nil, err 2898 } 2899 ret := &Operation{ 2900 ServerResponse: googleapi.ServerResponse{ 2901 Header: res.Header, 2902 HTTPStatusCode: res.StatusCode, 2903 }, 2904 } 2905 target := &ret 2906 if err := gensupport.DecodeResponse(target, res); err != nil { 2907 return nil, err 2908 } 2909 return ret, nil 2910 // { 2911 // "description": "Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.", 2912 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 2913 // "httpMethod": "GET", 2914 // "id": "cloudbuild.projects.locations.operations.get", 2915 // "parameterOrder": [ 2916 // "name" 2917 // ], 2918 // "parameters": { 2919 // "name": { 2920 // "description": "The name of the operation resource.", 2921 // "location": "path", 2922 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 2923 // "required": true, 2924 // "type": "string" 2925 // } 2926 // }, 2927 // "path": "v1alpha1/{+name}", 2928 // "response": { 2929 // "$ref": "Operation" 2930 // }, 2931 // "scopes": [ 2932 // "https://www.googleapis.com/auth/cloud-platform" 2933 // ] 2934 // } 2935 2936} 2937 2938// method id "cloudbuild.projects.workerPools.create": 2939 2940type ProjectsWorkerPoolsCreateCall struct { 2941 s *Service 2942 parent string 2943 workerpool *WorkerPool 2944 urlParams_ gensupport.URLParams 2945 ctx_ context.Context 2946 header_ http.Header 2947} 2948 2949// Create: Creates a `WorkerPool` to run the builds, and returns the new 2950// worker pool. 2951// 2952// - parent: ID of the parent project. 2953func (r *ProjectsWorkerPoolsService) Create(parent string, workerpool *WorkerPool) *ProjectsWorkerPoolsCreateCall { 2954 c := &ProjectsWorkerPoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2955 c.parent = parent 2956 c.workerpool = workerpool 2957 return c 2958} 2959 2960// Fields allows partial responses to be retrieved. See 2961// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2962// for more information. 2963func (c *ProjectsWorkerPoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsCreateCall { 2964 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2965 return c 2966} 2967 2968// Context sets the context to be used in this call's Do method. Any 2969// pending HTTP request will be aborted if the provided context is 2970// canceled. 2971func (c *ProjectsWorkerPoolsCreateCall) Context(ctx context.Context) *ProjectsWorkerPoolsCreateCall { 2972 c.ctx_ = ctx 2973 return c 2974} 2975 2976// Header returns an http.Header that can be modified by the caller to 2977// add HTTP headers to the request. 2978func (c *ProjectsWorkerPoolsCreateCall) Header() http.Header { 2979 if c.header_ == nil { 2980 c.header_ = make(http.Header) 2981 } 2982 return c.header_ 2983} 2984 2985func (c *ProjectsWorkerPoolsCreateCall) doRequest(alt string) (*http.Response, error) { 2986 reqHeaders := make(http.Header) 2987 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 2988 for k, v := range c.header_ { 2989 reqHeaders[k] = v 2990 } 2991 reqHeaders.Set("User-Agent", c.s.userAgent()) 2992 var body io.Reader = nil 2993 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workerpool) 2994 if err != nil { 2995 return nil, err 2996 } 2997 reqHeaders.Set("Content-Type", "application/json") 2998 c.urlParams_.Set("alt", alt) 2999 c.urlParams_.Set("prettyPrint", "false") 3000 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/workerPools") 3001 urls += "?" + c.urlParams_.Encode() 3002 req, err := http.NewRequest("POST", urls, body) 3003 if err != nil { 3004 return nil, err 3005 } 3006 req.Header = reqHeaders 3007 googleapi.Expand(req.URL, map[string]string{ 3008 "parent": c.parent, 3009 }) 3010 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3011} 3012 3013// Do executes the "cloudbuild.projects.workerPools.create" call. 3014// Exactly one of *WorkerPool or error will be non-nil. Any non-2xx 3015// status code is an error. Response headers are in either 3016// *WorkerPool.ServerResponse.Header or (if a response was returned at 3017// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3018// to check whether the returned error was because 3019// http.StatusNotModified was returned. 3020func (c *ProjectsWorkerPoolsCreateCall) Do(opts ...googleapi.CallOption) (*WorkerPool, error) { 3021 gensupport.SetOptions(c.urlParams_, opts...) 3022 res, err := c.doRequest("json") 3023 if res != nil && res.StatusCode == http.StatusNotModified { 3024 if res.Body != nil { 3025 res.Body.Close() 3026 } 3027 return nil, &googleapi.Error{ 3028 Code: res.StatusCode, 3029 Header: res.Header, 3030 } 3031 } 3032 if err != nil { 3033 return nil, err 3034 } 3035 defer googleapi.CloseBody(res) 3036 if err := googleapi.CheckResponse(res); err != nil { 3037 return nil, err 3038 } 3039 ret := &WorkerPool{ 3040 ServerResponse: googleapi.ServerResponse{ 3041 Header: res.Header, 3042 HTTPStatusCode: res.StatusCode, 3043 }, 3044 } 3045 target := &ret 3046 if err := gensupport.DecodeResponse(target, res); err != nil { 3047 return nil, err 3048 } 3049 return ret, nil 3050 // { 3051 // "description": "Creates a `WorkerPool` to run the builds, and returns the new worker pool.", 3052 // "flatPath": "v1alpha1/projects/{projectsId}/workerPools", 3053 // "httpMethod": "POST", 3054 // "id": "cloudbuild.projects.workerPools.create", 3055 // "parameterOrder": [ 3056 // "parent" 3057 // ], 3058 // "parameters": { 3059 // "parent": { 3060 // "description": "ID of the parent project.", 3061 // "location": "path", 3062 // "pattern": "^projects/[^/]+$", 3063 // "required": true, 3064 // "type": "string" 3065 // } 3066 // }, 3067 // "path": "v1alpha1/{+parent}/workerPools", 3068 // "request": { 3069 // "$ref": "WorkerPool" 3070 // }, 3071 // "response": { 3072 // "$ref": "WorkerPool" 3073 // }, 3074 // "scopes": [ 3075 // "https://www.googleapis.com/auth/cloud-platform" 3076 // ] 3077 // } 3078 3079} 3080 3081// method id "cloudbuild.projects.workerPools.delete": 3082 3083type ProjectsWorkerPoolsDeleteCall struct { 3084 s *Service 3085 name string 3086 urlParams_ gensupport.URLParams 3087 ctx_ context.Context 3088 header_ http.Header 3089} 3090 3091// Delete: Deletes a `WorkerPool` by its project ID and WorkerPool name. 3092// 3093// - name: The field will contain name of the resource requested, for 3094// example: "projects/project-1/workerPools/workerpool-name". 3095func (r *ProjectsWorkerPoolsService) Delete(name string) *ProjectsWorkerPoolsDeleteCall { 3096 c := &ProjectsWorkerPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3097 c.name = name 3098 return c 3099} 3100 3101// Fields allows partial responses to be retrieved. See 3102// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3103// for more information. 3104func (c *ProjectsWorkerPoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsDeleteCall { 3105 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3106 return c 3107} 3108 3109// Context sets the context to be used in this call's Do method. Any 3110// pending HTTP request will be aborted if the provided context is 3111// canceled. 3112func (c *ProjectsWorkerPoolsDeleteCall) Context(ctx context.Context) *ProjectsWorkerPoolsDeleteCall { 3113 c.ctx_ = ctx 3114 return c 3115} 3116 3117// Header returns an http.Header that can be modified by the caller to 3118// add HTTP headers to the request. 3119func (c *ProjectsWorkerPoolsDeleteCall) Header() http.Header { 3120 if c.header_ == nil { 3121 c.header_ = make(http.Header) 3122 } 3123 return c.header_ 3124} 3125 3126func (c *ProjectsWorkerPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { 3127 reqHeaders := make(http.Header) 3128 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3129 for k, v := range c.header_ { 3130 reqHeaders[k] = v 3131 } 3132 reqHeaders.Set("User-Agent", c.s.userAgent()) 3133 var body io.Reader = nil 3134 c.urlParams_.Set("alt", alt) 3135 c.urlParams_.Set("prettyPrint", "false") 3136 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 3137 urls += "?" + c.urlParams_.Encode() 3138 req, err := http.NewRequest("DELETE", urls, body) 3139 if err != nil { 3140 return nil, err 3141 } 3142 req.Header = reqHeaders 3143 googleapi.Expand(req.URL, map[string]string{ 3144 "name": c.name, 3145 }) 3146 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3147} 3148 3149// Do executes the "cloudbuild.projects.workerPools.delete" call. 3150// Exactly one of *Empty or error will be non-nil. Any non-2xx status 3151// code is an error. Response headers are in either 3152// *Empty.ServerResponse.Header or (if a response was returned at all) 3153// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3154// check whether the returned error was because http.StatusNotModified 3155// was returned. 3156func (c *ProjectsWorkerPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3157 gensupport.SetOptions(c.urlParams_, opts...) 3158 res, err := c.doRequest("json") 3159 if res != nil && res.StatusCode == http.StatusNotModified { 3160 if res.Body != nil { 3161 res.Body.Close() 3162 } 3163 return nil, &googleapi.Error{ 3164 Code: res.StatusCode, 3165 Header: res.Header, 3166 } 3167 } 3168 if err != nil { 3169 return nil, err 3170 } 3171 defer googleapi.CloseBody(res) 3172 if err := googleapi.CheckResponse(res); err != nil { 3173 return nil, err 3174 } 3175 ret := &Empty{ 3176 ServerResponse: googleapi.ServerResponse{ 3177 Header: res.Header, 3178 HTTPStatusCode: res.StatusCode, 3179 }, 3180 } 3181 target := &ret 3182 if err := gensupport.DecodeResponse(target, res); err != nil { 3183 return nil, err 3184 } 3185 return ret, nil 3186 // { 3187 // "description": "Deletes a `WorkerPool` by its project ID and WorkerPool name.", 3188 // "flatPath": "v1alpha1/projects/{projectsId}/workerPools/{workerPoolsId}", 3189 // "httpMethod": "DELETE", 3190 // "id": "cloudbuild.projects.workerPools.delete", 3191 // "parameterOrder": [ 3192 // "name" 3193 // ], 3194 // "parameters": { 3195 // "name": { 3196 // "description": "The field will contain name of the resource requested, for example: \"projects/project-1/workerPools/workerpool-name\"", 3197 // "location": "path", 3198 // "pattern": "^projects/[^/]+/workerPools/[^/]+$", 3199 // "required": true, 3200 // "type": "string" 3201 // } 3202 // }, 3203 // "path": "v1alpha1/{+name}", 3204 // "response": { 3205 // "$ref": "Empty" 3206 // }, 3207 // "scopes": [ 3208 // "https://www.googleapis.com/auth/cloud-platform" 3209 // ] 3210 // } 3211 3212} 3213 3214// method id "cloudbuild.projects.workerPools.get": 3215 3216type ProjectsWorkerPoolsGetCall struct { 3217 s *Service 3218 name string 3219 urlParams_ gensupport.URLParams 3220 ifNoneMatch_ string 3221 ctx_ context.Context 3222 header_ http.Header 3223} 3224 3225// Get: Returns information about a `WorkerPool`. 3226// 3227// - name: The field will contain name of the resource requested, for 3228// example: "projects/project-1/workerPools/workerpool-name". 3229func (r *ProjectsWorkerPoolsService) Get(name string) *ProjectsWorkerPoolsGetCall { 3230 c := &ProjectsWorkerPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3231 c.name = name 3232 return c 3233} 3234 3235// Fields allows partial responses to be retrieved. See 3236// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3237// for more information. 3238func (c *ProjectsWorkerPoolsGetCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsGetCall { 3239 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3240 return c 3241} 3242 3243// IfNoneMatch sets the optional parameter which makes the operation 3244// fail if the object's ETag matches the given value. This is useful for 3245// getting updates only after the object has changed since the last 3246// request. Use googleapi.IsNotModified to check whether the response 3247// error from Do is the result of In-None-Match. 3248func (c *ProjectsWorkerPoolsGetCall) IfNoneMatch(entityTag string) *ProjectsWorkerPoolsGetCall { 3249 c.ifNoneMatch_ = entityTag 3250 return c 3251} 3252 3253// Context sets the context to be used in this call's Do method. Any 3254// pending HTTP request will be aborted if the provided context is 3255// canceled. 3256func (c *ProjectsWorkerPoolsGetCall) Context(ctx context.Context) *ProjectsWorkerPoolsGetCall { 3257 c.ctx_ = ctx 3258 return c 3259} 3260 3261// Header returns an http.Header that can be modified by the caller to 3262// add HTTP headers to the request. 3263func (c *ProjectsWorkerPoolsGetCall) Header() http.Header { 3264 if c.header_ == nil { 3265 c.header_ = make(http.Header) 3266 } 3267 return c.header_ 3268} 3269 3270func (c *ProjectsWorkerPoolsGetCall) doRequest(alt string) (*http.Response, error) { 3271 reqHeaders := make(http.Header) 3272 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3273 for k, v := range c.header_ { 3274 reqHeaders[k] = v 3275 } 3276 reqHeaders.Set("User-Agent", c.s.userAgent()) 3277 if c.ifNoneMatch_ != "" { 3278 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3279 } 3280 var body io.Reader = nil 3281 c.urlParams_.Set("alt", alt) 3282 c.urlParams_.Set("prettyPrint", "false") 3283 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 3284 urls += "?" + c.urlParams_.Encode() 3285 req, err := http.NewRequest("GET", urls, body) 3286 if err != nil { 3287 return nil, err 3288 } 3289 req.Header = reqHeaders 3290 googleapi.Expand(req.URL, map[string]string{ 3291 "name": c.name, 3292 }) 3293 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3294} 3295 3296// Do executes the "cloudbuild.projects.workerPools.get" call. 3297// Exactly one of *WorkerPool or error will be non-nil. Any non-2xx 3298// status code is an error. Response headers are in either 3299// *WorkerPool.ServerResponse.Header or (if a response was returned at 3300// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3301// to check whether the returned error was because 3302// http.StatusNotModified was returned. 3303func (c *ProjectsWorkerPoolsGetCall) Do(opts ...googleapi.CallOption) (*WorkerPool, error) { 3304 gensupport.SetOptions(c.urlParams_, opts...) 3305 res, err := c.doRequest("json") 3306 if res != nil && res.StatusCode == http.StatusNotModified { 3307 if res.Body != nil { 3308 res.Body.Close() 3309 } 3310 return nil, &googleapi.Error{ 3311 Code: res.StatusCode, 3312 Header: res.Header, 3313 } 3314 } 3315 if err != nil { 3316 return nil, err 3317 } 3318 defer googleapi.CloseBody(res) 3319 if err := googleapi.CheckResponse(res); err != nil { 3320 return nil, err 3321 } 3322 ret := &WorkerPool{ 3323 ServerResponse: googleapi.ServerResponse{ 3324 Header: res.Header, 3325 HTTPStatusCode: res.StatusCode, 3326 }, 3327 } 3328 target := &ret 3329 if err := gensupport.DecodeResponse(target, res); err != nil { 3330 return nil, err 3331 } 3332 return ret, nil 3333 // { 3334 // "description": "Returns information about a `WorkerPool`.", 3335 // "flatPath": "v1alpha1/projects/{projectsId}/workerPools/{workerPoolsId}", 3336 // "httpMethod": "GET", 3337 // "id": "cloudbuild.projects.workerPools.get", 3338 // "parameterOrder": [ 3339 // "name" 3340 // ], 3341 // "parameters": { 3342 // "name": { 3343 // "description": "The field will contain name of the resource requested, for example: \"projects/project-1/workerPools/workerpool-name\"", 3344 // "location": "path", 3345 // "pattern": "^projects/[^/]+/workerPools/[^/]+$", 3346 // "required": true, 3347 // "type": "string" 3348 // } 3349 // }, 3350 // "path": "v1alpha1/{+name}", 3351 // "response": { 3352 // "$ref": "WorkerPool" 3353 // }, 3354 // "scopes": [ 3355 // "https://www.googleapis.com/auth/cloud-platform" 3356 // ] 3357 // } 3358 3359} 3360 3361// method id "cloudbuild.projects.workerPools.list": 3362 3363type ProjectsWorkerPoolsListCall struct { 3364 s *Service 3365 parent string 3366 urlParams_ gensupport.URLParams 3367 ifNoneMatch_ string 3368 ctx_ context.Context 3369 header_ http.Header 3370} 3371 3372// List: List project's `WorkerPool`s. 3373// 3374// - parent: ID of the parent project. 3375func (r *ProjectsWorkerPoolsService) List(parent string) *ProjectsWorkerPoolsListCall { 3376 c := &ProjectsWorkerPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3377 c.parent = parent 3378 return c 3379} 3380 3381// Fields allows partial responses to be retrieved. See 3382// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3383// for more information. 3384func (c *ProjectsWorkerPoolsListCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsListCall { 3385 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3386 return c 3387} 3388 3389// IfNoneMatch sets the optional parameter which makes the operation 3390// fail if the object's ETag matches the given value. This is useful for 3391// getting updates only after the object has changed since the last 3392// request. Use googleapi.IsNotModified to check whether the response 3393// error from Do is the result of In-None-Match. 3394func (c *ProjectsWorkerPoolsListCall) IfNoneMatch(entityTag string) *ProjectsWorkerPoolsListCall { 3395 c.ifNoneMatch_ = entityTag 3396 return c 3397} 3398 3399// Context sets the context to be used in this call's Do method. Any 3400// pending HTTP request will be aborted if the provided context is 3401// canceled. 3402func (c *ProjectsWorkerPoolsListCall) Context(ctx context.Context) *ProjectsWorkerPoolsListCall { 3403 c.ctx_ = ctx 3404 return c 3405} 3406 3407// Header returns an http.Header that can be modified by the caller to 3408// add HTTP headers to the request. 3409func (c *ProjectsWorkerPoolsListCall) Header() http.Header { 3410 if c.header_ == nil { 3411 c.header_ = make(http.Header) 3412 } 3413 return c.header_ 3414} 3415 3416func (c *ProjectsWorkerPoolsListCall) doRequest(alt string) (*http.Response, error) { 3417 reqHeaders := make(http.Header) 3418 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3419 for k, v := range c.header_ { 3420 reqHeaders[k] = v 3421 } 3422 reqHeaders.Set("User-Agent", c.s.userAgent()) 3423 if c.ifNoneMatch_ != "" { 3424 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3425 } 3426 var body io.Reader = nil 3427 c.urlParams_.Set("alt", alt) 3428 c.urlParams_.Set("prettyPrint", "false") 3429 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/workerPools") 3430 urls += "?" + c.urlParams_.Encode() 3431 req, err := http.NewRequest("GET", urls, body) 3432 if err != nil { 3433 return nil, err 3434 } 3435 req.Header = reqHeaders 3436 googleapi.Expand(req.URL, map[string]string{ 3437 "parent": c.parent, 3438 }) 3439 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3440} 3441 3442// Do executes the "cloudbuild.projects.workerPools.list" call. 3443// Exactly one of *ListWorkerPoolsResponse or error will be non-nil. Any 3444// non-2xx status code is an error. Response headers are in either 3445// *ListWorkerPoolsResponse.ServerResponse.Header or (if a response was 3446// returned at all) in error.(*googleapi.Error).Header. Use 3447// googleapi.IsNotModified to check whether the returned error was 3448// because http.StatusNotModified was returned. 3449func (c *ProjectsWorkerPoolsListCall) Do(opts ...googleapi.CallOption) (*ListWorkerPoolsResponse, error) { 3450 gensupport.SetOptions(c.urlParams_, opts...) 3451 res, err := c.doRequest("json") 3452 if res != nil && res.StatusCode == http.StatusNotModified { 3453 if res.Body != nil { 3454 res.Body.Close() 3455 } 3456 return nil, &googleapi.Error{ 3457 Code: res.StatusCode, 3458 Header: res.Header, 3459 } 3460 } 3461 if err != nil { 3462 return nil, err 3463 } 3464 defer googleapi.CloseBody(res) 3465 if err := googleapi.CheckResponse(res); err != nil { 3466 return nil, err 3467 } 3468 ret := &ListWorkerPoolsResponse{ 3469 ServerResponse: googleapi.ServerResponse{ 3470 Header: res.Header, 3471 HTTPStatusCode: res.StatusCode, 3472 }, 3473 } 3474 target := &ret 3475 if err := gensupport.DecodeResponse(target, res); err != nil { 3476 return nil, err 3477 } 3478 return ret, nil 3479 // { 3480 // "description": "List project's `WorkerPool`s.", 3481 // "flatPath": "v1alpha1/projects/{projectsId}/workerPools", 3482 // "httpMethod": "GET", 3483 // "id": "cloudbuild.projects.workerPools.list", 3484 // "parameterOrder": [ 3485 // "parent" 3486 // ], 3487 // "parameters": { 3488 // "parent": { 3489 // "description": "ID of the parent project.", 3490 // "location": "path", 3491 // "pattern": "^projects/[^/]+$", 3492 // "required": true, 3493 // "type": "string" 3494 // } 3495 // }, 3496 // "path": "v1alpha1/{+parent}/workerPools", 3497 // "response": { 3498 // "$ref": "ListWorkerPoolsResponse" 3499 // }, 3500 // "scopes": [ 3501 // "https://www.googleapis.com/auth/cloud-platform" 3502 // ] 3503 // } 3504 3505} 3506 3507// method id "cloudbuild.projects.workerPools.patch": 3508 3509type ProjectsWorkerPoolsPatchCall struct { 3510 s *Service 3511 name string 3512 workerpool *WorkerPool 3513 urlParams_ gensupport.URLParams 3514 ctx_ context.Context 3515 header_ http.Header 3516} 3517 3518// Patch: Update a `WorkerPool`. 3519// 3520// - name: The field will contain name of the resource requested, for 3521// example: "projects/project-1/workerPools/workerpool-name". 3522func (r *ProjectsWorkerPoolsService) Patch(name string, workerpool *WorkerPool) *ProjectsWorkerPoolsPatchCall { 3523 c := &ProjectsWorkerPoolsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3524 c.name = name 3525 c.workerpool = workerpool 3526 return c 3527} 3528 3529// Fields allows partial responses to be retrieved. See 3530// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3531// for more information. 3532func (c *ProjectsWorkerPoolsPatchCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsPatchCall { 3533 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3534 return c 3535} 3536 3537// Context sets the context to be used in this call's Do method. Any 3538// pending HTTP request will be aborted if the provided context is 3539// canceled. 3540func (c *ProjectsWorkerPoolsPatchCall) Context(ctx context.Context) *ProjectsWorkerPoolsPatchCall { 3541 c.ctx_ = ctx 3542 return c 3543} 3544 3545// Header returns an http.Header that can be modified by the caller to 3546// add HTTP headers to the request. 3547func (c *ProjectsWorkerPoolsPatchCall) Header() http.Header { 3548 if c.header_ == nil { 3549 c.header_ = make(http.Header) 3550 } 3551 return c.header_ 3552} 3553 3554func (c *ProjectsWorkerPoolsPatchCall) doRequest(alt string) (*http.Response, error) { 3555 reqHeaders := make(http.Header) 3556 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210915") 3557 for k, v := range c.header_ { 3558 reqHeaders[k] = v 3559 } 3560 reqHeaders.Set("User-Agent", c.s.userAgent()) 3561 var body io.Reader = nil 3562 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workerpool) 3563 if err != nil { 3564 return nil, err 3565 } 3566 reqHeaders.Set("Content-Type", "application/json") 3567 c.urlParams_.Set("alt", alt) 3568 c.urlParams_.Set("prettyPrint", "false") 3569 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 3570 urls += "?" + c.urlParams_.Encode() 3571 req, err := http.NewRequest("PATCH", urls, body) 3572 if err != nil { 3573 return nil, err 3574 } 3575 req.Header = reqHeaders 3576 googleapi.Expand(req.URL, map[string]string{ 3577 "name": c.name, 3578 }) 3579 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3580} 3581 3582// Do executes the "cloudbuild.projects.workerPools.patch" call. 3583// Exactly one of *WorkerPool or error will be non-nil. Any non-2xx 3584// status code is an error. Response headers are in either 3585// *WorkerPool.ServerResponse.Header or (if a response was returned at 3586// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3587// to check whether the returned error was because 3588// http.StatusNotModified was returned. 3589func (c *ProjectsWorkerPoolsPatchCall) Do(opts ...googleapi.CallOption) (*WorkerPool, error) { 3590 gensupport.SetOptions(c.urlParams_, opts...) 3591 res, err := c.doRequest("json") 3592 if res != nil && res.StatusCode == http.StatusNotModified { 3593 if res.Body != nil { 3594 res.Body.Close() 3595 } 3596 return nil, &googleapi.Error{ 3597 Code: res.StatusCode, 3598 Header: res.Header, 3599 } 3600 } 3601 if err != nil { 3602 return nil, err 3603 } 3604 defer googleapi.CloseBody(res) 3605 if err := googleapi.CheckResponse(res); err != nil { 3606 return nil, err 3607 } 3608 ret := &WorkerPool{ 3609 ServerResponse: googleapi.ServerResponse{ 3610 Header: res.Header, 3611 HTTPStatusCode: res.StatusCode, 3612 }, 3613 } 3614 target := &ret 3615 if err := gensupport.DecodeResponse(target, res); err != nil { 3616 return nil, err 3617 } 3618 return ret, nil 3619 // { 3620 // "description": "Update a `WorkerPool`.", 3621 // "flatPath": "v1alpha1/projects/{projectsId}/workerPools/{workerPoolsId}", 3622 // "httpMethod": "PATCH", 3623 // "id": "cloudbuild.projects.workerPools.patch", 3624 // "parameterOrder": [ 3625 // "name" 3626 // ], 3627 // "parameters": { 3628 // "name": { 3629 // "description": "The field will contain name of the resource requested, for example: \"projects/project-1/workerPools/workerpool-name\"", 3630 // "location": "path", 3631 // "pattern": "^projects/[^/]+/workerPools/[^/]+$", 3632 // "required": true, 3633 // "type": "string" 3634 // } 3635 // }, 3636 // "path": "v1alpha1/{+name}", 3637 // "request": { 3638 // "$ref": "WorkerPool" 3639 // }, 3640 // "response": { 3641 // "$ref": "WorkerPool" 3642 // }, 3643 // "scopes": [ 3644 // "https://www.googleapis.com/auth/cloud-platform" 3645 // ] 3646 // } 3647 3648} 3649