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/v1" 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/v1" 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:v1" 75const apiName = "cloudbuild" 76const apiVersion = "v1" 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.Operations = NewOperationsService(s) 120 s.Projects = NewProjectsService(s) 121 s.V1 = NewV1Service(s) 122 return s, nil 123} 124 125type Service struct { 126 client *http.Client 127 BasePath string // API endpoint base URL 128 UserAgent string // optional additional User-Agent fragment 129 130 Operations *OperationsService 131 132 Projects *ProjectsService 133 134 V1 *V1Service 135} 136 137func (s *Service) userAgent() string { 138 if s.UserAgent == "" { 139 return googleapi.UserAgent 140 } 141 return googleapi.UserAgent + " " + s.UserAgent 142} 143 144func NewOperationsService(s *Service) *OperationsService { 145 rs := &OperationsService{s: s} 146 return rs 147} 148 149type OperationsService struct { 150 s *Service 151} 152 153func NewProjectsService(s *Service) *ProjectsService { 154 rs := &ProjectsService{s: s} 155 rs.Builds = NewProjectsBuildsService(s) 156 rs.GithubEnterpriseConfigs = NewProjectsGithubEnterpriseConfigsService(s) 157 rs.Locations = NewProjectsLocationsService(s) 158 rs.Triggers = NewProjectsTriggersService(s) 159 return rs 160} 161 162type ProjectsService struct { 163 s *Service 164 165 Builds *ProjectsBuildsService 166 167 GithubEnterpriseConfigs *ProjectsGithubEnterpriseConfigsService 168 169 Locations *ProjectsLocationsService 170 171 Triggers *ProjectsTriggersService 172} 173 174func NewProjectsBuildsService(s *Service) *ProjectsBuildsService { 175 rs := &ProjectsBuildsService{s: s} 176 return rs 177} 178 179type ProjectsBuildsService struct { 180 s *Service 181} 182 183func NewProjectsGithubEnterpriseConfigsService(s *Service) *ProjectsGithubEnterpriseConfigsService { 184 rs := &ProjectsGithubEnterpriseConfigsService{s: s} 185 return rs 186} 187 188type ProjectsGithubEnterpriseConfigsService struct { 189 s *Service 190} 191 192func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 193 rs := &ProjectsLocationsService{s: s} 194 rs.Builds = NewProjectsLocationsBuildsService(s) 195 rs.GithubEnterpriseConfigs = NewProjectsLocationsGithubEnterpriseConfigsService(s) 196 rs.Operations = NewProjectsLocationsOperationsService(s) 197 rs.Triggers = NewProjectsLocationsTriggersService(s) 198 rs.WorkerPools = NewProjectsLocationsWorkerPoolsService(s) 199 return rs 200} 201 202type ProjectsLocationsService struct { 203 s *Service 204 205 Builds *ProjectsLocationsBuildsService 206 207 GithubEnterpriseConfigs *ProjectsLocationsGithubEnterpriseConfigsService 208 209 Operations *ProjectsLocationsOperationsService 210 211 Triggers *ProjectsLocationsTriggersService 212 213 WorkerPools *ProjectsLocationsWorkerPoolsService 214} 215 216func NewProjectsLocationsBuildsService(s *Service) *ProjectsLocationsBuildsService { 217 rs := &ProjectsLocationsBuildsService{s: s} 218 return rs 219} 220 221type ProjectsLocationsBuildsService struct { 222 s *Service 223} 224 225func NewProjectsLocationsGithubEnterpriseConfigsService(s *Service) *ProjectsLocationsGithubEnterpriseConfigsService { 226 rs := &ProjectsLocationsGithubEnterpriseConfigsService{s: s} 227 return rs 228} 229 230type ProjectsLocationsGithubEnterpriseConfigsService struct { 231 s *Service 232} 233 234func NewProjectsLocationsOperationsService(s *Service) *ProjectsLocationsOperationsService { 235 rs := &ProjectsLocationsOperationsService{s: s} 236 return rs 237} 238 239type ProjectsLocationsOperationsService struct { 240 s *Service 241} 242 243func NewProjectsLocationsTriggersService(s *Service) *ProjectsLocationsTriggersService { 244 rs := &ProjectsLocationsTriggersService{s: s} 245 return rs 246} 247 248type ProjectsLocationsTriggersService struct { 249 s *Service 250} 251 252func NewProjectsLocationsWorkerPoolsService(s *Service) *ProjectsLocationsWorkerPoolsService { 253 rs := &ProjectsLocationsWorkerPoolsService{s: s} 254 return rs 255} 256 257type ProjectsLocationsWorkerPoolsService struct { 258 s *Service 259} 260 261func NewProjectsTriggersService(s *Service) *ProjectsTriggersService { 262 rs := &ProjectsTriggersService{s: s} 263 return rs 264} 265 266type ProjectsTriggersService struct { 267 s *Service 268} 269 270func NewV1Service(s *Service) *V1Service { 271 rs := &V1Service{s: s} 272 return rs 273} 274 275type V1Service struct { 276 s *Service 277} 278 279// ApprovalConfig: ApprovalConfig describes configuration for manual 280// approval of a build. 281type ApprovalConfig struct { 282 // ApprovalRequired: Whether or not approval is needed. If this is set 283 // on a build, it will become pending when created, and will need to be 284 // explicitly approved to start. 285 ApprovalRequired bool `json:"approvalRequired,omitempty"` 286 287 // ForceSendFields is a list of field names (e.g. "ApprovalRequired") to 288 // unconditionally include in API requests. By default, fields with 289 // empty or default values are omitted from API requests. However, any 290 // non-pointer, non-interface field appearing in ForceSendFields will be 291 // sent to the server regardless of whether the field is empty or not. 292 // This may be used to include empty fields in Patch requests. 293 ForceSendFields []string `json:"-"` 294 295 // NullFields is a list of field names (e.g. "ApprovalRequired") to 296 // include in API requests with the JSON null value. By default, fields 297 // with empty values are omitted from API requests. However, any field 298 // with an empty value appearing in NullFields will be sent to the 299 // server as null. It is an error if a field in this list has a 300 // non-empty value. This may be used to include null fields in Patch 301 // requests. 302 NullFields []string `json:"-"` 303} 304 305func (s *ApprovalConfig) MarshalJSON() ([]byte, error) { 306 type NoMethod ApprovalConfig 307 raw := NoMethod(*s) 308 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 309} 310 311// ApprovalResult: ApprovalResult describes the decision and associated 312// metadata of a manual approval of a build. 313type ApprovalResult struct { 314 // ApprovalTime: Output only. The time when the approval decision was 315 // made. 316 ApprovalTime string `json:"approvalTime,omitempty"` 317 318 // ApproverAccount: Output only. Email of the user that called the 319 // ApproveBuild API to approve or reject a build at the time that the 320 // API was called (the user's actual email that is tied to their GAIA ID 321 // may have changed). This field is not stored, rather, it is calculated 322 // on the fly using approver_id. 323 ApproverAccount string `json:"approverAccount,omitempty"` 324 325 // Comment: Optional. An optional comment for this manual approval 326 // result. 327 Comment string `json:"comment,omitempty"` 328 329 // Decision: Required. The decision of this manual approval. 330 // 331 // Possible values: 332 // "DECISION_UNSPECIFIED" - Default enum type. This should not be 333 // used. 334 // "APPROVED" - Build is approved. 335 // "REJECTED" - Build is rejected. 336 Decision string `json:"decision,omitempty"` 337 338 // Url: Optional. An optional URL tied to this manual approval result. 339 // This field is essentially the same as comment, except that it will be 340 // rendered by the UI differently. An example use case is a link to an 341 // external job that approved this Build. 342 Url string `json:"url,omitempty"` 343 344 // ForceSendFields is a list of field names (e.g. "ApprovalTime") to 345 // unconditionally include in API requests. By default, fields with 346 // empty or default values are omitted from API requests. However, any 347 // non-pointer, non-interface field appearing in ForceSendFields will be 348 // sent to the server regardless of whether the field is empty or not. 349 // This may be used to include empty fields in Patch requests. 350 ForceSendFields []string `json:"-"` 351 352 // NullFields is a list of field names (e.g. "ApprovalTime") to include 353 // in API requests with the JSON null value. By default, fields with 354 // empty values are omitted from API requests. However, any field with 355 // an empty value appearing in NullFields will be sent to the server as 356 // null. It is an error if a field in this list has a non-empty value. 357 // This may be used to include null fields in Patch requests. 358 NullFields []string `json:"-"` 359} 360 361func (s *ApprovalResult) MarshalJSON() ([]byte, error) { 362 type NoMethod ApprovalResult 363 raw := NoMethod(*s) 364 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 365} 366 367// ApproveBuildRequest: Request to approve or reject a pending build. 368type ApproveBuildRequest struct { 369 // ApprovalResult: Approval decision and metadata. 370 ApprovalResult *ApprovalResult `json:"approvalResult,omitempty"` 371 372 // ForceSendFields is a list of field names (e.g. "ApprovalResult") to 373 // unconditionally include in API requests. By default, fields with 374 // empty or default values are omitted from API requests. However, any 375 // non-pointer, non-interface field appearing in ForceSendFields will be 376 // sent to the server regardless of whether the field is empty or not. 377 // This may be used to include empty fields in Patch requests. 378 ForceSendFields []string `json:"-"` 379 380 // NullFields is a list of field names (e.g. "ApprovalResult") to 381 // include in API requests with the JSON null value. By default, fields 382 // with empty values are omitted from API requests. However, any field 383 // with an empty value appearing in NullFields will be sent to the 384 // server as null. It is an error if a field in this list has a 385 // non-empty value. This may be used to include null fields in Patch 386 // requests. 387 NullFields []string `json:"-"` 388} 389 390func (s *ApproveBuildRequest) MarshalJSON() ([]byte, error) { 391 type NoMethod ApproveBuildRequest 392 raw := NoMethod(*s) 393 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 394} 395 396// ArtifactObjects: Files in the workspace to upload to Cloud Storage 397// upon successful completion of all build steps. 398type ArtifactObjects struct { 399 // Location: Cloud Storage bucket and optional object path, in the form 400 // "gs://bucket/path/to/somewhere/". (see Bucket Name Requirements 401 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 402 // Files in the workspace matching any path pattern will be uploaded to 403 // Cloud Storage with this location as a prefix. 404 Location string `json:"location,omitempty"` 405 406 // Paths: Path globs used to match files in the build's workspace. 407 Paths []string `json:"paths,omitempty"` 408 409 // Timing: Output only. Stores timing information for pushing all 410 // artifact objects. 411 Timing *TimeSpan `json:"timing,omitempty"` 412 413 // ForceSendFields is a list of field names (e.g. "Location") to 414 // unconditionally include in API requests. By default, fields with 415 // empty or default values are omitted from API requests. However, any 416 // non-pointer, non-interface field appearing in ForceSendFields will be 417 // sent to the server regardless of whether the field is empty or not. 418 // This may be used to include empty fields in Patch requests. 419 ForceSendFields []string `json:"-"` 420 421 // NullFields is a list of field names (e.g. "Location") to include in 422 // API requests with the JSON null value. By default, fields with empty 423 // values are omitted from API requests. However, any field with an 424 // empty value appearing in NullFields will be sent to the server as 425 // null. It is an error if a field in this list has a non-empty value. 426 // This may be used to include null fields in Patch requests. 427 NullFields []string `json:"-"` 428} 429 430func (s *ArtifactObjects) MarshalJSON() ([]byte, error) { 431 type NoMethod ArtifactObjects 432 raw := NoMethod(*s) 433 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 434} 435 436// ArtifactResult: An artifact that was uploaded during a build. This is 437// a single record in the artifact manifest JSON file. 438type ArtifactResult struct { 439 // FileHash: The file hash of the artifact. 440 FileHash []*FileHashes `json:"fileHash,omitempty"` 441 442 // Location: The path of an artifact in a Google Cloud Storage bucket, 443 // with the generation number. For example, 444 // `gs://mybucket/path/to/output.jar#generation`. 445 Location string `json:"location,omitempty"` 446 447 // ForceSendFields is a list of field names (e.g. "FileHash") to 448 // unconditionally include in API requests. By default, fields with 449 // empty or default values are omitted from API requests. However, any 450 // non-pointer, non-interface field appearing in ForceSendFields will be 451 // sent to the server regardless of whether the field is empty or not. 452 // This may be used to include empty fields in Patch requests. 453 ForceSendFields []string `json:"-"` 454 455 // NullFields is a list of field names (e.g. "FileHash") to include in 456 // API requests with the JSON null value. By default, fields with empty 457 // values are omitted from API requests. However, any field with an 458 // empty value appearing in NullFields will be sent to the server as 459 // null. It is an error if a field in this list has a non-empty value. 460 // This may be used to include null fields in Patch requests. 461 NullFields []string `json:"-"` 462} 463 464func (s *ArtifactResult) MarshalJSON() ([]byte, error) { 465 type NoMethod ArtifactResult 466 raw := NoMethod(*s) 467 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 468} 469 470// Artifacts: Artifacts produced by a build that should be uploaded upon 471// successful completion of all build steps. 472type Artifacts struct { 473 // Images: A list of images to be pushed upon the successful completion 474 // of all build steps. The images will be pushed using the builder 475 // service account's credentials. The digests of the pushed images will 476 // be stored in the Build resource's results field. If any of the images 477 // fail to be pushed, the build is marked FAILURE. 478 Images []string `json:"images,omitempty"` 479 480 // Objects: A list of objects to be uploaded to Cloud Storage upon 481 // successful completion of all build steps. Files in the workspace 482 // matching specified paths globs will be uploaded to the specified 483 // Cloud Storage location using the builder service account's 484 // credentials. The location and generation of the uploaded objects will 485 // be stored in the Build resource's results field. If any objects fail 486 // to be pushed, the build is marked FAILURE. 487 Objects *ArtifactObjects `json:"objects,omitempty"` 488 489 // ForceSendFields is a list of field names (e.g. "Images") to 490 // unconditionally include in API requests. By default, fields with 491 // empty or default values are omitted from API requests. However, any 492 // non-pointer, non-interface field appearing in ForceSendFields will be 493 // sent to the server regardless of whether the field is empty or not. 494 // This may be used to include empty fields in Patch requests. 495 ForceSendFields []string `json:"-"` 496 497 // NullFields is a list of field names (e.g. "Images") to include in API 498 // requests with the JSON null value. By default, fields with empty 499 // values are omitted from API requests. However, any field with an 500 // empty value appearing in NullFields will be sent to the server as 501 // null. It is an error if a field in this list has a non-empty value. 502 // This may be used to include null fields in Patch requests. 503 NullFields []string `json:"-"` 504} 505 506func (s *Artifacts) MarshalJSON() ([]byte, error) { 507 type NoMethod Artifacts 508 raw := NoMethod(*s) 509 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 510} 511 512// Build: A build resource in the Cloud Build API. At a high level, a 513// `Build` describes where to find source code, how to build it (for 514// example, the builder image to run on the source), and where to store 515// the built artifacts. Fields can include the following variables, 516// which will be expanded when the build is created: - $PROJECT_ID: the 517// project ID of the build. - $PROJECT_NUMBER: the project number of the 518// build. - $BUILD_ID: the autogenerated ID of the build. - $REPO_NAME: 519// the source repository name specified by RepoSource. - $BRANCH_NAME: 520// the branch name specified by RepoSource. - $TAG_NAME: the tag name 521// specified by RepoSource. - $REVISION_ID or $COMMIT_SHA: the commit 522// SHA specified by RepoSource or resolved from the specified branch or 523// tag. - $SHORT_SHA: first 7 characters of $REVISION_ID or $COMMIT_SHA. 524type Build struct { 525 // Approval: Output only. Describes this build's approval configuration, 526 // status, and result. 527 Approval *BuildApproval `json:"approval,omitempty"` 528 529 // Artifacts: Artifacts produced by the build that should be uploaded 530 // upon successful completion of all build steps. 531 Artifacts *Artifacts `json:"artifacts,omitempty"` 532 533 // AvailableSecrets: Secrets and secret environment variables. 534 AvailableSecrets *Secrets `json:"availableSecrets,omitempty"` 535 536 // BuildTriggerId: Output only. The ID of the `BuildTrigger` that 537 // triggered this build, if it was triggered automatically. 538 BuildTriggerId string `json:"buildTriggerId,omitempty"` 539 540 // CreateTime: Output only. Time at which the request to create the 541 // build was received. 542 CreateTime string `json:"createTime,omitempty"` 543 544 // FailureInfo: Output only. Contains information about the build when 545 // status=FAILURE. 546 FailureInfo *FailureInfo `json:"failureInfo,omitempty"` 547 548 // FinishTime: Output only. Time at which execution of the build was 549 // finished. The difference between finish_time and start_time is the 550 // duration of the build's execution. 551 FinishTime string `json:"finishTime,omitempty"` 552 553 // Id: Output only. Unique identifier of the build. 554 Id string `json:"id,omitempty"` 555 556 // Images: A list of images to be pushed upon the successful completion 557 // of all build steps. The images are pushed using the builder service 558 // account's credentials. The digests of the pushed images will be 559 // stored in the `Build` resource's results field. If any of the images 560 // fail to be pushed, the build status is marked `FAILURE`. 561 Images []string `json:"images,omitempty"` 562 563 // LogUrl: Output only. URL to logs for this build in Google Cloud 564 // Console. 565 LogUrl string `json:"logUrl,omitempty"` 566 567 // LogsBucket: Google Cloud Storage bucket where logs should be written 568 // (see Bucket Name Requirements 569 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 570 // Logs file names will be of the format 571 // `${logs_bucket}/log-${build_id}.txt`. 572 LogsBucket string `json:"logsBucket,omitempty"` 573 574 // Name: Output only. The 'Build' name with format: 575 // `projects/{project}/locations/{location}/builds/{build}`, where 576 // {build} is a unique identifier generated by the service. 577 Name string `json:"name,omitempty"` 578 579 // Options: Special options for this build. 580 Options *BuildOptions `json:"options,omitempty"` 581 582 // ProjectId: Output only. ID of the project. 583 ProjectId string `json:"projectId,omitempty"` 584 585 // QueueTtl: TTL in queue for this build. If provided and the build is 586 // enqueued longer than this value, the build will expire and the build 587 // status will be `EXPIRED`. The TTL starts ticking from create_time. 588 QueueTtl string `json:"queueTtl,omitempty"` 589 590 // Results: Output only. Results of the build. 591 Results *Results `json:"results,omitempty"` 592 593 // Secrets: Secrets to decrypt using Cloud Key Management Service. Note: 594 // Secret Manager is the recommended technique for managing sensitive 595 // data with Cloud Build. Use `available_secrets` to configure builds to 596 // access secrets from Secret Manager. For instructions, see: 597 // https://cloud.google.com/cloud-build/docs/securing-builds/use-secrets 598 Secrets []*Secret `json:"secrets,omitempty"` 599 600 // ServiceAccount: IAM service account whose credentials will be used at 601 // build runtime. Must be of the format 602 // `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT}`. ACCOUNT can be 603 // email address or uniqueId of the service account. 604 ServiceAccount string `json:"serviceAccount,omitempty"` 605 606 // Source: The location of the source files to build. 607 Source *Source `json:"source,omitempty"` 608 609 // SourceProvenance: Output only. A permanent fixed identifier for 610 // source. 611 SourceProvenance *SourceProvenance `json:"sourceProvenance,omitempty"` 612 613 // StartTime: Output only. Time at which execution of the build was 614 // started. 615 StartTime string `json:"startTime,omitempty"` 616 617 // Status: Output only. Status of the build. 618 // 619 // Possible values: 620 // "STATUS_UNKNOWN" - Status of the build is unknown. 621 // "PENDING" - Build has been created and is pending execution and 622 // queuing. It has not been queued. 623 // "QUEUED" - Build or step is queued; work has not yet begun. 624 // "WORKING" - Build or step is being executed. 625 // "SUCCESS" - Build or step finished successfully. 626 // "FAILURE" - Build or step failed to complete successfully. 627 // "INTERNAL_ERROR" - Build or step failed due to an internal cause. 628 // "TIMEOUT" - Build or step took longer than was allowed. 629 // "CANCELLED" - Build or step was canceled by a user. 630 // "EXPIRED" - Build was enqueued for longer than the value of 631 // `queue_ttl`. 632 Status string `json:"status,omitempty"` 633 634 // StatusDetail: Output only. Customer-readable message about the 635 // current status. 636 StatusDetail string `json:"statusDetail,omitempty"` 637 638 // Steps: Required. The operations to be performed on the workspace. 639 Steps []*BuildStep `json:"steps,omitempty"` 640 641 // Substitutions: Substitutions data for `Build` resource. 642 Substitutions map[string]string `json:"substitutions,omitempty"` 643 644 // Tags: Tags for annotation of a `Build`. These are not docker tags. 645 Tags []string `json:"tags,omitempty"` 646 647 // Timeout: Amount of time that this build should be allowed to run, to 648 // second granularity. If this amount of time elapses, work on the build 649 // will cease and the build status will be `TIMEOUT`. `timeout` starts 650 // ticking from `startTime`. Default time is ten minutes. 651 Timeout string `json:"timeout,omitempty"` 652 653 // Timing: Output only. Stores timing information for phases of the 654 // build. Valid keys are: * BUILD: time to execute all build steps. * 655 // PUSH: time to push all specified images. * FETCHSOURCE: time to fetch 656 // source. * SETUPBUILD: time to set up build. If the build does not 657 // specify source or images, these keys will not be included. 658 Timing map[string]TimeSpan `json:"timing,omitempty"` 659 660 // Warnings: Output only. Non-fatal problems encountered during the 661 // execution of the build. 662 Warnings []*Warning `json:"warnings,omitempty"` 663 664 // ServerResponse contains the HTTP response code and headers from the 665 // server. 666 googleapi.ServerResponse `json:"-"` 667 668 // ForceSendFields is a list of field names (e.g. "Approval") to 669 // unconditionally include in API requests. By default, fields with 670 // empty or default values are omitted from API requests. However, any 671 // non-pointer, non-interface field appearing in ForceSendFields will be 672 // sent to the server regardless of whether the field is empty or not. 673 // This may be used to include empty fields in Patch requests. 674 ForceSendFields []string `json:"-"` 675 676 // NullFields is a list of field names (e.g. "Approval") to include in 677 // API requests with the JSON null value. By default, fields with empty 678 // values are omitted from API requests. However, any field with an 679 // empty value appearing in NullFields will be sent to the server as 680 // null. It is an error if a field in this list has a non-empty value. 681 // This may be used to include null fields in Patch requests. 682 NullFields []string `json:"-"` 683} 684 685func (s *Build) MarshalJSON() ([]byte, error) { 686 type NoMethod Build 687 raw := NoMethod(*s) 688 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 689} 690 691// BuildApproval: BuildApproval describes a build's approval 692// configuration, state, and result. 693type BuildApproval struct { 694 // Config: Output only. Configuration for manual approval of this build. 695 Config *ApprovalConfig `json:"config,omitempty"` 696 697 // Result: Output only. Result of manual approval for this Build. 698 Result *ApprovalResult `json:"result,omitempty"` 699 700 // State: Output only. The state of this build's approval. 701 // 702 // Possible values: 703 // "STATE_UNSPECIFIED" - Default enum type. This should not be used. 704 // "PENDING" - Build approval is pending. 705 // "APPROVED" - Build approval has been approved. 706 // "REJECTED" - Build approval has been rejected. 707 // "CANCELLED" - Build was cancelled while it was still pending 708 // approval. 709 State string `json:"state,omitempty"` 710 711 // ForceSendFields is a list of field names (e.g. "Config") to 712 // unconditionally include in API requests. By default, fields with 713 // empty or default values are omitted from API requests. However, any 714 // non-pointer, non-interface field appearing in ForceSendFields will be 715 // sent to the server regardless of whether the field is empty or not. 716 // This may be used to include empty fields in Patch requests. 717 ForceSendFields []string `json:"-"` 718 719 // NullFields is a list of field names (e.g. "Config") to include in API 720 // requests with the JSON null value. By default, fields with empty 721 // values are omitted from API requests. However, any field with an 722 // empty value appearing in NullFields will be sent to the server as 723 // null. It is an error if a field in this list has a non-empty value. 724 // This may be used to include null fields in Patch requests. 725 NullFields []string `json:"-"` 726} 727 728func (s *BuildApproval) MarshalJSON() ([]byte, error) { 729 type NoMethod BuildApproval 730 raw := NoMethod(*s) 731 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 732} 733 734// BuildOperationMetadata: Metadata for build operations. 735type BuildOperationMetadata struct { 736 // Build: The build that the operation is tracking. 737 Build *Build `json:"build,omitempty"` 738 739 // ForceSendFields is a list of field names (e.g. "Build") to 740 // unconditionally include in API requests. By default, fields with 741 // empty or default values are omitted from API requests. However, any 742 // non-pointer, non-interface field appearing in ForceSendFields will be 743 // sent to the server regardless of whether the field is empty or not. 744 // This may be used to include empty fields in Patch requests. 745 ForceSendFields []string `json:"-"` 746 747 // NullFields is a list of field names (e.g. "Build") to include in API 748 // requests with the JSON null value. By default, fields with empty 749 // values are omitted from API requests. However, any field with an 750 // empty value appearing in NullFields will be sent to the server as 751 // null. It is an error if a field in this list has a non-empty value. 752 // This may be used to include null fields in Patch requests. 753 NullFields []string `json:"-"` 754} 755 756func (s *BuildOperationMetadata) MarshalJSON() ([]byte, error) { 757 type NoMethod BuildOperationMetadata 758 raw := NoMethod(*s) 759 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 760} 761 762// BuildOptions: Optional arguments to enable specific features of 763// builds. 764type BuildOptions struct { 765 // DiskSizeGb: Requested disk size for the VM that runs the build. Note 766 // that this is *NOT* "disk free"; some of the space will be used by the 767 // operating system and build utilities. Also note that this is the 768 // minimum disk size that will be allocated for the build -- the build 769 // may run with a larger disk than requested. At present, the maximum 770 // disk size is 1000GB; builds that request more than the maximum are 771 // rejected with an error. 772 DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` 773 774 // DynamicSubstitutions: Option to specify whether or not to apply bash 775 // style string operations to the substitutions. NOTE: this is always 776 // enabled for triggered builds and cannot be overridden in the build 777 // configuration file. 778 DynamicSubstitutions bool `json:"dynamicSubstitutions,omitempty"` 779 780 // Env: A list of global environment variable definitions that will 781 // exist for all build steps in this build. If a variable is defined in 782 // both globally and in a build step, the variable will use the build 783 // step value. The elements are of the form "KEY=VALUE" for the 784 // environment variable "KEY" being given the value "VALUE". 785 Env []string `json:"env,omitempty"` 786 787 // LogStreamingOption: Option to define build log streaming behavior to 788 // Google Cloud Storage. 789 // 790 // Possible values: 791 // "STREAM_DEFAULT" - Service may automatically determine build log 792 // streaming behavior. 793 // "STREAM_ON" - Build logs should be streamed to Google Cloud 794 // Storage. 795 // "STREAM_OFF" - Build logs should not be streamed to Google Cloud 796 // Storage; they will be written when the build is completed. 797 LogStreamingOption string `json:"logStreamingOption,omitempty"` 798 799 // Logging: Option to specify the logging mode, which determines if and 800 // where build logs are stored. 801 // 802 // Possible values: 803 // "LOGGING_UNSPECIFIED" - The service determines the logging mode. 804 // The default is `LEGACY`. Do not rely on the default logging behavior 805 // as it may change in the future. 806 // "LEGACY" - Cloud Logging and Cloud Storage logging are enabled. 807 // "GCS_ONLY" - Only Cloud Storage logging is enabled. 808 // "STACKDRIVER_ONLY" - This option is the same as CLOUD_LOGGING_ONLY. 809 // "CLOUD_LOGGING_ONLY" - Only Cloud Logging is enabled. Note that 810 // logs for both the Cloud Console UI and Cloud SDK are based on Cloud 811 // Storage logs, so neither will provide logs if this option is chosen. 812 // "NONE" - Turn off all logging. No build logs will be captured. 813 Logging string `json:"logging,omitempty"` 814 815 // MachineType: Compute Engine machine type on which to run the build. 816 // 817 // Possible values: 818 // "UNSPECIFIED" - Standard machine type. 819 // "N1_HIGHCPU_8" - Highcpu machine with 8 CPUs. 820 // "N1_HIGHCPU_32" - Highcpu machine with 32 CPUs. 821 // "E2_HIGHCPU_8" - Highcpu e2 machine with 8 CPUs. 822 // "E2_HIGHCPU_32" - Highcpu e2 machine with 32 CPUs. 823 MachineType string `json:"machineType,omitempty"` 824 825 // Pool: Optional. Specification for execution on a `WorkerPool`. See 826 // running builds in a private pool 827 // (https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) 828 // for more information. 829 Pool *PoolOption `json:"pool,omitempty"` 830 831 // RequestedVerifyOption: Requested verifiability options. 832 // 833 // Possible values: 834 // "NOT_VERIFIED" - Not a verifiable build. (default) 835 // "VERIFIED" - Verified build. 836 RequestedVerifyOption string `json:"requestedVerifyOption,omitempty"` 837 838 // SecretEnv: A list of global environment variables, which are 839 // encrypted using a Cloud Key Management Service crypto key. These 840 // values must be specified in the build's `Secret`. These variables 841 // will be available to all build steps in this build. 842 SecretEnv []string `json:"secretEnv,omitempty"` 843 844 // SourceProvenanceHash: Requested hash for SourceProvenance. 845 // 846 // Possible values: 847 // "NONE" - No hash requested. 848 // "SHA256" - Use a sha256 hash. 849 // "MD5" - Use a md5 hash. 850 SourceProvenanceHash []string `json:"sourceProvenanceHash,omitempty"` 851 852 // SubstitutionOption: Option to specify behavior when there is an error 853 // in the substitution checks. NOTE: this is always set to ALLOW_LOOSE 854 // for triggered builds and cannot be overridden in the build 855 // configuration file. 856 // 857 // Possible values: 858 // "MUST_MATCH" - Fails the build if error in substitutions checks, 859 // like missing a substitution in the template or in the map. 860 // "ALLOW_LOOSE" - Do not fail the build if error in substitutions 861 // checks. 862 SubstitutionOption string `json:"substitutionOption,omitempty"` 863 864 // Volumes: Global list of volumes to mount for ALL build steps Each 865 // volume is created as an empty volume prior to starting the build 866 // process. Upon completion of the build, volumes and their contents are 867 // discarded. Global volume names and paths cannot conflict with the 868 // volumes defined a build step. Using a global volume in a build with 869 // only one step is not valid as it is indicative of a build request 870 // with an incorrect configuration. 871 Volumes []*Volume `json:"volumes,omitempty"` 872 873 // WorkerPool: This field deprecated; please use `pool.name` instead. 874 WorkerPool string `json:"workerPool,omitempty"` 875 876 // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to 877 // unconditionally include in API requests. By default, fields with 878 // empty or default values are omitted from API requests. However, any 879 // non-pointer, non-interface field appearing in ForceSendFields will be 880 // sent to the server regardless of whether the field is empty or not. 881 // This may be used to include empty fields in Patch requests. 882 ForceSendFields []string `json:"-"` 883 884 // NullFields is a list of field names (e.g. "DiskSizeGb") to include in 885 // API requests with the JSON null value. By default, fields with empty 886 // values are omitted from API requests. However, any field with an 887 // empty value appearing in NullFields will be sent to the server as 888 // null. It is an error if a field in this list has a non-empty value. 889 // This may be used to include null fields in Patch requests. 890 NullFields []string `json:"-"` 891} 892 893func (s *BuildOptions) MarshalJSON() ([]byte, error) { 894 type NoMethod BuildOptions 895 raw := NoMethod(*s) 896 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 897} 898 899// BuildStep: A step in the build pipeline. 900type BuildStep struct { 901 // Args: A list of arguments that will be presented to the step when it 902 // is started. If the image used to run the step's container has an 903 // entrypoint, the `args` are used as arguments to that entrypoint. If 904 // the image does not define an entrypoint, the first element in args is 905 // used as the entrypoint, and the remainder will be used as arguments. 906 Args []string `json:"args,omitempty"` 907 908 // Dir: Working directory to use when running this step's container. If 909 // this value is a relative path, it is relative to the build's working 910 // directory. If this value is absolute, it may be outside the build's 911 // working directory, in which case the contents of the path may not be 912 // persisted across build step executions, unless a `volume` for that 913 // path is specified. If the build specifies a `RepoSource` with `dir` 914 // and a step with a `dir`, which specifies an absolute path, the 915 // `RepoSource` `dir` is ignored for the step's execution. 916 Dir string `json:"dir,omitempty"` 917 918 // Entrypoint: Entrypoint to be used instead of the build step image's 919 // default entrypoint. If unset, the image's default entrypoint is used. 920 Entrypoint string `json:"entrypoint,omitempty"` 921 922 // Env: A list of environment variable definitions to be used when 923 // running a step. The elements are of the form "KEY=VALUE" for the 924 // environment variable "KEY" being given the value "VALUE". 925 Env []string `json:"env,omitempty"` 926 927 // Id: Unique identifier for this build step, used in `wait_for` to 928 // reference this build step as a dependency. 929 Id string `json:"id,omitempty"` 930 931 // Name: Required. The name of the container image that will run this 932 // particular build step. If the image is available in the host's Docker 933 // daemon's cache, it will be run directly. If not, the host will 934 // attempt to pull the image first, using the builder service account's 935 // credentials if necessary. The Docker daemon's cache will already have 936 // the latest versions of all of the officially supported build steps 937 // (https://github.com/GoogleCloudPlatform/cloud-builders 938 // (https://github.com/GoogleCloudPlatform/cloud-builders)). The Docker 939 // daemon will also have cached many of the layers for some popular 940 // images, like "ubuntu", "debian", but they will be refreshed at the 941 // time you attempt to use them. If you built an image in a previous 942 // build step, it will be stored in the host's Docker daemon's cache and 943 // is available to use as the name for a later build step. 944 Name string `json:"name,omitempty"` 945 946 // PullTiming: Output only. Stores timing information for pulling this 947 // build step's builder image only. 948 PullTiming *TimeSpan `json:"pullTiming,omitempty"` 949 950 // Script: A shell script to be executed in the step. When script is 951 // provided, the user cannot specify the entrypoint or args. 952 Script string `json:"script,omitempty"` 953 954 // SecretEnv: A list of environment variables which are encrypted using 955 // a Cloud Key Management Service crypto key. These values must be 956 // specified in the build's `Secret`. 957 SecretEnv []string `json:"secretEnv,omitempty"` 958 959 // Status: Output only. Status of the build step. At this time, build 960 // step status is only updated on build completion; step status is not 961 // updated in real-time as the build progresses. 962 // 963 // Possible values: 964 // "STATUS_UNKNOWN" - Status of the build is unknown. 965 // "PENDING" - Build has been created and is pending execution and 966 // queuing. It has not been queued. 967 // "QUEUED" - Build or step is queued; work has not yet begun. 968 // "WORKING" - Build or step is being executed. 969 // "SUCCESS" - Build or step finished successfully. 970 // "FAILURE" - Build or step failed to complete successfully. 971 // "INTERNAL_ERROR" - Build or step failed due to an internal cause. 972 // "TIMEOUT" - Build or step took longer than was allowed. 973 // "CANCELLED" - Build or step was canceled by a user. 974 // "EXPIRED" - Build was enqueued for longer than the value of 975 // `queue_ttl`. 976 Status string `json:"status,omitempty"` 977 978 // Timeout: Time limit for executing this build step. If not defined, 979 // the step has no time limit and will be allowed to continue to run 980 // until either it completes or the build itself times out. 981 Timeout string `json:"timeout,omitempty"` 982 983 // Timing: Output only. Stores timing information for executing this 984 // build step. 985 Timing *TimeSpan `json:"timing,omitempty"` 986 987 // Volumes: List of volumes to mount into the build step. Each volume is 988 // created as an empty volume prior to execution of the build step. Upon 989 // completion of the build, volumes and their contents are discarded. 990 // Using a named volume in only one step is not valid as it is 991 // indicative of a build request with an incorrect configuration. 992 Volumes []*Volume `json:"volumes,omitempty"` 993 994 // WaitFor: The ID(s) of the step(s) that this build step depends on. 995 // This build step will not start until all the build steps in 996 // `wait_for` have completed successfully. If `wait_for` is empty, this 997 // build step will start when all previous build steps in the 998 // `Build.Steps` list have completed successfully. 999 WaitFor []string `json:"waitFor,omitempty"` 1000 1001 // ForceSendFields is a list of field names (e.g. "Args") to 1002 // unconditionally include in API requests. By default, fields with 1003 // empty or default values are omitted from API requests. However, any 1004 // non-pointer, non-interface field appearing in ForceSendFields will be 1005 // sent to the server regardless of whether the field is empty or not. 1006 // This may be used to include empty fields in Patch requests. 1007 ForceSendFields []string `json:"-"` 1008 1009 // NullFields is a list of field names (e.g. "Args") to include in API 1010 // requests with the JSON null value. By default, fields with empty 1011 // values are omitted from API requests. However, any field with an 1012 // empty value appearing in NullFields will be sent to the server as 1013 // null. It is an error if a field in this list has a non-empty value. 1014 // This may be used to include null fields in Patch requests. 1015 NullFields []string `json:"-"` 1016} 1017 1018func (s *BuildStep) MarshalJSON() ([]byte, error) { 1019 type NoMethod BuildStep 1020 raw := NoMethod(*s) 1021 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1022} 1023 1024// BuildTrigger: Configuration for an automated build in response to 1025// source repository changes. 1026type BuildTrigger struct { 1027 // ApprovalConfig: Configuration for manual approval to start a build 1028 // invocation of this BuildTrigger. 1029 ApprovalConfig *ApprovalConfig `json:"approvalConfig,omitempty"` 1030 1031 // Autodetect: Autodetect build configuration. The following precedence 1032 // is used (case insensitive): 1. cloudbuild.yaml 2. cloudbuild.yml 3. 1033 // cloudbuild.json 4. Dockerfile Currently only available for GitHub App 1034 // Triggers. 1035 Autodetect bool `json:"autodetect,omitempty"` 1036 1037 // Build: Contents of the build template. 1038 Build *Build `json:"build,omitempty"` 1039 1040 // CreateTime: Output only. Time when the trigger was created. 1041 CreateTime string `json:"createTime,omitempty"` 1042 1043 // Description: Human-readable description of this trigger. 1044 Description string `json:"description,omitempty"` 1045 1046 // Disabled: If true, the trigger will never automatically execute a 1047 // build. 1048 Disabled bool `json:"disabled,omitempty"` 1049 1050 // Filename: Path, from the source root, to the build configuration file 1051 // (i.e. cloudbuild.yaml). 1052 Filename string `json:"filename,omitempty"` 1053 1054 // Filter: A Common Expression Language string. 1055 Filter string `json:"filter,omitempty"` 1056 1057 // GitFileSource: The file source describing the local or remote Build 1058 // template. 1059 GitFileSource *GitFileSource `json:"gitFileSource,omitempty"` 1060 1061 // Github: GitHubEventsConfig describes the configuration of a trigger 1062 // that creates a build whenever a GitHub event is received. Mutually 1063 // exclusive with `trigger_template`. 1064 Github *GitHubEventsConfig `json:"github,omitempty"` 1065 1066 // Id: Output only. Unique identifier of the trigger. 1067 Id string `json:"id,omitempty"` 1068 1069 // IgnoredFiles: ignored_files and included_files are file glob matches 1070 // using https://golang.org/pkg/path/filepath/#Match extended with 1071 // support for "**". If ignored_files and changed files are both empty, 1072 // then they are not used to determine whether or not to trigger a 1073 // build. If ignored_files is not empty, then we ignore any files that 1074 // match any of the ignored_file globs. If the change has no files that 1075 // are outside of the ignored_files globs, then we do not trigger a 1076 // build. 1077 IgnoredFiles []string `json:"ignoredFiles,omitempty"` 1078 1079 // IncludedFiles: If any of the files altered in the commit pass the 1080 // ignored_files filter and included_files is empty, then as far as this 1081 // filter is concerned, we should trigger the build. If any of the files 1082 // altered in the commit pass the ignored_files filter and 1083 // included_files is not empty, then we make sure that at least one of 1084 // those files matches a included_files glob. If not, then we do not 1085 // trigger a build. 1086 IncludedFiles []string `json:"includedFiles,omitempty"` 1087 1088 // Name: User-assigned name of the trigger. Must be unique within the 1089 // project. Trigger names must meet the following requirements: + They 1090 // must contain only alphanumeric characters and dashes. + They can be 1091 // 1-64 characters long. + They must begin and end with an alphanumeric 1092 // character. 1093 Name string `json:"name,omitempty"` 1094 1095 // PubsubConfig: PubsubConfig describes the configuration of a trigger 1096 // that creates a build whenever a Pub/Sub message is published. 1097 PubsubConfig *PubsubConfig `json:"pubsubConfig,omitempty"` 1098 1099 // ResourceName: The `Trigger` name with format: 1100 // `projects/{project}/locations/{location}/triggers/{trigger}`, where 1101 // {trigger} is a unique identifier generated by the service. 1102 ResourceName string `json:"resourceName,omitempty"` 1103 1104 // ServiceAccount: The service account used for all user-controlled 1105 // operations including UpdateBuildTrigger, RunBuildTrigger, 1106 // CreateBuild, and CancelBuild. If no service account is set, then the 1107 // standard Cloud Build service account 1108 // ([PROJECT_NUM]@system.gserviceaccount.com) will be used instead. 1109 // Format: `projects/{PROJECT_ID}/serviceAccounts/{ACCOUNT_ID_OR_EMAIL}` 1110 ServiceAccount string `json:"serviceAccount,omitempty"` 1111 1112 // SourceToBuild: The repo and ref of the repository from which to 1113 // build. This field is used only for those triggers that do not respond 1114 // to SCM events. Triggers that respond to such events build source at 1115 // whatever commit caused the event. This field is currently only used 1116 // by Webhook, Pub/Sub, Manual, and Cron triggers. 1117 SourceToBuild *GitRepoSource `json:"sourceToBuild,omitempty"` 1118 1119 // Substitutions: Substitutions for Build resource. The keys must match 1120 // the following regular expression: `^_[A-Z0-9_]+$`. 1121 Substitutions map[string]string `json:"substitutions,omitempty"` 1122 1123 // Tags: Tags for annotation of a `BuildTrigger` 1124 Tags []string `json:"tags,omitempty"` 1125 1126 // TriggerTemplate: Template describing the types of source changes to 1127 // trigger a build. Branch and tag names in trigger templates are 1128 // interpreted as regular expressions. Any branch or tag change that 1129 // matches that regular expression will trigger a build. Mutually 1130 // exclusive with `github`. 1131 TriggerTemplate *RepoSource `json:"triggerTemplate,omitempty"` 1132 1133 // WebhookConfig: WebhookConfig describes the configuration of a trigger 1134 // that creates a build whenever a webhook is sent to a trigger's 1135 // webhook URL. 1136 WebhookConfig *WebhookConfig `json:"webhookConfig,omitempty"` 1137 1138 // ServerResponse contains the HTTP response code and headers from the 1139 // server. 1140 googleapi.ServerResponse `json:"-"` 1141 1142 // ForceSendFields is a list of field names (e.g. "ApprovalConfig") to 1143 // unconditionally include in API requests. By default, fields with 1144 // empty or default values are omitted from API requests. However, any 1145 // non-pointer, non-interface field appearing in ForceSendFields will be 1146 // sent to the server regardless of whether the field is empty or not. 1147 // This may be used to include empty fields in Patch requests. 1148 ForceSendFields []string `json:"-"` 1149 1150 // NullFields is a list of field names (e.g. "ApprovalConfig") to 1151 // include in API requests with the JSON null value. By default, fields 1152 // with empty values are omitted from API requests. However, any field 1153 // with an empty value appearing in NullFields will be sent to the 1154 // server as null. It is an error if a field in this list has a 1155 // non-empty value. This may be used to include null fields in Patch 1156 // requests. 1157 NullFields []string `json:"-"` 1158} 1159 1160func (s *BuildTrigger) MarshalJSON() ([]byte, error) { 1161 type NoMethod BuildTrigger 1162 raw := NoMethod(*s) 1163 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1164} 1165 1166// BuiltImage: An image built by the pipeline. 1167type BuiltImage struct { 1168 // Digest: Docker Registry 2.0 digest. 1169 Digest string `json:"digest,omitempty"` 1170 1171 // Name: Name used to push the container image to Google Container 1172 // Registry, as presented to `docker push`. 1173 Name string `json:"name,omitempty"` 1174 1175 // PushTiming: Output only. Stores timing information for pushing the 1176 // specified image. 1177 PushTiming *TimeSpan `json:"pushTiming,omitempty"` 1178 1179 // ForceSendFields is a list of field names (e.g. "Digest") to 1180 // unconditionally include in API requests. By default, fields with 1181 // empty or default values are omitted from API requests. However, any 1182 // non-pointer, non-interface field appearing in ForceSendFields will be 1183 // sent to the server regardless of whether the field is empty or not. 1184 // This may be used to include empty fields in Patch requests. 1185 ForceSendFields []string `json:"-"` 1186 1187 // NullFields is a list of field names (e.g. "Digest") to include in API 1188 // requests with the JSON null value. By default, fields with empty 1189 // values are omitted from API requests. However, any field with an 1190 // empty value appearing in NullFields will be sent to the server as 1191 // null. It is an error if a field in this list has a non-empty value. 1192 // This may be used to include null fields in Patch requests. 1193 NullFields []string `json:"-"` 1194} 1195 1196func (s *BuiltImage) MarshalJSON() ([]byte, error) { 1197 type NoMethod BuiltImage 1198 raw := NoMethod(*s) 1199 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1200} 1201 1202// CancelBuildRequest: Request to cancel an ongoing build. 1203type CancelBuildRequest struct { 1204 // Id: Required. ID of the build. 1205 Id string `json:"id,omitempty"` 1206 1207 // Name: The name of the `Build` to cancel. Format: 1208 // `projects/{project}/locations/{location}/builds/{build}` 1209 Name string `json:"name,omitempty"` 1210 1211 // ProjectId: Required. ID of the project. 1212 ProjectId string `json:"projectId,omitempty"` 1213 1214 // ForceSendFields is a list of field names (e.g. "Id") to 1215 // unconditionally include in API requests. By default, fields with 1216 // empty or default values are omitted from API requests. However, any 1217 // non-pointer, non-interface field appearing in ForceSendFields will be 1218 // sent to the server regardless of whether the field is empty or not. 1219 // This may be used to include empty fields in Patch requests. 1220 ForceSendFields []string `json:"-"` 1221 1222 // NullFields is a list of field names (e.g. "Id") to include in API 1223 // requests with the JSON null value. By default, fields with empty 1224 // values are omitted from API requests. However, any field with an 1225 // empty value appearing in NullFields will be sent to the server as 1226 // null. It is an error if a field in this list has a non-empty value. 1227 // This may be used to include null fields in Patch requests. 1228 NullFields []string `json:"-"` 1229} 1230 1231func (s *CancelBuildRequest) MarshalJSON() ([]byte, error) { 1232 type NoMethod CancelBuildRequest 1233 raw := NoMethod(*s) 1234 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1235} 1236 1237// CancelOperationRequest: The request message for 1238// Operations.CancelOperation. 1239type CancelOperationRequest struct { 1240} 1241 1242// CreateGitHubEnterpriseConfigOperationMetadata: Metadata for 1243// `CreateGithubEnterpriseConfig` operation. 1244type CreateGitHubEnterpriseConfigOperationMetadata struct { 1245 // CompleteTime: Time the operation was completed. 1246 CompleteTime string `json:"completeTime,omitempty"` 1247 1248 // CreateTime: Time the operation was created. 1249 CreateTime string `json:"createTime,omitempty"` 1250 1251 // GithubEnterpriseConfig: The resource name of the GitHubEnterprise to 1252 // be created. Format: 1253 // `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}` 1254 // . 1255 GithubEnterpriseConfig string `json:"githubEnterpriseConfig,omitempty"` 1256 1257 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 1258 // unconditionally include in API requests. By default, fields with 1259 // empty or default values are omitted from API requests. However, any 1260 // non-pointer, non-interface field appearing in ForceSendFields will be 1261 // sent to the server regardless of whether the field is empty or not. 1262 // This may be used to include empty fields in Patch requests. 1263 ForceSendFields []string `json:"-"` 1264 1265 // NullFields is a list of field names (e.g. "CompleteTime") to include 1266 // in API requests with the JSON null value. By default, fields with 1267 // empty values are omitted from API requests. However, any field with 1268 // an empty value appearing in NullFields will be sent to the server as 1269 // null. It is an error if a field in this list has a non-empty value. 1270 // This may be used to include null fields in Patch requests. 1271 NullFields []string `json:"-"` 1272} 1273 1274func (s *CreateGitHubEnterpriseConfigOperationMetadata) MarshalJSON() ([]byte, error) { 1275 type NoMethod CreateGitHubEnterpriseConfigOperationMetadata 1276 raw := NoMethod(*s) 1277 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1278} 1279 1280// CreateWorkerPoolOperationMetadata: Metadata for the 1281// `CreateWorkerPool` operation. 1282type CreateWorkerPoolOperationMetadata struct { 1283 // CompleteTime: Time the operation was completed. 1284 CompleteTime string `json:"completeTime,omitempty"` 1285 1286 // CreateTime: Time the operation was created. 1287 CreateTime string `json:"createTime,omitempty"` 1288 1289 // WorkerPool: The resource name of the `WorkerPool` to create. Format: 1290 // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. 1291 WorkerPool string `json:"workerPool,omitempty"` 1292 1293 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 1294 // unconditionally include in API requests. By default, fields with 1295 // empty or default values are omitted from API requests. However, any 1296 // non-pointer, non-interface field appearing in ForceSendFields will be 1297 // sent to the server regardless of whether the field is empty or not. 1298 // This may be used to include empty fields in Patch requests. 1299 ForceSendFields []string `json:"-"` 1300 1301 // NullFields is a list of field names (e.g. "CompleteTime") to include 1302 // in API requests with the JSON null value. By default, fields with 1303 // empty values are omitted from API requests. However, any field with 1304 // an empty value appearing in NullFields will be sent to the server as 1305 // null. It is an error if a field in this list has a non-empty value. 1306 // This may be used to include null fields in Patch requests. 1307 NullFields []string `json:"-"` 1308} 1309 1310func (s *CreateWorkerPoolOperationMetadata) MarshalJSON() ([]byte, error) { 1311 type NoMethod CreateWorkerPoolOperationMetadata 1312 raw := NoMethod(*s) 1313 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1314} 1315 1316// DeleteGitHubEnterpriseConfigOperationMetadata: Metadata for 1317// `DeleteGitHubEnterpriseConfig` operation. 1318type DeleteGitHubEnterpriseConfigOperationMetadata struct { 1319 // CompleteTime: Time the operation was completed. 1320 CompleteTime string `json:"completeTime,omitempty"` 1321 1322 // CreateTime: Time the operation was created. 1323 CreateTime string `json:"createTime,omitempty"` 1324 1325 // GithubEnterpriseConfig: The resource name of the GitHubEnterprise to 1326 // be deleted. Format: 1327 // `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}` 1328 // . 1329 GithubEnterpriseConfig string `json:"githubEnterpriseConfig,omitempty"` 1330 1331 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 1332 // unconditionally include in API requests. By default, fields with 1333 // empty or default values are omitted from API requests. However, any 1334 // non-pointer, non-interface field appearing in ForceSendFields will be 1335 // sent to the server regardless of whether the field is empty or not. 1336 // This may be used to include empty fields in Patch requests. 1337 ForceSendFields []string `json:"-"` 1338 1339 // NullFields is a list of field names (e.g. "CompleteTime") to include 1340 // in API requests with the JSON null value. By default, fields with 1341 // empty values are omitted from API requests. However, any field with 1342 // an empty value appearing in NullFields will be sent to the server as 1343 // null. It is an error if a field in this list has a non-empty value. 1344 // This may be used to include null fields in Patch requests. 1345 NullFields []string `json:"-"` 1346} 1347 1348func (s *DeleteGitHubEnterpriseConfigOperationMetadata) MarshalJSON() ([]byte, error) { 1349 type NoMethod DeleteGitHubEnterpriseConfigOperationMetadata 1350 raw := NoMethod(*s) 1351 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1352} 1353 1354// DeleteWorkerPoolOperationMetadata: Metadata for the 1355// `DeleteWorkerPool` operation. 1356type DeleteWorkerPoolOperationMetadata struct { 1357 // CompleteTime: Time the operation was completed. 1358 CompleteTime string `json:"completeTime,omitempty"` 1359 1360 // CreateTime: Time the operation was created. 1361 CreateTime string `json:"createTime,omitempty"` 1362 1363 // WorkerPool: The resource name of the `WorkerPool` being deleted. 1364 // Format: 1365 // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. 1366 WorkerPool string `json:"workerPool,omitempty"` 1367 1368 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 1369 // unconditionally include in API requests. By default, fields with 1370 // empty or default values are omitted from API requests. However, any 1371 // non-pointer, non-interface field appearing in ForceSendFields will be 1372 // sent to the server regardless of whether the field is empty or not. 1373 // This may be used to include empty fields in Patch requests. 1374 ForceSendFields []string `json:"-"` 1375 1376 // NullFields is a list of field names (e.g. "CompleteTime") to include 1377 // in API requests with the JSON null value. By default, fields with 1378 // empty values are omitted from API requests. However, any field with 1379 // an empty value appearing in NullFields will be sent to the server as 1380 // null. It is an error if a field in this list has a non-empty value. 1381 // This may be used to include null fields in Patch requests. 1382 NullFields []string `json:"-"` 1383} 1384 1385func (s *DeleteWorkerPoolOperationMetadata) MarshalJSON() ([]byte, error) { 1386 type NoMethod DeleteWorkerPoolOperationMetadata 1387 raw := NoMethod(*s) 1388 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1389} 1390 1391// Empty: A generic empty message that you can re-use to avoid defining 1392// duplicated empty messages in your APIs. A typical example is to use 1393// it as the request or the response type of an API method. For 1394// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 1395// (google.protobuf.Empty); } The JSON representation for `Empty` is 1396// empty JSON object `{}`. 1397type Empty struct { 1398 // ServerResponse contains the HTTP response code and headers from the 1399 // server. 1400 googleapi.ServerResponse `json:"-"` 1401} 1402 1403// FailureInfo: A fatal problem encountered during the execution of the 1404// build. 1405type FailureInfo struct { 1406 // Detail: Explains the failure issue in more detail using hard-coded 1407 // text. 1408 Detail string `json:"detail,omitempty"` 1409 1410 // Type: The name of the failure. 1411 // 1412 // Possible values: 1413 // "FAILURE_TYPE_UNSPECIFIED" - Type unspecified 1414 // "PUSH_FAILED" - Unable to push the image to the repository. 1415 // "PUSH_IMAGE_NOT_FOUND" - Final image not found. 1416 // "PUSH_NOT_AUTHORIZED" - Unauthorized push of the final image. 1417 // "LOGGING_FAILURE" - Backend logging failures. Should retry. 1418 // "USER_BUILD_STEP" - A build step has failed. 1419 // "FETCH_SOURCE_FAILED" - The source fetching has failed. 1420 Type string `json:"type,omitempty"` 1421 1422 // ForceSendFields is a list of field names (e.g. "Detail") to 1423 // unconditionally include in API requests. By default, fields with 1424 // empty or default values are omitted from API requests. However, any 1425 // non-pointer, non-interface field appearing in ForceSendFields will be 1426 // sent to the server regardless of whether the field is empty or not. 1427 // This may be used to include empty fields in Patch requests. 1428 ForceSendFields []string `json:"-"` 1429 1430 // NullFields is a list of field names (e.g. "Detail") to include in API 1431 // requests with the JSON null value. By default, fields with empty 1432 // values are omitted from API requests. However, any field with an 1433 // empty value appearing in NullFields will be sent to the server as 1434 // null. It is an error if a field in this list has a non-empty value. 1435 // This may be used to include null fields in Patch requests. 1436 NullFields []string `json:"-"` 1437} 1438 1439func (s *FailureInfo) MarshalJSON() ([]byte, error) { 1440 type NoMethod FailureInfo 1441 raw := NoMethod(*s) 1442 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1443} 1444 1445// FileHashes: Container message for hashes of byte content of files, 1446// used in SourceProvenance messages to verify integrity of source input 1447// to the build. 1448type FileHashes struct { 1449 // FileHash: Collection of file hashes. 1450 FileHash []*Hash `json:"fileHash,omitempty"` 1451 1452 // ForceSendFields is a list of field names (e.g. "FileHash") to 1453 // unconditionally include in API requests. By default, fields with 1454 // empty or default values are omitted from API requests. However, any 1455 // non-pointer, non-interface field appearing in ForceSendFields will be 1456 // sent to the server regardless of whether the field is empty or not. 1457 // This may be used to include empty fields in Patch requests. 1458 ForceSendFields []string `json:"-"` 1459 1460 // NullFields is a list of field names (e.g. "FileHash") to include in 1461 // API requests with the JSON null value. By default, fields with empty 1462 // values are omitted from API requests. However, any field with an 1463 // empty value appearing in NullFields will be sent to the server as 1464 // null. It is an error if a field in this list has a non-empty value. 1465 // This may be used to include null fields in Patch requests. 1466 NullFields []string `json:"-"` 1467} 1468 1469func (s *FileHashes) MarshalJSON() ([]byte, error) { 1470 type NoMethod FileHashes 1471 raw := NoMethod(*s) 1472 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1473} 1474 1475// GitFileSource: GitFileSource describes a file within a (possibly 1476// remote) code repository. 1477type GitFileSource struct { 1478 // Path: The path of the file, with the repo root as the root of the 1479 // path. 1480 Path string `json:"path,omitempty"` 1481 1482 // RepoType: See RepoType above. 1483 // 1484 // Possible values: 1485 // "UNKNOWN" - The default, unknown repo type. 1486 // "CLOUD_SOURCE_REPOSITORIES" - A Google Cloud Source 1487 // Repositories-hosted repo. 1488 // "GITHUB" - A GitHub-hosted repo not necessarily on "github.com" 1489 // (i.e. GitHub Enterprise). 1490 RepoType string `json:"repoType,omitempty"` 1491 1492 // Revision: The branch, tag, arbitrary ref, or SHA version of the repo 1493 // to use when resolving the filename (optional). This field respects 1494 // the same syntax/resolution as described here: 1495 // https://git-scm.com/docs/gitrevisions If unspecified, the revision 1496 // from which the trigger invocation originated is assumed to be the 1497 // revision from which to read the specified path. 1498 Revision string `json:"revision,omitempty"` 1499 1500 // Uri: The URI of the repo (optional). If unspecified, the repo from 1501 // which the trigger invocation originated is assumed to be the repo 1502 // from which to read the specified path. 1503 Uri string `json:"uri,omitempty"` 1504 1505 // ForceSendFields is a list of field names (e.g. "Path") to 1506 // unconditionally include in API requests. By default, fields with 1507 // empty or default values are omitted from API requests. However, any 1508 // non-pointer, non-interface field appearing in ForceSendFields will be 1509 // sent to the server regardless of whether the field is empty or not. 1510 // This may be used to include empty fields in Patch requests. 1511 ForceSendFields []string `json:"-"` 1512 1513 // NullFields is a list of field names (e.g. "Path") to include in API 1514 // requests with the JSON null value. By default, fields with empty 1515 // values are omitted from API requests. However, any field with an 1516 // empty value appearing in NullFields will be sent to the server as 1517 // null. It is an error if a field in this list has a non-empty value. 1518 // This may be used to include null fields in Patch requests. 1519 NullFields []string `json:"-"` 1520} 1521 1522func (s *GitFileSource) MarshalJSON() ([]byte, error) { 1523 type NoMethod GitFileSource 1524 raw := NoMethod(*s) 1525 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1526} 1527 1528// GitHubEnterpriseConfig: GitHubEnterpriseConfig represents a 1529// configuration for a GitHub Enterprise server. 1530type GitHubEnterpriseConfig struct { 1531 // AppId: Required. The GitHub app id of the Cloud Build app on the 1532 // GitHub Enterprise server. 1533 AppId int64 `json:"appId,omitempty,string"` 1534 1535 // CreateTime: Output only. Time when the installation was associated 1536 // with the project. 1537 CreateTime string `json:"createTime,omitempty"` 1538 1539 // DisplayName: Name to display for this config. 1540 DisplayName string `json:"displayName,omitempty"` 1541 1542 // HostUrl: The URL of the github enterprise host the configuration is 1543 // for. 1544 HostUrl string `json:"hostUrl,omitempty"` 1545 1546 // Name: Optional. The full resource name for the GitHubEnterpriseConfig 1547 // For example: 1548 // "projects/{$project_id}/githubEnterpriseConfig/{$config_id}" 1549 Name string `json:"name,omitempty"` 1550 1551 // PeeredNetwork: Optional. The network to be used when reaching out to 1552 // the GitHub Enterprise server. The VPC network must be enabled for 1553 // private service connection. This should be set if the GitHub 1554 // Enterprise server is hosted on-premises and not reachable by public 1555 // internet. If this field is left empty, no network peering will occur 1556 // and calls to the GitHub Enterprise server will be made over the 1557 // public internet. Must be in the format 1558 // `projects/{project}/global/networks/{network}`, where {project} is a 1559 // project number or id and {network} is the name of a VPC network in 1560 // the project. 1561 PeeredNetwork string `json:"peeredNetwork,omitempty"` 1562 1563 // Secrets: Names of secrets in Secret Manager. 1564 Secrets *GitHubEnterpriseSecrets `json:"secrets,omitempty"` 1565 1566 // SslCa: Optional. SSL certificate to use for requests to GitHub 1567 // Enterprise. 1568 SslCa string `json:"sslCa,omitempty"` 1569 1570 // WebhookKey: The key that should be attached to webhook calls to the 1571 // ReceiveWebhook endpoint. 1572 WebhookKey string `json:"webhookKey,omitempty"` 1573 1574 // ServerResponse contains the HTTP response code and headers from the 1575 // server. 1576 googleapi.ServerResponse `json:"-"` 1577 1578 // ForceSendFields is a list of field names (e.g. "AppId") to 1579 // unconditionally include in API requests. By default, fields with 1580 // empty or default values are omitted from API requests. However, any 1581 // non-pointer, non-interface field appearing in ForceSendFields will be 1582 // sent to the server regardless of whether the field is empty or not. 1583 // This may be used to include empty fields in Patch requests. 1584 ForceSendFields []string `json:"-"` 1585 1586 // NullFields is a list of field names (e.g. "AppId") to include in API 1587 // requests with the JSON null value. By default, fields with empty 1588 // values are omitted from API requests. However, any field with an 1589 // empty value appearing in NullFields will be sent to the server as 1590 // null. It is an error if a field in this list has a non-empty value. 1591 // This may be used to include null fields in Patch requests. 1592 NullFields []string `json:"-"` 1593} 1594 1595func (s *GitHubEnterpriseConfig) MarshalJSON() ([]byte, error) { 1596 type NoMethod GitHubEnterpriseConfig 1597 raw := NoMethod(*s) 1598 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1599} 1600 1601// GitHubEnterpriseSecrets: GitHubEnterpriseSecrets represents the names 1602// of all necessary secrets in Secret Manager for a GitHub Enterprise 1603// server. Format is: projects//secrets/. 1604type GitHubEnterpriseSecrets struct { 1605 // OauthClientIdName: The resource name for the OAuth client ID secret 1606 // in Secret Manager. 1607 OauthClientIdName string `json:"oauthClientIdName,omitempty"` 1608 1609 // OauthClientIdVersionName: The resource name for the OAuth client ID 1610 // secret version in Secret Manager. 1611 OauthClientIdVersionName string `json:"oauthClientIdVersionName,omitempty"` 1612 1613 // OauthSecretName: The resource name for the OAuth secret in Secret 1614 // Manager. 1615 OauthSecretName string `json:"oauthSecretName,omitempty"` 1616 1617 // OauthSecretVersionName: The resource name for the OAuth secret secret 1618 // version in Secret Manager. 1619 OauthSecretVersionName string `json:"oauthSecretVersionName,omitempty"` 1620 1621 // PrivateKeyName: The resource name for the private key secret. 1622 PrivateKeyName string `json:"privateKeyName,omitempty"` 1623 1624 // PrivateKeyVersionName: The resource name for the private key secret 1625 // version. 1626 PrivateKeyVersionName string `json:"privateKeyVersionName,omitempty"` 1627 1628 // WebhookSecretName: The resource name for the webhook secret in Secret 1629 // Manager. 1630 WebhookSecretName string `json:"webhookSecretName,omitempty"` 1631 1632 // WebhookSecretVersionName: The resource name for the webhook secret 1633 // secret version in Secret Manager. 1634 WebhookSecretVersionName string `json:"webhookSecretVersionName,omitempty"` 1635 1636 // ForceSendFields is a list of field names (e.g. "OauthClientIdName") 1637 // to unconditionally include in API requests. By default, fields with 1638 // empty or default values are omitted from API requests. However, any 1639 // non-pointer, non-interface field appearing in ForceSendFields will be 1640 // sent to the server regardless of whether the field is empty or not. 1641 // This may be used to include empty fields in Patch requests. 1642 ForceSendFields []string `json:"-"` 1643 1644 // NullFields is a list of field names (e.g. "OauthClientIdName") to 1645 // include in API requests with the JSON null value. By default, fields 1646 // with empty values are omitted from API requests. However, any field 1647 // with an empty value appearing in NullFields will be sent to the 1648 // server as null. It is an error if a field in this list has a 1649 // non-empty value. This may be used to include null fields in Patch 1650 // requests. 1651 NullFields []string `json:"-"` 1652} 1653 1654func (s *GitHubEnterpriseSecrets) MarshalJSON() ([]byte, error) { 1655 type NoMethod GitHubEnterpriseSecrets 1656 raw := NoMethod(*s) 1657 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1658} 1659 1660// GitHubEventsConfig: GitHubEventsConfig describes the configuration of 1661// a trigger that creates a build whenever a GitHub event is received. 1662type GitHubEventsConfig struct { 1663 // EnterpriseConfigResourceName: Optional. The resource name of the 1664 // github enterprise config that should be applied to this installation. 1665 // For example: 1666 // "projects/{$project_id}/githubEnterpriseConfig/{$config_id}" 1667 EnterpriseConfigResourceName string `json:"enterpriseConfigResourceName,omitempty"` 1668 1669 // InstallationId: The installationID that emits the GitHub event. 1670 InstallationId int64 `json:"installationId,omitempty,string"` 1671 1672 // Name: Name of the repository. For example: The name for 1673 // https://github.com/googlecloudplatform/cloud-builders is 1674 // "cloud-builders". 1675 Name string `json:"name,omitempty"` 1676 1677 // Owner: Owner of the repository. For example: The owner for 1678 // https://github.com/googlecloudplatform/cloud-builders is 1679 // "googlecloudplatform". 1680 Owner string `json:"owner,omitempty"` 1681 1682 // PullRequest: filter to match changes in pull requests. 1683 PullRequest *PullRequestFilter `json:"pullRequest,omitempty"` 1684 1685 // Push: filter to match changes in refs like branches, tags. 1686 Push *PushFilter `json:"push,omitempty"` 1687 1688 // ForceSendFields is a list of field names (e.g. 1689 // "EnterpriseConfigResourceName") to unconditionally include in API 1690 // requests. By default, fields with empty or default values are omitted 1691 // from API requests. However, any non-pointer, non-interface field 1692 // appearing in ForceSendFields will be sent to the server regardless of 1693 // whether the field is empty or not. This may be used to include empty 1694 // fields in Patch requests. 1695 ForceSendFields []string `json:"-"` 1696 1697 // NullFields is a list of field names (e.g. 1698 // "EnterpriseConfigResourceName") to include in API requests with the 1699 // JSON null value. By default, fields with empty values are omitted 1700 // from API requests. However, any field with an empty value appearing 1701 // in NullFields will be sent to the server as null. It is an error if a 1702 // field in this list has a non-empty value. This may be used to include 1703 // null fields in Patch requests. 1704 NullFields []string `json:"-"` 1705} 1706 1707func (s *GitHubEventsConfig) MarshalJSON() ([]byte, error) { 1708 type NoMethod GitHubEventsConfig 1709 raw := NoMethod(*s) 1710 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1711} 1712 1713// GitRepoSource: GitRepoSource describes a repo and ref of a code 1714// repository. 1715type GitRepoSource struct { 1716 // Ref: The branch or tag to use. Must start with "refs/" (required). 1717 Ref string `json:"ref,omitempty"` 1718 1719 // RepoType: See RepoType below. 1720 // 1721 // Possible values: 1722 // "UNKNOWN" - The default, unknown repo type. 1723 // "CLOUD_SOURCE_REPOSITORIES" - A Google Cloud Source 1724 // Repositories-hosted repo. 1725 // "GITHUB" - A GitHub-hosted repo not necessarily on "github.com" 1726 // (i.e. GitHub Enterprise). 1727 RepoType string `json:"repoType,omitempty"` 1728 1729 // Uri: The URI of the repo (required). 1730 Uri string `json:"uri,omitempty"` 1731 1732 // ForceSendFields is a list of field names (e.g. "Ref") to 1733 // unconditionally include in API requests. By default, fields with 1734 // empty or default values are omitted from API requests. However, any 1735 // non-pointer, non-interface field appearing in ForceSendFields will be 1736 // sent to the server regardless of whether the field is empty or not. 1737 // This may be used to include empty fields in Patch requests. 1738 ForceSendFields []string `json:"-"` 1739 1740 // NullFields is a list of field names (e.g. "Ref") to include in API 1741 // requests with the JSON null value. By default, fields with empty 1742 // values are omitted from API requests. However, any field with an 1743 // empty value appearing in NullFields will be sent to the server as 1744 // null. It is an error if a field in this list has a non-empty value. 1745 // This may be used to include null fields in Patch requests. 1746 NullFields []string `json:"-"` 1747} 1748 1749func (s *GitRepoSource) MarshalJSON() ([]byte, error) { 1750 type NoMethod GitRepoSource 1751 raw := NoMethod(*s) 1752 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1753} 1754 1755// GoogleDevtoolsCloudbuildV2OperationMetadata: Represents the metadata 1756// of the long-running operation. 1757type GoogleDevtoolsCloudbuildV2OperationMetadata struct { 1758 // ApiVersion: Output only. API version used to start the operation. 1759 ApiVersion string `json:"apiVersion,omitempty"` 1760 1761 // CreateTime: Output only. The time the operation was created. 1762 CreateTime string `json:"createTime,omitempty"` 1763 1764 // EndTime: Output only. The time the operation finished running. 1765 EndTime string `json:"endTime,omitempty"` 1766 1767 // RequestedCancellation: Output only. Identifies whether the user has 1768 // requested cancellation of the operation. Operations that have 1769 // successfully been cancelled have Operation.error value with a 1770 // google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. 1771 RequestedCancellation bool `json:"requestedCancellation,omitempty"` 1772 1773 // StatusMessage: Output only. Human-readable status of the operation, 1774 // if any. 1775 StatusMessage string `json:"statusMessage,omitempty"` 1776 1777 // Target: Output only. Server-defined resource path for the target of 1778 // the operation. 1779 Target string `json:"target,omitempty"` 1780 1781 // Verb: Output only. Name of the verb executed by the operation. 1782 Verb string `json:"verb,omitempty"` 1783 1784 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 1785 // unconditionally include in API requests. By default, fields with 1786 // empty or default values are omitted from API requests. However, any 1787 // non-pointer, non-interface field appearing in ForceSendFields will be 1788 // sent to the server regardless of whether the field is empty or not. 1789 // This may be used to include empty fields in Patch requests. 1790 ForceSendFields []string `json:"-"` 1791 1792 // NullFields is a list of field names (e.g. "ApiVersion") to include in 1793 // API requests with the JSON null value. By default, fields with empty 1794 // values are omitted from API requests. However, any field with an 1795 // empty value appearing in NullFields will be sent to the server as 1796 // null. It is an error if a field in this list has a non-empty value. 1797 // This may be used to include null fields in Patch requests. 1798 NullFields []string `json:"-"` 1799} 1800 1801func (s *GoogleDevtoolsCloudbuildV2OperationMetadata) MarshalJSON() ([]byte, error) { 1802 type NoMethod GoogleDevtoolsCloudbuildV2OperationMetadata 1803 raw := NoMethod(*s) 1804 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1805} 1806 1807// HTTPDelivery: HTTPDelivery is the delivery configuration for an HTTP 1808// notification. 1809type HTTPDelivery struct { 1810 // Uri: The URI to which JSON-containing HTTP POST requests should be 1811 // sent. 1812 Uri string `json:"uri,omitempty"` 1813 1814 // ForceSendFields is a list of field names (e.g. "Uri") to 1815 // unconditionally include in API requests. By default, fields with 1816 // empty or default values are omitted from API requests. However, any 1817 // non-pointer, non-interface field appearing in ForceSendFields will be 1818 // sent to the server regardless of whether the field is empty or not. 1819 // This may be used to include empty fields in Patch requests. 1820 ForceSendFields []string `json:"-"` 1821 1822 // NullFields is a list of field names (e.g. "Uri") to include in API 1823 // requests with the JSON null value. By default, fields with empty 1824 // values are omitted from API requests. However, any field with an 1825 // empty value appearing in NullFields will be sent to the server as 1826 // null. It is an error if a field in this list has a non-empty value. 1827 // This may be used to include null fields in Patch requests. 1828 NullFields []string `json:"-"` 1829} 1830 1831func (s *HTTPDelivery) MarshalJSON() ([]byte, error) { 1832 type NoMethod HTTPDelivery 1833 raw := NoMethod(*s) 1834 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1835} 1836 1837// Hash: Container message for hash values. 1838type Hash struct { 1839 // Type: The type of hash that was performed. 1840 // 1841 // Possible values: 1842 // "NONE" - No hash requested. 1843 // "SHA256" - Use a sha256 hash. 1844 // "MD5" - Use a md5 hash. 1845 Type string `json:"type,omitempty"` 1846 1847 // Value: The hash value. 1848 Value string `json:"value,omitempty"` 1849 1850 // ForceSendFields is a list of field names (e.g. "Type") to 1851 // unconditionally include in API requests. By default, fields with 1852 // empty or default values are omitted from API requests. However, any 1853 // non-pointer, non-interface field appearing in ForceSendFields will be 1854 // sent to the server regardless of whether the field is empty or not. 1855 // This may be used to include empty fields in Patch requests. 1856 ForceSendFields []string `json:"-"` 1857 1858 // NullFields is a list of field names (e.g. "Type") to include in API 1859 // requests with the JSON null value. By default, fields with empty 1860 // values are omitted from API requests. However, any field with an 1861 // empty value appearing in NullFields will be sent to the server as 1862 // null. It is an error if a field in this list has a non-empty value. 1863 // This may be used to include null fields in Patch requests. 1864 NullFields []string `json:"-"` 1865} 1866 1867func (s *Hash) MarshalJSON() ([]byte, error) { 1868 type NoMethod Hash 1869 raw := NoMethod(*s) 1870 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1871} 1872 1873// HttpBody: Message that represents an arbitrary HTTP body. It should 1874// only be used for payload formats that can't be represented as JSON, 1875// such as raw binary or an HTML page. This message can be used both in 1876// streaming and non-streaming API methods in the request as well as the 1877// response. It can be used as a top-level request field, which is 1878// convenient if one wants to extract parameters from either the URL or 1879// HTTP template into the request fields and also want access to the raw 1880// HTTP body. Example: message GetResourceRequest { // A unique request 1881// id. string request_id = 1; // The raw HTTP body is bound to this 1882// field. google.api.HttpBody http_body = 2; } service ResourceService { 1883// rpc GetResource(GetResourceRequest) returns (google.api.HttpBody); 1884// rpc UpdateResource(google.api.HttpBody) returns 1885// (google.protobuf.Empty); } Example with streaming methods: service 1886// CaldavService { rpc GetCalendar(stream google.api.HttpBody) returns 1887// (stream google.api.HttpBody); rpc UpdateCalendar(stream 1888// google.api.HttpBody) returns (stream google.api.HttpBody); } Use of 1889// this type only changes how the request and response bodies are 1890// handled, all other features will continue to work unchanged. 1891type HttpBody struct { 1892 // ContentType: The HTTP Content-Type header value specifying the 1893 // content type of the body. 1894 ContentType string `json:"contentType,omitempty"` 1895 1896 // Data: The HTTP request/response body as raw binary. 1897 Data string `json:"data,omitempty"` 1898 1899 // Extensions: Application specific response metadata. Must be set in 1900 // the first response for streaming APIs. 1901 Extensions []googleapi.RawMessage `json:"extensions,omitempty"` 1902 1903 // ForceSendFields is a list of field names (e.g. "ContentType") to 1904 // unconditionally include in API requests. By default, fields with 1905 // empty or default values are omitted from API requests. However, any 1906 // non-pointer, non-interface field appearing in ForceSendFields will be 1907 // sent to the server regardless of whether the field is empty or not. 1908 // This may be used to include empty fields in Patch requests. 1909 ForceSendFields []string `json:"-"` 1910 1911 // NullFields is a list of field names (e.g. "ContentType") to include 1912 // in API requests with the JSON null value. By default, fields with 1913 // empty values are omitted from API requests. However, any field with 1914 // an empty value appearing in NullFields will be sent to the server as 1915 // null. It is an error if a field in this list has a non-empty value. 1916 // This may be used to include null fields in Patch requests. 1917 NullFields []string `json:"-"` 1918} 1919 1920func (s *HttpBody) MarshalJSON() ([]byte, error) { 1921 type NoMethod HttpBody 1922 raw := NoMethod(*s) 1923 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1924} 1925 1926// InlineSecret: Pairs a set of secret environment variables mapped to 1927// encrypted values with the Cloud KMS key to use to decrypt the value. 1928type InlineSecret struct { 1929 // EnvMap: Map of environment variable name to its encrypted value. 1930 // Secret environment variables must be unique across all of a build's 1931 // secrets, and must be used by at least one build step. Values can be 1932 // at most 64 KB in size. There can be at most 100 secret values across 1933 // all of a build's secrets. 1934 EnvMap map[string]string `json:"envMap,omitempty"` 1935 1936 // KmsKeyName: Resource name of Cloud KMS crypto key to decrypt the 1937 // encrypted value. In format: 1938 // projects/*/locations/*/keyRings/*/cryptoKeys/* 1939 KmsKeyName string `json:"kmsKeyName,omitempty"` 1940 1941 // ForceSendFields is a list of field names (e.g. "EnvMap") to 1942 // unconditionally include in API requests. By default, fields with 1943 // empty or default values are omitted from API requests. However, any 1944 // non-pointer, non-interface field appearing in ForceSendFields will be 1945 // sent to the server regardless of whether the field is empty or not. 1946 // This may be used to include empty fields in Patch requests. 1947 ForceSendFields []string `json:"-"` 1948 1949 // NullFields is a list of field names (e.g. "EnvMap") to include in API 1950 // requests with the JSON null value. By default, fields with empty 1951 // values are omitted from API requests. However, any field with an 1952 // empty value appearing in NullFields will be sent to the server as 1953 // null. It is an error if a field in this list has a non-empty value. 1954 // This may be used to include null fields in Patch requests. 1955 NullFields []string `json:"-"` 1956} 1957 1958func (s *InlineSecret) MarshalJSON() ([]byte, error) { 1959 type NoMethod InlineSecret 1960 raw := NoMethod(*s) 1961 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1962} 1963 1964// ListBuildTriggersResponse: Response containing existing 1965// `BuildTriggers`. 1966type ListBuildTriggersResponse struct { 1967 // NextPageToken: Token to receive the next page of results. 1968 NextPageToken string `json:"nextPageToken,omitempty"` 1969 1970 // Triggers: `BuildTriggers` for the project, sorted by `create_time` 1971 // descending. 1972 Triggers []*BuildTrigger `json:"triggers,omitempty"` 1973 1974 // ServerResponse contains the HTTP response code and headers from the 1975 // server. 1976 googleapi.ServerResponse `json:"-"` 1977 1978 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 1979 // unconditionally include in API requests. By default, fields with 1980 // empty or default values are omitted from API requests. However, any 1981 // non-pointer, non-interface field appearing in ForceSendFields will be 1982 // sent to the server regardless of whether the field is empty or not. 1983 // This may be used to include empty fields in Patch requests. 1984 ForceSendFields []string `json:"-"` 1985 1986 // NullFields is a list of field names (e.g. "NextPageToken") to include 1987 // in API requests with the JSON null value. By default, fields with 1988 // empty values are omitted from API requests. However, any field with 1989 // an empty value appearing in NullFields will be sent to the server as 1990 // null. It is an error if a field in this list has a non-empty value. 1991 // This may be used to include null fields in Patch requests. 1992 NullFields []string `json:"-"` 1993} 1994 1995func (s *ListBuildTriggersResponse) MarshalJSON() ([]byte, error) { 1996 type NoMethod ListBuildTriggersResponse 1997 raw := NoMethod(*s) 1998 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1999} 2000 2001// ListBuildsResponse: Response including listed builds. 2002type ListBuildsResponse struct { 2003 // Builds: Builds will be sorted by `create_time`, descending. 2004 Builds []*Build `json:"builds,omitempty"` 2005 2006 // NextPageToken: Token to receive the next page of results. This will 2007 // be absent if the end of the response list has been reached. 2008 NextPageToken string `json:"nextPageToken,omitempty"` 2009 2010 // ServerResponse contains the HTTP response code and headers from the 2011 // server. 2012 googleapi.ServerResponse `json:"-"` 2013 2014 // ForceSendFields is a list of field names (e.g. "Builds") to 2015 // unconditionally include in API requests. By default, fields with 2016 // empty or default values are omitted from API requests. However, any 2017 // non-pointer, non-interface field appearing in ForceSendFields will be 2018 // sent to the server regardless of whether the field is empty or not. 2019 // This may be used to include empty fields in Patch requests. 2020 ForceSendFields []string `json:"-"` 2021 2022 // NullFields is a list of field names (e.g. "Builds") to include in API 2023 // requests with the JSON null value. By default, fields with empty 2024 // values are omitted from API requests. However, any field with an 2025 // empty value appearing in NullFields will be sent to the server as 2026 // null. It is an error if a field in this list has a non-empty value. 2027 // This may be used to include null fields in Patch requests. 2028 NullFields []string `json:"-"` 2029} 2030 2031func (s *ListBuildsResponse) MarshalJSON() ([]byte, error) { 2032 type NoMethod ListBuildsResponse 2033 raw := NoMethod(*s) 2034 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2035} 2036 2037// ListGithubEnterpriseConfigsResponse: RPC response object returned by 2038// ListGithubEnterpriseConfigs RPC method. 2039type ListGithubEnterpriseConfigsResponse struct { 2040 // Configs: A list of GitHubEnterpriseConfigs 2041 Configs []*GitHubEnterpriseConfig `json:"configs,omitempty"` 2042 2043 // ServerResponse contains the HTTP response code and headers from the 2044 // server. 2045 googleapi.ServerResponse `json:"-"` 2046 2047 // ForceSendFields is a list of field names (e.g. "Configs") to 2048 // unconditionally include in API requests. By default, fields with 2049 // empty or default values are omitted from API requests. However, any 2050 // non-pointer, non-interface field appearing in ForceSendFields will be 2051 // sent to the server regardless of whether the field is empty or not. 2052 // This may be used to include empty fields in Patch requests. 2053 ForceSendFields []string `json:"-"` 2054 2055 // NullFields is a list of field names (e.g. "Configs") to include in 2056 // API requests with the JSON null value. By default, fields with empty 2057 // values are omitted from API requests. However, any field with an 2058 // empty value appearing in NullFields will be sent to the server as 2059 // null. It is an error if a field in this list has a non-empty value. 2060 // This may be used to include null fields in Patch requests. 2061 NullFields []string `json:"-"` 2062} 2063 2064func (s *ListGithubEnterpriseConfigsResponse) MarshalJSON() ([]byte, error) { 2065 type NoMethod ListGithubEnterpriseConfigsResponse 2066 raw := NoMethod(*s) 2067 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2068} 2069 2070// ListWorkerPoolsResponse: Response containing existing `WorkerPools`. 2071type ListWorkerPoolsResponse struct { 2072 // NextPageToken: Continuation token used to page through large result 2073 // sets. Provide this value in a subsequent ListWorkerPoolsRequest to 2074 // return the next page of results. 2075 NextPageToken string `json:"nextPageToken,omitempty"` 2076 2077 // WorkerPools: `WorkerPools` for the specified project. 2078 WorkerPools []*WorkerPool `json:"workerPools,omitempty"` 2079 2080 // ServerResponse contains the HTTP response code and headers from the 2081 // server. 2082 googleapi.ServerResponse `json:"-"` 2083 2084 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2085 // unconditionally include in API requests. By default, fields with 2086 // empty or default values are omitted from API requests. However, any 2087 // non-pointer, non-interface field appearing in ForceSendFields will be 2088 // sent to the server regardless of whether the field is empty or not. 2089 // This may be used to include empty fields in Patch requests. 2090 ForceSendFields []string `json:"-"` 2091 2092 // NullFields is a list of field names (e.g. "NextPageToken") to include 2093 // in API requests with the JSON null value. By default, fields with 2094 // empty values are omitted from API requests. However, any field with 2095 // an empty value appearing in NullFields will be sent to the server as 2096 // null. It is an error if a field in this list has a non-empty value. 2097 // This may be used to include null fields in Patch requests. 2098 NullFields []string `json:"-"` 2099} 2100 2101func (s *ListWorkerPoolsResponse) MarshalJSON() ([]byte, error) { 2102 type NoMethod ListWorkerPoolsResponse 2103 raw := NoMethod(*s) 2104 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2105} 2106 2107// NetworkConfig: Defines the network configuration for the pool. 2108type NetworkConfig struct { 2109 // EgressOption: Option to configure network egress for the workers. 2110 // 2111 // Possible values: 2112 // "EGRESS_OPTION_UNSPECIFIED" - If set, defaults to PUBLIC_EGRESS. 2113 // "NO_PUBLIC_EGRESS" - If set, workers are created without any public 2114 // address, which prevents network egress to public IPs unless a network 2115 // proxy is configured. 2116 // "PUBLIC_EGRESS" - If set, workers are created with a public address 2117 // which allows for public internet egress. 2118 EgressOption string `json:"egressOption,omitempty"` 2119 2120 // PeeredNetwork: Required. Immutable. The network definition that the 2121 // workers are peered to. If this section is left empty, the workers 2122 // will be peered to `WorkerPool.project_id` on the service producer 2123 // network. Must be in the format 2124 // `projects/{project}/global/networks/{network}`, where `{project}` is 2125 // a project number, such as `12345`, and `{network}` is the name of a 2126 // VPC network in the project. See Understanding network configuration 2127 // options 2128 // (https://cloud.google.com/build/docs/private-pools/set-up-private-pool-environment) 2129 PeeredNetwork string `json:"peeredNetwork,omitempty"` 2130 2131 // ForceSendFields is a list of field names (e.g. "EgressOption") to 2132 // unconditionally include in API requests. By default, fields with 2133 // empty or default values are omitted from API requests. However, any 2134 // non-pointer, non-interface field appearing in ForceSendFields will be 2135 // sent to the server regardless of whether the field is empty or not. 2136 // This may be used to include empty fields in Patch requests. 2137 ForceSendFields []string `json:"-"` 2138 2139 // NullFields is a list of field names (e.g. "EgressOption") to include 2140 // in API requests with the JSON null value. By default, fields with 2141 // empty values are omitted from API requests. However, any field with 2142 // an empty value appearing in NullFields will be sent to the server as 2143 // null. It is an error if a field in this list has a non-empty value. 2144 // This may be used to include null fields in Patch requests. 2145 NullFields []string `json:"-"` 2146} 2147 2148func (s *NetworkConfig) MarshalJSON() ([]byte, error) { 2149 type NoMethod NetworkConfig 2150 raw := NoMethod(*s) 2151 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2152} 2153 2154// Notification: Notification is the container which holds the data that 2155// is relevant to this particular notification. 2156type Notification struct { 2157 // Filter: The filter string to use for notification filtering. 2158 // Currently, this is assumed to be a CEL program. See 2159 // https://opensource.google/projects/cel for more. 2160 Filter string `json:"filter,omitempty"` 2161 2162 // HttpDelivery: Configuration for HTTP delivery. 2163 HttpDelivery *HTTPDelivery `json:"httpDelivery,omitempty"` 2164 2165 // SlackDelivery: Configuration for Slack delivery. 2166 SlackDelivery *SlackDelivery `json:"slackDelivery,omitempty"` 2167 2168 // SmtpDelivery: Configuration for SMTP (email) delivery. 2169 SmtpDelivery *SMTPDelivery `json:"smtpDelivery,omitempty"` 2170 2171 // StructDelivery: Escape hatch for users to supply custom delivery 2172 // configs. 2173 StructDelivery googleapi.RawMessage `json:"structDelivery,omitempty"` 2174 2175 // ForceSendFields is a list of field names (e.g. "Filter") to 2176 // unconditionally include in API requests. By default, fields with 2177 // empty or default values are omitted from API requests. However, any 2178 // non-pointer, non-interface field appearing in ForceSendFields will be 2179 // sent to the server regardless of whether the field is empty or not. 2180 // This may be used to include empty fields in Patch requests. 2181 ForceSendFields []string `json:"-"` 2182 2183 // NullFields is a list of field names (e.g. "Filter") to include in API 2184 // requests with the JSON null value. By default, fields with empty 2185 // values are omitted from API requests. However, any field with an 2186 // empty value appearing in NullFields will be sent to the server as 2187 // null. It is an error if a field in this list has a non-empty value. 2188 // This may be used to include null fields in Patch requests. 2189 NullFields []string `json:"-"` 2190} 2191 2192func (s *Notification) MarshalJSON() ([]byte, error) { 2193 type NoMethod Notification 2194 raw := NoMethod(*s) 2195 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2196} 2197 2198// NotifierConfig: NotifierConfig is the top-level configuration 2199// message. 2200type NotifierConfig struct { 2201 // ApiVersion: The API version of this configuration format. 2202 ApiVersion string `json:"apiVersion,omitempty"` 2203 2204 // Kind: The type of notifier to use (e.g. SMTPNotifier). 2205 Kind string `json:"kind,omitempty"` 2206 2207 // Metadata: Metadata for referring to/handling/deploying this notifier. 2208 Metadata *NotifierMetadata `json:"metadata,omitempty"` 2209 2210 // Spec: The actual configuration for this notifier. 2211 Spec *NotifierSpec `json:"spec,omitempty"` 2212 2213 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 2214 // unconditionally include in API requests. By default, fields with 2215 // empty or default values are omitted from API requests. However, any 2216 // non-pointer, non-interface field appearing in ForceSendFields will be 2217 // sent to the server regardless of whether the field is empty or not. 2218 // This may be used to include empty fields in Patch requests. 2219 ForceSendFields []string `json:"-"` 2220 2221 // NullFields is a list of field names (e.g. "ApiVersion") to include in 2222 // API requests with the JSON null value. By default, fields with empty 2223 // values are omitted from API requests. However, any field with an 2224 // empty value appearing in NullFields will be sent to the server as 2225 // null. It is an error if a field in this list has a non-empty value. 2226 // This may be used to include null fields in Patch requests. 2227 NullFields []string `json:"-"` 2228} 2229 2230func (s *NotifierConfig) MarshalJSON() ([]byte, error) { 2231 type NoMethod NotifierConfig 2232 raw := NoMethod(*s) 2233 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2234} 2235 2236// NotifierMetadata: NotifierMetadata contains the data which can be 2237// used to reference or describe this notifier. 2238type NotifierMetadata struct { 2239 // Name: The human-readable and user-given name for the notifier. For 2240 // example: "repo-merge-email-notifier". 2241 Name string `json:"name,omitempty"` 2242 2243 // Notifier: The string representing the name and version of notifier to 2244 // deploy. Expected to be of the form of "/:". For example: 2245 // "gcr.io/my-project/notifiers/smtp:1.2.34". 2246 Notifier string `json:"notifier,omitempty"` 2247 2248 // ForceSendFields is a list of field names (e.g. "Name") to 2249 // unconditionally include in API requests. By default, fields with 2250 // empty or default values are omitted from API requests. However, any 2251 // non-pointer, non-interface field appearing in ForceSendFields will be 2252 // sent to the server regardless of whether the field is empty or not. 2253 // This may be used to include empty fields in Patch requests. 2254 ForceSendFields []string `json:"-"` 2255 2256 // NullFields is a list of field names (e.g. "Name") to include in API 2257 // requests with the JSON null value. By default, fields with empty 2258 // values are omitted from API requests. However, any field with an 2259 // empty value appearing in NullFields will be sent to the server as 2260 // null. It is an error if a field in this list has a non-empty value. 2261 // This may be used to include null fields in Patch requests. 2262 NullFields []string `json:"-"` 2263} 2264 2265func (s *NotifierMetadata) MarshalJSON() ([]byte, error) { 2266 type NoMethod NotifierMetadata 2267 raw := NoMethod(*s) 2268 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2269} 2270 2271// NotifierSecret: NotifierSecret is the container that maps a secret 2272// name (reference) to its Google Cloud Secret Manager resource path. 2273type NotifierSecret struct { 2274 // Name: Name is the local name of the secret, such as the verbatim 2275 // string "my-smtp-password". 2276 Name string `json:"name,omitempty"` 2277 2278 // Value: Value is interpreted to be a resource path for fetching the 2279 // actual (versioned) secret data for this secret. For example, this 2280 // would be a Google Cloud Secret Manager secret version resource path 2281 // like: "projects/my-project/secrets/my-secret/versions/latest". 2282 Value string `json:"value,omitempty"` 2283 2284 // ForceSendFields is a list of field names (e.g. "Name") to 2285 // unconditionally include in API requests. By default, fields with 2286 // empty or default values are omitted from API requests. However, any 2287 // non-pointer, non-interface field appearing in ForceSendFields will be 2288 // sent to the server regardless of whether the field is empty or not. 2289 // This may be used to include empty fields in Patch requests. 2290 ForceSendFields []string `json:"-"` 2291 2292 // NullFields is a list of field names (e.g. "Name") to include in API 2293 // requests with the JSON null value. By default, fields with empty 2294 // values are omitted from API requests. However, any field with an 2295 // empty value appearing in NullFields will be sent to the server as 2296 // null. It is an error if a field in this list has a non-empty value. 2297 // This may be used to include null fields in Patch requests. 2298 NullFields []string `json:"-"` 2299} 2300 2301func (s *NotifierSecret) MarshalJSON() ([]byte, error) { 2302 type NoMethod NotifierSecret 2303 raw := NoMethod(*s) 2304 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2305} 2306 2307// NotifierSecretRef: NotifierSecretRef contains the reference to a 2308// secret stored in the corresponding NotifierSpec. 2309type NotifierSecretRef struct { 2310 // SecretRef: The value of `secret_ref` should be a `name` that is 2311 // registered in a `Secret` in the `secrets` list of the `Spec`. 2312 SecretRef string `json:"secretRef,omitempty"` 2313 2314 // ForceSendFields is a list of field names (e.g. "SecretRef") to 2315 // unconditionally include in API requests. By default, fields with 2316 // empty or default values are omitted from API requests. However, any 2317 // non-pointer, non-interface field appearing in ForceSendFields will be 2318 // sent to the server regardless of whether the field is empty or not. 2319 // This may be used to include empty fields in Patch requests. 2320 ForceSendFields []string `json:"-"` 2321 2322 // NullFields is a list of field names (e.g. "SecretRef") to include in 2323 // API requests with the JSON null value. By default, fields with empty 2324 // values are omitted from API requests. However, any field with an 2325 // empty value appearing in NullFields will be sent to the server as 2326 // null. It is an error if a field in this list has a non-empty value. 2327 // This may be used to include null fields in Patch requests. 2328 NullFields []string `json:"-"` 2329} 2330 2331func (s *NotifierSecretRef) MarshalJSON() ([]byte, error) { 2332 type NoMethod NotifierSecretRef 2333 raw := NoMethod(*s) 2334 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2335} 2336 2337// NotifierSpec: NotifierSpec is the configuration container for 2338// notifications. 2339type NotifierSpec struct { 2340 // Notification: The configuration of this particular notifier. 2341 Notification *Notification `json:"notification,omitempty"` 2342 2343 // Secrets: Configurations for secret resources used by this particular 2344 // notifier. 2345 Secrets []*NotifierSecret `json:"secrets,omitempty"` 2346 2347 // ForceSendFields is a list of field names (e.g. "Notification") to 2348 // unconditionally include in API requests. By default, fields with 2349 // empty or default values are omitted from API requests. However, any 2350 // non-pointer, non-interface field appearing in ForceSendFields will be 2351 // sent to the server regardless of whether the field is empty or not. 2352 // This may be used to include empty fields in Patch requests. 2353 ForceSendFields []string `json:"-"` 2354 2355 // NullFields is a list of field names (e.g. "Notification") to include 2356 // in API requests with the JSON null value. By default, fields with 2357 // empty values are omitted from API requests. However, any field with 2358 // an empty value appearing in NullFields will be sent to the server as 2359 // null. It is an error if a field in this list has a non-empty value. 2360 // This may be used to include null fields in Patch requests. 2361 NullFields []string `json:"-"` 2362} 2363 2364func (s *NotifierSpec) MarshalJSON() ([]byte, error) { 2365 type NoMethod NotifierSpec 2366 raw := NoMethod(*s) 2367 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2368} 2369 2370// Operation: This resource represents a long-running operation that is 2371// the result of a network API call. 2372type Operation struct { 2373 // Done: If the value is `false`, it means the operation is still in 2374 // progress. If `true`, the operation is completed, and either `error` 2375 // or `response` is available. 2376 Done bool `json:"done,omitempty"` 2377 2378 // Error: The error result of the operation in case of failure or 2379 // cancellation. 2380 Error *Status `json:"error,omitempty"` 2381 2382 // Metadata: Service-specific metadata associated with the operation. It 2383 // typically contains progress information and common metadata such as 2384 // create time. Some services might not provide such metadata. Any 2385 // method that returns a long-running operation should document the 2386 // metadata type, if any. 2387 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 2388 2389 // Name: The server-assigned name, which is only unique within the same 2390 // service that originally returns it. If you use the default HTTP 2391 // mapping, the `name` should be a resource name ending with 2392 // `operations/{unique_id}`. 2393 Name string `json:"name,omitempty"` 2394 2395 // Response: The normal response of the operation in case of success. If 2396 // the original method returns no data on success, such as `Delete`, the 2397 // response is `google.protobuf.Empty`. If the original method is 2398 // standard `Get`/`Create`/`Update`, the response should be the 2399 // resource. For other methods, the response should have the type 2400 // `XxxResponse`, where `Xxx` is the original method name. For example, 2401 // if the original method name is `TakeSnapshot()`, the inferred 2402 // response type is `TakeSnapshotResponse`. 2403 Response googleapi.RawMessage `json:"response,omitempty"` 2404 2405 // ServerResponse contains the HTTP response code and headers from the 2406 // server. 2407 googleapi.ServerResponse `json:"-"` 2408 2409 // ForceSendFields is a list of field names (e.g. "Done") to 2410 // unconditionally include in API requests. By default, fields with 2411 // empty or default values are omitted from API requests. However, any 2412 // non-pointer, non-interface field appearing in ForceSendFields will be 2413 // sent to the server regardless of whether the field is empty or not. 2414 // This may be used to include empty fields in Patch requests. 2415 ForceSendFields []string `json:"-"` 2416 2417 // NullFields is a list of field names (e.g. "Done") to include in API 2418 // requests with the JSON null value. By default, fields with empty 2419 // values are omitted from API requests. However, any field with an 2420 // empty value appearing in NullFields will be sent to the server as 2421 // null. It is an error if a field in this list has a non-empty value. 2422 // This may be used to include null fields in Patch requests. 2423 NullFields []string `json:"-"` 2424} 2425 2426func (s *Operation) MarshalJSON() ([]byte, error) { 2427 type NoMethod Operation 2428 raw := NoMethod(*s) 2429 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2430} 2431 2432// OperationMetadata: Represents the metadata of the long-running 2433// operation. 2434type OperationMetadata struct { 2435 // ApiVersion: Output only. API version used to start the operation. 2436 ApiVersion string `json:"apiVersion,omitempty"` 2437 2438 // CancelRequested: Output only. Identifies whether the user has 2439 // requested cancellation of the operation. Operations that have been 2440 // cancelled successfully have Operation.error value with a 2441 // google.rpc.Status.code of 1, corresponding to `Code.CANCELLED`. 2442 CancelRequested bool `json:"cancelRequested,omitempty"` 2443 2444 // CreateTime: Output only. The time the operation was created. 2445 CreateTime string `json:"createTime,omitempty"` 2446 2447 // EndTime: Output only. The time the operation finished running. 2448 EndTime string `json:"endTime,omitempty"` 2449 2450 // StatusDetail: Output only. Human-readable status of the operation, if 2451 // any. 2452 StatusDetail string `json:"statusDetail,omitempty"` 2453 2454 // Target: Output only. Server-defined resource path for the target of 2455 // the operation. 2456 Target string `json:"target,omitempty"` 2457 2458 // Verb: Output only. Name of the verb executed by the operation. 2459 Verb string `json:"verb,omitempty"` 2460 2461 // ForceSendFields is a list of field names (e.g. "ApiVersion") to 2462 // unconditionally include in API requests. By default, fields with 2463 // empty or default values are omitted from API requests. However, any 2464 // non-pointer, non-interface field appearing in ForceSendFields will be 2465 // sent to the server regardless of whether the field is empty or not. 2466 // This may be used to include empty fields in Patch requests. 2467 ForceSendFields []string `json:"-"` 2468 2469 // NullFields is a list of field names (e.g. "ApiVersion") to include in 2470 // API requests with the JSON null value. By default, fields with empty 2471 // values are omitted from API requests. However, any field with an 2472 // empty value appearing in NullFields will be sent to the server as 2473 // null. It is an error if a field in this list has a non-empty value. 2474 // This may be used to include null fields in Patch requests. 2475 NullFields []string `json:"-"` 2476} 2477 2478func (s *OperationMetadata) MarshalJSON() ([]byte, error) { 2479 type NoMethod OperationMetadata 2480 raw := NoMethod(*s) 2481 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2482} 2483 2484// PoolOption: Details about how a build should be executed on a 2485// `WorkerPool`. See running builds in a private pool 2486// (https://cloud.google.com/build/docs/private-pools/run-builds-in-private-pool) 2487// for more information. 2488type PoolOption struct { 2489 // Name: The `WorkerPool` resource to execute the build on. You must 2490 // have `cloudbuild.workerpools.use` on the project hosting the 2491 // WorkerPool. Format 2492 // projects/{project}/locations/{location}/workerPools/{workerPoolId} 2493 Name string `json:"name,omitempty"` 2494 2495 // ForceSendFields is a list of field names (e.g. "Name") to 2496 // unconditionally include in API requests. By default, fields with 2497 // empty or default values are omitted from API requests. However, any 2498 // non-pointer, non-interface field appearing in ForceSendFields will be 2499 // sent to the server regardless of whether the field is empty or not. 2500 // This may be used to include empty fields in Patch requests. 2501 ForceSendFields []string `json:"-"` 2502 2503 // NullFields is a list of field names (e.g. "Name") to include in API 2504 // requests with the JSON null value. By default, fields with empty 2505 // values are omitted from API requests. However, any field with an 2506 // empty value appearing in NullFields will be sent to the server as 2507 // null. It is an error if a field in this list has a non-empty value. 2508 // This may be used to include null fields in Patch requests. 2509 NullFields []string `json:"-"` 2510} 2511 2512func (s *PoolOption) MarshalJSON() ([]byte, error) { 2513 type NoMethod PoolOption 2514 raw := NoMethod(*s) 2515 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2516} 2517 2518// PrivatePoolV1Config: Configuration for a V1 `PrivatePool`. 2519type PrivatePoolV1Config struct { 2520 // NetworkConfig: Network configuration for the pool. 2521 NetworkConfig *NetworkConfig `json:"networkConfig,omitempty"` 2522 2523 // WorkerConfig: Machine configuration for the workers in the pool. 2524 WorkerConfig *WorkerConfig `json:"workerConfig,omitempty"` 2525 2526 // ForceSendFields is a list of field names (e.g. "NetworkConfig") to 2527 // unconditionally include in API requests. By default, fields with 2528 // empty or default values are omitted from API requests. However, any 2529 // non-pointer, non-interface field appearing in ForceSendFields will be 2530 // sent to the server regardless of whether the field is empty or not. 2531 // This may be used to include empty fields in Patch requests. 2532 ForceSendFields []string `json:"-"` 2533 2534 // NullFields is a list of field names (e.g. "NetworkConfig") to include 2535 // in API requests with the JSON null value. By default, fields with 2536 // empty values are omitted from API requests. However, any field with 2537 // an empty value appearing in NullFields will be sent to the server as 2538 // null. It is an error if a field in this list has a non-empty value. 2539 // This may be used to include null fields in Patch requests. 2540 NullFields []string `json:"-"` 2541} 2542 2543func (s *PrivatePoolV1Config) MarshalJSON() ([]byte, error) { 2544 type NoMethod PrivatePoolV1Config 2545 raw := NoMethod(*s) 2546 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2547} 2548 2549// ProcessAppManifestCallbackOperationMetadata: Metadata for 2550// `ProcessAppManifestCallback` operation. 2551type ProcessAppManifestCallbackOperationMetadata struct { 2552 // CompleteTime: Time the operation was completed. 2553 CompleteTime string `json:"completeTime,omitempty"` 2554 2555 // CreateTime: Time the operation was created. 2556 CreateTime string `json:"createTime,omitempty"` 2557 2558 // GithubEnterpriseConfig: The resource name of the GitHubEnterprise to 2559 // be created. Format: 2560 // `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}` 2561 // . 2562 GithubEnterpriseConfig string `json:"githubEnterpriseConfig,omitempty"` 2563 2564 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 2565 // unconditionally include in API requests. By default, fields with 2566 // empty or default values are omitted from API requests. However, any 2567 // non-pointer, non-interface field appearing in ForceSendFields will be 2568 // sent to the server regardless of whether the field is empty or not. 2569 // This may be used to include empty fields in Patch requests. 2570 ForceSendFields []string `json:"-"` 2571 2572 // NullFields is a list of field names (e.g. "CompleteTime") to include 2573 // in API requests with the JSON null value. By default, fields with 2574 // empty values are omitted from API requests. However, any field with 2575 // an empty value appearing in NullFields will be sent to the server as 2576 // null. It is an error if a field in this list has a non-empty value. 2577 // This may be used to include null fields in Patch requests. 2578 NullFields []string `json:"-"` 2579} 2580 2581func (s *ProcessAppManifestCallbackOperationMetadata) MarshalJSON() ([]byte, error) { 2582 type NoMethod ProcessAppManifestCallbackOperationMetadata 2583 raw := NoMethod(*s) 2584 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2585} 2586 2587// PubsubConfig: PubsubConfig describes the configuration of a trigger 2588// that creates a build whenever a Pub/Sub message is published. 2589type PubsubConfig struct { 2590 // ServiceAccountEmail: Service account that will make the push request. 2591 ServiceAccountEmail string `json:"serviceAccountEmail,omitempty"` 2592 2593 // State: Potential issues with the underlying Pub/Sub subscription 2594 // configuration. Only populated on get requests. 2595 // 2596 // Possible values: 2597 // "STATE_UNSPECIFIED" - The subscription configuration has not been 2598 // checked. 2599 // "OK" - The Pub/Sub subscription is properly configured. 2600 // "SUBSCRIPTION_DELETED" - The subscription has been deleted. 2601 // "TOPIC_DELETED" - The topic has been deleted. 2602 // "SUBSCRIPTION_MISCONFIGURED" - Some of the subscription's field are 2603 // misconfigured. 2604 State string `json:"state,omitempty"` 2605 2606 // Subscription: Output only. Name of the subscription. Format is 2607 // `projects/{project}/subscriptions/{subscription}`. 2608 Subscription string `json:"subscription,omitempty"` 2609 2610 // Topic: The name of the topic from which this subscription is 2611 // receiving messages. Format is `projects/{project}/topics/{topic}`. 2612 Topic string `json:"topic,omitempty"` 2613 2614 // ForceSendFields is a list of field names (e.g. "ServiceAccountEmail") 2615 // to unconditionally include in API requests. By default, fields with 2616 // empty or default values are omitted from API requests. However, any 2617 // non-pointer, non-interface field appearing in ForceSendFields will be 2618 // sent to the server regardless of whether the field is empty or not. 2619 // This may be used to include empty fields in Patch requests. 2620 ForceSendFields []string `json:"-"` 2621 2622 // NullFields is a list of field names (e.g. "ServiceAccountEmail") to 2623 // include in API requests with the JSON null value. By default, fields 2624 // with empty values are omitted from API requests. However, any field 2625 // with an empty value appearing in NullFields will be sent to the 2626 // server as null. It is an error if a field in this list has a 2627 // non-empty value. This may be used to include null fields in Patch 2628 // requests. 2629 NullFields []string `json:"-"` 2630} 2631 2632func (s *PubsubConfig) MarshalJSON() ([]byte, error) { 2633 type NoMethod PubsubConfig 2634 raw := NoMethod(*s) 2635 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2636} 2637 2638// PullRequestFilter: PullRequestFilter contains filter properties for 2639// matching GitHub Pull Requests. 2640type PullRequestFilter struct { 2641 // Branch: Regex of branches to match. The syntax of the regular 2642 // expressions accepted is the syntax accepted by RE2 and described at 2643 // https://github.com/google/re2/wiki/Syntax 2644 Branch string `json:"branch,omitempty"` 2645 2646 // CommentControl: Configure builds to run whether a repository owner or 2647 // collaborator need to comment `/gcbrun`. 2648 // 2649 // Possible values: 2650 // "COMMENTS_DISABLED" - Do not require comments on Pull Requests 2651 // before builds are triggered. 2652 // "COMMENTS_ENABLED" - Enforce that repository owners or 2653 // collaborators must comment on Pull Requests before builds are 2654 // triggered. 2655 // "COMMENTS_ENABLED_FOR_EXTERNAL_CONTRIBUTORS_ONLY" - Enforce that 2656 // repository owners or collaborators must comment on external 2657 // contributors' Pull Requests before builds are triggered. 2658 CommentControl string `json:"commentControl,omitempty"` 2659 2660 // InvertRegex: If true, branches that do NOT match the git_ref will 2661 // trigger a build. 2662 InvertRegex bool `json:"invertRegex,omitempty"` 2663 2664 // ForceSendFields is a list of field names (e.g. "Branch") to 2665 // unconditionally include in API requests. By default, fields with 2666 // empty or default values are omitted from API requests. However, any 2667 // non-pointer, non-interface field appearing in ForceSendFields will be 2668 // sent to the server regardless of whether the field is empty or not. 2669 // This may be used to include empty fields in Patch requests. 2670 ForceSendFields []string `json:"-"` 2671 2672 // NullFields is a list of field names (e.g. "Branch") to include in API 2673 // requests with the JSON null value. By default, fields with empty 2674 // values are omitted from API requests. However, any field with an 2675 // empty value appearing in NullFields will be sent to the server as 2676 // null. It is an error if a field in this list has a non-empty value. 2677 // This may be used to include null fields in Patch requests. 2678 NullFields []string `json:"-"` 2679} 2680 2681func (s *PullRequestFilter) MarshalJSON() ([]byte, error) { 2682 type NoMethod PullRequestFilter 2683 raw := NoMethod(*s) 2684 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2685} 2686 2687// PushFilter: Push contains filter properties for matching GitHub git 2688// pushes. 2689type PushFilter struct { 2690 // Branch: Regexes matching branches to build. The syntax of the regular 2691 // expressions accepted is the syntax accepted by RE2 and described at 2692 // https://github.com/google/re2/wiki/Syntax 2693 Branch string `json:"branch,omitempty"` 2694 2695 // InvertRegex: When true, only trigger a build if the revision regex 2696 // does NOT match the git_ref regex. 2697 InvertRegex bool `json:"invertRegex,omitempty"` 2698 2699 // Tag: Regexes matching tags to build. The syntax of the regular 2700 // expressions accepted is the syntax accepted by RE2 and described at 2701 // https://github.com/google/re2/wiki/Syntax 2702 Tag string `json:"tag,omitempty"` 2703 2704 // ForceSendFields is a list of field names (e.g. "Branch") to 2705 // unconditionally include in API requests. By default, fields with 2706 // empty or default values are omitted from API requests. However, any 2707 // non-pointer, non-interface field appearing in ForceSendFields will be 2708 // sent to the server regardless of whether the field is empty or not. 2709 // This may be used to include empty fields in Patch requests. 2710 ForceSendFields []string `json:"-"` 2711 2712 // NullFields is a list of field names (e.g. "Branch") to include in API 2713 // requests with the JSON null value. By default, fields with empty 2714 // values are omitted from API requests. However, any field with an 2715 // empty value appearing in NullFields will be sent to the server as 2716 // null. It is an error if a field in this list has a non-empty value. 2717 // This may be used to include null fields in Patch requests. 2718 NullFields []string `json:"-"` 2719} 2720 2721func (s *PushFilter) MarshalJSON() ([]byte, error) { 2722 type NoMethod PushFilter 2723 raw := NoMethod(*s) 2724 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2725} 2726 2727// ReceiveTriggerWebhookResponse: ReceiveTriggerWebhookResponse 2728// [Experimental] is the response object for the ReceiveTriggerWebhook 2729// method. 2730type ReceiveTriggerWebhookResponse struct { 2731 // ServerResponse contains the HTTP response code and headers from the 2732 // server. 2733 googleapi.ServerResponse `json:"-"` 2734} 2735 2736// RepoSource: Location of the source in a Google Cloud Source 2737// Repository. 2738type RepoSource struct { 2739 // BranchName: Regex matching branches to build. The syntax of the 2740 // regular expressions accepted is the syntax accepted by RE2 and 2741 // described at https://github.com/google/re2/wiki/Syntax 2742 BranchName string `json:"branchName,omitempty"` 2743 2744 // CommitSha: Explicit commit SHA to build. 2745 CommitSha string `json:"commitSha,omitempty"` 2746 2747 // Dir: Directory, relative to the source root, in which to run the 2748 // build. This must be a relative path. If a step's `dir` is specified 2749 // and is an absolute path, this value is ignored for that step's 2750 // execution. 2751 Dir string `json:"dir,omitempty"` 2752 2753 // InvertRegex: Only trigger a build if the revision regex does NOT 2754 // match the revision regex. 2755 InvertRegex bool `json:"invertRegex,omitempty"` 2756 2757 // ProjectId: ID of the project that owns the Cloud Source Repository. 2758 // If omitted, the project ID requesting the build is assumed. 2759 ProjectId string `json:"projectId,omitempty"` 2760 2761 // RepoName: Name of the Cloud Source Repository. 2762 RepoName string `json:"repoName,omitempty"` 2763 2764 // Substitutions: Substitutions to use in a triggered build. Should only 2765 // be used with RunBuildTrigger 2766 Substitutions map[string]string `json:"substitutions,omitempty"` 2767 2768 // TagName: Regex matching tags to build. The syntax of the regular 2769 // expressions accepted is the syntax accepted by RE2 and described at 2770 // https://github.com/google/re2/wiki/Syntax 2771 TagName string `json:"tagName,omitempty"` 2772 2773 // ForceSendFields is a list of field names (e.g. "BranchName") to 2774 // unconditionally include in API requests. By default, fields with 2775 // empty or default values are omitted from API requests. However, any 2776 // non-pointer, non-interface field appearing in ForceSendFields will be 2777 // sent to the server regardless of whether the field is empty or not. 2778 // This may be used to include empty fields in Patch requests. 2779 ForceSendFields []string `json:"-"` 2780 2781 // NullFields is a list of field names (e.g. "BranchName") to include in 2782 // API requests with the JSON null value. By default, fields with empty 2783 // values are omitted from API requests. However, any field with an 2784 // empty value appearing in NullFields will be sent to the server as 2785 // null. It is an error if a field in this list has a non-empty value. 2786 // This may be used to include null fields in Patch requests. 2787 NullFields []string `json:"-"` 2788} 2789 2790func (s *RepoSource) MarshalJSON() ([]byte, error) { 2791 type NoMethod RepoSource 2792 raw := NoMethod(*s) 2793 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2794} 2795 2796// Results: Artifacts created by the build pipeline. 2797type Results struct { 2798 // ArtifactManifest: Path to the artifact manifest. Only populated when 2799 // artifacts are uploaded. 2800 ArtifactManifest string `json:"artifactManifest,omitempty"` 2801 2802 // ArtifactTiming: Time to push all non-container artifacts. 2803 ArtifactTiming *TimeSpan `json:"artifactTiming,omitempty"` 2804 2805 // BuildStepImages: List of build step digests, in the order 2806 // corresponding to build step indices. 2807 BuildStepImages []string `json:"buildStepImages,omitempty"` 2808 2809 // BuildStepOutputs: List of build step outputs, produced by builder 2810 // images, in the order corresponding to build step indices. Cloud 2811 // Builders (https://cloud.google.com/cloud-build/docs/cloud-builders) 2812 // can produce this output by writing to `$BUILDER_OUTPUT/output`. Only 2813 // the first 4KB of data is stored. 2814 BuildStepOutputs []string `json:"buildStepOutputs,omitempty"` 2815 2816 // Images: Container images that were built as a part of the build. 2817 Images []*BuiltImage `json:"images,omitempty"` 2818 2819 // NumArtifacts: Number of artifacts uploaded. Only populated when 2820 // artifacts are uploaded. 2821 NumArtifacts int64 `json:"numArtifacts,omitempty,string"` 2822 2823 // ForceSendFields is a list of field names (e.g. "ArtifactManifest") to 2824 // unconditionally include in API requests. By default, fields with 2825 // empty or default values are omitted from API requests. However, any 2826 // non-pointer, non-interface field appearing in ForceSendFields will be 2827 // sent to the server regardless of whether the field is empty or not. 2828 // This may be used to include empty fields in Patch requests. 2829 ForceSendFields []string `json:"-"` 2830 2831 // NullFields is a list of field names (e.g. "ArtifactManifest") to 2832 // include in API requests with the JSON null value. By default, fields 2833 // with empty values are omitted from API requests. However, any field 2834 // with an empty value appearing in NullFields will be sent to the 2835 // server as null. It is an error if a field in this list has a 2836 // non-empty value. This may be used to include null fields in Patch 2837 // requests. 2838 NullFields []string `json:"-"` 2839} 2840 2841func (s *Results) MarshalJSON() ([]byte, error) { 2842 type NoMethod Results 2843 raw := NoMethod(*s) 2844 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2845} 2846 2847// RetryBuildRequest: Specifies a build to retry. 2848type RetryBuildRequest struct { 2849 // Id: Required. Build ID of the original build. 2850 Id string `json:"id,omitempty"` 2851 2852 // Name: The name of the `Build` to retry. Format: 2853 // `projects/{project}/locations/{location}/builds/{build}` 2854 Name string `json:"name,omitempty"` 2855 2856 // ProjectId: Required. ID of the project. 2857 ProjectId string `json:"projectId,omitempty"` 2858 2859 // ForceSendFields is a list of field names (e.g. "Id") to 2860 // unconditionally include in API requests. By default, fields with 2861 // empty or default values are omitted from API requests. However, any 2862 // non-pointer, non-interface field appearing in ForceSendFields will be 2863 // sent to the server regardless of whether the field is empty or not. 2864 // This may be used to include empty fields in Patch requests. 2865 ForceSendFields []string `json:"-"` 2866 2867 // NullFields is a list of field names (e.g. "Id") to include in API 2868 // requests with the JSON null value. By default, fields with empty 2869 // values are omitted from API requests. However, any field with an 2870 // empty value appearing in NullFields will be sent to the server as 2871 // null. It is an error if a field in this list has a non-empty value. 2872 // This may be used to include null fields in Patch requests. 2873 NullFields []string `json:"-"` 2874} 2875 2876func (s *RetryBuildRequest) MarshalJSON() ([]byte, error) { 2877 type NoMethod RetryBuildRequest 2878 raw := NoMethod(*s) 2879 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2880} 2881 2882// RunBuildTriggerRequest: Specifies a build trigger to run and the 2883// source to use. 2884type RunBuildTriggerRequest struct { 2885 // ProjectId: Required. ID of the project. 2886 ProjectId string `json:"projectId,omitempty"` 2887 2888 // Source: Source to build against this trigger. 2889 Source *RepoSource `json:"source,omitempty"` 2890 2891 // TriggerId: Required. ID of the trigger. 2892 TriggerId string `json:"triggerId,omitempty"` 2893 2894 // ForceSendFields is a list of field names (e.g. "ProjectId") to 2895 // unconditionally include in API requests. By default, fields with 2896 // empty or default values are omitted from API requests. However, any 2897 // non-pointer, non-interface field appearing in ForceSendFields will be 2898 // sent to the server regardless of whether the field is empty or not. 2899 // This may be used to include empty fields in Patch requests. 2900 ForceSendFields []string `json:"-"` 2901 2902 // NullFields is a list of field names (e.g. "ProjectId") to include in 2903 // API requests with the JSON null value. By default, fields with empty 2904 // values are omitted from API requests. However, any field with an 2905 // empty value appearing in NullFields will be sent to the server as 2906 // null. It is an error if a field in this list has a non-empty value. 2907 // This may be used to include null fields in Patch requests. 2908 NullFields []string `json:"-"` 2909} 2910 2911func (s *RunBuildTriggerRequest) MarshalJSON() ([]byte, error) { 2912 type NoMethod RunBuildTriggerRequest 2913 raw := NoMethod(*s) 2914 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2915} 2916 2917// SMTPDelivery: SMTPDelivery is the delivery configuration for an SMTP 2918// (email) notification. 2919type SMTPDelivery struct { 2920 // FromAddress: This is the SMTP account/email that appears in the 2921 // `From:` of the email. If empty, it is assumed to be sender. 2922 FromAddress string `json:"fromAddress,omitempty"` 2923 2924 // Password: The SMTP sender's password. 2925 Password *NotifierSecretRef `json:"password,omitempty"` 2926 2927 // Port: The SMTP port of the server. 2928 Port string `json:"port,omitempty"` 2929 2930 // RecipientAddresses: This is the list of addresses to which we send 2931 // the email (i.e. in the `To:` of the email). 2932 RecipientAddresses []string `json:"recipientAddresses,omitempty"` 2933 2934 // SenderAddress: This is the SMTP account/email that is used to send 2935 // the message. 2936 SenderAddress string `json:"senderAddress,omitempty"` 2937 2938 // Server: The address of the SMTP server. 2939 Server string `json:"server,omitempty"` 2940 2941 // ForceSendFields is a list of field names (e.g. "FromAddress") to 2942 // unconditionally include in API requests. By default, fields with 2943 // empty or default values are omitted from API requests. However, any 2944 // non-pointer, non-interface field appearing in ForceSendFields will be 2945 // sent to the server regardless of whether the field is empty or not. 2946 // This may be used to include empty fields in Patch requests. 2947 ForceSendFields []string `json:"-"` 2948 2949 // NullFields is a list of field names (e.g. "FromAddress") to include 2950 // in API requests with the JSON null value. By default, fields with 2951 // empty values are omitted from API requests. However, any field with 2952 // an empty value appearing in NullFields will be sent to the server as 2953 // null. It is an error if a field in this list has a non-empty value. 2954 // This may be used to include null fields in Patch requests. 2955 NullFields []string `json:"-"` 2956} 2957 2958func (s *SMTPDelivery) MarshalJSON() ([]byte, error) { 2959 type NoMethod SMTPDelivery 2960 raw := NoMethod(*s) 2961 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2962} 2963 2964// Secret: Pairs a set of secret environment variables containing 2965// encrypted values with the Cloud KMS key to use to decrypt the value. 2966// Note: Use `kmsKeyName` with `available_secrets` instead of using 2967// `kmsKeyName` with `secret`. For instructions see: 2968// https://cloud.google.com/cloud-build/docs/securing-builds/use-encrypted-credentials. 2969type Secret struct { 2970 // KmsKeyName: Cloud KMS key name to use to decrypt these envs. 2971 KmsKeyName string `json:"kmsKeyName,omitempty"` 2972 2973 // SecretEnv: Map of environment variable name to its encrypted value. 2974 // Secret environment variables must be unique across all of a build's 2975 // secrets, and must be used by at least one build step. Values can be 2976 // at most 64 KB in size. There can be at most 100 secret values across 2977 // all of a build's secrets. 2978 SecretEnv map[string]string `json:"secretEnv,omitempty"` 2979 2980 // ForceSendFields is a list of field names (e.g. "KmsKeyName") to 2981 // unconditionally include in API requests. By default, fields with 2982 // empty or default values are omitted from API requests. However, any 2983 // non-pointer, non-interface field appearing in ForceSendFields will be 2984 // sent to the server regardless of whether the field is empty or not. 2985 // This may be used to include empty fields in Patch requests. 2986 ForceSendFields []string `json:"-"` 2987 2988 // NullFields is a list of field names (e.g. "KmsKeyName") to include in 2989 // API requests with the JSON null value. By default, fields with empty 2990 // values are omitted from API requests. However, any field with an 2991 // empty value appearing in NullFields will be sent to the server as 2992 // null. It is an error if a field in this list has a non-empty value. 2993 // This may be used to include null fields in Patch requests. 2994 NullFields []string `json:"-"` 2995} 2996 2997func (s *Secret) MarshalJSON() ([]byte, error) { 2998 type NoMethod Secret 2999 raw := NoMethod(*s) 3000 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3001} 3002 3003// SecretManagerSecret: Pairs a secret environment variable with a 3004// SecretVersion in Secret Manager. 3005type SecretManagerSecret struct { 3006 // Env: Environment variable name to associate with the secret. Secret 3007 // environment variables must be unique across all of a build's secrets, 3008 // and must be used by at least one build step. 3009 Env string `json:"env,omitempty"` 3010 3011 // VersionName: Resource name of the SecretVersion. In format: 3012 // projects/*/secrets/*/versions/* 3013 VersionName string `json:"versionName,omitempty"` 3014 3015 // ForceSendFields is a list of field names (e.g. "Env") to 3016 // unconditionally include in API requests. By default, fields with 3017 // empty or default values are omitted from API requests. However, any 3018 // non-pointer, non-interface field appearing in ForceSendFields will be 3019 // sent to the server regardless of whether the field is empty or not. 3020 // This may be used to include empty fields in Patch requests. 3021 ForceSendFields []string `json:"-"` 3022 3023 // NullFields is a list of field names (e.g. "Env") to include in API 3024 // requests with the JSON null value. By default, fields with empty 3025 // values are omitted from API requests. However, any field with an 3026 // empty value appearing in NullFields will be sent to the server as 3027 // null. It is an error if a field in this list has a non-empty value. 3028 // This may be used to include null fields in Patch requests. 3029 NullFields []string `json:"-"` 3030} 3031 3032func (s *SecretManagerSecret) MarshalJSON() ([]byte, error) { 3033 type NoMethod SecretManagerSecret 3034 raw := NoMethod(*s) 3035 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3036} 3037 3038// Secrets: Secrets and secret environment variables. 3039type Secrets struct { 3040 // Inline: Secrets encrypted with KMS key and the associated secret 3041 // environment variable. 3042 Inline []*InlineSecret `json:"inline,omitempty"` 3043 3044 // SecretManager: Secrets in Secret Manager and associated secret 3045 // environment variable. 3046 SecretManager []*SecretManagerSecret `json:"secretManager,omitempty"` 3047 3048 // ForceSendFields is a list of field names (e.g. "Inline") to 3049 // unconditionally include in API requests. By default, fields with 3050 // empty or default values are omitted from API requests. However, any 3051 // non-pointer, non-interface field appearing in ForceSendFields will be 3052 // sent to the server regardless of whether the field is empty or not. 3053 // This may be used to include empty fields in Patch requests. 3054 ForceSendFields []string `json:"-"` 3055 3056 // NullFields is a list of field names (e.g. "Inline") to include in API 3057 // requests with the JSON null value. By default, fields with empty 3058 // values are omitted from API requests. However, any field with an 3059 // empty value appearing in NullFields will be sent to the server as 3060 // null. It is an error if a field in this list has a non-empty value. 3061 // This may be used to include null fields in Patch requests. 3062 NullFields []string `json:"-"` 3063} 3064 3065func (s *Secrets) MarshalJSON() ([]byte, error) { 3066 type NoMethod Secrets 3067 raw := NoMethod(*s) 3068 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3069} 3070 3071// SlackDelivery: SlackDelivery is the delivery configuration for 3072// delivering Slack messages via webhooks. See Slack webhook 3073// documentation at: https://api.slack.com/messaging/webhooks. 3074type SlackDelivery struct { 3075 // WebhookUri: The secret reference for the Slack webhook URI for 3076 // sending messages to a channel. 3077 WebhookUri *NotifierSecretRef `json:"webhookUri,omitempty"` 3078 3079 // ForceSendFields is a list of field names (e.g. "WebhookUri") to 3080 // unconditionally include in API requests. By default, fields with 3081 // empty or default values are omitted from API requests. However, any 3082 // non-pointer, non-interface field appearing in ForceSendFields will be 3083 // sent to the server regardless of whether the field is empty or not. 3084 // This may be used to include empty fields in Patch requests. 3085 ForceSendFields []string `json:"-"` 3086 3087 // NullFields is a list of field names (e.g. "WebhookUri") to include in 3088 // API requests with the JSON null value. By default, fields with empty 3089 // values are omitted from API requests. However, any field with an 3090 // empty value appearing in NullFields will be sent to the server as 3091 // null. It is an error if a field in this list has a non-empty value. 3092 // This may be used to include null fields in Patch requests. 3093 NullFields []string `json:"-"` 3094} 3095 3096func (s *SlackDelivery) MarshalJSON() ([]byte, error) { 3097 type NoMethod SlackDelivery 3098 raw := NoMethod(*s) 3099 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3100} 3101 3102// Source: Location of the source in a supported storage service. 3103type Source struct { 3104 // RepoSource: If provided, get the source from this location in a Cloud 3105 // Source Repository. 3106 RepoSource *RepoSource `json:"repoSource,omitempty"` 3107 3108 // StorageSource: If provided, get the source from this location in 3109 // Google Cloud Storage. 3110 StorageSource *StorageSource `json:"storageSource,omitempty"` 3111 3112 // StorageSourceManifest: If provided, get the source from this manifest 3113 // in Google Cloud Storage. This feature is in Preview; see description 3114 // here 3115 // (https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). 3116 StorageSourceManifest *StorageSourceManifest `json:"storageSourceManifest,omitempty"` 3117 3118 // ForceSendFields is a list of field names (e.g. "RepoSource") to 3119 // unconditionally include in API requests. By default, fields with 3120 // empty or default values are omitted from API requests. However, any 3121 // non-pointer, non-interface field appearing in ForceSendFields will be 3122 // sent to the server regardless of whether the field is empty or not. 3123 // This may be used to include empty fields in Patch requests. 3124 ForceSendFields []string `json:"-"` 3125 3126 // NullFields is a list of field names (e.g. "RepoSource") to include in 3127 // API requests with the JSON null value. By default, fields with empty 3128 // values are omitted from API requests. However, any field with an 3129 // empty value appearing in NullFields will be sent to the server as 3130 // null. It is an error if a field in this list has a non-empty value. 3131 // This may be used to include null fields in Patch requests. 3132 NullFields []string `json:"-"` 3133} 3134 3135func (s *Source) MarshalJSON() ([]byte, error) { 3136 type NoMethod Source 3137 raw := NoMethod(*s) 3138 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3139} 3140 3141// SourceProvenance: Provenance of the source. Ways to find the original 3142// source, or verify that some source was used for this build. 3143type SourceProvenance struct { 3144 // FileHashes: Output only. Hash(es) of the build source, which can be 3145 // used to verify that the original source integrity was maintained in 3146 // the build. Note that `FileHashes` will only be populated if 3147 // `BuildOptions` has requested a `SourceProvenanceHash`. The keys to 3148 // this map are file paths used as build source and the values contain 3149 // the hash values for those files. If the build source came in a single 3150 // package such as a gzipped tarfile (`.tar.gz`), the `FileHash` will be 3151 // for the single path to that file. 3152 FileHashes map[string]FileHashes `json:"fileHashes,omitempty"` 3153 3154 // ResolvedRepoSource: A copy of the build's `source.repo_source`, if 3155 // exists, with any revisions resolved. 3156 ResolvedRepoSource *RepoSource `json:"resolvedRepoSource,omitempty"` 3157 3158 // ResolvedStorageSource: A copy of the build's `source.storage_source`, 3159 // if exists, with any generations resolved. 3160 ResolvedStorageSource *StorageSource `json:"resolvedStorageSource,omitempty"` 3161 3162 // ResolvedStorageSourceManifest: A copy of the build's 3163 // `source.storage_source_manifest`, if exists, with any revisions 3164 // resolved. This feature is in Preview. 3165 ResolvedStorageSourceManifest *StorageSourceManifest `json:"resolvedStorageSourceManifest,omitempty"` 3166 3167 // ForceSendFields is a list of field names (e.g. "FileHashes") to 3168 // unconditionally include in API requests. By default, fields with 3169 // empty or default values are omitted from API requests. However, any 3170 // non-pointer, non-interface field appearing in ForceSendFields will be 3171 // sent to the server regardless of whether the field is empty or not. 3172 // This may be used to include empty fields in Patch requests. 3173 ForceSendFields []string `json:"-"` 3174 3175 // NullFields is a list of field names (e.g. "FileHashes") to include in 3176 // API requests with the JSON null value. By default, fields with empty 3177 // values are omitted from API requests. However, any field with an 3178 // empty value appearing in NullFields will be sent to the server as 3179 // null. It is an error if a field in this list has a non-empty value. 3180 // This may be used to include null fields in Patch requests. 3181 NullFields []string `json:"-"` 3182} 3183 3184func (s *SourceProvenance) MarshalJSON() ([]byte, error) { 3185 type NoMethod SourceProvenance 3186 raw := NoMethod(*s) 3187 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3188} 3189 3190// Status: The `Status` type defines a logical error model that is 3191// suitable for different programming environments, including REST APIs 3192// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 3193// `Status` message contains three pieces of data: error code, error 3194// message, and error details. You can find out more about this error 3195// model and how to work with it in the API Design Guide 3196// (https://cloud.google.com/apis/design/errors). 3197type Status struct { 3198 // Code: The status code, which should be an enum value of 3199 // google.rpc.Code. 3200 Code int64 `json:"code,omitempty"` 3201 3202 // Details: A list of messages that carry the error details. There is a 3203 // common set of message types for APIs to use. 3204 Details []googleapi.RawMessage `json:"details,omitempty"` 3205 3206 // Message: A developer-facing error message, which should be in 3207 // English. Any user-facing error message should be localized and sent 3208 // in the google.rpc.Status.details field, or localized by the client. 3209 Message string `json:"message,omitempty"` 3210 3211 // ForceSendFields is a list of field names (e.g. "Code") to 3212 // unconditionally include in API requests. By default, fields with 3213 // empty or default values are omitted from API requests. However, any 3214 // non-pointer, non-interface field appearing in ForceSendFields will be 3215 // sent to the server regardless of whether the field is empty or not. 3216 // This may be used to include empty fields in Patch requests. 3217 ForceSendFields []string `json:"-"` 3218 3219 // NullFields is a list of field names (e.g. "Code") to include in API 3220 // requests with the JSON null value. By default, fields with empty 3221 // values are omitted from API requests. However, any field with an 3222 // empty value appearing in NullFields will be sent to the server as 3223 // null. It is an error if a field in this list has a non-empty value. 3224 // This may be used to include null fields in Patch requests. 3225 NullFields []string `json:"-"` 3226} 3227 3228func (s *Status) MarshalJSON() ([]byte, error) { 3229 type NoMethod Status 3230 raw := NoMethod(*s) 3231 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3232} 3233 3234// StorageSource: Location of the source in an archive file in Google 3235// Cloud Storage. 3236type StorageSource struct { 3237 // Bucket: Google Cloud Storage bucket containing the source (see Bucket 3238 // Name Requirements 3239 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 3240 Bucket string `json:"bucket,omitempty"` 3241 3242 // Generation: Google Cloud Storage generation for the object. If the 3243 // generation is omitted, the latest generation will be used. 3244 Generation int64 `json:"generation,omitempty,string"` 3245 3246 // Object: Google Cloud Storage object containing the source. This 3247 // object must be a zipped (`.zip`) or gzipped archive file (`.tar.gz`) 3248 // containing source to build. 3249 Object string `json:"object,omitempty"` 3250 3251 // ForceSendFields is a list of field names (e.g. "Bucket") to 3252 // unconditionally include in API requests. By default, fields with 3253 // empty or default values are omitted from API requests. However, any 3254 // non-pointer, non-interface field appearing in ForceSendFields will be 3255 // sent to the server regardless of whether the field is empty or not. 3256 // This may be used to include empty fields in Patch requests. 3257 ForceSendFields []string `json:"-"` 3258 3259 // NullFields is a list of field names (e.g. "Bucket") to include in API 3260 // requests with the JSON null value. By default, fields with empty 3261 // values are omitted from API requests. However, any field with an 3262 // empty value appearing in NullFields will be sent to the server as 3263 // null. It is an error if a field in this list has a non-empty value. 3264 // This may be used to include null fields in Patch requests. 3265 NullFields []string `json:"-"` 3266} 3267 3268func (s *StorageSource) MarshalJSON() ([]byte, error) { 3269 type NoMethod StorageSource 3270 raw := NoMethod(*s) 3271 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3272} 3273 3274// StorageSourceManifest: Location of the source manifest in Google 3275// Cloud Storage. This feature is in Preview; see description here 3276// (https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/gcs-fetcher). 3277type StorageSourceManifest struct { 3278 // Bucket: Google Cloud Storage bucket containing the source manifest 3279 // (see Bucket Name Requirements 3280 // (https://cloud.google.com/storage/docs/bucket-naming#requirements)). 3281 Bucket string `json:"bucket,omitempty"` 3282 3283 // Generation: Google Cloud Storage generation for the object. If the 3284 // generation is omitted, the latest generation will be used. 3285 Generation int64 `json:"generation,omitempty,string"` 3286 3287 // Object: Google Cloud Storage object containing the source manifest. 3288 // This object must be a JSON file. 3289 Object string `json:"object,omitempty"` 3290 3291 // ForceSendFields is a list of field names (e.g. "Bucket") to 3292 // unconditionally include in API requests. By default, fields with 3293 // empty or default values are omitted from API requests. However, any 3294 // non-pointer, non-interface field appearing in ForceSendFields will be 3295 // sent to the server regardless of whether the field is empty or not. 3296 // This may be used to include empty fields in Patch requests. 3297 ForceSendFields []string `json:"-"` 3298 3299 // NullFields is a list of field names (e.g. "Bucket") to include in API 3300 // requests with the JSON null value. By default, fields with empty 3301 // values are omitted from API requests. However, any field with an 3302 // empty value appearing in NullFields will be sent to the server as 3303 // null. It is an error if a field in this list has a non-empty value. 3304 // This may be used to include null fields in Patch requests. 3305 NullFields []string `json:"-"` 3306} 3307 3308func (s *StorageSourceManifest) MarshalJSON() ([]byte, error) { 3309 type NoMethod StorageSourceManifest 3310 raw := NoMethod(*s) 3311 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3312} 3313 3314// TimeSpan: Start and end times for a build execution phase. 3315type TimeSpan struct { 3316 // EndTime: End of time span. 3317 EndTime string `json:"endTime,omitempty"` 3318 3319 // StartTime: Start of time span. 3320 StartTime string `json:"startTime,omitempty"` 3321 3322 // ForceSendFields is a list of field names (e.g. "EndTime") to 3323 // unconditionally include in API requests. By default, fields with 3324 // empty or default values are omitted from API requests. However, any 3325 // non-pointer, non-interface field appearing in ForceSendFields will be 3326 // sent to the server regardless of whether the field is empty or not. 3327 // This may be used to include empty fields in Patch requests. 3328 ForceSendFields []string `json:"-"` 3329 3330 // NullFields is a list of field names (e.g. "EndTime") to include in 3331 // API requests with the JSON null value. By default, fields with empty 3332 // values are omitted from API requests. However, any field with an 3333 // empty value appearing in NullFields will be sent to the server as 3334 // null. It is an error if a field in this list has a non-empty value. 3335 // This may be used to include null fields in Patch requests. 3336 NullFields []string `json:"-"` 3337} 3338 3339func (s *TimeSpan) MarshalJSON() ([]byte, error) { 3340 type NoMethod TimeSpan 3341 raw := NoMethod(*s) 3342 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3343} 3344 3345// UpdateGitHubEnterpriseConfigOperationMetadata: Metadata for 3346// `UpdateGitHubEnterpriseConfig` operation. 3347type UpdateGitHubEnterpriseConfigOperationMetadata struct { 3348 // CompleteTime: Time the operation was completed. 3349 CompleteTime string `json:"completeTime,omitempty"` 3350 3351 // CreateTime: Time the operation was created. 3352 CreateTime string `json:"createTime,omitempty"` 3353 3354 // GithubEnterpriseConfig: The resource name of the GitHubEnterprise to 3355 // be updated. Format: 3356 // `projects/{project}/locations/{location}/githubEnterpriseConfigs/{id}` 3357 // . 3358 GithubEnterpriseConfig string `json:"githubEnterpriseConfig,omitempty"` 3359 3360 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 3361 // unconditionally include in API requests. By default, fields with 3362 // empty or default values are omitted from API requests. However, any 3363 // non-pointer, non-interface field appearing in ForceSendFields will be 3364 // sent to the server regardless of whether the field is empty or not. 3365 // This may be used to include empty fields in Patch requests. 3366 ForceSendFields []string `json:"-"` 3367 3368 // NullFields is a list of field names (e.g. "CompleteTime") to include 3369 // in API requests with the JSON null value. By default, fields with 3370 // empty values are omitted from API requests. However, any field with 3371 // an empty value appearing in NullFields will be sent to the server as 3372 // null. It is an error if a field in this list has a non-empty value. 3373 // This may be used to include null fields in Patch requests. 3374 NullFields []string `json:"-"` 3375} 3376 3377func (s *UpdateGitHubEnterpriseConfigOperationMetadata) MarshalJSON() ([]byte, error) { 3378 type NoMethod UpdateGitHubEnterpriseConfigOperationMetadata 3379 raw := NoMethod(*s) 3380 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3381} 3382 3383// UpdateWorkerPoolOperationMetadata: Metadata for the 3384// `UpdateWorkerPool` operation. 3385type UpdateWorkerPoolOperationMetadata struct { 3386 // CompleteTime: Time the operation was completed. 3387 CompleteTime string `json:"completeTime,omitempty"` 3388 3389 // CreateTime: Time the operation was created. 3390 CreateTime string `json:"createTime,omitempty"` 3391 3392 // WorkerPool: The resource name of the `WorkerPool` being updated. 3393 // Format: 3394 // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. 3395 WorkerPool string `json:"workerPool,omitempty"` 3396 3397 // ForceSendFields is a list of field names (e.g. "CompleteTime") to 3398 // unconditionally include in API requests. By default, fields with 3399 // empty or default values are omitted from API requests. However, any 3400 // non-pointer, non-interface field appearing in ForceSendFields will be 3401 // sent to the server regardless of whether the field is empty or not. 3402 // This may be used to include empty fields in Patch requests. 3403 ForceSendFields []string `json:"-"` 3404 3405 // NullFields is a list of field names (e.g. "CompleteTime") to include 3406 // in API requests with the JSON null value. By default, fields with 3407 // empty values are omitted from API requests. However, any field with 3408 // an empty value appearing in NullFields will be sent to the server as 3409 // null. It is an error if a field in this list has a non-empty value. 3410 // This may be used to include null fields in Patch requests. 3411 NullFields []string `json:"-"` 3412} 3413 3414func (s *UpdateWorkerPoolOperationMetadata) MarshalJSON() ([]byte, error) { 3415 type NoMethod UpdateWorkerPoolOperationMetadata 3416 raw := NoMethod(*s) 3417 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3418} 3419 3420// Volume: Volume describes a Docker container volume which is mounted 3421// into build steps in order to persist files across build step 3422// execution. 3423type Volume struct { 3424 // Name: Name of the volume to mount. Volume names must be unique per 3425 // build step and must be valid names for Docker volumes. Each named 3426 // volume must be used by at least two build steps. 3427 Name string `json:"name,omitempty"` 3428 3429 // Path: Path at which to mount the volume. Paths must be absolute and 3430 // cannot conflict with other volume paths on the same build step or 3431 // with certain reserved volume paths. 3432 Path string `json:"path,omitempty"` 3433 3434 // ForceSendFields is a list of field names (e.g. "Name") to 3435 // unconditionally include in API requests. By default, fields with 3436 // empty or default values are omitted from API requests. However, any 3437 // non-pointer, non-interface field appearing in ForceSendFields will be 3438 // sent to the server regardless of whether the field is empty or not. 3439 // This may be used to include empty fields in Patch requests. 3440 ForceSendFields []string `json:"-"` 3441 3442 // NullFields is a list of field names (e.g. "Name") to include in API 3443 // requests with the JSON null value. By default, fields with empty 3444 // values are omitted from API requests. However, any field with an 3445 // empty value appearing in NullFields will be sent to the server as 3446 // null. It is an error if a field in this list has a non-empty value. 3447 // This may be used to include null fields in Patch requests. 3448 NullFields []string `json:"-"` 3449} 3450 3451func (s *Volume) MarshalJSON() ([]byte, error) { 3452 type NoMethod Volume 3453 raw := NoMethod(*s) 3454 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3455} 3456 3457// Warning: A non-fatal problem encountered during the execution of the 3458// build. 3459type Warning struct { 3460 // Priority: The priority for this warning. 3461 // 3462 // Possible values: 3463 // "PRIORITY_UNSPECIFIED" - Should not be used. 3464 // "INFO" - e.g. deprecation warnings and alternative feature 3465 // highlights. 3466 // "WARNING" - e.g. automated detection of possible issues with the 3467 // build. 3468 // "ALERT" - e.g. alerts that a feature used in the build is pending 3469 // removal 3470 Priority string `json:"priority,omitempty"` 3471 3472 // Text: Explanation of the warning generated. 3473 Text string `json:"text,omitempty"` 3474 3475 // ForceSendFields is a list of field names (e.g. "Priority") to 3476 // unconditionally include in API requests. By default, fields with 3477 // empty or default values are omitted from API requests. However, any 3478 // non-pointer, non-interface field appearing in ForceSendFields will be 3479 // sent to the server regardless of whether the field is empty or not. 3480 // This may be used to include empty fields in Patch requests. 3481 ForceSendFields []string `json:"-"` 3482 3483 // NullFields is a list of field names (e.g. "Priority") to include in 3484 // API requests with the JSON null value. By default, fields with empty 3485 // values are omitted from API requests. However, any field with an 3486 // empty value appearing in NullFields will be sent to the server as 3487 // null. It is an error if a field in this list has a non-empty value. 3488 // This may be used to include null fields in Patch requests. 3489 NullFields []string `json:"-"` 3490} 3491 3492func (s *Warning) MarshalJSON() ([]byte, error) { 3493 type NoMethod Warning 3494 raw := NoMethod(*s) 3495 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3496} 3497 3498// WebhookConfig: WebhookConfig describes the configuration of a trigger 3499// that creates a build whenever a webhook is sent to a trigger's 3500// webhook URL. 3501type WebhookConfig struct { 3502 // Secret: Required. Resource name for the secret required as a URL 3503 // parameter. 3504 Secret string `json:"secret,omitempty"` 3505 3506 // State: Potential issues with the underlying Pub/Sub subscription 3507 // configuration. Only populated on get requests. 3508 // 3509 // Possible values: 3510 // "STATE_UNSPECIFIED" - The webhook auth configuration not been 3511 // checked. 3512 // "OK" - The auth configuration is properly setup. 3513 // "SECRET_DELETED" - The secret provided in auth_method has been 3514 // deleted. 3515 State string `json:"state,omitempty"` 3516 3517 // ForceSendFields is a list of field names (e.g. "Secret") to 3518 // unconditionally include in API requests. By default, fields with 3519 // empty or default values are omitted from API requests. However, any 3520 // non-pointer, non-interface field appearing in ForceSendFields will be 3521 // sent to the server regardless of whether the field is empty or not. 3522 // This may be used to include empty fields in Patch requests. 3523 ForceSendFields []string `json:"-"` 3524 3525 // NullFields is a list of field names (e.g. "Secret") to include in API 3526 // requests with the JSON null value. By default, fields with empty 3527 // values are omitted from API requests. However, any field with an 3528 // empty value appearing in NullFields will be sent to the server as 3529 // null. It is an error if a field in this list has a non-empty value. 3530 // This may be used to include null fields in Patch requests. 3531 NullFields []string `json:"-"` 3532} 3533 3534func (s *WebhookConfig) MarshalJSON() ([]byte, error) { 3535 type NoMethod WebhookConfig 3536 raw := NoMethod(*s) 3537 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3538} 3539 3540// WorkerConfig: Defines the configuration to be used for creating 3541// workers in the pool. 3542type WorkerConfig struct { 3543 // DiskSizeGb: Size of the disk attached to the worker, in GB. See 3544 // Worker pool config file 3545 // (https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). 3546 // Specify a value of up to 1000. If `0` is specified, Cloud Build will 3547 // use a standard disk size. 3548 DiskSizeGb int64 `json:"diskSizeGb,omitempty,string"` 3549 3550 // MachineType: Machine type of a worker, such as `e2-medium`. See 3551 // Worker pool config file 3552 // (https://cloud.google.com/build/docs/private-pools/worker-pool-config-file-schema). 3553 // If left blank, Cloud Build will use a sensible default. 3554 MachineType string `json:"machineType,omitempty"` 3555 3556 // ForceSendFields is a list of field names (e.g. "DiskSizeGb") to 3557 // unconditionally include in API requests. By default, fields with 3558 // empty or default values are omitted from API requests. However, any 3559 // non-pointer, non-interface field appearing in ForceSendFields will be 3560 // sent to the server regardless of whether the field is empty or not. 3561 // This may be used to include empty fields in Patch requests. 3562 ForceSendFields []string `json:"-"` 3563 3564 // NullFields is a list of field names (e.g. "DiskSizeGb") to include in 3565 // API requests with the JSON null value. By default, fields with empty 3566 // values are omitted from API requests. However, any field with an 3567 // empty value appearing in NullFields will be sent to the server as 3568 // null. It is an error if a field in this list has a non-empty value. 3569 // This may be used to include null fields in Patch requests. 3570 NullFields []string `json:"-"` 3571} 3572 3573func (s *WorkerConfig) MarshalJSON() ([]byte, error) { 3574 type NoMethod WorkerConfig 3575 raw := NoMethod(*s) 3576 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3577} 3578 3579// WorkerPool: Configuration for a `WorkerPool`. Cloud Build owns and 3580// maintains a pool of workers for general use and have no access to a 3581// project's private network. By default, builds submitted to Cloud 3582// Build will use a worker from this pool. If your build needs access to 3583// resources on a private network, create and use a `WorkerPool` to run 3584// your builds. Private `WorkerPool`s give your builds access to any 3585// single VPC network that you administer, including any on-prem 3586// resources connected to that VPC network. For an overview of private 3587// pools, see Private pools overview 3588// (https://cloud.google.com/build/docs/private-pools/private-pools-overview). 3589type WorkerPool struct { 3590 // Annotations: User specified annotations. See 3591 // https://google.aip.dev/128#annotations for more details such as 3592 // format and size limitations. 3593 Annotations map[string]string `json:"annotations,omitempty"` 3594 3595 // CreateTime: Output only. Time at which the request to create the 3596 // `WorkerPool` was received. 3597 CreateTime string `json:"createTime,omitempty"` 3598 3599 // DeleteTime: Output only. Time at which the request to delete the 3600 // `WorkerPool` was received. 3601 DeleteTime string `json:"deleteTime,omitempty"` 3602 3603 // DisplayName: A user-specified, human-readable name for the 3604 // `WorkerPool`. If provided, this value must be 1-63 characters. 3605 DisplayName string `json:"displayName,omitempty"` 3606 3607 // Etag: Output only. Checksum computed by the server. May be sent on 3608 // update and delete requests to ensure that the client has an 3609 // up-to-date value before proceeding. 3610 Etag string `json:"etag,omitempty"` 3611 3612 // Name: Output only. The resource name of the `WorkerPool`, with format 3613 // `projects/{project}/locations/{location}/workerPools/{worker_pool}`. 3614 // The value of `{worker_pool}` is provided by `worker_pool_id` in 3615 // `CreateWorkerPool` request and the value of `{location}` is 3616 // determined by the endpoint accessed. 3617 Name string `json:"name,omitempty"` 3618 3619 // PrivatePoolV1Config: Private Pool using a v1 configuration. 3620 PrivatePoolV1Config *PrivatePoolV1Config `json:"privatePoolV1Config,omitempty"` 3621 3622 // State: Output only. `WorkerPool` state. 3623 // 3624 // Possible values: 3625 // "STATE_UNSPECIFIED" - State of the `WorkerPool` is unknown. 3626 // "CREATING" - `WorkerPool` is being created. 3627 // "RUNNING" - `WorkerPool` is running. 3628 // "DELETING" - `WorkerPool` is being deleted: cancelling builds and 3629 // draining workers. 3630 // "DELETED" - `WorkerPool` is deleted. 3631 State string `json:"state,omitempty"` 3632 3633 // Uid: Output only. A unique identifier for the `WorkerPool`. 3634 Uid string `json:"uid,omitempty"` 3635 3636 // UpdateTime: Output only. Time at which the request to update the 3637 // `WorkerPool` was received. 3638 UpdateTime string `json:"updateTime,omitempty"` 3639 3640 // ServerResponse contains the HTTP response code and headers from the 3641 // server. 3642 googleapi.ServerResponse `json:"-"` 3643 3644 // ForceSendFields is a list of field names (e.g. "Annotations") to 3645 // unconditionally include in API requests. By default, fields with 3646 // empty or default values are omitted from API requests. However, any 3647 // non-pointer, non-interface field appearing in ForceSendFields will be 3648 // sent to the server regardless of whether the field is empty or not. 3649 // This may be used to include empty fields in Patch requests. 3650 ForceSendFields []string `json:"-"` 3651 3652 // NullFields is a list of field names (e.g. "Annotations") to include 3653 // in API requests with the JSON null value. By default, fields with 3654 // empty values are omitted from API requests. However, any field with 3655 // an empty value appearing in NullFields will be sent to the server as 3656 // null. It is an error if a field in this list has a non-empty value. 3657 // This may be used to include null fields in Patch requests. 3658 NullFields []string `json:"-"` 3659} 3660 3661func (s *WorkerPool) MarshalJSON() ([]byte, error) { 3662 type NoMethod WorkerPool 3663 raw := NoMethod(*s) 3664 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3665} 3666 3667// method id "cloudbuild.operations.cancel": 3668 3669type OperationsCancelCall struct { 3670 s *Service 3671 name string 3672 canceloperationrequest *CancelOperationRequest 3673 urlParams_ gensupport.URLParams 3674 ctx_ context.Context 3675 header_ http.Header 3676} 3677 3678// Cancel: Starts asynchronous cancellation on a long-running operation. 3679// The server makes a best effort to cancel the operation, but success 3680// is not guaranteed. If the server doesn't support this method, it 3681// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use 3682// Operations.GetOperation or other methods to check whether the 3683// cancellation succeeded or whether the operation completed despite 3684// cancellation. On successful cancellation, the operation is not 3685// deleted; instead, it becomes an operation with an Operation.error 3686// value with a google.rpc.Status.code of 1, corresponding to 3687// `Code.CANCELLED`. 3688// 3689// - name: The name of the operation resource to be cancelled. 3690func (r *OperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *OperationsCancelCall { 3691 c := &OperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3692 c.name = name 3693 c.canceloperationrequest = canceloperationrequest 3694 return c 3695} 3696 3697// Fields allows partial responses to be retrieved. See 3698// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3699// for more information. 3700func (c *OperationsCancelCall) Fields(s ...googleapi.Field) *OperationsCancelCall { 3701 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3702 return c 3703} 3704 3705// Context sets the context to be used in this call's Do method. Any 3706// pending HTTP request will be aborted if the provided context is 3707// canceled. 3708func (c *OperationsCancelCall) Context(ctx context.Context) *OperationsCancelCall { 3709 c.ctx_ = ctx 3710 return c 3711} 3712 3713// Header returns an http.Header that can be modified by the caller to 3714// add HTTP headers to the request. 3715func (c *OperationsCancelCall) Header() http.Header { 3716 if c.header_ == nil { 3717 c.header_ = make(http.Header) 3718 } 3719 return c.header_ 3720} 3721 3722func (c *OperationsCancelCall) doRequest(alt string) (*http.Response, error) { 3723 reqHeaders := make(http.Header) 3724 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3725 for k, v := range c.header_ { 3726 reqHeaders[k] = v 3727 } 3728 reqHeaders.Set("User-Agent", c.s.userAgent()) 3729 var body io.Reader = nil 3730 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 3731 if err != nil { 3732 return nil, err 3733 } 3734 reqHeaders.Set("Content-Type", "application/json") 3735 c.urlParams_.Set("alt", alt) 3736 c.urlParams_.Set("prettyPrint", "false") 3737 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") 3738 urls += "?" + c.urlParams_.Encode() 3739 req, err := http.NewRequest("POST", urls, body) 3740 if err != nil { 3741 return nil, err 3742 } 3743 req.Header = reqHeaders 3744 googleapi.Expand(req.URL, map[string]string{ 3745 "name": c.name, 3746 }) 3747 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3748} 3749 3750// Do executes the "cloudbuild.operations.cancel" call. 3751// Exactly one of *Empty or error will be non-nil. Any non-2xx status 3752// code is an error. Response headers are in either 3753// *Empty.ServerResponse.Header or (if a response was returned at all) 3754// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 3755// check whether the returned error was because http.StatusNotModified 3756// was returned. 3757func (c *OperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 3758 gensupport.SetOptions(c.urlParams_, opts...) 3759 res, err := c.doRequest("json") 3760 if res != nil && res.StatusCode == http.StatusNotModified { 3761 if res.Body != nil { 3762 res.Body.Close() 3763 } 3764 return nil, &googleapi.Error{ 3765 Code: res.StatusCode, 3766 Header: res.Header, 3767 } 3768 } 3769 if err != nil { 3770 return nil, err 3771 } 3772 defer googleapi.CloseBody(res) 3773 if err := googleapi.CheckResponse(res); err != nil { 3774 return nil, err 3775 } 3776 ret := &Empty{ 3777 ServerResponse: googleapi.ServerResponse{ 3778 Header: res.Header, 3779 HTTPStatusCode: res.StatusCode, 3780 }, 3781 } 3782 target := &ret 3783 if err := gensupport.DecodeResponse(target, res); err != nil { 3784 return nil, err 3785 } 3786 return ret, nil 3787 // { 3788 // "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`.", 3789 // "flatPath": "v1/operations/{operationsId}:cancel", 3790 // "httpMethod": "POST", 3791 // "id": "cloudbuild.operations.cancel", 3792 // "parameterOrder": [ 3793 // "name" 3794 // ], 3795 // "parameters": { 3796 // "name": { 3797 // "description": "The name of the operation resource to be cancelled.", 3798 // "location": "path", 3799 // "pattern": "^operations/.*$", 3800 // "required": true, 3801 // "type": "string" 3802 // } 3803 // }, 3804 // "path": "v1/{+name}:cancel", 3805 // "request": { 3806 // "$ref": "CancelOperationRequest" 3807 // }, 3808 // "response": { 3809 // "$ref": "Empty" 3810 // }, 3811 // "scopes": [ 3812 // "https://www.googleapis.com/auth/cloud-platform" 3813 // ] 3814 // } 3815 3816} 3817 3818// method id "cloudbuild.operations.get": 3819 3820type OperationsGetCall struct { 3821 s *Service 3822 name string 3823 urlParams_ gensupport.URLParams 3824 ifNoneMatch_ string 3825 ctx_ context.Context 3826 header_ http.Header 3827} 3828 3829// Get: Gets the latest state of a long-running operation. Clients can 3830// use this method to poll the operation result at intervals as 3831// recommended by the API service. 3832// 3833// - name: The name of the operation resource. 3834func (r *OperationsService) Get(name string) *OperationsGetCall { 3835 c := &OperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3836 c.name = name 3837 return c 3838} 3839 3840// Fields allows partial responses to be retrieved. See 3841// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3842// for more information. 3843func (c *OperationsGetCall) Fields(s ...googleapi.Field) *OperationsGetCall { 3844 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3845 return c 3846} 3847 3848// IfNoneMatch sets the optional parameter which makes the operation 3849// fail if the object's ETag matches the given value. This is useful for 3850// getting updates only after the object has changed since the last 3851// request. Use googleapi.IsNotModified to check whether the response 3852// error from Do is the result of In-None-Match. 3853func (c *OperationsGetCall) IfNoneMatch(entityTag string) *OperationsGetCall { 3854 c.ifNoneMatch_ = entityTag 3855 return c 3856} 3857 3858// Context sets the context to be used in this call's Do method. Any 3859// pending HTTP request will be aborted if the provided context is 3860// canceled. 3861func (c *OperationsGetCall) Context(ctx context.Context) *OperationsGetCall { 3862 c.ctx_ = ctx 3863 return c 3864} 3865 3866// Header returns an http.Header that can be modified by the caller to 3867// add HTTP headers to the request. 3868func (c *OperationsGetCall) Header() http.Header { 3869 if c.header_ == nil { 3870 c.header_ = make(http.Header) 3871 } 3872 return c.header_ 3873} 3874 3875func (c *OperationsGetCall) doRequest(alt string) (*http.Response, error) { 3876 reqHeaders := make(http.Header) 3877 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 3878 for k, v := range c.header_ { 3879 reqHeaders[k] = v 3880 } 3881 reqHeaders.Set("User-Agent", c.s.userAgent()) 3882 if c.ifNoneMatch_ != "" { 3883 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 3884 } 3885 var body io.Reader = nil 3886 c.urlParams_.Set("alt", alt) 3887 c.urlParams_.Set("prettyPrint", "false") 3888 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 3889 urls += "?" + c.urlParams_.Encode() 3890 req, err := http.NewRequest("GET", urls, body) 3891 if err != nil { 3892 return nil, err 3893 } 3894 req.Header = reqHeaders 3895 googleapi.Expand(req.URL, map[string]string{ 3896 "name": c.name, 3897 }) 3898 return gensupport.SendRequest(c.ctx_, c.s.client, req) 3899} 3900 3901// Do executes the "cloudbuild.operations.get" call. 3902// Exactly one of *Operation or error will be non-nil. Any non-2xx 3903// status code is an error. Response headers are in either 3904// *Operation.ServerResponse.Header or (if a response was returned at 3905// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 3906// to check whether the returned error was because 3907// http.StatusNotModified was returned. 3908func (c *OperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 3909 gensupport.SetOptions(c.urlParams_, opts...) 3910 res, err := c.doRequest("json") 3911 if res != nil && res.StatusCode == http.StatusNotModified { 3912 if res.Body != nil { 3913 res.Body.Close() 3914 } 3915 return nil, &googleapi.Error{ 3916 Code: res.StatusCode, 3917 Header: res.Header, 3918 } 3919 } 3920 if err != nil { 3921 return nil, err 3922 } 3923 defer googleapi.CloseBody(res) 3924 if err := googleapi.CheckResponse(res); err != nil { 3925 return nil, err 3926 } 3927 ret := &Operation{ 3928 ServerResponse: googleapi.ServerResponse{ 3929 Header: res.Header, 3930 HTTPStatusCode: res.StatusCode, 3931 }, 3932 } 3933 target := &ret 3934 if err := gensupport.DecodeResponse(target, res); err != nil { 3935 return nil, err 3936 } 3937 return ret, nil 3938 // { 3939 // "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.", 3940 // "flatPath": "v1/operations/{operationsId}", 3941 // "httpMethod": "GET", 3942 // "id": "cloudbuild.operations.get", 3943 // "parameterOrder": [ 3944 // "name" 3945 // ], 3946 // "parameters": { 3947 // "name": { 3948 // "description": "The name of the operation resource.", 3949 // "location": "path", 3950 // "pattern": "^operations/.*$", 3951 // "required": true, 3952 // "type": "string" 3953 // } 3954 // }, 3955 // "path": "v1/{+name}", 3956 // "response": { 3957 // "$ref": "Operation" 3958 // }, 3959 // "scopes": [ 3960 // "https://www.googleapis.com/auth/cloud-platform" 3961 // ] 3962 // } 3963 3964} 3965 3966// method id "cloudbuild.projects.builds.approve": 3967 3968type ProjectsBuildsApproveCall struct { 3969 s *Service 3970 name string 3971 approvebuildrequest *ApproveBuildRequest 3972 urlParams_ gensupport.URLParams 3973 ctx_ context.Context 3974 header_ http.Header 3975} 3976 3977// Approve: Approves or rejects a pending build. If approved, the 3978// returned LRO will be analogous to the LRO returned from a CreateBuild 3979// call. If rejected, the returned LRO will be immediately done. 3980// 3981// - name: Name of the target build. For example: 3982// "projects/{$project_id}/builds/{$build_id}". 3983func (r *ProjectsBuildsService) Approve(name string, approvebuildrequest *ApproveBuildRequest) *ProjectsBuildsApproveCall { 3984 c := &ProjectsBuildsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 3985 c.name = name 3986 c.approvebuildrequest = approvebuildrequest 3987 return c 3988} 3989 3990// Fields allows partial responses to be retrieved. See 3991// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 3992// for more information. 3993func (c *ProjectsBuildsApproveCall) Fields(s ...googleapi.Field) *ProjectsBuildsApproveCall { 3994 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 3995 return c 3996} 3997 3998// Context sets the context to be used in this call's Do method. Any 3999// pending HTTP request will be aborted if the provided context is 4000// canceled. 4001func (c *ProjectsBuildsApproveCall) Context(ctx context.Context) *ProjectsBuildsApproveCall { 4002 c.ctx_ = ctx 4003 return c 4004} 4005 4006// Header returns an http.Header that can be modified by the caller to 4007// add HTTP headers to the request. 4008func (c *ProjectsBuildsApproveCall) Header() http.Header { 4009 if c.header_ == nil { 4010 c.header_ = make(http.Header) 4011 } 4012 return c.header_ 4013} 4014 4015func (c *ProjectsBuildsApproveCall) doRequest(alt string) (*http.Response, error) { 4016 reqHeaders := make(http.Header) 4017 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 4018 for k, v := range c.header_ { 4019 reqHeaders[k] = v 4020 } 4021 reqHeaders.Set("User-Agent", c.s.userAgent()) 4022 var body io.Reader = nil 4023 body, err := googleapi.WithoutDataWrapper.JSONReader(c.approvebuildrequest) 4024 if err != nil { 4025 return nil, err 4026 } 4027 reqHeaders.Set("Content-Type", "application/json") 4028 c.urlParams_.Set("alt", alt) 4029 c.urlParams_.Set("prettyPrint", "false") 4030 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:approve") 4031 urls += "?" + c.urlParams_.Encode() 4032 req, err := http.NewRequest("POST", urls, body) 4033 if err != nil { 4034 return nil, err 4035 } 4036 req.Header = reqHeaders 4037 googleapi.Expand(req.URL, map[string]string{ 4038 "name": c.name, 4039 }) 4040 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4041} 4042 4043// Do executes the "cloudbuild.projects.builds.approve" call. 4044// Exactly one of *Operation or error will be non-nil. Any non-2xx 4045// status code is an error. Response headers are in either 4046// *Operation.ServerResponse.Header or (if a response was returned at 4047// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4048// to check whether the returned error was because 4049// http.StatusNotModified was returned. 4050func (c *ProjectsBuildsApproveCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4051 gensupport.SetOptions(c.urlParams_, opts...) 4052 res, err := c.doRequest("json") 4053 if res != nil && res.StatusCode == http.StatusNotModified { 4054 if res.Body != nil { 4055 res.Body.Close() 4056 } 4057 return nil, &googleapi.Error{ 4058 Code: res.StatusCode, 4059 Header: res.Header, 4060 } 4061 } 4062 if err != nil { 4063 return nil, err 4064 } 4065 defer googleapi.CloseBody(res) 4066 if err := googleapi.CheckResponse(res); err != nil { 4067 return nil, err 4068 } 4069 ret := &Operation{ 4070 ServerResponse: googleapi.ServerResponse{ 4071 Header: res.Header, 4072 HTTPStatusCode: res.StatusCode, 4073 }, 4074 } 4075 target := &ret 4076 if err := gensupport.DecodeResponse(target, res); err != nil { 4077 return nil, err 4078 } 4079 return ret, nil 4080 // { 4081 // "description": "Approves or rejects a pending build. If approved, the returned LRO will be analogous to the LRO returned from a CreateBuild call. If rejected, the returned LRO will be immediately done.", 4082 // "flatPath": "v1/projects/{projectsId}/builds/{buildsId}:approve", 4083 // "httpMethod": "POST", 4084 // "id": "cloudbuild.projects.builds.approve", 4085 // "parameterOrder": [ 4086 // "name" 4087 // ], 4088 // "parameters": { 4089 // "name": { 4090 // "description": "Required. Name of the target build. For example: \"projects/{$project_id}/builds/{$build_id}\"", 4091 // "location": "path", 4092 // "pattern": "^projects/[^/]+/builds/[^/]+$", 4093 // "required": true, 4094 // "type": "string" 4095 // } 4096 // }, 4097 // "path": "v1/{+name}:approve", 4098 // "request": { 4099 // "$ref": "ApproveBuildRequest" 4100 // }, 4101 // "response": { 4102 // "$ref": "Operation" 4103 // }, 4104 // "scopes": [ 4105 // "https://www.googleapis.com/auth/cloud-platform" 4106 // ] 4107 // } 4108 4109} 4110 4111// method id "cloudbuild.projects.builds.cancel": 4112 4113type ProjectsBuildsCancelCall struct { 4114 s *Service 4115 projectId string 4116 id string 4117 cancelbuildrequest *CancelBuildRequest 4118 urlParams_ gensupport.URLParams 4119 ctx_ context.Context 4120 header_ http.Header 4121} 4122 4123// Cancel: Cancels a build in progress. 4124// 4125// - id: ID of the build. 4126// - projectId: ID of the project. 4127func (r *ProjectsBuildsService) Cancel(projectId string, id string, cancelbuildrequest *CancelBuildRequest) *ProjectsBuildsCancelCall { 4128 c := &ProjectsBuildsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4129 c.projectId = projectId 4130 c.id = id 4131 c.cancelbuildrequest = cancelbuildrequest 4132 return c 4133} 4134 4135// Fields allows partial responses to be retrieved. See 4136// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4137// for more information. 4138func (c *ProjectsBuildsCancelCall) Fields(s ...googleapi.Field) *ProjectsBuildsCancelCall { 4139 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4140 return c 4141} 4142 4143// Context sets the context to be used in this call's Do method. Any 4144// pending HTTP request will be aborted if the provided context is 4145// canceled. 4146func (c *ProjectsBuildsCancelCall) Context(ctx context.Context) *ProjectsBuildsCancelCall { 4147 c.ctx_ = ctx 4148 return c 4149} 4150 4151// Header returns an http.Header that can be modified by the caller to 4152// add HTTP headers to the request. 4153func (c *ProjectsBuildsCancelCall) Header() http.Header { 4154 if c.header_ == nil { 4155 c.header_ = make(http.Header) 4156 } 4157 return c.header_ 4158} 4159 4160func (c *ProjectsBuildsCancelCall) doRequest(alt string) (*http.Response, error) { 4161 reqHeaders := make(http.Header) 4162 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 4163 for k, v := range c.header_ { 4164 reqHeaders[k] = v 4165 } 4166 reqHeaders.Set("User-Agent", c.s.userAgent()) 4167 var body io.Reader = nil 4168 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelbuildrequest) 4169 if err != nil { 4170 return nil, err 4171 } 4172 reqHeaders.Set("Content-Type", "application/json") 4173 c.urlParams_.Set("alt", alt) 4174 c.urlParams_.Set("prettyPrint", "false") 4175 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/builds/{id}:cancel") 4176 urls += "?" + c.urlParams_.Encode() 4177 req, err := http.NewRequest("POST", urls, body) 4178 if err != nil { 4179 return nil, err 4180 } 4181 req.Header = reqHeaders 4182 googleapi.Expand(req.URL, map[string]string{ 4183 "projectId": c.projectId, 4184 "id": c.id, 4185 }) 4186 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4187} 4188 4189// Do executes the "cloudbuild.projects.builds.cancel" call. 4190// Exactly one of *Build or error will be non-nil. Any non-2xx status 4191// code is an error. Response headers are in either 4192// *Build.ServerResponse.Header or (if a response was returned at all) 4193// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4194// check whether the returned error was because http.StatusNotModified 4195// was returned. 4196func (c *ProjectsBuildsCancelCall) Do(opts ...googleapi.CallOption) (*Build, error) { 4197 gensupport.SetOptions(c.urlParams_, opts...) 4198 res, err := c.doRequest("json") 4199 if res != nil && res.StatusCode == http.StatusNotModified { 4200 if res.Body != nil { 4201 res.Body.Close() 4202 } 4203 return nil, &googleapi.Error{ 4204 Code: res.StatusCode, 4205 Header: res.Header, 4206 } 4207 } 4208 if err != nil { 4209 return nil, err 4210 } 4211 defer googleapi.CloseBody(res) 4212 if err := googleapi.CheckResponse(res); err != nil { 4213 return nil, err 4214 } 4215 ret := &Build{ 4216 ServerResponse: googleapi.ServerResponse{ 4217 Header: res.Header, 4218 HTTPStatusCode: res.StatusCode, 4219 }, 4220 } 4221 target := &ret 4222 if err := gensupport.DecodeResponse(target, res); err != nil { 4223 return nil, err 4224 } 4225 return ret, nil 4226 // { 4227 // "description": "Cancels a build in progress.", 4228 // "flatPath": "v1/projects/{projectId}/builds/{id}:cancel", 4229 // "httpMethod": "POST", 4230 // "id": "cloudbuild.projects.builds.cancel", 4231 // "parameterOrder": [ 4232 // "projectId", 4233 // "id" 4234 // ], 4235 // "parameters": { 4236 // "id": { 4237 // "description": "Required. ID of the build.", 4238 // "location": "path", 4239 // "required": true, 4240 // "type": "string" 4241 // }, 4242 // "projectId": { 4243 // "description": "Required. ID of the project.", 4244 // "location": "path", 4245 // "required": true, 4246 // "type": "string" 4247 // } 4248 // }, 4249 // "path": "v1/projects/{projectId}/builds/{id}:cancel", 4250 // "request": { 4251 // "$ref": "CancelBuildRequest" 4252 // }, 4253 // "response": { 4254 // "$ref": "Build" 4255 // }, 4256 // "scopes": [ 4257 // "https://www.googleapis.com/auth/cloud-platform" 4258 // ] 4259 // } 4260 4261} 4262 4263// method id "cloudbuild.projects.builds.create": 4264 4265type ProjectsBuildsCreateCall struct { 4266 s *Service 4267 projectId string 4268 build *Build 4269 urlParams_ gensupport.URLParams 4270 ctx_ context.Context 4271 header_ http.Header 4272} 4273 4274// Create: Starts a build with the specified configuration. This method 4275// returns a long-running `Operation`, which includes the build ID. Pass 4276// the build ID to `GetBuild` to determine the build status (such as 4277// `SUCCESS` or `FAILURE`). 4278// 4279// - projectId: ID of the project. 4280func (r *ProjectsBuildsService) Create(projectId string, build *Build) *ProjectsBuildsCreateCall { 4281 c := &ProjectsBuildsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4282 c.projectId = projectId 4283 c.build = build 4284 return c 4285} 4286 4287// Parent sets the optional parameter "parent": The parent resource 4288// where this build will be created. Format: 4289// `projects/{project}/locations/{location}` 4290func (c *ProjectsBuildsCreateCall) Parent(parent string) *ProjectsBuildsCreateCall { 4291 c.urlParams_.Set("parent", parent) 4292 return c 4293} 4294 4295// Fields allows partial responses to be retrieved. See 4296// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4297// for more information. 4298func (c *ProjectsBuildsCreateCall) Fields(s ...googleapi.Field) *ProjectsBuildsCreateCall { 4299 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4300 return c 4301} 4302 4303// Context sets the context to be used in this call's Do method. Any 4304// pending HTTP request will be aborted if the provided context is 4305// canceled. 4306func (c *ProjectsBuildsCreateCall) Context(ctx context.Context) *ProjectsBuildsCreateCall { 4307 c.ctx_ = ctx 4308 return c 4309} 4310 4311// Header returns an http.Header that can be modified by the caller to 4312// add HTTP headers to the request. 4313func (c *ProjectsBuildsCreateCall) Header() http.Header { 4314 if c.header_ == nil { 4315 c.header_ = make(http.Header) 4316 } 4317 return c.header_ 4318} 4319 4320func (c *ProjectsBuildsCreateCall) doRequest(alt string) (*http.Response, error) { 4321 reqHeaders := make(http.Header) 4322 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 4323 for k, v := range c.header_ { 4324 reqHeaders[k] = v 4325 } 4326 reqHeaders.Set("User-Agent", c.s.userAgent()) 4327 var body io.Reader = nil 4328 body, err := googleapi.WithoutDataWrapper.JSONReader(c.build) 4329 if err != nil { 4330 return nil, err 4331 } 4332 reqHeaders.Set("Content-Type", "application/json") 4333 c.urlParams_.Set("alt", alt) 4334 c.urlParams_.Set("prettyPrint", "false") 4335 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/builds") 4336 urls += "?" + c.urlParams_.Encode() 4337 req, err := http.NewRequest("POST", urls, body) 4338 if err != nil { 4339 return nil, err 4340 } 4341 req.Header = reqHeaders 4342 googleapi.Expand(req.URL, map[string]string{ 4343 "projectId": c.projectId, 4344 }) 4345 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4346} 4347 4348// Do executes the "cloudbuild.projects.builds.create" call. 4349// Exactly one of *Operation or error will be non-nil. Any non-2xx 4350// status code is an error. Response headers are in either 4351// *Operation.ServerResponse.Header or (if a response was returned at 4352// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4353// to check whether the returned error was because 4354// http.StatusNotModified was returned. 4355func (c *ProjectsBuildsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4356 gensupport.SetOptions(c.urlParams_, opts...) 4357 res, err := c.doRequest("json") 4358 if res != nil && res.StatusCode == http.StatusNotModified { 4359 if res.Body != nil { 4360 res.Body.Close() 4361 } 4362 return nil, &googleapi.Error{ 4363 Code: res.StatusCode, 4364 Header: res.Header, 4365 } 4366 } 4367 if err != nil { 4368 return nil, err 4369 } 4370 defer googleapi.CloseBody(res) 4371 if err := googleapi.CheckResponse(res); err != nil { 4372 return nil, err 4373 } 4374 ret := &Operation{ 4375 ServerResponse: googleapi.ServerResponse{ 4376 Header: res.Header, 4377 HTTPStatusCode: res.StatusCode, 4378 }, 4379 } 4380 target := &ret 4381 if err := gensupport.DecodeResponse(target, res); err != nil { 4382 return nil, err 4383 } 4384 return ret, nil 4385 // { 4386 // "description": "Starts a build with the specified configuration. This method returns a long-running `Operation`, which includes the build ID. Pass the build ID to `GetBuild` to determine the build status (such as `SUCCESS` or `FAILURE`).", 4387 // "flatPath": "v1/projects/{projectId}/builds", 4388 // "httpMethod": "POST", 4389 // "id": "cloudbuild.projects.builds.create", 4390 // "parameterOrder": [ 4391 // "projectId" 4392 // ], 4393 // "parameters": { 4394 // "parent": { 4395 // "description": "The parent resource where this build will be created. Format: `projects/{project}/locations/{location}`", 4396 // "location": "query", 4397 // "type": "string" 4398 // }, 4399 // "projectId": { 4400 // "description": "Required. ID of the project.", 4401 // "location": "path", 4402 // "required": true, 4403 // "type": "string" 4404 // } 4405 // }, 4406 // "path": "v1/projects/{projectId}/builds", 4407 // "request": { 4408 // "$ref": "Build" 4409 // }, 4410 // "response": { 4411 // "$ref": "Operation" 4412 // }, 4413 // "scopes": [ 4414 // "https://www.googleapis.com/auth/cloud-platform" 4415 // ] 4416 // } 4417 4418} 4419 4420// method id "cloudbuild.projects.builds.get": 4421 4422type ProjectsBuildsGetCall struct { 4423 s *Service 4424 projectId string 4425 id string 4426 urlParams_ gensupport.URLParams 4427 ifNoneMatch_ string 4428 ctx_ context.Context 4429 header_ http.Header 4430} 4431 4432// Get: Returns information about a previously requested build. The 4433// `Build` that is returned includes its status (such as `SUCCESS`, 4434// `FAILURE`, or `WORKING`), and timing information. 4435// 4436// - id: ID of the build. 4437// - projectId: ID of the project. 4438func (r *ProjectsBuildsService) Get(projectId string, id string) *ProjectsBuildsGetCall { 4439 c := &ProjectsBuildsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4440 c.projectId = projectId 4441 c.id = id 4442 return c 4443} 4444 4445// Name sets the optional parameter "name": The name of the `Build` to 4446// retrieve. Format: 4447// `projects/{project}/locations/{location}/builds/{build}` 4448func (c *ProjectsBuildsGetCall) Name(name string) *ProjectsBuildsGetCall { 4449 c.urlParams_.Set("name", name) 4450 return c 4451} 4452 4453// Fields allows partial responses to be retrieved. See 4454// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4455// for more information. 4456func (c *ProjectsBuildsGetCall) Fields(s ...googleapi.Field) *ProjectsBuildsGetCall { 4457 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4458 return c 4459} 4460 4461// IfNoneMatch sets the optional parameter which makes the operation 4462// fail if the object's ETag matches the given value. This is useful for 4463// getting updates only after the object has changed since the last 4464// request. Use googleapi.IsNotModified to check whether the response 4465// error from Do is the result of In-None-Match. 4466func (c *ProjectsBuildsGetCall) IfNoneMatch(entityTag string) *ProjectsBuildsGetCall { 4467 c.ifNoneMatch_ = entityTag 4468 return c 4469} 4470 4471// Context sets the context to be used in this call's Do method. Any 4472// pending HTTP request will be aborted if the provided context is 4473// canceled. 4474func (c *ProjectsBuildsGetCall) Context(ctx context.Context) *ProjectsBuildsGetCall { 4475 c.ctx_ = ctx 4476 return c 4477} 4478 4479// Header returns an http.Header that can be modified by the caller to 4480// add HTTP headers to the request. 4481func (c *ProjectsBuildsGetCall) Header() http.Header { 4482 if c.header_ == nil { 4483 c.header_ = make(http.Header) 4484 } 4485 return c.header_ 4486} 4487 4488func (c *ProjectsBuildsGetCall) doRequest(alt string) (*http.Response, error) { 4489 reqHeaders := make(http.Header) 4490 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 4491 for k, v := range c.header_ { 4492 reqHeaders[k] = v 4493 } 4494 reqHeaders.Set("User-Agent", c.s.userAgent()) 4495 if c.ifNoneMatch_ != "" { 4496 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4497 } 4498 var body io.Reader = nil 4499 c.urlParams_.Set("alt", alt) 4500 c.urlParams_.Set("prettyPrint", "false") 4501 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/builds/{id}") 4502 urls += "?" + c.urlParams_.Encode() 4503 req, err := http.NewRequest("GET", urls, body) 4504 if err != nil { 4505 return nil, err 4506 } 4507 req.Header = reqHeaders 4508 googleapi.Expand(req.URL, map[string]string{ 4509 "projectId": c.projectId, 4510 "id": c.id, 4511 }) 4512 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4513} 4514 4515// Do executes the "cloudbuild.projects.builds.get" call. 4516// Exactly one of *Build or error will be non-nil. Any non-2xx status 4517// code is an error. Response headers are in either 4518// *Build.ServerResponse.Header or (if a response was returned at all) 4519// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4520// check whether the returned error was because http.StatusNotModified 4521// was returned. 4522func (c *ProjectsBuildsGetCall) Do(opts ...googleapi.CallOption) (*Build, error) { 4523 gensupport.SetOptions(c.urlParams_, opts...) 4524 res, err := c.doRequest("json") 4525 if res != nil && res.StatusCode == http.StatusNotModified { 4526 if res.Body != nil { 4527 res.Body.Close() 4528 } 4529 return nil, &googleapi.Error{ 4530 Code: res.StatusCode, 4531 Header: res.Header, 4532 } 4533 } 4534 if err != nil { 4535 return nil, err 4536 } 4537 defer googleapi.CloseBody(res) 4538 if err := googleapi.CheckResponse(res); err != nil { 4539 return nil, err 4540 } 4541 ret := &Build{ 4542 ServerResponse: googleapi.ServerResponse{ 4543 Header: res.Header, 4544 HTTPStatusCode: res.StatusCode, 4545 }, 4546 } 4547 target := &ret 4548 if err := gensupport.DecodeResponse(target, res); err != nil { 4549 return nil, err 4550 } 4551 return ret, nil 4552 // { 4553 // "description": "Returns information about a previously requested build. The `Build` that is returned includes its status (such as `SUCCESS`, `FAILURE`, or `WORKING`), and timing information.", 4554 // "flatPath": "v1/projects/{projectId}/builds/{id}", 4555 // "httpMethod": "GET", 4556 // "id": "cloudbuild.projects.builds.get", 4557 // "parameterOrder": [ 4558 // "projectId", 4559 // "id" 4560 // ], 4561 // "parameters": { 4562 // "id": { 4563 // "description": "Required. ID of the build.", 4564 // "location": "path", 4565 // "required": true, 4566 // "type": "string" 4567 // }, 4568 // "name": { 4569 // "description": "The name of the `Build` to retrieve. Format: `projects/{project}/locations/{location}/builds/{build}`", 4570 // "location": "query", 4571 // "type": "string" 4572 // }, 4573 // "projectId": { 4574 // "description": "Required. ID of the project.", 4575 // "location": "path", 4576 // "required": true, 4577 // "type": "string" 4578 // } 4579 // }, 4580 // "path": "v1/projects/{projectId}/builds/{id}", 4581 // "response": { 4582 // "$ref": "Build" 4583 // }, 4584 // "scopes": [ 4585 // "https://www.googleapis.com/auth/cloud-platform" 4586 // ] 4587 // } 4588 4589} 4590 4591// method id "cloudbuild.projects.builds.list": 4592 4593type ProjectsBuildsListCall struct { 4594 s *Service 4595 projectId string 4596 urlParams_ gensupport.URLParams 4597 ifNoneMatch_ string 4598 ctx_ context.Context 4599 header_ http.Header 4600} 4601 4602// List: Lists previously requested builds. Previously requested builds 4603// may still be in-progress, or may have finished successfully or 4604// unsuccessfully. 4605// 4606// - projectId: ID of the project. 4607func (r *ProjectsBuildsService) List(projectId string) *ProjectsBuildsListCall { 4608 c := &ProjectsBuildsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4609 c.projectId = projectId 4610 return c 4611} 4612 4613// Filter sets the optional parameter "filter": The raw filter text to 4614// constrain the results. 4615func (c *ProjectsBuildsListCall) Filter(filter string) *ProjectsBuildsListCall { 4616 c.urlParams_.Set("filter", filter) 4617 return c 4618} 4619 4620// PageSize sets the optional parameter "pageSize": Number of results to 4621// return in the list. 4622func (c *ProjectsBuildsListCall) PageSize(pageSize int64) *ProjectsBuildsListCall { 4623 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 4624 return c 4625} 4626 4627// PageToken sets the optional parameter "pageToken": The page token for 4628// the next page of Builds. If unspecified, the first page of results is 4629// returned. If the token is rejected for any reason, INVALID_ARGUMENT 4630// will be thrown. In this case, the token should be discarded, and 4631// pagination should be restarted from the first page of results. See 4632// https://google.aip.dev/158 for more. 4633func (c *ProjectsBuildsListCall) PageToken(pageToken string) *ProjectsBuildsListCall { 4634 c.urlParams_.Set("pageToken", pageToken) 4635 return c 4636} 4637 4638// Parent sets the optional parameter "parent": The parent of the 4639// collection of `Builds`. Format: 4640// `projects/{project}/locations/location` 4641func (c *ProjectsBuildsListCall) Parent(parent string) *ProjectsBuildsListCall { 4642 c.urlParams_.Set("parent", parent) 4643 return c 4644} 4645 4646// Fields allows partial responses to be retrieved. See 4647// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4648// for more information. 4649func (c *ProjectsBuildsListCall) Fields(s ...googleapi.Field) *ProjectsBuildsListCall { 4650 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4651 return c 4652} 4653 4654// IfNoneMatch sets the optional parameter which makes the operation 4655// fail if the object's ETag matches the given value. This is useful for 4656// getting updates only after the object has changed since the last 4657// request. Use googleapi.IsNotModified to check whether the response 4658// error from Do is the result of In-None-Match. 4659func (c *ProjectsBuildsListCall) IfNoneMatch(entityTag string) *ProjectsBuildsListCall { 4660 c.ifNoneMatch_ = entityTag 4661 return c 4662} 4663 4664// Context sets the context to be used in this call's Do method. Any 4665// pending HTTP request will be aborted if the provided context is 4666// canceled. 4667func (c *ProjectsBuildsListCall) Context(ctx context.Context) *ProjectsBuildsListCall { 4668 c.ctx_ = ctx 4669 return c 4670} 4671 4672// Header returns an http.Header that can be modified by the caller to 4673// add HTTP headers to the request. 4674func (c *ProjectsBuildsListCall) Header() http.Header { 4675 if c.header_ == nil { 4676 c.header_ = make(http.Header) 4677 } 4678 return c.header_ 4679} 4680 4681func (c *ProjectsBuildsListCall) doRequest(alt string) (*http.Response, error) { 4682 reqHeaders := make(http.Header) 4683 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 4684 for k, v := range c.header_ { 4685 reqHeaders[k] = v 4686 } 4687 reqHeaders.Set("User-Agent", c.s.userAgent()) 4688 if c.ifNoneMatch_ != "" { 4689 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4690 } 4691 var body io.Reader = nil 4692 c.urlParams_.Set("alt", alt) 4693 c.urlParams_.Set("prettyPrint", "false") 4694 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/builds") 4695 urls += "?" + c.urlParams_.Encode() 4696 req, err := http.NewRequest("GET", urls, body) 4697 if err != nil { 4698 return nil, err 4699 } 4700 req.Header = reqHeaders 4701 googleapi.Expand(req.URL, map[string]string{ 4702 "projectId": c.projectId, 4703 }) 4704 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4705} 4706 4707// Do executes the "cloudbuild.projects.builds.list" call. 4708// Exactly one of *ListBuildsResponse or error will be non-nil. Any 4709// non-2xx status code is an error. Response headers are in either 4710// *ListBuildsResponse.ServerResponse.Header or (if a response was 4711// returned at all) in error.(*googleapi.Error).Header. Use 4712// googleapi.IsNotModified to check whether the returned error was 4713// because http.StatusNotModified was returned. 4714func (c *ProjectsBuildsListCall) Do(opts ...googleapi.CallOption) (*ListBuildsResponse, error) { 4715 gensupport.SetOptions(c.urlParams_, opts...) 4716 res, err := c.doRequest("json") 4717 if res != nil && res.StatusCode == http.StatusNotModified { 4718 if res.Body != nil { 4719 res.Body.Close() 4720 } 4721 return nil, &googleapi.Error{ 4722 Code: res.StatusCode, 4723 Header: res.Header, 4724 } 4725 } 4726 if err != nil { 4727 return nil, err 4728 } 4729 defer googleapi.CloseBody(res) 4730 if err := googleapi.CheckResponse(res); err != nil { 4731 return nil, err 4732 } 4733 ret := &ListBuildsResponse{ 4734 ServerResponse: googleapi.ServerResponse{ 4735 Header: res.Header, 4736 HTTPStatusCode: res.StatusCode, 4737 }, 4738 } 4739 target := &ret 4740 if err := gensupport.DecodeResponse(target, res); err != nil { 4741 return nil, err 4742 } 4743 return ret, nil 4744 // { 4745 // "description": "Lists previously requested builds. Previously requested builds may still be in-progress, or may have finished successfully or unsuccessfully.", 4746 // "flatPath": "v1/projects/{projectId}/builds", 4747 // "httpMethod": "GET", 4748 // "id": "cloudbuild.projects.builds.list", 4749 // "parameterOrder": [ 4750 // "projectId" 4751 // ], 4752 // "parameters": { 4753 // "filter": { 4754 // "description": "The raw filter text to constrain the results.", 4755 // "location": "query", 4756 // "type": "string" 4757 // }, 4758 // "pageSize": { 4759 // "description": "Number of results to return in the list.", 4760 // "format": "int32", 4761 // "location": "query", 4762 // "type": "integer" 4763 // }, 4764 // "pageToken": { 4765 // "description": "The page token for the next page of Builds. If unspecified, the first page of results is returned. If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. In this case, the token should be discarded, and pagination should be restarted from the first page of results. See https://google.aip.dev/158 for more.", 4766 // "location": "query", 4767 // "type": "string" 4768 // }, 4769 // "parent": { 4770 // "description": "The parent of the collection of `Builds`. Format: `projects/{project}/locations/location`", 4771 // "location": "query", 4772 // "type": "string" 4773 // }, 4774 // "projectId": { 4775 // "description": "Required. ID of the project.", 4776 // "location": "path", 4777 // "required": true, 4778 // "type": "string" 4779 // } 4780 // }, 4781 // "path": "v1/projects/{projectId}/builds", 4782 // "response": { 4783 // "$ref": "ListBuildsResponse" 4784 // }, 4785 // "scopes": [ 4786 // "https://www.googleapis.com/auth/cloud-platform" 4787 // ] 4788 // } 4789 4790} 4791 4792// Pages invokes f for each page of results. 4793// A non-nil error returned from f will halt the iteration. 4794// The provided context supersedes any context provided to the Context method. 4795func (c *ProjectsBuildsListCall) Pages(ctx context.Context, f func(*ListBuildsResponse) error) error { 4796 c.ctx_ = ctx 4797 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 4798 for { 4799 x, err := c.Do() 4800 if err != nil { 4801 return err 4802 } 4803 if err := f(x); err != nil { 4804 return err 4805 } 4806 if x.NextPageToken == "" { 4807 return nil 4808 } 4809 c.PageToken(x.NextPageToken) 4810 } 4811} 4812 4813// method id "cloudbuild.projects.builds.retry": 4814 4815type ProjectsBuildsRetryCall struct { 4816 s *Service 4817 projectId string 4818 id string 4819 retrybuildrequest *RetryBuildRequest 4820 urlParams_ gensupport.URLParams 4821 ctx_ context.Context 4822 header_ http.Header 4823} 4824 4825// Retry: Creates a new build based on the specified build. This method 4826// creates a new build using the original build request, which may or 4827// may not result in an identical build. For triggered builds: * 4828// Triggered builds resolve to a precise revision; therefore a retry of 4829// a triggered build will result in a build that uses the same revision. 4830// For non-triggered builds that specify `RepoSource`: * If the original 4831// build built from the tip of a branch, the retried build will build 4832// from the tip of that branch, which may not be the same revision as 4833// the original build. * If the original build specified a commit sha or 4834// revision ID, the retried build will use the identical source. For 4835// builds that specify `StorageSource`: * If the original build pulled 4836// source from Google Cloud Storage without specifying the generation of 4837// the object, the new build will use the current object, which may be 4838// different from the original build source. * If the original build 4839// pulled source from Cloud Storage and specified the generation of the 4840// object, the new build will attempt to use the same object, which may 4841// or may not be available depending on the bucket's lifecycle 4842// management settings. 4843// 4844// - id: Build ID of the original build. 4845// - projectId: ID of the project. 4846func (r *ProjectsBuildsService) Retry(projectId string, id string, retrybuildrequest *RetryBuildRequest) *ProjectsBuildsRetryCall { 4847 c := &ProjectsBuildsRetryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4848 c.projectId = projectId 4849 c.id = id 4850 c.retrybuildrequest = retrybuildrequest 4851 return c 4852} 4853 4854// Fields allows partial responses to be retrieved. See 4855// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4856// for more information. 4857func (c *ProjectsBuildsRetryCall) Fields(s ...googleapi.Field) *ProjectsBuildsRetryCall { 4858 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4859 return c 4860} 4861 4862// Context sets the context to be used in this call's Do method. Any 4863// pending HTTP request will be aborted if the provided context is 4864// canceled. 4865func (c *ProjectsBuildsRetryCall) Context(ctx context.Context) *ProjectsBuildsRetryCall { 4866 c.ctx_ = ctx 4867 return c 4868} 4869 4870// Header returns an http.Header that can be modified by the caller to 4871// add HTTP headers to the request. 4872func (c *ProjectsBuildsRetryCall) Header() http.Header { 4873 if c.header_ == nil { 4874 c.header_ = make(http.Header) 4875 } 4876 return c.header_ 4877} 4878 4879func (c *ProjectsBuildsRetryCall) doRequest(alt string) (*http.Response, error) { 4880 reqHeaders := make(http.Header) 4881 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 4882 for k, v := range c.header_ { 4883 reqHeaders[k] = v 4884 } 4885 reqHeaders.Set("User-Agent", c.s.userAgent()) 4886 var body io.Reader = nil 4887 body, err := googleapi.WithoutDataWrapper.JSONReader(c.retrybuildrequest) 4888 if err != nil { 4889 return nil, err 4890 } 4891 reqHeaders.Set("Content-Type", "application/json") 4892 c.urlParams_.Set("alt", alt) 4893 c.urlParams_.Set("prettyPrint", "false") 4894 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/builds/{id}:retry") 4895 urls += "?" + c.urlParams_.Encode() 4896 req, err := http.NewRequest("POST", urls, body) 4897 if err != nil { 4898 return nil, err 4899 } 4900 req.Header = reqHeaders 4901 googleapi.Expand(req.URL, map[string]string{ 4902 "projectId": c.projectId, 4903 "id": c.id, 4904 }) 4905 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4906} 4907 4908// Do executes the "cloudbuild.projects.builds.retry" call. 4909// Exactly one of *Operation or error will be non-nil. Any non-2xx 4910// status code is an error. Response headers are in either 4911// *Operation.ServerResponse.Header or (if a response was returned at 4912// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 4913// to check whether the returned error was because 4914// http.StatusNotModified was returned. 4915func (c *ProjectsBuildsRetryCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 4916 gensupport.SetOptions(c.urlParams_, opts...) 4917 res, err := c.doRequest("json") 4918 if res != nil && res.StatusCode == http.StatusNotModified { 4919 if res.Body != nil { 4920 res.Body.Close() 4921 } 4922 return nil, &googleapi.Error{ 4923 Code: res.StatusCode, 4924 Header: res.Header, 4925 } 4926 } 4927 if err != nil { 4928 return nil, err 4929 } 4930 defer googleapi.CloseBody(res) 4931 if err := googleapi.CheckResponse(res); err != nil { 4932 return nil, err 4933 } 4934 ret := &Operation{ 4935 ServerResponse: googleapi.ServerResponse{ 4936 Header: res.Header, 4937 HTTPStatusCode: res.StatusCode, 4938 }, 4939 } 4940 target := &ret 4941 if err := gensupport.DecodeResponse(target, res); err != nil { 4942 return nil, err 4943 } 4944 return ret, nil 4945 // { 4946 // "description": "Creates a new build based on the specified build. This method creates a new build using the original build request, which may or may not result in an identical build. For triggered builds: * Triggered builds resolve to a precise revision; therefore a retry of a triggered build will result in a build that uses the same revision. For non-triggered builds that specify `RepoSource`: * If the original build built from the tip of a branch, the retried build will build from the tip of that branch, which may not be the same revision as the original build. * If the original build specified a commit sha or revision ID, the retried build will use the identical source. For builds that specify `StorageSource`: * If the original build pulled source from Google Cloud Storage without specifying the generation of the object, the new build will use the current object, which may be different from the original build source. * If the original build pulled source from Cloud Storage and specified the generation of the object, the new build will attempt to use the same object, which may or may not be available depending on the bucket's lifecycle management settings.", 4947 // "flatPath": "v1/projects/{projectId}/builds/{id}:retry", 4948 // "httpMethod": "POST", 4949 // "id": "cloudbuild.projects.builds.retry", 4950 // "parameterOrder": [ 4951 // "projectId", 4952 // "id" 4953 // ], 4954 // "parameters": { 4955 // "id": { 4956 // "description": "Required. Build ID of the original build.", 4957 // "location": "path", 4958 // "required": true, 4959 // "type": "string" 4960 // }, 4961 // "projectId": { 4962 // "description": "Required. ID of the project.", 4963 // "location": "path", 4964 // "required": true, 4965 // "type": "string" 4966 // } 4967 // }, 4968 // "path": "v1/projects/{projectId}/builds/{id}:retry", 4969 // "request": { 4970 // "$ref": "RetryBuildRequest" 4971 // }, 4972 // "response": { 4973 // "$ref": "Operation" 4974 // }, 4975 // "scopes": [ 4976 // "https://www.googleapis.com/auth/cloud-platform" 4977 // ] 4978 // } 4979 4980} 4981 4982// method id "cloudbuild.projects.githubEnterpriseConfigs.create": 4983 4984type ProjectsGithubEnterpriseConfigsCreateCall struct { 4985 s *Service 4986 parent string 4987 githubenterpriseconfig *GitHubEnterpriseConfig 4988 urlParams_ gensupport.URLParams 4989 ctx_ context.Context 4990 header_ http.Header 4991} 4992 4993// Create: Create an association between a GCP project and a GitHub 4994// Enterprise server. This API is experimental. 4995// 4996// - parent: Name of the parent project. For example: 4997// projects/{$project_number} or projects/{$project_id}. 4998func (r *ProjectsGithubEnterpriseConfigsService) Create(parent string, githubenterpriseconfig *GitHubEnterpriseConfig) *ProjectsGithubEnterpriseConfigsCreateCall { 4999 c := &ProjectsGithubEnterpriseConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5000 c.parent = parent 5001 c.githubenterpriseconfig = githubenterpriseconfig 5002 return c 5003} 5004 5005// ProjectId sets the optional parameter "projectId": ID of the project. 5006func (c *ProjectsGithubEnterpriseConfigsCreateCall) ProjectId(projectId string) *ProjectsGithubEnterpriseConfigsCreateCall { 5007 c.urlParams_.Set("projectId", projectId) 5008 return c 5009} 5010 5011// Fields allows partial responses to be retrieved. See 5012// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5013// for more information. 5014func (c *ProjectsGithubEnterpriseConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsGithubEnterpriseConfigsCreateCall { 5015 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5016 return c 5017} 5018 5019// Context sets the context to be used in this call's Do method. Any 5020// pending HTTP request will be aborted if the provided context is 5021// canceled. 5022func (c *ProjectsGithubEnterpriseConfigsCreateCall) Context(ctx context.Context) *ProjectsGithubEnterpriseConfigsCreateCall { 5023 c.ctx_ = ctx 5024 return c 5025} 5026 5027// Header returns an http.Header that can be modified by the caller to 5028// add HTTP headers to the request. 5029func (c *ProjectsGithubEnterpriseConfigsCreateCall) Header() http.Header { 5030 if c.header_ == nil { 5031 c.header_ = make(http.Header) 5032 } 5033 return c.header_ 5034} 5035 5036func (c *ProjectsGithubEnterpriseConfigsCreateCall) doRequest(alt string) (*http.Response, error) { 5037 reqHeaders := make(http.Header) 5038 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 5039 for k, v := range c.header_ { 5040 reqHeaders[k] = v 5041 } 5042 reqHeaders.Set("User-Agent", c.s.userAgent()) 5043 var body io.Reader = nil 5044 body, err := googleapi.WithoutDataWrapper.JSONReader(c.githubenterpriseconfig) 5045 if err != nil { 5046 return nil, err 5047 } 5048 reqHeaders.Set("Content-Type", "application/json") 5049 c.urlParams_.Set("alt", alt) 5050 c.urlParams_.Set("prettyPrint", "false") 5051 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/githubEnterpriseConfigs") 5052 urls += "?" + c.urlParams_.Encode() 5053 req, err := http.NewRequest("POST", urls, body) 5054 if err != nil { 5055 return nil, err 5056 } 5057 req.Header = reqHeaders 5058 googleapi.Expand(req.URL, map[string]string{ 5059 "parent": c.parent, 5060 }) 5061 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5062} 5063 5064// Do executes the "cloudbuild.projects.githubEnterpriseConfigs.create" call. 5065// Exactly one of *Operation or error will be non-nil. Any non-2xx 5066// status code is an error. Response headers are in either 5067// *Operation.ServerResponse.Header or (if a response was returned at 5068// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5069// to check whether the returned error was because 5070// http.StatusNotModified was returned. 5071func (c *ProjectsGithubEnterpriseConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5072 gensupport.SetOptions(c.urlParams_, opts...) 5073 res, err := c.doRequest("json") 5074 if res != nil && res.StatusCode == http.StatusNotModified { 5075 if res.Body != nil { 5076 res.Body.Close() 5077 } 5078 return nil, &googleapi.Error{ 5079 Code: res.StatusCode, 5080 Header: res.Header, 5081 } 5082 } 5083 if err != nil { 5084 return nil, err 5085 } 5086 defer googleapi.CloseBody(res) 5087 if err := googleapi.CheckResponse(res); err != nil { 5088 return nil, err 5089 } 5090 ret := &Operation{ 5091 ServerResponse: googleapi.ServerResponse{ 5092 Header: res.Header, 5093 HTTPStatusCode: res.StatusCode, 5094 }, 5095 } 5096 target := &ret 5097 if err := gensupport.DecodeResponse(target, res); err != nil { 5098 return nil, err 5099 } 5100 return ret, nil 5101 // { 5102 // "description": "Create an association between a GCP project and a GitHub Enterprise server. This API is experimental.", 5103 // "flatPath": "v1/projects/{projectsId}/githubEnterpriseConfigs", 5104 // "httpMethod": "POST", 5105 // "id": "cloudbuild.projects.githubEnterpriseConfigs.create", 5106 // "parameterOrder": [ 5107 // "parent" 5108 // ], 5109 // "parameters": { 5110 // "parent": { 5111 // "description": "Name of the parent project. For example: projects/{$project_number} or projects/{$project_id}", 5112 // "location": "path", 5113 // "pattern": "^projects/[^/]+$", 5114 // "required": true, 5115 // "type": "string" 5116 // }, 5117 // "projectId": { 5118 // "description": "ID of the project.", 5119 // "location": "query", 5120 // "type": "string" 5121 // } 5122 // }, 5123 // "path": "v1/{+parent}/githubEnterpriseConfigs", 5124 // "request": { 5125 // "$ref": "GitHubEnterpriseConfig" 5126 // }, 5127 // "response": { 5128 // "$ref": "Operation" 5129 // }, 5130 // "scopes": [ 5131 // "https://www.googleapis.com/auth/cloud-platform" 5132 // ] 5133 // } 5134 5135} 5136 5137// method id "cloudbuild.projects.githubEnterpriseConfigs.delete": 5138 5139type ProjectsGithubEnterpriseConfigsDeleteCall struct { 5140 s *Service 5141 name string 5142 urlParams_ gensupport.URLParams 5143 ctx_ context.Context 5144 header_ http.Header 5145} 5146 5147// Delete: Delete an association between a GCP project and a GitHub 5148// Enterprise server. This API is experimental. 5149// 5150// - name: This field should contain the name of the enterprise config 5151// resource. For example: 5152// "projects/{$project_id}/githubEnterpriseConfig/{$config_id}". 5153func (r *ProjectsGithubEnterpriseConfigsService) Delete(name string) *ProjectsGithubEnterpriseConfigsDeleteCall { 5154 c := &ProjectsGithubEnterpriseConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5155 c.name = name 5156 return c 5157} 5158 5159// ConfigId sets the optional parameter "configId": Unique identifier of 5160// the `GitHubEnterpriseConfig` 5161func (c *ProjectsGithubEnterpriseConfigsDeleteCall) ConfigId(configId string) *ProjectsGithubEnterpriseConfigsDeleteCall { 5162 c.urlParams_.Set("configId", configId) 5163 return c 5164} 5165 5166// ProjectId sets the optional parameter "projectId": ID of the project 5167func (c *ProjectsGithubEnterpriseConfigsDeleteCall) ProjectId(projectId string) *ProjectsGithubEnterpriseConfigsDeleteCall { 5168 c.urlParams_.Set("projectId", projectId) 5169 return c 5170} 5171 5172// Fields allows partial responses to be retrieved. See 5173// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5174// for more information. 5175func (c *ProjectsGithubEnterpriseConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsGithubEnterpriseConfigsDeleteCall { 5176 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5177 return c 5178} 5179 5180// Context sets the context to be used in this call's Do method. Any 5181// pending HTTP request will be aborted if the provided context is 5182// canceled. 5183func (c *ProjectsGithubEnterpriseConfigsDeleteCall) Context(ctx context.Context) *ProjectsGithubEnterpriseConfigsDeleteCall { 5184 c.ctx_ = ctx 5185 return c 5186} 5187 5188// Header returns an http.Header that can be modified by the caller to 5189// add HTTP headers to the request. 5190func (c *ProjectsGithubEnterpriseConfigsDeleteCall) Header() http.Header { 5191 if c.header_ == nil { 5192 c.header_ = make(http.Header) 5193 } 5194 return c.header_ 5195} 5196 5197func (c *ProjectsGithubEnterpriseConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { 5198 reqHeaders := make(http.Header) 5199 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 5200 for k, v := range c.header_ { 5201 reqHeaders[k] = v 5202 } 5203 reqHeaders.Set("User-Agent", c.s.userAgent()) 5204 var body io.Reader = nil 5205 c.urlParams_.Set("alt", alt) 5206 c.urlParams_.Set("prettyPrint", "false") 5207 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5208 urls += "?" + c.urlParams_.Encode() 5209 req, err := http.NewRequest("DELETE", urls, body) 5210 if err != nil { 5211 return nil, err 5212 } 5213 req.Header = reqHeaders 5214 googleapi.Expand(req.URL, map[string]string{ 5215 "name": c.name, 5216 }) 5217 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5218} 5219 5220// Do executes the "cloudbuild.projects.githubEnterpriseConfigs.delete" call. 5221// Exactly one of *Operation or error will be non-nil. Any non-2xx 5222// status code is an error. Response headers are in either 5223// *Operation.ServerResponse.Header or (if a response was returned at 5224// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5225// to check whether the returned error was because 5226// http.StatusNotModified was returned. 5227func (c *ProjectsGithubEnterpriseConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5228 gensupport.SetOptions(c.urlParams_, opts...) 5229 res, err := c.doRequest("json") 5230 if res != nil && res.StatusCode == http.StatusNotModified { 5231 if res.Body != nil { 5232 res.Body.Close() 5233 } 5234 return nil, &googleapi.Error{ 5235 Code: res.StatusCode, 5236 Header: res.Header, 5237 } 5238 } 5239 if err != nil { 5240 return nil, err 5241 } 5242 defer googleapi.CloseBody(res) 5243 if err := googleapi.CheckResponse(res); err != nil { 5244 return nil, err 5245 } 5246 ret := &Operation{ 5247 ServerResponse: googleapi.ServerResponse{ 5248 Header: res.Header, 5249 HTTPStatusCode: res.StatusCode, 5250 }, 5251 } 5252 target := &ret 5253 if err := gensupport.DecodeResponse(target, res); err != nil { 5254 return nil, err 5255 } 5256 return ret, nil 5257 // { 5258 // "description": "Delete an association between a GCP project and a GitHub Enterprise server. This API is experimental.", 5259 // "flatPath": "v1/projects/{projectsId}/githubEnterpriseConfigs/{githubEnterpriseConfigsId}", 5260 // "httpMethod": "DELETE", 5261 // "id": "cloudbuild.projects.githubEnterpriseConfigs.delete", 5262 // "parameterOrder": [ 5263 // "name" 5264 // ], 5265 // "parameters": { 5266 // "configId": { 5267 // "description": "Unique identifier of the `GitHubEnterpriseConfig`", 5268 // "location": "query", 5269 // "type": "string" 5270 // }, 5271 // "name": { 5272 // "description": "This field should contain the name of the enterprise config resource. For example: \"projects/{$project_id}/githubEnterpriseConfig/{$config_id}\"", 5273 // "location": "path", 5274 // "pattern": "^projects/[^/]+/githubEnterpriseConfigs/[^/]+$", 5275 // "required": true, 5276 // "type": "string" 5277 // }, 5278 // "projectId": { 5279 // "description": "ID of the project", 5280 // "location": "query", 5281 // "type": "string" 5282 // } 5283 // }, 5284 // "path": "v1/{+name}", 5285 // "response": { 5286 // "$ref": "Operation" 5287 // }, 5288 // "scopes": [ 5289 // "https://www.googleapis.com/auth/cloud-platform" 5290 // ] 5291 // } 5292 5293} 5294 5295// method id "cloudbuild.projects.githubEnterpriseConfigs.get": 5296 5297type ProjectsGithubEnterpriseConfigsGetCall struct { 5298 s *Service 5299 name string 5300 urlParams_ gensupport.URLParams 5301 ifNoneMatch_ string 5302 ctx_ context.Context 5303 header_ http.Header 5304} 5305 5306// Get: Retrieve a GitHubEnterpriseConfig. This API is experimental. 5307// 5308// - name: This field should contain the name of the enterprise config 5309// resource. For example: 5310// "projects/{$project_id}/githubEnterpriseConfig/{$config_id}". 5311func (r *ProjectsGithubEnterpriseConfigsService) Get(name string) *ProjectsGithubEnterpriseConfigsGetCall { 5312 c := &ProjectsGithubEnterpriseConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5313 c.name = name 5314 return c 5315} 5316 5317// ConfigId sets the optional parameter "configId": Unique identifier of 5318// the `GitHubEnterpriseConfig` 5319func (c *ProjectsGithubEnterpriseConfigsGetCall) ConfigId(configId string) *ProjectsGithubEnterpriseConfigsGetCall { 5320 c.urlParams_.Set("configId", configId) 5321 return c 5322} 5323 5324// ProjectId sets the optional parameter "projectId": ID of the project 5325func (c *ProjectsGithubEnterpriseConfigsGetCall) ProjectId(projectId string) *ProjectsGithubEnterpriseConfigsGetCall { 5326 c.urlParams_.Set("projectId", projectId) 5327 return c 5328} 5329 5330// Fields allows partial responses to be retrieved. See 5331// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5332// for more information. 5333func (c *ProjectsGithubEnterpriseConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsGithubEnterpriseConfigsGetCall { 5334 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5335 return c 5336} 5337 5338// IfNoneMatch sets the optional parameter which makes the operation 5339// fail if the object's ETag matches the given value. This is useful for 5340// getting updates only after the object has changed since the last 5341// request. Use googleapi.IsNotModified to check whether the response 5342// error from Do is the result of In-None-Match. 5343func (c *ProjectsGithubEnterpriseConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsGithubEnterpriseConfigsGetCall { 5344 c.ifNoneMatch_ = entityTag 5345 return c 5346} 5347 5348// Context sets the context to be used in this call's Do method. Any 5349// pending HTTP request will be aborted if the provided context is 5350// canceled. 5351func (c *ProjectsGithubEnterpriseConfigsGetCall) Context(ctx context.Context) *ProjectsGithubEnterpriseConfigsGetCall { 5352 c.ctx_ = ctx 5353 return c 5354} 5355 5356// Header returns an http.Header that can be modified by the caller to 5357// add HTTP headers to the request. 5358func (c *ProjectsGithubEnterpriseConfigsGetCall) Header() http.Header { 5359 if c.header_ == nil { 5360 c.header_ = make(http.Header) 5361 } 5362 return c.header_ 5363} 5364 5365func (c *ProjectsGithubEnterpriseConfigsGetCall) doRequest(alt string) (*http.Response, error) { 5366 reqHeaders := make(http.Header) 5367 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 5368 for k, v := range c.header_ { 5369 reqHeaders[k] = v 5370 } 5371 reqHeaders.Set("User-Agent", c.s.userAgent()) 5372 if c.ifNoneMatch_ != "" { 5373 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5374 } 5375 var body io.Reader = nil 5376 c.urlParams_.Set("alt", alt) 5377 c.urlParams_.Set("prettyPrint", "false") 5378 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5379 urls += "?" + c.urlParams_.Encode() 5380 req, err := http.NewRequest("GET", urls, body) 5381 if err != nil { 5382 return nil, err 5383 } 5384 req.Header = reqHeaders 5385 googleapi.Expand(req.URL, map[string]string{ 5386 "name": c.name, 5387 }) 5388 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5389} 5390 5391// Do executes the "cloudbuild.projects.githubEnterpriseConfigs.get" call. 5392// Exactly one of *GitHubEnterpriseConfig or error will be non-nil. Any 5393// non-2xx status code is an error. Response headers are in either 5394// *GitHubEnterpriseConfig.ServerResponse.Header or (if a response was 5395// returned at all) in error.(*googleapi.Error).Header. Use 5396// googleapi.IsNotModified to check whether the returned error was 5397// because http.StatusNotModified was returned. 5398func (c *ProjectsGithubEnterpriseConfigsGetCall) Do(opts ...googleapi.CallOption) (*GitHubEnterpriseConfig, error) { 5399 gensupport.SetOptions(c.urlParams_, opts...) 5400 res, err := c.doRequest("json") 5401 if res != nil && res.StatusCode == http.StatusNotModified { 5402 if res.Body != nil { 5403 res.Body.Close() 5404 } 5405 return nil, &googleapi.Error{ 5406 Code: res.StatusCode, 5407 Header: res.Header, 5408 } 5409 } 5410 if err != nil { 5411 return nil, err 5412 } 5413 defer googleapi.CloseBody(res) 5414 if err := googleapi.CheckResponse(res); err != nil { 5415 return nil, err 5416 } 5417 ret := &GitHubEnterpriseConfig{ 5418 ServerResponse: googleapi.ServerResponse{ 5419 Header: res.Header, 5420 HTTPStatusCode: res.StatusCode, 5421 }, 5422 } 5423 target := &ret 5424 if err := gensupport.DecodeResponse(target, res); err != nil { 5425 return nil, err 5426 } 5427 return ret, nil 5428 // { 5429 // "description": "Retrieve a GitHubEnterpriseConfig. This API is experimental.", 5430 // "flatPath": "v1/projects/{projectsId}/githubEnterpriseConfigs/{githubEnterpriseConfigsId}", 5431 // "httpMethod": "GET", 5432 // "id": "cloudbuild.projects.githubEnterpriseConfigs.get", 5433 // "parameterOrder": [ 5434 // "name" 5435 // ], 5436 // "parameters": { 5437 // "configId": { 5438 // "description": "Unique identifier of the `GitHubEnterpriseConfig`", 5439 // "location": "query", 5440 // "type": "string" 5441 // }, 5442 // "name": { 5443 // "description": "This field should contain the name of the enterprise config resource. For example: \"projects/{$project_id}/githubEnterpriseConfig/{$config_id}\"", 5444 // "location": "path", 5445 // "pattern": "^projects/[^/]+/githubEnterpriseConfigs/[^/]+$", 5446 // "required": true, 5447 // "type": "string" 5448 // }, 5449 // "projectId": { 5450 // "description": "ID of the project", 5451 // "location": "query", 5452 // "type": "string" 5453 // } 5454 // }, 5455 // "path": "v1/{+name}", 5456 // "response": { 5457 // "$ref": "GitHubEnterpriseConfig" 5458 // }, 5459 // "scopes": [ 5460 // "https://www.googleapis.com/auth/cloud-platform" 5461 // ] 5462 // } 5463 5464} 5465 5466// method id "cloudbuild.projects.githubEnterpriseConfigs.list": 5467 5468type ProjectsGithubEnterpriseConfigsListCall struct { 5469 s *Service 5470 parent string 5471 urlParams_ gensupport.URLParams 5472 ifNoneMatch_ string 5473 ctx_ context.Context 5474 header_ http.Header 5475} 5476 5477// List: List all GitHubEnterpriseConfigs for a given project. This API 5478// is experimental. 5479// 5480// - parent: Name of the parent project. For example: 5481// projects/{$project_number} or projects/{$project_id}. 5482func (r *ProjectsGithubEnterpriseConfigsService) List(parent string) *ProjectsGithubEnterpriseConfigsListCall { 5483 c := &ProjectsGithubEnterpriseConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5484 c.parent = parent 5485 return c 5486} 5487 5488// ProjectId sets the optional parameter "projectId": ID of the project 5489func (c *ProjectsGithubEnterpriseConfigsListCall) ProjectId(projectId string) *ProjectsGithubEnterpriseConfigsListCall { 5490 c.urlParams_.Set("projectId", projectId) 5491 return c 5492} 5493 5494// Fields allows partial responses to be retrieved. See 5495// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5496// for more information. 5497func (c *ProjectsGithubEnterpriseConfigsListCall) Fields(s ...googleapi.Field) *ProjectsGithubEnterpriseConfigsListCall { 5498 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5499 return c 5500} 5501 5502// IfNoneMatch sets the optional parameter which makes the operation 5503// fail if the object's ETag matches the given value. This is useful for 5504// getting updates only after the object has changed since the last 5505// request. Use googleapi.IsNotModified to check whether the response 5506// error from Do is the result of In-None-Match. 5507func (c *ProjectsGithubEnterpriseConfigsListCall) IfNoneMatch(entityTag string) *ProjectsGithubEnterpriseConfigsListCall { 5508 c.ifNoneMatch_ = entityTag 5509 return c 5510} 5511 5512// Context sets the context to be used in this call's Do method. Any 5513// pending HTTP request will be aborted if the provided context is 5514// canceled. 5515func (c *ProjectsGithubEnterpriseConfigsListCall) Context(ctx context.Context) *ProjectsGithubEnterpriseConfigsListCall { 5516 c.ctx_ = ctx 5517 return c 5518} 5519 5520// Header returns an http.Header that can be modified by the caller to 5521// add HTTP headers to the request. 5522func (c *ProjectsGithubEnterpriseConfigsListCall) Header() http.Header { 5523 if c.header_ == nil { 5524 c.header_ = make(http.Header) 5525 } 5526 return c.header_ 5527} 5528 5529func (c *ProjectsGithubEnterpriseConfigsListCall) doRequest(alt string) (*http.Response, error) { 5530 reqHeaders := make(http.Header) 5531 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 5532 for k, v := range c.header_ { 5533 reqHeaders[k] = v 5534 } 5535 reqHeaders.Set("User-Agent", c.s.userAgent()) 5536 if c.ifNoneMatch_ != "" { 5537 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5538 } 5539 var body io.Reader = nil 5540 c.urlParams_.Set("alt", alt) 5541 c.urlParams_.Set("prettyPrint", "false") 5542 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/githubEnterpriseConfigs") 5543 urls += "?" + c.urlParams_.Encode() 5544 req, err := http.NewRequest("GET", urls, body) 5545 if err != nil { 5546 return nil, err 5547 } 5548 req.Header = reqHeaders 5549 googleapi.Expand(req.URL, map[string]string{ 5550 "parent": c.parent, 5551 }) 5552 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5553} 5554 5555// Do executes the "cloudbuild.projects.githubEnterpriseConfigs.list" call. 5556// Exactly one of *ListGithubEnterpriseConfigsResponse or error will be 5557// non-nil. Any non-2xx status code is an error. Response headers are in 5558// either *ListGithubEnterpriseConfigsResponse.ServerResponse.Header or 5559// (if a response was returned at all) in 5560// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 5561// whether the returned error was because http.StatusNotModified was 5562// returned. 5563func (c *ProjectsGithubEnterpriseConfigsListCall) Do(opts ...googleapi.CallOption) (*ListGithubEnterpriseConfigsResponse, error) { 5564 gensupport.SetOptions(c.urlParams_, opts...) 5565 res, err := c.doRequest("json") 5566 if res != nil && res.StatusCode == http.StatusNotModified { 5567 if res.Body != nil { 5568 res.Body.Close() 5569 } 5570 return nil, &googleapi.Error{ 5571 Code: res.StatusCode, 5572 Header: res.Header, 5573 } 5574 } 5575 if err != nil { 5576 return nil, err 5577 } 5578 defer googleapi.CloseBody(res) 5579 if err := googleapi.CheckResponse(res); err != nil { 5580 return nil, err 5581 } 5582 ret := &ListGithubEnterpriseConfigsResponse{ 5583 ServerResponse: googleapi.ServerResponse{ 5584 Header: res.Header, 5585 HTTPStatusCode: res.StatusCode, 5586 }, 5587 } 5588 target := &ret 5589 if err := gensupport.DecodeResponse(target, res); err != nil { 5590 return nil, err 5591 } 5592 return ret, nil 5593 // { 5594 // "description": "List all GitHubEnterpriseConfigs for a given project. This API is experimental.", 5595 // "flatPath": "v1/projects/{projectsId}/githubEnterpriseConfigs", 5596 // "httpMethod": "GET", 5597 // "id": "cloudbuild.projects.githubEnterpriseConfigs.list", 5598 // "parameterOrder": [ 5599 // "parent" 5600 // ], 5601 // "parameters": { 5602 // "parent": { 5603 // "description": "Name of the parent project. For example: projects/{$project_number} or projects/{$project_id}", 5604 // "location": "path", 5605 // "pattern": "^projects/[^/]+$", 5606 // "required": true, 5607 // "type": "string" 5608 // }, 5609 // "projectId": { 5610 // "description": "ID of the project", 5611 // "location": "query", 5612 // "type": "string" 5613 // } 5614 // }, 5615 // "path": "v1/{+parent}/githubEnterpriseConfigs", 5616 // "response": { 5617 // "$ref": "ListGithubEnterpriseConfigsResponse" 5618 // }, 5619 // "scopes": [ 5620 // "https://www.googleapis.com/auth/cloud-platform" 5621 // ] 5622 // } 5623 5624} 5625 5626// method id "cloudbuild.projects.githubEnterpriseConfigs.patch": 5627 5628type ProjectsGithubEnterpriseConfigsPatchCall struct { 5629 s *Service 5630 name string 5631 githubenterpriseconfig *GitHubEnterpriseConfig 5632 urlParams_ gensupport.URLParams 5633 ctx_ context.Context 5634 header_ http.Header 5635} 5636 5637// Patch: Update an association between a GCP project and a GitHub 5638// Enterprise server. This API is experimental. 5639// 5640// - name: Optional. The full resource name for the 5641// GitHubEnterpriseConfig For example: 5642// "projects/{$project_id}/githubEnterpriseConfig/{$config_id}". 5643func (r *ProjectsGithubEnterpriseConfigsService) Patch(name string, githubenterpriseconfig *GitHubEnterpriseConfig) *ProjectsGithubEnterpriseConfigsPatchCall { 5644 c := &ProjectsGithubEnterpriseConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5645 c.name = name 5646 c.githubenterpriseconfig = githubenterpriseconfig 5647 return c 5648} 5649 5650// UpdateMask sets the optional parameter "updateMask": Update mask for 5651// the resource. If this is set, the server will only update the fields 5652// specified in the field mask. Otherwise, a full update of the mutable 5653// resource fields will be performed. 5654func (c *ProjectsGithubEnterpriseConfigsPatchCall) UpdateMask(updateMask string) *ProjectsGithubEnterpriseConfigsPatchCall { 5655 c.urlParams_.Set("updateMask", updateMask) 5656 return c 5657} 5658 5659// Fields allows partial responses to be retrieved. See 5660// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5661// for more information. 5662func (c *ProjectsGithubEnterpriseConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsGithubEnterpriseConfigsPatchCall { 5663 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5664 return c 5665} 5666 5667// Context sets the context to be used in this call's Do method. Any 5668// pending HTTP request will be aborted if the provided context is 5669// canceled. 5670func (c *ProjectsGithubEnterpriseConfigsPatchCall) Context(ctx context.Context) *ProjectsGithubEnterpriseConfigsPatchCall { 5671 c.ctx_ = ctx 5672 return c 5673} 5674 5675// Header returns an http.Header that can be modified by the caller to 5676// add HTTP headers to the request. 5677func (c *ProjectsGithubEnterpriseConfigsPatchCall) Header() http.Header { 5678 if c.header_ == nil { 5679 c.header_ = make(http.Header) 5680 } 5681 return c.header_ 5682} 5683 5684func (c *ProjectsGithubEnterpriseConfigsPatchCall) doRequest(alt string) (*http.Response, error) { 5685 reqHeaders := make(http.Header) 5686 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 5687 for k, v := range c.header_ { 5688 reqHeaders[k] = v 5689 } 5690 reqHeaders.Set("User-Agent", c.s.userAgent()) 5691 var body io.Reader = nil 5692 body, err := googleapi.WithoutDataWrapper.JSONReader(c.githubenterpriseconfig) 5693 if err != nil { 5694 return nil, err 5695 } 5696 reqHeaders.Set("Content-Type", "application/json") 5697 c.urlParams_.Set("alt", alt) 5698 c.urlParams_.Set("prettyPrint", "false") 5699 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5700 urls += "?" + c.urlParams_.Encode() 5701 req, err := http.NewRequest("PATCH", urls, body) 5702 if err != nil { 5703 return nil, err 5704 } 5705 req.Header = reqHeaders 5706 googleapi.Expand(req.URL, map[string]string{ 5707 "name": c.name, 5708 }) 5709 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5710} 5711 5712// Do executes the "cloudbuild.projects.githubEnterpriseConfigs.patch" call. 5713// Exactly one of *Operation or error will be non-nil. Any non-2xx 5714// status code is an error. Response headers are in either 5715// *Operation.ServerResponse.Header or (if a response was returned at 5716// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5717// to check whether the returned error was because 5718// http.StatusNotModified was returned. 5719func (c *ProjectsGithubEnterpriseConfigsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5720 gensupport.SetOptions(c.urlParams_, opts...) 5721 res, err := c.doRequest("json") 5722 if res != nil && res.StatusCode == http.StatusNotModified { 5723 if res.Body != nil { 5724 res.Body.Close() 5725 } 5726 return nil, &googleapi.Error{ 5727 Code: res.StatusCode, 5728 Header: res.Header, 5729 } 5730 } 5731 if err != nil { 5732 return nil, err 5733 } 5734 defer googleapi.CloseBody(res) 5735 if err := googleapi.CheckResponse(res); err != nil { 5736 return nil, err 5737 } 5738 ret := &Operation{ 5739 ServerResponse: googleapi.ServerResponse{ 5740 Header: res.Header, 5741 HTTPStatusCode: res.StatusCode, 5742 }, 5743 } 5744 target := &ret 5745 if err := gensupport.DecodeResponse(target, res); err != nil { 5746 return nil, err 5747 } 5748 return ret, nil 5749 // { 5750 // "description": "Update an association between a GCP project and a GitHub Enterprise server. This API is experimental.", 5751 // "flatPath": "v1/projects/{projectsId}/githubEnterpriseConfigs/{githubEnterpriseConfigsId}", 5752 // "httpMethod": "PATCH", 5753 // "id": "cloudbuild.projects.githubEnterpriseConfigs.patch", 5754 // "parameterOrder": [ 5755 // "name" 5756 // ], 5757 // "parameters": { 5758 // "name": { 5759 // "description": "Optional. The full resource name for the GitHubEnterpriseConfig For example: \"projects/{$project_id}/githubEnterpriseConfig/{$config_id}\"", 5760 // "location": "path", 5761 // "pattern": "^projects/[^/]+/githubEnterpriseConfigs/[^/]+$", 5762 // "required": true, 5763 // "type": "string" 5764 // }, 5765 // "updateMask": { 5766 // "description": "Update mask for the resource. If this is set, the server will only update the fields specified in the field mask. Otherwise, a full update of the mutable resource fields will be performed.", 5767 // "format": "google-fieldmask", 5768 // "location": "query", 5769 // "type": "string" 5770 // } 5771 // }, 5772 // "path": "v1/{+name}", 5773 // "request": { 5774 // "$ref": "GitHubEnterpriseConfig" 5775 // }, 5776 // "response": { 5777 // "$ref": "Operation" 5778 // }, 5779 // "scopes": [ 5780 // "https://www.googleapis.com/auth/cloud-platform" 5781 // ] 5782 // } 5783 5784} 5785 5786// method id "cloudbuild.projects.locations.builds.approve": 5787 5788type ProjectsLocationsBuildsApproveCall struct { 5789 s *Service 5790 name string 5791 approvebuildrequest *ApproveBuildRequest 5792 urlParams_ gensupport.URLParams 5793 ctx_ context.Context 5794 header_ http.Header 5795} 5796 5797// Approve: Approves or rejects a pending build. If approved, the 5798// returned LRO will be analogous to the LRO returned from a CreateBuild 5799// call. If rejected, the returned LRO will be immediately done. 5800// 5801// - name: Name of the target build. For example: 5802// "projects/{$project_id}/builds/{$build_id}". 5803func (r *ProjectsLocationsBuildsService) Approve(name string, approvebuildrequest *ApproveBuildRequest) *ProjectsLocationsBuildsApproveCall { 5804 c := &ProjectsLocationsBuildsApproveCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5805 c.name = name 5806 c.approvebuildrequest = approvebuildrequest 5807 return c 5808} 5809 5810// Fields allows partial responses to be retrieved. See 5811// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5812// for more information. 5813func (c *ProjectsLocationsBuildsApproveCall) Fields(s ...googleapi.Field) *ProjectsLocationsBuildsApproveCall { 5814 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5815 return c 5816} 5817 5818// Context sets the context to be used in this call's Do method. Any 5819// pending HTTP request will be aborted if the provided context is 5820// canceled. 5821func (c *ProjectsLocationsBuildsApproveCall) Context(ctx context.Context) *ProjectsLocationsBuildsApproveCall { 5822 c.ctx_ = ctx 5823 return c 5824} 5825 5826// Header returns an http.Header that can be modified by the caller to 5827// add HTTP headers to the request. 5828func (c *ProjectsLocationsBuildsApproveCall) Header() http.Header { 5829 if c.header_ == nil { 5830 c.header_ = make(http.Header) 5831 } 5832 return c.header_ 5833} 5834 5835func (c *ProjectsLocationsBuildsApproveCall) doRequest(alt string) (*http.Response, error) { 5836 reqHeaders := make(http.Header) 5837 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 5838 for k, v := range c.header_ { 5839 reqHeaders[k] = v 5840 } 5841 reqHeaders.Set("User-Agent", c.s.userAgent()) 5842 var body io.Reader = nil 5843 body, err := googleapi.WithoutDataWrapper.JSONReader(c.approvebuildrequest) 5844 if err != nil { 5845 return nil, err 5846 } 5847 reqHeaders.Set("Content-Type", "application/json") 5848 c.urlParams_.Set("alt", alt) 5849 c.urlParams_.Set("prettyPrint", "false") 5850 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:approve") 5851 urls += "?" + c.urlParams_.Encode() 5852 req, err := http.NewRequest("POST", urls, body) 5853 if err != nil { 5854 return nil, err 5855 } 5856 req.Header = reqHeaders 5857 googleapi.Expand(req.URL, map[string]string{ 5858 "name": c.name, 5859 }) 5860 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5861} 5862 5863// Do executes the "cloudbuild.projects.locations.builds.approve" call. 5864// Exactly one of *Operation or error will be non-nil. Any non-2xx 5865// status code is an error. Response headers are in either 5866// *Operation.ServerResponse.Header or (if a response was returned at 5867// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 5868// to check whether the returned error was because 5869// http.StatusNotModified was returned. 5870func (c *ProjectsLocationsBuildsApproveCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 5871 gensupport.SetOptions(c.urlParams_, opts...) 5872 res, err := c.doRequest("json") 5873 if res != nil && res.StatusCode == http.StatusNotModified { 5874 if res.Body != nil { 5875 res.Body.Close() 5876 } 5877 return nil, &googleapi.Error{ 5878 Code: res.StatusCode, 5879 Header: res.Header, 5880 } 5881 } 5882 if err != nil { 5883 return nil, err 5884 } 5885 defer googleapi.CloseBody(res) 5886 if err := googleapi.CheckResponse(res); err != nil { 5887 return nil, err 5888 } 5889 ret := &Operation{ 5890 ServerResponse: googleapi.ServerResponse{ 5891 Header: res.Header, 5892 HTTPStatusCode: res.StatusCode, 5893 }, 5894 } 5895 target := &ret 5896 if err := gensupport.DecodeResponse(target, res); err != nil { 5897 return nil, err 5898 } 5899 return ret, nil 5900 // { 5901 // "description": "Approves or rejects a pending build. If approved, the returned LRO will be analogous to the LRO returned from a CreateBuild call. If rejected, the returned LRO will be immediately done.", 5902 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/builds/{buildsId}:approve", 5903 // "httpMethod": "POST", 5904 // "id": "cloudbuild.projects.locations.builds.approve", 5905 // "parameterOrder": [ 5906 // "name" 5907 // ], 5908 // "parameters": { 5909 // "name": { 5910 // "description": "Required. Name of the target build. For example: \"projects/{$project_id}/builds/{$build_id}\"", 5911 // "location": "path", 5912 // "pattern": "^projects/[^/]+/locations/[^/]+/builds/[^/]+$", 5913 // "required": true, 5914 // "type": "string" 5915 // } 5916 // }, 5917 // "path": "v1/{+name}:approve", 5918 // "request": { 5919 // "$ref": "ApproveBuildRequest" 5920 // }, 5921 // "response": { 5922 // "$ref": "Operation" 5923 // }, 5924 // "scopes": [ 5925 // "https://www.googleapis.com/auth/cloud-platform" 5926 // ] 5927 // } 5928 5929} 5930 5931// method id "cloudbuild.projects.locations.builds.cancel": 5932 5933type ProjectsLocationsBuildsCancelCall struct { 5934 s *Service 5935 name string 5936 cancelbuildrequest *CancelBuildRequest 5937 urlParams_ gensupport.URLParams 5938 ctx_ context.Context 5939 header_ http.Header 5940} 5941 5942// Cancel: Cancels a build in progress. 5943// 5944// - name: The name of the `Build` to cancel. Format: 5945// `projects/{project}/locations/{location}/builds/{build}`. 5946func (r *ProjectsLocationsBuildsService) Cancel(name string, cancelbuildrequest *CancelBuildRequest) *ProjectsLocationsBuildsCancelCall { 5947 c := &ProjectsLocationsBuildsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5948 c.name = name 5949 c.cancelbuildrequest = cancelbuildrequest 5950 return c 5951} 5952 5953// Fields allows partial responses to be retrieved. See 5954// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5955// for more information. 5956func (c *ProjectsLocationsBuildsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsBuildsCancelCall { 5957 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5958 return c 5959} 5960 5961// Context sets the context to be used in this call's Do method. Any 5962// pending HTTP request will be aborted if the provided context is 5963// canceled. 5964func (c *ProjectsLocationsBuildsCancelCall) Context(ctx context.Context) *ProjectsLocationsBuildsCancelCall { 5965 c.ctx_ = ctx 5966 return c 5967} 5968 5969// Header returns an http.Header that can be modified by the caller to 5970// add HTTP headers to the request. 5971func (c *ProjectsLocationsBuildsCancelCall) Header() http.Header { 5972 if c.header_ == nil { 5973 c.header_ = make(http.Header) 5974 } 5975 return c.header_ 5976} 5977 5978func (c *ProjectsLocationsBuildsCancelCall) doRequest(alt string) (*http.Response, error) { 5979 reqHeaders := make(http.Header) 5980 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 5981 for k, v := range c.header_ { 5982 reqHeaders[k] = v 5983 } 5984 reqHeaders.Set("User-Agent", c.s.userAgent()) 5985 var body io.Reader = nil 5986 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cancelbuildrequest) 5987 if err != nil { 5988 return nil, err 5989 } 5990 reqHeaders.Set("Content-Type", "application/json") 5991 c.urlParams_.Set("alt", alt) 5992 c.urlParams_.Set("prettyPrint", "false") 5993 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") 5994 urls += "?" + c.urlParams_.Encode() 5995 req, err := http.NewRequest("POST", urls, body) 5996 if err != nil { 5997 return nil, err 5998 } 5999 req.Header = reqHeaders 6000 googleapi.Expand(req.URL, map[string]string{ 6001 "name": c.name, 6002 }) 6003 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6004} 6005 6006// Do executes the "cloudbuild.projects.locations.builds.cancel" call. 6007// Exactly one of *Build or error will be non-nil. Any non-2xx status 6008// code is an error. Response headers are in either 6009// *Build.ServerResponse.Header or (if a response was returned at all) 6010// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6011// check whether the returned error was because http.StatusNotModified 6012// was returned. 6013func (c *ProjectsLocationsBuildsCancelCall) Do(opts ...googleapi.CallOption) (*Build, error) { 6014 gensupport.SetOptions(c.urlParams_, opts...) 6015 res, err := c.doRequest("json") 6016 if res != nil && res.StatusCode == http.StatusNotModified { 6017 if res.Body != nil { 6018 res.Body.Close() 6019 } 6020 return nil, &googleapi.Error{ 6021 Code: res.StatusCode, 6022 Header: res.Header, 6023 } 6024 } 6025 if err != nil { 6026 return nil, err 6027 } 6028 defer googleapi.CloseBody(res) 6029 if err := googleapi.CheckResponse(res); err != nil { 6030 return nil, err 6031 } 6032 ret := &Build{ 6033 ServerResponse: googleapi.ServerResponse{ 6034 Header: res.Header, 6035 HTTPStatusCode: res.StatusCode, 6036 }, 6037 } 6038 target := &ret 6039 if err := gensupport.DecodeResponse(target, res); err != nil { 6040 return nil, err 6041 } 6042 return ret, nil 6043 // { 6044 // "description": "Cancels a build in progress.", 6045 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/builds/{buildsId}:cancel", 6046 // "httpMethod": "POST", 6047 // "id": "cloudbuild.projects.locations.builds.cancel", 6048 // "parameterOrder": [ 6049 // "name" 6050 // ], 6051 // "parameters": { 6052 // "name": { 6053 // "description": "The name of the `Build` to cancel. Format: `projects/{project}/locations/{location}/builds/{build}`", 6054 // "location": "path", 6055 // "pattern": "^projects/[^/]+/locations/[^/]+/builds/[^/]+$", 6056 // "required": true, 6057 // "type": "string" 6058 // } 6059 // }, 6060 // "path": "v1/{+name}:cancel", 6061 // "request": { 6062 // "$ref": "CancelBuildRequest" 6063 // }, 6064 // "response": { 6065 // "$ref": "Build" 6066 // }, 6067 // "scopes": [ 6068 // "https://www.googleapis.com/auth/cloud-platform" 6069 // ] 6070 // } 6071 6072} 6073 6074// method id "cloudbuild.projects.locations.builds.create": 6075 6076type ProjectsLocationsBuildsCreateCall struct { 6077 s *Service 6078 parent string 6079 build *Build 6080 urlParams_ gensupport.URLParams 6081 ctx_ context.Context 6082 header_ http.Header 6083} 6084 6085// Create: Starts a build with the specified configuration. This method 6086// returns a long-running `Operation`, which includes the build ID. Pass 6087// the build ID to `GetBuild` to determine the build status (such as 6088// `SUCCESS` or `FAILURE`). 6089// 6090// - parent: The parent resource where this build will be created. 6091// Format: `projects/{project}/locations/{location}`. 6092func (r *ProjectsLocationsBuildsService) Create(parent string, build *Build) *ProjectsLocationsBuildsCreateCall { 6093 c := &ProjectsLocationsBuildsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6094 c.parent = parent 6095 c.build = build 6096 return c 6097} 6098 6099// ProjectId sets the optional parameter "projectId": Required. ID of 6100// the project. 6101func (c *ProjectsLocationsBuildsCreateCall) ProjectId(projectId string) *ProjectsLocationsBuildsCreateCall { 6102 c.urlParams_.Set("projectId", projectId) 6103 return c 6104} 6105 6106// Fields allows partial responses to be retrieved. See 6107// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6108// for more information. 6109func (c *ProjectsLocationsBuildsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsBuildsCreateCall { 6110 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6111 return c 6112} 6113 6114// Context sets the context to be used in this call's Do method. Any 6115// pending HTTP request will be aborted if the provided context is 6116// canceled. 6117func (c *ProjectsLocationsBuildsCreateCall) Context(ctx context.Context) *ProjectsLocationsBuildsCreateCall { 6118 c.ctx_ = ctx 6119 return c 6120} 6121 6122// Header returns an http.Header that can be modified by the caller to 6123// add HTTP headers to the request. 6124func (c *ProjectsLocationsBuildsCreateCall) Header() http.Header { 6125 if c.header_ == nil { 6126 c.header_ = make(http.Header) 6127 } 6128 return c.header_ 6129} 6130 6131func (c *ProjectsLocationsBuildsCreateCall) doRequest(alt string) (*http.Response, error) { 6132 reqHeaders := make(http.Header) 6133 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 6134 for k, v := range c.header_ { 6135 reqHeaders[k] = v 6136 } 6137 reqHeaders.Set("User-Agent", c.s.userAgent()) 6138 var body io.Reader = nil 6139 body, err := googleapi.WithoutDataWrapper.JSONReader(c.build) 6140 if err != nil { 6141 return nil, err 6142 } 6143 reqHeaders.Set("Content-Type", "application/json") 6144 c.urlParams_.Set("alt", alt) 6145 c.urlParams_.Set("prettyPrint", "false") 6146 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/builds") 6147 urls += "?" + c.urlParams_.Encode() 6148 req, err := http.NewRequest("POST", urls, body) 6149 if err != nil { 6150 return nil, err 6151 } 6152 req.Header = reqHeaders 6153 googleapi.Expand(req.URL, map[string]string{ 6154 "parent": c.parent, 6155 }) 6156 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6157} 6158 6159// Do executes the "cloudbuild.projects.locations.builds.create" call. 6160// Exactly one of *Operation or error will be non-nil. Any non-2xx 6161// status code is an error. Response headers are in either 6162// *Operation.ServerResponse.Header or (if a response was returned at 6163// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6164// to check whether the returned error was because 6165// http.StatusNotModified was returned. 6166func (c *ProjectsLocationsBuildsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6167 gensupport.SetOptions(c.urlParams_, opts...) 6168 res, err := c.doRequest("json") 6169 if res != nil && res.StatusCode == http.StatusNotModified { 6170 if res.Body != nil { 6171 res.Body.Close() 6172 } 6173 return nil, &googleapi.Error{ 6174 Code: res.StatusCode, 6175 Header: res.Header, 6176 } 6177 } 6178 if err != nil { 6179 return nil, err 6180 } 6181 defer googleapi.CloseBody(res) 6182 if err := googleapi.CheckResponse(res); err != nil { 6183 return nil, err 6184 } 6185 ret := &Operation{ 6186 ServerResponse: googleapi.ServerResponse{ 6187 Header: res.Header, 6188 HTTPStatusCode: res.StatusCode, 6189 }, 6190 } 6191 target := &ret 6192 if err := gensupport.DecodeResponse(target, res); err != nil { 6193 return nil, err 6194 } 6195 return ret, nil 6196 // { 6197 // "description": "Starts a build with the specified configuration. This method returns a long-running `Operation`, which includes the build ID. Pass the build ID to `GetBuild` to determine the build status (such as `SUCCESS` or `FAILURE`).", 6198 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/builds", 6199 // "httpMethod": "POST", 6200 // "id": "cloudbuild.projects.locations.builds.create", 6201 // "parameterOrder": [ 6202 // "parent" 6203 // ], 6204 // "parameters": { 6205 // "parent": { 6206 // "description": "The parent resource where this build will be created. Format: `projects/{project}/locations/{location}`", 6207 // "location": "path", 6208 // "pattern": "^projects/[^/]+/locations/[^/]+$", 6209 // "required": true, 6210 // "type": "string" 6211 // }, 6212 // "projectId": { 6213 // "description": "Required. ID of the project.", 6214 // "location": "query", 6215 // "type": "string" 6216 // } 6217 // }, 6218 // "path": "v1/{+parent}/builds", 6219 // "request": { 6220 // "$ref": "Build" 6221 // }, 6222 // "response": { 6223 // "$ref": "Operation" 6224 // }, 6225 // "scopes": [ 6226 // "https://www.googleapis.com/auth/cloud-platform" 6227 // ] 6228 // } 6229 6230} 6231 6232// method id "cloudbuild.projects.locations.builds.get": 6233 6234type ProjectsLocationsBuildsGetCall struct { 6235 s *Service 6236 name string 6237 urlParams_ gensupport.URLParams 6238 ifNoneMatch_ string 6239 ctx_ context.Context 6240 header_ http.Header 6241} 6242 6243// Get: Returns information about a previously requested build. The 6244// `Build` that is returned includes its status (such as `SUCCESS`, 6245// `FAILURE`, or `WORKING`), and timing information. 6246// 6247// - name: The name of the `Build` to retrieve. Format: 6248// `projects/{project}/locations/{location}/builds/{build}`. 6249func (r *ProjectsLocationsBuildsService) Get(name string) *ProjectsLocationsBuildsGetCall { 6250 c := &ProjectsLocationsBuildsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6251 c.name = name 6252 return c 6253} 6254 6255// Id sets the optional parameter "id": Required. ID of the build. 6256func (c *ProjectsLocationsBuildsGetCall) Id(id string) *ProjectsLocationsBuildsGetCall { 6257 c.urlParams_.Set("id", id) 6258 return c 6259} 6260 6261// ProjectId sets the optional parameter "projectId": Required. ID of 6262// the project. 6263func (c *ProjectsLocationsBuildsGetCall) ProjectId(projectId string) *ProjectsLocationsBuildsGetCall { 6264 c.urlParams_.Set("projectId", projectId) 6265 return c 6266} 6267 6268// Fields allows partial responses to be retrieved. See 6269// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6270// for more information. 6271func (c *ProjectsLocationsBuildsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsBuildsGetCall { 6272 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6273 return c 6274} 6275 6276// IfNoneMatch sets the optional parameter which makes the operation 6277// fail if the object's ETag matches the given value. This is useful for 6278// getting updates only after the object has changed since the last 6279// request. Use googleapi.IsNotModified to check whether the response 6280// error from Do is the result of In-None-Match. 6281func (c *ProjectsLocationsBuildsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsBuildsGetCall { 6282 c.ifNoneMatch_ = entityTag 6283 return c 6284} 6285 6286// Context sets the context to be used in this call's Do method. Any 6287// pending HTTP request will be aborted if the provided context is 6288// canceled. 6289func (c *ProjectsLocationsBuildsGetCall) Context(ctx context.Context) *ProjectsLocationsBuildsGetCall { 6290 c.ctx_ = ctx 6291 return c 6292} 6293 6294// Header returns an http.Header that can be modified by the caller to 6295// add HTTP headers to the request. 6296func (c *ProjectsLocationsBuildsGetCall) Header() http.Header { 6297 if c.header_ == nil { 6298 c.header_ = make(http.Header) 6299 } 6300 return c.header_ 6301} 6302 6303func (c *ProjectsLocationsBuildsGetCall) doRequest(alt string) (*http.Response, error) { 6304 reqHeaders := make(http.Header) 6305 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 6306 for k, v := range c.header_ { 6307 reqHeaders[k] = v 6308 } 6309 reqHeaders.Set("User-Agent", c.s.userAgent()) 6310 if c.ifNoneMatch_ != "" { 6311 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6312 } 6313 var body io.Reader = nil 6314 c.urlParams_.Set("alt", alt) 6315 c.urlParams_.Set("prettyPrint", "false") 6316 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 6317 urls += "?" + c.urlParams_.Encode() 6318 req, err := http.NewRequest("GET", urls, body) 6319 if err != nil { 6320 return nil, err 6321 } 6322 req.Header = reqHeaders 6323 googleapi.Expand(req.URL, map[string]string{ 6324 "name": c.name, 6325 }) 6326 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6327} 6328 6329// Do executes the "cloudbuild.projects.locations.builds.get" call. 6330// Exactly one of *Build or error will be non-nil. Any non-2xx status 6331// code is an error. Response headers are in either 6332// *Build.ServerResponse.Header or (if a response was returned at all) 6333// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6334// check whether the returned error was because http.StatusNotModified 6335// was returned. 6336func (c *ProjectsLocationsBuildsGetCall) Do(opts ...googleapi.CallOption) (*Build, error) { 6337 gensupport.SetOptions(c.urlParams_, opts...) 6338 res, err := c.doRequest("json") 6339 if res != nil && res.StatusCode == http.StatusNotModified { 6340 if res.Body != nil { 6341 res.Body.Close() 6342 } 6343 return nil, &googleapi.Error{ 6344 Code: res.StatusCode, 6345 Header: res.Header, 6346 } 6347 } 6348 if err != nil { 6349 return nil, err 6350 } 6351 defer googleapi.CloseBody(res) 6352 if err := googleapi.CheckResponse(res); err != nil { 6353 return nil, err 6354 } 6355 ret := &Build{ 6356 ServerResponse: googleapi.ServerResponse{ 6357 Header: res.Header, 6358 HTTPStatusCode: res.StatusCode, 6359 }, 6360 } 6361 target := &ret 6362 if err := gensupport.DecodeResponse(target, res); err != nil { 6363 return nil, err 6364 } 6365 return ret, nil 6366 // { 6367 // "description": "Returns information about a previously requested build. The `Build` that is returned includes its status (such as `SUCCESS`, `FAILURE`, or `WORKING`), and timing information.", 6368 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/builds/{buildsId}", 6369 // "httpMethod": "GET", 6370 // "id": "cloudbuild.projects.locations.builds.get", 6371 // "parameterOrder": [ 6372 // "name" 6373 // ], 6374 // "parameters": { 6375 // "id": { 6376 // "description": "Required. ID of the build.", 6377 // "location": "query", 6378 // "type": "string" 6379 // }, 6380 // "name": { 6381 // "description": "The name of the `Build` to retrieve. Format: `projects/{project}/locations/{location}/builds/{build}`", 6382 // "location": "path", 6383 // "pattern": "^projects/[^/]+/locations/[^/]+/builds/[^/]+$", 6384 // "required": true, 6385 // "type": "string" 6386 // }, 6387 // "projectId": { 6388 // "description": "Required. ID of the project.", 6389 // "location": "query", 6390 // "type": "string" 6391 // } 6392 // }, 6393 // "path": "v1/{+name}", 6394 // "response": { 6395 // "$ref": "Build" 6396 // }, 6397 // "scopes": [ 6398 // "https://www.googleapis.com/auth/cloud-platform" 6399 // ] 6400 // } 6401 6402} 6403 6404// method id "cloudbuild.projects.locations.builds.list": 6405 6406type ProjectsLocationsBuildsListCall struct { 6407 s *Service 6408 parent string 6409 urlParams_ gensupport.URLParams 6410 ifNoneMatch_ string 6411 ctx_ context.Context 6412 header_ http.Header 6413} 6414 6415// List: Lists previously requested builds. Previously requested builds 6416// may still be in-progress, or may have finished successfully or 6417// unsuccessfully. 6418// 6419// - parent: The parent of the collection of `Builds`. Format: 6420// `projects/{project}/locations/location`. 6421func (r *ProjectsLocationsBuildsService) List(parent string) *ProjectsLocationsBuildsListCall { 6422 c := &ProjectsLocationsBuildsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6423 c.parent = parent 6424 return c 6425} 6426 6427// Filter sets the optional parameter "filter": The raw filter text to 6428// constrain the results. 6429func (c *ProjectsLocationsBuildsListCall) Filter(filter string) *ProjectsLocationsBuildsListCall { 6430 c.urlParams_.Set("filter", filter) 6431 return c 6432} 6433 6434// PageSize sets the optional parameter "pageSize": Number of results to 6435// return in the list. 6436func (c *ProjectsLocationsBuildsListCall) PageSize(pageSize int64) *ProjectsLocationsBuildsListCall { 6437 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6438 return c 6439} 6440 6441// PageToken sets the optional parameter "pageToken": The page token for 6442// the next page of Builds. If unspecified, the first page of results is 6443// returned. If the token is rejected for any reason, INVALID_ARGUMENT 6444// will be thrown. In this case, the token should be discarded, and 6445// pagination should be restarted from the first page of results. See 6446// https://google.aip.dev/158 for more. 6447func (c *ProjectsLocationsBuildsListCall) PageToken(pageToken string) *ProjectsLocationsBuildsListCall { 6448 c.urlParams_.Set("pageToken", pageToken) 6449 return c 6450} 6451 6452// ProjectId sets the optional parameter "projectId": Required. ID of 6453// the project. 6454func (c *ProjectsLocationsBuildsListCall) ProjectId(projectId string) *ProjectsLocationsBuildsListCall { 6455 c.urlParams_.Set("projectId", projectId) 6456 return c 6457} 6458 6459// Fields allows partial responses to be retrieved. See 6460// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6461// for more information. 6462func (c *ProjectsLocationsBuildsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsBuildsListCall { 6463 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6464 return c 6465} 6466 6467// IfNoneMatch sets the optional parameter which makes the operation 6468// fail if the object's ETag matches the given value. This is useful for 6469// getting updates only after the object has changed since the last 6470// request. Use googleapi.IsNotModified to check whether the response 6471// error from Do is the result of In-None-Match. 6472func (c *ProjectsLocationsBuildsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsBuildsListCall { 6473 c.ifNoneMatch_ = entityTag 6474 return c 6475} 6476 6477// Context sets the context to be used in this call's Do method. Any 6478// pending HTTP request will be aborted if the provided context is 6479// canceled. 6480func (c *ProjectsLocationsBuildsListCall) Context(ctx context.Context) *ProjectsLocationsBuildsListCall { 6481 c.ctx_ = ctx 6482 return c 6483} 6484 6485// Header returns an http.Header that can be modified by the caller to 6486// add HTTP headers to the request. 6487func (c *ProjectsLocationsBuildsListCall) Header() http.Header { 6488 if c.header_ == nil { 6489 c.header_ = make(http.Header) 6490 } 6491 return c.header_ 6492} 6493 6494func (c *ProjectsLocationsBuildsListCall) doRequest(alt string) (*http.Response, error) { 6495 reqHeaders := make(http.Header) 6496 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 6497 for k, v := range c.header_ { 6498 reqHeaders[k] = v 6499 } 6500 reqHeaders.Set("User-Agent", c.s.userAgent()) 6501 if c.ifNoneMatch_ != "" { 6502 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6503 } 6504 var body io.Reader = nil 6505 c.urlParams_.Set("alt", alt) 6506 c.urlParams_.Set("prettyPrint", "false") 6507 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/builds") 6508 urls += "?" + c.urlParams_.Encode() 6509 req, err := http.NewRequest("GET", urls, body) 6510 if err != nil { 6511 return nil, err 6512 } 6513 req.Header = reqHeaders 6514 googleapi.Expand(req.URL, map[string]string{ 6515 "parent": c.parent, 6516 }) 6517 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6518} 6519 6520// Do executes the "cloudbuild.projects.locations.builds.list" call. 6521// Exactly one of *ListBuildsResponse or error will be non-nil. Any 6522// non-2xx status code is an error. Response headers are in either 6523// *ListBuildsResponse.ServerResponse.Header or (if a response was 6524// returned at all) in error.(*googleapi.Error).Header. Use 6525// googleapi.IsNotModified to check whether the returned error was 6526// because http.StatusNotModified was returned. 6527func (c *ProjectsLocationsBuildsListCall) Do(opts ...googleapi.CallOption) (*ListBuildsResponse, error) { 6528 gensupport.SetOptions(c.urlParams_, opts...) 6529 res, err := c.doRequest("json") 6530 if res != nil && res.StatusCode == http.StatusNotModified { 6531 if res.Body != nil { 6532 res.Body.Close() 6533 } 6534 return nil, &googleapi.Error{ 6535 Code: res.StatusCode, 6536 Header: res.Header, 6537 } 6538 } 6539 if err != nil { 6540 return nil, err 6541 } 6542 defer googleapi.CloseBody(res) 6543 if err := googleapi.CheckResponse(res); err != nil { 6544 return nil, err 6545 } 6546 ret := &ListBuildsResponse{ 6547 ServerResponse: googleapi.ServerResponse{ 6548 Header: res.Header, 6549 HTTPStatusCode: res.StatusCode, 6550 }, 6551 } 6552 target := &ret 6553 if err := gensupport.DecodeResponse(target, res); err != nil { 6554 return nil, err 6555 } 6556 return ret, nil 6557 // { 6558 // "description": "Lists previously requested builds. Previously requested builds may still be in-progress, or may have finished successfully or unsuccessfully.", 6559 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/builds", 6560 // "httpMethod": "GET", 6561 // "id": "cloudbuild.projects.locations.builds.list", 6562 // "parameterOrder": [ 6563 // "parent" 6564 // ], 6565 // "parameters": { 6566 // "filter": { 6567 // "description": "The raw filter text to constrain the results.", 6568 // "location": "query", 6569 // "type": "string" 6570 // }, 6571 // "pageSize": { 6572 // "description": "Number of results to return in the list.", 6573 // "format": "int32", 6574 // "location": "query", 6575 // "type": "integer" 6576 // }, 6577 // "pageToken": { 6578 // "description": "The page token for the next page of Builds. If unspecified, the first page of results is returned. If the token is rejected for any reason, INVALID_ARGUMENT will be thrown. In this case, the token should be discarded, and pagination should be restarted from the first page of results. See https://google.aip.dev/158 for more.", 6579 // "location": "query", 6580 // "type": "string" 6581 // }, 6582 // "parent": { 6583 // "description": "The parent of the collection of `Builds`. Format: `projects/{project}/locations/location`", 6584 // "location": "path", 6585 // "pattern": "^projects/[^/]+/locations/[^/]+$", 6586 // "required": true, 6587 // "type": "string" 6588 // }, 6589 // "projectId": { 6590 // "description": "Required. ID of the project.", 6591 // "location": "query", 6592 // "type": "string" 6593 // } 6594 // }, 6595 // "path": "v1/{+parent}/builds", 6596 // "response": { 6597 // "$ref": "ListBuildsResponse" 6598 // }, 6599 // "scopes": [ 6600 // "https://www.googleapis.com/auth/cloud-platform" 6601 // ] 6602 // } 6603 6604} 6605 6606// Pages invokes f for each page of results. 6607// A non-nil error returned from f will halt the iteration. 6608// The provided context supersedes any context provided to the Context method. 6609func (c *ProjectsLocationsBuildsListCall) Pages(ctx context.Context, f func(*ListBuildsResponse) error) error { 6610 c.ctx_ = ctx 6611 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6612 for { 6613 x, err := c.Do() 6614 if err != nil { 6615 return err 6616 } 6617 if err := f(x); err != nil { 6618 return err 6619 } 6620 if x.NextPageToken == "" { 6621 return nil 6622 } 6623 c.PageToken(x.NextPageToken) 6624 } 6625} 6626 6627// method id "cloudbuild.projects.locations.builds.retry": 6628 6629type ProjectsLocationsBuildsRetryCall struct { 6630 s *Service 6631 name string 6632 retrybuildrequest *RetryBuildRequest 6633 urlParams_ gensupport.URLParams 6634 ctx_ context.Context 6635 header_ http.Header 6636} 6637 6638// Retry: Creates a new build based on the specified build. This method 6639// creates a new build using the original build request, which may or 6640// may not result in an identical build. For triggered builds: * 6641// Triggered builds resolve to a precise revision; therefore a retry of 6642// a triggered build will result in a build that uses the same revision. 6643// For non-triggered builds that specify `RepoSource`: * If the original 6644// build built from the tip of a branch, the retried build will build 6645// from the tip of that branch, which may not be the same revision as 6646// the original build. * If the original build specified a commit sha or 6647// revision ID, the retried build will use the identical source. For 6648// builds that specify `StorageSource`: * If the original build pulled 6649// source from Google Cloud Storage without specifying the generation of 6650// the object, the new build will use the current object, which may be 6651// different from the original build source. * If the original build 6652// pulled source from Cloud Storage and specified the generation of the 6653// object, the new build will attempt to use the same object, which may 6654// or may not be available depending on the bucket's lifecycle 6655// management settings. 6656// 6657// - name: The name of the `Build` to retry. Format: 6658// `projects/{project}/locations/{location}/builds/{build}`. 6659func (r *ProjectsLocationsBuildsService) Retry(name string, retrybuildrequest *RetryBuildRequest) *ProjectsLocationsBuildsRetryCall { 6660 c := &ProjectsLocationsBuildsRetryCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6661 c.name = name 6662 c.retrybuildrequest = retrybuildrequest 6663 return c 6664} 6665 6666// Fields allows partial responses to be retrieved. See 6667// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6668// for more information. 6669func (c *ProjectsLocationsBuildsRetryCall) Fields(s ...googleapi.Field) *ProjectsLocationsBuildsRetryCall { 6670 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6671 return c 6672} 6673 6674// Context sets the context to be used in this call's Do method. Any 6675// pending HTTP request will be aborted if the provided context is 6676// canceled. 6677func (c *ProjectsLocationsBuildsRetryCall) Context(ctx context.Context) *ProjectsLocationsBuildsRetryCall { 6678 c.ctx_ = ctx 6679 return c 6680} 6681 6682// Header returns an http.Header that can be modified by the caller to 6683// add HTTP headers to the request. 6684func (c *ProjectsLocationsBuildsRetryCall) Header() http.Header { 6685 if c.header_ == nil { 6686 c.header_ = make(http.Header) 6687 } 6688 return c.header_ 6689} 6690 6691func (c *ProjectsLocationsBuildsRetryCall) doRequest(alt string) (*http.Response, error) { 6692 reqHeaders := make(http.Header) 6693 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 6694 for k, v := range c.header_ { 6695 reqHeaders[k] = v 6696 } 6697 reqHeaders.Set("User-Agent", c.s.userAgent()) 6698 var body io.Reader = nil 6699 body, err := googleapi.WithoutDataWrapper.JSONReader(c.retrybuildrequest) 6700 if err != nil { 6701 return nil, err 6702 } 6703 reqHeaders.Set("Content-Type", "application/json") 6704 c.urlParams_.Set("alt", alt) 6705 c.urlParams_.Set("prettyPrint", "false") 6706 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:retry") 6707 urls += "?" + c.urlParams_.Encode() 6708 req, err := http.NewRequest("POST", urls, body) 6709 if err != nil { 6710 return nil, err 6711 } 6712 req.Header = reqHeaders 6713 googleapi.Expand(req.URL, map[string]string{ 6714 "name": c.name, 6715 }) 6716 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6717} 6718 6719// Do executes the "cloudbuild.projects.locations.builds.retry" call. 6720// Exactly one of *Operation or error will be non-nil. Any non-2xx 6721// status code is an error. Response headers are in either 6722// *Operation.ServerResponse.Header or (if a response was returned at 6723// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6724// to check whether the returned error was because 6725// http.StatusNotModified was returned. 6726func (c *ProjectsLocationsBuildsRetryCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6727 gensupport.SetOptions(c.urlParams_, opts...) 6728 res, err := c.doRequest("json") 6729 if res != nil && res.StatusCode == http.StatusNotModified { 6730 if res.Body != nil { 6731 res.Body.Close() 6732 } 6733 return nil, &googleapi.Error{ 6734 Code: res.StatusCode, 6735 Header: res.Header, 6736 } 6737 } 6738 if err != nil { 6739 return nil, err 6740 } 6741 defer googleapi.CloseBody(res) 6742 if err := googleapi.CheckResponse(res); err != nil { 6743 return nil, err 6744 } 6745 ret := &Operation{ 6746 ServerResponse: googleapi.ServerResponse{ 6747 Header: res.Header, 6748 HTTPStatusCode: res.StatusCode, 6749 }, 6750 } 6751 target := &ret 6752 if err := gensupport.DecodeResponse(target, res); err != nil { 6753 return nil, err 6754 } 6755 return ret, nil 6756 // { 6757 // "description": "Creates a new build based on the specified build. This method creates a new build using the original build request, which may or may not result in an identical build. For triggered builds: * Triggered builds resolve to a precise revision; therefore a retry of a triggered build will result in a build that uses the same revision. For non-triggered builds that specify `RepoSource`: * If the original build built from the tip of a branch, the retried build will build from the tip of that branch, which may not be the same revision as the original build. * If the original build specified a commit sha or revision ID, the retried build will use the identical source. For builds that specify `StorageSource`: * If the original build pulled source from Google Cloud Storage without specifying the generation of the object, the new build will use the current object, which may be different from the original build source. * If the original build pulled source from Cloud Storage and specified the generation of the object, the new build will attempt to use the same object, which may or may not be available depending on the bucket's lifecycle management settings.", 6758 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/builds/{buildsId}:retry", 6759 // "httpMethod": "POST", 6760 // "id": "cloudbuild.projects.locations.builds.retry", 6761 // "parameterOrder": [ 6762 // "name" 6763 // ], 6764 // "parameters": { 6765 // "name": { 6766 // "description": "The name of the `Build` to retry. Format: `projects/{project}/locations/{location}/builds/{build}`", 6767 // "location": "path", 6768 // "pattern": "^projects/[^/]+/locations/[^/]+/builds/[^/]+$", 6769 // "required": true, 6770 // "type": "string" 6771 // } 6772 // }, 6773 // "path": "v1/{+name}:retry", 6774 // "request": { 6775 // "$ref": "RetryBuildRequest" 6776 // }, 6777 // "response": { 6778 // "$ref": "Operation" 6779 // }, 6780 // "scopes": [ 6781 // "https://www.googleapis.com/auth/cloud-platform" 6782 // ] 6783 // } 6784 6785} 6786 6787// method id "cloudbuild.projects.locations.githubEnterpriseConfigs.create": 6788 6789type ProjectsLocationsGithubEnterpriseConfigsCreateCall struct { 6790 s *Service 6791 parent string 6792 githubenterpriseconfig *GitHubEnterpriseConfig 6793 urlParams_ gensupport.URLParams 6794 ctx_ context.Context 6795 header_ http.Header 6796} 6797 6798// Create: Create an association between a GCP project and a GitHub 6799// Enterprise server. This API is experimental. 6800// 6801// - parent: Name of the parent project. For example: 6802// projects/{$project_number} or projects/{$project_id}. 6803func (r *ProjectsLocationsGithubEnterpriseConfigsService) Create(parent string, githubenterpriseconfig *GitHubEnterpriseConfig) *ProjectsLocationsGithubEnterpriseConfigsCreateCall { 6804 c := &ProjectsLocationsGithubEnterpriseConfigsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6805 c.parent = parent 6806 c.githubenterpriseconfig = githubenterpriseconfig 6807 return c 6808} 6809 6810// ProjectId sets the optional parameter "projectId": ID of the project. 6811func (c *ProjectsLocationsGithubEnterpriseConfigsCreateCall) ProjectId(projectId string) *ProjectsLocationsGithubEnterpriseConfigsCreateCall { 6812 c.urlParams_.Set("projectId", projectId) 6813 return c 6814} 6815 6816// Fields allows partial responses to be retrieved. See 6817// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6818// for more information. 6819func (c *ProjectsLocationsGithubEnterpriseConfigsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsGithubEnterpriseConfigsCreateCall { 6820 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6821 return c 6822} 6823 6824// Context sets the context to be used in this call's Do method. Any 6825// pending HTTP request will be aborted if the provided context is 6826// canceled. 6827func (c *ProjectsLocationsGithubEnterpriseConfigsCreateCall) Context(ctx context.Context) *ProjectsLocationsGithubEnterpriseConfigsCreateCall { 6828 c.ctx_ = ctx 6829 return c 6830} 6831 6832// Header returns an http.Header that can be modified by the caller to 6833// add HTTP headers to the request. 6834func (c *ProjectsLocationsGithubEnterpriseConfigsCreateCall) Header() http.Header { 6835 if c.header_ == nil { 6836 c.header_ = make(http.Header) 6837 } 6838 return c.header_ 6839} 6840 6841func (c *ProjectsLocationsGithubEnterpriseConfigsCreateCall) doRequest(alt string) (*http.Response, error) { 6842 reqHeaders := make(http.Header) 6843 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 6844 for k, v := range c.header_ { 6845 reqHeaders[k] = v 6846 } 6847 reqHeaders.Set("User-Agent", c.s.userAgent()) 6848 var body io.Reader = nil 6849 body, err := googleapi.WithoutDataWrapper.JSONReader(c.githubenterpriseconfig) 6850 if err != nil { 6851 return nil, err 6852 } 6853 reqHeaders.Set("Content-Type", "application/json") 6854 c.urlParams_.Set("alt", alt) 6855 c.urlParams_.Set("prettyPrint", "false") 6856 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/githubEnterpriseConfigs") 6857 urls += "?" + c.urlParams_.Encode() 6858 req, err := http.NewRequest("POST", urls, body) 6859 if err != nil { 6860 return nil, err 6861 } 6862 req.Header = reqHeaders 6863 googleapi.Expand(req.URL, map[string]string{ 6864 "parent": c.parent, 6865 }) 6866 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6867} 6868 6869// Do executes the "cloudbuild.projects.locations.githubEnterpriseConfigs.create" call. 6870// Exactly one of *Operation or error will be non-nil. Any non-2xx 6871// status code is an error. Response headers are in either 6872// *Operation.ServerResponse.Header or (if a response was returned at 6873// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6874// to check whether the returned error was because 6875// http.StatusNotModified was returned. 6876func (c *ProjectsLocationsGithubEnterpriseConfigsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6877 gensupport.SetOptions(c.urlParams_, opts...) 6878 res, err := c.doRequest("json") 6879 if res != nil && res.StatusCode == http.StatusNotModified { 6880 if res.Body != nil { 6881 res.Body.Close() 6882 } 6883 return nil, &googleapi.Error{ 6884 Code: res.StatusCode, 6885 Header: res.Header, 6886 } 6887 } 6888 if err != nil { 6889 return nil, err 6890 } 6891 defer googleapi.CloseBody(res) 6892 if err := googleapi.CheckResponse(res); err != nil { 6893 return nil, err 6894 } 6895 ret := &Operation{ 6896 ServerResponse: googleapi.ServerResponse{ 6897 Header: res.Header, 6898 HTTPStatusCode: res.StatusCode, 6899 }, 6900 } 6901 target := &ret 6902 if err := gensupport.DecodeResponse(target, res); err != nil { 6903 return nil, err 6904 } 6905 return ret, nil 6906 // { 6907 // "description": "Create an association between a GCP project and a GitHub Enterprise server. This API is experimental.", 6908 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/githubEnterpriseConfigs", 6909 // "httpMethod": "POST", 6910 // "id": "cloudbuild.projects.locations.githubEnterpriseConfigs.create", 6911 // "parameterOrder": [ 6912 // "parent" 6913 // ], 6914 // "parameters": { 6915 // "parent": { 6916 // "description": "Name of the parent project. For example: projects/{$project_number} or projects/{$project_id}", 6917 // "location": "path", 6918 // "pattern": "^projects/[^/]+/locations/[^/]+$", 6919 // "required": true, 6920 // "type": "string" 6921 // }, 6922 // "projectId": { 6923 // "description": "ID of the project.", 6924 // "location": "query", 6925 // "type": "string" 6926 // } 6927 // }, 6928 // "path": "v1/{+parent}/githubEnterpriseConfigs", 6929 // "request": { 6930 // "$ref": "GitHubEnterpriseConfig" 6931 // }, 6932 // "response": { 6933 // "$ref": "Operation" 6934 // }, 6935 // "scopes": [ 6936 // "https://www.googleapis.com/auth/cloud-platform" 6937 // ] 6938 // } 6939 6940} 6941 6942// method id "cloudbuild.projects.locations.githubEnterpriseConfigs.delete": 6943 6944type ProjectsLocationsGithubEnterpriseConfigsDeleteCall struct { 6945 s *Service 6946 name string 6947 urlParams_ gensupport.URLParams 6948 ctx_ context.Context 6949 header_ http.Header 6950} 6951 6952// Delete: Delete an association between a GCP project and a GitHub 6953// Enterprise server. This API is experimental. 6954// 6955// - name: This field should contain the name of the enterprise config 6956// resource. For example: 6957// "projects/{$project_id}/githubEnterpriseConfig/{$config_id}". 6958func (r *ProjectsLocationsGithubEnterpriseConfigsService) Delete(name string) *ProjectsLocationsGithubEnterpriseConfigsDeleteCall { 6959 c := &ProjectsLocationsGithubEnterpriseConfigsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6960 c.name = name 6961 return c 6962} 6963 6964// ConfigId sets the optional parameter "configId": Unique identifier of 6965// the `GitHubEnterpriseConfig` 6966func (c *ProjectsLocationsGithubEnterpriseConfigsDeleteCall) ConfigId(configId string) *ProjectsLocationsGithubEnterpriseConfigsDeleteCall { 6967 c.urlParams_.Set("configId", configId) 6968 return c 6969} 6970 6971// ProjectId sets the optional parameter "projectId": ID of the project 6972func (c *ProjectsLocationsGithubEnterpriseConfigsDeleteCall) ProjectId(projectId string) *ProjectsLocationsGithubEnterpriseConfigsDeleteCall { 6973 c.urlParams_.Set("projectId", projectId) 6974 return c 6975} 6976 6977// Fields allows partial responses to be retrieved. See 6978// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6979// for more information. 6980func (c *ProjectsLocationsGithubEnterpriseConfigsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsGithubEnterpriseConfigsDeleteCall { 6981 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6982 return c 6983} 6984 6985// Context sets the context to be used in this call's Do method. Any 6986// pending HTTP request will be aborted if the provided context is 6987// canceled. 6988func (c *ProjectsLocationsGithubEnterpriseConfigsDeleteCall) Context(ctx context.Context) *ProjectsLocationsGithubEnterpriseConfigsDeleteCall { 6989 c.ctx_ = ctx 6990 return c 6991} 6992 6993// Header returns an http.Header that can be modified by the caller to 6994// add HTTP headers to the request. 6995func (c *ProjectsLocationsGithubEnterpriseConfigsDeleteCall) Header() http.Header { 6996 if c.header_ == nil { 6997 c.header_ = make(http.Header) 6998 } 6999 return c.header_ 7000} 7001 7002func (c *ProjectsLocationsGithubEnterpriseConfigsDeleteCall) doRequest(alt string) (*http.Response, error) { 7003 reqHeaders := make(http.Header) 7004 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 7005 for k, v := range c.header_ { 7006 reqHeaders[k] = v 7007 } 7008 reqHeaders.Set("User-Agent", c.s.userAgent()) 7009 var body io.Reader = nil 7010 c.urlParams_.Set("alt", alt) 7011 c.urlParams_.Set("prettyPrint", "false") 7012 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7013 urls += "?" + c.urlParams_.Encode() 7014 req, err := http.NewRequest("DELETE", urls, body) 7015 if err != nil { 7016 return nil, err 7017 } 7018 req.Header = reqHeaders 7019 googleapi.Expand(req.URL, map[string]string{ 7020 "name": c.name, 7021 }) 7022 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7023} 7024 7025// Do executes the "cloudbuild.projects.locations.githubEnterpriseConfigs.delete" call. 7026// Exactly one of *Operation or error will be non-nil. Any non-2xx 7027// status code is an error. Response headers are in either 7028// *Operation.ServerResponse.Header or (if a response was returned at 7029// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7030// to check whether the returned error was because 7031// http.StatusNotModified was returned. 7032func (c *ProjectsLocationsGithubEnterpriseConfigsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7033 gensupport.SetOptions(c.urlParams_, opts...) 7034 res, err := c.doRequest("json") 7035 if res != nil && res.StatusCode == http.StatusNotModified { 7036 if res.Body != nil { 7037 res.Body.Close() 7038 } 7039 return nil, &googleapi.Error{ 7040 Code: res.StatusCode, 7041 Header: res.Header, 7042 } 7043 } 7044 if err != nil { 7045 return nil, err 7046 } 7047 defer googleapi.CloseBody(res) 7048 if err := googleapi.CheckResponse(res); err != nil { 7049 return nil, err 7050 } 7051 ret := &Operation{ 7052 ServerResponse: googleapi.ServerResponse{ 7053 Header: res.Header, 7054 HTTPStatusCode: res.StatusCode, 7055 }, 7056 } 7057 target := &ret 7058 if err := gensupport.DecodeResponse(target, res); err != nil { 7059 return nil, err 7060 } 7061 return ret, nil 7062 // { 7063 // "description": "Delete an association between a GCP project and a GitHub Enterprise server. This API is experimental.", 7064 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/githubEnterpriseConfigs/{githubEnterpriseConfigsId}", 7065 // "httpMethod": "DELETE", 7066 // "id": "cloudbuild.projects.locations.githubEnterpriseConfigs.delete", 7067 // "parameterOrder": [ 7068 // "name" 7069 // ], 7070 // "parameters": { 7071 // "configId": { 7072 // "description": "Unique identifier of the `GitHubEnterpriseConfig`", 7073 // "location": "query", 7074 // "type": "string" 7075 // }, 7076 // "name": { 7077 // "description": "This field should contain the name of the enterprise config resource. For example: \"projects/{$project_id}/githubEnterpriseConfig/{$config_id}\"", 7078 // "location": "path", 7079 // "pattern": "^projects/[^/]+/locations/[^/]+/githubEnterpriseConfigs/[^/]+$", 7080 // "required": true, 7081 // "type": "string" 7082 // }, 7083 // "projectId": { 7084 // "description": "ID of the project", 7085 // "location": "query", 7086 // "type": "string" 7087 // } 7088 // }, 7089 // "path": "v1/{+name}", 7090 // "response": { 7091 // "$ref": "Operation" 7092 // }, 7093 // "scopes": [ 7094 // "https://www.googleapis.com/auth/cloud-platform" 7095 // ] 7096 // } 7097 7098} 7099 7100// method id "cloudbuild.projects.locations.githubEnterpriseConfigs.get": 7101 7102type ProjectsLocationsGithubEnterpriseConfigsGetCall struct { 7103 s *Service 7104 name string 7105 urlParams_ gensupport.URLParams 7106 ifNoneMatch_ string 7107 ctx_ context.Context 7108 header_ http.Header 7109} 7110 7111// Get: Retrieve a GitHubEnterpriseConfig. This API is experimental. 7112// 7113// - name: This field should contain the name of the enterprise config 7114// resource. For example: 7115// "projects/{$project_id}/githubEnterpriseConfig/{$config_id}". 7116func (r *ProjectsLocationsGithubEnterpriseConfigsService) Get(name string) *ProjectsLocationsGithubEnterpriseConfigsGetCall { 7117 c := &ProjectsLocationsGithubEnterpriseConfigsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7118 c.name = name 7119 return c 7120} 7121 7122// ConfigId sets the optional parameter "configId": Unique identifier of 7123// the `GitHubEnterpriseConfig` 7124func (c *ProjectsLocationsGithubEnterpriseConfigsGetCall) ConfigId(configId string) *ProjectsLocationsGithubEnterpriseConfigsGetCall { 7125 c.urlParams_.Set("configId", configId) 7126 return c 7127} 7128 7129// ProjectId sets the optional parameter "projectId": ID of the project 7130func (c *ProjectsLocationsGithubEnterpriseConfigsGetCall) ProjectId(projectId string) *ProjectsLocationsGithubEnterpriseConfigsGetCall { 7131 c.urlParams_.Set("projectId", projectId) 7132 return c 7133} 7134 7135// Fields allows partial responses to be retrieved. See 7136// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7137// for more information. 7138func (c *ProjectsLocationsGithubEnterpriseConfigsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsGithubEnterpriseConfigsGetCall { 7139 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7140 return c 7141} 7142 7143// IfNoneMatch sets the optional parameter which makes the operation 7144// fail if the object's ETag matches the given value. This is useful for 7145// getting updates only after the object has changed since the last 7146// request. Use googleapi.IsNotModified to check whether the response 7147// error from Do is the result of In-None-Match. 7148func (c *ProjectsLocationsGithubEnterpriseConfigsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsGithubEnterpriseConfigsGetCall { 7149 c.ifNoneMatch_ = entityTag 7150 return c 7151} 7152 7153// Context sets the context to be used in this call's Do method. Any 7154// pending HTTP request will be aborted if the provided context is 7155// canceled. 7156func (c *ProjectsLocationsGithubEnterpriseConfigsGetCall) Context(ctx context.Context) *ProjectsLocationsGithubEnterpriseConfigsGetCall { 7157 c.ctx_ = ctx 7158 return c 7159} 7160 7161// Header returns an http.Header that can be modified by the caller to 7162// add HTTP headers to the request. 7163func (c *ProjectsLocationsGithubEnterpriseConfigsGetCall) Header() http.Header { 7164 if c.header_ == nil { 7165 c.header_ = make(http.Header) 7166 } 7167 return c.header_ 7168} 7169 7170func (c *ProjectsLocationsGithubEnterpriseConfigsGetCall) doRequest(alt string) (*http.Response, error) { 7171 reqHeaders := make(http.Header) 7172 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 7173 for k, v := range c.header_ { 7174 reqHeaders[k] = v 7175 } 7176 reqHeaders.Set("User-Agent", c.s.userAgent()) 7177 if c.ifNoneMatch_ != "" { 7178 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7179 } 7180 var body io.Reader = nil 7181 c.urlParams_.Set("alt", alt) 7182 c.urlParams_.Set("prettyPrint", "false") 7183 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7184 urls += "?" + c.urlParams_.Encode() 7185 req, err := http.NewRequest("GET", urls, body) 7186 if err != nil { 7187 return nil, err 7188 } 7189 req.Header = reqHeaders 7190 googleapi.Expand(req.URL, map[string]string{ 7191 "name": c.name, 7192 }) 7193 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7194} 7195 7196// Do executes the "cloudbuild.projects.locations.githubEnterpriseConfigs.get" call. 7197// Exactly one of *GitHubEnterpriseConfig or error will be non-nil. Any 7198// non-2xx status code is an error. Response headers are in either 7199// *GitHubEnterpriseConfig.ServerResponse.Header or (if a response was 7200// returned at all) in error.(*googleapi.Error).Header. Use 7201// googleapi.IsNotModified to check whether the returned error was 7202// because http.StatusNotModified was returned. 7203func (c *ProjectsLocationsGithubEnterpriseConfigsGetCall) Do(opts ...googleapi.CallOption) (*GitHubEnterpriseConfig, error) { 7204 gensupport.SetOptions(c.urlParams_, opts...) 7205 res, err := c.doRequest("json") 7206 if res != nil && res.StatusCode == http.StatusNotModified { 7207 if res.Body != nil { 7208 res.Body.Close() 7209 } 7210 return nil, &googleapi.Error{ 7211 Code: res.StatusCode, 7212 Header: res.Header, 7213 } 7214 } 7215 if err != nil { 7216 return nil, err 7217 } 7218 defer googleapi.CloseBody(res) 7219 if err := googleapi.CheckResponse(res); err != nil { 7220 return nil, err 7221 } 7222 ret := &GitHubEnterpriseConfig{ 7223 ServerResponse: googleapi.ServerResponse{ 7224 Header: res.Header, 7225 HTTPStatusCode: res.StatusCode, 7226 }, 7227 } 7228 target := &ret 7229 if err := gensupport.DecodeResponse(target, res); err != nil { 7230 return nil, err 7231 } 7232 return ret, nil 7233 // { 7234 // "description": "Retrieve a GitHubEnterpriseConfig. This API is experimental.", 7235 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/githubEnterpriseConfigs/{githubEnterpriseConfigsId}", 7236 // "httpMethod": "GET", 7237 // "id": "cloudbuild.projects.locations.githubEnterpriseConfigs.get", 7238 // "parameterOrder": [ 7239 // "name" 7240 // ], 7241 // "parameters": { 7242 // "configId": { 7243 // "description": "Unique identifier of the `GitHubEnterpriseConfig`", 7244 // "location": "query", 7245 // "type": "string" 7246 // }, 7247 // "name": { 7248 // "description": "This field should contain the name of the enterprise config resource. For example: \"projects/{$project_id}/githubEnterpriseConfig/{$config_id}\"", 7249 // "location": "path", 7250 // "pattern": "^projects/[^/]+/locations/[^/]+/githubEnterpriseConfigs/[^/]+$", 7251 // "required": true, 7252 // "type": "string" 7253 // }, 7254 // "projectId": { 7255 // "description": "ID of the project", 7256 // "location": "query", 7257 // "type": "string" 7258 // } 7259 // }, 7260 // "path": "v1/{+name}", 7261 // "response": { 7262 // "$ref": "GitHubEnterpriseConfig" 7263 // }, 7264 // "scopes": [ 7265 // "https://www.googleapis.com/auth/cloud-platform" 7266 // ] 7267 // } 7268 7269} 7270 7271// method id "cloudbuild.projects.locations.githubEnterpriseConfigs.list": 7272 7273type ProjectsLocationsGithubEnterpriseConfigsListCall struct { 7274 s *Service 7275 parent string 7276 urlParams_ gensupport.URLParams 7277 ifNoneMatch_ string 7278 ctx_ context.Context 7279 header_ http.Header 7280} 7281 7282// List: List all GitHubEnterpriseConfigs for a given project. This API 7283// is experimental. 7284// 7285// - parent: Name of the parent project. For example: 7286// projects/{$project_number} or projects/{$project_id}. 7287func (r *ProjectsLocationsGithubEnterpriseConfigsService) List(parent string) *ProjectsLocationsGithubEnterpriseConfigsListCall { 7288 c := &ProjectsLocationsGithubEnterpriseConfigsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7289 c.parent = parent 7290 return c 7291} 7292 7293// ProjectId sets the optional parameter "projectId": ID of the project 7294func (c *ProjectsLocationsGithubEnterpriseConfigsListCall) ProjectId(projectId string) *ProjectsLocationsGithubEnterpriseConfigsListCall { 7295 c.urlParams_.Set("projectId", projectId) 7296 return c 7297} 7298 7299// Fields allows partial responses to be retrieved. See 7300// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7301// for more information. 7302func (c *ProjectsLocationsGithubEnterpriseConfigsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsGithubEnterpriseConfigsListCall { 7303 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7304 return c 7305} 7306 7307// IfNoneMatch sets the optional parameter which makes the operation 7308// fail if the object's ETag matches the given value. This is useful for 7309// getting updates only after the object has changed since the last 7310// request. Use googleapi.IsNotModified to check whether the response 7311// error from Do is the result of In-None-Match. 7312func (c *ProjectsLocationsGithubEnterpriseConfigsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsGithubEnterpriseConfigsListCall { 7313 c.ifNoneMatch_ = entityTag 7314 return c 7315} 7316 7317// Context sets the context to be used in this call's Do method. Any 7318// pending HTTP request will be aborted if the provided context is 7319// canceled. 7320func (c *ProjectsLocationsGithubEnterpriseConfigsListCall) Context(ctx context.Context) *ProjectsLocationsGithubEnterpriseConfigsListCall { 7321 c.ctx_ = ctx 7322 return c 7323} 7324 7325// Header returns an http.Header that can be modified by the caller to 7326// add HTTP headers to the request. 7327func (c *ProjectsLocationsGithubEnterpriseConfigsListCall) Header() http.Header { 7328 if c.header_ == nil { 7329 c.header_ = make(http.Header) 7330 } 7331 return c.header_ 7332} 7333 7334func (c *ProjectsLocationsGithubEnterpriseConfigsListCall) doRequest(alt string) (*http.Response, error) { 7335 reqHeaders := make(http.Header) 7336 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 7337 for k, v := range c.header_ { 7338 reqHeaders[k] = v 7339 } 7340 reqHeaders.Set("User-Agent", c.s.userAgent()) 7341 if c.ifNoneMatch_ != "" { 7342 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7343 } 7344 var body io.Reader = nil 7345 c.urlParams_.Set("alt", alt) 7346 c.urlParams_.Set("prettyPrint", "false") 7347 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/githubEnterpriseConfigs") 7348 urls += "?" + c.urlParams_.Encode() 7349 req, err := http.NewRequest("GET", urls, body) 7350 if err != nil { 7351 return nil, err 7352 } 7353 req.Header = reqHeaders 7354 googleapi.Expand(req.URL, map[string]string{ 7355 "parent": c.parent, 7356 }) 7357 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7358} 7359 7360// Do executes the "cloudbuild.projects.locations.githubEnterpriseConfigs.list" call. 7361// Exactly one of *ListGithubEnterpriseConfigsResponse or error will be 7362// non-nil. Any non-2xx status code is an error. Response headers are in 7363// either *ListGithubEnterpriseConfigsResponse.ServerResponse.Header or 7364// (if a response was returned at all) in 7365// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 7366// whether the returned error was because http.StatusNotModified was 7367// returned. 7368func (c *ProjectsLocationsGithubEnterpriseConfigsListCall) Do(opts ...googleapi.CallOption) (*ListGithubEnterpriseConfigsResponse, error) { 7369 gensupport.SetOptions(c.urlParams_, opts...) 7370 res, err := c.doRequest("json") 7371 if res != nil && res.StatusCode == http.StatusNotModified { 7372 if res.Body != nil { 7373 res.Body.Close() 7374 } 7375 return nil, &googleapi.Error{ 7376 Code: res.StatusCode, 7377 Header: res.Header, 7378 } 7379 } 7380 if err != nil { 7381 return nil, err 7382 } 7383 defer googleapi.CloseBody(res) 7384 if err := googleapi.CheckResponse(res); err != nil { 7385 return nil, err 7386 } 7387 ret := &ListGithubEnterpriseConfigsResponse{ 7388 ServerResponse: googleapi.ServerResponse{ 7389 Header: res.Header, 7390 HTTPStatusCode: res.StatusCode, 7391 }, 7392 } 7393 target := &ret 7394 if err := gensupport.DecodeResponse(target, res); err != nil { 7395 return nil, err 7396 } 7397 return ret, nil 7398 // { 7399 // "description": "List all GitHubEnterpriseConfigs for a given project. This API is experimental.", 7400 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/githubEnterpriseConfigs", 7401 // "httpMethod": "GET", 7402 // "id": "cloudbuild.projects.locations.githubEnterpriseConfigs.list", 7403 // "parameterOrder": [ 7404 // "parent" 7405 // ], 7406 // "parameters": { 7407 // "parent": { 7408 // "description": "Name of the parent project. For example: projects/{$project_number} or projects/{$project_id}", 7409 // "location": "path", 7410 // "pattern": "^projects/[^/]+/locations/[^/]+$", 7411 // "required": true, 7412 // "type": "string" 7413 // }, 7414 // "projectId": { 7415 // "description": "ID of the project", 7416 // "location": "query", 7417 // "type": "string" 7418 // } 7419 // }, 7420 // "path": "v1/{+parent}/githubEnterpriseConfigs", 7421 // "response": { 7422 // "$ref": "ListGithubEnterpriseConfigsResponse" 7423 // }, 7424 // "scopes": [ 7425 // "https://www.googleapis.com/auth/cloud-platform" 7426 // ] 7427 // } 7428 7429} 7430 7431// method id "cloudbuild.projects.locations.githubEnterpriseConfigs.patch": 7432 7433type ProjectsLocationsGithubEnterpriseConfigsPatchCall struct { 7434 s *Service 7435 name string 7436 githubenterpriseconfig *GitHubEnterpriseConfig 7437 urlParams_ gensupport.URLParams 7438 ctx_ context.Context 7439 header_ http.Header 7440} 7441 7442// Patch: Update an association between a GCP project and a GitHub 7443// Enterprise server. This API is experimental. 7444// 7445// - name: Optional. The full resource name for the 7446// GitHubEnterpriseConfig For example: 7447// "projects/{$project_id}/githubEnterpriseConfig/{$config_id}". 7448func (r *ProjectsLocationsGithubEnterpriseConfigsService) Patch(name string, githubenterpriseconfig *GitHubEnterpriseConfig) *ProjectsLocationsGithubEnterpriseConfigsPatchCall { 7449 c := &ProjectsLocationsGithubEnterpriseConfigsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7450 c.name = name 7451 c.githubenterpriseconfig = githubenterpriseconfig 7452 return c 7453} 7454 7455// UpdateMask sets the optional parameter "updateMask": Update mask for 7456// the resource. If this is set, the server will only update the fields 7457// specified in the field mask. Otherwise, a full update of the mutable 7458// resource fields will be performed. 7459func (c *ProjectsLocationsGithubEnterpriseConfigsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsGithubEnterpriseConfigsPatchCall { 7460 c.urlParams_.Set("updateMask", updateMask) 7461 return c 7462} 7463 7464// Fields allows partial responses to be retrieved. See 7465// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7466// for more information. 7467func (c *ProjectsLocationsGithubEnterpriseConfigsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsGithubEnterpriseConfigsPatchCall { 7468 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7469 return c 7470} 7471 7472// Context sets the context to be used in this call's Do method. Any 7473// pending HTTP request will be aborted if the provided context is 7474// canceled. 7475func (c *ProjectsLocationsGithubEnterpriseConfigsPatchCall) Context(ctx context.Context) *ProjectsLocationsGithubEnterpriseConfigsPatchCall { 7476 c.ctx_ = ctx 7477 return c 7478} 7479 7480// Header returns an http.Header that can be modified by the caller to 7481// add HTTP headers to the request. 7482func (c *ProjectsLocationsGithubEnterpriseConfigsPatchCall) Header() http.Header { 7483 if c.header_ == nil { 7484 c.header_ = make(http.Header) 7485 } 7486 return c.header_ 7487} 7488 7489func (c *ProjectsLocationsGithubEnterpriseConfigsPatchCall) doRequest(alt string) (*http.Response, error) { 7490 reqHeaders := make(http.Header) 7491 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 7492 for k, v := range c.header_ { 7493 reqHeaders[k] = v 7494 } 7495 reqHeaders.Set("User-Agent", c.s.userAgent()) 7496 var body io.Reader = nil 7497 body, err := googleapi.WithoutDataWrapper.JSONReader(c.githubenterpriseconfig) 7498 if err != nil { 7499 return nil, err 7500 } 7501 reqHeaders.Set("Content-Type", "application/json") 7502 c.urlParams_.Set("alt", alt) 7503 c.urlParams_.Set("prettyPrint", "false") 7504 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7505 urls += "?" + c.urlParams_.Encode() 7506 req, err := http.NewRequest("PATCH", urls, body) 7507 if err != nil { 7508 return nil, err 7509 } 7510 req.Header = reqHeaders 7511 googleapi.Expand(req.URL, map[string]string{ 7512 "name": c.name, 7513 }) 7514 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7515} 7516 7517// Do executes the "cloudbuild.projects.locations.githubEnterpriseConfigs.patch" call. 7518// Exactly one of *Operation or error will be non-nil. Any non-2xx 7519// status code is an error. Response headers are in either 7520// *Operation.ServerResponse.Header or (if a response was returned at 7521// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7522// to check whether the returned error was because 7523// http.StatusNotModified was returned. 7524func (c *ProjectsLocationsGithubEnterpriseConfigsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7525 gensupport.SetOptions(c.urlParams_, opts...) 7526 res, err := c.doRequest("json") 7527 if res != nil && res.StatusCode == http.StatusNotModified { 7528 if res.Body != nil { 7529 res.Body.Close() 7530 } 7531 return nil, &googleapi.Error{ 7532 Code: res.StatusCode, 7533 Header: res.Header, 7534 } 7535 } 7536 if err != nil { 7537 return nil, err 7538 } 7539 defer googleapi.CloseBody(res) 7540 if err := googleapi.CheckResponse(res); err != nil { 7541 return nil, err 7542 } 7543 ret := &Operation{ 7544 ServerResponse: googleapi.ServerResponse{ 7545 Header: res.Header, 7546 HTTPStatusCode: res.StatusCode, 7547 }, 7548 } 7549 target := &ret 7550 if err := gensupport.DecodeResponse(target, res); err != nil { 7551 return nil, err 7552 } 7553 return ret, nil 7554 // { 7555 // "description": "Update an association between a GCP project and a GitHub Enterprise server. This API is experimental.", 7556 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/githubEnterpriseConfigs/{githubEnterpriseConfigsId}", 7557 // "httpMethod": "PATCH", 7558 // "id": "cloudbuild.projects.locations.githubEnterpriseConfigs.patch", 7559 // "parameterOrder": [ 7560 // "name" 7561 // ], 7562 // "parameters": { 7563 // "name": { 7564 // "description": "Optional. The full resource name for the GitHubEnterpriseConfig For example: \"projects/{$project_id}/githubEnterpriseConfig/{$config_id}\"", 7565 // "location": "path", 7566 // "pattern": "^projects/[^/]+/locations/[^/]+/githubEnterpriseConfigs/[^/]+$", 7567 // "required": true, 7568 // "type": "string" 7569 // }, 7570 // "updateMask": { 7571 // "description": "Update mask for the resource. If this is set, the server will only update the fields specified in the field mask. Otherwise, a full update of the mutable resource fields will be performed.", 7572 // "format": "google-fieldmask", 7573 // "location": "query", 7574 // "type": "string" 7575 // } 7576 // }, 7577 // "path": "v1/{+name}", 7578 // "request": { 7579 // "$ref": "GitHubEnterpriseConfig" 7580 // }, 7581 // "response": { 7582 // "$ref": "Operation" 7583 // }, 7584 // "scopes": [ 7585 // "https://www.googleapis.com/auth/cloud-platform" 7586 // ] 7587 // } 7588 7589} 7590 7591// method id "cloudbuild.projects.locations.operations.cancel": 7592 7593type ProjectsLocationsOperationsCancelCall struct { 7594 s *Service 7595 name string 7596 canceloperationrequest *CancelOperationRequest 7597 urlParams_ gensupport.URLParams 7598 ctx_ context.Context 7599 header_ http.Header 7600} 7601 7602// Cancel: Starts asynchronous cancellation on a long-running operation. 7603// The server makes a best effort to cancel the operation, but success 7604// is not guaranteed. If the server doesn't support this method, it 7605// returns `google.rpc.Code.UNIMPLEMENTED`. Clients can use 7606// Operations.GetOperation or other methods to check whether the 7607// cancellation succeeded or whether the operation completed despite 7608// cancellation. On successful cancellation, the operation is not 7609// deleted; instead, it becomes an operation with an Operation.error 7610// value with a google.rpc.Status.code of 1, corresponding to 7611// `Code.CANCELLED`. 7612// 7613// - name: The name of the operation resource to be cancelled. 7614func (r *ProjectsLocationsOperationsService) Cancel(name string, canceloperationrequest *CancelOperationRequest) *ProjectsLocationsOperationsCancelCall { 7615 c := &ProjectsLocationsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7616 c.name = name 7617 c.canceloperationrequest = canceloperationrequest 7618 return c 7619} 7620 7621// Fields allows partial responses to be retrieved. See 7622// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7623// for more information. 7624func (c *ProjectsLocationsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsCancelCall { 7625 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7626 return c 7627} 7628 7629// Context sets the context to be used in this call's Do method. Any 7630// pending HTTP request will be aborted if the provided context is 7631// canceled. 7632func (c *ProjectsLocationsOperationsCancelCall) Context(ctx context.Context) *ProjectsLocationsOperationsCancelCall { 7633 c.ctx_ = ctx 7634 return c 7635} 7636 7637// Header returns an http.Header that can be modified by the caller to 7638// add HTTP headers to the request. 7639func (c *ProjectsLocationsOperationsCancelCall) Header() http.Header { 7640 if c.header_ == nil { 7641 c.header_ = make(http.Header) 7642 } 7643 return c.header_ 7644} 7645 7646func (c *ProjectsLocationsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 7647 reqHeaders := make(http.Header) 7648 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 7649 for k, v := range c.header_ { 7650 reqHeaders[k] = v 7651 } 7652 reqHeaders.Set("User-Agent", c.s.userAgent()) 7653 var body io.Reader = nil 7654 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceloperationrequest) 7655 if err != nil { 7656 return nil, err 7657 } 7658 reqHeaders.Set("Content-Type", "application/json") 7659 c.urlParams_.Set("alt", alt) 7660 c.urlParams_.Set("prettyPrint", "false") 7661 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") 7662 urls += "?" + c.urlParams_.Encode() 7663 req, err := http.NewRequest("POST", urls, body) 7664 if err != nil { 7665 return nil, err 7666 } 7667 req.Header = reqHeaders 7668 googleapi.Expand(req.URL, map[string]string{ 7669 "name": c.name, 7670 }) 7671 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7672} 7673 7674// Do executes the "cloudbuild.projects.locations.operations.cancel" call. 7675// Exactly one of *Empty or error will be non-nil. Any non-2xx status 7676// code is an error. Response headers are in either 7677// *Empty.ServerResponse.Header or (if a response was returned at all) 7678// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7679// check whether the returned error was because http.StatusNotModified 7680// was returned. 7681func (c *ProjectsLocationsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 7682 gensupport.SetOptions(c.urlParams_, opts...) 7683 res, err := c.doRequest("json") 7684 if res != nil && res.StatusCode == http.StatusNotModified { 7685 if res.Body != nil { 7686 res.Body.Close() 7687 } 7688 return nil, &googleapi.Error{ 7689 Code: res.StatusCode, 7690 Header: res.Header, 7691 } 7692 } 7693 if err != nil { 7694 return nil, err 7695 } 7696 defer googleapi.CloseBody(res) 7697 if err := googleapi.CheckResponse(res); err != nil { 7698 return nil, err 7699 } 7700 ret := &Empty{ 7701 ServerResponse: googleapi.ServerResponse{ 7702 Header: res.Header, 7703 HTTPStatusCode: res.StatusCode, 7704 }, 7705 } 7706 target := &ret 7707 if err := gensupport.DecodeResponse(target, res); err != nil { 7708 return nil, err 7709 } 7710 return ret, nil 7711 // { 7712 // "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`.", 7713 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}:cancel", 7714 // "httpMethod": "POST", 7715 // "id": "cloudbuild.projects.locations.operations.cancel", 7716 // "parameterOrder": [ 7717 // "name" 7718 // ], 7719 // "parameters": { 7720 // "name": { 7721 // "description": "The name of the operation resource to be cancelled.", 7722 // "location": "path", 7723 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 7724 // "required": true, 7725 // "type": "string" 7726 // } 7727 // }, 7728 // "path": "v1/{+name}:cancel", 7729 // "request": { 7730 // "$ref": "CancelOperationRequest" 7731 // }, 7732 // "response": { 7733 // "$ref": "Empty" 7734 // }, 7735 // "scopes": [ 7736 // "https://www.googleapis.com/auth/cloud-platform" 7737 // ] 7738 // } 7739 7740} 7741 7742// method id "cloudbuild.projects.locations.operations.get": 7743 7744type ProjectsLocationsOperationsGetCall struct { 7745 s *Service 7746 name string 7747 urlParams_ gensupport.URLParams 7748 ifNoneMatch_ string 7749 ctx_ context.Context 7750 header_ http.Header 7751} 7752 7753// Get: Gets the latest state of a long-running operation. Clients can 7754// use this method to poll the operation result at intervals as 7755// recommended by the API service. 7756// 7757// - name: The name of the operation resource. 7758func (r *ProjectsLocationsOperationsService) Get(name string) *ProjectsLocationsOperationsGetCall { 7759 c := &ProjectsLocationsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7760 c.name = name 7761 return c 7762} 7763 7764// Fields allows partial responses to be retrieved. See 7765// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7766// for more information. 7767func (c *ProjectsLocationsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsOperationsGetCall { 7768 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7769 return c 7770} 7771 7772// IfNoneMatch sets the optional parameter which makes the operation 7773// fail if the object's ETag matches the given value. This is useful for 7774// getting updates only after the object has changed since the last 7775// request. Use googleapi.IsNotModified to check whether the response 7776// error from Do is the result of In-None-Match. 7777func (c *ProjectsLocationsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsOperationsGetCall { 7778 c.ifNoneMatch_ = entityTag 7779 return c 7780} 7781 7782// Context sets the context to be used in this call's Do method. Any 7783// pending HTTP request will be aborted if the provided context is 7784// canceled. 7785func (c *ProjectsLocationsOperationsGetCall) Context(ctx context.Context) *ProjectsLocationsOperationsGetCall { 7786 c.ctx_ = ctx 7787 return c 7788} 7789 7790// Header returns an http.Header that can be modified by the caller to 7791// add HTTP headers to the request. 7792func (c *ProjectsLocationsOperationsGetCall) Header() http.Header { 7793 if c.header_ == nil { 7794 c.header_ = make(http.Header) 7795 } 7796 return c.header_ 7797} 7798 7799func (c *ProjectsLocationsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 7800 reqHeaders := make(http.Header) 7801 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 7802 for k, v := range c.header_ { 7803 reqHeaders[k] = v 7804 } 7805 reqHeaders.Set("User-Agent", c.s.userAgent()) 7806 if c.ifNoneMatch_ != "" { 7807 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7808 } 7809 var body io.Reader = nil 7810 c.urlParams_.Set("alt", alt) 7811 c.urlParams_.Set("prettyPrint", "false") 7812 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7813 urls += "?" + c.urlParams_.Encode() 7814 req, err := http.NewRequest("GET", urls, body) 7815 if err != nil { 7816 return nil, err 7817 } 7818 req.Header = reqHeaders 7819 googleapi.Expand(req.URL, map[string]string{ 7820 "name": c.name, 7821 }) 7822 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7823} 7824 7825// Do executes the "cloudbuild.projects.locations.operations.get" call. 7826// Exactly one of *Operation or error will be non-nil. Any non-2xx 7827// status code is an error. Response headers are in either 7828// *Operation.ServerResponse.Header or (if a response was returned at 7829// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7830// to check whether the returned error was because 7831// http.StatusNotModified was returned. 7832func (c *ProjectsLocationsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 7833 gensupport.SetOptions(c.urlParams_, opts...) 7834 res, err := c.doRequest("json") 7835 if res != nil && res.StatusCode == http.StatusNotModified { 7836 if res.Body != nil { 7837 res.Body.Close() 7838 } 7839 return nil, &googleapi.Error{ 7840 Code: res.StatusCode, 7841 Header: res.Header, 7842 } 7843 } 7844 if err != nil { 7845 return nil, err 7846 } 7847 defer googleapi.CloseBody(res) 7848 if err := googleapi.CheckResponse(res); err != nil { 7849 return nil, err 7850 } 7851 ret := &Operation{ 7852 ServerResponse: googleapi.ServerResponse{ 7853 Header: res.Header, 7854 HTTPStatusCode: res.StatusCode, 7855 }, 7856 } 7857 target := &ret 7858 if err := gensupport.DecodeResponse(target, res); err != nil { 7859 return nil, err 7860 } 7861 return ret, nil 7862 // { 7863 // "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.", 7864 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/operations/{operationsId}", 7865 // "httpMethod": "GET", 7866 // "id": "cloudbuild.projects.locations.operations.get", 7867 // "parameterOrder": [ 7868 // "name" 7869 // ], 7870 // "parameters": { 7871 // "name": { 7872 // "description": "The name of the operation resource.", 7873 // "location": "path", 7874 // "pattern": "^projects/[^/]+/locations/[^/]+/operations/[^/]+$", 7875 // "required": true, 7876 // "type": "string" 7877 // } 7878 // }, 7879 // "path": "v1/{+name}", 7880 // "response": { 7881 // "$ref": "Operation" 7882 // }, 7883 // "scopes": [ 7884 // "https://www.googleapis.com/auth/cloud-platform" 7885 // ] 7886 // } 7887 7888} 7889 7890// method id "cloudbuild.projects.locations.triggers.create": 7891 7892type ProjectsLocationsTriggersCreateCall struct { 7893 s *Service 7894 parent string 7895 buildtrigger *BuildTrigger 7896 urlParams_ gensupport.URLParams 7897 ctx_ context.Context 7898 header_ http.Header 7899} 7900 7901// Create: Creates a new `BuildTrigger`. This API is experimental. 7902// 7903// - parent: The parent resource where this trigger will be created. 7904// Format: `projects/{project}/locations/{location}`. 7905func (r *ProjectsLocationsTriggersService) Create(parent string, buildtrigger *BuildTrigger) *ProjectsLocationsTriggersCreateCall { 7906 c := &ProjectsLocationsTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7907 c.parent = parent 7908 c.buildtrigger = buildtrigger 7909 return c 7910} 7911 7912// ProjectId sets the optional parameter "projectId": Required. ID of 7913// the project for which to configure automatic builds. 7914func (c *ProjectsLocationsTriggersCreateCall) ProjectId(projectId string) *ProjectsLocationsTriggersCreateCall { 7915 c.urlParams_.Set("projectId", projectId) 7916 return c 7917} 7918 7919// Fields allows partial responses to be retrieved. See 7920// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7921// for more information. 7922func (c *ProjectsLocationsTriggersCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersCreateCall { 7923 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7924 return c 7925} 7926 7927// Context sets the context to be used in this call's Do method. Any 7928// pending HTTP request will be aborted if the provided context is 7929// canceled. 7930func (c *ProjectsLocationsTriggersCreateCall) Context(ctx context.Context) *ProjectsLocationsTriggersCreateCall { 7931 c.ctx_ = ctx 7932 return c 7933} 7934 7935// Header returns an http.Header that can be modified by the caller to 7936// add HTTP headers to the request. 7937func (c *ProjectsLocationsTriggersCreateCall) Header() http.Header { 7938 if c.header_ == nil { 7939 c.header_ = make(http.Header) 7940 } 7941 return c.header_ 7942} 7943 7944func (c *ProjectsLocationsTriggersCreateCall) doRequest(alt string) (*http.Response, error) { 7945 reqHeaders := make(http.Header) 7946 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 7947 for k, v := range c.header_ { 7948 reqHeaders[k] = v 7949 } 7950 reqHeaders.Set("User-Agent", c.s.userAgent()) 7951 var body io.Reader = nil 7952 body, err := googleapi.WithoutDataWrapper.JSONReader(c.buildtrigger) 7953 if err != nil { 7954 return nil, err 7955 } 7956 reqHeaders.Set("Content-Type", "application/json") 7957 c.urlParams_.Set("alt", alt) 7958 c.urlParams_.Set("prettyPrint", "false") 7959 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/triggers") 7960 urls += "?" + c.urlParams_.Encode() 7961 req, err := http.NewRequest("POST", urls, body) 7962 if err != nil { 7963 return nil, err 7964 } 7965 req.Header = reqHeaders 7966 googleapi.Expand(req.URL, map[string]string{ 7967 "parent": c.parent, 7968 }) 7969 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7970} 7971 7972// Do executes the "cloudbuild.projects.locations.triggers.create" call. 7973// Exactly one of *BuildTrigger or error will be non-nil. Any non-2xx 7974// status code is an error. Response headers are in either 7975// *BuildTrigger.ServerResponse.Header or (if a response was returned at 7976// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 7977// to check whether the returned error was because 7978// http.StatusNotModified was returned. 7979func (c *ProjectsLocationsTriggersCreateCall) Do(opts ...googleapi.CallOption) (*BuildTrigger, error) { 7980 gensupport.SetOptions(c.urlParams_, opts...) 7981 res, err := c.doRequest("json") 7982 if res != nil && res.StatusCode == http.StatusNotModified { 7983 if res.Body != nil { 7984 res.Body.Close() 7985 } 7986 return nil, &googleapi.Error{ 7987 Code: res.StatusCode, 7988 Header: res.Header, 7989 } 7990 } 7991 if err != nil { 7992 return nil, err 7993 } 7994 defer googleapi.CloseBody(res) 7995 if err := googleapi.CheckResponse(res); err != nil { 7996 return nil, err 7997 } 7998 ret := &BuildTrigger{ 7999 ServerResponse: googleapi.ServerResponse{ 8000 Header: res.Header, 8001 HTTPStatusCode: res.StatusCode, 8002 }, 8003 } 8004 target := &ret 8005 if err := gensupport.DecodeResponse(target, res); err != nil { 8006 return nil, err 8007 } 8008 return ret, nil 8009 // { 8010 // "description": "Creates a new `BuildTrigger`. This API is experimental.", 8011 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/triggers", 8012 // "httpMethod": "POST", 8013 // "id": "cloudbuild.projects.locations.triggers.create", 8014 // "parameterOrder": [ 8015 // "parent" 8016 // ], 8017 // "parameters": { 8018 // "parent": { 8019 // "description": "The parent resource where this trigger will be created. Format: `projects/{project}/locations/{location}`", 8020 // "location": "path", 8021 // "pattern": "^projects/[^/]+/locations/[^/]+$", 8022 // "required": true, 8023 // "type": "string" 8024 // }, 8025 // "projectId": { 8026 // "description": "Required. ID of the project for which to configure automatic builds.", 8027 // "location": "query", 8028 // "type": "string" 8029 // } 8030 // }, 8031 // "path": "v1/{+parent}/triggers", 8032 // "request": { 8033 // "$ref": "BuildTrigger" 8034 // }, 8035 // "response": { 8036 // "$ref": "BuildTrigger" 8037 // }, 8038 // "scopes": [ 8039 // "https://www.googleapis.com/auth/cloud-platform" 8040 // ] 8041 // } 8042 8043} 8044 8045// method id "cloudbuild.projects.locations.triggers.delete": 8046 8047type ProjectsLocationsTriggersDeleteCall struct { 8048 s *Service 8049 name string 8050 urlParams_ gensupport.URLParams 8051 ctx_ context.Context 8052 header_ http.Header 8053} 8054 8055// Delete: Deletes a `BuildTrigger` by its project ID and trigger ID. 8056// This API is experimental. 8057// 8058// - name: The name of the `Trigger` to delete. Format: 8059// `projects/{project}/locations/{location}/triggers/{trigger}`. 8060func (r *ProjectsLocationsTriggersService) Delete(name string) *ProjectsLocationsTriggersDeleteCall { 8061 c := &ProjectsLocationsTriggersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8062 c.name = name 8063 return c 8064} 8065 8066// ProjectId sets the optional parameter "projectId": Required. ID of 8067// the project that owns the trigger. 8068func (c *ProjectsLocationsTriggersDeleteCall) ProjectId(projectId string) *ProjectsLocationsTriggersDeleteCall { 8069 c.urlParams_.Set("projectId", projectId) 8070 return c 8071} 8072 8073// TriggerId sets the optional parameter "triggerId": Required. ID of 8074// the `BuildTrigger` to delete. 8075func (c *ProjectsLocationsTriggersDeleteCall) TriggerId(triggerId string) *ProjectsLocationsTriggersDeleteCall { 8076 c.urlParams_.Set("triggerId", triggerId) 8077 return c 8078} 8079 8080// Fields allows partial responses to be retrieved. See 8081// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8082// for more information. 8083func (c *ProjectsLocationsTriggersDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersDeleteCall { 8084 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8085 return c 8086} 8087 8088// Context sets the context to be used in this call's Do method. Any 8089// pending HTTP request will be aborted if the provided context is 8090// canceled. 8091func (c *ProjectsLocationsTriggersDeleteCall) Context(ctx context.Context) *ProjectsLocationsTriggersDeleteCall { 8092 c.ctx_ = ctx 8093 return c 8094} 8095 8096// Header returns an http.Header that can be modified by the caller to 8097// add HTTP headers to the request. 8098func (c *ProjectsLocationsTriggersDeleteCall) Header() http.Header { 8099 if c.header_ == nil { 8100 c.header_ = make(http.Header) 8101 } 8102 return c.header_ 8103} 8104 8105func (c *ProjectsLocationsTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { 8106 reqHeaders := make(http.Header) 8107 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 8108 for k, v := range c.header_ { 8109 reqHeaders[k] = v 8110 } 8111 reqHeaders.Set("User-Agent", c.s.userAgent()) 8112 var body io.Reader = nil 8113 c.urlParams_.Set("alt", alt) 8114 c.urlParams_.Set("prettyPrint", "false") 8115 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 8116 urls += "?" + c.urlParams_.Encode() 8117 req, err := http.NewRequest("DELETE", urls, body) 8118 if err != nil { 8119 return nil, err 8120 } 8121 req.Header = reqHeaders 8122 googleapi.Expand(req.URL, map[string]string{ 8123 "name": c.name, 8124 }) 8125 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8126} 8127 8128// Do executes the "cloudbuild.projects.locations.triggers.delete" call. 8129// Exactly one of *Empty or error will be non-nil. Any non-2xx status 8130// code is an error. Response headers are in either 8131// *Empty.ServerResponse.Header or (if a response was returned at all) 8132// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8133// check whether the returned error was because http.StatusNotModified 8134// was returned. 8135func (c *ProjectsLocationsTriggersDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 8136 gensupport.SetOptions(c.urlParams_, opts...) 8137 res, err := c.doRequest("json") 8138 if res != nil && res.StatusCode == http.StatusNotModified { 8139 if res.Body != nil { 8140 res.Body.Close() 8141 } 8142 return nil, &googleapi.Error{ 8143 Code: res.StatusCode, 8144 Header: res.Header, 8145 } 8146 } 8147 if err != nil { 8148 return nil, err 8149 } 8150 defer googleapi.CloseBody(res) 8151 if err := googleapi.CheckResponse(res); err != nil { 8152 return nil, err 8153 } 8154 ret := &Empty{ 8155 ServerResponse: googleapi.ServerResponse{ 8156 Header: res.Header, 8157 HTTPStatusCode: res.StatusCode, 8158 }, 8159 } 8160 target := &ret 8161 if err := gensupport.DecodeResponse(target, res); err != nil { 8162 return nil, err 8163 } 8164 return ret, nil 8165 // { 8166 // "description": "Deletes a `BuildTrigger` by its project ID and trigger ID. This API is experimental.", 8167 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}", 8168 // "httpMethod": "DELETE", 8169 // "id": "cloudbuild.projects.locations.triggers.delete", 8170 // "parameterOrder": [ 8171 // "name" 8172 // ], 8173 // "parameters": { 8174 // "name": { 8175 // "description": "The name of the `Trigger` to delete. Format: `projects/{project}/locations/{location}/triggers/{trigger}`", 8176 // "location": "path", 8177 // "pattern": "^projects/[^/]+/locations/[^/]+/triggers/[^/]+$", 8178 // "required": true, 8179 // "type": "string" 8180 // }, 8181 // "projectId": { 8182 // "description": "Required. ID of the project that owns the trigger.", 8183 // "location": "query", 8184 // "type": "string" 8185 // }, 8186 // "triggerId": { 8187 // "description": "Required. ID of the `BuildTrigger` to delete.", 8188 // "location": "query", 8189 // "type": "string" 8190 // } 8191 // }, 8192 // "path": "v1/{+name}", 8193 // "response": { 8194 // "$ref": "Empty" 8195 // }, 8196 // "scopes": [ 8197 // "https://www.googleapis.com/auth/cloud-platform" 8198 // ] 8199 // } 8200 8201} 8202 8203// method id "cloudbuild.projects.locations.triggers.get": 8204 8205type ProjectsLocationsTriggersGetCall struct { 8206 s *Service 8207 name string 8208 urlParams_ gensupport.URLParams 8209 ifNoneMatch_ string 8210 ctx_ context.Context 8211 header_ http.Header 8212} 8213 8214// Get: Returns information about a `BuildTrigger`. This API is 8215// experimental. 8216// 8217// - name: The name of the `Trigger` to retrieve. Format: 8218// `projects/{project}/locations/{location}/triggers/{trigger}`. 8219func (r *ProjectsLocationsTriggersService) Get(name string) *ProjectsLocationsTriggersGetCall { 8220 c := &ProjectsLocationsTriggersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8221 c.name = name 8222 return c 8223} 8224 8225// ProjectId sets the optional parameter "projectId": Required. ID of 8226// the project that owns the trigger. 8227func (c *ProjectsLocationsTriggersGetCall) ProjectId(projectId string) *ProjectsLocationsTriggersGetCall { 8228 c.urlParams_.Set("projectId", projectId) 8229 return c 8230} 8231 8232// TriggerId sets the optional parameter "triggerId": Required. 8233// Identifier (`id` or `name`) of the `BuildTrigger` to get. 8234func (c *ProjectsLocationsTriggersGetCall) TriggerId(triggerId string) *ProjectsLocationsTriggersGetCall { 8235 c.urlParams_.Set("triggerId", triggerId) 8236 return c 8237} 8238 8239// Fields allows partial responses to be retrieved. See 8240// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8241// for more information. 8242func (c *ProjectsLocationsTriggersGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersGetCall { 8243 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8244 return c 8245} 8246 8247// IfNoneMatch sets the optional parameter which makes the operation 8248// fail if the object's ETag matches the given value. This is useful for 8249// getting updates only after the object has changed since the last 8250// request. Use googleapi.IsNotModified to check whether the response 8251// error from Do is the result of In-None-Match. 8252func (c *ProjectsLocationsTriggersGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsTriggersGetCall { 8253 c.ifNoneMatch_ = entityTag 8254 return c 8255} 8256 8257// Context sets the context to be used in this call's Do method. Any 8258// pending HTTP request will be aborted if the provided context is 8259// canceled. 8260func (c *ProjectsLocationsTriggersGetCall) Context(ctx context.Context) *ProjectsLocationsTriggersGetCall { 8261 c.ctx_ = ctx 8262 return c 8263} 8264 8265// Header returns an http.Header that can be modified by the caller to 8266// add HTTP headers to the request. 8267func (c *ProjectsLocationsTriggersGetCall) Header() http.Header { 8268 if c.header_ == nil { 8269 c.header_ = make(http.Header) 8270 } 8271 return c.header_ 8272} 8273 8274func (c *ProjectsLocationsTriggersGetCall) doRequest(alt string) (*http.Response, error) { 8275 reqHeaders := make(http.Header) 8276 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 8277 for k, v := range c.header_ { 8278 reqHeaders[k] = v 8279 } 8280 reqHeaders.Set("User-Agent", c.s.userAgent()) 8281 if c.ifNoneMatch_ != "" { 8282 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8283 } 8284 var body io.Reader = nil 8285 c.urlParams_.Set("alt", alt) 8286 c.urlParams_.Set("prettyPrint", "false") 8287 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 8288 urls += "?" + c.urlParams_.Encode() 8289 req, err := http.NewRequest("GET", urls, body) 8290 if err != nil { 8291 return nil, err 8292 } 8293 req.Header = reqHeaders 8294 googleapi.Expand(req.URL, map[string]string{ 8295 "name": c.name, 8296 }) 8297 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8298} 8299 8300// Do executes the "cloudbuild.projects.locations.triggers.get" call. 8301// Exactly one of *BuildTrigger or error will be non-nil. Any non-2xx 8302// status code is an error. Response headers are in either 8303// *BuildTrigger.ServerResponse.Header or (if a response was returned at 8304// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8305// to check whether the returned error was because 8306// http.StatusNotModified was returned. 8307func (c *ProjectsLocationsTriggersGetCall) Do(opts ...googleapi.CallOption) (*BuildTrigger, error) { 8308 gensupport.SetOptions(c.urlParams_, opts...) 8309 res, err := c.doRequest("json") 8310 if res != nil && res.StatusCode == http.StatusNotModified { 8311 if res.Body != nil { 8312 res.Body.Close() 8313 } 8314 return nil, &googleapi.Error{ 8315 Code: res.StatusCode, 8316 Header: res.Header, 8317 } 8318 } 8319 if err != nil { 8320 return nil, err 8321 } 8322 defer googleapi.CloseBody(res) 8323 if err := googleapi.CheckResponse(res); err != nil { 8324 return nil, err 8325 } 8326 ret := &BuildTrigger{ 8327 ServerResponse: googleapi.ServerResponse{ 8328 Header: res.Header, 8329 HTTPStatusCode: res.StatusCode, 8330 }, 8331 } 8332 target := &ret 8333 if err := gensupport.DecodeResponse(target, res); err != nil { 8334 return nil, err 8335 } 8336 return ret, nil 8337 // { 8338 // "description": "Returns information about a `BuildTrigger`. This API is experimental.", 8339 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}", 8340 // "httpMethod": "GET", 8341 // "id": "cloudbuild.projects.locations.triggers.get", 8342 // "parameterOrder": [ 8343 // "name" 8344 // ], 8345 // "parameters": { 8346 // "name": { 8347 // "description": "The name of the `Trigger` to retrieve. Format: `projects/{project}/locations/{location}/triggers/{trigger}`", 8348 // "location": "path", 8349 // "pattern": "^projects/[^/]+/locations/[^/]+/triggers/[^/]+$", 8350 // "required": true, 8351 // "type": "string" 8352 // }, 8353 // "projectId": { 8354 // "description": "Required. ID of the project that owns the trigger.", 8355 // "location": "query", 8356 // "type": "string" 8357 // }, 8358 // "triggerId": { 8359 // "description": "Required. Identifier (`id` or `name`) of the `BuildTrigger` to get.", 8360 // "location": "query", 8361 // "type": "string" 8362 // } 8363 // }, 8364 // "path": "v1/{+name}", 8365 // "response": { 8366 // "$ref": "BuildTrigger" 8367 // }, 8368 // "scopes": [ 8369 // "https://www.googleapis.com/auth/cloud-platform" 8370 // ] 8371 // } 8372 8373} 8374 8375// method id "cloudbuild.projects.locations.triggers.list": 8376 8377type ProjectsLocationsTriggersListCall struct { 8378 s *Service 8379 parent string 8380 urlParams_ gensupport.URLParams 8381 ifNoneMatch_ string 8382 ctx_ context.Context 8383 header_ http.Header 8384} 8385 8386// List: Lists existing `BuildTrigger`s. This API is experimental. 8387// 8388// - parent: The parent of the collection of `Triggers`. Format: 8389// `projects/{project}/locations/{location}`. 8390func (r *ProjectsLocationsTriggersService) List(parent string) *ProjectsLocationsTriggersListCall { 8391 c := &ProjectsLocationsTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8392 c.parent = parent 8393 return c 8394} 8395 8396// PageSize sets the optional parameter "pageSize": Number of results to 8397// return in the list. 8398func (c *ProjectsLocationsTriggersListCall) PageSize(pageSize int64) *ProjectsLocationsTriggersListCall { 8399 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8400 return c 8401} 8402 8403// PageToken sets the optional parameter "pageToken": Token to provide 8404// to skip to a particular spot in the list. 8405func (c *ProjectsLocationsTriggersListCall) PageToken(pageToken string) *ProjectsLocationsTriggersListCall { 8406 c.urlParams_.Set("pageToken", pageToken) 8407 return c 8408} 8409 8410// ProjectId sets the optional parameter "projectId": Required. ID of 8411// the project for which to list BuildTriggers. 8412func (c *ProjectsLocationsTriggersListCall) ProjectId(projectId string) *ProjectsLocationsTriggersListCall { 8413 c.urlParams_.Set("projectId", projectId) 8414 return c 8415} 8416 8417// Fields allows partial responses to be retrieved. See 8418// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8419// for more information. 8420func (c *ProjectsLocationsTriggersListCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersListCall { 8421 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8422 return c 8423} 8424 8425// IfNoneMatch sets the optional parameter which makes the operation 8426// fail if the object's ETag matches the given value. This is useful for 8427// getting updates only after the object has changed since the last 8428// request. Use googleapi.IsNotModified to check whether the response 8429// error from Do is the result of In-None-Match. 8430func (c *ProjectsLocationsTriggersListCall) IfNoneMatch(entityTag string) *ProjectsLocationsTriggersListCall { 8431 c.ifNoneMatch_ = entityTag 8432 return c 8433} 8434 8435// Context sets the context to be used in this call's Do method. Any 8436// pending HTTP request will be aborted if the provided context is 8437// canceled. 8438func (c *ProjectsLocationsTriggersListCall) Context(ctx context.Context) *ProjectsLocationsTriggersListCall { 8439 c.ctx_ = ctx 8440 return c 8441} 8442 8443// Header returns an http.Header that can be modified by the caller to 8444// add HTTP headers to the request. 8445func (c *ProjectsLocationsTriggersListCall) Header() http.Header { 8446 if c.header_ == nil { 8447 c.header_ = make(http.Header) 8448 } 8449 return c.header_ 8450} 8451 8452func (c *ProjectsLocationsTriggersListCall) doRequest(alt string) (*http.Response, error) { 8453 reqHeaders := make(http.Header) 8454 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 8455 for k, v := range c.header_ { 8456 reqHeaders[k] = v 8457 } 8458 reqHeaders.Set("User-Agent", c.s.userAgent()) 8459 if c.ifNoneMatch_ != "" { 8460 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8461 } 8462 var body io.Reader = nil 8463 c.urlParams_.Set("alt", alt) 8464 c.urlParams_.Set("prettyPrint", "false") 8465 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/triggers") 8466 urls += "?" + c.urlParams_.Encode() 8467 req, err := http.NewRequest("GET", urls, body) 8468 if err != nil { 8469 return nil, err 8470 } 8471 req.Header = reqHeaders 8472 googleapi.Expand(req.URL, map[string]string{ 8473 "parent": c.parent, 8474 }) 8475 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8476} 8477 8478// Do executes the "cloudbuild.projects.locations.triggers.list" call. 8479// Exactly one of *ListBuildTriggersResponse or error will be non-nil. 8480// Any non-2xx status code is an error. Response headers are in either 8481// *ListBuildTriggersResponse.ServerResponse.Header or (if a response 8482// was returned at all) in error.(*googleapi.Error).Header. Use 8483// googleapi.IsNotModified to check whether the returned error was 8484// because http.StatusNotModified was returned. 8485func (c *ProjectsLocationsTriggersListCall) Do(opts ...googleapi.CallOption) (*ListBuildTriggersResponse, error) { 8486 gensupport.SetOptions(c.urlParams_, opts...) 8487 res, err := c.doRequest("json") 8488 if res != nil && res.StatusCode == http.StatusNotModified { 8489 if res.Body != nil { 8490 res.Body.Close() 8491 } 8492 return nil, &googleapi.Error{ 8493 Code: res.StatusCode, 8494 Header: res.Header, 8495 } 8496 } 8497 if err != nil { 8498 return nil, err 8499 } 8500 defer googleapi.CloseBody(res) 8501 if err := googleapi.CheckResponse(res); err != nil { 8502 return nil, err 8503 } 8504 ret := &ListBuildTriggersResponse{ 8505 ServerResponse: googleapi.ServerResponse{ 8506 Header: res.Header, 8507 HTTPStatusCode: res.StatusCode, 8508 }, 8509 } 8510 target := &ret 8511 if err := gensupport.DecodeResponse(target, res); err != nil { 8512 return nil, err 8513 } 8514 return ret, nil 8515 // { 8516 // "description": "Lists existing `BuildTrigger`s. This API is experimental.", 8517 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/triggers", 8518 // "httpMethod": "GET", 8519 // "id": "cloudbuild.projects.locations.triggers.list", 8520 // "parameterOrder": [ 8521 // "parent" 8522 // ], 8523 // "parameters": { 8524 // "pageSize": { 8525 // "description": "Number of results to return in the list.", 8526 // "format": "int32", 8527 // "location": "query", 8528 // "type": "integer" 8529 // }, 8530 // "pageToken": { 8531 // "description": "Token to provide to skip to a particular spot in the list.", 8532 // "location": "query", 8533 // "type": "string" 8534 // }, 8535 // "parent": { 8536 // "description": "The parent of the collection of `Triggers`. Format: `projects/{project}/locations/{location}`", 8537 // "location": "path", 8538 // "pattern": "^projects/[^/]+/locations/[^/]+$", 8539 // "required": true, 8540 // "type": "string" 8541 // }, 8542 // "projectId": { 8543 // "description": "Required. ID of the project for which to list BuildTriggers.", 8544 // "location": "query", 8545 // "type": "string" 8546 // } 8547 // }, 8548 // "path": "v1/{+parent}/triggers", 8549 // "response": { 8550 // "$ref": "ListBuildTriggersResponse" 8551 // }, 8552 // "scopes": [ 8553 // "https://www.googleapis.com/auth/cloud-platform" 8554 // ] 8555 // } 8556 8557} 8558 8559// Pages invokes f for each page of results. 8560// A non-nil error returned from f will halt the iteration. 8561// The provided context supersedes any context provided to the Context method. 8562func (c *ProjectsLocationsTriggersListCall) Pages(ctx context.Context, f func(*ListBuildTriggersResponse) error) error { 8563 c.ctx_ = ctx 8564 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8565 for { 8566 x, err := c.Do() 8567 if err != nil { 8568 return err 8569 } 8570 if err := f(x); err != nil { 8571 return err 8572 } 8573 if x.NextPageToken == "" { 8574 return nil 8575 } 8576 c.PageToken(x.NextPageToken) 8577 } 8578} 8579 8580// method id "cloudbuild.projects.locations.triggers.patch": 8581 8582type ProjectsLocationsTriggersPatchCall struct { 8583 s *Service 8584 resourceNameid string 8585 buildtrigger *BuildTrigger 8586 urlParams_ gensupport.URLParams 8587 ctx_ context.Context 8588 header_ http.Header 8589} 8590 8591// Patch: Updates a `BuildTrigger` by its project ID and trigger ID. 8592// This API is experimental. 8593// 8594// - resourceName: The `Trigger` name with format: 8595// `projects/{project}/locations/{location}/triggers/{trigger}`, where 8596// {trigger} is a unique identifier generated by the service. 8597func (r *ProjectsLocationsTriggersService) Patch(resourceNameid string, buildtrigger *BuildTrigger) *ProjectsLocationsTriggersPatchCall { 8598 c := &ProjectsLocationsTriggersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8599 c.resourceNameid = resourceNameid 8600 c.buildtrigger = buildtrigger 8601 return c 8602} 8603 8604// ProjectId sets the optional parameter "projectId": Required. ID of 8605// the project that owns the trigger. 8606func (c *ProjectsLocationsTriggersPatchCall) ProjectId(projectId string) *ProjectsLocationsTriggersPatchCall { 8607 c.urlParams_.Set("projectId", projectId) 8608 return c 8609} 8610 8611// TriggerId sets the optional parameter "triggerId": Required. ID of 8612// the `BuildTrigger` to update. 8613func (c *ProjectsLocationsTriggersPatchCall) TriggerId(triggerId string) *ProjectsLocationsTriggersPatchCall { 8614 c.urlParams_.Set("triggerId", triggerId) 8615 return c 8616} 8617 8618// Fields allows partial responses to be retrieved. See 8619// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8620// for more information. 8621func (c *ProjectsLocationsTriggersPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersPatchCall { 8622 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8623 return c 8624} 8625 8626// Context sets the context to be used in this call's Do method. Any 8627// pending HTTP request will be aborted if the provided context is 8628// canceled. 8629func (c *ProjectsLocationsTriggersPatchCall) Context(ctx context.Context) *ProjectsLocationsTriggersPatchCall { 8630 c.ctx_ = ctx 8631 return c 8632} 8633 8634// Header returns an http.Header that can be modified by the caller to 8635// add HTTP headers to the request. 8636func (c *ProjectsLocationsTriggersPatchCall) Header() http.Header { 8637 if c.header_ == nil { 8638 c.header_ = make(http.Header) 8639 } 8640 return c.header_ 8641} 8642 8643func (c *ProjectsLocationsTriggersPatchCall) doRequest(alt string) (*http.Response, error) { 8644 reqHeaders := make(http.Header) 8645 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 8646 for k, v := range c.header_ { 8647 reqHeaders[k] = v 8648 } 8649 reqHeaders.Set("User-Agent", c.s.userAgent()) 8650 var body io.Reader = nil 8651 body, err := googleapi.WithoutDataWrapper.JSONReader(c.buildtrigger) 8652 if err != nil { 8653 return nil, err 8654 } 8655 reqHeaders.Set("Content-Type", "application/json") 8656 c.urlParams_.Set("alt", alt) 8657 c.urlParams_.Set("prettyPrint", "false") 8658 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resourceName}") 8659 urls += "?" + c.urlParams_.Encode() 8660 req, err := http.NewRequest("PATCH", urls, body) 8661 if err != nil { 8662 return nil, err 8663 } 8664 req.Header = reqHeaders 8665 googleapi.Expand(req.URL, map[string]string{ 8666 "resourceName": c.resourceNameid, 8667 }) 8668 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8669} 8670 8671// Do executes the "cloudbuild.projects.locations.triggers.patch" call. 8672// Exactly one of *BuildTrigger or error will be non-nil. Any non-2xx 8673// status code is an error. Response headers are in either 8674// *BuildTrigger.ServerResponse.Header or (if a response was returned at 8675// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8676// to check whether the returned error was because 8677// http.StatusNotModified was returned. 8678func (c *ProjectsLocationsTriggersPatchCall) Do(opts ...googleapi.CallOption) (*BuildTrigger, error) { 8679 gensupport.SetOptions(c.urlParams_, opts...) 8680 res, err := c.doRequest("json") 8681 if res != nil && res.StatusCode == http.StatusNotModified { 8682 if res.Body != nil { 8683 res.Body.Close() 8684 } 8685 return nil, &googleapi.Error{ 8686 Code: res.StatusCode, 8687 Header: res.Header, 8688 } 8689 } 8690 if err != nil { 8691 return nil, err 8692 } 8693 defer googleapi.CloseBody(res) 8694 if err := googleapi.CheckResponse(res); err != nil { 8695 return nil, err 8696 } 8697 ret := &BuildTrigger{ 8698 ServerResponse: googleapi.ServerResponse{ 8699 Header: res.Header, 8700 HTTPStatusCode: res.StatusCode, 8701 }, 8702 } 8703 target := &ret 8704 if err := gensupport.DecodeResponse(target, res); err != nil { 8705 return nil, err 8706 } 8707 return ret, nil 8708 // { 8709 // "description": "Updates a `BuildTrigger` by its project ID and trigger ID. This API is experimental.", 8710 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}", 8711 // "httpMethod": "PATCH", 8712 // "id": "cloudbuild.projects.locations.triggers.patch", 8713 // "parameterOrder": [ 8714 // "resourceName" 8715 // ], 8716 // "parameters": { 8717 // "projectId": { 8718 // "description": "Required. ID of the project that owns the trigger.", 8719 // "location": "query", 8720 // "type": "string" 8721 // }, 8722 // "resourceName": { 8723 // "description": "The `Trigger` name with format: `projects/{project}/locations/{location}/triggers/{trigger}`, where {trigger} is a unique identifier generated by the service.", 8724 // "location": "path", 8725 // "pattern": "^projects/[^/]+/locations/[^/]+/triggers/[^/]+$", 8726 // "required": true, 8727 // "type": "string" 8728 // }, 8729 // "triggerId": { 8730 // "description": "Required. ID of the `BuildTrigger` to update.", 8731 // "location": "query", 8732 // "type": "string" 8733 // } 8734 // }, 8735 // "path": "v1/{+resourceName}", 8736 // "request": { 8737 // "$ref": "BuildTrigger" 8738 // }, 8739 // "response": { 8740 // "$ref": "BuildTrigger" 8741 // }, 8742 // "scopes": [ 8743 // "https://www.googleapis.com/auth/cloud-platform" 8744 // ] 8745 // } 8746 8747} 8748 8749// method id "cloudbuild.projects.locations.triggers.run": 8750 8751type ProjectsLocationsTriggersRunCall struct { 8752 s *Service 8753 name string 8754 runbuildtriggerrequest *RunBuildTriggerRequest 8755 urlParams_ gensupport.URLParams 8756 ctx_ context.Context 8757 header_ http.Header 8758} 8759 8760// Run: Runs a `BuildTrigger` at a particular source revision. 8761// 8762// - name: The name of the `Trigger` to run. Format: 8763// `projects/{project}/locations/{location}/triggers/{trigger}`. 8764func (r *ProjectsLocationsTriggersService) Run(name string, runbuildtriggerrequest *RunBuildTriggerRequest) *ProjectsLocationsTriggersRunCall { 8765 c := &ProjectsLocationsTriggersRunCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8766 c.name = name 8767 c.runbuildtriggerrequest = runbuildtriggerrequest 8768 return c 8769} 8770 8771// Fields allows partial responses to be retrieved. See 8772// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8773// for more information. 8774func (c *ProjectsLocationsTriggersRunCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersRunCall { 8775 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8776 return c 8777} 8778 8779// Context sets the context to be used in this call's Do method. Any 8780// pending HTTP request will be aborted if the provided context is 8781// canceled. 8782func (c *ProjectsLocationsTriggersRunCall) Context(ctx context.Context) *ProjectsLocationsTriggersRunCall { 8783 c.ctx_ = ctx 8784 return c 8785} 8786 8787// Header returns an http.Header that can be modified by the caller to 8788// add HTTP headers to the request. 8789func (c *ProjectsLocationsTriggersRunCall) Header() http.Header { 8790 if c.header_ == nil { 8791 c.header_ = make(http.Header) 8792 } 8793 return c.header_ 8794} 8795 8796func (c *ProjectsLocationsTriggersRunCall) doRequest(alt string) (*http.Response, error) { 8797 reqHeaders := make(http.Header) 8798 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 8799 for k, v := range c.header_ { 8800 reqHeaders[k] = v 8801 } 8802 reqHeaders.Set("User-Agent", c.s.userAgent()) 8803 var body io.Reader = nil 8804 body, err := googleapi.WithoutDataWrapper.JSONReader(c.runbuildtriggerrequest) 8805 if err != nil { 8806 return nil, err 8807 } 8808 reqHeaders.Set("Content-Type", "application/json") 8809 c.urlParams_.Set("alt", alt) 8810 c.urlParams_.Set("prettyPrint", "false") 8811 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:run") 8812 urls += "?" + c.urlParams_.Encode() 8813 req, err := http.NewRequest("POST", urls, body) 8814 if err != nil { 8815 return nil, err 8816 } 8817 req.Header = reqHeaders 8818 googleapi.Expand(req.URL, map[string]string{ 8819 "name": c.name, 8820 }) 8821 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8822} 8823 8824// Do executes the "cloudbuild.projects.locations.triggers.run" call. 8825// Exactly one of *Operation or error will be non-nil. Any non-2xx 8826// status code is an error. Response headers are in either 8827// *Operation.ServerResponse.Header or (if a response was returned at 8828// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8829// to check whether the returned error was because 8830// http.StatusNotModified was returned. 8831func (c *ProjectsLocationsTriggersRunCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8832 gensupport.SetOptions(c.urlParams_, opts...) 8833 res, err := c.doRequest("json") 8834 if res != nil && res.StatusCode == http.StatusNotModified { 8835 if res.Body != nil { 8836 res.Body.Close() 8837 } 8838 return nil, &googleapi.Error{ 8839 Code: res.StatusCode, 8840 Header: res.Header, 8841 } 8842 } 8843 if err != nil { 8844 return nil, err 8845 } 8846 defer googleapi.CloseBody(res) 8847 if err := googleapi.CheckResponse(res); err != nil { 8848 return nil, err 8849 } 8850 ret := &Operation{ 8851 ServerResponse: googleapi.ServerResponse{ 8852 Header: res.Header, 8853 HTTPStatusCode: res.StatusCode, 8854 }, 8855 } 8856 target := &ret 8857 if err := gensupport.DecodeResponse(target, res); err != nil { 8858 return nil, err 8859 } 8860 return ret, nil 8861 // { 8862 // "description": "Runs a `BuildTrigger` at a particular source revision.", 8863 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}:run", 8864 // "httpMethod": "POST", 8865 // "id": "cloudbuild.projects.locations.triggers.run", 8866 // "parameterOrder": [ 8867 // "name" 8868 // ], 8869 // "parameters": { 8870 // "name": { 8871 // "description": "The name of the `Trigger` to run. Format: `projects/{project}/locations/{location}/triggers/{trigger}`", 8872 // "location": "path", 8873 // "pattern": "^projects/[^/]+/locations/[^/]+/triggers/[^/]+$", 8874 // "required": true, 8875 // "type": "string" 8876 // } 8877 // }, 8878 // "path": "v1/{+name}:run", 8879 // "request": { 8880 // "$ref": "RunBuildTriggerRequest" 8881 // }, 8882 // "response": { 8883 // "$ref": "Operation" 8884 // }, 8885 // "scopes": [ 8886 // "https://www.googleapis.com/auth/cloud-platform" 8887 // ] 8888 // } 8889 8890} 8891 8892// method id "cloudbuild.projects.locations.triggers.webhook": 8893 8894type ProjectsLocationsTriggersWebhookCall struct { 8895 s *Service 8896 name string 8897 httpbody *HttpBody 8898 urlParams_ gensupport.URLParams 8899 ctx_ context.Context 8900 header_ http.Header 8901} 8902 8903// Webhook: ReceiveTriggerWebhook [Experimental] is called when the API 8904// receives a webhook request targeted at a specific trigger. 8905// 8906// - name: The name of the `ReceiveTriggerWebhook` to retrieve. Format: 8907// `projects/{project}/locations/{location}/triggers/{trigger}`. 8908func (r *ProjectsLocationsTriggersService) Webhook(name string, httpbody *HttpBody) *ProjectsLocationsTriggersWebhookCall { 8909 c := &ProjectsLocationsTriggersWebhookCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8910 c.name = name 8911 c.httpbody = httpbody 8912 return c 8913} 8914 8915// ProjectId sets the optional parameter "projectId": Project in which 8916// the specified trigger lives 8917func (c *ProjectsLocationsTriggersWebhookCall) ProjectId(projectId string) *ProjectsLocationsTriggersWebhookCall { 8918 c.urlParams_.Set("projectId", projectId) 8919 return c 8920} 8921 8922// Secret sets the optional parameter "secret": Secret token used for 8923// authorization if an OAuth token isn't provided. 8924func (c *ProjectsLocationsTriggersWebhookCall) Secret(secret string) *ProjectsLocationsTriggersWebhookCall { 8925 c.urlParams_.Set("secret", secret) 8926 return c 8927} 8928 8929// Trigger sets the optional parameter "trigger": Name of the trigger to 8930// run the payload against 8931func (c *ProjectsLocationsTriggersWebhookCall) Trigger(trigger string) *ProjectsLocationsTriggersWebhookCall { 8932 c.urlParams_.Set("trigger", trigger) 8933 return c 8934} 8935 8936// Fields allows partial responses to be retrieved. See 8937// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8938// for more information. 8939func (c *ProjectsLocationsTriggersWebhookCall) Fields(s ...googleapi.Field) *ProjectsLocationsTriggersWebhookCall { 8940 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8941 return c 8942} 8943 8944// Context sets the context to be used in this call's Do method. Any 8945// pending HTTP request will be aborted if the provided context is 8946// canceled. 8947func (c *ProjectsLocationsTriggersWebhookCall) Context(ctx context.Context) *ProjectsLocationsTriggersWebhookCall { 8948 c.ctx_ = ctx 8949 return c 8950} 8951 8952// Header returns an http.Header that can be modified by the caller to 8953// add HTTP headers to the request. 8954func (c *ProjectsLocationsTriggersWebhookCall) Header() http.Header { 8955 if c.header_ == nil { 8956 c.header_ = make(http.Header) 8957 } 8958 return c.header_ 8959} 8960 8961func (c *ProjectsLocationsTriggersWebhookCall) doRequest(alt string) (*http.Response, error) { 8962 reqHeaders := make(http.Header) 8963 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 8964 for k, v := range c.header_ { 8965 reqHeaders[k] = v 8966 } 8967 reqHeaders.Set("User-Agent", c.s.userAgent()) 8968 var body io.Reader = nil 8969 body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpbody) 8970 if err != nil { 8971 return nil, err 8972 } 8973 reqHeaders.Set("Content-Type", "application/json") 8974 c.urlParams_.Set("alt", alt) 8975 c.urlParams_.Set("prettyPrint", "false") 8976 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:webhook") 8977 urls += "?" + c.urlParams_.Encode() 8978 req, err := http.NewRequest("POST", urls, body) 8979 if err != nil { 8980 return nil, err 8981 } 8982 req.Header = reqHeaders 8983 googleapi.Expand(req.URL, map[string]string{ 8984 "name": c.name, 8985 }) 8986 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8987} 8988 8989// Do executes the "cloudbuild.projects.locations.triggers.webhook" call. 8990// Exactly one of *ReceiveTriggerWebhookResponse or error will be 8991// non-nil. Any non-2xx status code is an error. Response headers are in 8992// either *ReceiveTriggerWebhookResponse.ServerResponse.Header or (if a 8993// response was returned at all) in error.(*googleapi.Error).Header. Use 8994// googleapi.IsNotModified to check whether the returned error was 8995// because http.StatusNotModified was returned. 8996func (c *ProjectsLocationsTriggersWebhookCall) Do(opts ...googleapi.CallOption) (*ReceiveTriggerWebhookResponse, error) { 8997 gensupport.SetOptions(c.urlParams_, opts...) 8998 res, err := c.doRequest("json") 8999 if res != nil && res.StatusCode == http.StatusNotModified { 9000 if res.Body != nil { 9001 res.Body.Close() 9002 } 9003 return nil, &googleapi.Error{ 9004 Code: res.StatusCode, 9005 Header: res.Header, 9006 } 9007 } 9008 if err != nil { 9009 return nil, err 9010 } 9011 defer googleapi.CloseBody(res) 9012 if err := googleapi.CheckResponse(res); err != nil { 9013 return nil, err 9014 } 9015 ret := &ReceiveTriggerWebhookResponse{ 9016 ServerResponse: googleapi.ServerResponse{ 9017 Header: res.Header, 9018 HTTPStatusCode: res.StatusCode, 9019 }, 9020 } 9021 target := &ret 9022 if err := gensupport.DecodeResponse(target, res); err != nil { 9023 return nil, err 9024 } 9025 return ret, nil 9026 // { 9027 // "description": "ReceiveTriggerWebhook [Experimental] is called when the API receives a webhook request targeted at a specific trigger.", 9028 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/triggers/{triggersId}:webhook", 9029 // "httpMethod": "POST", 9030 // "id": "cloudbuild.projects.locations.triggers.webhook", 9031 // "parameterOrder": [ 9032 // "name" 9033 // ], 9034 // "parameters": { 9035 // "name": { 9036 // "description": "The name of the `ReceiveTriggerWebhook` to retrieve. Format: `projects/{project}/locations/{location}/triggers/{trigger}`", 9037 // "location": "path", 9038 // "pattern": "^projects/[^/]+/locations/[^/]+/triggers/[^/]+$", 9039 // "required": true, 9040 // "type": "string" 9041 // }, 9042 // "projectId": { 9043 // "description": "Project in which the specified trigger lives", 9044 // "location": "query", 9045 // "type": "string" 9046 // }, 9047 // "secret": { 9048 // "description": "Secret token used for authorization if an OAuth token isn't provided.", 9049 // "location": "query", 9050 // "type": "string" 9051 // }, 9052 // "trigger": { 9053 // "description": "Name of the trigger to run the payload against", 9054 // "location": "query", 9055 // "type": "string" 9056 // } 9057 // }, 9058 // "path": "v1/{+name}:webhook", 9059 // "request": { 9060 // "$ref": "HttpBody" 9061 // }, 9062 // "response": { 9063 // "$ref": "ReceiveTriggerWebhookResponse" 9064 // } 9065 // } 9066 9067} 9068 9069// method id "cloudbuild.projects.locations.workerPools.create": 9070 9071type ProjectsLocationsWorkerPoolsCreateCall struct { 9072 s *Service 9073 parent string 9074 workerpool *WorkerPool 9075 urlParams_ gensupport.URLParams 9076 ctx_ context.Context 9077 header_ http.Header 9078} 9079 9080// Create: Creates a `WorkerPool`. 9081// 9082// - parent: The parent resource where this worker pool will be created. 9083// Format: `projects/{project}/locations/{location}`. 9084func (r *ProjectsLocationsWorkerPoolsService) Create(parent string, workerpool *WorkerPool) *ProjectsLocationsWorkerPoolsCreateCall { 9085 c := &ProjectsLocationsWorkerPoolsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9086 c.parent = parent 9087 c.workerpool = workerpool 9088 return c 9089} 9090 9091// ValidateOnly sets the optional parameter "validateOnly": If set, 9092// validate the request and preview the response, but do not actually 9093// post it. 9094func (c *ProjectsLocationsWorkerPoolsCreateCall) ValidateOnly(validateOnly bool) *ProjectsLocationsWorkerPoolsCreateCall { 9095 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 9096 return c 9097} 9098 9099// WorkerPoolId sets the optional parameter "workerPoolId": Required. 9100// Immutable. The ID to use for the `WorkerPool`, which will become the 9101// final component of the resource name. This value should be 1-63 9102// characters, and valid characters are /a-z-/. 9103func (c *ProjectsLocationsWorkerPoolsCreateCall) WorkerPoolId(workerPoolId string) *ProjectsLocationsWorkerPoolsCreateCall { 9104 c.urlParams_.Set("workerPoolId", workerPoolId) 9105 return c 9106} 9107 9108// Fields allows partial responses to be retrieved. See 9109// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9110// for more information. 9111func (c *ProjectsLocationsWorkerPoolsCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkerPoolsCreateCall { 9112 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9113 return c 9114} 9115 9116// Context sets the context to be used in this call's Do method. Any 9117// pending HTTP request will be aborted if the provided context is 9118// canceled. 9119func (c *ProjectsLocationsWorkerPoolsCreateCall) Context(ctx context.Context) *ProjectsLocationsWorkerPoolsCreateCall { 9120 c.ctx_ = ctx 9121 return c 9122} 9123 9124// Header returns an http.Header that can be modified by the caller to 9125// add HTTP headers to the request. 9126func (c *ProjectsLocationsWorkerPoolsCreateCall) Header() http.Header { 9127 if c.header_ == nil { 9128 c.header_ = make(http.Header) 9129 } 9130 return c.header_ 9131} 9132 9133func (c *ProjectsLocationsWorkerPoolsCreateCall) doRequest(alt string) (*http.Response, error) { 9134 reqHeaders := make(http.Header) 9135 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 9136 for k, v := range c.header_ { 9137 reqHeaders[k] = v 9138 } 9139 reqHeaders.Set("User-Agent", c.s.userAgent()) 9140 var body io.Reader = nil 9141 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workerpool) 9142 if err != nil { 9143 return nil, err 9144 } 9145 reqHeaders.Set("Content-Type", "application/json") 9146 c.urlParams_.Set("alt", alt) 9147 c.urlParams_.Set("prettyPrint", "false") 9148 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workerPools") 9149 urls += "?" + c.urlParams_.Encode() 9150 req, err := http.NewRequest("POST", urls, body) 9151 if err != nil { 9152 return nil, err 9153 } 9154 req.Header = reqHeaders 9155 googleapi.Expand(req.URL, map[string]string{ 9156 "parent": c.parent, 9157 }) 9158 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9159} 9160 9161// Do executes the "cloudbuild.projects.locations.workerPools.create" call. 9162// Exactly one of *Operation or error will be non-nil. Any non-2xx 9163// status code is an error. Response headers are in either 9164// *Operation.ServerResponse.Header or (if a response was returned at 9165// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9166// to check whether the returned error was because 9167// http.StatusNotModified was returned. 9168func (c *ProjectsLocationsWorkerPoolsCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9169 gensupport.SetOptions(c.urlParams_, opts...) 9170 res, err := c.doRequest("json") 9171 if res != nil && res.StatusCode == http.StatusNotModified { 9172 if res.Body != nil { 9173 res.Body.Close() 9174 } 9175 return nil, &googleapi.Error{ 9176 Code: res.StatusCode, 9177 Header: res.Header, 9178 } 9179 } 9180 if err != nil { 9181 return nil, err 9182 } 9183 defer googleapi.CloseBody(res) 9184 if err := googleapi.CheckResponse(res); err != nil { 9185 return nil, err 9186 } 9187 ret := &Operation{ 9188 ServerResponse: googleapi.ServerResponse{ 9189 Header: res.Header, 9190 HTTPStatusCode: res.StatusCode, 9191 }, 9192 } 9193 target := &ret 9194 if err := gensupport.DecodeResponse(target, res); err != nil { 9195 return nil, err 9196 } 9197 return ret, nil 9198 // { 9199 // "description": "Creates a `WorkerPool`.", 9200 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workerPools", 9201 // "httpMethod": "POST", 9202 // "id": "cloudbuild.projects.locations.workerPools.create", 9203 // "parameterOrder": [ 9204 // "parent" 9205 // ], 9206 // "parameters": { 9207 // "parent": { 9208 // "description": "Required. The parent resource where this worker pool will be created. Format: `projects/{project}/locations/{location}`.", 9209 // "location": "path", 9210 // "pattern": "^projects/[^/]+/locations/[^/]+$", 9211 // "required": true, 9212 // "type": "string" 9213 // }, 9214 // "validateOnly": { 9215 // "description": "If set, validate the request and preview the response, but do not actually post it.", 9216 // "location": "query", 9217 // "type": "boolean" 9218 // }, 9219 // "workerPoolId": { 9220 // "description": "Required. Immutable. The ID to use for the `WorkerPool`, which will become the final component of the resource name. This value should be 1-63 characters, and valid characters are /a-z-/.", 9221 // "location": "query", 9222 // "type": "string" 9223 // } 9224 // }, 9225 // "path": "v1/{+parent}/workerPools", 9226 // "request": { 9227 // "$ref": "WorkerPool" 9228 // }, 9229 // "response": { 9230 // "$ref": "Operation" 9231 // }, 9232 // "scopes": [ 9233 // "https://www.googleapis.com/auth/cloud-platform" 9234 // ] 9235 // } 9236 9237} 9238 9239// method id "cloudbuild.projects.locations.workerPools.delete": 9240 9241type ProjectsLocationsWorkerPoolsDeleteCall struct { 9242 s *Service 9243 name string 9244 urlParams_ gensupport.URLParams 9245 ctx_ context.Context 9246 header_ http.Header 9247} 9248 9249// Delete: Deletes a `WorkerPool`. 9250// 9251// - name: The name of the `WorkerPool` to delete. Format: 9252// `projects/{project}/locations/{workerPool}/workerPools/{workerPool}` 9253// . 9254func (r *ProjectsLocationsWorkerPoolsService) Delete(name string) *ProjectsLocationsWorkerPoolsDeleteCall { 9255 c := &ProjectsLocationsWorkerPoolsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9256 c.name = name 9257 return c 9258} 9259 9260// AllowMissing sets the optional parameter "allowMissing": If set to 9261// true, and the `WorkerPool` is not found, the request will succeed but 9262// no action will be taken on the server. 9263func (c *ProjectsLocationsWorkerPoolsDeleteCall) AllowMissing(allowMissing bool) *ProjectsLocationsWorkerPoolsDeleteCall { 9264 c.urlParams_.Set("allowMissing", fmt.Sprint(allowMissing)) 9265 return c 9266} 9267 9268// Etag sets the optional parameter "etag": If this is provided, it must 9269// match the server's etag on the workerpool for the request to be 9270// processed. 9271func (c *ProjectsLocationsWorkerPoolsDeleteCall) Etag(etag string) *ProjectsLocationsWorkerPoolsDeleteCall { 9272 c.urlParams_.Set("etag", etag) 9273 return c 9274} 9275 9276// ValidateOnly sets the optional parameter "validateOnly": If set, 9277// validate the request and preview the response, but do not actually 9278// post it. 9279func (c *ProjectsLocationsWorkerPoolsDeleteCall) ValidateOnly(validateOnly bool) *ProjectsLocationsWorkerPoolsDeleteCall { 9280 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 9281 return c 9282} 9283 9284// Fields allows partial responses to be retrieved. See 9285// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9286// for more information. 9287func (c *ProjectsLocationsWorkerPoolsDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkerPoolsDeleteCall { 9288 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9289 return c 9290} 9291 9292// Context sets the context to be used in this call's Do method. Any 9293// pending HTTP request will be aborted if the provided context is 9294// canceled. 9295func (c *ProjectsLocationsWorkerPoolsDeleteCall) Context(ctx context.Context) *ProjectsLocationsWorkerPoolsDeleteCall { 9296 c.ctx_ = ctx 9297 return c 9298} 9299 9300// Header returns an http.Header that can be modified by the caller to 9301// add HTTP headers to the request. 9302func (c *ProjectsLocationsWorkerPoolsDeleteCall) Header() http.Header { 9303 if c.header_ == nil { 9304 c.header_ = make(http.Header) 9305 } 9306 return c.header_ 9307} 9308 9309func (c *ProjectsLocationsWorkerPoolsDeleteCall) doRequest(alt string) (*http.Response, error) { 9310 reqHeaders := make(http.Header) 9311 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 9312 for k, v := range c.header_ { 9313 reqHeaders[k] = v 9314 } 9315 reqHeaders.Set("User-Agent", c.s.userAgent()) 9316 var body io.Reader = nil 9317 c.urlParams_.Set("alt", alt) 9318 c.urlParams_.Set("prettyPrint", "false") 9319 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 9320 urls += "?" + c.urlParams_.Encode() 9321 req, err := http.NewRequest("DELETE", urls, body) 9322 if err != nil { 9323 return nil, err 9324 } 9325 req.Header = reqHeaders 9326 googleapi.Expand(req.URL, map[string]string{ 9327 "name": c.name, 9328 }) 9329 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9330} 9331 9332// Do executes the "cloudbuild.projects.locations.workerPools.delete" call. 9333// Exactly one of *Operation or error will be non-nil. Any non-2xx 9334// status code is an error. Response headers are in either 9335// *Operation.ServerResponse.Header or (if a response was returned at 9336// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9337// to check whether the returned error was because 9338// http.StatusNotModified was returned. 9339func (c *ProjectsLocationsWorkerPoolsDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9340 gensupport.SetOptions(c.urlParams_, opts...) 9341 res, err := c.doRequest("json") 9342 if res != nil && res.StatusCode == http.StatusNotModified { 9343 if res.Body != nil { 9344 res.Body.Close() 9345 } 9346 return nil, &googleapi.Error{ 9347 Code: res.StatusCode, 9348 Header: res.Header, 9349 } 9350 } 9351 if err != nil { 9352 return nil, err 9353 } 9354 defer googleapi.CloseBody(res) 9355 if err := googleapi.CheckResponse(res); err != nil { 9356 return nil, err 9357 } 9358 ret := &Operation{ 9359 ServerResponse: googleapi.ServerResponse{ 9360 Header: res.Header, 9361 HTTPStatusCode: res.StatusCode, 9362 }, 9363 } 9364 target := &ret 9365 if err := gensupport.DecodeResponse(target, res); err != nil { 9366 return nil, err 9367 } 9368 return ret, nil 9369 // { 9370 // "description": "Deletes a `WorkerPool`.", 9371 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workerPools/{workerPoolsId}", 9372 // "httpMethod": "DELETE", 9373 // "id": "cloudbuild.projects.locations.workerPools.delete", 9374 // "parameterOrder": [ 9375 // "name" 9376 // ], 9377 // "parameters": { 9378 // "allowMissing": { 9379 // "description": "If set to true, and the `WorkerPool` is not found, the request will succeed but no action will be taken on the server.", 9380 // "location": "query", 9381 // "type": "boolean" 9382 // }, 9383 // "etag": { 9384 // "description": "Optional. If this is provided, it must match the server's etag on the workerpool for the request to be processed.", 9385 // "location": "query", 9386 // "type": "string" 9387 // }, 9388 // "name": { 9389 // "description": "Required. The name of the `WorkerPool` to delete. Format: `projects/{project}/locations/{workerPool}/workerPools/{workerPool}`.", 9390 // "location": "path", 9391 // "pattern": "^projects/[^/]+/locations/[^/]+/workerPools/[^/]+$", 9392 // "required": true, 9393 // "type": "string" 9394 // }, 9395 // "validateOnly": { 9396 // "description": "If set, validate the request and preview the response, but do not actually post it.", 9397 // "location": "query", 9398 // "type": "boolean" 9399 // } 9400 // }, 9401 // "path": "v1/{+name}", 9402 // "response": { 9403 // "$ref": "Operation" 9404 // }, 9405 // "scopes": [ 9406 // "https://www.googleapis.com/auth/cloud-platform" 9407 // ] 9408 // } 9409 9410} 9411 9412// method id "cloudbuild.projects.locations.workerPools.get": 9413 9414type ProjectsLocationsWorkerPoolsGetCall struct { 9415 s *Service 9416 name string 9417 urlParams_ gensupport.URLParams 9418 ifNoneMatch_ string 9419 ctx_ context.Context 9420 header_ http.Header 9421} 9422 9423// Get: Returns details of a `WorkerPool`. 9424// 9425// - name: The name of the `WorkerPool` to retrieve. Format: 9426// `projects/{project}/locations/{location}/workerPools/{workerPool}`. 9427func (r *ProjectsLocationsWorkerPoolsService) Get(name string) *ProjectsLocationsWorkerPoolsGetCall { 9428 c := &ProjectsLocationsWorkerPoolsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9429 c.name = name 9430 return c 9431} 9432 9433// Fields allows partial responses to be retrieved. See 9434// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9435// for more information. 9436func (c *ProjectsLocationsWorkerPoolsGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkerPoolsGetCall { 9437 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9438 return c 9439} 9440 9441// IfNoneMatch sets the optional parameter which makes the operation 9442// fail if the object's ETag matches the given value. This is useful for 9443// getting updates only after the object has changed since the last 9444// request. Use googleapi.IsNotModified to check whether the response 9445// error from Do is the result of In-None-Match. 9446func (c *ProjectsLocationsWorkerPoolsGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkerPoolsGetCall { 9447 c.ifNoneMatch_ = entityTag 9448 return c 9449} 9450 9451// Context sets the context to be used in this call's Do method. Any 9452// pending HTTP request will be aborted if the provided context is 9453// canceled. 9454func (c *ProjectsLocationsWorkerPoolsGetCall) Context(ctx context.Context) *ProjectsLocationsWorkerPoolsGetCall { 9455 c.ctx_ = ctx 9456 return c 9457} 9458 9459// Header returns an http.Header that can be modified by the caller to 9460// add HTTP headers to the request. 9461func (c *ProjectsLocationsWorkerPoolsGetCall) Header() http.Header { 9462 if c.header_ == nil { 9463 c.header_ = make(http.Header) 9464 } 9465 return c.header_ 9466} 9467 9468func (c *ProjectsLocationsWorkerPoolsGetCall) doRequest(alt string) (*http.Response, error) { 9469 reqHeaders := make(http.Header) 9470 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 9471 for k, v := range c.header_ { 9472 reqHeaders[k] = v 9473 } 9474 reqHeaders.Set("User-Agent", c.s.userAgent()) 9475 if c.ifNoneMatch_ != "" { 9476 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9477 } 9478 var body io.Reader = nil 9479 c.urlParams_.Set("alt", alt) 9480 c.urlParams_.Set("prettyPrint", "false") 9481 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 9482 urls += "?" + c.urlParams_.Encode() 9483 req, err := http.NewRequest("GET", urls, body) 9484 if err != nil { 9485 return nil, err 9486 } 9487 req.Header = reqHeaders 9488 googleapi.Expand(req.URL, map[string]string{ 9489 "name": c.name, 9490 }) 9491 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9492} 9493 9494// Do executes the "cloudbuild.projects.locations.workerPools.get" call. 9495// Exactly one of *WorkerPool or error will be non-nil. Any non-2xx 9496// status code is an error. Response headers are in either 9497// *WorkerPool.ServerResponse.Header or (if a response was returned at 9498// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9499// to check whether the returned error was because 9500// http.StatusNotModified was returned. 9501func (c *ProjectsLocationsWorkerPoolsGetCall) Do(opts ...googleapi.CallOption) (*WorkerPool, error) { 9502 gensupport.SetOptions(c.urlParams_, opts...) 9503 res, err := c.doRequest("json") 9504 if res != nil && res.StatusCode == http.StatusNotModified { 9505 if res.Body != nil { 9506 res.Body.Close() 9507 } 9508 return nil, &googleapi.Error{ 9509 Code: res.StatusCode, 9510 Header: res.Header, 9511 } 9512 } 9513 if err != nil { 9514 return nil, err 9515 } 9516 defer googleapi.CloseBody(res) 9517 if err := googleapi.CheckResponse(res); err != nil { 9518 return nil, err 9519 } 9520 ret := &WorkerPool{ 9521 ServerResponse: googleapi.ServerResponse{ 9522 Header: res.Header, 9523 HTTPStatusCode: res.StatusCode, 9524 }, 9525 } 9526 target := &ret 9527 if err := gensupport.DecodeResponse(target, res); err != nil { 9528 return nil, err 9529 } 9530 return ret, nil 9531 // { 9532 // "description": "Returns details of a `WorkerPool`.", 9533 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workerPools/{workerPoolsId}", 9534 // "httpMethod": "GET", 9535 // "id": "cloudbuild.projects.locations.workerPools.get", 9536 // "parameterOrder": [ 9537 // "name" 9538 // ], 9539 // "parameters": { 9540 // "name": { 9541 // "description": "Required. The name of the `WorkerPool` to retrieve. Format: `projects/{project}/locations/{location}/workerPools/{workerPool}`.", 9542 // "location": "path", 9543 // "pattern": "^projects/[^/]+/locations/[^/]+/workerPools/[^/]+$", 9544 // "required": true, 9545 // "type": "string" 9546 // } 9547 // }, 9548 // "path": "v1/{+name}", 9549 // "response": { 9550 // "$ref": "WorkerPool" 9551 // }, 9552 // "scopes": [ 9553 // "https://www.googleapis.com/auth/cloud-platform" 9554 // ] 9555 // } 9556 9557} 9558 9559// method id "cloudbuild.projects.locations.workerPools.list": 9560 9561type ProjectsLocationsWorkerPoolsListCall struct { 9562 s *Service 9563 parent string 9564 urlParams_ gensupport.URLParams 9565 ifNoneMatch_ string 9566 ctx_ context.Context 9567 header_ http.Header 9568} 9569 9570// List: Lists `WorkerPool`s. 9571// 9572// - parent: The parent of the collection of `WorkerPools`. Format: 9573// `projects/{project}/locations/{location}`. 9574func (r *ProjectsLocationsWorkerPoolsService) List(parent string) *ProjectsLocationsWorkerPoolsListCall { 9575 c := &ProjectsLocationsWorkerPoolsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9576 c.parent = parent 9577 return c 9578} 9579 9580// PageSize sets the optional parameter "pageSize": The maximum number 9581// of `WorkerPool`s to return. The service may return fewer than this 9582// value. If omitted, the server will use a sensible default. 9583func (c *ProjectsLocationsWorkerPoolsListCall) PageSize(pageSize int64) *ProjectsLocationsWorkerPoolsListCall { 9584 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9585 return c 9586} 9587 9588// PageToken sets the optional parameter "pageToken": A page token, 9589// received from a previous `ListWorkerPools` call. Provide this to 9590// retrieve the subsequent page. 9591func (c *ProjectsLocationsWorkerPoolsListCall) PageToken(pageToken string) *ProjectsLocationsWorkerPoolsListCall { 9592 c.urlParams_.Set("pageToken", pageToken) 9593 return c 9594} 9595 9596// Fields allows partial responses to be retrieved. See 9597// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9598// for more information. 9599func (c *ProjectsLocationsWorkerPoolsListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkerPoolsListCall { 9600 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9601 return c 9602} 9603 9604// IfNoneMatch sets the optional parameter which makes the operation 9605// fail if the object's ETag matches the given value. This is useful for 9606// getting updates only after the object has changed since the last 9607// request. Use googleapi.IsNotModified to check whether the response 9608// error from Do is the result of In-None-Match. 9609func (c *ProjectsLocationsWorkerPoolsListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkerPoolsListCall { 9610 c.ifNoneMatch_ = entityTag 9611 return c 9612} 9613 9614// Context sets the context to be used in this call's Do method. Any 9615// pending HTTP request will be aborted if the provided context is 9616// canceled. 9617func (c *ProjectsLocationsWorkerPoolsListCall) Context(ctx context.Context) *ProjectsLocationsWorkerPoolsListCall { 9618 c.ctx_ = ctx 9619 return c 9620} 9621 9622// Header returns an http.Header that can be modified by the caller to 9623// add HTTP headers to the request. 9624func (c *ProjectsLocationsWorkerPoolsListCall) Header() http.Header { 9625 if c.header_ == nil { 9626 c.header_ = make(http.Header) 9627 } 9628 return c.header_ 9629} 9630 9631func (c *ProjectsLocationsWorkerPoolsListCall) doRequest(alt string) (*http.Response, error) { 9632 reqHeaders := make(http.Header) 9633 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 9634 for k, v := range c.header_ { 9635 reqHeaders[k] = v 9636 } 9637 reqHeaders.Set("User-Agent", c.s.userAgent()) 9638 if c.ifNoneMatch_ != "" { 9639 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9640 } 9641 var body io.Reader = nil 9642 c.urlParams_.Set("alt", alt) 9643 c.urlParams_.Set("prettyPrint", "false") 9644 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workerPools") 9645 urls += "?" + c.urlParams_.Encode() 9646 req, err := http.NewRequest("GET", urls, body) 9647 if err != nil { 9648 return nil, err 9649 } 9650 req.Header = reqHeaders 9651 googleapi.Expand(req.URL, map[string]string{ 9652 "parent": c.parent, 9653 }) 9654 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9655} 9656 9657// Do executes the "cloudbuild.projects.locations.workerPools.list" call. 9658// Exactly one of *ListWorkerPoolsResponse or error will be non-nil. Any 9659// non-2xx status code is an error. Response headers are in either 9660// *ListWorkerPoolsResponse.ServerResponse.Header or (if a response was 9661// returned at all) in error.(*googleapi.Error).Header. Use 9662// googleapi.IsNotModified to check whether the returned error was 9663// because http.StatusNotModified was returned. 9664func (c *ProjectsLocationsWorkerPoolsListCall) Do(opts ...googleapi.CallOption) (*ListWorkerPoolsResponse, error) { 9665 gensupport.SetOptions(c.urlParams_, opts...) 9666 res, err := c.doRequest("json") 9667 if res != nil && res.StatusCode == http.StatusNotModified { 9668 if res.Body != nil { 9669 res.Body.Close() 9670 } 9671 return nil, &googleapi.Error{ 9672 Code: res.StatusCode, 9673 Header: res.Header, 9674 } 9675 } 9676 if err != nil { 9677 return nil, err 9678 } 9679 defer googleapi.CloseBody(res) 9680 if err := googleapi.CheckResponse(res); err != nil { 9681 return nil, err 9682 } 9683 ret := &ListWorkerPoolsResponse{ 9684 ServerResponse: googleapi.ServerResponse{ 9685 Header: res.Header, 9686 HTTPStatusCode: res.StatusCode, 9687 }, 9688 } 9689 target := &ret 9690 if err := gensupport.DecodeResponse(target, res); err != nil { 9691 return nil, err 9692 } 9693 return ret, nil 9694 // { 9695 // "description": "Lists `WorkerPool`s.", 9696 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workerPools", 9697 // "httpMethod": "GET", 9698 // "id": "cloudbuild.projects.locations.workerPools.list", 9699 // "parameterOrder": [ 9700 // "parent" 9701 // ], 9702 // "parameters": { 9703 // "pageSize": { 9704 // "description": "The maximum number of `WorkerPool`s to return. The service may return fewer than this value. If omitted, the server will use a sensible default.", 9705 // "format": "int32", 9706 // "location": "query", 9707 // "type": "integer" 9708 // }, 9709 // "pageToken": { 9710 // "description": "A page token, received from a previous `ListWorkerPools` call. Provide this to retrieve the subsequent page.", 9711 // "location": "query", 9712 // "type": "string" 9713 // }, 9714 // "parent": { 9715 // "description": "Required. The parent of the collection of `WorkerPools`. Format: `projects/{project}/locations/{location}`.", 9716 // "location": "path", 9717 // "pattern": "^projects/[^/]+/locations/[^/]+$", 9718 // "required": true, 9719 // "type": "string" 9720 // } 9721 // }, 9722 // "path": "v1/{+parent}/workerPools", 9723 // "response": { 9724 // "$ref": "ListWorkerPoolsResponse" 9725 // }, 9726 // "scopes": [ 9727 // "https://www.googleapis.com/auth/cloud-platform" 9728 // ] 9729 // } 9730 9731} 9732 9733// Pages invokes f for each page of results. 9734// A non-nil error returned from f will halt the iteration. 9735// The provided context supersedes any context provided to the Context method. 9736func (c *ProjectsLocationsWorkerPoolsListCall) Pages(ctx context.Context, f func(*ListWorkerPoolsResponse) error) error { 9737 c.ctx_ = ctx 9738 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9739 for { 9740 x, err := c.Do() 9741 if err != nil { 9742 return err 9743 } 9744 if err := f(x); err != nil { 9745 return err 9746 } 9747 if x.NextPageToken == "" { 9748 return nil 9749 } 9750 c.PageToken(x.NextPageToken) 9751 } 9752} 9753 9754// method id "cloudbuild.projects.locations.workerPools.patch": 9755 9756type ProjectsLocationsWorkerPoolsPatchCall struct { 9757 s *Service 9758 name string 9759 workerpool *WorkerPool 9760 urlParams_ gensupport.URLParams 9761 ctx_ context.Context 9762 header_ http.Header 9763} 9764 9765// Patch: Updates a `WorkerPool`. 9766// 9767// - name: Output only. The resource name of the `WorkerPool`, with 9768// format 9769// `projects/{project}/locations/{location}/workerPools/{worker_pool}`. 9770// The value of `{worker_pool}` is provided by `worker_pool_id` in 9771// `CreateWorkerPool` request and the value of `{location}` is 9772// determined by the endpoint accessed. 9773func (r *ProjectsLocationsWorkerPoolsService) Patch(name string, workerpool *WorkerPool) *ProjectsLocationsWorkerPoolsPatchCall { 9774 c := &ProjectsLocationsWorkerPoolsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9775 c.name = name 9776 c.workerpool = workerpool 9777 return c 9778} 9779 9780// UpdateMask sets the optional parameter "updateMask": A mask 9781// specifying which fields in `worker_pool` to update. 9782func (c *ProjectsLocationsWorkerPoolsPatchCall) UpdateMask(updateMask string) *ProjectsLocationsWorkerPoolsPatchCall { 9783 c.urlParams_.Set("updateMask", updateMask) 9784 return c 9785} 9786 9787// ValidateOnly sets the optional parameter "validateOnly": If set, 9788// validate the request and preview the response, but do not actually 9789// post it. 9790func (c *ProjectsLocationsWorkerPoolsPatchCall) ValidateOnly(validateOnly bool) *ProjectsLocationsWorkerPoolsPatchCall { 9791 c.urlParams_.Set("validateOnly", fmt.Sprint(validateOnly)) 9792 return c 9793} 9794 9795// Fields allows partial responses to be retrieved. See 9796// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9797// for more information. 9798func (c *ProjectsLocationsWorkerPoolsPatchCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkerPoolsPatchCall { 9799 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9800 return c 9801} 9802 9803// Context sets the context to be used in this call's Do method. Any 9804// pending HTTP request will be aborted if the provided context is 9805// canceled. 9806func (c *ProjectsLocationsWorkerPoolsPatchCall) Context(ctx context.Context) *ProjectsLocationsWorkerPoolsPatchCall { 9807 c.ctx_ = ctx 9808 return c 9809} 9810 9811// Header returns an http.Header that can be modified by the caller to 9812// add HTTP headers to the request. 9813func (c *ProjectsLocationsWorkerPoolsPatchCall) Header() http.Header { 9814 if c.header_ == nil { 9815 c.header_ = make(http.Header) 9816 } 9817 return c.header_ 9818} 9819 9820func (c *ProjectsLocationsWorkerPoolsPatchCall) doRequest(alt string) (*http.Response, error) { 9821 reqHeaders := make(http.Header) 9822 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 9823 for k, v := range c.header_ { 9824 reqHeaders[k] = v 9825 } 9826 reqHeaders.Set("User-Agent", c.s.userAgent()) 9827 var body io.Reader = nil 9828 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workerpool) 9829 if err != nil { 9830 return nil, err 9831 } 9832 reqHeaders.Set("Content-Type", "application/json") 9833 c.urlParams_.Set("alt", alt) 9834 c.urlParams_.Set("prettyPrint", "false") 9835 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 9836 urls += "?" + c.urlParams_.Encode() 9837 req, err := http.NewRequest("PATCH", urls, body) 9838 if err != nil { 9839 return nil, err 9840 } 9841 req.Header = reqHeaders 9842 googleapi.Expand(req.URL, map[string]string{ 9843 "name": c.name, 9844 }) 9845 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9846} 9847 9848// Do executes the "cloudbuild.projects.locations.workerPools.patch" call. 9849// Exactly one of *Operation or error will be non-nil. Any non-2xx 9850// status code is an error. Response headers are in either 9851// *Operation.ServerResponse.Header or (if a response was returned at 9852// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9853// to check whether the returned error was because 9854// http.StatusNotModified was returned. 9855func (c *ProjectsLocationsWorkerPoolsPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9856 gensupport.SetOptions(c.urlParams_, opts...) 9857 res, err := c.doRequest("json") 9858 if res != nil && res.StatusCode == http.StatusNotModified { 9859 if res.Body != nil { 9860 res.Body.Close() 9861 } 9862 return nil, &googleapi.Error{ 9863 Code: res.StatusCode, 9864 Header: res.Header, 9865 } 9866 } 9867 if err != nil { 9868 return nil, err 9869 } 9870 defer googleapi.CloseBody(res) 9871 if err := googleapi.CheckResponse(res); err != nil { 9872 return nil, err 9873 } 9874 ret := &Operation{ 9875 ServerResponse: googleapi.ServerResponse{ 9876 Header: res.Header, 9877 HTTPStatusCode: res.StatusCode, 9878 }, 9879 } 9880 target := &ret 9881 if err := gensupport.DecodeResponse(target, res); err != nil { 9882 return nil, err 9883 } 9884 return ret, nil 9885 // { 9886 // "description": "Updates a `WorkerPool`.", 9887 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workerPools/{workerPoolsId}", 9888 // "httpMethod": "PATCH", 9889 // "id": "cloudbuild.projects.locations.workerPools.patch", 9890 // "parameterOrder": [ 9891 // "name" 9892 // ], 9893 // "parameters": { 9894 // "name": { 9895 // "description": "Output only. The resource name of the `WorkerPool`, with format `projects/{project}/locations/{location}/workerPools/{worker_pool}`. The value of `{worker_pool}` is provided by `worker_pool_id` in `CreateWorkerPool` request and the value of `{location}` is determined by the endpoint accessed.", 9896 // "location": "path", 9897 // "pattern": "^projects/[^/]+/locations/[^/]+/workerPools/[^/]+$", 9898 // "required": true, 9899 // "type": "string" 9900 // }, 9901 // "updateMask": { 9902 // "description": "A mask specifying which fields in `worker_pool` to update.", 9903 // "format": "google-fieldmask", 9904 // "location": "query", 9905 // "type": "string" 9906 // }, 9907 // "validateOnly": { 9908 // "description": "If set, validate the request and preview the response, but do not actually post it.", 9909 // "location": "query", 9910 // "type": "boolean" 9911 // } 9912 // }, 9913 // "path": "v1/{+name}", 9914 // "request": { 9915 // "$ref": "WorkerPool" 9916 // }, 9917 // "response": { 9918 // "$ref": "Operation" 9919 // }, 9920 // "scopes": [ 9921 // "https://www.googleapis.com/auth/cloud-platform" 9922 // ] 9923 // } 9924 9925} 9926 9927// method id "cloudbuild.projects.triggers.create": 9928 9929type ProjectsTriggersCreateCall struct { 9930 s *Service 9931 projectId string 9932 buildtrigger *BuildTrigger 9933 urlParams_ gensupport.URLParams 9934 ctx_ context.Context 9935 header_ http.Header 9936} 9937 9938// Create: Creates a new `BuildTrigger`. This API is experimental. 9939// 9940// - projectId: ID of the project for which to configure automatic 9941// builds. 9942func (r *ProjectsTriggersService) Create(projectId string, buildtrigger *BuildTrigger) *ProjectsTriggersCreateCall { 9943 c := &ProjectsTriggersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9944 c.projectId = projectId 9945 c.buildtrigger = buildtrigger 9946 return c 9947} 9948 9949// Parent sets the optional parameter "parent": The parent resource 9950// where this trigger will be created. Format: 9951// `projects/{project}/locations/{location}` 9952func (c *ProjectsTriggersCreateCall) Parent(parent string) *ProjectsTriggersCreateCall { 9953 c.urlParams_.Set("parent", parent) 9954 return c 9955} 9956 9957// Fields allows partial responses to be retrieved. See 9958// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9959// for more information. 9960func (c *ProjectsTriggersCreateCall) Fields(s ...googleapi.Field) *ProjectsTriggersCreateCall { 9961 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9962 return c 9963} 9964 9965// Context sets the context to be used in this call's Do method. Any 9966// pending HTTP request will be aborted if the provided context is 9967// canceled. 9968func (c *ProjectsTriggersCreateCall) Context(ctx context.Context) *ProjectsTriggersCreateCall { 9969 c.ctx_ = ctx 9970 return c 9971} 9972 9973// Header returns an http.Header that can be modified by the caller to 9974// add HTTP headers to the request. 9975func (c *ProjectsTriggersCreateCall) Header() http.Header { 9976 if c.header_ == nil { 9977 c.header_ = make(http.Header) 9978 } 9979 return c.header_ 9980} 9981 9982func (c *ProjectsTriggersCreateCall) doRequest(alt string) (*http.Response, error) { 9983 reqHeaders := make(http.Header) 9984 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 9985 for k, v := range c.header_ { 9986 reqHeaders[k] = v 9987 } 9988 reqHeaders.Set("User-Agent", c.s.userAgent()) 9989 var body io.Reader = nil 9990 body, err := googleapi.WithoutDataWrapper.JSONReader(c.buildtrigger) 9991 if err != nil { 9992 return nil, err 9993 } 9994 reqHeaders.Set("Content-Type", "application/json") 9995 c.urlParams_.Set("alt", alt) 9996 c.urlParams_.Set("prettyPrint", "false") 9997 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/triggers") 9998 urls += "?" + c.urlParams_.Encode() 9999 req, err := http.NewRequest("POST", urls, body) 10000 if err != nil { 10001 return nil, err 10002 } 10003 req.Header = reqHeaders 10004 googleapi.Expand(req.URL, map[string]string{ 10005 "projectId": c.projectId, 10006 }) 10007 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10008} 10009 10010// Do executes the "cloudbuild.projects.triggers.create" call. 10011// Exactly one of *BuildTrigger or error will be non-nil. Any non-2xx 10012// status code is an error. Response headers are in either 10013// *BuildTrigger.ServerResponse.Header or (if a response was returned at 10014// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10015// to check whether the returned error was because 10016// http.StatusNotModified was returned. 10017func (c *ProjectsTriggersCreateCall) Do(opts ...googleapi.CallOption) (*BuildTrigger, error) { 10018 gensupport.SetOptions(c.urlParams_, opts...) 10019 res, err := c.doRequest("json") 10020 if res != nil && res.StatusCode == http.StatusNotModified { 10021 if res.Body != nil { 10022 res.Body.Close() 10023 } 10024 return nil, &googleapi.Error{ 10025 Code: res.StatusCode, 10026 Header: res.Header, 10027 } 10028 } 10029 if err != nil { 10030 return nil, err 10031 } 10032 defer googleapi.CloseBody(res) 10033 if err := googleapi.CheckResponse(res); err != nil { 10034 return nil, err 10035 } 10036 ret := &BuildTrigger{ 10037 ServerResponse: googleapi.ServerResponse{ 10038 Header: res.Header, 10039 HTTPStatusCode: res.StatusCode, 10040 }, 10041 } 10042 target := &ret 10043 if err := gensupport.DecodeResponse(target, res); err != nil { 10044 return nil, err 10045 } 10046 return ret, nil 10047 // { 10048 // "description": "Creates a new `BuildTrigger`. This API is experimental.", 10049 // "flatPath": "v1/projects/{projectId}/triggers", 10050 // "httpMethod": "POST", 10051 // "id": "cloudbuild.projects.triggers.create", 10052 // "parameterOrder": [ 10053 // "projectId" 10054 // ], 10055 // "parameters": { 10056 // "parent": { 10057 // "description": "The parent resource where this trigger will be created. Format: `projects/{project}/locations/{location}`", 10058 // "location": "query", 10059 // "type": "string" 10060 // }, 10061 // "projectId": { 10062 // "description": "Required. ID of the project for which to configure automatic builds.", 10063 // "location": "path", 10064 // "required": true, 10065 // "type": "string" 10066 // } 10067 // }, 10068 // "path": "v1/projects/{projectId}/triggers", 10069 // "request": { 10070 // "$ref": "BuildTrigger" 10071 // }, 10072 // "response": { 10073 // "$ref": "BuildTrigger" 10074 // }, 10075 // "scopes": [ 10076 // "https://www.googleapis.com/auth/cloud-platform" 10077 // ] 10078 // } 10079 10080} 10081 10082// method id "cloudbuild.projects.triggers.delete": 10083 10084type ProjectsTriggersDeleteCall struct { 10085 s *Service 10086 projectId string 10087 triggerId string 10088 urlParams_ gensupport.URLParams 10089 ctx_ context.Context 10090 header_ http.Header 10091} 10092 10093// Delete: Deletes a `BuildTrigger` by its project ID and trigger ID. 10094// This API is experimental. 10095// 10096// - projectId: ID of the project that owns the trigger. 10097// - triggerId: ID of the `BuildTrigger` to delete. 10098func (r *ProjectsTriggersService) Delete(projectId string, triggerId string) *ProjectsTriggersDeleteCall { 10099 c := &ProjectsTriggersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10100 c.projectId = projectId 10101 c.triggerId = triggerId 10102 return c 10103} 10104 10105// Name sets the optional parameter "name": The name of the `Trigger` to 10106// delete. Format: 10107// `projects/{project}/locations/{location}/triggers/{trigger}` 10108func (c *ProjectsTriggersDeleteCall) Name(name string) *ProjectsTriggersDeleteCall { 10109 c.urlParams_.Set("name", name) 10110 return c 10111} 10112 10113// Fields allows partial responses to be retrieved. See 10114// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10115// for more information. 10116func (c *ProjectsTriggersDeleteCall) Fields(s ...googleapi.Field) *ProjectsTriggersDeleteCall { 10117 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10118 return c 10119} 10120 10121// Context sets the context to be used in this call's Do method. Any 10122// pending HTTP request will be aborted if the provided context is 10123// canceled. 10124func (c *ProjectsTriggersDeleteCall) Context(ctx context.Context) *ProjectsTriggersDeleteCall { 10125 c.ctx_ = ctx 10126 return c 10127} 10128 10129// Header returns an http.Header that can be modified by the caller to 10130// add HTTP headers to the request. 10131func (c *ProjectsTriggersDeleteCall) Header() http.Header { 10132 if c.header_ == nil { 10133 c.header_ = make(http.Header) 10134 } 10135 return c.header_ 10136} 10137 10138func (c *ProjectsTriggersDeleteCall) doRequest(alt string) (*http.Response, error) { 10139 reqHeaders := make(http.Header) 10140 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 10141 for k, v := range c.header_ { 10142 reqHeaders[k] = v 10143 } 10144 reqHeaders.Set("User-Agent", c.s.userAgent()) 10145 var body io.Reader = nil 10146 c.urlParams_.Set("alt", alt) 10147 c.urlParams_.Set("prettyPrint", "false") 10148 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/triggers/{triggerId}") 10149 urls += "?" + c.urlParams_.Encode() 10150 req, err := http.NewRequest("DELETE", urls, body) 10151 if err != nil { 10152 return nil, err 10153 } 10154 req.Header = reqHeaders 10155 googleapi.Expand(req.URL, map[string]string{ 10156 "projectId": c.projectId, 10157 "triggerId": c.triggerId, 10158 }) 10159 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10160} 10161 10162// Do executes the "cloudbuild.projects.triggers.delete" call. 10163// Exactly one of *Empty or error will be non-nil. Any non-2xx status 10164// code is an error. Response headers are in either 10165// *Empty.ServerResponse.Header or (if a response was returned at all) 10166// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10167// check whether the returned error was because http.StatusNotModified 10168// was returned. 10169func (c *ProjectsTriggersDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 10170 gensupport.SetOptions(c.urlParams_, opts...) 10171 res, err := c.doRequest("json") 10172 if res != nil && res.StatusCode == http.StatusNotModified { 10173 if res.Body != nil { 10174 res.Body.Close() 10175 } 10176 return nil, &googleapi.Error{ 10177 Code: res.StatusCode, 10178 Header: res.Header, 10179 } 10180 } 10181 if err != nil { 10182 return nil, err 10183 } 10184 defer googleapi.CloseBody(res) 10185 if err := googleapi.CheckResponse(res); err != nil { 10186 return nil, err 10187 } 10188 ret := &Empty{ 10189 ServerResponse: googleapi.ServerResponse{ 10190 Header: res.Header, 10191 HTTPStatusCode: res.StatusCode, 10192 }, 10193 } 10194 target := &ret 10195 if err := gensupport.DecodeResponse(target, res); err != nil { 10196 return nil, err 10197 } 10198 return ret, nil 10199 // { 10200 // "description": "Deletes a `BuildTrigger` by its project ID and trigger ID. This API is experimental.", 10201 // "flatPath": "v1/projects/{projectId}/triggers/{triggerId}", 10202 // "httpMethod": "DELETE", 10203 // "id": "cloudbuild.projects.triggers.delete", 10204 // "parameterOrder": [ 10205 // "projectId", 10206 // "triggerId" 10207 // ], 10208 // "parameters": { 10209 // "name": { 10210 // "description": "The name of the `Trigger` to delete. Format: `projects/{project}/locations/{location}/triggers/{trigger}`", 10211 // "location": "query", 10212 // "type": "string" 10213 // }, 10214 // "projectId": { 10215 // "description": "Required. ID of the project that owns the trigger.", 10216 // "location": "path", 10217 // "required": true, 10218 // "type": "string" 10219 // }, 10220 // "triggerId": { 10221 // "description": "Required. ID of the `BuildTrigger` to delete.", 10222 // "location": "path", 10223 // "required": true, 10224 // "type": "string" 10225 // } 10226 // }, 10227 // "path": "v1/projects/{projectId}/triggers/{triggerId}", 10228 // "response": { 10229 // "$ref": "Empty" 10230 // }, 10231 // "scopes": [ 10232 // "https://www.googleapis.com/auth/cloud-platform" 10233 // ] 10234 // } 10235 10236} 10237 10238// method id "cloudbuild.projects.triggers.get": 10239 10240type ProjectsTriggersGetCall struct { 10241 s *Service 10242 projectId string 10243 triggerId string 10244 urlParams_ gensupport.URLParams 10245 ifNoneMatch_ string 10246 ctx_ context.Context 10247 header_ http.Header 10248} 10249 10250// Get: Returns information about a `BuildTrigger`. This API is 10251// experimental. 10252// 10253// - projectId: ID of the project that owns the trigger. 10254// - triggerId: Identifier (`id` or `name`) of the `BuildTrigger` to 10255// get. 10256func (r *ProjectsTriggersService) Get(projectId string, triggerId string) *ProjectsTriggersGetCall { 10257 c := &ProjectsTriggersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10258 c.projectId = projectId 10259 c.triggerId = triggerId 10260 return c 10261} 10262 10263// Name sets the optional parameter "name": The name of the `Trigger` to 10264// retrieve. Format: 10265// `projects/{project}/locations/{location}/triggers/{trigger}` 10266func (c *ProjectsTriggersGetCall) Name(name string) *ProjectsTriggersGetCall { 10267 c.urlParams_.Set("name", name) 10268 return c 10269} 10270 10271// Fields allows partial responses to be retrieved. See 10272// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10273// for more information. 10274func (c *ProjectsTriggersGetCall) Fields(s ...googleapi.Field) *ProjectsTriggersGetCall { 10275 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10276 return c 10277} 10278 10279// IfNoneMatch sets the optional parameter which makes the operation 10280// fail if the object's ETag matches the given value. This is useful for 10281// getting updates only after the object has changed since the last 10282// request. Use googleapi.IsNotModified to check whether the response 10283// error from Do is the result of In-None-Match. 10284func (c *ProjectsTriggersGetCall) IfNoneMatch(entityTag string) *ProjectsTriggersGetCall { 10285 c.ifNoneMatch_ = entityTag 10286 return c 10287} 10288 10289// Context sets the context to be used in this call's Do method. Any 10290// pending HTTP request will be aborted if the provided context is 10291// canceled. 10292func (c *ProjectsTriggersGetCall) Context(ctx context.Context) *ProjectsTriggersGetCall { 10293 c.ctx_ = ctx 10294 return c 10295} 10296 10297// Header returns an http.Header that can be modified by the caller to 10298// add HTTP headers to the request. 10299func (c *ProjectsTriggersGetCall) Header() http.Header { 10300 if c.header_ == nil { 10301 c.header_ = make(http.Header) 10302 } 10303 return c.header_ 10304} 10305 10306func (c *ProjectsTriggersGetCall) doRequest(alt string) (*http.Response, error) { 10307 reqHeaders := make(http.Header) 10308 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 10309 for k, v := range c.header_ { 10310 reqHeaders[k] = v 10311 } 10312 reqHeaders.Set("User-Agent", c.s.userAgent()) 10313 if c.ifNoneMatch_ != "" { 10314 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10315 } 10316 var body io.Reader = nil 10317 c.urlParams_.Set("alt", alt) 10318 c.urlParams_.Set("prettyPrint", "false") 10319 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/triggers/{triggerId}") 10320 urls += "?" + c.urlParams_.Encode() 10321 req, err := http.NewRequest("GET", urls, body) 10322 if err != nil { 10323 return nil, err 10324 } 10325 req.Header = reqHeaders 10326 googleapi.Expand(req.URL, map[string]string{ 10327 "projectId": c.projectId, 10328 "triggerId": c.triggerId, 10329 }) 10330 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10331} 10332 10333// Do executes the "cloudbuild.projects.triggers.get" call. 10334// Exactly one of *BuildTrigger or error will be non-nil. Any non-2xx 10335// status code is an error. Response headers are in either 10336// *BuildTrigger.ServerResponse.Header or (if a response was returned at 10337// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10338// to check whether the returned error was because 10339// http.StatusNotModified was returned. 10340func (c *ProjectsTriggersGetCall) Do(opts ...googleapi.CallOption) (*BuildTrigger, error) { 10341 gensupport.SetOptions(c.urlParams_, opts...) 10342 res, err := c.doRequest("json") 10343 if res != nil && res.StatusCode == http.StatusNotModified { 10344 if res.Body != nil { 10345 res.Body.Close() 10346 } 10347 return nil, &googleapi.Error{ 10348 Code: res.StatusCode, 10349 Header: res.Header, 10350 } 10351 } 10352 if err != nil { 10353 return nil, err 10354 } 10355 defer googleapi.CloseBody(res) 10356 if err := googleapi.CheckResponse(res); err != nil { 10357 return nil, err 10358 } 10359 ret := &BuildTrigger{ 10360 ServerResponse: googleapi.ServerResponse{ 10361 Header: res.Header, 10362 HTTPStatusCode: res.StatusCode, 10363 }, 10364 } 10365 target := &ret 10366 if err := gensupport.DecodeResponse(target, res); err != nil { 10367 return nil, err 10368 } 10369 return ret, nil 10370 // { 10371 // "description": "Returns information about a `BuildTrigger`. This API is experimental.", 10372 // "flatPath": "v1/projects/{projectId}/triggers/{triggerId}", 10373 // "httpMethod": "GET", 10374 // "id": "cloudbuild.projects.triggers.get", 10375 // "parameterOrder": [ 10376 // "projectId", 10377 // "triggerId" 10378 // ], 10379 // "parameters": { 10380 // "name": { 10381 // "description": "The name of the `Trigger` to retrieve. Format: `projects/{project}/locations/{location}/triggers/{trigger}`", 10382 // "location": "query", 10383 // "type": "string" 10384 // }, 10385 // "projectId": { 10386 // "description": "Required. ID of the project that owns the trigger.", 10387 // "location": "path", 10388 // "required": true, 10389 // "type": "string" 10390 // }, 10391 // "triggerId": { 10392 // "description": "Required. Identifier (`id` or `name`) of the `BuildTrigger` to get.", 10393 // "location": "path", 10394 // "required": true, 10395 // "type": "string" 10396 // } 10397 // }, 10398 // "path": "v1/projects/{projectId}/triggers/{triggerId}", 10399 // "response": { 10400 // "$ref": "BuildTrigger" 10401 // }, 10402 // "scopes": [ 10403 // "https://www.googleapis.com/auth/cloud-platform" 10404 // ] 10405 // } 10406 10407} 10408 10409// method id "cloudbuild.projects.triggers.list": 10410 10411type ProjectsTriggersListCall struct { 10412 s *Service 10413 projectId string 10414 urlParams_ gensupport.URLParams 10415 ifNoneMatch_ string 10416 ctx_ context.Context 10417 header_ http.Header 10418} 10419 10420// List: Lists existing `BuildTrigger`s. This API is experimental. 10421// 10422// - projectId: ID of the project for which to list BuildTriggers. 10423func (r *ProjectsTriggersService) List(projectId string) *ProjectsTriggersListCall { 10424 c := &ProjectsTriggersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10425 c.projectId = projectId 10426 return c 10427} 10428 10429// PageSize sets the optional parameter "pageSize": Number of results to 10430// return in the list. 10431func (c *ProjectsTriggersListCall) PageSize(pageSize int64) *ProjectsTriggersListCall { 10432 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 10433 return c 10434} 10435 10436// PageToken sets the optional parameter "pageToken": Token to provide 10437// to skip to a particular spot in the list. 10438func (c *ProjectsTriggersListCall) PageToken(pageToken string) *ProjectsTriggersListCall { 10439 c.urlParams_.Set("pageToken", pageToken) 10440 return c 10441} 10442 10443// Parent sets the optional parameter "parent": The parent of the 10444// collection of `Triggers`. Format: 10445// `projects/{project}/locations/{location}` 10446func (c *ProjectsTriggersListCall) Parent(parent string) *ProjectsTriggersListCall { 10447 c.urlParams_.Set("parent", parent) 10448 return c 10449} 10450 10451// Fields allows partial responses to be retrieved. See 10452// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10453// for more information. 10454func (c *ProjectsTriggersListCall) Fields(s ...googleapi.Field) *ProjectsTriggersListCall { 10455 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10456 return c 10457} 10458 10459// IfNoneMatch sets the optional parameter which makes the operation 10460// fail if the object's ETag matches the given value. This is useful for 10461// getting updates only after the object has changed since the last 10462// request. Use googleapi.IsNotModified to check whether the response 10463// error from Do is the result of In-None-Match. 10464func (c *ProjectsTriggersListCall) IfNoneMatch(entityTag string) *ProjectsTriggersListCall { 10465 c.ifNoneMatch_ = entityTag 10466 return c 10467} 10468 10469// Context sets the context to be used in this call's Do method. Any 10470// pending HTTP request will be aborted if the provided context is 10471// canceled. 10472func (c *ProjectsTriggersListCall) Context(ctx context.Context) *ProjectsTriggersListCall { 10473 c.ctx_ = ctx 10474 return c 10475} 10476 10477// Header returns an http.Header that can be modified by the caller to 10478// add HTTP headers to the request. 10479func (c *ProjectsTriggersListCall) Header() http.Header { 10480 if c.header_ == nil { 10481 c.header_ = make(http.Header) 10482 } 10483 return c.header_ 10484} 10485 10486func (c *ProjectsTriggersListCall) doRequest(alt string) (*http.Response, error) { 10487 reqHeaders := make(http.Header) 10488 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 10489 for k, v := range c.header_ { 10490 reqHeaders[k] = v 10491 } 10492 reqHeaders.Set("User-Agent", c.s.userAgent()) 10493 if c.ifNoneMatch_ != "" { 10494 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 10495 } 10496 var body io.Reader = nil 10497 c.urlParams_.Set("alt", alt) 10498 c.urlParams_.Set("prettyPrint", "false") 10499 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/triggers") 10500 urls += "?" + c.urlParams_.Encode() 10501 req, err := http.NewRequest("GET", urls, body) 10502 if err != nil { 10503 return nil, err 10504 } 10505 req.Header = reqHeaders 10506 googleapi.Expand(req.URL, map[string]string{ 10507 "projectId": c.projectId, 10508 }) 10509 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10510} 10511 10512// Do executes the "cloudbuild.projects.triggers.list" call. 10513// Exactly one of *ListBuildTriggersResponse or error will be non-nil. 10514// Any non-2xx status code is an error. Response headers are in either 10515// *ListBuildTriggersResponse.ServerResponse.Header or (if a response 10516// was returned at all) in error.(*googleapi.Error).Header. Use 10517// googleapi.IsNotModified to check whether the returned error was 10518// because http.StatusNotModified was returned. 10519func (c *ProjectsTriggersListCall) Do(opts ...googleapi.CallOption) (*ListBuildTriggersResponse, error) { 10520 gensupport.SetOptions(c.urlParams_, opts...) 10521 res, err := c.doRequest("json") 10522 if res != nil && res.StatusCode == http.StatusNotModified { 10523 if res.Body != nil { 10524 res.Body.Close() 10525 } 10526 return nil, &googleapi.Error{ 10527 Code: res.StatusCode, 10528 Header: res.Header, 10529 } 10530 } 10531 if err != nil { 10532 return nil, err 10533 } 10534 defer googleapi.CloseBody(res) 10535 if err := googleapi.CheckResponse(res); err != nil { 10536 return nil, err 10537 } 10538 ret := &ListBuildTriggersResponse{ 10539 ServerResponse: googleapi.ServerResponse{ 10540 Header: res.Header, 10541 HTTPStatusCode: res.StatusCode, 10542 }, 10543 } 10544 target := &ret 10545 if err := gensupport.DecodeResponse(target, res); err != nil { 10546 return nil, err 10547 } 10548 return ret, nil 10549 // { 10550 // "description": "Lists existing `BuildTrigger`s. This API is experimental.", 10551 // "flatPath": "v1/projects/{projectId}/triggers", 10552 // "httpMethod": "GET", 10553 // "id": "cloudbuild.projects.triggers.list", 10554 // "parameterOrder": [ 10555 // "projectId" 10556 // ], 10557 // "parameters": { 10558 // "pageSize": { 10559 // "description": "Number of results to return in the list.", 10560 // "format": "int32", 10561 // "location": "query", 10562 // "type": "integer" 10563 // }, 10564 // "pageToken": { 10565 // "description": "Token to provide to skip to a particular spot in the list.", 10566 // "location": "query", 10567 // "type": "string" 10568 // }, 10569 // "parent": { 10570 // "description": "The parent of the collection of `Triggers`. Format: `projects/{project}/locations/{location}`", 10571 // "location": "query", 10572 // "type": "string" 10573 // }, 10574 // "projectId": { 10575 // "description": "Required. ID of the project for which to list BuildTriggers.", 10576 // "location": "path", 10577 // "required": true, 10578 // "type": "string" 10579 // } 10580 // }, 10581 // "path": "v1/projects/{projectId}/triggers", 10582 // "response": { 10583 // "$ref": "ListBuildTriggersResponse" 10584 // }, 10585 // "scopes": [ 10586 // "https://www.googleapis.com/auth/cloud-platform" 10587 // ] 10588 // } 10589 10590} 10591 10592// Pages invokes f for each page of results. 10593// A non-nil error returned from f will halt the iteration. 10594// The provided context supersedes any context provided to the Context method. 10595func (c *ProjectsTriggersListCall) Pages(ctx context.Context, f func(*ListBuildTriggersResponse) error) error { 10596 c.ctx_ = ctx 10597 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 10598 for { 10599 x, err := c.Do() 10600 if err != nil { 10601 return err 10602 } 10603 if err := f(x); err != nil { 10604 return err 10605 } 10606 if x.NextPageToken == "" { 10607 return nil 10608 } 10609 c.PageToken(x.NextPageToken) 10610 } 10611} 10612 10613// method id "cloudbuild.projects.triggers.patch": 10614 10615type ProjectsTriggersPatchCall struct { 10616 s *Service 10617 projectId string 10618 triggerId string 10619 buildtrigger *BuildTrigger 10620 urlParams_ gensupport.URLParams 10621 ctx_ context.Context 10622 header_ http.Header 10623} 10624 10625// Patch: Updates a `BuildTrigger` by its project ID and trigger ID. 10626// This API is experimental. 10627// 10628// - projectId: ID of the project that owns the trigger. 10629// - triggerId: ID of the `BuildTrigger` to update. 10630func (r *ProjectsTriggersService) Patch(projectId string, triggerId string, buildtrigger *BuildTrigger) *ProjectsTriggersPatchCall { 10631 c := &ProjectsTriggersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10632 c.projectId = projectId 10633 c.triggerId = triggerId 10634 c.buildtrigger = buildtrigger 10635 return c 10636} 10637 10638// Fields allows partial responses to be retrieved. See 10639// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10640// for more information. 10641func (c *ProjectsTriggersPatchCall) Fields(s ...googleapi.Field) *ProjectsTriggersPatchCall { 10642 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10643 return c 10644} 10645 10646// Context sets the context to be used in this call's Do method. Any 10647// pending HTTP request will be aborted if the provided context is 10648// canceled. 10649func (c *ProjectsTriggersPatchCall) Context(ctx context.Context) *ProjectsTriggersPatchCall { 10650 c.ctx_ = ctx 10651 return c 10652} 10653 10654// Header returns an http.Header that can be modified by the caller to 10655// add HTTP headers to the request. 10656func (c *ProjectsTriggersPatchCall) Header() http.Header { 10657 if c.header_ == nil { 10658 c.header_ = make(http.Header) 10659 } 10660 return c.header_ 10661} 10662 10663func (c *ProjectsTriggersPatchCall) doRequest(alt string) (*http.Response, error) { 10664 reqHeaders := make(http.Header) 10665 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 10666 for k, v := range c.header_ { 10667 reqHeaders[k] = v 10668 } 10669 reqHeaders.Set("User-Agent", c.s.userAgent()) 10670 var body io.Reader = nil 10671 body, err := googleapi.WithoutDataWrapper.JSONReader(c.buildtrigger) 10672 if err != nil { 10673 return nil, err 10674 } 10675 reqHeaders.Set("Content-Type", "application/json") 10676 c.urlParams_.Set("alt", alt) 10677 c.urlParams_.Set("prettyPrint", "false") 10678 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/triggers/{triggerId}") 10679 urls += "?" + c.urlParams_.Encode() 10680 req, err := http.NewRequest("PATCH", urls, body) 10681 if err != nil { 10682 return nil, err 10683 } 10684 req.Header = reqHeaders 10685 googleapi.Expand(req.URL, map[string]string{ 10686 "projectId": c.projectId, 10687 "triggerId": c.triggerId, 10688 }) 10689 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10690} 10691 10692// Do executes the "cloudbuild.projects.triggers.patch" call. 10693// Exactly one of *BuildTrigger or error will be non-nil. Any non-2xx 10694// status code is an error. Response headers are in either 10695// *BuildTrigger.ServerResponse.Header or (if a response was returned at 10696// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10697// to check whether the returned error was because 10698// http.StatusNotModified was returned. 10699func (c *ProjectsTriggersPatchCall) Do(opts ...googleapi.CallOption) (*BuildTrigger, error) { 10700 gensupport.SetOptions(c.urlParams_, opts...) 10701 res, err := c.doRequest("json") 10702 if res != nil && res.StatusCode == http.StatusNotModified { 10703 if res.Body != nil { 10704 res.Body.Close() 10705 } 10706 return nil, &googleapi.Error{ 10707 Code: res.StatusCode, 10708 Header: res.Header, 10709 } 10710 } 10711 if err != nil { 10712 return nil, err 10713 } 10714 defer googleapi.CloseBody(res) 10715 if err := googleapi.CheckResponse(res); err != nil { 10716 return nil, err 10717 } 10718 ret := &BuildTrigger{ 10719 ServerResponse: googleapi.ServerResponse{ 10720 Header: res.Header, 10721 HTTPStatusCode: res.StatusCode, 10722 }, 10723 } 10724 target := &ret 10725 if err := gensupport.DecodeResponse(target, res); err != nil { 10726 return nil, err 10727 } 10728 return ret, nil 10729 // { 10730 // "description": "Updates a `BuildTrigger` by its project ID and trigger ID. This API is experimental.", 10731 // "flatPath": "v1/projects/{projectId}/triggers/{triggerId}", 10732 // "httpMethod": "PATCH", 10733 // "id": "cloudbuild.projects.triggers.patch", 10734 // "parameterOrder": [ 10735 // "projectId", 10736 // "triggerId" 10737 // ], 10738 // "parameters": { 10739 // "projectId": { 10740 // "description": "Required. ID of the project that owns the trigger.", 10741 // "location": "path", 10742 // "required": true, 10743 // "type": "string" 10744 // }, 10745 // "triggerId": { 10746 // "description": "Required. ID of the `BuildTrigger` to update.", 10747 // "location": "path", 10748 // "required": true, 10749 // "type": "string" 10750 // } 10751 // }, 10752 // "path": "v1/projects/{projectId}/triggers/{triggerId}", 10753 // "request": { 10754 // "$ref": "BuildTrigger" 10755 // }, 10756 // "response": { 10757 // "$ref": "BuildTrigger" 10758 // }, 10759 // "scopes": [ 10760 // "https://www.googleapis.com/auth/cloud-platform" 10761 // ] 10762 // } 10763 10764} 10765 10766// method id "cloudbuild.projects.triggers.run": 10767 10768type ProjectsTriggersRunCall struct { 10769 s *Service 10770 projectId string 10771 triggerId string 10772 reposource *RepoSource 10773 urlParams_ gensupport.URLParams 10774 ctx_ context.Context 10775 header_ http.Header 10776} 10777 10778// Run: Runs a `BuildTrigger` at a particular source revision. 10779// 10780// - projectId: ID of the project. 10781// - triggerId: ID of the trigger. 10782func (r *ProjectsTriggersService) Run(projectId string, triggerId string, reposource *RepoSource) *ProjectsTriggersRunCall { 10783 c := &ProjectsTriggersRunCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10784 c.projectId = projectId 10785 c.triggerId = triggerId 10786 c.reposource = reposource 10787 return c 10788} 10789 10790// Name sets the optional parameter "name": The name of the `Trigger` to 10791// run. Format: 10792// `projects/{project}/locations/{location}/triggers/{trigger}` 10793func (c *ProjectsTriggersRunCall) Name(name string) *ProjectsTriggersRunCall { 10794 c.urlParams_.Set("name", name) 10795 return c 10796} 10797 10798// Fields allows partial responses to be retrieved. See 10799// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10800// for more information. 10801func (c *ProjectsTriggersRunCall) Fields(s ...googleapi.Field) *ProjectsTriggersRunCall { 10802 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10803 return c 10804} 10805 10806// Context sets the context to be used in this call's Do method. Any 10807// pending HTTP request will be aborted if the provided context is 10808// canceled. 10809func (c *ProjectsTriggersRunCall) Context(ctx context.Context) *ProjectsTriggersRunCall { 10810 c.ctx_ = ctx 10811 return c 10812} 10813 10814// Header returns an http.Header that can be modified by the caller to 10815// add HTTP headers to the request. 10816func (c *ProjectsTriggersRunCall) Header() http.Header { 10817 if c.header_ == nil { 10818 c.header_ = make(http.Header) 10819 } 10820 return c.header_ 10821} 10822 10823func (c *ProjectsTriggersRunCall) doRequest(alt string) (*http.Response, error) { 10824 reqHeaders := make(http.Header) 10825 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 10826 for k, v := range c.header_ { 10827 reqHeaders[k] = v 10828 } 10829 reqHeaders.Set("User-Agent", c.s.userAgent()) 10830 var body io.Reader = nil 10831 body, err := googleapi.WithoutDataWrapper.JSONReader(c.reposource) 10832 if err != nil { 10833 return nil, err 10834 } 10835 reqHeaders.Set("Content-Type", "application/json") 10836 c.urlParams_.Set("alt", alt) 10837 c.urlParams_.Set("prettyPrint", "false") 10838 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/triggers/{triggerId}:run") 10839 urls += "?" + c.urlParams_.Encode() 10840 req, err := http.NewRequest("POST", urls, body) 10841 if err != nil { 10842 return nil, err 10843 } 10844 req.Header = reqHeaders 10845 googleapi.Expand(req.URL, map[string]string{ 10846 "projectId": c.projectId, 10847 "triggerId": c.triggerId, 10848 }) 10849 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10850} 10851 10852// Do executes the "cloudbuild.projects.triggers.run" call. 10853// Exactly one of *Operation or error will be non-nil. Any non-2xx 10854// status code is an error. Response headers are in either 10855// *Operation.ServerResponse.Header or (if a response was returned at 10856// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10857// to check whether the returned error was because 10858// http.StatusNotModified was returned. 10859func (c *ProjectsTriggersRunCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10860 gensupport.SetOptions(c.urlParams_, opts...) 10861 res, err := c.doRequest("json") 10862 if res != nil && res.StatusCode == http.StatusNotModified { 10863 if res.Body != nil { 10864 res.Body.Close() 10865 } 10866 return nil, &googleapi.Error{ 10867 Code: res.StatusCode, 10868 Header: res.Header, 10869 } 10870 } 10871 if err != nil { 10872 return nil, err 10873 } 10874 defer googleapi.CloseBody(res) 10875 if err := googleapi.CheckResponse(res); err != nil { 10876 return nil, err 10877 } 10878 ret := &Operation{ 10879 ServerResponse: googleapi.ServerResponse{ 10880 Header: res.Header, 10881 HTTPStatusCode: res.StatusCode, 10882 }, 10883 } 10884 target := &ret 10885 if err := gensupport.DecodeResponse(target, res); err != nil { 10886 return nil, err 10887 } 10888 return ret, nil 10889 // { 10890 // "description": "Runs a `BuildTrigger` at a particular source revision.", 10891 // "flatPath": "v1/projects/{projectId}/triggers/{triggerId}:run", 10892 // "httpMethod": "POST", 10893 // "id": "cloudbuild.projects.triggers.run", 10894 // "parameterOrder": [ 10895 // "projectId", 10896 // "triggerId" 10897 // ], 10898 // "parameters": { 10899 // "name": { 10900 // "description": "The name of the `Trigger` to run. Format: `projects/{project}/locations/{location}/triggers/{trigger}`", 10901 // "location": "query", 10902 // "type": "string" 10903 // }, 10904 // "projectId": { 10905 // "description": "Required. ID of the project.", 10906 // "location": "path", 10907 // "required": true, 10908 // "type": "string" 10909 // }, 10910 // "triggerId": { 10911 // "description": "Required. ID of the trigger.", 10912 // "location": "path", 10913 // "required": true, 10914 // "type": "string" 10915 // } 10916 // }, 10917 // "path": "v1/projects/{projectId}/triggers/{triggerId}:run", 10918 // "request": { 10919 // "$ref": "RepoSource" 10920 // }, 10921 // "response": { 10922 // "$ref": "Operation" 10923 // }, 10924 // "scopes": [ 10925 // "https://www.googleapis.com/auth/cloud-platform" 10926 // ] 10927 // } 10928 10929} 10930 10931// method id "cloudbuild.projects.triggers.webhook": 10932 10933type ProjectsTriggersWebhookCall struct { 10934 s *Service 10935 projectId string 10936 trigger string 10937 httpbody *HttpBody 10938 urlParams_ gensupport.URLParams 10939 ctx_ context.Context 10940 header_ http.Header 10941} 10942 10943// Webhook: ReceiveTriggerWebhook [Experimental] is called when the API 10944// receives a webhook request targeted at a specific trigger. 10945// 10946// - projectId: Project in which the specified trigger lives. 10947// - trigger: Name of the trigger to run the payload against. 10948func (r *ProjectsTriggersService) Webhook(projectId string, trigger string, httpbody *HttpBody) *ProjectsTriggersWebhookCall { 10949 c := &ProjectsTriggersWebhookCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10950 c.projectId = projectId 10951 c.trigger = trigger 10952 c.httpbody = httpbody 10953 return c 10954} 10955 10956// Name sets the optional parameter "name": The name of the 10957// `ReceiveTriggerWebhook` to retrieve. Format: 10958// `projects/{project}/locations/{location}/triggers/{trigger}` 10959func (c *ProjectsTriggersWebhookCall) Name(name string) *ProjectsTriggersWebhookCall { 10960 c.urlParams_.Set("name", name) 10961 return c 10962} 10963 10964// Secret sets the optional parameter "secret": Secret token used for 10965// authorization if an OAuth token isn't provided. 10966func (c *ProjectsTriggersWebhookCall) Secret(secret string) *ProjectsTriggersWebhookCall { 10967 c.urlParams_.Set("secret", secret) 10968 return c 10969} 10970 10971// Fields allows partial responses to be retrieved. See 10972// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10973// for more information. 10974func (c *ProjectsTriggersWebhookCall) Fields(s ...googleapi.Field) *ProjectsTriggersWebhookCall { 10975 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10976 return c 10977} 10978 10979// Context sets the context to be used in this call's Do method. Any 10980// pending HTTP request will be aborted if the provided context is 10981// canceled. 10982func (c *ProjectsTriggersWebhookCall) Context(ctx context.Context) *ProjectsTriggersWebhookCall { 10983 c.ctx_ = ctx 10984 return c 10985} 10986 10987// Header returns an http.Header that can be modified by the caller to 10988// add HTTP headers to the request. 10989func (c *ProjectsTriggersWebhookCall) Header() http.Header { 10990 if c.header_ == nil { 10991 c.header_ = make(http.Header) 10992 } 10993 return c.header_ 10994} 10995 10996func (c *ProjectsTriggersWebhookCall) doRequest(alt string) (*http.Response, error) { 10997 reqHeaders := make(http.Header) 10998 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 10999 for k, v := range c.header_ { 11000 reqHeaders[k] = v 11001 } 11002 reqHeaders.Set("User-Agent", c.s.userAgent()) 11003 var body io.Reader = nil 11004 body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpbody) 11005 if err != nil { 11006 return nil, err 11007 } 11008 reqHeaders.Set("Content-Type", "application/json") 11009 c.urlParams_.Set("alt", alt) 11010 c.urlParams_.Set("prettyPrint", "false") 11011 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/triggers/{trigger}:webhook") 11012 urls += "?" + c.urlParams_.Encode() 11013 req, err := http.NewRequest("POST", urls, body) 11014 if err != nil { 11015 return nil, err 11016 } 11017 req.Header = reqHeaders 11018 googleapi.Expand(req.URL, map[string]string{ 11019 "projectId": c.projectId, 11020 "trigger": c.trigger, 11021 }) 11022 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11023} 11024 11025// Do executes the "cloudbuild.projects.triggers.webhook" call. 11026// Exactly one of *ReceiveTriggerWebhookResponse or error will be 11027// non-nil. Any non-2xx status code is an error. Response headers are in 11028// either *ReceiveTriggerWebhookResponse.ServerResponse.Header or (if a 11029// response was returned at all) in error.(*googleapi.Error).Header. Use 11030// googleapi.IsNotModified to check whether the returned error was 11031// because http.StatusNotModified was returned. 11032func (c *ProjectsTriggersWebhookCall) Do(opts ...googleapi.CallOption) (*ReceiveTriggerWebhookResponse, error) { 11033 gensupport.SetOptions(c.urlParams_, opts...) 11034 res, err := c.doRequest("json") 11035 if res != nil && res.StatusCode == http.StatusNotModified { 11036 if res.Body != nil { 11037 res.Body.Close() 11038 } 11039 return nil, &googleapi.Error{ 11040 Code: res.StatusCode, 11041 Header: res.Header, 11042 } 11043 } 11044 if err != nil { 11045 return nil, err 11046 } 11047 defer googleapi.CloseBody(res) 11048 if err := googleapi.CheckResponse(res); err != nil { 11049 return nil, err 11050 } 11051 ret := &ReceiveTriggerWebhookResponse{ 11052 ServerResponse: googleapi.ServerResponse{ 11053 Header: res.Header, 11054 HTTPStatusCode: res.StatusCode, 11055 }, 11056 } 11057 target := &ret 11058 if err := gensupport.DecodeResponse(target, res); err != nil { 11059 return nil, err 11060 } 11061 return ret, nil 11062 // { 11063 // "description": "ReceiveTriggerWebhook [Experimental] is called when the API receives a webhook request targeted at a specific trigger.", 11064 // "flatPath": "v1/projects/{projectId}/triggers/{trigger}:webhook", 11065 // "httpMethod": "POST", 11066 // "id": "cloudbuild.projects.triggers.webhook", 11067 // "parameterOrder": [ 11068 // "projectId", 11069 // "trigger" 11070 // ], 11071 // "parameters": { 11072 // "name": { 11073 // "description": "The name of the `ReceiveTriggerWebhook` to retrieve. Format: `projects/{project}/locations/{location}/triggers/{trigger}`", 11074 // "location": "query", 11075 // "type": "string" 11076 // }, 11077 // "projectId": { 11078 // "description": "Project in which the specified trigger lives", 11079 // "location": "path", 11080 // "required": true, 11081 // "type": "string" 11082 // }, 11083 // "secret": { 11084 // "description": "Secret token used for authorization if an OAuth token isn't provided.", 11085 // "location": "query", 11086 // "type": "string" 11087 // }, 11088 // "trigger": { 11089 // "description": "Name of the trigger to run the payload against", 11090 // "location": "path", 11091 // "required": true, 11092 // "type": "string" 11093 // } 11094 // }, 11095 // "path": "v1/projects/{projectId}/triggers/{trigger}:webhook", 11096 // "request": { 11097 // "$ref": "HttpBody" 11098 // }, 11099 // "response": { 11100 // "$ref": "ReceiveTriggerWebhookResponse" 11101 // } 11102 // } 11103 11104} 11105 11106// method id "cloudbuild.webhook": 11107 11108type V1WebhookCall struct { 11109 s *Service 11110 httpbody *HttpBody 11111 urlParams_ gensupport.URLParams 11112 ctx_ context.Context 11113 header_ http.Header 11114} 11115 11116// Webhook: ReceiveWebhook is called when the API receives a GitHub 11117// webhook. 11118func (r *V1Service) Webhook(httpbody *HttpBody) *V1WebhookCall { 11119 c := &V1WebhookCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11120 c.httpbody = httpbody 11121 return c 11122} 11123 11124// WebhookKey sets the optional parameter "webhookKey": For GitHub 11125// Enterprise webhooks, this key is used to associate the webhook 11126// request with the GitHubEnterpriseConfig to use for validation. 11127func (c *V1WebhookCall) WebhookKey(webhookKey string) *V1WebhookCall { 11128 c.urlParams_.Set("webhookKey", webhookKey) 11129 return c 11130} 11131 11132// Fields allows partial responses to be retrieved. See 11133// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11134// for more information. 11135func (c *V1WebhookCall) Fields(s ...googleapi.Field) *V1WebhookCall { 11136 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11137 return c 11138} 11139 11140// Context sets the context to be used in this call's Do method. Any 11141// pending HTTP request will be aborted if the provided context is 11142// canceled. 11143func (c *V1WebhookCall) Context(ctx context.Context) *V1WebhookCall { 11144 c.ctx_ = ctx 11145 return c 11146} 11147 11148// Header returns an http.Header that can be modified by the caller to 11149// add HTTP headers to the request. 11150func (c *V1WebhookCall) Header() http.Header { 11151 if c.header_ == nil { 11152 c.header_ = make(http.Header) 11153 } 11154 return c.header_ 11155} 11156 11157func (c *V1WebhookCall) doRequest(alt string) (*http.Response, error) { 11158 reqHeaders := make(http.Header) 11159 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210812") 11160 for k, v := range c.header_ { 11161 reqHeaders[k] = v 11162 } 11163 reqHeaders.Set("User-Agent", c.s.userAgent()) 11164 var body io.Reader = nil 11165 body, err := googleapi.WithoutDataWrapper.JSONReader(c.httpbody) 11166 if err != nil { 11167 return nil, err 11168 } 11169 reqHeaders.Set("Content-Type", "application/json") 11170 c.urlParams_.Set("alt", alt) 11171 c.urlParams_.Set("prettyPrint", "false") 11172 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/webhook") 11173 urls += "?" + c.urlParams_.Encode() 11174 req, err := http.NewRequest("POST", urls, body) 11175 if err != nil { 11176 return nil, err 11177 } 11178 req.Header = reqHeaders 11179 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11180} 11181 11182// Do executes the "cloudbuild.webhook" call. 11183// Exactly one of *Empty or error will be non-nil. Any non-2xx status 11184// code is an error. Response headers are in either 11185// *Empty.ServerResponse.Header or (if a response was returned at all) 11186// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11187// check whether the returned error was because http.StatusNotModified 11188// was returned. 11189func (c *V1WebhookCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 11190 gensupport.SetOptions(c.urlParams_, opts...) 11191 res, err := c.doRequest("json") 11192 if res != nil && res.StatusCode == http.StatusNotModified { 11193 if res.Body != nil { 11194 res.Body.Close() 11195 } 11196 return nil, &googleapi.Error{ 11197 Code: res.StatusCode, 11198 Header: res.Header, 11199 } 11200 } 11201 if err != nil { 11202 return nil, err 11203 } 11204 defer googleapi.CloseBody(res) 11205 if err := googleapi.CheckResponse(res); err != nil { 11206 return nil, err 11207 } 11208 ret := &Empty{ 11209 ServerResponse: googleapi.ServerResponse{ 11210 Header: res.Header, 11211 HTTPStatusCode: res.StatusCode, 11212 }, 11213 } 11214 target := &ret 11215 if err := gensupport.DecodeResponse(target, res); err != nil { 11216 return nil, err 11217 } 11218 return ret, nil 11219 // { 11220 // "description": "ReceiveWebhook is called when the API receives a GitHub webhook.", 11221 // "flatPath": "v1/webhook", 11222 // "httpMethod": "POST", 11223 // "id": "cloudbuild.webhook", 11224 // "parameterOrder": [], 11225 // "parameters": { 11226 // "webhookKey": { 11227 // "description": "For GitHub Enterprise webhooks, this key is used to associate the webhook request with the GitHubEnterpriseConfig to use for validation.", 11228 // "location": "query", 11229 // "type": "string" 11230 // } 11231 // }, 11232 // "path": "v1/webhook", 11233 // "request": { 11234 // "$ref": "HttpBody" 11235 // }, 11236 // "response": { 11237 // "$ref": "Empty" 11238 // } 11239 // } 11240 11241} 11242