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/v1beta1" 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/v1beta1" 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:v1beta1" 75const apiName = "cloudbuild" 76const apiVersion = "v1beta1" 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 Platform data 83 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 84) 85 86// NewService creates a new Service. 87func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 88 scopesOption := option.WithScopes( 89 "https://www.googleapis.com/auth/cloud-platform", 90 ) 91 // NOTE: prepend, so we don't override user-specified scopes. 92 opts = append([]option.ClientOption{scopesOption}, opts...) 93 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 94 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 95 client, endpoint, err := htransport.NewClient(ctx, opts...) 96 if err != nil { 97 return nil, err 98 } 99 s, err := New(client) 100 if err != nil { 101 return nil, err 102 } 103 if endpoint != "" { 104 s.BasePath = endpoint 105 } 106 return s, nil 107} 108 109// New creates a new Service. It uses the provided http.Client for requests. 110// 111// Deprecated: please use NewService instead. 112// To provide a custom HTTP client, use option.WithHTTPClient. 113// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 114func New(client *http.Client) (*Service, error) { 115 if client == nil { 116 return nil, errors.New("client is nil") 117 } 118 s := &Service{client: client, BasePath: basePath} 119 s.Projects = NewProjectsService(s) 120 return s, nil 121} 122 123type Service struct { 124 client *http.Client 125 BasePath string // API endpoint base URL 126 UserAgent string // optional additional User-Agent fragment 127 128 Projects *ProjectsService 129} 130 131func (s *Service) userAgent() string { 132 if s.UserAgent == "" { 133 return googleapi.UserAgent 134 } 135 return googleapi.UserAgent + " " + s.UserAgent 136} 137 138func NewProjectsService(s *Service) *ProjectsService { 139 rs := &ProjectsService{s: s} 140 rs.Locations = NewProjectsLocationsService(s) 141 return rs 142} 143 144type ProjectsService struct { 145 s *Service 146 147 Locations *ProjectsLocationsService 148} 149 150func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 151 rs := &ProjectsLocationsService{s: s} 152 rs.Operations = NewProjectsLocationsOperationsService(s) 153 rs.WorkerPools = NewProjectsLocationsWorkerPoolsService(s) 154 return rs 155} 156 157type ProjectsLocationsService struct { 158 s *Service 159 160 Operations *ProjectsLocationsOperationsService 161 162 WorkerPools *ProjectsLocationsWorkerPoolsService 163} 164 165func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 166 rs := &ProjectsLocationsOperationsService{s: s} 167 return rs 168} 169 170type ProjectsLocationsOperationsService struct { 171 s *Service 172} 173 174func NewProjectsLocationsWorkerPoolsService(s *Service) *ProjectsLocationsWorkerPoolsService { 175 rs := &ProjectsLocationsWorkerPoolsService{s: s} 176 return rs 177} 178 179type ProjectsLocationsWorkerPoolsService struct { 180 s *Service 181} 182 183// ArtifactObjects: Files in the workspace to upload to Cloud Storage 184// upon successful completion of all build steps. 185type ArtifactObjects struct { 186 // Location: Cloud Storage bucket and optional object path, in the form 187 // "gs://bucket/path/to/somewhere/". (see Bucket Name Requirements 188 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 189 // Files in the workspace matching any path pattern will be uploaded to 190 // Cloud Storage with this location as a prefix. 191 Location string `json:"location,omitempty"` 192 193 // Paths: Path globs used to match files in the build's workspace. 194 Paths []string `json:"paths,omitempty"` 195 196 // Timing: Output only. Stores timing information for pushing all 197 // artifact objects. 198 Timing *TimeSpan `json:"timing,omitempty"` 199 200 // ForceSendFields is a list of field names (e.g. "Location") to 201 // unconditionally include in API requests. By default, fields with 202 // empty values are omitted from API requests. However, any non-pointer, 203 // non-interface field appearing in ForceSendFields will be sent to the 204 // server regardless of whether the field is empty or not. This may be 205 // used to include empty fields in Patch requests. 206 ForceSendFields []string `json:"-"` 207 208 // NullFields is a list of field names (e.g. "Location") to include in 209 // API requests with the JSON null value. By default, fields with empty 210 // values are omitted from API requests. However, any field with an 211 // empty value appearing in NullFields will be sent to the server as 212 // null. It is an error if a field in this list has a non-empty value. 213 // This may be used to include null fields in Patch requests. 214 NullFields []string `json:"-"` 215} 216 217func (s *ArtifactObjects) MarshalJSON() ([]byte, error) { 218 type NoMethod ArtifactObjects 219 raw := NoMethod(*s) 220 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 221} 222 223// ArtifactResult: An artifact that was uploaded during a build. This is 224// a single record in the artifact manifest JSON file. 225type ArtifactResult struct { 226 // FileHash: The file hash of the artifact. 227 FileHash []*FileHashes `json:"fileHash,omitempty"` 228 229 // Location: The path of an artifact in a Google Cloud Storage bucket, 230 // with the generation number. For example, 231 // `gs://mybucket/path/to/output.jar#generation`. 232 Location string `json:"location,omitempty"` 233 234 // ForceSendFields is a list of field names (e.g. "FileHash") to 235 // unconditionally include in API requests. By default, fields with 236 // empty values are omitted from API requests. However, any non-pointer, 237 // non-interface field appearing in ForceSendFields will be sent to the 238 // server regardless of whether the field is empty or not. This may be 239 // used to include empty fields in Patch requests. 240 ForceSendFields []string `json:"-"` 241 242 // NullFields is a list of field names (e.g. "FileHash") to include in 243 // API requests with the JSON null value. By default, fields with empty 244 // values are omitted from API requests. However, any field with an 245 // empty value appearing in NullFields will be sent to the server as 246 // null. It is an error if a field in this list has a non-empty value. 247 // This may be used to include null fields in Patch requests. 248 NullFields []string `json:"-"` 249} 250 251func (s *ArtifactResult) MarshalJSON() ([]byte, error) { 252 type NoMethod ArtifactResult 253 raw := NoMethod(*s) 254 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 255} 256 257// Artifacts: Artifacts produced by a build that should be uploaded upon 258// successful completion of all build steps. 259type Artifacts struct { 260 // Images: A list of images to be pushed upon the successful completion 261 // of all build steps. The images will be pushed using the builder 262 // service account's credentials. The digests of the pushed images will 263 // be stored in the Build resource's results field. If any of the images 264 // fail to be pushed, the build is marked FAILURE. 265 Images []string `json:"images,omitempty"` 266 267 // Objects: A list of objects to be uploaded to Cloud Storage upon 268 // successful completion of all build steps. Files in the workspace 269 // matching specified paths globs will be uploaded to the specified 270 // Cloud Storage location using the builder service account's 271 // credentials. The location and generation of the uploaded objects will 272 // be stored in the Build resource's results field. If any objects fail 273 // to be pushed, the build is marked FAILURE. 274 Objects *ArtifactObjects `json:"objects,omitempty"` 275 276 // ForceSendFields is a list of field names (e.g. "Images") to 277 // unconditionally include in API requests. By default, fields with 278 // empty values are omitted from API requests. However, any non-pointer, 279 // non-interface field appearing in ForceSendFields will be sent to the 280 // server regardless of whether the field is empty or not. This may be 281 // used to include empty fields in Patch requests. 282 ForceSendFields []string `json:"-"` 283 284 // NullFields is a list of field names (e.g. "Images") to include in API 285 // requests with the JSON null value. By default, fields with empty 286 // values are omitted from API requests. However, any field with an 287 // empty value appearing in NullFields will be sent to the server as 288 // null. It is an error if a field in this list has a non-empty value. 289 // This may be used to include null fields in Patch requests. 290 NullFields []string `json:"-"` 291} 292 293func (s *Artifacts) MarshalJSON() ([]byte, error) { 294 type NoMethod Artifacts 295 raw := NoMethod(*s) 296 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 297} 298 299// Build: A build resource in the Cloud Build API. At a high level, a 300// `Build` describes where to find source code, how to build it (for 301// example, the builder image to run on the source), and where to store 302// the built artifacts. Fields can include the following variables, 303// which will be expanded when the build is created: - $PROJECT_ID: the 304// project ID of the build. - $PROJECT_NUMBER: the project number of the 305// build. - $BUILD_ID: the autogenerated ID of the build. - $REPO_NAME: 306// the source repository name specified by RepoSource. - $BRANCH_NAME: 307// the branch name specified by RepoSource. - $TAG_NAME: the tag name 308// specified by RepoSource. - $REVISION_ID or $COMMIT_SHA: the commit 309// SHA specified by RepoSource or resolved from the specified branch or 310// tag. - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA. 311type Build struct { 312 // Artifacts: Artifacts produced by the build that should be uploaded 313 // upon successful completion of all build steps. 314 Artifacts *Artifacts `json:"artifacts,omitempty"` 315 316 // AvailableSecrets: Secrets and secret environment variables. 317 AvailableSecrets *Secrets `json:"availableSecrets,omitempty"` 318 319 // BuildTriggerId: Output only. The ID of the `BuildTrigger` that 320 // triggered this build, if it was triggered automatically. 321 BuildTriggerId string `json:"buildTriggerId,omitempty"` 322 323 // CreateTime: Output only. Time at which the request to create the 324 // build was received. 325 CreateTime string `json:"createTime,omitempty"` 326 327 // FinishTime: Output only. Time at which execution of the build was 328 // finished. The difference between finish_time and start_time is the 329 // duration of the build's execution. 330 FinishTime string `json:"finishTime,omitempty"` 331 332 // Id: Output only. Unique identifier of the build. 333 Id string `json:"id,omitempty"` 334 335 // Images: A list of images to be pushed upon the successful completion 336 // of all build steps. The images are pushed using the builder service 337 // account's credentials. The digests of the pushed images will be 338 // stored in the `Build` resource's results field. If any of the images 339 // fail to be pushed, the build status is marked `FAILURE`. 340 Images []string `json:"images,omitempty"` 341 342 // LogUrl: Output only. URL to logs for this build in Google Cloud 343 // Console. 344 LogUrl string `json:"logUrl,omitempty"` 345 346 // LogsBucket: Google Cloud Storage bucket where logs should be written 347 // (see Bucket Name Requirements 348 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 349 // Logs file names will be of the format 350 // `${logs_bucket}/log-${build_id}.txt`. 351 LogsBucket string `json:"logsBucket,omitempty"` 352 353 // Name: Output only. The 'Build' name with format: 354 // `projects/{project}/locations/{location}/builds/{build}`, where 355 // {build} is a unique identifier generated by the service. 356 Name string `json:"name,omitempty"` 357 358 // Options: Special options for this build. 359 Options *BuildOptions `json:"options,omitempty"` 360 361 // ProjectId: Output only. ID of the project. 362 ProjectId string `json:"projectId,omitempty"` 363 364 // QueueTtl: TTL in queue for this build. If provided and the build is 365 // enqueued longer than this value, the build will expire and the build 366 // status will be `EXPIRED`. The TTL starts ticking from create_time. 367 QueueTtl string `json:"queueTtl,omitempty"` 368 369 // Results: Output only. Results of the build. 370 Results *Results `json:"results,omitempty"` 371 372 // Secrets: Secrets to decrypt using Cloud Key Management Service. Note: 373 // Secret Manager is the recommended technique for managing sensitive 374 // data with Cloud Build. Use `available_secrets` to configure builds to 375 // access secrets from Secret Manager. For instructions, see: 376 // https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets 377 Secrets []*Secret `json:"secrets,omitempty"` 378 379 // ServiceAccount: IAM service account whose credentials will be used at 380 // build runtime. Must be of the format 381 // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. ACCOUNT can be 382 // email address or uniqueId of the service account. This field is in 383 // beta. 384 ServiceAccount string `json:"serviceAccount,omitempty"` 385 386 // Source: The location of the source files to build. 387 Source *Source `json:"source,omitempty"` 388 389 // SourceProvenance: Output only. A permanent fixed identifier for 390 // source. 391 SourceProvenance *SourceProvenance `json:"sourceProvenance,omitempty"` 392 393 // StartTime: Output only. Time at which execution of the build was 394 // started. 395 StartTime string `json:"startTime,omitempty"` 396 397 // Status: Output only. Status of the build. 398 // 399 // Possible values: 400 // "STATUS_UNKNOWN" - Status of the build is unknown. 401 // "QUEUED" - Build or step is queued; work has not yet begun. 402 // "WORKING" - Build or step is being executed. 403 // "SUCCESS" - Build or step finished successfully. 404 // "FAILURE" - Build or step failed to complete successfully. 405 // "INTERNAL_ERROR" - Build or step failed due to an internal cause. 406 // "TIMEOUT" - Build or step took longer than was allowed. 407 // "CANCELLED" - Build or step was canceled by a user. 408 // "EXPIRED" - Build was enqueued for longer than the value of 409 // `queue_ttl`. 410 Status string `json:"status,omitempty"` 411 412 // StatusDetail: Output only. Customer-readable message about the 413 // current status. 414 StatusDetail string `json:"statusDetail,omitempty"` 415 416 // Steps: Required. The operations to be performed on the workspace. 417 Steps []*BuildStep `json:"steps,omitempty"` 418 419 // Substitutions: Substitutions data for `Build` resource. 420 Substitutions map[string]string `json:"substitutions,omitempty"` 421 422 // Tags: Tags for annotation of a `Build`. These are not docker tags. 423 Tags []string `json:"tags,omitempty"` 424 425 // Timeout: Amount of time that this build should be allowed to run, to 426 // second granularity. If this amount of time elapses, work on the build 427 // will cease and the build status will be `TIMEOUT`. `timeout` starts 428 // ticking from `startTime`. Default time is ten minutes. 429 Timeout string `json:"timeout,omitempty"` 430 431 // Timing: Output only. Stores timing information for phases of the 432 // build. Valid keys are: * BUILD: time to execute all build steps * 433 // PUSH: time to push all specified images. * FETCHSOURCE: time to fetch 434 // source. If the build does not specify source or images, these keys 435 // will not be included. 436 Timing map[string]TimeSpan `json:"timing,omitempty"` 437 438 // ForceSendFields is a list of field names (e.g. "Artifacts") to 439 // unconditionally include in API requests. By default, fields with 440 // empty values are omitted from API requests. However, any non-pointer, 441 // non-interface field appearing in ForceSendFields will be sent to the 442 // server regardless of whether the field is empty or not. This may be 443 // used to include empty fields in Patch requests. 444 ForceSendFields []string `json:"-"` 445 446 // NullFields is a list of field names (e.g. "Artifacts") to include in 447 // API requests with the JSON null value. By default, fields with empty 448 // values are omitted from API requests. However, any field with an 449 // empty value appearing in NullFields will be sent to the server as 450 // null. It is an error if a field in this list has a non-empty value. 451 // This may be used to include null fields in Patch requests. 452 NullFields []string `json:"-"` 453} 454 455func (s *Build) MarshalJSON() ([]byte, error) { 456 type NoMethod Build 457 raw := NoMethod(*s) 458 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 459} 460 461// BuildOperationMetadata: Metadata for build operations. 462type BuildOperationMetadata struct { 463 // Build: The build that the operation is tracking. 464 Build *Build `json:"build,omitempty"` 465 466 // ForceSendFields is a list of field names (e.g. "Build") to 467 // unconditionally include in API requests. By default, fields with 468 // empty values are omitted from API requests. However, any non-pointer, 469 // non-interface field appearing in ForceSendFields will be sent to the 470 // server regardless of whether the field is empty or not. This may be 471 // used to include empty fields in Patch requests. 472 ForceSendFields []string `json:"-"` 473 474 // NullFields is a list of field names (e.g. "Build") to include in API 475 // requests with the JSON null value. By default, fields with empty 476 // values are omitted from API requests. However, any field with an 477 // empty value appearing in NullFields will be sent to the server as 478 // null. It is an error if a field in this list has a non-empty value. 479 // This may be used to include null fields in Patch requests. 480 NullFields []string `json:"-"` 481} 482 483func (s *BuildOperationMetadata) MarshalJSON() ([]byte, error) { 484 type NoMethod BuildOperationMetadata 485 raw := NoMethod(*s) 486 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 487} 488 489// BuildOptions: Optional arguments to enable specific features of 490// builds. 491type BuildOptions struct { 492 // DiskSizeGb: Requested disk size for the VM that runs the build. Note 493 // that this is *NOT* "disk free"; some of the space will be used by the 494 // operating system and build utilities. Also note that this is the 495 // minimum disk size that will be allocated for the build -- the build 496 // may run with a larger disk than requested. At present, the maximum 497 // disk size is 1000GB; builds that request more than the maximum are 498 // rejected with an error. 499 DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` 500 501 // DynamicSubstitutions: Option to specify whether or not to apply bash 502 // style string operations to the substitutions. NOTE: this is always 503 // enabled for triggered builds and cannot be overridden in the build 504 // configuration file. 505 DynamicSubstitutions bool `json:"dynamicSubstitutions,omitempty"` 506 507 // Env: A list of global environment variable definitions that will 508 // exist for all build steps in this build. If a variable is defined in 509 // both globally and in a build step, the variable will use the build 510 // step value. The elements are of the form "KEY=VALUE" for the 511 // environment variable "KEY" being given the value "VALUE". 512 Env []string `json:"env,omitempty"` 513 514 // LogStreamingOption: Option to define build log streaming behavior to 515 // Google Cloud Storage. 516 // 517 // Possible values: 518 // "STREAM_DEFAULT" - Service may automatically determine build log 519 // streaming behavior. 520 // "STREAM_ON" - Build logs should be streamed to Google Cloud 521 // Storage. 522 // "STREAM_OFF" - Build logs should not be streamed to Google Cloud 523 // Storage; they will be written when the build is completed. 524 LogStreamingOption string `json:"logStreamingOption,omitempty"` 525 526 // Logging: Option to specify the logging mode, which determines if and 527 // where build logs are stored. 528 // 529 // Possible values: 530 // "LOGGING_UNSPECIFIED" - The service determines the logging mode. 531 // The default is `LEGACY`. Do not rely on the default logging behavior 532 // as it may change in the future. 533 // "LEGACY" - Cloud Logging and Cloud Storage logging are enabled. 534 // "GCS_ONLY" - Only Cloud Storage logging is enabled. 535 // "STACKDRIVER_ONLY" - This option is the same as CLOUD_LOGGING_ONLY. 536 // "CLOUD_LOGGING_ONLY" - Only Cloud Logging is enabled. Note that 537 // logs for both the Cloud Console UI and Cloud SDK are based on Cloud 538 // Storage logs, so neither will provide logs if this option is chosen. 539 // "NONE" - Turn off all logging. No build logs will be captured. 540 Logging string `json:"logging,omitempty"` 541 542 // MachineType: Compute Engine machine type on which to run the build. 543 // 544 // Possible values: 545 // "UNSPECIFIED" - Standard machine type. 546 // "N1_HIGHCPU_8" - Highcpu machine with 8 CPUs. 547 // "N1_HIGHCPU_32" - Highcpu machine with 32 CPUs. 548 // "E2_HIGHCPU_8" - Highcpu e2 machine with 8 CPUs. 549 // "E2_HIGHCPU_32" - Highcpu e2 machine with 32 CPUs. 550 MachineType string `json:"machineType,omitempty"` 551 552 // RequestedVerifyOption: Requested verifiability options. 553 // 554 // Possible values: 555 // "NOT_VERIFIED" - Not a verifiable build. (default) 556 // "VERIFIED" - Verified build. 557 RequestedVerifyOption string `json:"requestedVerifyOption,omitempty"` 558 559 // SecretEnv: A list of global environment variables, which are 560 // encrypted using a Cloud Key Management Service crypto key. These 561 // values must be specified in the build's `Secret`. These variables 562 // will be available to all build steps in this build. 563 SecretEnv []string `json:"secretEnv,omitempty"` 564 565 // SourceProvenanceHash: Requested hash for SourceProvenance. 566 // 567 // Possible values: 568 // "NONE" - No hash requested. 569 // "SHA256" - Use a sha256 hash. 570 // "MD5" - Use a md5 hash. 571 SourceProvenanceHash []string `json:"sourceProvenanceHash,omitempty"` 572 573 // SubstitutionOption: Option to specify behavior when there is an error 574 // in the substitution checks. NOTE: this is always set to ALLOW_LOOSE 575 // for triggered builds and cannot be overridden in the build 576 // configuration file. 577 // 578 // Possible values: 579 // "MUST_MATCH" - Fails the build if error in substitutions checks, 580 // like missing a substitution in the template or in the map. 581 // "ALLOW_LOOSE" - Do not fail the build if error in substitutions 582 // checks. 583 SubstitutionOption string `json:"substitutionOption,omitempty"` 584 585 // Volumes: Global list of volumes to mount for ALL build steps Each 586 // volume is created as an empty volume prior to starting the build 587 // process. Upon completion of the build, volumes and their contents are 588 // discarded. Global volume names and paths cannot conflict with the 589 // volumes defined a build step. Using a global volume in a build with 590 // only one step is not valid as it is indicative of a build request 591 // with an incorrect configuration. 592 Volumes []*Volume `json:"volumes,omitempty"` 593 594 // WorkerPool: Option to specify a `WorkerPool` for the build. Format: 595 // projects/{project}/locations/{location}/workerPools/{workerPool} This 596 // field is in beta and is available only to restricted users. 597 WorkerPool string `json:"workerPool,omitempty"` 598 599 // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to 600 // unconditionally include in API requests. By default, fields with 601 // empty values are omitted from API requests. However, any non-pointer, 602 // non-interface field appearing in ForceSendFields will be sent to the 603 // server regardless of whether the field is empty or not. This may be 604 // used to include empty fields in Patch requests. 605 ForceSendFields []string `json:"-"` 606 607 // NullFields is a list of field names (e.g. "DiskSizeGb") to include in 608 // API requests with the JSON null value. By default, fields with empty 609 // values are omitted from API requests. However, any field with an 610 // empty value appearing in NullFields will be sent to the server as 611 // null. It is an error if a field in this list has a non-empty value. 612 // This may be used to include null fields in Patch requests. 613 NullFields []string `json:"-"` 614} 615 616func (s *BuildOptions) MarshalJSON() ([]byte, error) { 617 type NoMethod BuildOptions 618 raw := NoMethod(*s) 619 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 620} 621 622// BuildStep: A step in the build pipeline. 623type BuildStep struct { 624 // Args: A list of arguments that will be presented to the step when it 625 // is started. If the image used to run the step's container has an 626 // entrypoint, the `args` are used as arguments to that entrypoint. If 627 // the image does not define an entrypoint, the first element in args is 628 // used as the entrypoint, and the remainder will be used as arguments. 629 Args []string `json:"args,omitempty"` 630 631 // Dir: Working directory to use when running this step's container. If 632 // this value is a relative path, it is relative to the build's working 633 // directory. If this value is absolute, it may be outside the build's 634 // working directory, in which case the contents of the path may not be 635 // persisted across build step executions, unless a `volume` for that 636 // path is specified. If the build specifies a `RepoSource` with `dir` 637 // and a step with a `dir`, which specifies an absolute path, the 638 // `RepoSource` `dir` is ignored for the step's execution. 639 Dir string `json:"dir,omitempty"` 640 641 // Entrypoint: Entrypoint to be used instead of the build step image's 642 // default entrypoint. If unset, the image's default entrypoint is used. 643 Entrypoint string `json:"entrypoint,omitempty"` 644 645 // Env: A list of environment variable definitions to be used when 646 // running a step. The elements are of the form "KEY=VALUE" for the 647 // environment variable "KEY" being given the value "VALUE". 648 Env []string `json:"env,omitempty"` 649 650 // Id: Unique identifier for this build step, used in `wait_for` to 651 // reference this build step as a dependency. 652 Id string `json:"id,omitempty"` 653 654 // Name: Required. The name of the container image that will run this 655 // particular build step. If the image is available in the host's Docker 656 // daemon's cache, it will be run directly. If not, the host will 657 // attempt to pull the image first, using the builder service account's 658 // credentials if necessary. The Docker daemon's cache will already have 659 // the latest versions of all of the officially supported build steps 660 // (https://github.com/GoogleCloudPlatform/cloud-builders 661 // (https://github.com/GoogleCloudPlatform/cloud-builders)). The Docker 662 // daemon will also have cached many of the layers for some popular 663 // images, like "ubuntu", "debian", but they will be refreshed at the 664 // time you attempt to use them. If you built an image in a previous 665 // build step, it will be stored in the host's Docker daemon's cache and 666 // is available to use as the name for a later build step. 667 Name string `json:"name,omitempty"` 668 669 // PullTiming: Output only. Stores timing information for pulling this 670 // build step's builder image only. 671 PullTiming *TimeSpan `json:"pullTiming,omitempty"` 672 673 // SecretEnv: A list of environment variables which are encrypted using 674 // a Cloud Key Management Service crypto key. These values must be 675 // specified in the build's `Secret`. 676 SecretEnv []string `json:"secretEnv,omitempty"` 677 678 // Status: Output only. Status of the build step. At this time, build 679 // step status is only updated on build completion; step status is not 680 // updated in real-time as the build progresses. 681 // 682 // Possible values: 683 // "STATUS_UNKNOWN" - Status of the build is unknown. 684 // "QUEUED" - Build or step is queued; work has not yet begun. 685 // "WORKING" - Build or step is being executed. 686 // "SUCCESS" - Build or step finished successfully. 687 // "FAILURE" - Build or step failed to complete successfully. 688 // "INTERNAL_ERROR" - Build or step failed due to an internal cause. 689 // "TIMEOUT" - Build or step took longer than was allowed. 690 // "CANCELLED" - Build or step was canceled by a user. 691 // "EXPIRED" - Build was enqueued for longer than the value of 692 // `queue_ttl`. 693 Status string `json:"status,omitempty"` 694 695 // Timeout: Time limit for executing this build step. If not defined, 696 // the step has no time limit and will be allowed to continue to run 697 // until either it completes or the build itself times out. 698 Timeout string `json:"timeout,omitempty"` 699 700 // Timing: Output only. Stores timing information for executing this 701 // build step. 702 Timing *TimeSpan `json:"timing,omitempty"` 703 704 // Volumes: List of volumes to mount into the build step. Each volume is 705 // created as an empty volume prior to execution of the build step. Upon 706 // completion of the build, volumes and their contents are discarded. 707 // Using a named volume in only one step is not valid as it is 708 // indicative of a build request with an incorrect configuration. 709 Volumes []*Volume `json:"volumes,omitempty"` 710 711 // WaitFor: The ID(s) of the step(s) that this build step depends on. 712 // This build step will not start until all the build steps in 713 // `wait_for` have completed successfully. If `wait_for` is empty, this 714 // build step will start when all previous build steps in the 715 // `Build.Steps` list have completed successfully. 716 WaitFor []string `json:"waitFor,omitempty"` 717 718 // ForceSendFields is a list of field names (e.g. "Args") to 719 // unconditionally include in API requests. By default, fields with 720 // empty values are omitted from API requests. However, any non-pointer, 721 // non-interface field appearing in ForceSendFields will be sent to the 722 // server regardless of whether the field is empty or not. This may be 723 // used to include empty fields in Patch requests. 724 ForceSendFields []string `json:"-"` 725 726 // NullFields is a list of field names (e.g. "Args") to include in API 727 // requests with the JSON null value. By default, fields with empty 728 // values are omitted from API requests. However, any field with an 729 // empty value appearing in NullFields will be sent to the server as 730 // null. It is an error if a field in this list has a non-empty value. 731 // This may be used to include null fields in Patch requests. 732 NullFields []string `json:"-"` 733} 734 735func (s *BuildStep) MarshalJSON() ([]byte, error) { 736 type NoMethod BuildStep 737 raw := NoMethod(*s) 738 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 739} 740 741// BuiltImage: An image built by the pipeline. 742type BuiltImage struct { 743 // Digest: Docker Registry 2.0 digest. 744 Digest string `json:"digest,omitempty"` 745 746 // Name: Name used to push the container image to Google Container 747 // Registry, as presented to `docker push`. 748 Name string `json:"name,omitempty"` 749 750 // PushTiming: Output only. Stores timing information for pushing the 751 // specified image. 752 PushTiming *TimeSpan `json:"pushTiming,omitempty"` 753 754 // ForceSendFields is a list of field names (e.g. "Digest") to 755 // unconditionally include in API requests. By default, fields with 756 // empty values are omitted from API requests. However, any non-pointer, 757 // non-interface field appearing in ForceSendFields will be sent to the 758 // server regardless of whether the field is empty or not. This may be 759 // used to include empty fields in Patch requests. 760 ForceSendFields []string `json:"-"` 761 762 // NullFields is a list of field names (e.g. "Digest") to include in API 763 // requests with the JSON null value. By default, fields with empty 764 // values are omitted from API requests. However, any field with an 765 // empty value appearing in NullFields will be sent to the server as 766 // null. It is an error if a field in this list has a non-empty value. 767 // This may be used to include null fields in Patch requests. 768 NullFields []string `json:"-"` 769} 770 771func (s *BuiltImage) MarshalJSON() ([]byte, error) { 772 type NoMethod BuiltImage 773 raw := NoMethod(*s) 774 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 775} 776 777// CancelOperationRequest: The request message for 778// Operations.CancelOperation. 779type CancelOperationRequest struct { 780} 781 782// Empty: A generic empty message that you can re-use to avoid defining 783// duplicated empty messages in your APIs. A typical example is to use 784// it as the request or the response type of an API method. For 785// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 786// (google.protobuf.Empty); } The JSON representation for `Empty` is 787// empty JSON object `{}`. 788type Empty struct { 789 // ServerResponse contains the HTTP response code and headers from the 790 // server. 791 googleapi.ServerResponse `json:"-"` 792} 793 794// FileHashes: Container message for hashes of byte content of files, 795// used in SourceProvenance messages to verify integrity of source input 796// to the build. 797type FileHashes struct { 798 // FileHash: Collection of file hashes. 799 FileHash []*Hash `json:"fileHash,omitempty"` 800 801 // ForceSendFields is a list of field names (e.g. "FileHash") to 802 // unconditionally include in API requests. By default, fields with 803 // empty values are omitted from API requests. However, any non-pointer, 804 // non-interface field appearing in ForceSendFields will be sent to the 805 // server regardless of whether the field is empty or not. This may be 806 // used to include empty fields in Patch requests. 807 ForceSendFields []string `json:"-"` 808 809 // NullFields is a list of field names (e.g. "FileHash") to include in 810 // API requests with the JSON null value. By default, fields with empty 811 // values are omitted from API requests. However, any field with an 812 // empty value appearing in NullFields will be sent to the server as 813 // null. It is an error if a field in this list has a non-empty value. 814 // This may be used to include null fields in Patch requests. 815 NullFields []string `json:"-"` 816} 817 818func (s *FileHashes) MarshalJSON() ([]byte, error) { 819 type NoMethod FileHashes 820 raw := NoMethod(*s) 821 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 822} 823 824// HTTPDelivery: HTTPDelivery is the delivery configuration for an HTTP 825// notification. 826type HTTPDelivery struct { 827 // Uri: The URI to which JSON-containing HTTP POST requests should be 828 // sent. 829 Uri string `json:"uri,omitempty"` 830 831 // ForceSendFields is a list of field names (e.g. "Uri") to 832 // unconditionally include in API requests. By default, fields with 833 // empty values are omitted from API requests. However, any non-pointer, 834 // non-interface field appearing in ForceSendFields will be sent to the 835 // server regardless of whether the field is empty or not. This may be 836 // used to include empty fields in Patch requests. 837 ForceSendFields []string `json:"-"` 838 839 // NullFields is a list of field names (e.g. "Uri") to include in API 840 // requests with the JSON null value. By default, fields with empty 841 // values are omitted from API requests. However, any field with an 842 // empty value appearing in NullFields will be sent to the server as 843 // null. It is an error if a field in this list has a non-empty value. 844 // This may be used to include null fields in Patch requests. 845 NullFields []string `json:"-"` 846} 847 848func (s *HTTPDelivery) MarshalJSON() ([]byte, error) { 849 type NoMethod HTTPDelivery 850 raw := NoMethod(*s) 851 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 852} 853 854// Hash: Container message for hash values. 855type Hash struct { 856 // Type: The type of hash that was performed. 857 // 858 // Possible values: 859 // "NONE" - No hash requested. 860 // "SHA256" - Use a sha256 hash. 861 // "MD5" - Use a md5 hash. 862 Type string `json:"type,omitempty"` 863 864 // Value: The hash value. 865 Value string `json:"value,omitempty"` 866 867 // ForceSendFields is a list of field names (e.g. "Type") to 868 // unconditionally include in API requests. By default, fields with 869 // empty values are omitted from API requests. However, any non-pointer, 870 // non-interface field appearing in ForceSendFields will be sent to the 871 // server regardless of whether the field is empty or not. This may be 872 // used to include empty fields in Patch requests. 873 ForceSendFields []string `json:"-"` 874 875 // NullFields is a list of field names (e.g. "Type") to include in API 876 // requests with the JSON null value. By default, fields with empty 877 // values are omitted from API requests. However, any field with an 878 // empty value appearing in NullFields will be sent to the server as 879 // null. It is an error if a field in this list has a non-empty value. 880 // This may be used to include null fields in Patch requests. 881 NullFields []string `json:"-"` 882} 883 884func (s *Hash) MarshalJSON() ([]byte, error) { 885 type NoMethod Hash 886 raw := NoMethod(*s) 887 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 888} 889 890// InlineSecret: Pairs a set of secret environment variables mapped to 891// encrypted values with the Cloud KMS key to use to decrypt the value. 892type InlineSecret struct { 893 // EnvMap: Map of environment variable name to its encrypted value. 894 // Secret environment variables must be unique across all of a build's 895 // secrets, and must be used by at least one build step. Values can be 896 // at most 64 KB in size. There can be at most 100 secret values across 897 // all of a build's secrets. 898 EnvMap map[string]string `json:"envMap,omitempty"` 899 900 // KmsKeyName: Resource name of Cloud KMS crypto key to decrypt the 901 // encrypted value. In format: 902 // projects/*/locations/*/keyRings/*/cryptoKeys/* 903 KmsKeyName string `json:"kmsKeyName,omitempty"` 904 905 // ForceSendFields is a list of field names (e.g. "EnvMap") to 906 // unconditionally include in API requests. By default, fields with 907 // empty values are omitted from API requests. However, any non-pointer, 908 // non-interface field appearing in ForceSendFields will be sent to the 909 // server regardless of whether the field is empty or not. This may be 910 // used to include empty fields in Patch requests. 911 ForceSendFields []string `json:"-"` 912 913 // NullFields is a list of field names (e.g. "EnvMap") to include in API 914 // requests with the JSON null value. By default, fields with empty 915 // values are omitted from API requests. However, any field with an 916 // empty value appearing in NullFields will be sent to the server as 917 // null. It is an error if a field in this list has a non-empty value. 918 // This may be used to include null fields in Patch requests. 919 NullFields []string `json:"-"` 920} 921 922func (s *InlineSecret) MarshalJSON() ([]byte, error) { 923 type NoMethod InlineSecret 924 raw := NoMethod(*s) 925 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 926} 927 928// ListWorkerPoolsResponse: Response containing existing `WorkerPools`. 929type ListWorkerPoolsResponse struct { 930 // WorkerPools: `WorkerPools` for the specified project. 931 WorkerPools []*WorkerPool `json:"workerPools,omitempty"` 932 933 // ServerResponse contains the HTTP response code and headers from the 934 // server. 935 googleapi.ServerResponse `json:"-"` 936 937 // ForceSendFields is a list of field names (e.g. "WorkerPools") to 938 // unconditionally include in API requests. By default, fields with 939 // empty values are omitted from API requests. However, any non-pointer, 940 // non-interface field appearing in ForceSendFields will be sent to the 941 // server regardless of whether the field is empty or not. This may be 942 // used to include empty fields in Patch requests. 943 ForceSendFields []string `json:"-"` 944 945 // NullFields is a list of field names (e.g. "WorkerPools") to include 946 // in API requests with the JSON null value. By default, fields with 947 // empty values are omitted from API requests. However, any field with 948 // an empty value appearing in NullFields will be sent to the server as 949 // null. It is an error if a field in this list has a non-empty value. 950 // This may be used to include null fields in Patch requests. 951 NullFields []string `json:"-"` 952} 953 954func (s *ListWorkerPoolsResponse) MarshalJSON() ([]byte, error) { 955 type NoMethod ListWorkerPoolsResponse 956 raw := NoMethod(*s) 957 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 958} 959 960// NetworkConfig: Network describes the network configuration for a 961// `WorkerPool`. 962type NetworkConfig struct { 963 // PeeredNetwork: Required. Immutable. The network definition that the 964 // workers are peered to. If this section is left empty, the workers 965 // will be peered to `WorkerPool.project_id` on the service producer 966 // network. Must be in the format 967 // `projects/{project}/global/networks/{network}`, where `{project}` is 968 // a project number, such as `12345`, and `{network}` is the name of a 969 // VPC network in the project. See Understanding network configuration 970 // options 971 // (https://cloud.google.com/cloud-build/docs/custom-workers/set-up-custom-worker-pool-environment#understanding_the_network_configuration_options) 972 PeeredNetwork string `json:"peeredNetwork,omitempty"` 973 974 // ForceSendFields is a list of field names (e.g. "PeeredNetwork") to 975 // unconditionally include in API requests. By default, fields with 976 // empty values are omitted from API requests. However, any non-pointer, 977 // non-interface field appearing in ForceSendFields will be sent to the 978 // server regardless of whether the field is empty or not. This may be 979 // used to include empty fields in Patch requests. 980 ForceSendFields []string `json:"-"` 981 982 // NullFields is a list of field names (e.g. "PeeredNetwork") to include 983 // in API requests with the JSON null value. By default, fields with 984 // empty values are omitted from API requests. However, any field with 985 // an empty value appearing in NullFields will be sent to the server as 986 // null. It is an error if a field in this list has a non-empty value. 987 // This may be used to include null fields in Patch requests. 988 NullFields []string `json:"-"` 989} 990 991func (s *NetworkConfig) MarshalJSON() ([]byte, error) { 992 type NoMethod NetworkConfig 993 raw := NoMethod(*s) 994 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 995} 996 997// Notification: Notification is the container which holds the data that 998// is relevant to this particular notification. 999type Notification struct { 1000 // Filter: The filter string to use for notification filtering. 1001 // Currently, this is assumed to be a CEL program. See 1002 // https://opensource.google/projects/cel for more. 1003 Filter string `json:"filter,omitempty"` 1004 1005 // HttpDelivery: Configuration for HTTP delivery. 1006 HttpDelivery *HTTPDelivery `json:"httpDelivery,omitempty"` 1007 1008 // SlackDelivery: Configuration for Slack delivery. 1009 SlackDelivery *SlackDelivery `json:"slackDelivery,omitempty"` 1010 1011 // SmtpDelivery: Configuration for SMTP (email) delivery. 1012 SmtpDelivery *SMTPDelivery `json:"smtpDelivery,omitempty"` 1013 1014 // StructDelivery: Escape hatch for users to supply custom delivery 1015 // configs. 1016 StructDelivery googleapi.RawMessage `json:"structDelivery,omitempty"` 1017 1018 // ForceSendFields is a list of field names (e.g. "Filter") to 1019 // unconditionally include in API requests. By default, fields with 1020 // empty values are omitted from API requests. However, any non-pointer, 1021 // non-interface field appearing in ForceSendFields will be sent to the 1022 // server regardless of whether the field is empty or not. This may be 1023 // used to include empty fields in Patch requests. 1024 ForceSendFields []string `json:"-"` 1025 1026 // NullFields is a list of field names (e.g. "Filter") to include in API 1027 // requests with the JSON null value. By default, fields with empty 1028 // values are omitted from API requests. However, any field with an 1029 // empty value appearing in NullFields will be sent to the server as 1030 // null. It is an error if a field in this list has a non-empty value. 1031 // This may be used to include null fields in Patch requests. 1032 NullFields []string `json:"-"` 1033} 1034 1035func (s *Notification) MarshalJSON() ([]byte, error) { 1036 type NoMethod Notification 1037 raw := NoMethod(*s) 1038 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1039} 1040 1041// NotifierConfig: NotifierConfig is the top-level configuration 1042// message. 1043type NotifierConfig struct { 1044 // ApiVersion: The API version of this configuration format. 1045 ApiVersion string `json:"apiVersion,omitempty"` 1046 1047 // Kind: The type of notifier to use (e.g. SMTPNotifier). 1048 Kind string `json:"kind,omitempty"` 1049 1050 // Metadata: Metadata for referring to/handling/deploying this notifier. 1051 Metadata *NotifierMetadata `json:"metadata,omitempty"` 1052 1053 // Spec: The actual configuration for this notifier. 1054 Spec *NotifierSpec `json:"spec,omitempty"` 1055 1056 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1057 // unconditionally include in API requests. By default, fields with 1058 // empty values are omitted from API requests. However, any non-pointer, 1059 // non-interface field appearing in ForceSendFields will be sent to the 1060 // server regardless of whether the field is empty or not. This may be 1061 // used to include empty fields in Patch requests. 1062 ForceSendFields []string `json:"-"` 1063 1064 // NullFields is a list of field names (e.g. "ApiVersion") to include in 1065 // API requests with the JSON null value. By default, fields with empty 1066 // values are omitted from API requests. However, any field with an 1067 // empty value appearing in NullFields will be sent to the server as 1068 // null. It is an error if a field in this list has a non-empty value. 1069 // This may be used to include null fields in Patch requests. 1070 NullFields []string `json:"-"` 1071} 1072 1073func (s *NotifierConfig) MarshalJSON() ([]byte, error) { 1074 type NoMethod NotifierConfig 1075 raw := NoMethod(*s) 1076 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1077} 1078 1079// NotifierMetadata: NotifierMetadata contains the data which can be 1080// used to reference or describe this notifier. 1081type NotifierMetadata struct { 1082 // Name: The human-readable and user-given name for the notifier. For 1083 // example: "repo-merge-email-notifier". 1084 Name string `json:"name,omitempty"` 1085 1086 // Notifier: The string representing the name and version of notifier to 1087 // deploy. Expected to be of the form of "/:". For example: 1088 // "gcr.io/my-project/notifiers/smtp:1.2.34". 1089 Notifier string `json:"notifier,omitempty"` 1090 1091 // ForceSendFields is a list of field names (e.g. "Name") to 1092 // unconditionally include in API requests. By default, fields with 1093 // empty values are omitted from API requests. However, any non-pointer, 1094 // non-interface field appearing in ForceSendFields will be sent to the 1095 // server regardless of whether the field is empty or not. This may be 1096 // used to include empty fields in Patch requests. 1097 ForceSendFields []string `json:"-"` 1098 1099 // NullFields is a list of field names (e.g. "Name") to include in API 1100 // requests with the JSON null value. By default, fields with empty 1101 // values are omitted from API requests. However, any field with an 1102 // empty value appearing in NullFields will be sent to the server as 1103 // null. It is an error if a field in this list has a non-empty value. 1104 // This may be used to include null fields in Patch requests. 1105 NullFields []string `json:"-"` 1106} 1107 1108func (s *NotifierMetadata) MarshalJSON() ([]byte, error) { 1109 type NoMethod NotifierMetadata 1110 raw := NoMethod(*s) 1111 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1112} 1113 1114// NotifierSecret: NotifierSecret is the container that maps a secret 1115// name (reference) to its Google Cloud Secret Manager resource path. 1116type NotifierSecret struct { 1117 // Name: Name is the local name of the secret, such as the verbatim 1118 // string "my-smtp-password". 1119 Name string `json:"name,omitempty"` 1120 1121 // Value: Value is interpreted to be a resource path for fetching the 1122 // actual (versioned) secret data for this secret. For example, this 1123 // would be a Google Cloud Secret Manager secret version resource path 1124 // like: "projects/my-project/secrets/my-secret/versions/latest". 1125 Value string `json:"value,omitempty"` 1126 1127 // ForceSendFields is a list of field names (e.g. "Name") to 1128 // unconditionally include in API requests. By default, fields with 1129 // empty values are omitted from API requests. However, any non-pointer, 1130 // non-interface field appearing in ForceSendFields will be sent to the 1131 // server regardless of whether the field is empty or not. This may be 1132 // used to include empty fields in Patch requests. 1133 ForceSendFields []string `json:"-"` 1134 1135 // NullFields is a list of field names (e.g. "Name") to include in API 1136 // requests with the JSON null value. By default, fields with empty 1137 // values are omitted from API requests. However, any field with an 1138 // empty value appearing in NullFields will be sent to the server as 1139 // null. It is an error if a field in this list has a non-empty value. 1140 // This may be used to include null fields in Patch requests. 1141 NullFields []string `json:"-"` 1142} 1143 1144func (s *NotifierSecret) MarshalJSON() ([]byte, error) { 1145 type NoMethod NotifierSecret 1146 raw := NoMethod(*s) 1147 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1148} 1149 1150// NotifierSecretRef: NotifierSecretRef contains the reference to a 1151// secret stored in the corresponding NotifierSpec. 1152type NotifierSecretRef struct { 1153 // SecretRef: The value of `secret_ref` should be a `name` that is 1154 // registered in a `Secret` in the `secrets` list of the `Spec`. 1155 SecretRef string `json:"secretRef,omitempty"` 1156 1157 // ForceSendFields is a list of field names (e.g. "SecretRef") to 1158 // unconditionally include in API requests. By default, fields with 1159 // empty values are omitted from API requests. However, any non-pointer, 1160 // non-interface field appearing in ForceSendFields will be sent to the 1161 // server regardless of whether the field is empty or not. This may be 1162 // used to include empty fields in Patch requests. 1163 ForceSendFields []string `json:"-"` 1164 1165 // NullFields is a list of field names (e.g. "SecretRef") to include in 1166 // API requests with the JSON null value. By default, fields with empty 1167 // values are omitted from API requests. However, any field with an 1168 // empty value appearing in NullFields will be sent to the server as 1169 // null. It is an error if a field in this list has a non-empty value. 1170 // This may be used to include null fields in Patch requests. 1171 NullFields []string `json:"-"` 1172} 1173 1174func (s *NotifierSecretRef) MarshalJSON() ([]byte, error) { 1175 type NoMethod NotifierSecretRef 1176 raw := NoMethod(*s) 1177 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1178} 1179 1180// NotifierSpec: NotifierSpec is the configuration container for 1181// notifications. 1182type NotifierSpec struct { 1183 // Notification: The configuration of this particular notifier. 1184 Notification *Notification `json:"notification,omitempty"` 1185 1186 // Secrets: Configurations for secret resources used by this particular 1187 // notifier. 1188 Secrets []*NotifierSecret `json:"secrets,omitempty"` 1189 1190 // ForceSendFields is a list of field names (e.g. "Notification") to 1191 // unconditionally include in API requests. By default, fields with 1192 // empty values are omitted from API requests. However, any non-pointer, 1193 // non-interface field appearing in ForceSendFields will be sent to the 1194 // server regardless of whether the field is empty or not. This may be 1195 // used to include empty fields in Patch requests. 1196 ForceSendFields []string `json:"-"` 1197 1198 // NullFields is a list of field names (e.g. "Notification") to include 1199 // in API requests with the JSON null value. By default, fields with 1200 // empty values are omitted from API requests. However, any field with 1201 // an empty value appearing in NullFields will be sent to the server as 1202 // null. It is an error if a field in this list has a non-empty value. 1203 // This may be used to include null fields in Patch requests. 1204 NullFields []string `json:"-"` 1205} 1206 1207func (s *NotifierSpec) MarshalJSON() ([]byte, error) { 1208 type NoMethod NotifierSpec 1209 raw := NoMethod(*s) 1210 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1211} 1212 1213// Operation: This resource represents a long-running operation that is 1214// the result of a network API call. 1215type Operation struct { 1216 // Done: If the value is `false`, it means the operation is still in 1217 // progress. If `true`, the operation is completed, and either `error` 1218 // or `response` is available. 1219 Done bool `json:"done,omitempty"` 1220 1221 // Error: The error result of the operation in case of failure or 1222 // cancellation. 1223 Error *Status `json:"error,omitempty"` 1224 1225 // Metadata: Service-specific metadata associated with the operation. It 1226 // typically contains progress information and common metadata such as 1227 // create time. Some services might not provide such metadata. Any 1228 // method that returns a long-running operation should document the 1229 // metadata type, if any. 1230 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1231 1232 // Name: The server-assigned name, which is only unique within the same 1233 // service that originally returns it. If you use the default HTTP 1234 // mapping, the `name` should be a resource name ending with 1235 // `operations/{unique_id}`. 1236 Name string `json:"name,omitempty"` 1237 1238 // Response: The normal response of the operation in case of success. If 1239 // the original method returns no data on success, such as `Delete`, the 1240 // response is `google.protobuf.Empty`. If the original method is 1241 // standard `Get`/`Create`/`Update`, the response should be the 1242 // resource. For other methods, the response should have the type 1243 // `XxxResponse`, where `Xxx` is the original method name. For example, 1244 // if the original method name is `TakeSnapshot()`, the inferred 1245 // response type is `TakeSnapshotResponse`. 1246 Response googleapi.RawMessage `json:"response,omitempty"` 1247 1248 // ServerResponse contains the HTTP response code and headers from the 1249 // server. 1250 googleapi.ServerResponse `json:"-"` 1251 1252 // ForceSendFields is a list of field names (e.g. "Done") to 1253 // unconditionally include in API requests. By default, fields with 1254 // empty values are omitted from API requests. However, any non-pointer, 1255 // non-interface field appearing in ForceSendFields will be sent to the 1256 // server regardless of whether the field is empty or not. This may be 1257 // used to include empty fields in Patch requests. 1258 ForceSendFields []string `json:"-"` 1259 1260 // NullFields is a list of field names (e.g. "Done") to include in API 1261 // requests with the JSON null value. By default, fields with empty 1262 // values are omitted from API requests. However, any field with an 1263 // empty value appearing in NullFields will be sent to the server as 1264 // null. It is an error if a field in this list has a non-empty value. 1265 // This may be used to include null fields in Patch requests. 1266 NullFields []string `json:"-"` 1267} 1268 1269func (s *Operation) MarshalJSON() ([]byte, error) { 1270 type NoMethod Operation 1271 raw := NoMethod(*s) 1272 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1273} 1274 1275// RepoSource: Location of the source in a Google Cloud Source 1276// Repository. 1277type RepoSource struct { 1278 // BranchName: Regex matching branches to build. The syntax of the 1279 // regular expressions accepted is the syntax accepted by RE2 and 1280 // described at https://github.com/google/re2/wiki/Syntax 1281 BranchName string `json:"branchName,omitempty"` 1282 1283 // CommitSha: Explicit commit SHA to build. 1284 CommitSha string `json:"commitSha,omitempty"` 1285 1286 // Dir: Directory, relative to the source root, in which to run the 1287 // build. This must be a relative path. If a step's `dir` is specified 1288 // and is an absolute path, this value is ignored for that step's 1289 // execution. 1290 Dir string `json:"dir,omitempty"` 1291 1292 // InvertRegex: Only trigger a build if the revision regex does NOT 1293 // match the revision regex. 1294 InvertRegex bool `json:"invertRegex,omitempty"` 1295 1296 // ProjectId: ID of the project that owns the Cloud Source Repository. 1297 // If omitted, the project ID requesting the build is assumed. 1298 ProjectId string `json:"projectId,omitempty"` 1299 1300 // RepoName: Name of the Cloud Source Repository. 1301 RepoName string `json:"repoName,omitempty"` 1302 1303 // Substitutions: Substitutions to use in a triggered build. Should only 1304 // be used with RunBuildTrigger 1305 Substitutions map[string]string `json:"substitutions,omitempty"` 1306 1307 // TagName: Regex matching tags to build. The syntax of the regular 1308 // expressions accepted is the syntax accepted by RE2 and described at 1309 // https://github.com/google/re2/wiki/Syntax 1310 TagName string `json:"tagName,omitempty"` 1311 1312 // ForceSendFields is a list of field names (e.g. "BranchName") to 1313 // unconditionally include in API requests. By default, fields with 1314 // empty values are omitted from API requests. However, any non-pointer, 1315 // non-interface field appearing in ForceSendFields will be sent to the 1316 // server regardless of whether the field is empty or not. This may be 1317 // used to include empty fields in Patch requests. 1318 ForceSendFields []string `json:"-"` 1319 1320 // NullFields is a list of field names (e.g. "BranchName") to include in 1321 // API requests with the JSON null value. By default, fields with empty 1322 // values are omitted from API requests. However, any field with an 1323 // empty value appearing in NullFields will be sent to the server as 1324 // null. It is an error if a field in this list has a non-empty value. 1325 // This may be used to include null fields in Patch requests. 1326 NullFields []string `json:"-"` 1327} 1328 1329func (s *RepoSource) MarshalJSON() ([]byte, error) { 1330 type NoMethod RepoSource 1331 raw := NoMethod(*s) 1332 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1333} 1334 1335// Results: Artifacts created by the build pipeline. 1336type Results struct { 1337 // ArtifactManifest: Path to the artifact manifest. Only populated when 1338 // artifacts are uploaded. 1339 ArtifactManifest string `json:"artifactManifest,omitempty"` 1340 1341 // ArtifactTiming: Time to push all non-container artifacts. 1342 ArtifactTiming *TimeSpan `json:"artifactTiming,omitempty"` 1343 1344 // BuildStepImages: List of build step digests, in the order 1345 // corresponding to build step indices. 1346 BuildStepImages []string `json:"buildStepImages,omitempty"` 1347 1348 // BuildStepOutputs: List of build step outputs, produced by builder 1349 // images, in the order corresponding to build step indices. Cloud 1350 // Builders (https://cloud.google.com/cloud-build/docs/cloud-builders) 1351 // can produce this output by writing to `$BUILDER_OUTPUT/output`. Only 1352 // the first 4KB of data is stored. 1353 BuildStepOutputs []string `json:"buildStepOutputs,omitempty"` 1354 1355 // Images: Container images that were built as a part of the build. 1356 Images []*BuiltImage `json:"images,omitempty"` 1357 1358 // NumArtifacts: Number of artifacts uploaded. Only populated when 1359 // artifacts are uploaded. 1360 NumArtifacts int64 `json:"numArtifacts,omitempty,string"` 1361 1362 // ForceSendFields is a list of field names (e.g. "ArtifactManifest") to 1363 // unconditionally include in API requests. By default, fields with 1364 // empty values are omitted from API requests. However, any non-pointer, 1365 // non-interface field appearing in ForceSendFields will be sent to the 1366 // server regardless of whether the field is empty or not. This may be 1367 // used to include empty fields in Patch requests. 1368 ForceSendFields []string `json:"-"` 1369 1370 // NullFields is a list of field names (e.g. "ArtifactManifest") to 1371 // include in API requests with the JSON null value. By default, fields 1372 // with empty values are omitted from API requests. However, any field 1373 // with an empty value appearing in NullFields will be sent to the 1374 // server as null. It is an error if a field in this list has a 1375 // non-empty value. This may be used to include null fields in Patch 1376 // requests. 1377 NullFields []string `json:"-"` 1378} 1379 1380func (s *Results) MarshalJSON() ([]byte, error) { 1381 type NoMethod Results 1382 raw := NoMethod(*s) 1383 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1384} 1385 1386// SMTPDelivery: SMTPDelivery is the delivery configuration for an SMTP 1387// (email) notification. 1388type SMTPDelivery struct { 1389 // FromAddress: This is the SMTP account/email that appears in the 1390 // `From:` of the email. If empty, it is assumed to be sender. 1391 FromAddress string `json:"fromAddress,omitempty"` 1392 1393 // Password: The SMTP sender's password. 1394 Password *NotifierSecretRef `json:"password,omitempty"` 1395 1396 // Port: The SMTP port of the server. 1397 Port string `json:"port,omitempty"` 1398 1399 // RecipientAddresses: This is the list of addresses to which we send 1400 // the email (i.e. in the `To:` of the email). 1401 RecipientAddresses []string `json:"recipientAddresses,omitempty"` 1402 1403 // SenderAddress: This is the SMTP account/email that is used to send 1404 // the message. 1405 SenderAddress string `json:"senderAddress,omitempty"` 1406 1407 // Server: The address of the SMTP server. 1408 Server string `json:"server,omitempty"` 1409 1410 // ForceSendFields is a list of field names (e.g. "FromAddress") to 1411 // unconditionally include in API requests. By default, fields with 1412 // empty values are omitted from API requests. However, any non-pointer, 1413 // non-interface field appearing in ForceSendFields will be sent to the 1414 // server regardless of whether the field is empty or not. This may be 1415 // used to include empty fields in Patch requests. 1416 ForceSendFields []string `json:"-"` 1417 1418 // NullFields is a list of field names (e.g. "FromAddress") to include 1419 // in API requests with the JSON null value. By default, fields with 1420 // empty values are omitted from API requests. However, any field with 1421 // an empty value appearing in NullFields will be sent to the server as 1422 // null. It is an error if a field in this list has a non-empty value. 1423 // This may be used to include null fields in Patch requests. 1424 NullFields []string `json:"-"` 1425} 1426 1427func (s *SMTPDelivery) MarshalJSON() ([]byte, error) { 1428 type NoMethod SMTPDelivery 1429 raw := NoMethod(*s) 1430 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1431} 1432 1433// Secret: Pairs a set of secret environment variables containing 1434// encrypted values with the Cloud KMS key to use to decrypt the value. 1435// Note: Use `kmsKeyName` with `available_secrets` instead of using 1436// `kmsKeyName` with `secret`. For instructions see: 1437// https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-credentials. 1438type Secret struct { 1439 // KmsKeyName: Cloud KMS key name to use to decrypt these envs. 1440 KmsKeyName string `json:"kmsKeyName,omitempty"` 1441 1442 // SecretEnv: Map of environment variable name to its encrypted value. 1443 // Secret environment variables must be unique across all of a build's 1444 // secrets, and must be used by at least one build step. Values can be 1445 // at most 64 KB in size. There can be at most 100 secret values across 1446 // all of a build's secrets. 1447 SecretEnv map[string]string `json:"secretEnv,omitempty"` 1448 1449 // ForceSendFields is a list of field names (e.g. "KmsKeyName") to 1450 // unconditionally include in API requests. By default, fields with 1451 // empty values are omitted from API requests. However, any non-pointer, 1452 // non-interface field appearing in ForceSendFields will be sent to the 1453 // server regardless of whether the field is empty or not. This may be 1454 // used to include empty fields in Patch requests. 1455 ForceSendFields []string `json:"-"` 1456 1457 // NullFields is a list of field names (e.g. "KmsKeyName") to include in 1458 // API requests with the JSON null value. By default, fields with empty 1459 // values are omitted from API requests. However, any field with an 1460 // empty value appearing in NullFields will be sent to the server as 1461 // null. It is an error if a field in this list has a non-empty value. 1462 // This may be used to include null fields in Patch requests. 1463 NullFields []string `json:"-"` 1464} 1465 1466func (s *Secret) MarshalJSON() ([]byte, error) { 1467 type NoMethod Secret 1468 raw := NoMethod(*s) 1469 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1470} 1471 1472// SecretManagerSecret: Pairs a secret environment variable with a 1473// SecretVersion in Secret Manager. 1474type SecretManagerSecret struct { 1475 // Env: Environment variable name to associate with the secret. Secret 1476 // environment variables must be unique across all of a build's secrets, 1477 // and must be used by at least one build step. 1478 Env string `json:"env,omitempty"` 1479 1480 // VersionName: Resource name of the SecretVersion. In format: 1481 // projects/*/secrets/*/versions/* 1482 VersionName string `json:"versionName,omitempty"` 1483 1484 // ForceSendFields is a list of field names (e.g. "Env") to 1485 // unconditionally include in API requests. By default, fields with 1486 // empty values are omitted from API requests. However, any non-pointer, 1487 // non-interface field appearing in ForceSendFields will be sent to the 1488 // server regardless of whether the field is empty or not. This may be 1489 // used to include empty fields in Patch requests. 1490 ForceSendFields []string `json:"-"` 1491 1492 // NullFields is a list of field names (e.g. "Env") to include in API 1493 // requests with the JSON null value. By default, fields with empty 1494 // values are omitted from API requests. However, any field with an 1495 // empty value appearing in NullFields will be sent to the server as 1496 // null. It is an error if a field in this list has a non-empty value. 1497 // This may be used to include null fields in Patch requests. 1498 NullFields []string `json:"-"` 1499} 1500 1501func (s *SecretManagerSecret) MarshalJSON() ([]byte, error) { 1502 type NoMethod SecretManagerSecret 1503 raw := NoMethod(*s) 1504 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1505} 1506 1507// Secrets: Secrets and secret environment variables. 1508type Secrets struct { 1509 // Inline: Secrets encrypted with KMS key and the associated secret 1510 // environment variable. 1511 Inline []*InlineSecret `json:"inline,omitempty"` 1512 1513 // SecretManager: Secrets in Secret Manager and associated secret 1514 // environment variable. 1515 SecretManager []*SecretManagerSecret `json:"secretManager,omitempty"` 1516 1517 // ForceSendFields is a list of field names (e.g. "Inline") to 1518 // unconditionally include in API requests. By default, fields with 1519 // empty values are omitted from API requests. However, any non-pointer, 1520 // non-interface field appearing in ForceSendFields will be sent to the 1521 // server regardless of whether the field is empty or not. This may be 1522 // used to include empty fields in Patch requests. 1523 ForceSendFields []string `json:"-"` 1524 1525 // NullFields is a list of field names (e.g. "Inline") to include in API 1526 // requests with the JSON null value. By default, fields with empty 1527 // values are omitted from API requests. However, any field with an 1528 // empty value appearing in NullFields will be sent to the server as 1529 // null. It is an error if a field in this list has a non-empty value. 1530 // This may be used to include null fields in Patch requests. 1531 NullFields []string `json:"-"` 1532} 1533 1534func (s *Secrets) MarshalJSON() ([]byte, error) { 1535 type NoMethod Secrets 1536 raw := NoMethod(*s) 1537 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1538} 1539 1540// SlackDelivery: SlackDelivery is the delivery configuration for 1541// delivering Slack messages via webhooks. See Slack webhook 1542// documentation at: https://api.slack.com/messaging/webhooks. 1543type SlackDelivery struct { 1544 // WebhookUri: The secret reference for the Slack webhook URI for 1545 // sending messages to a channel. 1546 WebhookUri *NotifierSecretRef `json:"webhookUri,omitempty"` 1547 1548 // ForceSendFields is a list of field names (e.g. "WebhookUri") to 1549 // unconditionally include in API requests. By default, fields with 1550 // empty values are omitted from API requests. However, any non-pointer, 1551 // non-interface field appearing in ForceSendFields will be sent to the 1552 // server regardless of whether the field is empty or not. This may be 1553 // used to include empty fields in Patch requests. 1554 ForceSendFields []string `json:"-"` 1555 1556 // NullFields is a list of field names (e.g. "WebhookUri") to include in 1557 // API requests with the JSON null value. By default, fields with empty 1558 // values are omitted from API requests. However, any field with an 1559 // empty value appearing in NullFields will be sent to the server as 1560 // null. It is an error if a field in this list has a non-empty value. 1561 // This may be used to include null fields in Patch requests. 1562 NullFields []string `json:"-"` 1563} 1564 1565func (s *SlackDelivery) MarshalJSON() ([]byte, error) { 1566 type NoMethod SlackDelivery 1567 raw := NoMethod(*s) 1568 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1569} 1570 1571// Source: Location of the source in a supported storage service. 1572type Source struct { 1573 // RepoSource: If provided, get the source from this location in a Cloud 1574 // Source Repository. 1575 RepoSource *RepoSource `json:"repoSource,omitempty"` 1576 1577 // StorageSource: If provided, get the source from this location in 1578 // Google Cloud Storage. 1579 StorageSource *StorageSource `json:"storageSource,omitempty"` 1580 1581 // StorageSourceManifest: If provided, get the source from this manifest 1582 // in Google Cloud Storage. This feature is in Preview. 1583 StorageSourceManifest *StorageSourceManifest `json:"storageSourceManifest,omitempty"` 1584 1585 // ForceSendFields is a list of field names (e.g. "RepoSource") to 1586 // unconditionally include in API requests. By default, fields with 1587 // empty values are omitted from API requests. However, any non-pointer, 1588 // non-interface field appearing in ForceSendFields will be sent to the 1589 // server regardless of whether the field is empty or not. This may be 1590 // used to include empty fields in Patch requests. 1591 ForceSendFields []string `json:"-"` 1592 1593 // NullFields is a list of field names (e.g. "RepoSource") to include in 1594 // API requests with the JSON null value. By default, fields with empty 1595 // values are omitted from API requests. However, any field with an 1596 // empty value appearing in NullFields will be sent to the server as 1597 // null. It is an error if a field in this list has a non-empty value. 1598 // This may be used to include null fields in Patch requests. 1599 NullFields []string `json:"-"` 1600} 1601 1602func (s *Source) MarshalJSON() ([]byte, error) { 1603 type NoMethod Source 1604 raw := NoMethod(*s) 1605 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1606} 1607 1608// SourceProvenance: Provenance of the source. Ways to find the original 1609// source, or verify that some source was used for this build. 1610type SourceProvenance struct { 1611 // FileHashes: Output only. Hash(es) of the build source, which can be 1612 // used to verify that the original source integrity was maintained in 1613 // the build. Note that `FileHashes` will only be populated if 1614 // `BuildOptions` has requested a `SourceProvenanceHash`. The keys to 1615 // this map are file paths used as build source and the values contain 1616 // the hash values for those files. If the build source came in a single 1617 // package such as a gzipped tarfile (`.tar.gz`), the `FileHash` will be 1618 // for the single path to that file. 1619 FileHashes map[string]FileHashes `json:"fileHashes,omitempty"` 1620 1621 // ResolvedRepoSource: A copy of the build's `source.repo_source`, if 1622 // exists, with any revisions resolved. 1623 ResolvedRepoSource *RepoSource `json:"resolvedRepoSource,omitempty"` 1624 1625 // ResolvedStorageSource: A copy of the build's `source.storage_source`, 1626 // if exists, with any generations resolved. 1627 ResolvedStorageSource *StorageSource `json:"resolvedStorageSource,omitempty"` 1628 1629 // ResolvedStorageSourceManifest: A copy of the build's 1630 // `source.storage_source_manifest`, if exists, with any revisions 1631 // resolved. This feature is in Preview. 1632 ResolvedStorageSourceManifest *StorageSourceManifest `json:"resolvedStorageSourceManifest,omitempty"` 1633 1634 // ForceSendFields is a list of field names (e.g. "FileHashes") to 1635 // unconditionally include in API requests. By default, fields with 1636 // empty values are omitted from API requests. However, any non-pointer, 1637 // non-interface field appearing in ForceSendFields will be sent to the 1638 // server regardless of whether the field is empty or not. This may be 1639 // used to include empty fields in Patch requests. 1640 ForceSendFields []string `json:"-"` 1641 1642 // NullFields is a list of field names (e.g. "FileHashes") to include in 1643 // API requests with the JSON null value. By default, fields with empty 1644 // values are omitted from API requests. However, any field with an 1645 // empty value appearing in NullFields will be sent to the server as 1646 // null. It is an error if a field in this list has a non-empty value. 1647 // This may be used to include null fields in Patch requests. 1648 NullFields []string `json:"-"` 1649} 1650 1651func (s *SourceProvenance) MarshalJSON() ([]byte, error) { 1652 type NoMethod SourceProvenance 1653 raw := NoMethod(*s) 1654 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1655} 1656 1657// Status: The `Status` type defines a logical error model that is 1658// suitable for different programming environments, including REST APIs 1659// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 1660// `Status` message contains three pieces of data: error code, error 1661// message, and error details. You can find out more about this error 1662// model and how to work with it in the API Design Guide 1663// (https://cloud.google.com/apis/design/errors). 1664type Status struct { 1665 // Code: The status code, which should be an enum value of 1666 // google.rpc.Code. 1667 Code int64 `json:"code,omitempty"` 1668 1669 // Details: A list of messages that carry the error details. There is a 1670 // common set of message types for APIs to use. 1671 Details []googleapi.RawMessage `json:"details,omitempty"` 1672 1673 // Message: A developer-facing error message, which should be in 1674 // English. Any user-facing error message should be localized and sent 1675 // in the google.rpc.Status.details field, or localized by the client. 1676 Message string `json:"message,omitempty"` 1677 1678 // ForceSendFields is a list of field names (e.g. "Code") to 1679 // unconditionally include in API requests. By default, fields with 1680 // empty values are omitted from API requests. However, any non-pointer, 1681 // non-interface field appearing in ForceSendFields will be sent to the 1682 // server regardless of whether the field is empty or not. This may be 1683 // used to include empty fields in Patch requests. 1684 ForceSendFields []string `json:"-"` 1685 1686 // NullFields is a list of field names (e.g. "Code") to include in API 1687 // requests with the JSON null value. By default, fields with empty 1688 // values are omitted from API requests. However, any field with an 1689 // empty value appearing in NullFields will be sent to the server as 1690 // null. It is an error if a field in this list has a non-empty value. 1691 // This may be used to include null fields in Patch requests. 1692 NullFields []string `json:"-"` 1693} 1694 1695func (s *Status) MarshalJSON() ([]byte, error) { 1696 type NoMethod Status 1697 raw := NoMethod(*s) 1698 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1699} 1700 1701// StorageSource: Location of the source in an archive file in Google 1702// Cloud Storage. 1703type StorageSource struct { 1704 // Bucket: Google Cloud Storage bucket containing the source (see Bucket 1705 // Name Requirements 1706 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 1707 Bucket string `json:"bucket,omitempty"` 1708 1709 // Generation: Google Cloud Storage generation for the object. If the 1710 // generation is omitted, the latest generation will be used. 1711 Generation int64 `json:"generation,omitempty,string"` 1712 1713 // Object: Google Cloud Storage object containing the source. This 1714 // object must be a gzipped archive file (`.tar.gz`) containing source 1715 // to build. 1716 Object string `json:"object,omitempty"` 1717 1718 // ForceSendFields is a list of field names (e.g. "Bucket") to 1719 // unconditionally include in API requests. By default, fields with 1720 // empty values are omitted from API requests. However, any non-pointer, 1721 // non-interface field appearing in ForceSendFields will be sent to the 1722 // server regardless of whether the field is empty or not. This may be 1723 // used to include empty fields in Patch requests. 1724 ForceSendFields []string `json:"-"` 1725 1726 // NullFields is a list of field names (e.g. "Bucket") to include in API 1727 // requests with the JSON null value. By default, fields with empty 1728 // values are omitted from API requests. However, any field with an 1729 // empty value appearing in NullFields will be sent to the server as 1730 // null. It is an error if a field in this list has a non-empty value. 1731 // This may be used to include null fields in Patch requests. 1732 NullFields []string `json:"-"` 1733} 1734 1735func (s *StorageSource) MarshalJSON() ([]byte, error) { 1736 type NoMethod StorageSource 1737 raw := NoMethod(*s) 1738 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1739} 1740 1741// StorageSourceManifest: Location of the source manifest in Google 1742// Cloud Storage. This feature is in Preview. 1743type StorageSourceManifest struct { 1744 // Bucket: Google Cloud Storage bucket containing the source manifest 1745 // (see Bucket Name Requirements 1746 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 1747 Bucket string `json:"bucket,omitempty"` 1748 1749 // Generation: Google Cloud Storage generation for the object. If the 1750 // generation is omitted, the latest generation will be used. 1751 Generation int64 `json:"generation,omitempty,string"` 1752 1753 // Object: Google Cloud Storage object containing the source manifest. 1754 // This object must be a JSON file. 1755 Object string `json:"object,omitempty"` 1756 1757 // ForceSendFields is a list of field names (e.g. "Bucket") to 1758 // unconditionally include in API requests. By default, fields with 1759 // empty values are omitted from API requests. However, any non-pointer, 1760 // non-interface field appearing in ForceSendFields will be sent to the 1761 // server regardless of whether the field is empty or not. This may be 1762 // used to include empty fields in Patch requests. 1763 ForceSendFields []string `json:"-"` 1764 1765 // NullFields is a list of field names (e.g. "Bucket") to include in API 1766 // requests with the JSON null value. By default, fields with empty 1767 // values are omitted from API requests. However, any field with an 1768 // empty value appearing in NullFields will be sent to the server as 1769 // null. It is an error if a field in this list has a non-empty value. 1770 // This may be used to include null fields in Patch requests. 1771 NullFields []string `json:"-"` 1772} 1773 1774func (s *StorageSourceManifest) MarshalJSON() ([]byte, error) { 1775 type NoMethod StorageSourceManifest 1776 raw := NoMethod(*s) 1777 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1778} 1779 1780// TimeSpan: Start and end times for a build execution phase. 1781type TimeSpan struct { 1782 // EndTime: End of time span. 1783 EndTime string `json:"endTime,omitempty"` 1784 1785 // StartTime: Start of time span. 1786 StartTime string `json:"startTime,omitempty"` 1787 1788 // ForceSendFields is a list of field names (e.g. "EndTime") to 1789 // unconditionally include in API requests. By default, fields with 1790 // empty values are omitted from API requests. However, any non-pointer, 1791 // non-interface field appearing in ForceSendFields will be sent to the 1792 // server regardless of whether the field is empty or not. This may be 1793 // used to include empty fields in Patch requests. 1794 ForceSendFields []string `json:"-"` 1795 1796 // NullFields is a list of field names (e.g. "EndTime") to include in 1797 // API requests with the JSON null value. By default, fields with empty 1798 // values are omitted from API requests. However, any field with an 1799 // empty value appearing in NullFields will be sent to the server as 1800 // null. It is an error if a field in this list has a non-empty value. 1801 // This may be used to include null fields in Patch requests. 1802 NullFields []string `json:"-"` 1803} 1804 1805func (s *TimeSpan) MarshalJSON() ([]byte, error) { 1806 type NoMethod TimeSpan 1807 raw := NoMethod(*s) 1808 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1809} 1810 1811// Volume: Volume describes a Docker container volume which is mounted 1812// into build steps in order to persist files across build step 1813// execution. 1814type Volume struct { 1815 // Name: Name of the volume to mount. Volume names must be unique per 1816 // build step and must be valid names for Docker volumes. Each named 1817 // volume must be used by at least two build steps. 1818 Name string `json:"name,omitempty"` 1819 1820 // Path: Path at which to mount the volume. Paths must be absolute and 1821 // cannot conflict with other volume paths on the same build step or 1822 // with certain reserved volume paths. 1823 Path string `json:"path,omitempty"` 1824 1825 // ForceSendFields is a list of field names (e.g. "Name") to 1826 // unconditionally include in API requests. By default, fields with 1827 // empty values are omitted from API requests. However, any non-pointer, 1828 // non-interface field appearing in ForceSendFields will be sent to the 1829 // server regardless of whether the field is empty or not. This may be 1830 // used to include empty fields in Patch requests. 1831 ForceSendFields []string `json:"-"` 1832 1833 // NullFields is a list of field names (e.g. "Name") to include in API 1834 // requests with the JSON null value. By default, fields with empty 1835 // values are omitted from API requests. However, any field with an 1836 // empty value appearing in NullFields will be sent to the server as 1837 // null. It is an error if a field in this list has a non-empty value. 1838 // This may be used to include null fields in Patch requests. 1839 NullFields []string `json:"-"` 1840} 1841 1842func (s *Volume) MarshalJSON() ([]byte, error) { 1843 type NoMethod Volume 1844 raw := NoMethod(*s) 1845 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1846} 1847 1848// WorkerConfig: Defines the configuration to be used for creating 1849// workers in the pool. 1850type WorkerConfig struct { 1851 // DiskSizeGb: Size of the disk attached to the worker, in GB. See 1852 // Worker pool config file 1853 // (https://cloud.google.com/cloud-build/docs/custom-workers/worker-pool-config-file). 1854 // Specify a value of up to 1000. If `0` is specified, Cloud Build will 1855 // use a standard disk size. 1856 DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` 1857 1858 // MachineType: Machine type of a worker, such as `n1-standard-1`. See 1859 // Worker pool config file 1860 // (https://cloud.google.com/cloud-build/docs/custom-workers/worker-pool-config-file). 1861 // If left blank, Cloud Build will use `n1-standard-1`. 1862 MachineType string `json:"machineType,omitempty"` 1863 1864 // NoExternalIp: If true, workers are created without any public 1865 // address, which prevents network egress to public IPs. 1866 NoExternalIp bool `json:"noExternalIp,omitempty"` 1867 1868 // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to 1869 // unconditionally include in API requests. By default, fields with 1870 // empty values are omitted from API requests. However, any non-pointer, 1871 // non-interface field appearing in ForceSendFields will be sent to the 1872 // server regardless of whether the field is empty or not. This may be 1873 // used to include empty fields in Patch requests. 1874 ForceSendFields []string `json:"-"` 1875 1876 // NullFields is a list of field names (e.g. "DiskSizeGb") to include in 1877 // API requests with the JSON null value. By default, fields with empty 1878 // values are omitted from API requests. However, any field with an 1879 // empty value appearing in NullFields will be sent to the server as 1880 // null. It is an error if a field in this list has a non-empty value. 1881 // This may be used to include null fields in Patch requests. 1882 NullFields []string `json:"-"` 1883} 1884 1885func (s *WorkerConfig) MarshalJSON() ([]byte, error) { 1886 type NoMethod WorkerConfig 1887 raw := NoMethod(*s) 1888 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1889} 1890 1891// WorkerPool: Configuration for a `WorkerPool` to run the builds. 1892// Workers provide a build environment where Cloud Build runs your 1893// builds. Cloud Build owns and maintains a pool of workers for general 1894// use. By default, when you submit a build, Cloud Build uses one of the 1895// workers from this pool. Builds that run in the default worker pool 1896// have access to the public internet. If your build needs access to 1897// resources on a private network, create and use a `WorkerPool` to run 1898// your builds. Custom `WorkerPool`s give your builds access to any 1899// single VPC network that you administer, including any on-prem 1900// resources connected to that VPC network. For an overview of custom 1901// worker pools, see Custom workers overview 1902// (https://cloud.google.com/cloud-build/docs/custom-workers/custom-workers-overview). 1903type WorkerPool struct { 1904 // CreateTime: Output only. Time at which the request to create the 1905 // `WorkerPool` was received. 1906 CreateTime string `json:"createTime,omitempty"` 1907 1908 // DeleteTime: Output only. Time at which the request to delete the 1909 // `WorkerPool` was received. 1910 DeleteTime string `json:"deleteTime,omitempty"` 1911 1912 // Name: Output only. The resource name of the `WorkerPool`, with format 1913 // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. 1914 // The value of `{worker_pool}` is provided by `worker_pool_id` in 1915 // `CreateWorkerPool` request and the value of `{location}` is 1916 // determined by the endpoint accessed. 1917 Name string `json:"name,omitempty"` 1918 1919 // NetworkConfig: Network configuration for the `WorkerPool`. 1920 NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"` 1921 1922 // State: Output only. `WorkerPool` state. 1923 // 1924 // Possible values: 1925 // "STATE_UNSPECIFIED" - State of the `WorkerPool` is unknown. 1926 // "CREATING" - `WorkerPool` is being created. 1927 // "RUNNING" - `WorkerPool` is running. 1928 // "DELETING" - `WorkerPool` is being deleted: cancelling builds and 1929 // draining workers. 1930 // "DELETED" - `WorkerPool` is deleted. 1931 State string `json:"state,omitempty"` 1932 1933 // UpdateTime: Output only. Time at which the request to update the 1934 // `WorkerPool` was received. 1935 UpdateTime string `json:"updateTime,omitempty"` 1936 1937 // WorkerConfig: Worker configuration for the `WorkerPool`. 1938 WorkerConfig *WorkerConfig `json:"workerConfig,omitempty"` 1939 1940 // ServerResponse contains the HTTP response code and headers from the 1941 // server. 1942 googleapi.ServerResponse `json:"-"` 1943 1944 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1945 // unconditionally include in API requests. By default, fields with 1946 // empty values are omitted from API requests. However, any non-pointer, 1947 // non-interface field appearing in ForceSendFields will be sent to the 1948 // server regardless of whether the field is empty or not. This may be 1949 // used to include empty fields in Patch requests. 1950 ForceSendFields []string `json:"-"` 1951 1952 // NullFields is a list of field names (e.g. "CreateTime") to include in 1953 // API requests with the JSON null value. By default, fields with empty 1954 // values are omitted from API requests. However, any field with an 1955 // empty value appearing in NullFields will be sent to the server as 1956 // null. It is an error if a field in this list has a non-empty value. 1957 // This may be used to include null fields in Patch requests. 1958 NullFields []string `json:"-"` 1959} 1960 1961func (s *WorkerPool) MarshalJSON() ([]byte, error) { 1962 type NoMethod WorkerPool 1963 raw := NoMethod(*s) 1964 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1965} 1966 1967// method id "cloudbuild.projects.locations.operations.cancel": 1968 1969type ProjectsLocationsOperationsCancelCall struct { 1970 s *Service 1971 name string 1972 canceloperationrequest *CancelOperationRequest 1973 urlParams_ gensupport.URLParams 1974 ctx_ context.Context 1975 header_ http.Header 1976} 1977 1978// Cancel: Starts asynchronous cancellation on a long-running operation. 1979// The server makes a best effort to cancel the operation, but success 1980// is not guaranteed. If the server doesn't support this method, it 1981// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use 1982// Operations.GetOperation or other methods to check whether the 1983// cancellation succeeded or whether the operation completed despite 1984// cancellation. On successful cancellation, the operation is not 1985// deleted; instead, it becomes an operation with an Operation.error 1986// value with a google.rpc.Status.code of 1, corresponding to 1987// `Code.CANCELLED`. 1988func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall { 1989 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 1990 c.name = name 1991 c.canceloperationrequest = canceloperationrequest 1992 return c 1993} 1994 1995// Fields allows partial responses to be retrieved. See 1996// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 1997// for more information. 1998func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { 1999 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2000 return c 2001} 2002 2003// Context sets the context to be used in this call's Do method. Any 2004// pending HTTP request will be aborted if the provided context is 2005// canceled. 2006func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { 2007 c.ctx_ = ctx 2008 return c 2009} 2010 2011// Header returns an http.Header that can be modified by the caller to 2012// add HTTP headers to the request. 2013func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { 2014 if c.header_ == nil { 2015 c.header_ = make(http.Header) 2016 } 2017 return c.header_ 2018} 2019 2020func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 2021 reqHeaders := make(http.Header) 2022 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2023 for k, v := range c.header_ { 2024 reqHeaders[k] = v 2025 } 2026 reqHeaders.Set("User-Agent", c.s.userAgent()) 2027 var body io.Reader = nil 2028 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 2029 if err != nil { 2030 return nil, err 2031 } 2032 reqHeaders.Set("Content-Type", "application/json") 2033 c.urlParams_.Set("alt", alt) 2034 c.urlParams_.Set("prettyPrint", "false") 2035 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}:cancel") 2036 urls += "?" + c.urlParams_.Encode() 2037 req, err := http.NewRequest("POST", urls, body) 2038 if err != nil { 2039 return nil, err 2040 } 2041 req.Header = reqHeaders 2042 googleapi.Expand(req.URL, map[string]string{ 2043 "name": c.name, 2044 }) 2045 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2046} 2047 2048// Do executes the "cloudbuild.projects.locations.operations.cancel" call. 2049// Exactly one of *Empty or error will be non-nil. Any non-2xx status 2050// code is an error. Response headers are in either 2051// *Empty.ServerResponse.Header or (if a response was returned at all) 2052// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2053// check whether the returned error was because http.StatusNotModified 2054// was returned. 2055func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2056 gensupport.SetOptions(c.urlParams_, opts...) 2057 res, err := c.doRequest("json") 2058 if res != nil && res.StatusCode == http.StatusNotModified { 2059 if res.Body != nil { 2060 res.Body.Close() 2061 } 2062 return nil, &googleapi.Error{ 2063 Code: res.StatusCode, 2064 Header: res.Header, 2065 } 2066 } 2067 if err != nil { 2068 return nil, err 2069 } 2070 defer googleapi.CloseBody(res) 2071 if err := googleapi.CheckResponse(res); err != nil { 2072 return nil, err 2073 } 2074 ret := &Empty{ 2075 ServerResponse: googleapi.ServerResponse{ 2076 Header: res.Header, 2077 HTTPStatusCode: res.StatusCode, 2078 }, 2079 } 2080 target := &ret 2081 if err := gensupport.DecodeResponse(target, res); err != nil { 2082 return nil, err 2083 } 2084 return ret, nil 2085 // { 2086 // "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`.", 2087 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", 2088 // "httpMethod": "POST", 2089 // "id": "cloudbuild.projects.locations.operations.cancel", 2090 // "parameterOrder": [ 2091 // "name" 2092 // ], 2093 // "parameters": { 2094 // "name": { 2095 // "description": "The name of the operation resource to be cancelled.", 2096 // "location": "path", 2097 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 2098 // "required": true, 2099 // "type": "string" 2100 // } 2101 // }, 2102 // "path": "v1beta1/{+name}:cancel", 2103 // "request": { 2104 // "$ref": "CancelOperationRequest" 2105 // }, 2106 // "response": { 2107 // "$ref": "Empty" 2108 // }, 2109 // "scopes": [ 2110 // "https://www.googleapis.com/auth/cloud-platform" 2111 // ] 2112 // } 2113 2114} 2115 2116// method id "cloudbuild.projects.locations.operations.get": 2117 2118type ProjectsLocationsOperationsGetCall struct { 2119 s *Service 2120 name string 2121 urlParams_ gensupport.URLParams 2122 ifNoneMatch_ string 2123 ctx_ context.Context 2124 header_ http.Header 2125} 2126 2127// Get: Gets the latest state of a long-running operation. Clients can 2128// use this method to poll the operation result at intervals as 2129// recommended by the API service. 2130func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 2131 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2132 c.name = name 2133 return c 2134} 2135 2136// Fields allows partial responses to be retrieved. See 2137// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2138// for more information. 2139func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 2140 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2141 return c 2142} 2143 2144// IfNoneMatch sets the optional parameter which makes the operation 2145// fail if the object's ETag matches the given value. This is useful for 2146// getting updates only after the object has changed since the last 2147// request. Use googleapi.IsNotModified to check whether the response 2148// error from Do is the result of In-None-Match. 2149func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 2150 c.ifNoneMatch_ = entityTag 2151 return c 2152} 2153 2154// Context sets the context to be used in this call's Do method. Any 2155// pending HTTP request will be aborted if the provided context is 2156// canceled. 2157func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 2158 c.ctx_ = ctx 2159 return c 2160} 2161 2162// Header returns an http.Header that can be modified by the caller to 2163// add HTTP headers to the request. 2164func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 2165 if c.header_ == nil { 2166 c.header_ = make(http.Header) 2167 } 2168 return c.header_ 2169} 2170 2171func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 2172 reqHeaders := make(http.Header) 2173 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2174 for k, v := range c.header_ { 2175 reqHeaders[k] = v 2176 } 2177 reqHeaders.Set("User-Agent", c.s.userAgent()) 2178 if c.ifNoneMatch_ != "" { 2179 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2180 } 2181 var body io.Reader = nil 2182 c.urlParams_.Set("alt", alt) 2183 c.urlParams_.Set("prettyPrint", "false") 2184 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2185 urls += "?" + c.urlParams_.Encode() 2186 req, err := http.NewRequest("GET", urls, body) 2187 if err != nil { 2188 return nil, err 2189 } 2190 req.Header = reqHeaders 2191 googleapi.Expand(req.URL, map[string]string{ 2192 "name": c.name, 2193 }) 2194 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2195} 2196 2197// Do executes the "cloudbuild.projects.locations.operations.get" call. 2198// Exactly one of *Operation or error will be non-nil. Any non-2xx 2199// status code is an error. Response headers are in either 2200// *Operation.ServerResponse.Header or (if a response was returned at 2201// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2202// to check whether the returned error was because 2203// http.StatusNotModified was returned. 2204func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2205 gensupport.SetOptions(c.urlParams_, opts...) 2206 res, err := c.doRequest("json") 2207 if res != nil && res.StatusCode == http.StatusNotModified { 2208 if res.Body != nil { 2209 res.Body.Close() 2210 } 2211 return nil, &googleapi.Error{ 2212 Code: res.StatusCode, 2213 Header: res.Header, 2214 } 2215 } 2216 if err != nil { 2217 return nil, err 2218 } 2219 defer googleapi.CloseBody(res) 2220 if err := googleapi.CheckResponse(res); err != nil { 2221 return nil, err 2222 } 2223 ret := &Operation{ 2224 ServerResponse: googleapi.ServerResponse{ 2225 Header: res.Header, 2226 HTTPStatusCode: res.StatusCode, 2227 }, 2228 } 2229 target := &ret 2230 if err := gensupport.DecodeResponse(target, res); err != nil { 2231 return nil, err 2232 } 2233 return ret, nil 2234 // { 2235 // "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.", 2236 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 2237 // "httpMethod": "GET", 2238 // "id": "cloudbuild.projects.locations.operations.get", 2239 // "parameterOrder": [ 2240 // "name" 2241 // ], 2242 // "parameters": { 2243 // "name": { 2244 // "description": "The name of the operation resource.", 2245 // "location": "path", 2246 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 2247 // "required": true, 2248 // "type": "string" 2249 // } 2250 // }, 2251 // "path": "v1beta1/{+name}", 2252 // "response": { 2253 // "$ref": "Operation" 2254 // }, 2255 // "scopes": [ 2256 // "https://www.googleapis.com/auth/cloud-platform" 2257 // ] 2258 // } 2259 2260} 2261 2262// method id "cloudbuild.projects.locations.workerPools.create": 2263 2264type ProjectsLocationsWorkerPoolsCreateCall struct { 2265 s *Service 2266 parent string 2267 workerpool *WorkerPool 2268 urlParams_ gensupport.URLParams 2269 ctx_ context.Context 2270 header_ http.Header 2271} 2272 2273// Create: Creates a `WorkerPool` to run the builds, and returns the new 2274// worker pool. NOTE: As of now, this method returns an `Operation` that 2275// is always complete. 2276func (r *ProjectsLocationsWorkerPoolsService) Create(parent string, workerpool *WorkerPool) *ProjectsLocationsWorkerPoolsCreateCall { 2277 c := &ProjectsLocationsWorkerPoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2278 c.parent = parent 2279 c.workerpool = workerpool 2280 return c 2281} 2282 2283// WorkerPoolId sets the optional parameter "workerPoolId": Required. 2284// Immutable. The ID to use for the `WorkerPool`, which will become the 2285// final component of the resource name. This value should be 1-63 2286// characters, and valid characters are /a-z-/. 2287func (c *ProjectsLocationsWorkerPoolsCreateCall) WorkerPoolId(workerPoolId string) *ProjectsLocationsWorkerPoolsCreateCall { 2288 c.urlParams_.Set("workerPoolId", workerPoolId) 2289 return c 2290} 2291 2292// Fields allows partial responses to be retrieved. See 2293// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2294// for more information. 2295func (c *ProjectsLocationsWorkerPoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkerPoolsCreateCall { 2296 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2297 return c 2298} 2299 2300// Context sets the context to be used in this call's Do method. Any 2301// pending HTTP request will be aborted if the provided context is 2302// canceled. 2303func (c *ProjectsLocationsWorkerPoolsCreateCall) Context(ctx context.Context) *ProjectsLocationsWorkerPoolsCreateCall { 2304 c.ctx_ = ctx 2305 return c 2306} 2307 2308// Header returns an http.Header that can be modified by the caller to 2309// add HTTP headers to the request. 2310func (c *ProjectsLocationsWorkerPoolsCreateCall) Header() http.Header { 2311 if c.header_ == nil { 2312 c.header_ = make(http.Header) 2313 } 2314 return c.header_ 2315} 2316 2317func (c *ProjectsLocationsWorkerPoolsCreateCall) doRequest(alt string) (*http.Response, error) { 2318 reqHeaders := make(http.Header) 2319 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2320 for k, v := range c.header_ { 2321 reqHeaders[k] = v 2322 } 2323 reqHeaders.Set("User-Agent", c.s.userAgent()) 2324 var body io.Reader = nil 2325 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workerpool) 2326 if err != nil { 2327 return nil, err 2328 } 2329 reqHeaders.Set("Content-Type", "application/json") 2330 c.urlParams_.Set("alt", alt) 2331 c.urlParams_.Set("prettyPrint", "false") 2332 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/workerPools") 2333 urls += "?" + c.urlParams_.Encode() 2334 req, err := http.NewRequest("POST", urls, body) 2335 if err != nil { 2336 return nil, err 2337 } 2338 req.Header = reqHeaders 2339 googleapi.Expand(req.URL, map[string]string{ 2340 "parent": c.parent, 2341 }) 2342 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2343} 2344 2345// Do executes the "cloudbuild.projects.locations.workerPools.create" call. 2346// Exactly one of *Operation or error will be non-nil. Any non-2xx 2347// status code is an error. Response headers are in either 2348// *Operation.ServerResponse.Header or (if a response was returned at 2349// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2350// to check whether the returned error was because 2351// http.StatusNotModified was returned. 2352func (c *ProjectsLocationsWorkerPoolsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2353 gensupport.SetOptions(c.urlParams_, opts...) 2354 res, err := c.doRequest("json") 2355 if res != nil && res.StatusCode == http.StatusNotModified { 2356 if res.Body != nil { 2357 res.Body.Close() 2358 } 2359 return nil, &googleapi.Error{ 2360 Code: res.StatusCode, 2361 Header: res.Header, 2362 } 2363 } 2364 if err != nil { 2365 return nil, err 2366 } 2367 defer googleapi.CloseBody(res) 2368 if err := googleapi.CheckResponse(res); err != nil { 2369 return nil, err 2370 } 2371 ret := &Operation{ 2372 ServerResponse: googleapi.ServerResponse{ 2373 Header: res.Header, 2374 HTTPStatusCode: res.StatusCode, 2375 }, 2376 } 2377 target := &ret 2378 if err := gensupport.DecodeResponse(target, res); err != nil { 2379 return nil, err 2380 } 2381 return ret, nil 2382 // { 2383 // "description": "Creates a `WorkerPool` to run the builds, and returns the new worker pool. NOTE: As of now, this method returns an `Operation` that is always complete.", 2384 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/workerPools", 2385 // "httpMethod": "POST", 2386 // "id": "cloudbuild.projects.locations.workerPools.create", 2387 // "parameterOrder": [ 2388 // "parent" 2389 // ], 2390 // "parameters": { 2391 // "parent": { 2392 // "description": "Required. The parent resource where this worker pool will be created. Format: `projects/{project}/locations/{location}`.", 2393 // "location": "path", 2394 // "pattern": "^projects/[^/]+/locations/[^/]+$", 2395 // "required": true, 2396 // "type": "string" 2397 // }, 2398 // "workerPoolId": { 2399 // "description": "Required. Immutable. The ID to use for the `WorkerPool`, which will become the final component of the resource name. This value should be 1-63 characters, and valid characters are /a-z-/.", 2400 // "location": "query", 2401 // "type": "string" 2402 // } 2403 // }, 2404 // "path": "v1beta1/{+parent}/workerPools", 2405 // "request": { 2406 // "$ref": "WorkerPool" 2407 // }, 2408 // "response": { 2409 // "$ref": "Operation" 2410 // }, 2411 // "scopes": [ 2412 // "https://www.googleapis.com/auth/cloud-platform" 2413 // ] 2414 // } 2415 2416} 2417 2418// method id "cloudbuild.projects.locations.workerPools.delete": 2419 2420type ProjectsLocationsWorkerPoolsDeleteCall struct { 2421 s *Service 2422 name string 2423 urlParams_ gensupport.URLParams 2424 ctx_ context.Context 2425 header_ http.Header 2426} 2427 2428// Delete: Deletes a `WorkerPool`. NOTE: As of now, this method returns 2429// an `Operation` that is always complete. 2430func (r *ProjectsLocationsWorkerPoolsService) Delete(name string) *ProjectsLocationsWorkerPoolsDeleteCall { 2431 c := &ProjectsLocationsWorkerPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2432 c.name = name 2433 return c 2434} 2435 2436// Fields allows partial responses to be retrieved. See 2437// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2438// for more information. 2439func (c *ProjectsLocationsWorkerPoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkerPoolsDeleteCall { 2440 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2441 return c 2442} 2443 2444// Context sets the context to be used in this call's Do method. Any 2445// pending HTTP request will be aborted if the provided context is 2446// canceled. 2447func (c *ProjectsLocationsWorkerPoolsDeleteCall) Context(ctx context.Context) *ProjectsLocationsWorkerPoolsDeleteCall { 2448 c.ctx_ = ctx 2449 return c 2450} 2451 2452// Header returns an http.Header that can be modified by the caller to 2453// add HTTP headers to the request. 2454func (c *ProjectsLocationsWorkerPoolsDeleteCall) Header() http.Header { 2455 if c.header_ == nil { 2456 c.header_ = make(http.Header) 2457 } 2458 return c.header_ 2459} 2460 2461func (c *ProjectsLocationsWorkerPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { 2462 reqHeaders := make(http.Header) 2463 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2464 for k, v := range c.header_ { 2465 reqHeaders[k] = v 2466 } 2467 reqHeaders.Set("User-Agent", c.s.userAgent()) 2468 var body io.Reader = nil 2469 c.urlParams_.Set("alt", alt) 2470 c.urlParams_.Set("prettyPrint", "false") 2471 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2472 urls += "?" + c.urlParams_.Encode() 2473 req, err := http.NewRequest("DELETE", urls, body) 2474 if err != nil { 2475 return nil, err 2476 } 2477 req.Header = reqHeaders 2478 googleapi.Expand(req.URL, map[string]string{ 2479 "name": c.name, 2480 }) 2481 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2482} 2483 2484// Do executes the "cloudbuild.projects.locations.workerPools.delete" call. 2485// Exactly one of *Operation or error will be non-nil. Any non-2xx 2486// status code is an error. Response headers are in either 2487// *Operation.ServerResponse.Header or (if a response was returned at 2488// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2489// to check whether the returned error was because 2490// http.StatusNotModified was returned. 2491func (c *ProjectsLocationsWorkerPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2492 gensupport.SetOptions(c.urlParams_, opts...) 2493 res, err := c.doRequest("json") 2494 if res != nil && res.StatusCode == http.StatusNotModified { 2495 if res.Body != nil { 2496 res.Body.Close() 2497 } 2498 return nil, &googleapi.Error{ 2499 Code: res.StatusCode, 2500 Header: res.Header, 2501 } 2502 } 2503 if err != nil { 2504 return nil, err 2505 } 2506 defer googleapi.CloseBody(res) 2507 if err := googleapi.CheckResponse(res); err != nil { 2508 return nil, err 2509 } 2510 ret := &Operation{ 2511 ServerResponse: googleapi.ServerResponse{ 2512 Header: res.Header, 2513 HTTPStatusCode: res.StatusCode, 2514 }, 2515 } 2516 target := &ret 2517 if err := gensupport.DecodeResponse(target, res); err != nil { 2518 return nil, err 2519 } 2520 return ret, nil 2521 // { 2522 // "description": "Deletes a `WorkerPool`. NOTE: As of now, this method returns an `Operation` that is always complete.", 2523 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/workerPools/{workerPoolsId}", 2524 // "httpMethod": "DELETE", 2525 // "id": "cloudbuild.projects.locations.workerPools.delete", 2526 // "parameterOrder": [ 2527 // "name" 2528 // ], 2529 // "parameters": { 2530 // "name": { 2531 // "description": "Required. The name of the `WorkerPool` to delete. Format: `projects/{project}/locations/{workerPool}/workerPools/{workerPool}`.", 2532 // "location": "path", 2533 // "pattern": "^projects/[^/]+/locations/[^/]+/workerPools/[^/]+$", 2534 // "required": true, 2535 // "type": "string" 2536 // } 2537 // }, 2538 // "path": "v1beta1/{+name}", 2539 // "response": { 2540 // "$ref": "Operation" 2541 // }, 2542 // "scopes": [ 2543 // "https://www.googleapis.com/auth/cloud-platform" 2544 // ] 2545 // } 2546 2547} 2548 2549// method id "cloudbuild.projects.locations.workerPools.get": 2550 2551type ProjectsLocationsWorkerPoolsGetCall struct { 2552 s *Service 2553 name string 2554 urlParams_ gensupport.URLParams 2555 ifNoneMatch_ string 2556 ctx_ context.Context 2557 header_ http.Header 2558} 2559 2560// Get: Returns details of a `WorkerPool`. 2561func (r *ProjectsLocationsWorkerPoolsService) Get(name string) *ProjectsLocationsWorkerPoolsGetCall { 2562 c := &ProjectsLocationsWorkerPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2563 c.name = name 2564 return c 2565} 2566 2567// Fields allows partial responses to be retrieved. See 2568// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2569// for more information. 2570func (c *ProjectsLocationsWorkerPoolsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkerPoolsGetCall { 2571 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2572 return c 2573} 2574 2575// IfNoneMatch sets the optional parameter which makes the operation 2576// fail if the object's ETag matches the given value. This is useful for 2577// getting updates only after the object has changed since the last 2578// request. Use googleapi.IsNotModified to check whether the response 2579// error from Do is the result of In-None-Match. 2580func (c *ProjectsLocationsWorkerPoolsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkerPoolsGetCall { 2581 c.ifNoneMatch_ = entityTag 2582 return c 2583} 2584 2585// Context sets the context to be used in this call's Do method. Any 2586// pending HTTP request will be aborted if the provided context is 2587// canceled. 2588func (c *ProjectsLocationsWorkerPoolsGetCall) Context(ctx context.Context) *ProjectsLocationsWorkerPoolsGetCall { 2589 c.ctx_ = ctx 2590 return c 2591} 2592 2593// Header returns an http.Header that can be modified by the caller to 2594// add HTTP headers to the request. 2595func (c *ProjectsLocationsWorkerPoolsGetCall) Header() http.Header { 2596 if c.header_ == nil { 2597 c.header_ = make(http.Header) 2598 } 2599 return c.header_ 2600} 2601 2602func (c *ProjectsLocationsWorkerPoolsGetCall) doRequest(alt string) (*http.Response, error) { 2603 reqHeaders := make(http.Header) 2604 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2605 for k, v := range c.header_ { 2606 reqHeaders[k] = v 2607 } 2608 reqHeaders.Set("User-Agent", c.s.userAgent()) 2609 if c.ifNoneMatch_ != "" { 2610 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2611 } 2612 var body io.Reader = nil 2613 c.urlParams_.Set("alt", alt) 2614 c.urlParams_.Set("prettyPrint", "false") 2615 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2616 urls += "?" + c.urlParams_.Encode() 2617 req, err := http.NewRequest("GET", urls, body) 2618 if err != nil { 2619 return nil, err 2620 } 2621 req.Header = reqHeaders 2622 googleapi.Expand(req.URL, map[string]string{ 2623 "name": c.name, 2624 }) 2625 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2626} 2627 2628// Do executes the "cloudbuild.projects.locations.workerPools.get" call. 2629// Exactly one of *WorkerPool or error will be non-nil. Any non-2xx 2630// status code is an error. Response headers are in either 2631// *WorkerPool.ServerResponse.Header or (if a response was returned at 2632// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2633// to check whether the returned error was because 2634// http.StatusNotModified was returned. 2635func (c *ProjectsLocationsWorkerPoolsGetCall) Do(opts ...googleapi.CallOption) (*WorkerPool, error) { 2636 gensupport.SetOptions(c.urlParams_, opts...) 2637 res, err := c.doRequest("json") 2638 if res != nil && res.StatusCode == http.StatusNotModified { 2639 if res.Body != nil { 2640 res.Body.Close() 2641 } 2642 return nil, &googleapi.Error{ 2643 Code: res.StatusCode, 2644 Header: res.Header, 2645 } 2646 } 2647 if err != nil { 2648 return nil, err 2649 } 2650 defer googleapi.CloseBody(res) 2651 if err := googleapi.CheckResponse(res); err != nil { 2652 return nil, err 2653 } 2654 ret := &WorkerPool{ 2655 ServerResponse: googleapi.ServerResponse{ 2656 Header: res.Header, 2657 HTTPStatusCode: res.StatusCode, 2658 }, 2659 } 2660 target := &ret 2661 if err := gensupport.DecodeResponse(target, res); err != nil { 2662 return nil, err 2663 } 2664 return ret, nil 2665 // { 2666 // "description": "Returns details of a `WorkerPool`.", 2667 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/workerPools/{workerPoolsId}", 2668 // "httpMethod": "GET", 2669 // "id": "cloudbuild.projects.locations.workerPools.get", 2670 // "parameterOrder": [ 2671 // "name" 2672 // ], 2673 // "parameters": { 2674 // "name": { 2675 // "description": "Required. The name of the `WorkerPool` to retrieve. Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`.", 2676 // "location": "path", 2677 // "pattern": "^projects/[^/]+/locations/[^/]+/workerPools/[^/]+$", 2678 // "required": true, 2679 // "type": "string" 2680 // } 2681 // }, 2682 // "path": "v1beta1/{+name}", 2683 // "response": { 2684 // "$ref": "WorkerPool" 2685 // }, 2686 // "scopes": [ 2687 // "https://www.googleapis.com/auth/cloud-platform" 2688 // ] 2689 // } 2690 2691} 2692 2693// method id "cloudbuild.projects.locations.workerPools.list": 2694 2695type ProjectsLocationsWorkerPoolsListCall struct { 2696 s *Service 2697 parent string 2698 urlParams_ gensupport.URLParams 2699 ifNoneMatch_ string 2700 ctx_ context.Context 2701 header_ http.Header 2702} 2703 2704// List: Lists `WorkerPool`s in the given project. 2705func (r *ProjectsLocationsWorkerPoolsService) List(parent string) *ProjectsLocationsWorkerPoolsListCall { 2706 c := &ProjectsLocationsWorkerPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2707 c.parent = parent 2708 return c 2709} 2710 2711// Fields allows partial responses to be retrieved. See 2712// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2713// for more information. 2714func (c *ProjectsLocationsWorkerPoolsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkerPoolsListCall { 2715 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2716 return c 2717} 2718 2719// IfNoneMatch sets the optional parameter which makes the operation 2720// fail if the object's ETag matches the given value. This is useful for 2721// getting updates only after the object has changed since the last 2722// request. Use googleapi.IsNotModified to check whether the response 2723// error from Do is the result of In-None-Match. 2724func (c *ProjectsLocationsWorkerPoolsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkerPoolsListCall { 2725 c.ifNoneMatch_ = entityTag 2726 return c 2727} 2728 2729// Context sets the context to be used in this call's Do method. Any 2730// pending HTTP request will be aborted if the provided context is 2731// canceled. 2732func (c *ProjectsLocationsWorkerPoolsListCall) Context(ctx context.Context) *ProjectsLocationsWorkerPoolsListCall { 2733 c.ctx_ = ctx 2734 return c 2735} 2736 2737// Header returns an http.Header that can be modified by the caller to 2738// add HTTP headers to the request. 2739func (c *ProjectsLocationsWorkerPoolsListCall) Header() http.Header { 2740 if c.header_ == nil { 2741 c.header_ = make(http.Header) 2742 } 2743 return c.header_ 2744} 2745 2746func (c *ProjectsLocationsWorkerPoolsListCall) doRequest(alt string) (*http.Response, error) { 2747 reqHeaders := make(http.Header) 2748 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2749 for k, v := range c.header_ { 2750 reqHeaders[k] = v 2751 } 2752 reqHeaders.Set("User-Agent", c.s.userAgent()) 2753 if c.ifNoneMatch_ != "" { 2754 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2755 } 2756 var body io.Reader = nil 2757 c.urlParams_.Set("alt", alt) 2758 c.urlParams_.Set("prettyPrint", "false") 2759 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+parent}/workerPools") 2760 urls += "?" + c.urlParams_.Encode() 2761 req, err := http.NewRequest("GET", urls, body) 2762 if err != nil { 2763 return nil, err 2764 } 2765 req.Header = reqHeaders 2766 googleapi.Expand(req.URL, map[string]string{ 2767 "parent": c.parent, 2768 }) 2769 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2770} 2771 2772// Do executes the "cloudbuild.projects.locations.workerPools.list" call. 2773// Exactly one of *ListWorkerPoolsResponse or error will be non-nil. Any 2774// non-2xx status code is an error. Response headers are in either 2775// *ListWorkerPoolsResponse.ServerResponse.Header or (if a response was 2776// returned at all) in error.(*googleapi.Error).Header. Use 2777// googleapi.IsNotModified to check whether the returned error was 2778// because http.StatusNotModified was returned. 2779func (c *ProjectsLocationsWorkerPoolsListCall) Do(opts ...googleapi.CallOption) (*ListWorkerPoolsResponse, error) { 2780 gensupport.SetOptions(c.urlParams_, opts...) 2781 res, err := c.doRequest("json") 2782 if res != nil && res.StatusCode == http.StatusNotModified { 2783 if res.Body != nil { 2784 res.Body.Close() 2785 } 2786 return nil, &googleapi.Error{ 2787 Code: res.StatusCode, 2788 Header: res.Header, 2789 } 2790 } 2791 if err != nil { 2792 return nil, err 2793 } 2794 defer googleapi.CloseBody(res) 2795 if err := googleapi.CheckResponse(res); err != nil { 2796 return nil, err 2797 } 2798 ret := &ListWorkerPoolsResponse{ 2799 ServerResponse: googleapi.ServerResponse{ 2800 Header: res.Header, 2801 HTTPStatusCode: res.StatusCode, 2802 }, 2803 } 2804 target := &ret 2805 if err := gensupport.DecodeResponse(target, res); err != nil { 2806 return nil, err 2807 } 2808 return ret, nil 2809 // { 2810 // "description": "Lists `WorkerPool`s in the given project.", 2811 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/workerPools", 2812 // "httpMethod": "GET", 2813 // "id": "cloudbuild.projects.locations.workerPools.list", 2814 // "parameterOrder": [ 2815 // "parent" 2816 // ], 2817 // "parameters": { 2818 // "parent": { 2819 // "description": "Required. The parent of the collection of `WorkerPools`. Format: `projects/{project}/locations/location`.", 2820 // "location": "path", 2821 // "pattern": "^projects/[^/]+/locations/[^/]+$", 2822 // "required": true, 2823 // "type": "string" 2824 // } 2825 // }, 2826 // "path": "v1beta1/{+parent}/workerPools", 2827 // "response": { 2828 // "$ref": "ListWorkerPoolsResponse" 2829 // }, 2830 // "scopes": [ 2831 // "https://www.googleapis.com/auth/cloud-platform" 2832 // ] 2833 // } 2834 2835} 2836 2837// method id "cloudbuild.projects.locations.workerPools.patch": 2838 2839type ProjectsLocationsWorkerPoolsPatchCall struct { 2840 s *Service 2841 name string 2842 workerpool *WorkerPool 2843 urlParams_ gensupport.URLParams 2844 ctx_ context.Context 2845 header_ http.Header 2846} 2847 2848// Patch: Updates a `WorkerPool`. NOTE: As of now, this method returns 2849// an `Operation` that is always complete. 2850func (r *ProjectsLocationsWorkerPoolsService) Patch(name string, workerpool *WorkerPool) *ProjectsLocationsWorkerPoolsPatchCall { 2851 c := &ProjectsLocationsWorkerPoolsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2852 c.name = name 2853 c.workerpool = workerpool 2854 return c 2855} 2856 2857// UpdateMask sets the optional parameter "updateMask": A mask 2858// specifying which fields in `WorkerPool` to update. 2859func (c *ProjectsLocationsWorkerPoolsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsWorkerPoolsPatchCall { 2860 c.urlParams_.Set("updateMask", updateMask) 2861 return c 2862} 2863 2864// Fields allows partial responses to be retrieved. See 2865// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2866// for more information. 2867func (c *ProjectsLocationsWorkerPoolsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkerPoolsPatchCall { 2868 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2869 return c 2870} 2871 2872// Context sets the context to be used in this call's Do method. Any 2873// pending HTTP request will be aborted if the provided context is 2874// canceled. 2875func (c *ProjectsLocationsWorkerPoolsPatchCall) Context(ctx context.Context) *ProjectsLocationsWorkerPoolsPatchCall { 2876 c.ctx_ = ctx 2877 return c 2878} 2879 2880// Header returns an http.Header that can be modified by the caller to 2881// add HTTP headers to the request. 2882func (c *ProjectsLocationsWorkerPoolsPatchCall) Header() http.Header { 2883 if c.header_ == nil { 2884 c.header_ = make(http.Header) 2885 } 2886 return c.header_ 2887} 2888 2889func (c *ProjectsLocationsWorkerPoolsPatchCall) doRequest(alt string) (*http.Response, error) { 2890 reqHeaders := make(http.Header) 2891 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2892 for k, v := range c.header_ { 2893 reqHeaders[k] = v 2894 } 2895 reqHeaders.Set("User-Agent", c.s.userAgent()) 2896 var body io.Reader = nil 2897 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workerpool) 2898 if err != nil { 2899 return nil, err 2900 } 2901 reqHeaders.Set("Content-Type", "application/json") 2902 c.urlParams_.Set("alt", alt) 2903 c.urlParams_.Set("prettyPrint", "false") 2904 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta1/{+name}") 2905 urls += "?" + c.urlParams_.Encode() 2906 req, err := http.NewRequest("PATCH", urls, body) 2907 if err != nil { 2908 return nil, err 2909 } 2910 req.Header = reqHeaders 2911 googleapi.Expand(req.URL, map[string]string{ 2912 "name": c.name, 2913 }) 2914 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2915} 2916 2917// Do executes the "cloudbuild.projects.locations.workerPools.patch" call. 2918// Exactly one of *Operation or error will be non-nil. Any non-2xx 2919// status code is an error. Response headers are in either 2920// *Operation.ServerResponse.Header or (if a response was returned at 2921// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2922// to check whether the returned error was because 2923// http.StatusNotModified was returned. 2924func (c *ProjectsLocationsWorkerPoolsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2925 gensupport.SetOptions(c.urlParams_, opts...) 2926 res, err := c.doRequest("json") 2927 if res != nil && res.StatusCode == http.StatusNotModified { 2928 if res.Body != nil { 2929 res.Body.Close() 2930 } 2931 return nil, &googleapi.Error{ 2932 Code: res.StatusCode, 2933 Header: res.Header, 2934 } 2935 } 2936 if err != nil { 2937 return nil, err 2938 } 2939 defer googleapi.CloseBody(res) 2940 if err := googleapi.CheckResponse(res); err != nil { 2941 return nil, err 2942 } 2943 ret := &Operation{ 2944 ServerResponse: googleapi.ServerResponse{ 2945 Header: res.Header, 2946 HTTPStatusCode: res.StatusCode, 2947 }, 2948 } 2949 target := &ret 2950 if err := gensupport.DecodeResponse(target, res); err != nil { 2951 return nil, err 2952 } 2953 return ret, nil 2954 // { 2955 // "description": "Updates a `WorkerPool`. NOTE: As of now, this method returns an `Operation` that is always complete.", 2956 // "flatPath": "v1beta1/projects/{projectsId}/locations/{locationsId}/workerPools/{workerPoolsId}", 2957 // "httpMethod": "PATCH", 2958 // "id": "cloudbuild.projects.locations.workerPools.patch", 2959 // "parameterOrder": [ 2960 // "name" 2961 // ], 2962 // "parameters": { 2963 // "name": { 2964 // "description": "Output only. The resource name of the `WorkerPool`, with format `projects/{project}/locations/{location}/workerPools/{worker_pool}`. The value of `{worker_pool}` is provided by `worker_pool_id` in `CreateWorkerPool` request and the value of `{location}` is determined by the endpoint accessed.", 2965 // "location": "path", 2966 // "pattern": "^projects/[^/]+/locations/[^/]+/workerPools/[^/]+$", 2967 // "required": true, 2968 // "type": "string" 2969 // }, 2970 // "updateMask": { 2971 // "description": "A mask specifying which fields in `WorkerPool` to update.", 2972 // "format": "google-fieldmask", 2973 // "location": "query", 2974 // "type": "string" 2975 // } 2976 // }, 2977 // "path": "v1beta1/{+name}", 2978 // "request": { 2979 // "$ref": "WorkerPool" 2980 // }, 2981 // "response": { 2982 // "$ref": "Operation" 2983 // }, 2984 // "scopes": [ 2985 // "https://www.googleapis.com/auth/cloud-platform" 2986 // ] 2987 // } 2988 2989} 2990