1// Copyright 2021 Google LLC. 2// Use of this source code is governed by a BSD-style 3// license that can be found in the LICENSE file. 4 5// Code generated file. DO NOT EDIT. 6 7// Package cloudbuild provides access to the Cloud Build API. 8// 9// For product documentation, see: https://cloud.google.com/cloud-build/docs/ 10// 11// Creating a client 12// 13// Usage example: 14// 15// import "google.golang.org/api/cloudbuild/v1alpha1" 16// ... 17// ctx := context.Background() 18// cloudbuildService, err := cloudbuild.NewService(ctx) 19// 20// In this example, Google Application Default Credentials are used for authentication. 21// 22// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 23// 24// Other authentication options 25// 26// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 27// 28// cloudbuildService, err := cloudbuild.NewService(ctx, option.WithAPIKey("AIza...")) 29// 30// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 31// 32// config := &oauth2.Config{...} 33// // ... 34// token, err := config.Exchange(ctx, ...) 35// cloudbuildService, err := cloudbuild.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 36// 37// See https://godoc.org/google.golang.org/api/option/ for details on options. 38package cloudbuild // import "google.golang.org/api/cloudbuild/v1alpha1" 39 40import ( 41 "bytes" 42 "context" 43 "encoding/json" 44 "errors" 45 "fmt" 46 "io" 47 "net/http" 48 "net/url" 49 "strconv" 50 "strings" 51 52 googleapi "google.golang.org/api/googleapi" 53 gensupport "google.golang.org/api/internal/gensupport" 54 option "google.golang.org/api/option" 55 internaloption "google.golang.org/api/option/internaloption" 56 htransport "google.golang.org/api/transport/http" 57) 58 59// Always reference these packages, just in case the auto-generated code 60// below doesn't. 61var _ = bytes.NewBuffer 62var _ = strconv.Itoa 63var _ = fmt.Sprintf 64var _ = json.NewDecoder 65var _ = io.Copy 66var _ = url.Parse 67var _ = gensupport.MarshalJSON 68var _ = googleapi.Version 69var _ = errors.New 70var _ = strings.Replace 71var _ = context.Canceled 72var _ = internaloption.WithDefaultEndpoint 73 74const apiId = "cloudbuild:v1alpha1" 75const apiName = "cloudbuild" 76const apiVersion = "v1alpha1" 77const basePath = "https://cloudbuild.googleapis.com/" 78const mtlsBasePath = "https://cloudbuild.mtls.googleapis.com/" 79 80// OAuth2 scopes used by this API. 81const ( 82 // See, edit, configure, and delete your Google Cloud 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 rs.WorkerPools = NewProjectsWorkerPoolsService(s) 142 return rs 143} 144 145type ProjectsService struct { 146 s *Service 147 148 Locations *ProjectsLocationsService 149 150 WorkerPools *ProjectsWorkerPoolsService 151} 152 153func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 154 rs := &ProjectsLocationsService{s: s} 155 rs.Operations = NewProjectsLocationsOperationsService(s) 156 return rs 157} 158 159type ProjectsLocationsService struct { 160 s *Service 161 162 Operations *ProjectsLocationsOperationsService 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 NewProjectsWorkerPoolsService(s *Service) *ProjectsWorkerPoolsService { 175 rs := &ProjectsWorkerPoolsService{s: s} 176 return rs 177} 178 179type ProjectsWorkerPoolsService 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 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// Network: Network describes the GCP network used to create workers in. 961type Network struct { 962 // Network: Network on which the workers are created. "default" network 963 // is used if empty. 964 Network string `json:"network,omitempty"` 965 966 // ProjectId: Project id containing the defined network and subnetwork. 967 // For a peered VPC, this will be the same as the project_id in which 968 // the workers are created. For a shared VPC, this will be the project 969 // sharing the network with the project_id project in which workers will 970 // be created. For custom workers with no VPC, this will be the same as 971 // project_id. 972 ProjectId string `json:"projectId,omitempty"` 973 974 // Subnetwork: Subnetwork on which the workers are created. "default" 975 // subnetwork is used if empty. 976 Subnetwork string `json:"subnetwork,omitempty"` 977 978 // ForceSendFields is a list of field names (e.g. "Network") to 979 // unconditionally include in API requests. By default, fields with 980 // empty values are omitted from API requests. However, any non-pointer, 981 // non-interface field appearing in ForceSendFields will be sent to the 982 // server regardless of whether the field is empty or not. This may be 983 // used to include empty fields in Patch requests. 984 ForceSendFields []string `json:"-"` 985 986 // NullFields is a list of field names (e.g. "Network") to include in 987 // API requests with the JSON null value. By default, fields with empty 988 // values are omitted from API requests. However, any field with an 989 // empty value appearing in NullFields will be sent to the server as 990 // null. It is an error if a field in this list has a non-empty value. 991 // This may be used to include null fields in Patch requests. 992 NullFields []string `json:"-"` 993} 994 995func (s *Network) MarshalJSON() ([]byte, error) { 996 type NoMethod Network 997 raw := NoMethod(*s) 998 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 999} 1000 1001// Notification: Notification is the container which holds the data that 1002// is relevant to this particular notification. 1003type Notification struct { 1004 // Filter: The filter string to use for notification filtering. 1005 // Currently, this is assumed to be a CEL program. See 1006 // https://opensource.google/projects/cel for more. 1007 Filter string `json:"filter,omitempty"` 1008 1009 // HttpDelivery: Configuration for HTTP delivery. 1010 HttpDelivery *HTTPDelivery `json:"httpDelivery,omitempty"` 1011 1012 // SlackDelivery: Configuration for Slack delivery. 1013 SlackDelivery *SlackDelivery `json:"slackDelivery,omitempty"` 1014 1015 // SmtpDelivery: Configuration for SMTP (email) delivery. 1016 SmtpDelivery *SMTPDelivery `json:"smtpDelivery,omitempty"` 1017 1018 // StructDelivery: Escape hatch for users to supply custom delivery 1019 // configs. 1020 StructDelivery googleapi.RawMessage `json:"structDelivery,omitempty"` 1021 1022 // ForceSendFields is a list of field names (e.g. "Filter") to 1023 // unconditionally include in API requests. By default, fields with 1024 // empty values are omitted from API requests. However, any non-pointer, 1025 // non-interface field appearing in ForceSendFields will be sent to the 1026 // server regardless of whether the field is empty or not. This may be 1027 // used to include empty fields in Patch requests. 1028 ForceSendFields []string `json:"-"` 1029 1030 // NullFields is a list of field names (e.g. "Filter") to include in API 1031 // requests with the JSON null value. By default, fields with empty 1032 // values are omitted from API requests. However, any field with an 1033 // empty value appearing in NullFields will be sent to the server as 1034 // null. It is an error if a field in this list has a non-empty value. 1035 // This may be used to include null fields in Patch requests. 1036 NullFields []string `json:"-"` 1037} 1038 1039func (s *Notification) MarshalJSON() ([]byte, error) { 1040 type NoMethod Notification 1041 raw := NoMethod(*s) 1042 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1043} 1044 1045// NotifierConfig: NotifierConfig is the top-level configuration 1046// message. 1047type NotifierConfig struct { 1048 // ApiVersion: The API version of this configuration format. 1049 ApiVersion string `json:"apiVersion,omitempty"` 1050 1051 // Kind: The type of notifier to use (e.g. SMTPNotifier). 1052 Kind string `json:"kind,omitempty"` 1053 1054 // Metadata: Metadata for referring to/handling/deploying this notifier. 1055 Metadata *NotifierMetadata `json:"metadata,omitempty"` 1056 1057 // Spec: The actual configuration for this notifier. 1058 Spec *NotifierSpec `json:"spec,omitempty"` 1059 1060 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1061 // unconditionally include in API requests. By default, fields with 1062 // empty values are omitted from API requests. However, any non-pointer, 1063 // non-interface field appearing in ForceSendFields will be sent to the 1064 // server regardless of whether the field is empty or not. This may be 1065 // used to include empty fields in Patch requests. 1066 ForceSendFields []string `json:"-"` 1067 1068 // NullFields is a list of field names (e.g. "ApiVersion") to include in 1069 // API requests with the JSON null value. By default, fields with empty 1070 // values are omitted from API requests. However, any field with an 1071 // empty value appearing in NullFields will be sent to the server as 1072 // null. It is an error if a field in this list has a non-empty value. 1073 // This may be used to include null fields in Patch requests. 1074 NullFields []string `json:"-"` 1075} 1076 1077func (s *NotifierConfig) MarshalJSON() ([]byte, error) { 1078 type NoMethod NotifierConfig 1079 raw := NoMethod(*s) 1080 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1081} 1082 1083// NotifierMetadata: NotifierMetadata contains the data which can be 1084// used to reference or describe this notifier. 1085type NotifierMetadata struct { 1086 // Name: The human-readable and user-given name for the notifier. For 1087 // example: "repo-merge-email-notifier". 1088 Name string `json:"name,omitempty"` 1089 1090 // Notifier: The string representing the name and version of notifier to 1091 // deploy. Expected to be of the form of "/:". For example: 1092 // "gcr.io/my-project/notifiers/smtp:1.2.34". 1093 Notifier string `json:"notifier,omitempty"` 1094 1095 // ForceSendFields is a list of field names (e.g. "Name") to 1096 // unconditionally include in API requests. By default, fields with 1097 // empty values are omitted from API requests. However, any non-pointer, 1098 // non-interface field appearing in ForceSendFields will be sent to the 1099 // server regardless of whether the field is empty or not. This may be 1100 // used to include empty fields in Patch requests. 1101 ForceSendFields []string `json:"-"` 1102 1103 // NullFields is a list of field names (e.g. "Name") to include in API 1104 // requests with the JSON null value. By default, fields with empty 1105 // values are omitted from API requests. However, any field with an 1106 // empty value appearing in NullFields will be sent to the server as 1107 // null. It is an error if a field in this list has a non-empty value. 1108 // This may be used to include null fields in Patch requests. 1109 NullFields []string `json:"-"` 1110} 1111 1112func (s *NotifierMetadata) MarshalJSON() ([]byte, error) { 1113 type NoMethod NotifierMetadata 1114 raw := NoMethod(*s) 1115 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1116} 1117 1118// NotifierSecret: NotifierSecret is the container that maps a secret 1119// name (reference) to its Google Cloud Secret Manager resource path. 1120type NotifierSecret struct { 1121 // Name: Name is the local name of the secret, such as the verbatim 1122 // string "my-smtp-password". 1123 Name string `json:"name,omitempty"` 1124 1125 // Value: Value is interpreted to be a resource path for fetching the 1126 // actual (versioned) secret data for this secret. For example, this 1127 // would be a Google Cloud Secret Manager secret version resource path 1128 // like: "projects/my-project/secrets/my-secret/versions/latest". 1129 Value string `json:"value,omitempty"` 1130 1131 // ForceSendFields is a list of field names (e.g. "Name") to 1132 // unconditionally include in API requests. By default, fields with 1133 // empty values are omitted from API requests. However, any non-pointer, 1134 // non-interface field appearing in ForceSendFields will be sent to the 1135 // server regardless of whether the field is empty or not. This may be 1136 // used to include empty fields in Patch requests. 1137 ForceSendFields []string `json:"-"` 1138 1139 // NullFields is a list of field names (e.g. "Name") to include in API 1140 // requests with the JSON null value. By default, fields with empty 1141 // values are omitted from API requests. However, any field with an 1142 // empty value appearing in NullFields will be sent to the server as 1143 // null. It is an error if a field in this list has a non-empty value. 1144 // This may be used to include null fields in Patch requests. 1145 NullFields []string `json:"-"` 1146} 1147 1148func (s *NotifierSecret) MarshalJSON() ([]byte, error) { 1149 type NoMethod NotifierSecret 1150 raw := NoMethod(*s) 1151 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1152} 1153 1154// NotifierSecretRef: NotifierSecretRef contains the reference to a 1155// secret stored in the corresponding NotifierSpec. 1156type NotifierSecretRef struct { 1157 // SecretRef: The value of `secret_ref` should be a `name` that is 1158 // registered in a `Secret` in the `secrets` list of the `Spec`. 1159 SecretRef string `json:"secretRef,omitempty"` 1160 1161 // ForceSendFields is a list of field names (e.g. "SecretRef") to 1162 // unconditionally include in API requests. By default, fields with 1163 // empty values are omitted from API requests. However, any non-pointer, 1164 // non-interface field appearing in ForceSendFields will be sent to the 1165 // server regardless of whether the field is empty or not. This may be 1166 // used to include empty fields in Patch requests. 1167 ForceSendFields []string `json:"-"` 1168 1169 // NullFields is a list of field names (e.g. "SecretRef") to include in 1170 // API requests with the JSON null value. By default, fields with empty 1171 // values are omitted from API requests. However, any field with an 1172 // empty value appearing in NullFields will be sent to the server as 1173 // null. It is an error if a field in this list has a non-empty value. 1174 // This may be used to include null fields in Patch requests. 1175 NullFields []string `json:"-"` 1176} 1177 1178func (s *NotifierSecretRef) MarshalJSON() ([]byte, error) { 1179 type NoMethod NotifierSecretRef 1180 raw := NoMethod(*s) 1181 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1182} 1183 1184// NotifierSpec: NotifierSpec is the configuration container for 1185// notifications. 1186type NotifierSpec struct { 1187 // Notification: The configuration of this particular notifier. 1188 Notification *Notification `json:"notification,omitempty"` 1189 1190 // Secrets: Configurations for secret resources used by this particular 1191 // notifier. 1192 Secrets []*NotifierSecret `json:"secrets,omitempty"` 1193 1194 // ForceSendFields is a list of field names (e.g. "Notification") to 1195 // unconditionally include in API requests. By default, fields with 1196 // empty values are omitted from API requests. However, any non-pointer, 1197 // non-interface field appearing in ForceSendFields will be sent to the 1198 // server regardless of whether the field is empty or not. This may be 1199 // used to include empty fields in Patch requests. 1200 ForceSendFields []string `json:"-"` 1201 1202 // NullFields is a list of field names (e.g. "Notification") to include 1203 // in API requests with the JSON null value. By default, fields with 1204 // empty values are omitted from API requests. However, any field with 1205 // an empty value appearing in NullFields will be sent to the server as 1206 // null. It is an error if a field in this list has a non-empty value. 1207 // This may be used to include null fields in Patch requests. 1208 NullFields []string `json:"-"` 1209} 1210 1211func (s *NotifierSpec) MarshalJSON() ([]byte, error) { 1212 type NoMethod NotifierSpec 1213 raw := NoMethod(*s) 1214 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1215} 1216 1217// Operation: This resource represents a long-running operation that is 1218// the result of a network API call. 1219type Operation struct { 1220 // Done: If the value is `false`, it means the operation is still in 1221 // progress. If `true`, the operation is completed, and either `error` 1222 // or `response` is available. 1223 Done bool `json:"done,omitempty"` 1224 1225 // Error: The error result of the operation in case of failure or 1226 // cancellation. 1227 Error *Status `json:"error,omitempty"` 1228 1229 // Metadata: Service-specific metadata associated with the operation. It 1230 // typically contains progress information and common metadata such as 1231 // create time. Some services might not provide such metadata. Any 1232 // method that returns a long-running operation should document the 1233 // metadata type, if any. 1234 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 1235 1236 // Name: The server-assigned name, which is only unique within the same 1237 // service that originally returns it. If you use the default HTTP 1238 // mapping, the `name` should be a resource name ending with 1239 // `operations/{unique_id}`. 1240 Name string `json:"name,omitempty"` 1241 1242 // Response: The normal response of the operation in case of success. If 1243 // the original method returns no data on success, such as `Delete`, the 1244 // response is `google.protobuf.Empty`. If the original method is 1245 // standard `Get`/`Create`/`Update`, the response should be the 1246 // resource. For other methods, the response should have the type 1247 // `XxxResponse`, where `Xxx` is the original method name. For example, 1248 // if the original method name is `TakeSnapshot()`, the inferred 1249 // response type is `TakeSnapshotResponse`. 1250 Response googleapi.RawMessage `json:"response,omitempty"` 1251 1252 // ServerResponse contains the HTTP response code and headers from the 1253 // server. 1254 googleapi.ServerResponse `json:"-"` 1255 1256 // ForceSendFields is a list of field names (e.g. "Done") to 1257 // unconditionally include in API requests. By default, fields with 1258 // empty values are omitted from API requests. However, any non-pointer, 1259 // non-interface field appearing in ForceSendFields will be sent to the 1260 // server regardless of whether the field is empty or not. This may be 1261 // used to include empty fields in Patch requests. 1262 ForceSendFields []string `json:"-"` 1263 1264 // NullFields is a list of field names (e.g. "Done") to include in API 1265 // requests with the JSON null value. By default, fields with empty 1266 // values are omitted from API requests. However, any field with an 1267 // empty value appearing in NullFields will be sent to the server as 1268 // null. It is an error if a field in this list has a non-empty value. 1269 // This may be used to include null fields in Patch requests. 1270 NullFields []string `json:"-"` 1271} 1272 1273func (s *Operation) MarshalJSON() ([]byte, error) { 1274 type NoMethod Operation 1275 raw := NoMethod(*s) 1276 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1277} 1278 1279// RepoSource: Location of the source in a Google Cloud Source 1280// Repository. 1281type RepoSource struct { 1282 // BranchName: Regex matching branches to build. The syntax of the 1283 // regular expressions accepted is the syntax accepted by RE2 and 1284 // described at https://github.com/google/re2/wiki/Syntax 1285 BranchName string `json:"branchName,omitempty"` 1286 1287 // CommitSha: Explicit commit SHA to build. 1288 CommitSha string `json:"commitSha,omitempty"` 1289 1290 // Dir: Directory, relative to the source root, in which to run the 1291 // build. This must be a relative path. If a step's `dir` is specified 1292 // and is an absolute path, this value is ignored for that step's 1293 // execution. 1294 Dir string `json:"dir,omitempty"` 1295 1296 // InvertRegex: Only trigger a build if the revision regex does NOT 1297 // match the revision regex. 1298 InvertRegex bool `json:"invertRegex,omitempty"` 1299 1300 // ProjectId: ID of the project that owns the Cloud Source Repository. 1301 // If omitted, the project ID requesting the build is assumed. 1302 ProjectId string `json:"projectId,omitempty"` 1303 1304 // RepoName: Name of the Cloud Source Repository. 1305 RepoName string `json:"repoName,omitempty"` 1306 1307 // Substitutions: Substitutions to use in a triggered build. Should only 1308 // be used with RunBuildTrigger 1309 Substitutions map[string]string `json:"substitutions,omitempty"` 1310 1311 // TagName: Regex matching tags to build. The syntax of the regular 1312 // expressions accepted is the syntax accepted by RE2 and described at 1313 // https://github.com/google/re2/wiki/Syntax 1314 TagName string `json:"tagName,omitempty"` 1315 1316 // ForceSendFields is a list of field names (e.g. "BranchName") to 1317 // unconditionally include in API requests. By default, fields with 1318 // empty values are omitted from API requests. However, any non-pointer, 1319 // non-interface field appearing in ForceSendFields will be sent to the 1320 // server regardless of whether the field is empty or not. This may be 1321 // used to include empty fields in Patch requests. 1322 ForceSendFields []string `json:"-"` 1323 1324 // NullFields is a list of field names (e.g. "BranchName") to include in 1325 // API requests with the JSON null value. By default, fields with empty 1326 // values are omitted from API requests. However, any field with an 1327 // empty value appearing in NullFields will be sent to the server as 1328 // null. It is an error if a field in this list has a non-empty value. 1329 // This may be used to include null fields in Patch requests. 1330 NullFields []string `json:"-"` 1331} 1332 1333func (s *RepoSource) MarshalJSON() ([]byte, error) { 1334 type NoMethod RepoSource 1335 raw := NoMethod(*s) 1336 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1337} 1338 1339// Results: Artifacts created by the build pipeline. 1340type Results struct { 1341 // ArtifactManifest: Path to the artifact manifest. Only populated when 1342 // artifacts are uploaded. 1343 ArtifactManifest string `json:"artifactManifest,omitempty"` 1344 1345 // ArtifactTiming: Time to push all non-container artifacts. 1346 ArtifactTiming *TimeSpan `json:"artifactTiming,omitempty"` 1347 1348 // BuildStepImages: List of build step digests, in the order 1349 // corresponding to build step indices. 1350 BuildStepImages []string `json:"buildStepImages,omitempty"` 1351 1352 // BuildStepOutputs: List of build step outputs, produced by builder 1353 // images, in the order corresponding to build step indices. Cloud 1354 // Builders (https://cloud.google.com/cloud-build/docs/cloud-builders) 1355 // can produce this output by writing to `$BUILDER_OUTPUT/output`. Only 1356 // the first 4KB of data is stored. 1357 BuildStepOutputs []string `json:"buildStepOutputs,omitempty"` 1358 1359 // Images: Container images that were built as a part of the build. 1360 Images []*BuiltImage `json:"images,omitempty"` 1361 1362 // NumArtifacts: Number of artifacts uploaded. Only populated when 1363 // artifacts are uploaded. 1364 NumArtifacts int64 `json:"numArtifacts,omitempty,string"` 1365 1366 // ForceSendFields is a list of field names (e.g. "ArtifactManifest") to 1367 // unconditionally include in API requests. By default, fields with 1368 // empty values are omitted from API requests. However, any non-pointer, 1369 // non-interface field appearing in ForceSendFields will be sent to the 1370 // server regardless of whether the field is empty or not. This may be 1371 // used to include empty fields in Patch requests. 1372 ForceSendFields []string `json:"-"` 1373 1374 // NullFields is a list of field names (e.g. "ArtifactManifest") to 1375 // include in API requests with the JSON null value. By default, fields 1376 // with empty values are omitted from API requests. However, any field 1377 // with an empty value appearing in NullFields will be sent to the 1378 // server as null. It is an error if a field in this list has a 1379 // non-empty value. This may be used to include null fields in Patch 1380 // requests. 1381 NullFields []string `json:"-"` 1382} 1383 1384func (s *Results) MarshalJSON() ([]byte, error) { 1385 type NoMethod Results 1386 raw := NoMethod(*s) 1387 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1388} 1389 1390// SMTPDelivery: SMTPDelivery is the delivery configuration for an SMTP 1391// (email) notification. 1392type SMTPDelivery struct { 1393 // FromAddress: This is the SMTP account/email that appears in the 1394 // `From:` of the email. If empty, it is assumed to be sender. 1395 FromAddress string `json:"fromAddress,omitempty"` 1396 1397 // Password: The SMTP sender's password. 1398 Password *NotifierSecretRef `json:"password,omitempty"` 1399 1400 // Port: The SMTP port of the server. 1401 Port string `json:"port,omitempty"` 1402 1403 // RecipientAddresses: This is the list of addresses to which we send 1404 // the email (i.e. in the `To:` of the email). 1405 RecipientAddresses []string `json:"recipientAddresses,omitempty"` 1406 1407 // SenderAddress: This is the SMTP account/email that is used to send 1408 // the message. 1409 SenderAddress string `json:"senderAddress,omitempty"` 1410 1411 // Server: The address of the SMTP server. 1412 Server string `json:"server,omitempty"` 1413 1414 // ForceSendFields is a list of field names (e.g. "FromAddress") to 1415 // unconditionally include in API requests. By default, fields with 1416 // empty values are omitted from API requests. However, any non-pointer, 1417 // non-interface field appearing in ForceSendFields will be sent to the 1418 // server regardless of whether the field is empty or not. This may be 1419 // used to include empty fields in Patch requests. 1420 ForceSendFields []string `json:"-"` 1421 1422 // NullFields is a list of field names (e.g. "FromAddress") to include 1423 // in API requests with the JSON null value. By default, fields with 1424 // empty values are omitted from API requests. However, any field with 1425 // an empty value appearing in NullFields will be sent to the server as 1426 // null. It is an error if a field in this list has a non-empty value. 1427 // This may be used to include null fields in Patch requests. 1428 NullFields []string `json:"-"` 1429} 1430 1431func (s *SMTPDelivery) MarshalJSON() ([]byte, error) { 1432 type NoMethod SMTPDelivery 1433 raw := NoMethod(*s) 1434 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1435} 1436 1437// Secret: Pairs a set of secret environment variables containing 1438// encrypted values with the Cloud KMS key to use to decrypt the value. 1439// Note: Use `kmsKeyName` with `available_secrets` instead of using 1440// `kmsKeyName` with `secret`. For instructions see: 1441// https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-credentials. 1442type Secret struct { 1443 // KmsKeyName: Cloud KMS key name to use to decrypt these envs. 1444 KmsKeyName string `json:"kmsKeyName,omitempty"` 1445 1446 // SecretEnv: Map of environment variable name to its encrypted value. 1447 // Secret environment variables must be unique across all of a build's 1448 // secrets, and must be used by at least one build step. Values can be 1449 // at most 64 KB in size. There can be at most 100 secret values across 1450 // all of a build's secrets. 1451 SecretEnv map[string]string `json:"secretEnv,omitempty"` 1452 1453 // ForceSendFields is a list of field names (e.g. "KmsKeyName") to 1454 // unconditionally include in API requests. By default, fields with 1455 // empty values are omitted from API requests. However, any non-pointer, 1456 // non-interface field appearing in ForceSendFields will be sent to the 1457 // server regardless of whether the field is empty or not. This may be 1458 // used to include empty fields in Patch requests. 1459 ForceSendFields []string `json:"-"` 1460 1461 // NullFields is a list of field names (e.g. "KmsKeyName") to include in 1462 // API requests with the JSON null value. By default, fields with empty 1463 // values are omitted from API requests. However, any field with an 1464 // empty value appearing in NullFields will be sent to the server as 1465 // null. It is an error if a field in this list has a non-empty value. 1466 // This may be used to include null fields in Patch requests. 1467 NullFields []string `json:"-"` 1468} 1469 1470func (s *Secret) MarshalJSON() ([]byte, error) { 1471 type NoMethod Secret 1472 raw := NoMethod(*s) 1473 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1474} 1475 1476// SecretManagerSecret: Pairs a secret environment variable with a 1477// SecretVersion in Secret Manager. 1478type SecretManagerSecret struct { 1479 // Env: Environment variable name to associate with the secret. Secret 1480 // environment variables must be unique across all of a build's secrets, 1481 // and must be used by at least one build step. 1482 Env string `json:"env,omitempty"` 1483 1484 // VersionName: Resource name of the SecretVersion. In format: 1485 // projects/*/secrets/*/versions/* 1486 VersionName string `json:"versionName,omitempty"` 1487 1488 // ForceSendFields is a list of field names (e.g. "Env") to 1489 // unconditionally include in API requests. By default, fields with 1490 // empty values are omitted from API requests. However, any non-pointer, 1491 // non-interface field appearing in ForceSendFields will be sent to the 1492 // server regardless of whether the field is empty or not. This may be 1493 // used to include empty fields in Patch requests. 1494 ForceSendFields []string `json:"-"` 1495 1496 // NullFields is a list of field names (e.g. "Env") to include in API 1497 // requests with the JSON null value. By default, fields with empty 1498 // values are omitted from API requests. However, any field with an 1499 // empty value appearing in NullFields will be sent to the server as 1500 // null. It is an error if a field in this list has a non-empty value. 1501 // This may be used to include null fields in Patch requests. 1502 NullFields []string `json:"-"` 1503} 1504 1505func (s *SecretManagerSecret) MarshalJSON() ([]byte, error) { 1506 type NoMethod SecretManagerSecret 1507 raw := NoMethod(*s) 1508 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1509} 1510 1511// Secrets: Secrets and secret environment variables. 1512type Secrets struct { 1513 // Inline: Secrets encrypted with KMS key and the associated secret 1514 // environment variable. 1515 Inline []*InlineSecret `json:"inline,omitempty"` 1516 1517 // SecretManager: Secrets in Secret Manager and associated secret 1518 // environment variable. 1519 SecretManager []*SecretManagerSecret `json:"secretManager,omitempty"` 1520 1521 // ForceSendFields is a list of field names (e.g. "Inline") to 1522 // unconditionally include in API requests. By default, fields with 1523 // empty values are omitted from API requests. However, any non-pointer, 1524 // non-interface field appearing in ForceSendFields will be sent to the 1525 // server regardless of whether the field is empty or not. This may be 1526 // used to include empty fields in Patch requests. 1527 ForceSendFields []string `json:"-"` 1528 1529 // NullFields is a list of field names (e.g. "Inline") to include in API 1530 // requests with the JSON null value. By default, fields with empty 1531 // values are omitted from API requests. However, any field with an 1532 // empty value appearing in NullFields will be sent to the server as 1533 // null. It is an error if a field in this list has a non-empty value. 1534 // This may be used to include null fields in Patch requests. 1535 NullFields []string `json:"-"` 1536} 1537 1538func (s *Secrets) MarshalJSON() ([]byte, error) { 1539 type NoMethod Secrets 1540 raw := NoMethod(*s) 1541 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1542} 1543 1544// SlackDelivery: SlackDelivery is the delivery configuration for 1545// delivering Slack messages via webhooks. See Slack webhook 1546// documentation at: https://api.slack.com/messaging/webhooks. 1547type SlackDelivery struct { 1548 // WebhookUri: The secret reference for the Slack webhook URI for 1549 // sending messages to a channel. 1550 WebhookUri *NotifierSecretRef `json:"webhookUri,omitempty"` 1551 1552 // ForceSendFields is a list of field names (e.g. "WebhookUri") to 1553 // unconditionally include in API requests. By default, fields with 1554 // empty values are omitted from API requests. However, any non-pointer, 1555 // non-interface field appearing in ForceSendFields will be sent to the 1556 // server regardless of whether the field is empty or not. This may be 1557 // used to include empty fields in Patch requests. 1558 ForceSendFields []string `json:"-"` 1559 1560 // NullFields is a list of field names (e.g. "WebhookUri") to include in 1561 // API requests with the JSON null value. By default, fields with empty 1562 // values are omitted from API requests. However, any field with an 1563 // empty value appearing in NullFields will be sent to the server as 1564 // null. It is an error if a field in this list has a non-empty value. 1565 // This may be used to include null fields in Patch requests. 1566 NullFields []string `json:"-"` 1567} 1568 1569func (s *SlackDelivery) MarshalJSON() ([]byte, error) { 1570 type NoMethod SlackDelivery 1571 raw := NoMethod(*s) 1572 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1573} 1574 1575// Source: Location of the source in a supported storage service. 1576type Source struct { 1577 // RepoSource: If provided, get the source from this location in a Cloud 1578 // Source Repository. 1579 RepoSource *RepoSource `json:"repoSource,omitempty"` 1580 1581 // StorageSource: If provided, get the source from this location in 1582 // Google Cloud Storage. 1583 StorageSource *StorageSource `json:"storageSource,omitempty"` 1584 1585 // StorageSourceManifest: If provided, get the source from this manifest 1586 // in Google Cloud Storage. This feature is in Preview. 1587 StorageSourceManifest *StorageSourceManifest `json:"storageSourceManifest,omitempty"` 1588 1589 // ForceSendFields is a list of field names (e.g. "RepoSource") to 1590 // unconditionally include in API requests. By default, fields with 1591 // empty values are omitted from API requests. However, any non-pointer, 1592 // non-interface field appearing in ForceSendFields will be sent to the 1593 // server regardless of whether the field is empty or not. This may be 1594 // used to include empty fields in Patch requests. 1595 ForceSendFields []string `json:"-"` 1596 1597 // NullFields is a list of field names (e.g. "RepoSource") to include in 1598 // API requests with the JSON null value. By default, fields with empty 1599 // values are omitted from API requests. However, any field with an 1600 // empty value appearing in NullFields will be sent to the server as 1601 // null. It is an error if a field in this list has a non-empty value. 1602 // This may be used to include null fields in Patch requests. 1603 NullFields []string `json:"-"` 1604} 1605 1606func (s *Source) MarshalJSON() ([]byte, error) { 1607 type NoMethod Source 1608 raw := NoMethod(*s) 1609 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1610} 1611 1612// SourceProvenance: Provenance of the source. Ways to find the original 1613// source, or verify that some source was used for this build. 1614type SourceProvenance struct { 1615 // FileHashes: Output only. Hash(es) of the build source, which can be 1616 // used to verify that the original source integrity was maintained in 1617 // the build. Note that `FileHashes` will only be populated if 1618 // `BuildOptions` has requested a `SourceProvenanceHash`. The keys to 1619 // this map are file paths used as build source and the values contain 1620 // the hash values for those files. If the build source came in a single 1621 // package such as a gzipped tarfile (`.tar.gz`), the `FileHash` will be 1622 // for the single path to that file. 1623 FileHashes map[string]FileHashes `json:"fileHashes,omitempty"` 1624 1625 // ResolvedRepoSource: A copy of the build's `source.repo_source`, if 1626 // exists, with any revisions resolved. 1627 ResolvedRepoSource *RepoSource `json:"resolvedRepoSource,omitempty"` 1628 1629 // ResolvedStorageSource: A copy of the build's `source.storage_source`, 1630 // if exists, with any generations resolved. 1631 ResolvedStorageSource *StorageSource `json:"resolvedStorageSource,omitempty"` 1632 1633 // ResolvedStorageSourceManifest: A copy of the build's 1634 // `source.storage_source_manifest`, if exists, with any revisions 1635 // resolved. This feature is in Preview. 1636 ResolvedStorageSourceManifest *StorageSourceManifest `json:"resolvedStorageSourceManifest,omitempty"` 1637 1638 // ForceSendFields is a list of field names (e.g. "FileHashes") to 1639 // unconditionally include in API requests. By default, fields with 1640 // empty values are omitted from API requests. However, any non-pointer, 1641 // non-interface field appearing in ForceSendFields will be sent to the 1642 // server regardless of whether the field is empty or not. This may be 1643 // used to include empty fields in Patch requests. 1644 ForceSendFields []string `json:"-"` 1645 1646 // NullFields is a list of field names (e.g. "FileHashes") to include in 1647 // API requests with the JSON null value. By default, fields with empty 1648 // values are omitted from API requests. However, any field with an 1649 // empty value appearing in NullFields will be sent to the server as 1650 // null. It is an error if a field in this list has a non-empty value. 1651 // This may be used to include null fields in Patch requests. 1652 NullFields []string `json:"-"` 1653} 1654 1655func (s *SourceProvenance) MarshalJSON() ([]byte, error) { 1656 type NoMethod SourceProvenance 1657 raw := NoMethod(*s) 1658 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1659} 1660 1661// Status: The `Status` type defines a logical error model that is 1662// suitable for different programming environments, including REST APIs 1663// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 1664// `Status` message contains three pieces of data: error code, error 1665// message, and error details. You can find out more about this error 1666// model and how to work with it in the API Design Guide 1667// (https://cloud.google.com/apis/design/errors). 1668type Status struct { 1669 // Code: The status code, which should be an enum value of 1670 // google.rpc.Code. 1671 Code int64 `json:"code,omitempty"` 1672 1673 // Details: A list of messages that carry the error details. There is a 1674 // common set of message types for APIs to use. 1675 Details []googleapi.RawMessage `json:"details,omitempty"` 1676 1677 // Message: A developer-facing error message, which should be in 1678 // English. Any user-facing error message should be localized and sent 1679 // in the google.rpc.Status.details field, or localized by the client. 1680 Message string `json:"message,omitempty"` 1681 1682 // ForceSendFields is a list of field names (e.g. "Code") to 1683 // unconditionally include in API requests. By default, fields with 1684 // empty values are omitted from API requests. However, any non-pointer, 1685 // non-interface field appearing in ForceSendFields will be sent to the 1686 // server regardless of whether the field is empty or not. This may be 1687 // used to include empty fields in Patch requests. 1688 ForceSendFields []string `json:"-"` 1689 1690 // NullFields is a list of field names (e.g. "Code") to include in API 1691 // requests with the JSON null value. By default, fields with empty 1692 // values are omitted from API requests. However, any field with an 1693 // empty value appearing in NullFields will be sent to the server as 1694 // null. It is an error if a field in this list has a non-empty value. 1695 // This may be used to include null fields in Patch requests. 1696 NullFields []string `json:"-"` 1697} 1698 1699func (s *Status) MarshalJSON() ([]byte, error) { 1700 type NoMethod Status 1701 raw := NoMethod(*s) 1702 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1703} 1704 1705// StorageSource: Location of the source in an archive file in Google 1706// Cloud Storage. 1707type StorageSource struct { 1708 // Bucket: Google Cloud Storage bucket containing the source (see Bucket 1709 // Name Requirements 1710 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 1711 Bucket string `json:"bucket,omitempty"` 1712 1713 // Generation: Google Cloud Storage generation for the object. If the 1714 // generation is omitted, the latest generation will be used. 1715 Generation int64 `json:"generation,omitempty,string"` 1716 1717 // Object: Google Cloud Storage object containing the source. This 1718 // object must be a gzipped archive file (`.tar.gz`) containing source 1719 // to build. 1720 Object string `json:"object,omitempty"` 1721 1722 // ForceSendFields is a list of field names (e.g. "Bucket") to 1723 // unconditionally include in API requests. By default, fields with 1724 // empty values are omitted from API requests. However, any non-pointer, 1725 // non-interface field appearing in ForceSendFields will be sent to the 1726 // server regardless of whether the field is empty or not. This may be 1727 // used to include empty fields in Patch requests. 1728 ForceSendFields []string `json:"-"` 1729 1730 // NullFields is a list of field names (e.g. "Bucket") to include in API 1731 // requests with the JSON null value. By default, fields with empty 1732 // values are omitted from API requests. However, any field with an 1733 // empty value appearing in NullFields will be sent to the server as 1734 // null. It is an error if a field in this list has a non-empty value. 1735 // This may be used to include null fields in Patch requests. 1736 NullFields []string `json:"-"` 1737} 1738 1739func (s *StorageSource) MarshalJSON() ([]byte, error) { 1740 type NoMethod StorageSource 1741 raw := NoMethod(*s) 1742 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1743} 1744 1745// StorageSourceManifest: Location of the source manifest in Google 1746// Cloud Storage. This feature is in Preview. 1747type StorageSourceManifest struct { 1748 // Bucket: Google Cloud Storage bucket containing the source manifest 1749 // (see Bucket Name Requirements 1750 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 1751 Bucket string `json:"bucket,omitempty"` 1752 1753 // Generation: Google Cloud Storage generation for the object. If the 1754 // generation is omitted, the latest generation will be used. 1755 Generation int64 `json:"generation,omitempty,string"` 1756 1757 // Object: Google Cloud Storage object containing the source manifest. 1758 // This object must be a JSON file. 1759 Object string `json:"object,omitempty"` 1760 1761 // ForceSendFields is a list of field names (e.g. "Bucket") to 1762 // unconditionally include in API requests. By default, fields with 1763 // empty values are omitted from API requests. However, any non-pointer, 1764 // non-interface field appearing in ForceSendFields will be sent to the 1765 // server regardless of whether the field is empty or not. This may be 1766 // used to include empty fields in Patch requests. 1767 ForceSendFields []string `json:"-"` 1768 1769 // NullFields is a list of field names (e.g. "Bucket") to include in API 1770 // requests with the JSON null value. By default, fields with empty 1771 // values are omitted from API requests. However, any field with an 1772 // empty value appearing in NullFields will be sent to the server as 1773 // null. It is an error if a field in this list has a non-empty value. 1774 // This may be used to include null fields in Patch requests. 1775 NullFields []string `json:"-"` 1776} 1777 1778func (s *StorageSourceManifest) MarshalJSON() ([]byte, error) { 1779 type NoMethod StorageSourceManifest 1780 raw := NoMethod(*s) 1781 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1782} 1783 1784// TimeSpan: Start and end times for a build execution phase. 1785type TimeSpan struct { 1786 // EndTime: End of time span. 1787 EndTime string `json:"endTime,omitempty"` 1788 1789 // StartTime: Start of time span. 1790 StartTime string `json:"startTime,omitempty"` 1791 1792 // ForceSendFields is a list of field names (e.g. "EndTime") to 1793 // unconditionally include in API requests. By default, fields with 1794 // empty values are omitted from API requests. However, any non-pointer, 1795 // non-interface field appearing in ForceSendFields will be sent to the 1796 // server regardless of whether the field is empty or not. This may be 1797 // used to include empty fields in Patch requests. 1798 ForceSendFields []string `json:"-"` 1799 1800 // NullFields is a list of field names (e.g. "EndTime") to include in 1801 // API requests with the JSON null value. By default, fields with empty 1802 // values are omitted from API requests. However, any field with an 1803 // empty value appearing in NullFields will be sent to the server as 1804 // null. It is an error if a field in this list has a non-empty value. 1805 // This may be used to include null fields in Patch requests. 1806 NullFields []string `json:"-"` 1807} 1808 1809func (s *TimeSpan) MarshalJSON() ([]byte, error) { 1810 type NoMethod TimeSpan 1811 raw := NoMethod(*s) 1812 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1813} 1814 1815// Volume: Volume describes a Docker container volume which is mounted 1816// into build steps in order to persist files across build step 1817// execution. 1818type Volume struct { 1819 // Name: Name of the volume to mount. Volume names must be unique per 1820 // build step and must be valid names for Docker volumes. Each named 1821 // volume must be used by at least two build steps. 1822 Name string `json:"name,omitempty"` 1823 1824 // Path: Path at which to mount the volume. Paths must be absolute and 1825 // cannot conflict with other volume paths on the same build step or 1826 // with certain reserved volume paths. 1827 Path string `json:"path,omitempty"` 1828 1829 // ForceSendFields is a list of field names (e.g. "Name") to 1830 // unconditionally include in API requests. By default, fields with 1831 // empty values are omitted from API requests. However, any non-pointer, 1832 // non-interface field appearing in ForceSendFields will be sent to the 1833 // server regardless of whether the field is empty or not. This may be 1834 // used to include empty fields in Patch requests. 1835 ForceSendFields []string `json:"-"` 1836 1837 // NullFields is a list of field names (e.g. "Name") to include in API 1838 // requests with the JSON null value. By default, fields with empty 1839 // values are omitted from API requests. However, any field with an 1840 // empty value appearing in NullFields will be sent to the server as 1841 // null. It is an error if a field in this list has a non-empty value. 1842 // This may be used to include null fields in Patch requests. 1843 NullFields []string `json:"-"` 1844} 1845 1846func (s *Volume) MarshalJSON() ([]byte, error) { 1847 type NoMethod Volume 1848 raw := NoMethod(*s) 1849 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1850} 1851 1852// WorkerConfig: WorkerConfig defines the configuration to be used for a 1853// creating workers in the pool. 1854type WorkerConfig struct { 1855 // DiskSizeGb: Size of the disk attached to the worker, in GB. See 1856 // https://cloud.google.com/compute/docs/disks/ If `0` is specified, 1857 // Cloud Build will use a standard disk size. `disk_size` is overridden 1858 // if you specify a different disk size in `build_options`. In this 1859 // case, a VM with a disk size specified in the `build_options` will be 1860 // created on demand at build time. For more information see 1861 // https://cloud.google.com/cloud-build/docs/api/reference/rest/v1/projects.builds#buildoptions 1862 DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` 1863 1864 // MachineType: Machine Type of the worker, such as n1-standard-1. See 1865 // https://cloud.google.com/compute/docs/machine-types. If left blank, 1866 // Cloud Build will use a standard unspecified machine to create the 1867 // worker pool. `machine_type` is overridden if you specify a different 1868 // machine type in `build_options`. In this case, the VM specified in 1869 // the `build_options` will be created on demand at build time. For more 1870 // information see 1871 // https://cloud.google.com/cloud-build/docs/speeding-up-builds#using_custom_virtual_machine_sizes 1872 MachineType string `json:"machineType,omitempty"` 1873 1874 // Network: The network definition used to create the worker. If this 1875 // section is left empty, the workers will be created in 1876 // WorkerPool.project_id on the default network. 1877 Network *Network `json:"network,omitempty"` 1878 1879 // Tag: The tag applied to the worker, and the same tag used by the 1880 // firewall rule. It is used to identify the Cloud Build workers among 1881 // other VMs. The default value for tag is `worker`. 1882 Tag string `json:"tag,omitempty"` 1883 1884 // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to 1885 // unconditionally include in API requests. By default, fields with 1886 // empty values are omitted from API requests. However, any non-pointer, 1887 // non-interface field appearing in ForceSendFields will be sent to the 1888 // server regardless of whether the field is empty or not. This may be 1889 // used to include empty fields in Patch requests. 1890 ForceSendFields []string `json:"-"` 1891 1892 // NullFields is a list of field names (e.g. "DiskSizeGb") to include in 1893 // API requests with the JSON null value. By default, fields with empty 1894 // values are omitted from API requests. However, any field with an 1895 // empty value appearing in NullFields will be sent to the server as 1896 // null. It is an error if a field in this list has a non-empty value. 1897 // This may be used to include null fields in Patch requests. 1898 NullFields []string `json:"-"` 1899} 1900 1901func (s *WorkerConfig) MarshalJSON() ([]byte, error) { 1902 type NoMethod WorkerConfig 1903 raw := NoMethod(*s) 1904 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1905} 1906 1907// WorkerPool: Configuration for a WorkerPool to run the builds. Workers 1908// are machines that Cloud Build uses to run your builds. By default, 1909// all workers run in a project owned by Cloud Build. To have full 1910// control over the workers that execute your builds -- such as enabling 1911// them to access private resources on your private network -- you can 1912// request Cloud Build to run the workers in your own project by 1913// creating a custom workers pool. 1914type WorkerPool struct { 1915 // CreateTime: Output only. Time at which the request to create the 1916 // `WorkerPool` was received. 1917 CreateTime string `json:"createTime,omitempty"` 1918 1919 // DeleteTime: Output only. Time at which the request to delete the 1920 // `WorkerPool` was received. 1921 DeleteTime string `json:"deleteTime,omitempty"` 1922 1923 // Name: User-defined name of the `WorkerPool`. 1924 Name string `json:"name,omitempty"` 1925 1926 // ProjectId: The project ID of the GCP project for which the 1927 // `WorkerPool` is created. 1928 ProjectId string `json:"projectId,omitempty"` 1929 1930 // Regions: List of regions to create the `WorkerPool`. Regions can't be 1931 // empty. If Cloud Build adds a new GCP region in the future, the 1932 // existing `WorkerPool` will not be enabled in the new region 1933 // automatically; you must add the new region to the `regions` field to 1934 // enable the `WorkerPool` in that region. 1935 // 1936 // Possible values: 1937 // "REGION_UNSPECIFIED" - no region 1938 // "us-central1" - us-central1 region 1939 // "us-west1" - us-west1 region 1940 // "us-east1" - us-east1 region 1941 // "us-east4" - us-east4 region 1942 Regions []string `json:"regions,omitempty"` 1943 1944 // ServiceAccountEmail: Output only. The service account used to manage 1945 // the `WorkerPool`. The service account must have the Compute Instance 1946 // Admin (Beta) permission at the project level. 1947 ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` 1948 1949 // Status: Output only. WorkerPool Status. 1950 // 1951 // Possible values: 1952 // "STATUS_UNSPECIFIED" - Status of the `WorkerPool` is unknown. 1953 // "CREATING" - `WorkerPool` is being created. 1954 // "RUNNING" - `WorkerPool` is running. 1955 // "DELETING" - `WorkerPool` is being deleted: cancelling builds and 1956 // draining workers. 1957 // "DELETED" - `WorkerPool` is deleted. 1958 Status string `json:"status,omitempty"` 1959 1960 // UpdateTime: Output only. Time at which the request to update the 1961 // `WorkerPool` was received. 1962 UpdateTime string `json:"updateTime,omitempty"` 1963 1964 // WorkerConfig: Configuration to be used for a creating workers in the 1965 // `WorkerPool`. 1966 WorkerConfig *WorkerConfig `json:"workerConfig,omitempty"` 1967 1968 // WorkerCount: Total number of workers to be created across all 1969 // requested regions. 1970 WorkerCount int64 `json:"workerCount,omitempty,string"` 1971 1972 // ServerResponse contains the HTTP response code and headers from the 1973 // server. 1974 googleapi.ServerResponse `json:"-"` 1975 1976 // ForceSendFields is a list of field names (e.g. "CreateTime") to 1977 // unconditionally include in API requests. By default, fields with 1978 // empty values are omitted from API requests. However, any non-pointer, 1979 // non-interface field appearing in ForceSendFields will be sent to the 1980 // server regardless of whether the field is empty or not. This may be 1981 // used to include empty fields in Patch requests. 1982 ForceSendFields []string `json:"-"` 1983 1984 // NullFields is a list of field names (e.g. "CreateTime") to include in 1985 // API requests with the JSON null value. By default, fields with empty 1986 // values are omitted from API requests. However, any field with an 1987 // empty value appearing in NullFields will be sent to the server as 1988 // null. It is an error if a field in this list has a non-empty value. 1989 // This may be used to include null fields in Patch requests. 1990 NullFields []string `json:"-"` 1991} 1992 1993func (s *WorkerPool) MarshalJSON() ([]byte, error) { 1994 type NoMethod WorkerPool 1995 raw := NoMethod(*s) 1996 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1997} 1998 1999// method id "cloudbuild.projects.locations.operations.cancel": 2000 2001type ProjectsLocationsOperationsCancelCall struct { 2002 s *Service 2003 name string 2004 canceloperationrequest *CancelOperationRequest 2005 urlParams_ gensupport.URLParams 2006 ctx_ context.Context 2007 header_ http.Header 2008} 2009 2010// Cancel: Starts asynchronous cancellation on a long-running operation. 2011// The server makes a best effort to cancel the operation, but success 2012// is not guaranteed. If the server doesn't support this method, it 2013// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use 2014// Operations.GetOperation or other methods to check whether the 2015// cancellation succeeded or whether the operation completed despite 2016// cancellation. On successful cancellation, the operation is not 2017// deleted; instead, it becomes an operation with an Operation.error 2018// value with a google.rpc.Status.code of 1, corresponding to 2019// `Code.CANCELLED`. 2020func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall { 2021 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2022 c.name = name 2023 c.canceloperationrequest = canceloperationrequest 2024 return c 2025} 2026 2027// Fields allows partial responses to be retrieved. See 2028// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2029// for more information. 2030func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { 2031 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2032 return c 2033} 2034 2035// Context sets the context to be used in this call's Do method. Any 2036// pending HTTP request will be aborted if the provided context is 2037// canceled. 2038func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { 2039 c.ctx_ = ctx 2040 return c 2041} 2042 2043// Header returns an http.Header that can be modified by the caller to 2044// add HTTP headers to the request. 2045func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { 2046 if c.header_ == nil { 2047 c.header_ = make(http.Header) 2048 } 2049 return c.header_ 2050} 2051 2052func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 2053 reqHeaders := make(http.Header) 2054 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2055 for k, v := range c.header_ { 2056 reqHeaders[k] = v 2057 } 2058 reqHeaders.Set("User-Agent", c.s.userAgent()) 2059 var body io.Reader = nil 2060 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 2061 if err != nil { 2062 return nil, err 2063 } 2064 reqHeaders.Set("Content-Type", "application/json") 2065 c.urlParams_.Set("alt", alt) 2066 c.urlParams_.Set("prettyPrint", "false") 2067 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}:cancel") 2068 urls += "?" + c.urlParams_.Encode() 2069 req, err := http.NewRequest("POST", urls, body) 2070 if err != nil { 2071 return nil, err 2072 } 2073 req.Header = reqHeaders 2074 googleapi.Expand(req.URL, map[string]string{ 2075 "name": c.name, 2076 }) 2077 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2078} 2079 2080// Do executes the "cloudbuild.projects.locations.operations.cancel" call. 2081// Exactly one of *Empty or error will be non-nil. Any non-2xx status 2082// code is an error. Response headers are in either 2083// *Empty.ServerResponse.Header or (if a response was returned at all) 2084// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2085// check whether the returned error was because http.StatusNotModified 2086// was returned. 2087func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2088 gensupport.SetOptions(c.urlParams_, opts...) 2089 res, err := c.doRequest("json") 2090 if res != nil && res.StatusCode == http.StatusNotModified { 2091 if res.Body != nil { 2092 res.Body.Close() 2093 } 2094 return nil, &googleapi.Error{ 2095 Code: res.StatusCode, 2096 Header: res.Header, 2097 } 2098 } 2099 if err != nil { 2100 return nil, err 2101 } 2102 defer googleapi.CloseBody(res) 2103 if err := googleapi.CheckResponse(res); err != nil { 2104 return nil, err 2105 } 2106 ret := &Empty{ 2107 ServerResponse: googleapi.ServerResponse{ 2108 Header: res.Header, 2109 HTTPStatusCode: res.StatusCode, 2110 }, 2111 } 2112 target := &ret 2113 if err := gensupport.DecodeResponse(target, res); err != nil { 2114 return nil, err 2115 } 2116 return ret, nil 2117 // { 2118 // "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`.", 2119 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", 2120 // "httpMethod": "POST", 2121 // "id": "cloudbuild.projects.locations.operations.cancel", 2122 // "parameterOrder": [ 2123 // "name" 2124 // ], 2125 // "parameters": { 2126 // "name": { 2127 // "description": "The name of the operation resource to be cancelled.", 2128 // "location": "path", 2129 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 2130 // "required": true, 2131 // "type": "string" 2132 // } 2133 // }, 2134 // "path": "v1alpha1/{+name}:cancel", 2135 // "request": { 2136 // "$ref": "CancelOperationRequest" 2137 // }, 2138 // "response": { 2139 // "$ref": "Empty" 2140 // }, 2141 // "scopes": [ 2142 // "https://www.googleapis.com/auth/cloud-platform" 2143 // ] 2144 // } 2145 2146} 2147 2148// method id "cloudbuild.projects.locations.operations.get": 2149 2150type ProjectsLocationsOperationsGetCall struct { 2151 s *Service 2152 name string 2153 urlParams_ gensupport.URLParams 2154 ifNoneMatch_ string 2155 ctx_ context.Context 2156 header_ http.Header 2157} 2158 2159// Get: Gets the latest state of a long-running operation. Clients can 2160// use this method to poll the operation result at intervals as 2161// recommended by the API service. 2162func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 2163 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2164 c.name = name 2165 return c 2166} 2167 2168// Fields allows partial responses to be retrieved. See 2169// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2170// for more information. 2171func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 2172 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2173 return c 2174} 2175 2176// IfNoneMatch sets the optional parameter which makes the operation 2177// fail if the object's ETag matches the given value. This is useful for 2178// getting updates only after the object has changed since the last 2179// request. Use googleapi.IsNotModified to check whether the response 2180// error from Do is the result of In-None-Match. 2181func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 2182 c.ifNoneMatch_ = entityTag 2183 return c 2184} 2185 2186// Context sets the context to be used in this call's Do method. Any 2187// pending HTTP request will be aborted if the provided context is 2188// canceled. 2189func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 2190 c.ctx_ = ctx 2191 return c 2192} 2193 2194// Header returns an http.Header that can be modified by the caller to 2195// add HTTP headers to the request. 2196func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 2197 if c.header_ == nil { 2198 c.header_ = make(http.Header) 2199 } 2200 return c.header_ 2201} 2202 2203func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 2204 reqHeaders := make(http.Header) 2205 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2206 for k, v := range c.header_ { 2207 reqHeaders[k] = v 2208 } 2209 reqHeaders.Set("User-Agent", c.s.userAgent()) 2210 if c.ifNoneMatch_ != "" { 2211 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2212 } 2213 var body io.Reader = nil 2214 c.urlParams_.Set("alt", alt) 2215 c.urlParams_.Set("prettyPrint", "false") 2216 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 2217 urls += "?" + c.urlParams_.Encode() 2218 req, err := http.NewRequest("GET", urls, body) 2219 if err != nil { 2220 return nil, err 2221 } 2222 req.Header = reqHeaders 2223 googleapi.Expand(req.URL, map[string]string{ 2224 "name": c.name, 2225 }) 2226 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2227} 2228 2229// Do executes the "cloudbuild.projects.locations.operations.get" call. 2230// Exactly one of *Operation or error will be non-nil. Any non-2xx 2231// status code is an error. Response headers are in either 2232// *Operation.ServerResponse.Header or (if a response was returned at 2233// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2234// to check whether the returned error was because 2235// http.StatusNotModified was returned. 2236func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 2237 gensupport.SetOptions(c.urlParams_, opts...) 2238 res, err := c.doRequest("json") 2239 if res != nil && res.StatusCode == http.StatusNotModified { 2240 if res.Body != nil { 2241 res.Body.Close() 2242 } 2243 return nil, &googleapi.Error{ 2244 Code: res.StatusCode, 2245 Header: res.Header, 2246 } 2247 } 2248 if err != nil { 2249 return nil, err 2250 } 2251 defer googleapi.CloseBody(res) 2252 if err := googleapi.CheckResponse(res); err != nil { 2253 return nil, err 2254 } 2255 ret := &Operation{ 2256 ServerResponse: googleapi.ServerResponse{ 2257 Header: res.Header, 2258 HTTPStatusCode: res.StatusCode, 2259 }, 2260 } 2261 target := &ret 2262 if err := gensupport.DecodeResponse(target, res); err != nil { 2263 return nil, err 2264 } 2265 return ret, nil 2266 // { 2267 // "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.", 2268 // "flatPath": "v1alpha1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 2269 // "httpMethod": "GET", 2270 // "id": "cloudbuild.projects.locations.operations.get", 2271 // "parameterOrder": [ 2272 // "name" 2273 // ], 2274 // "parameters": { 2275 // "name": { 2276 // "description": "The name of the operation resource.", 2277 // "location": "path", 2278 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 2279 // "required": true, 2280 // "type": "string" 2281 // } 2282 // }, 2283 // "path": "v1alpha1/{+name}", 2284 // "response": { 2285 // "$ref": "Operation" 2286 // }, 2287 // "scopes": [ 2288 // "https://www.googleapis.com/auth/cloud-platform" 2289 // ] 2290 // } 2291 2292} 2293 2294// method id "cloudbuild.projects.workerPools.create": 2295 2296type ProjectsWorkerPoolsCreateCall struct { 2297 s *Service 2298 parent string 2299 workerpool *WorkerPool 2300 urlParams_ gensupport.URLParams 2301 ctx_ context.Context 2302 header_ http.Header 2303} 2304 2305// Create: Creates a `WorkerPool` to run the builds, and returns the new 2306// worker pool. 2307func (r *ProjectsWorkerPoolsService) Create(parent string, workerpool *WorkerPool) *ProjectsWorkerPoolsCreateCall { 2308 c := &ProjectsWorkerPoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2309 c.parent = parent 2310 c.workerpool = workerpool 2311 return c 2312} 2313 2314// Fields allows partial responses to be retrieved. See 2315// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2316// for more information. 2317func (c *ProjectsWorkerPoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsCreateCall { 2318 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2319 return c 2320} 2321 2322// Context sets the context to be used in this call's Do method. Any 2323// pending HTTP request will be aborted if the provided context is 2324// canceled. 2325func (c *ProjectsWorkerPoolsCreateCall) Context(ctx context.Context) *ProjectsWorkerPoolsCreateCall { 2326 c.ctx_ = ctx 2327 return c 2328} 2329 2330// Header returns an http.Header that can be modified by the caller to 2331// add HTTP headers to the request. 2332func (c *ProjectsWorkerPoolsCreateCall) Header() http.Header { 2333 if c.header_ == nil { 2334 c.header_ = make(http.Header) 2335 } 2336 return c.header_ 2337} 2338 2339func (c *ProjectsWorkerPoolsCreateCall) doRequest(alt string) (*http.Response, error) { 2340 reqHeaders := make(http.Header) 2341 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2342 for k, v := range c.header_ { 2343 reqHeaders[k] = v 2344 } 2345 reqHeaders.Set("User-Agent", c.s.userAgent()) 2346 var body io.Reader = nil 2347 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workerpool) 2348 if err != nil { 2349 return nil, err 2350 } 2351 reqHeaders.Set("Content-Type", "application/json") 2352 c.urlParams_.Set("alt", alt) 2353 c.urlParams_.Set("prettyPrint", "false") 2354 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/workerPools") 2355 urls += "?" + c.urlParams_.Encode() 2356 req, err := http.NewRequest("POST", urls, body) 2357 if err != nil { 2358 return nil, err 2359 } 2360 req.Header = reqHeaders 2361 googleapi.Expand(req.URL, map[string]string{ 2362 "parent": c.parent, 2363 }) 2364 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2365} 2366 2367// Do executes the "cloudbuild.projects.workerPools.create" call. 2368// Exactly one of *WorkerPool or error will be non-nil. Any non-2xx 2369// status code is an error. Response headers are in either 2370// *WorkerPool.ServerResponse.Header or (if a response was returned at 2371// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2372// to check whether the returned error was because 2373// http.StatusNotModified was returned. 2374func (c *ProjectsWorkerPoolsCreateCall) Do(opts ...googleapi.CallOption) (*WorkerPool, error) { 2375 gensupport.SetOptions(c.urlParams_, opts...) 2376 res, err := c.doRequest("json") 2377 if res != nil && res.StatusCode == http.StatusNotModified { 2378 if res.Body != nil { 2379 res.Body.Close() 2380 } 2381 return nil, &googleapi.Error{ 2382 Code: res.StatusCode, 2383 Header: res.Header, 2384 } 2385 } 2386 if err != nil { 2387 return nil, err 2388 } 2389 defer googleapi.CloseBody(res) 2390 if err := googleapi.CheckResponse(res); err != nil { 2391 return nil, err 2392 } 2393 ret := &WorkerPool{ 2394 ServerResponse: googleapi.ServerResponse{ 2395 Header: res.Header, 2396 HTTPStatusCode: res.StatusCode, 2397 }, 2398 } 2399 target := &ret 2400 if err := gensupport.DecodeResponse(target, res); err != nil { 2401 return nil, err 2402 } 2403 return ret, nil 2404 // { 2405 // "description": "Creates a `WorkerPool` to run the builds, and returns the new worker pool.", 2406 // "flatPath": "v1alpha1/projects/{projectsId}/workerPools", 2407 // "httpMethod": "POST", 2408 // "id": "cloudbuild.projects.workerPools.create", 2409 // "parameterOrder": [ 2410 // "parent" 2411 // ], 2412 // "parameters": { 2413 // "parent": { 2414 // "description": "ID of the parent project.", 2415 // "location": "path", 2416 // "pattern": "^projects/[^/]+$", 2417 // "required": true, 2418 // "type": "string" 2419 // } 2420 // }, 2421 // "path": "v1alpha1/{+parent}/workerPools", 2422 // "request": { 2423 // "$ref": "WorkerPool" 2424 // }, 2425 // "response": { 2426 // "$ref": "WorkerPool" 2427 // }, 2428 // "scopes": [ 2429 // "https://www.googleapis.com/auth/cloud-platform" 2430 // ] 2431 // } 2432 2433} 2434 2435// method id "cloudbuild.projects.workerPools.delete": 2436 2437type ProjectsWorkerPoolsDeleteCall struct { 2438 s *Service 2439 name string 2440 urlParams_ gensupport.URLParams 2441 ctx_ context.Context 2442 header_ http.Header 2443} 2444 2445// Delete: Deletes a `WorkerPool` by its project ID and WorkerPool name. 2446func (r *ProjectsWorkerPoolsService) Delete(name string) *ProjectsWorkerPoolsDeleteCall { 2447 c := &ProjectsWorkerPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2448 c.name = name 2449 return c 2450} 2451 2452// Fields allows partial responses to be retrieved. See 2453// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2454// for more information. 2455func (c *ProjectsWorkerPoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsDeleteCall { 2456 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2457 return c 2458} 2459 2460// Context sets the context to be used in this call's Do method. Any 2461// pending HTTP request will be aborted if the provided context is 2462// canceled. 2463func (c *ProjectsWorkerPoolsDeleteCall) Context(ctx context.Context) *ProjectsWorkerPoolsDeleteCall { 2464 c.ctx_ = ctx 2465 return c 2466} 2467 2468// Header returns an http.Header that can be modified by the caller to 2469// add HTTP headers to the request. 2470func (c *ProjectsWorkerPoolsDeleteCall) Header() http.Header { 2471 if c.header_ == nil { 2472 c.header_ = make(http.Header) 2473 } 2474 return c.header_ 2475} 2476 2477func (c *ProjectsWorkerPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { 2478 reqHeaders := make(http.Header) 2479 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2480 for k, v := range c.header_ { 2481 reqHeaders[k] = v 2482 } 2483 reqHeaders.Set("User-Agent", c.s.userAgent()) 2484 var body io.Reader = nil 2485 c.urlParams_.Set("alt", alt) 2486 c.urlParams_.Set("prettyPrint", "false") 2487 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 2488 urls += "?" + c.urlParams_.Encode() 2489 req, err := http.NewRequest("DELETE", urls, body) 2490 if err != nil { 2491 return nil, err 2492 } 2493 req.Header = reqHeaders 2494 googleapi.Expand(req.URL, map[string]string{ 2495 "name": c.name, 2496 }) 2497 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2498} 2499 2500// Do executes the "cloudbuild.projects.workerPools.delete" call. 2501// Exactly one of *Empty or error will be non-nil. Any non-2xx status 2502// code is an error. Response headers are in either 2503// *Empty.ServerResponse.Header or (if a response was returned at all) 2504// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 2505// check whether the returned error was because http.StatusNotModified 2506// was returned. 2507func (c *ProjectsWorkerPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 2508 gensupport.SetOptions(c.urlParams_, opts...) 2509 res, err := c.doRequest("json") 2510 if res != nil && res.StatusCode == http.StatusNotModified { 2511 if res.Body != nil { 2512 res.Body.Close() 2513 } 2514 return nil, &googleapi.Error{ 2515 Code: res.StatusCode, 2516 Header: res.Header, 2517 } 2518 } 2519 if err != nil { 2520 return nil, err 2521 } 2522 defer googleapi.CloseBody(res) 2523 if err := googleapi.CheckResponse(res); err != nil { 2524 return nil, err 2525 } 2526 ret := &Empty{ 2527 ServerResponse: googleapi.ServerResponse{ 2528 Header: res.Header, 2529 HTTPStatusCode: res.StatusCode, 2530 }, 2531 } 2532 target := &ret 2533 if err := gensupport.DecodeResponse(target, res); err != nil { 2534 return nil, err 2535 } 2536 return ret, nil 2537 // { 2538 // "description": "Deletes a `WorkerPool` by its project ID and WorkerPool name.", 2539 // "flatPath": "v1alpha1/projects/{projectsId}/workerPools/{workerPoolsId}", 2540 // "httpMethod": "DELETE", 2541 // "id": "cloudbuild.projects.workerPools.delete", 2542 // "parameterOrder": [ 2543 // "name" 2544 // ], 2545 // "parameters": { 2546 // "name": { 2547 // "description": "The field will contain name of the resource requested, for example: \"projects/project-1/workerPools/workerpool-name\"", 2548 // "location": "path", 2549 // "pattern": "^projects/[^/]+/workerPools/[^/]+$", 2550 // "required": true, 2551 // "type": "string" 2552 // } 2553 // }, 2554 // "path": "v1alpha1/{+name}", 2555 // "response": { 2556 // "$ref": "Empty" 2557 // }, 2558 // "scopes": [ 2559 // "https://www.googleapis.com/auth/cloud-platform" 2560 // ] 2561 // } 2562 2563} 2564 2565// method id "cloudbuild.projects.workerPools.get": 2566 2567type ProjectsWorkerPoolsGetCall struct { 2568 s *Service 2569 name string 2570 urlParams_ gensupport.URLParams 2571 ifNoneMatch_ string 2572 ctx_ context.Context 2573 header_ http.Header 2574} 2575 2576// Get: Returns information about a `WorkerPool`. 2577func (r *ProjectsWorkerPoolsService) Get(name string) *ProjectsWorkerPoolsGetCall { 2578 c := &ProjectsWorkerPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2579 c.name = name 2580 return c 2581} 2582 2583// Fields allows partial responses to be retrieved. See 2584// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2585// for more information. 2586func (c *ProjectsWorkerPoolsGetCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsGetCall { 2587 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2588 return c 2589} 2590 2591// IfNoneMatch sets the optional parameter which makes the operation 2592// fail if the object's ETag matches the given value. This is useful for 2593// getting updates only after the object has changed since the last 2594// request. Use googleapi.IsNotModified to check whether the response 2595// error from Do is the result of In-None-Match. 2596func (c *ProjectsWorkerPoolsGetCall) IfNoneMatch(entityTag string) *ProjectsWorkerPoolsGetCall { 2597 c.ifNoneMatch_ = entityTag 2598 return c 2599} 2600 2601// Context sets the context to be used in this call's Do method. Any 2602// pending HTTP request will be aborted if the provided context is 2603// canceled. 2604func (c *ProjectsWorkerPoolsGetCall) Context(ctx context.Context) *ProjectsWorkerPoolsGetCall { 2605 c.ctx_ = ctx 2606 return c 2607} 2608 2609// Header returns an http.Header that can be modified by the caller to 2610// add HTTP headers to the request. 2611func (c *ProjectsWorkerPoolsGetCall) Header() http.Header { 2612 if c.header_ == nil { 2613 c.header_ = make(http.Header) 2614 } 2615 return c.header_ 2616} 2617 2618func (c *ProjectsWorkerPoolsGetCall) doRequest(alt string) (*http.Response, error) { 2619 reqHeaders := make(http.Header) 2620 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2621 for k, v := range c.header_ { 2622 reqHeaders[k] = v 2623 } 2624 reqHeaders.Set("User-Agent", c.s.userAgent()) 2625 if c.ifNoneMatch_ != "" { 2626 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2627 } 2628 var body io.Reader = nil 2629 c.urlParams_.Set("alt", alt) 2630 c.urlParams_.Set("prettyPrint", "false") 2631 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 2632 urls += "?" + c.urlParams_.Encode() 2633 req, err := http.NewRequest("GET", urls, body) 2634 if err != nil { 2635 return nil, err 2636 } 2637 req.Header = reqHeaders 2638 googleapi.Expand(req.URL, map[string]string{ 2639 "name": c.name, 2640 }) 2641 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2642} 2643 2644// Do executes the "cloudbuild.projects.workerPools.get" call. 2645// Exactly one of *WorkerPool or error will be non-nil. Any non-2xx 2646// status code is an error. Response headers are in either 2647// *WorkerPool.ServerResponse.Header or (if a response was returned at 2648// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2649// to check whether the returned error was because 2650// http.StatusNotModified was returned. 2651func (c *ProjectsWorkerPoolsGetCall) Do(opts ...googleapi.CallOption) (*WorkerPool, error) { 2652 gensupport.SetOptions(c.urlParams_, opts...) 2653 res, err := c.doRequest("json") 2654 if res != nil && res.StatusCode == http.StatusNotModified { 2655 if res.Body != nil { 2656 res.Body.Close() 2657 } 2658 return nil, &googleapi.Error{ 2659 Code: res.StatusCode, 2660 Header: res.Header, 2661 } 2662 } 2663 if err != nil { 2664 return nil, err 2665 } 2666 defer googleapi.CloseBody(res) 2667 if err := googleapi.CheckResponse(res); err != nil { 2668 return nil, err 2669 } 2670 ret := &WorkerPool{ 2671 ServerResponse: googleapi.ServerResponse{ 2672 Header: res.Header, 2673 HTTPStatusCode: res.StatusCode, 2674 }, 2675 } 2676 target := &ret 2677 if err := gensupport.DecodeResponse(target, res); err != nil { 2678 return nil, err 2679 } 2680 return ret, nil 2681 // { 2682 // "description": "Returns information about a `WorkerPool`.", 2683 // "flatPath": "v1alpha1/projects/{projectsId}/workerPools/{workerPoolsId}", 2684 // "httpMethod": "GET", 2685 // "id": "cloudbuild.projects.workerPools.get", 2686 // "parameterOrder": [ 2687 // "name" 2688 // ], 2689 // "parameters": { 2690 // "name": { 2691 // "description": "The field will contain name of the resource requested, for example: \"projects/project-1/workerPools/workerpool-name\"", 2692 // "location": "path", 2693 // "pattern": "^projects/[^/]+/workerPools/[^/]+$", 2694 // "required": true, 2695 // "type": "string" 2696 // } 2697 // }, 2698 // "path": "v1alpha1/{+name}", 2699 // "response": { 2700 // "$ref": "WorkerPool" 2701 // }, 2702 // "scopes": [ 2703 // "https://www.googleapis.com/auth/cloud-platform" 2704 // ] 2705 // } 2706 2707} 2708 2709// method id "cloudbuild.projects.workerPools.list": 2710 2711type ProjectsWorkerPoolsListCall struct { 2712 s *Service 2713 parent string 2714 urlParams_ gensupport.URLParams 2715 ifNoneMatch_ string 2716 ctx_ context.Context 2717 header_ http.Header 2718} 2719 2720// List: List project's `WorkerPool`s. 2721func (r *ProjectsWorkerPoolsService) List(parent string) *ProjectsWorkerPoolsListCall { 2722 c := &ProjectsWorkerPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2723 c.parent = parent 2724 return c 2725} 2726 2727// Fields allows partial responses to be retrieved. See 2728// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2729// for more information. 2730func (c *ProjectsWorkerPoolsListCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsListCall { 2731 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2732 return c 2733} 2734 2735// IfNoneMatch sets the optional parameter which makes the operation 2736// fail if the object's ETag matches the given value. This is useful for 2737// getting updates only after the object has changed since the last 2738// request. Use googleapi.IsNotModified to check whether the response 2739// error from Do is the result of In-None-Match. 2740func (c *ProjectsWorkerPoolsListCall) IfNoneMatch(entityTag string) *ProjectsWorkerPoolsListCall { 2741 c.ifNoneMatch_ = entityTag 2742 return c 2743} 2744 2745// Context sets the context to be used in this call's Do method. Any 2746// pending HTTP request will be aborted if the provided context is 2747// canceled. 2748func (c *ProjectsWorkerPoolsListCall) Context(ctx context.Context) *ProjectsWorkerPoolsListCall { 2749 c.ctx_ = ctx 2750 return c 2751} 2752 2753// Header returns an http.Header that can be modified by the caller to 2754// add HTTP headers to the request. 2755func (c *ProjectsWorkerPoolsListCall) Header() http.Header { 2756 if c.header_ == nil { 2757 c.header_ = make(http.Header) 2758 } 2759 return c.header_ 2760} 2761 2762func (c *ProjectsWorkerPoolsListCall) doRequest(alt string) (*http.Response, error) { 2763 reqHeaders := make(http.Header) 2764 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2765 for k, v := range c.header_ { 2766 reqHeaders[k] = v 2767 } 2768 reqHeaders.Set("User-Agent", c.s.userAgent()) 2769 if c.ifNoneMatch_ != "" { 2770 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 2771 } 2772 var body io.Reader = nil 2773 c.urlParams_.Set("alt", alt) 2774 c.urlParams_.Set("prettyPrint", "false") 2775 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+parent}/workerPools") 2776 urls += "?" + c.urlParams_.Encode() 2777 req, err := http.NewRequest("GET", urls, body) 2778 if err != nil { 2779 return nil, err 2780 } 2781 req.Header = reqHeaders 2782 googleapi.Expand(req.URL, map[string]string{ 2783 "parent": c.parent, 2784 }) 2785 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2786} 2787 2788// Do executes the "cloudbuild.projects.workerPools.list" call. 2789// Exactly one of *ListWorkerPoolsResponse or error will be non-nil. Any 2790// non-2xx status code is an error. Response headers are in either 2791// *ListWorkerPoolsResponse.ServerResponse.Header or (if a response was 2792// returned at all) in error.(*googleapi.Error).Header. Use 2793// googleapi.IsNotModified to check whether the returned error was 2794// because http.StatusNotModified was returned. 2795func (c *ProjectsWorkerPoolsListCall) Do(opts ...googleapi.CallOption) (*ListWorkerPoolsResponse, error) { 2796 gensupport.SetOptions(c.urlParams_, opts...) 2797 res, err := c.doRequest("json") 2798 if res != nil && res.StatusCode == http.StatusNotModified { 2799 if res.Body != nil { 2800 res.Body.Close() 2801 } 2802 return nil, &googleapi.Error{ 2803 Code: res.StatusCode, 2804 Header: res.Header, 2805 } 2806 } 2807 if err != nil { 2808 return nil, err 2809 } 2810 defer googleapi.CloseBody(res) 2811 if err := googleapi.CheckResponse(res); err != nil { 2812 return nil, err 2813 } 2814 ret := &ListWorkerPoolsResponse{ 2815 ServerResponse: googleapi.ServerResponse{ 2816 Header: res.Header, 2817 HTTPStatusCode: res.StatusCode, 2818 }, 2819 } 2820 target := &ret 2821 if err := gensupport.DecodeResponse(target, res); err != nil { 2822 return nil, err 2823 } 2824 return ret, nil 2825 // { 2826 // "description": "List project's `WorkerPool`s.", 2827 // "flatPath": "v1alpha1/projects/{projectsId}/workerPools", 2828 // "httpMethod": "GET", 2829 // "id": "cloudbuild.projects.workerPools.list", 2830 // "parameterOrder": [ 2831 // "parent" 2832 // ], 2833 // "parameters": { 2834 // "parent": { 2835 // "description": "ID of the parent project.", 2836 // "location": "path", 2837 // "pattern": "^projects/[^/]+$", 2838 // "required": true, 2839 // "type": "string" 2840 // } 2841 // }, 2842 // "path": "v1alpha1/{+parent}/workerPools", 2843 // "response": { 2844 // "$ref": "ListWorkerPoolsResponse" 2845 // }, 2846 // "scopes": [ 2847 // "https://www.googleapis.com/auth/cloud-platform" 2848 // ] 2849 // } 2850 2851} 2852 2853// method id "cloudbuild.projects.workerPools.patch": 2854 2855type ProjectsWorkerPoolsPatchCall struct { 2856 s *Service 2857 name string 2858 workerpool *WorkerPool 2859 urlParams_ gensupport.URLParams 2860 ctx_ context.Context 2861 header_ http.Header 2862} 2863 2864// Patch: Update a `WorkerPool`. 2865func (r *ProjectsWorkerPoolsService) Patch(name string, workerpool *WorkerPool) *ProjectsWorkerPoolsPatchCall { 2866 c := &ProjectsWorkerPoolsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 2867 c.name = name 2868 c.workerpool = workerpool 2869 return c 2870} 2871 2872// Fields allows partial responses to be retrieved. See 2873// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 2874// for more information. 2875func (c *ProjectsWorkerPoolsPatchCall) Fields(s ...googleapi.Field) *ProjectsWorkerPoolsPatchCall { 2876 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 2877 return c 2878} 2879 2880// Context sets the context to be used in this call's Do method. Any 2881// pending HTTP request will be aborted if the provided context is 2882// canceled. 2883func (c *ProjectsWorkerPoolsPatchCall) Context(ctx context.Context) *ProjectsWorkerPoolsPatchCall { 2884 c.ctx_ = ctx 2885 return c 2886} 2887 2888// Header returns an http.Header that can be modified by the caller to 2889// add HTTP headers to the request. 2890func (c *ProjectsWorkerPoolsPatchCall) Header() http.Header { 2891 if c.header_ == nil { 2892 c.header_ = make(http.Header) 2893 } 2894 return c.header_ 2895} 2896 2897func (c *ProjectsWorkerPoolsPatchCall) doRequest(alt string) (*http.Response, error) { 2898 reqHeaders := make(http.Header) 2899 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210322") 2900 for k, v := range c.header_ { 2901 reqHeaders[k] = v 2902 } 2903 reqHeaders.Set("User-Agent", c.s.userAgent()) 2904 var body io.Reader = nil 2905 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workerpool) 2906 if err != nil { 2907 return nil, err 2908 } 2909 reqHeaders.Set("Content-Type", "application/json") 2910 c.urlParams_.Set("alt", alt) 2911 c.urlParams_.Set("prettyPrint", "false") 2912 urls := googleapi.ResolveRelative(c.s.BasePath, "v1alpha1/{+name}") 2913 urls += "?" + c.urlParams_.Encode() 2914 req, err := http.NewRequest("PATCH", urls, body) 2915 if err != nil { 2916 return nil, err 2917 } 2918 req.Header = reqHeaders 2919 googleapi.Expand(req.URL, map[string]string{ 2920 "name": c.name, 2921 }) 2922 return gensupport.SendRequest(c.ctx_, c.s.client, req) 2923} 2924 2925// Do executes the "cloudbuild.projects.workerPools.patch" call. 2926// Exactly one of *WorkerPool or error will be non-nil. Any non-2xx 2927// status code is an error. Response headers are in either 2928// *WorkerPool.ServerResponse.Header or (if a response was returned at 2929// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 2930// to check whether the returned error was because 2931// http.StatusNotModified was returned. 2932func (c *ProjectsWorkerPoolsPatchCall) Do(opts ...googleapi.CallOption) (*WorkerPool, error) { 2933 gensupport.SetOptions(c.urlParams_, opts...) 2934 res, err := c.doRequest("json") 2935 if res != nil && res.StatusCode == http.StatusNotModified { 2936 if res.Body != nil { 2937 res.Body.Close() 2938 } 2939 return nil, &googleapi.Error{ 2940 Code: res.StatusCode, 2941 Header: res.Header, 2942 } 2943 } 2944 if err != nil { 2945 return nil, err 2946 } 2947 defer googleapi.CloseBody(res) 2948 if err := googleapi.CheckResponse(res); err != nil { 2949 return nil, err 2950 } 2951 ret := &WorkerPool{ 2952 ServerResponse: googleapi.ServerResponse{ 2953 Header: res.Header, 2954 HTTPStatusCode: res.StatusCode, 2955 }, 2956 } 2957 target := &ret 2958 if err := gensupport.DecodeResponse(target, res); err != nil { 2959 return nil, err 2960 } 2961 return ret, nil 2962 // { 2963 // "description": "Update a `WorkerPool`.", 2964 // "flatPath": "v1alpha1/projects/{projectsId}/workerPools/{workerPoolsId}", 2965 // "httpMethod": "PATCH", 2966 // "id": "cloudbuild.projects.workerPools.patch", 2967 // "parameterOrder": [ 2968 // "name" 2969 // ], 2970 // "parameters": { 2971 // "name": { 2972 // "description": "The field will contain name of the resource requested, for example: \"projects/project-1/workerPools/workerpool-name\"", 2973 // "location": "path", 2974 // "pattern": "^projects/[^/]+/workerPools/[^/]+$", 2975 // "required": true, 2976 // "type": "string" 2977 // } 2978 // }, 2979 // "path": "v1alpha1/{+name}", 2980 // "request": { 2981 // "$ref": "WorkerPool" 2982 // }, 2983 // "response": { 2984 // "$ref": "WorkerPool" 2985 // }, 2986 // "scopes": [ 2987 // "https://www.googleapis.com/auth/cloud-platform" 2988 // ] 2989 // } 2990 2991} 2992