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 dataproc provides access to the Cloud Dataproc API. 8// 9// This package is DEPRECATED. Use package cloud.google.com/go/dataproc/apiv1 instead. 10// 11// For product documentation, see: https://cloud.google.com/dataproc/ 12// 13// Creating a client 14// 15// Usage example: 16// 17// import "google.golang.org/api/dataproc/v1" 18// ... 19// ctx := context.Background() 20// dataprocService, err := dataproc.NewService(ctx) 21// 22// In this example, Google Application Default Credentials are used for authentication. 23// 24// For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials. 25// 26// Other authentication options 27// 28// To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey: 29// 30// dataprocService, err := dataproc.NewService(ctx, option.WithAPIKey("AIza...")) 31// 32// To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource: 33// 34// config := &oauth2.Config{...} 35// // ... 36// token, err := config.Exchange(ctx, ...) 37// dataprocService, err := dataproc.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token))) 38// 39// See https://godoc.org/google.golang.org/api/option/ for details on options. 40package dataproc // import "google.golang.org/api/dataproc/v1" 41 42import ( 43 "bytes" 44 "context" 45 "encoding/json" 46 "errors" 47 "fmt" 48 "io" 49 "net/http" 50 "net/url" 51 "strconv" 52 "strings" 53 54 googleapi "google.golang.org/api/googleapi" 55 gensupport "google.golang.org/api/internal/gensupport" 56 option "google.golang.org/api/option" 57 internaloption "google.golang.org/api/option/internaloption" 58 htransport "google.golang.org/api/transport/http" 59) 60 61// Always reference these packages, just in case the auto-generated code 62// below doesn't. 63var _ = bytes.NewBuffer 64var _ = strconv.Itoa 65var _ = fmt.Sprintf 66var _ = json.NewDecoder 67var _ = io.Copy 68var _ = url.Parse 69var _ = gensupport.MarshalJSON 70var _ = googleapi.Version 71var _ = errors.New 72var _ = strings.Replace 73var _ = context.Canceled 74var _ = internaloption.WithDefaultEndpoint 75 76const apiId = "dataproc:v1" 77const apiName = "dataproc" 78const apiVersion = "v1" 79const basePath = "https://dataproc.googleapis.com/" 80const mtlsBasePath = "https://dataproc.mtls.googleapis.com/" 81 82// OAuth2 scopes used by this API. 83const ( 84 // See, edit, configure, and delete your Google Cloud data and see the 85 // email address for your Google Account. 86 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 87) 88 89// NewService creates a new Service. 90func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 91 scopesOption := option.WithScopes( 92 "https://www.googleapis.com/auth/cloud-platform", 93 ) 94 // NOTE: prepend, so we don't override user-specified scopes. 95 opts = append([]option.ClientOption{scopesOption}, opts...) 96 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 97 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 98 client, endpoint, err := htransport.NewClient(ctx, opts...) 99 if err != nil { 100 return nil, err 101 } 102 s, err := New(client) 103 if err != nil { 104 return nil, err 105 } 106 if endpoint != "" { 107 s.BasePath = endpoint 108 } 109 return s, nil 110} 111 112// New creates a new Service. It uses the provided http.Client for requests. 113// 114// Deprecated: please use NewService instead. 115// To provide a custom HTTP client, use option.WithHTTPClient. 116// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 117func New(client *http.Client) (*Service, error) { 118 if client == nil { 119 return nil, errors.New("client is nil") 120 } 121 s := &Service{client: client, BasePath: basePath} 122 s.Projects = NewProjectsService(s) 123 return s, nil 124} 125 126type Service struct { 127 client *http.Client 128 BasePath string // API endpoint base URL 129 UserAgent string // optional additional User-Agent fragment 130 131 Projects *ProjectsService 132} 133 134func (s *Service) userAgent() string { 135 if s.UserAgent == "" { 136 return googleapi.UserAgent 137 } 138 return googleapi.UserAgent + " " + s.UserAgent 139} 140 141func NewProjectsService(s *Service) *ProjectsService { 142 rs := &ProjectsService{s: s} 143 rs.Locations = NewProjectsLocationsService(s) 144 rs.Regions = NewProjectsRegionsService(s) 145 return rs 146} 147 148type ProjectsService struct { 149 s *Service 150 151 Locations *ProjectsLocationsService 152 153 Regions *ProjectsRegionsService 154} 155 156func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 157 rs := &ProjectsLocationsService{s: s} 158 rs.AutoscalingPolicies = NewProjectsLocationsAutoscalingPoliciesService(s) 159 rs.WorkflowTemplates = NewProjectsLocationsWorkflowTemplatesService(s) 160 return rs 161} 162 163type ProjectsLocationsService struct { 164 s *Service 165 166 AutoscalingPolicies *ProjectsLocationsAutoscalingPoliciesService 167 168 WorkflowTemplates *ProjectsLocationsWorkflowTemplatesService 169} 170 171func NewProjectsLocationsAutoscalingPoliciesService(s *Service) *ProjectsLocationsAutoscalingPoliciesService { 172 rs := &ProjectsLocationsAutoscalingPoliciesService{s: s} 173 return rs 174} 175 176type ProjectsLocationsAutoscalingPoliciesService struct { 177 s *Service 178} 179 180func NewProjectsLocationsWorkflowTemplatesService(s *Service) *ProjectsLocationsWorkflowTemplatesService { 181 rs := &ProjectsLocationsWorkflowTemplatesService{s: s} 182 return rs 183} 184 185type ProjectsLocationsWorkflowTemplatesService struct { 186 s *Service 187} 188 189func NewProjectsRegionsService(s *Service) *ProjectsRegionsService { 190 rs := &ProjectsRegionsService{s: s} 191 rs.AutoscalingPolicies = NewProjectsRegionsAutoscalingPoliciesService(s) 192 rs.Clusters = NewProjectsRegionsClustersService(s) 193 rs.Jobs = NewProjectsRegionsJobsService(s) 194 rs.Operations = NewProjectsRegionsOperationsService(s) 195 rs.WorkflowTemplates = NewProjectsRegionsWorkflowTemplatesService(s) 196 return rs 197} 198 199type ProjectsRegionsService struct { 200 s *Service 201 202 AutoscalingPolicies *ProjectsRegionsAutoscalingPoliciesService 203 204 Clusters *ProjectsRegionsClustersService 205 206 Jobs *ProjectsRegionsJobsService 207 208 Operations *ProjectsRegionsOperationsService 209 210 WorkflowTemplates *ProjectsRegionsWorkflowTemplatesService 211} 212 213func NewProjectsRegionsAutoscalingPoliciesService(s *Service) *ProjectsRegionsAutoscalingPoliciesService { 214 rs := &ProjectsRegionsAutoscalingPoliciesService{s: s} 215 return rs 216} 217 218type ProjectsRegionsAutoscalingPoliciesService struct { 219 s *Service 220} 221 222func NewProjectsRegionsClustersService(s *Service) *ProjectsRegionsClustersService { 223 rs := &ProjectsRegionsClustersService{s: s} 224 return rs 225} 226 227type ProjectsRegionsClustersService struct { 228 s *Service 229} 230 231func NewProjectsRegionsJobsService(s *Service) *ProjectsRegionsJobsService { 232 rs := &ProjectsRegionsJobsService{s: s} 233 return rs 234} 235 236type ProjectsRegionsJobsService struct { 237 s *Service 238} 239 240func NewProjectsRegionsOperationsService(s *Service) *ProjectsRegionsOperationsService { 241 rs := &ProjectsRegionsOperationsService{s: s} 242 return rs 243} 244 245type ProjectsRegionsOperationsService struct { 246 s *Service 247} 248 249func NewProjectsRegionsWorkflowTemplatesService(s *Service) *ProjectsRegionsWorkflowTemplatesService { 250 rs := &ProjectsRegionsWorkflowTemplatesService{s: s} 251 return rs 252} 253 254type ProjectsRegionsWorkflowTemplatesService struct { 255 s *Service 256} 257 258// AcceleratorConfig: Specifies the type and number of accelerator cards 259// attached to the instances of an instance. See GPUs on Compute Engine 260// (https://cloud.google.com/compute/docs/gpus/). 261type AcceleratorConfig struct { 262 // AcceleratorCount: The number of the accelerator cards of this type 263 // exposed to this instance. 264 AcceleratorCount int64 `json:"acceleratorCount,omitempty"` 265 266 // AcceleratorTypeUri: Full URL, partial URI, or short name of the 267 // accelerator type resource to expose to this instance. See Compute 268 // Engine AcceleratorTypes 269 // (https://cloud.google.com/compute/docs/reference/beta/acceleratorTypes).Examples: 270 // https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 271 // projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k 272 // 80 nvidia-tesla-k80Auto Zone Exception: If you are using the Dataproc 273 // Auto Zone Placement 274 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) 275 // feature, you must use the short name of the accelerator type 276 // resource, for example, nvidia-tesla-k80. 277 AcceleratorTypeUri string `json:"acceleratorTypeUri,omitempty"` 278 279 // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to 280 // unconditionally include in API requests. By default, fields with 281 // empty values are omitted from API requests. However, any non-pointer, 282 // non-interface field appearing in ForceSendFields will be sent to the 283 // server regardless of whether the field is empty or not. This may be 284 // used to include empty fields in Patch requests. 285 ForceSendFields []string `json:"-"` 286 287 // NullFields is a list of field names (e.g. "AcceleratorCount") to 288 // include in API requests with the JSON null value. By default, fields 289 // with empty values are omitted from API requests. However, any field 290 // with an empty value appearing in NullFields will be sent to the 291 // server as null. It is an error if a field in this list has a 292 // non-empty value. This may be used to include null fields in Patch 293 // requests. 294 NullFields []string `json:"-"` 295} 296 297func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) { 298 type NoMethod AcceleratorConfig 299 raw := NoMethod(*s) 300 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 301} 302 303// AutoscalingConfig: Autoscaling Policy config associated with the 304// cluster. 305type AutoscalingConfig struct { 306 // PolicyUri: Optional. The autoscaling policy used by the cluster.Only 307 // resource names including projectid and location (region) are valid. 308 // Examples: 309 // https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id] 310 // projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/ 311 // [policy_id]Note that the policy must be in the same project and 312 // Dataproc region. 313 PolicyUri string `json:"policyUri,omitempty"` 314 315 // ForceSendFields is a list of field names (e.g. "PolicyUri") to 316 // unconditionally include in API requests. By default, fields with 317 // empty values are omitted from API requests. However, any non-pointer, 318 // non-interface field appearing in ForceSendFields will be sent to the 319 // server regardless of whether the field is empty or not. This may be 320 // used to include empty fields in Patch requests. 321 ForceSendFields []string `json:"-"` 322 323 // NullFields is a list of field names (e.g. "PolicyUri") to include in 324 // API requests with the JSON null value. By default, fields with empty 325 // values are omitted from API requests. However, any field with an 326 // empty value appearing in NullFields will be sent to the server as 327 // null. It is an error if a field in this list has a non-empty value. 328 // This may be used to include null fields in Patch requests. 329 NullFields []string `json:"-"` 330} 331 332func (s *AutoscalingConfig) MarshalJSON() ([]byte, error) { 333 type NoMethod AutoscalingConfig 334 raw := NoMethod(*s) 335 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 336} 337 338// AutoscalingPolicy: Describes an autoscaling policy for Dataproc 339// cluster autoscaler. 340type AutoscalingPolicy struct { 341 BasicAlgorithm *BasicAutoscalingAlgorithm `json:"basicAlgorithm,omitempty"` 342 343 // Id: Required. The policy id.The id must contain only letters (a-z, 344 // A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin 345 // or end with underscore or hyphen. Must consist of between 3 and 50 346 // characters. 347 Id string `json:"id,omitempty"` 348 349 // Name: Output only. The "resource name" of the autoscaling policy, as 350 // described in https://cloud.google.com/apis/design/resource_names. For 351 // projects.regions.autoscalingPolicies, the resource name of the policy 352 // has the following format: 353 // projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} 354 // For projects.locations.autoscalingPolicies, the resource name of the 355 // policy has the following format: 356 // projects/{project_id}/locations/{location}/autoscalingPolicies/{policy 357 // _id} 358 Name string `json:"name,omitempty"` 359 360 // SecondaryWorkerConfig: Optional. Describes how the autoscaler will 361 // operate for secondary workers. 362 SecondaryWorkerConfig *InstanceGroupAutoscalingPolicyConfig `json:"secondaryWorkerConfig,omitempty"` 363 364 // WorkerConfig: Required. Describes how the autoscaler will operate for 365 // primary workers. 366 WorkerConfig *InstanceGroupAutoscalingPolicyConfig `json:"workerConfig,omitempty"` 367 368 // ServerResponse contains the HTTP response code and headers from the 369 // server. 370 googleapi.ServerResponse `json:"-"` 371 372 // ForceSendFields is a list of field names (e.g. "BasicAlgorithm") to 373 // unconditionally include in API requests. By default, fields with 374 // empty values are omitted from API requests. However, any non-pointer, 375 // non-interface field appearing in ForceSendFields will be sent to the 376 // server regardless of whether the field is empty or not. This may be 377 // used to include empty fields in Patch requests. 378 ForceSendFields []string `json:"-"` 379 380 // NullFields is a list of field names (e.g. "BasicAlgorithm") 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 *AutoscalingPolicy) MarshalJSON() ([]byte, error) { 391 type NoMethod AutoscalingPolicy 392 raw := NoMethod(*s) 393 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 394} 395 396// BasicAutoscalingAlgorithm: Basic algorithm for autoscaling. 397type BasicAutoscalingAlgorithm struct { 398 // CooldownPeriod: Optional. Duration between scaling events. A scaling 399 // period starts after the update operation from the previous event has 400 // completed.Bounds: 2m, 1d. Default: 2m. 401 CooldownPeriod string `json:"cooldownPeriod,omitempty"` 402 403 // YarnConfig: Optional. YARN autoscaling configuration. 404 YarnConfig *BasicYarnAutoscalingConfig `json:"yarnConfig,omitempty"` 405 406 // ForceSendFields is a list of field names (e.g. "CooldownPeriod") to 407 // unconditionally include in API requests. By default, fields with 408 // empty values are omitted from API requests. However, any non-pointer, 409 // non-interface field appearing in ForceSendFields will be sent to the 410 // server regardless of whether the field is empty or not. This may be 411 // used to include empty fields in Patch requests. 412 ForceSendFields []string `json:"-"` 413 414 // NullFields is a list of field names (e.g. "CooldownPeriod") to 415 // include in API requests with the JSON null value. By default, fields 416 // with empty values are omitted from API requests. However, any field 417 // with an empty value appearing in NullFields will be sent to the 418 // server as null. It is an error if a field in this list has a 419 // non-empty value. This may be used to include null fields in Patch 420 // requests. 421 NullFields []string `json:"-"` 422} 423 424func (s *BasicAutoscalingAlgorithm) MarshalJSON() ([]byte, error) { 425 type NoMethod BasicAutoscalingAlgorithm 426 raw := NoMethod(*s) 427 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 428} 429 430// BasicYarnAutoscalingConfig: Basic autoscaling configurations for 431// YARN. 432type BasicYarnAutoscalingConfig struct { 433 // GracefulDecommissionTimeout: Required. Timeout for YARN graceful 434 // decommissioning of Node Managers. Specifies the duration to wait for 435 // jobs to complete before forcefully removing workers (and potentially 436 // interrupting jobs). Only applicable to downscaling operations.Bounds: 437 // 0s, 1d. 438 GracefulDecommissionTimeout string `json:"gracefulDecommissionTimeout,omitempty"` 439 440 // ScaleDownFactor: Required. Fraction of average YARN pending memory in 441 // the last cooldown period for which to remove workers. A scale-down 442 // factor of 1 will result in scaling down so that there is no available 443 // memory remaining after the update (more aggressive scaling). A 444 // scale-down factor of 0 disables removing workers, which can be 445 // beneficial for autoscaling a single job. See How autoscaling works 446 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works) 447 // for more information.Bounds: 0.0, 1.0. 448 ScaleDownFactor float64 `json:"scaleDownFactor,omitempty"` 449 450 // ScaleDownMinWorkerFraction: Optional. Minimum scale-down threshold as 451 // a fraction of total cluster size before scaling occurs. For example, 452 // in a 20-worker cluster, a threshold of 0.1 means the autoscaler must 453 // recommend at least a 2 worker scale-down for the cluster to scale. A 454 // threshold of 0 means the autoscaler will scale down on any 455 // recommended change.Bounds: 0.0, 1.0. Default: 0.0. 456 ScaleDownMinWorkerFraction float64 `json:"scaleDownMinWorkerFraction,omitempty"` 457 458 // ScaleUpFactor: Required. Fraction of average YARN pending memory in 459 // the last cooldown period for which to add workers. A scale-up factor 460 // of 1.0 will result in scaling up so that there is no pending memory 461 // remaining after the update (more aggressive scaling). A scale-up 462 // factor closer to 0 will result in a smaller magnitude of scaling up 463 // (less aggressive scaling). See How autoscaling works 464 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works) 465 // for more information.Bounds: 0.0, 1.0. 466 ScaleUpFactor float64 `json:"scaleUpFactor,omitempty"` 467 468 // ScaleUpMinWorkerFraction: Optional. Minimum scale-up threshold as a 469 // fraction of total cluster size before scaling occurs. For example, in 470 // a 20-worker cluster, a threshold of 0.1 means the autoscaler must 471 // recommend at least a 2-worker scale-up for the cluster to scale. A 472 // threshold of 0 means the autoscaler will scale up on any recommended 473 // change.Bounds: 0.0, 1.0. Default: 0.0. 474 ScaleUpMinWorkerFraction float64 `json:"scaleUpMinWorkerFraction,omitempty"` 475 476 // ForceSendFields is a list of field names (e.g. 477 // "GracefulDecommissionTimeout") to unconditionally include in API 478 // requests. By default, fields with empty values are omitted from API 479 // requests. However, any non-pointer, non-interface field appearing in 480 // ForceSendFields will be sent to the server regardless of whether the 481 // field is empty or not. This may be used to include empty fields in 482 // Patch requests. 483 ForceSendFields []string `json:"-"` 484 485 // NullFields is a list of field names (e.g. 486 // "GracefulDecommissionTimeout") to include in API requests with the 487 // JSON null value. By default, fields with empty values are omitted 488 // from API requests. However, any field with an empty value appearing 489 // in NullFields will be sent to the server as null. It is an error if a 490 // field in this list has a non-empty value. This may be used to include 491 // null fields in Patch requests. 492 NullFields []string `json:"-"` 493} 494 495func (s *BasicYarnAutoscalingConfig) MarshalJSON() ([]byte, error) { 496 type NoMethod BasicYarnAutoscalingConfig 497 raw := NoMethod(*s) 498 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 499} 500 501func (s *BasicYarnAutoscalingConfig) UnmarshalJSON(data []byte) error { 502 type NoMethod BasicYarnAutoscalingConfig 503 var s1 struct { 504 ScaleDownFactor gensupport.JSONFloat64 `json:"scaleDownFactor"` 505 ScaleDownMinWorkerFraction gensupport.JSONFloat64 `json:"scaleDownMinWorkerFraction"` 506 ScaleUpFactor gensupport.JSONFloat64 `json:"scaleUpFactor"` 507 ScaleUpMinWorkerFraction gensupport.JSONFloat64 `json:"scaleUpMinWorkerFraction"` 508 *NoMethod 509 } 510 s1.NoMethod = (*NoMethod)(s) 511 if err := json.Unmarshal(data, &s1); err != nil { 512 return err 513 } 514 s.ScaleDownFactor = float64(s1.ScaleDownFactor) 515 s.ScaleDownMinWorkerFraction = float64(s1.ScaleDownMinWorkerFraction) 516 s.ScaleUpFactor = float64(s1.ScaleUpFactor) 517 s.ScaleUpMinWorkerFraction = float64(s1.ScaleUpMinWorkerFraction) 518 return nil 519} 520 521// BatchOperationMetadata: Metadata describing the Batch operation. 522type BatchOperationMetadata struct { 523 // Batch: Name of the batch for the operation. 524 Batch string `json:"batch,omitempty"` 525 526 // BatchUuid: Batch UUID for the operation. 527 BatchUuid string `json:"batchUuid,omitempty"` 528 529 // CreateTime: The time when the operation was created. 530 CreateTime string `json:"createTime,omitempty"` 531 532 // Description: Short description of the operation. 533 Description string `json:"description,omitempty"` 534 535 // DoneTime: The time when the operation finished. 536 DoneTime string `json:"doneTime,omitempty"` 537 538 // Labels: Labels associated with the operation. 539 Labels map[string]string `json:"labels,omitempty"` 540 541 // OperationType: The operation type. 542 // 543 // Possible values: 544 // "BATCH_OPERATION_TYPE_UNSPECIFIED" - Batch operation type is 545 // unknown. 546 // "BATCH" - Batch operation type. 547 OperationType string `json:"operationType,omitempty"` 548 549 // Warnings: Warnings encountered during operation execution. 550 Warnings []string `json:"warnings,omitempty"` 551 552 // ForceSendFields is a list of field names (e.g. "Batch") to 553 // unconditionally include in API requests. By default, fields with 554 // empty values are omitted from API requests. However, any non-pointer, 555 // non-interface field appearing in ForceSendFields will be sent to the 556 // server regardless of whether the field is empty or not. This may be 557 // used to include empty fields in Patch requests. 558 ForceSendFields []string `json:"-"` 559 560 // NullFields is a list of field names (e.g. "Batch") to include in API 561 // requests with the JSON null value. By default, fields with empty 562 // values are omitted from API requests. However, any field with an 563 // empty value appearing in NullFields will be sent to the server as 564 // null. It is an error if a field in this list has a non-empty value. 565 // This may be used to include null fields in Patch requests. 566 NullFields []string `json:"-"` 567} 568 569func (s *BatchOperationMetadata) MarshalJSON() ([]byte, error) { 570 type NoMethod BatchOperationMetadata 571 raw := NoMethod(*s) 572 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 573} 574 575// Binding: Associates members with a role. 576type Binding struct { 577 // Condition: The condition that is associated with this binding.If the 578 // condition evaluates to true, then this binding applies to the current 579 // request.If the condition evaluates to false, then this binding does 580 // not apply to the current request. However, a different role binding 581 // might grant the same role to one or more of the members in this 582 // binding.To learn which resources support conditions in their IAM 583 // policies, see the IAM documentation 584 // (https://cloud.google.com/iam/help/conditions/resource-policies). 585 Condition *Expr `json:"condition,omitempty"` 586 587 // Members: Specifies the identities requesting access for a Cloud 588 // Platform resource. members can have the following values: allUsers: A 589 // special identifier that represents anyone who is on the internet; 590 // with or without a Google account. allAuthenticatedUsers: A special 591 // identifier that represents anyone who is authenticated with a Google 592 // account or a service account. user:{emailid}: An email address that 593 // represents a specific Google account. For example, alice@example.com 594 // . serviceAccount:{emailid}: An email address that represents a 595 // service account. For example, 596 // my-other-app@appspot.gserviceaccount.com. group:{emailid}: An email 597 // address that represents a Google group. For example, 598 // admins@example.com. deleted:user:{emailid}?uid={uniqueid}: An email 599 // address (plus unique identifier) representing a user that has been 600 // recently deleted. For example, 601 // alice@example.com?uid=123456789012345678901. If the user is 602 // recovered, this value reverts to user:{emailid} and the recovered 603 // user retains the role in the binding. 604 // deleted:serviceAccount:{emailid}?uid={uniqueid}: An email address 605 // (plus unique identifier) representing a service account that has been 606 // recently deleted. For example, 607 // my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901. 608 // If the service account is undeleted, this value reverts to 609 // serviceAccount:{emailid} and the undeleted service account retains 610 // the role in the binding. deleted:group:{emailid}?uid={uniqueid}: An 611 // email address (plus unique identifier) representing a Google group 612 // that has been recently deleted. For example, 613 // admins@example.com?uid=123456789012345678901. If the group is 614 // recovered, this value reverts to group:{emailid} and the recovered 615 // group retains the role in the binding. domain:{domain}: The G Suite 616 // domain (primary) that represents all the users of that domain. For 617 // example, google.com or example.com. 618 Members []string `json:"members,omitempty"` 619 620 // Role: Role that is assigned to members. For example, roles/viewer, 621 // roles/editor, or roles/owner. 622 Role string `json:"role,omitempty"` 623 624 // ForceSendFields is a list of field names (e.g. "Condition") to 625 // unconditionally include in API requests. By default, fields with 626 // empty values are omitted from API requests. However, any non-pointer, 627 // non-interface field appearing in ForceSendFields will be sent to the 628 // server regardless of whether the field is empty or not. This may be 629 // used to include empty fields in Patch requests. 630 ForceSendFields []string `json:"-"` 631 632 // NullFields is a list of field names (e.g. "Condition") to include in 633 // API requests with the JSON null value. By default, fields with empty 634 // values are omitted from API requests. However, any field with an 635 // empty value appearing in NullFields will be sent to the server as 636 // null. It is an error if a field in this list has a non-empty value. 637 // This may be used to include null fields in Patch requests. 638 NullFields []string `json:"-"` 639} 640 641func (s *Binding) MarshalJSON() ([]byte, error) { 642 type NoMethod Binding 643 raw := NoMethod(*s) 644 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 645} 646 647// CancelJobRequest: A request to cancel a job. 648type CancelJobRequest struct { 649} 650 651// Cluster: Describes the identifying information, config, and status of 652// a cluster of Compute Engine instances. 653type Cluster struct { 654 // ClusterName: Required. The cluster name. Cluster names within a 655 // project must be unique. Names of deleted clusters can be reused. 656 ClusterName string `json:"clusterName,omitempty"` 657 658 // ClusterUuid: Output only. A cluster UUID (Unique Universal 659 // Identifier). Dataproc generates this value when it creates the 660 // cluster. 661 ClusterUuid string `json:"clusterUuid,omitempty"` 662 663 // Config: Required. The cluster config. Note that Dataproc may set 664 // default values, and values may change when clusters are updated. 665 Config *ClusterConfig `json:"config,omitempty"` 666 667 // Labels: Optional. The labels to associate with this cluster. Label 668 // keys must contain 1 to 63 characters, and must conform to RFC 1035 669 // (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, 670 // but, if present, must contain 1 to 63 characters, and must conform to 671 // RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 672 // labels can be associated with a cluster. 673 Labels map[string]string `json:"labels,omitempty"` 674 675 // Metrics: Output only. Contains cluster daemon metrics such as HDFS 676 // and YARN stats.Beta Feature: This report is available for testing 677 // purposes only. It may be changed before final release. 678 Metrics *ClusterMetrics `json:"metrics,omitempty"` 679 680 // ProjectId: Required. The Google Cloud Platform project ID that the 681 // cluster belongs to. 682 ProjectId string `json:"projectId,omitempty"` 683 684 // Status: Output only. Cluster status. 685 Status *ClusterStatus `json:"status,omitempty"` 686 687 // StatusHistory: Output only. The previous cluster status. 688 StatusHistory []*ClusterStatus `json:"statusHistory,omitempty"` 689 690 // ServerResponse contains the HTTP response code and headers from the 691 // server. 692 googleapi.ServerResponse `json:"-"` 693 694 // ForceSendFields is a list of field names (e.g. "ClusterName") to 695 // unconditionally include in API requests. By default, fields with 696 // empty values are omitted from API requests. However, any non-pointer, 697 // non-interface field appearing in ForceSendFields will be sent to the 698 // server regardless of whether the field is empty or not. This may be 699 // used to include empty fields in Patch requests. 700 ForceSendFields []string `json:"-"` 701 702 // NullFields is a list of field names (e.g. "ClusterName") to include 703 // in API requests with the JSON null value. By default, fields with 704 // empty values are omitted from API requests. However, any field with 705 // an empty value appearing in NullFields will be sent to the server as 706 // null. It is an error if a field in this list has a non-empty value. 707 // This may be used to include null fields in Patch requests. 708 NullFields []string `json:"-"` 709} 710 711func (s *Cluster) MarshalJSON() ([]byte, error) { 712 type NoMethod Cluster 713 raw := NoMethod(*s) 714 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 715} 716 717// ClusterConfig: The cluster config. 718type ClusterConfig struct { 719 // AutoscalingConfig: Optional. Autoscaling config for the policy 720 // associated with the cluster. Cluster does not autoscale if this field 721 // is unset. 722 AutoscalingConfig *AutoscalingConfig `json:"autoscalingConfig,omitempty"` 723 724 // ConfigBucket: Optional. A Cloud Storage bucket used to stage job 725 // dependencies, config files, and job driver console output. If you do 726 // not specify a staging bucket, Cloud Dataproc will determine a Cloud 727 // Storage location (US, ASIA, or EU) for your cluster's staging bucket 728 // according to the Compute Engine zone where your cluster is deployed, 729 // and then create and manage this project-level, per-location bucket 730 // (see Dataproc staging bucket 731 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). 732 // This field requires a Cloud Storage bucket name, not a URI to a Cloud 733 // Storage bucket. 734 ConfigBucket string `json:"configBucket,omitempty"` 735 736 // EncryptionConfig: Optional. Encryption settings for the cluster. 737 EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"` 738 739 // EndpointConfig: Optional. Port/endpoint configuration for this 740 // cluster 741 EndpointConfig *EndpointConfig `json:"endpointConfig,omitempty"` 742 743 // GceClusterConfig: Optional. The shared Compute Engine config settings 744 // for all instances in a cluster. 745 GceClusterConfig *GceClusterConfig `json:"gceClusterConfig,omitempty"` 746 747 // GkeClusterConfig: Optional. BETA. The Kubernetes Engine config for 748 // Dataproc clusters deployed to Kubernetes. Setting this is considered 749 // mutually exclusive with Compute Engine-based options such as 750 // gce_cluster_config, master_config, worker_config, 751 // secondary_worker_config, and autoscaling_config. 752 GkeClusterConfig *GkeClusterConfig `json:"gkeClusterConfig,omitempty"` 753 754 // InitializationActions: Optional. Commands to execute on each node 755 // after config is completed. By default, executables are run on master 756 // and all worker nodes. You can test a node's role metadata to run an 757 // executable on a master or worker node, as shown below using curl (you 758 // can also use wget): ROLE=$(curl -H Metadata-Flavor:Google 759 // http://metadata/computeMetadata/v1/instance/attributes/dataproc-role) 760 // if [[ "${ROLE}" == 'Master' ]]; then ... master specific actions ... 761 // else ... worker specific actions ... fi 762 InitializationActions []*NodeInitializationAction `json:"initializationActions,omitempty"` 763 764 // LifecycleConfig: Optional. Lifecycle setting for the cluster. 765 LifecycleConfig *LifecycleConfig `json:"lifecycleConfig,omitempty"` 766 767 // MasterConfig: Optional. The Compute Engine config settings for the 768 // master instance in a cluster. 769 MasterConfig *InstanceGroupConfig `json:"masterConfig,omitempty"` 770 771 // MetastoreConfig: Optional. Metastore configuration. 772 MetastoreConfig *MetastoreConfig `json:"metastoreConfig,omitempty"` 773 774 // SecondaryWorkerConfig: Optional. The Compute Engine config settings 775 // for additional worker instances in a cluster. 776 SecondaryWorkerConfig *InstanceGroupConfig `json:"secondaryWorkerConfig,omitempty"` 777 778 // SecurityConfig: Optional. Security settings for the cluster. 779 SecurityConfig *SecurityConfig `json:"securityConfig,omitempty"` 780 781 // SoftwareConfig: Optional. The config settings for software inside the 782 // cluster. 783 SoftwareConfig *SoftwareConfig `json:"softwareConfig,omitempty"` 784 785 // TempBucket: Optional. A Cloud Storage bucket used to store ephemeral 786 // cluster and jobs data, such as Spark and MapReduce history files. If 787 // you do not specify a temp bucket, Dataproc will determine a Cloud 788 // Storage location (US, ASIA, or EU) for your cluster's temp bucket 789 // according to the Compute Engine zone where your cluster is deployed, 790 // and then create and manage this project-level, per-location bucket. 791 // The default bucket has a TTL of 90 days, but you can use any TTL (or 792 // none) if you specify a bucket. This field requires a Cloud Storage 793 // bucket name, not a URI to a Cloud Storage bucket. 794 TempBucket string `json:"tempBucket,omitempty"` 795 796 // WorkerConfig: Optional. The Compute Engine config settings for worker 797 // instances in a cluster. 798 WorkerConfig *InstanceGroupConfig `json:"workerConfig,omitempty"` 799 800 // ForceSendFields is a list of field names (e.g. "AutoscalingConfig") 801 // to unconditionally include in API requests. By default, fields with 802 // empty values are omitted from API requests. However, any non-pointer, 803 // non-interface field appearing in ForceSendFields will be sent to the 804 // server regardless of whether the field is empty or not. This may be 805 // used to include empty fields in Patch requests. 806 ForceSendFields []string `json:"-"` 807 808 // NullFields is a list of field names (e.g. "AutoscalingConfig") to 809 // include in API requests with the JSON null value. By default, fields 810 // with empty values are omitted from API requests. However, any field 811 // with an empty value appearing in NullFields will be sent to the 812 // server as null. It is an error if a field in this list has a 813 // non-empty value. This may be used to include null fields in Patch 814 // requests. 815 NullFields []string `json:"-"` 816} 817 818func (s *ClusterConfig) MarshalJSON() ([]byte, error) { 819 type NoMethod ClusterConfig 820 raw := NoMethod(*s) 821 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 822} 823 824// ClusterMetrics: Contains cluster daemon metrics, such as HDFS and 825// YARN stats.Beta Feature: This report is available for testing 826// purposes only. It may be changed before final release. 827type ClusterMetrics struct { 828 // HdfsMetrics: The HDFS metrics. 829 HdfsMetrics map[string]string `json:"hdfsMetrics,omitempty"` 830 831 // YarnMetrics: The YARN metrics. 832 YarnMetrics map[string]string `json:"yarnMetrics,omitempty"` 833 834 // ForceSendFields is a list of field names (e.g. "HdfsMetrics") to 835 // unconditionally include in API requests. By default, fields with 836 // empty values are omitted from API requests. However, any non-pointer, 837 // non-interface field appearing in ForceSendFields will be sent to the 838 // server regardless of whether the field is empty or not. This may be 839 // used to include empty fields in Patch requests. 840 ForceSendFields []string `json:"-"` 841 842 // NullFields is a list of field names (e.g. "HdfsMetrics") to include 843 // in API requests with the JSON null value. By default, fields with 844 // empty values are omitted from API requests. However, any field with 845 // an empty value appearing in NullFields will be sent to the server as 846 // null. It is an error if a field in this list has a non-empty value. 847 // This may be used to include null fields in Patch requests. 848 NullFields []string `json:"-"` 849} 850 851func (s *ClusterMetrics) MarshalJSON() ([]byte, error) { 852 type NoMethod ClusterMetrics 853 raw := NoMethod(*s) 854 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 855} 856 857// ClusterOperation: The cluster operation triggered by a workflow. 858type ClusterOperation struct { 859 // Done: Output only. Indicates the operation is done. 860 Done bool `json:"done,omitempty"` 861 862 // Error: Output only. Error, if operation failed. 863 Error string `json:"error,omitempty"` 864 865 // OperationId: Output only. The id of the cluster operation. 866 OperationId string `json:"operationId,omitempty"` 867 868 // ForceSendFields is a list of field names (e.g. "Done") to 869 // unconditionally include in API requests. By default, fields with 870 // empty values are omitted from API requests. However, any non-pointer, 871 // non-interface field appearing in ForceSendFields will be sent to the 872 // server regardless of whether the field is empty or not. This may be 873 // used to include empty fields in Patch requests. 874 ForceSendFields []string `json:"-"` 875 876 // NullFields is a list of field names (e.g. "Done") to include in API 877 // requests with the JSON null value. By default, fields with empty 878 // values are omitted from API requests. However, any field with an 879 // empty value appearing in NullFields will be sent to the server as 880 // null. It is an error if a field in this list has a non-empty value. 881 // This may be used to include null fields in Patch requests. 882 NullFields []string `json:"-"` 883} 884 885func (s *ClusterOperation) MarshalJSON() ([]byte, error) { 886 type NoMethod ClusterOperation 887 raw := NoMethod(*s) 888 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 889} 890 891// ClusterOperationMetadata: Metadata describing the operation. 892type ClusterOperationMetadata struct { 893 // ClusterName: Output only. Name of the cluster for the operation. 894 ClusterName string `json:"clusterName,omitempty"` 895 896 // ClusterUuid: Output only. Cluster UUID for the operation. 897 ClusterUuid string `json:"clusterUuid,omitempty"` 898 899 // Description: Output only. Short description of operation. 900 Description string `json:"description,omitempty"` 901 902 // Labels: Output only. Labels associated with the operation 903 Labels map[string]string `json:"labels,omitempty"` 904 905 // OperationType: Output only. The operation type. 906 OperationType string `json:"operationType,omitempty"` 907 908 // Status: Output only. Current operation status. 909 Status *ClusterOperationStatus `json:"status,omitempty"` 910 911 // StatusHistory: Output only. The previous operation status. 912 StatusHistory []*ClusterOperationStatus `json:"statusHistory,omitempty"` 913 914 // Warnings: Output only. Errors encountered during operation execution. 915 Warnings []string `json:"warnings,omitempty"` 916 917 // ForceSendFields is a list of field names (e.g. "ClusterName") to 918 // unconditionally include in API requests. By default, fields with 919 // empty values are omitted from API requests. However, any non-pointer, 920 // non-interface field appearing in ForceSendFields will be sent to the 921 // server regardless of whether the field is empty or not. This may be 922 // used to include empty fields in Patch requests. 923 ForceSendFields []string `json:"-"` 924 925 // NullFields is a list of field names (e.g. "ClusterName") to include 926 // in API requests with the JSON null value. By default, fields with 927 // empty values are omitted from API requests. However, any field with 928 // an empty value appearing in NullFields will be sent to the server as 929 // null. It is an error if a field in this list has a non-empty value. 930 // This may be used to include null fields in Patch requests. 931 NullFields []string `json:"-"` 932} 933 934func (s *ClusterOperationMetadata) MarshalJSON() ([]byte, error) { 935 type NoMethod ClusterOperationMetadata 936 raw := NoMethod(*s) 937 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 938} 939 940// ClusterOperationStatus: The status of the operation. 941type ClusterOperationStatus struct { 942 // Details: Output only. A message containing any operation metadata 943 // details. 944 Details string `json:"details,omitempty"` 945 946 // InnerState: Output only. A message containing the detailed operation 947 // state. 948 InnerState string `json:"innerState,omitempty"` 949 950 // State: Output only. A message containing the operation state. 951 // 952 // Possible values: 953 // "UNKNOWN" - Unused. 954 // "PENDING" - The operation has been created. 955 // "RUNNING" - The operation is running. 956 // "DONE" - The operation is done; either cancelled or completed. 957 State string `json:"state,omitempty"` 958 959 // StateStartTime: Output only. The time this state was entered. 960 StateStartTime string `json:"stateStartTime,omitempty"` 961 962 // ForceSendFields is a list of field names (e.g. "Details") to 963 // unconditionally include in API requests. By default, fields with 964 // empty values are omitted from API requests. However, any non-pointer, 965 // non-interface field appearing in ForceSendFields will be sent to the 966 // server regardless of whether the field is empty or not. This may be 967 // used to include empty fields in Patch requests. 968 ForceSendFields []string `json:"-"` 969 970 // NullFields is a list of field names (e.g. "Details") to include in 971 // API requests with the JSON null value. By default, fields with empty 972 // values are omitted from API requests. However, any field with an 973 // empty value appearing in NullFields will be sent to the server as 974 // null. It is an error if a field in this list has a non-empty value. 975 // This may be used to include null fields in Patch requests. 976 NullFields []string `json:"-"` 977} 978 979func (s *ClusterOperationStatus) MarshalJSON() ([]byte, error) { 980 type NoMethod ClusterOperationStatus 981 raw := NoMethod(*s) 982 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 983} 984 985// ClusterSelector: A selector that chooses target cluster for jobs 986// based on metadata. 987type ClusterSelector struct { 988 // ClusterLabels: Required. The cluster labels. Cluster must have all 989 // labels to match. 990 ClusterLabels map[string]string `json:"clusterLabels,omitempty"` 991 992 // Zone: Optional. The zone where workflow process executes. This 993 // parameter does not affect the selection of the cluster.If 994 // unspecified, the zone of the first cluster matching the selector is 995 // used. 996 Zone string `json:"zone,omitempty"` 997 998 // ForceSendFields is a list of field names (e.g. "ClusterLabels") to 999 // unconditionally include in API requests. By default, fields with 1000 // empty values are omitted from API requests. However, any non-pointer, 1001 // non-interface field appearing in ForceSendFields will be sent to the 1002 // server regardless of whether the field is empty or not. This may be 1003 // used to include empty fields in Patch requests. 1004 ForceSendFields []string `json:"-"` 1005 1006 // NullFields is a list of field names (e.g. "ClusterLabels") to include 1007 // in API requests with the JSON null value. By default, fields with 1008 // empty values are omitted from API requests. However, any field with 1009 // an empty value appearing in NullFields will be sent to the server as 1010 // null. It is an error if a field in this list has a non-empty value. 1011 // This may be used to include null fields in Patch requests. 1012 NullFields []string `json:"-"` 1013} 1014 1015func (s *ClusterSelector) MarshalJSON() ([]byte, error) { 1016 type NoMethod ClusterSelector 1017 raw := NoMethod(*s) 1018 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1019} 1020 1021// ClusterStatus: The status of a cluster and its instances. 1022type ClusterStatus struct { 1023 // Detail: Optional. Output only. Details of cluster's state. 1024 Detail string `json:"detail,omitempty"` 1025 1026 // State: Output only. The cluster's state. 1027 // 1028 // Possible values: 1029 // "UNKNOWN" - The cluster state is unknown. 1030 // "CREATING" - The cluster is being created and set up. It is not 1031 // ready for use. 1032 // "RUNNING" - The cluster is currently running and healthy. It is 1033 // ready for use. 1034 // "ERROR" - The cluster encountered an error. It is not ready for 1035 // use. 1036 // "ERROR_DUE_TO_UPDATE" - The cluster has encountered an error while 1037 // being updated. Jobs can be submitted to the cluster, but the cluster 1038 // cannot be updated. 1039 // "DELETING" - The cluster is being deleted. It cannot be used. 1040 // "UPDATING" - The cluster is being updated. It continues to accept 1041 // and process jobs. 1042 // "STOPPING" - The cluster is being stopped. It cannot be used. 1043 // "STOPPED" - The cluster is currently stopped. It is not ready for 1044 // use. 1045 // "STARTING" - The cluster is being started. It is not ready for use. 1046 State string `json:"state,omitempty"` 1047 1048 // StateStartTime: Output only. Time when this state was entered (see 1049 // JSON representation of Timestamp 1050 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 1051 StateStartTime string `json:"stateStartTime,omitempty"` 1052 1053 // Substate: Output only. Additional state information that includes 1054 // status reported by the agent. 1055 // 1056 // Possible values: 1057 // "UNSPECIFIED" - The cluster substate is unknown. 1058 // "UNHEALTHY" - The cluster is known to be in an unhealthy state (for 1059 // example, critical daemons are not running or HDFS capacity is 1060 // exhausted).Applies to RUNNING state. 1061 // "STALE_STATUS" - The agent-reported status is out of date (may 1062 // occur if Dataproc loses communication with Agent).Applies to RUNNING 1063 // state. 1064 Substate string `json:"substate,omitempty"` 1065 1066 // ForceSendFields is a list of field names (e.g. "Detail") to 1067 // unconditionally include in API requests. By default, fields with 1068 // empty values are omitted from API requests. However, any non-pointer, 1069 // non-interface field appearing in ForceSendFields will be sent to the 1070 // server regardless of whether the field is empty or not. This may be 1071 // used to include empty fields in Patch requests. 1072 ForceSendFields []string `json:"-"` 1073 1074 // NullFields is a list of field names (e.g. "Detail") to include in API 1075 // requests with the JSON null value. By default, fields with empty 1076 // values are omitted from API requests. However, any field with an 1077 // empty value appearing in NullFields will be sent to the server as 1078 // null. It is an error if a field in this list has a non-empty value. 1079 // This may be used to include null fields in Patch requests. 1080 NullFields []string `json:"-"` 1081} 1082 1083func (s *ClusterStatus) MarshalJSON() ([]byte, error) { 1084 type NoMethod ClusterStatus 1085 raw := NoMethod(*s) 1086 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1087} 1088 1089// ConfidentialInstanceConfig: Confidential Instance Config for clusters 1090// using Confidential VMs 1091// (https://cloud.google.com/compute/confidential-vm/docs) 1092type ConfidentialInstanceConfig struct { 1093 // EnableConfidentialCompute: Optional. Defines whether the instance 1094 // should have confidential compute enabled. 1095 EnableConfidentialCompute bool `json:"enableConfidentialCompute,omitempty"` 1096 1097 // ForceSendFields is a list of field names (e.g. 1098 // "EnableConfidentialCompute") to unconditionally include in API 1099 // requests. By default, fields with empty values are omitted from API 1100 // requests. However, any non-pointer, non-interface field appearing in 1101 // ForceSendFields will be sent to the server regardless of whether the 1102 // field is empty or not. This may be used to include empty fields in 1103 // Patch requests. 1104 ForceSendFields []string `json:"-"` 1105 1106 // NullFields is a list of field names (e.g. 1107 // "EnableConfidentialCompute") to include in API requests with the JSON 1108 // null value. By default, fields with empty values are omitted from API 1109 // requests. However, any field with an empty value appearing in 1110 // NullFields will be sent to the server as null. It is an error if a 1111 // field in this list has a non-empty value. This may be used to include 1112 // null fields in Patch requests. 1113 NullFields []string `json:"-"` 1114} 1115 1116func (s *ConfidentialInstanceConfig) MarshalJSON() ([]byte, error) { 1117 type NoMethod ConfidentialInstanceConfig 1118 raw := NoMethod(*s) 1119 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1120} 1121 1122// DiagnoseClusterRequest: A request to collect cluster diagnostic 1123// information. 1124type DiagnoseClusterRequest struct { 1125} 1126 1127// DiagnoseClusterResults: The location of diagnostic output. 1128type DiagnoseClusterResults struct { 1129 // OutputUri: Output only. The Cloud Storage URI of the diagnostic 1130 // output. The output report is a plain text file with a summary of 1131 // collected diagnostics. 1132 OutputUri string `json:"outputUri,omitempty"` 1133 1134 // ForceSendFields is a list of field names (e.g. "OutputUri") to 1135 // unconditionally include in API requests. By default, fields with 1136 // empty values are omitted from API requests. However, any non-pointer, 1137 // non-interface field appearing in ForceSendFields will be sent to the 1138 // server regardless of whether the field is empty or not. This may be 1139 // used to include empty fields in Patch requests. 1140 ForceSendFields []string `json:"-"` 1141 1142 // NullFields is a list of field names (e.g. "OutputUri") to include in 1143 // API requests with the JSON null value. By default, fields with empty 1144 // values are omitted from API requests. However, any field with an 1145 // empty value appearing in NullFields will be sent to the server as 1146 // null. It is an error if a field in this list has a non-empty value. 1147 // This may be used to include null fields in Patch requests. 1148 NullFields []string `json:"-"` 1149} 1150 1151func (s *DiagnoseClusterResults) MarshalJSON() ([]byte, error) { 1152 type NoMethod DiagnoseClusterResults 1153 raw := NoMethod(*s) 1154 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1155} 1156 1157// DiskConfig: Specifies the config of disk options for a group of VM 1158// instances. 1159type DiskConfig struct { 1160 // BootDiskSizeGb: Optional. Size in GB of the boot disk (default is 1161 // 500GB). 1162 BootDiskSizeGb int64 `json:"bootDiskSizeGb,omitempty"` 1163 1164 // BootDiskType: Optional. Type of the boot disk (default is 1165 // "pd-standard"). Valid values: "pd-balanced" (Persistent Disk Balanced 1166 // Solid State Drive), "pd-ssd" (Persistent Disk Solid State Drive), or 1167 // "pd-standard" (Persistent Disk Hard Disk Drive). See Disk types 1168 // (https://cloud.google.com/compute/docs/disks#disk-types). 1169 BootDiskType string `json:"bootDiskType,omitempty"` 1170 1171 // NumLocalSsds: Optional. Number of attached SSDs, from 0 to 4 (default 1172 // is 0). If SSDs are not attached, the boot disk is used to store 1173 // runtime logs and HDFS 1174 // (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If 1175 // one or more SSDs are attached, this runtime bulk data is spread 1176 // across them, and the boot disk contains only basic config and 1177 // installed binaries. 1178 NumLocalSsds int64 `json:"numLocalSsds,omitempty"` 1179 1180 // ForceSendFields is a list of field names (e.g. "BootDiskSizeGb") to 1181 // unconditionally include in API requests. By default, fields with 1182 // empty values are omitted from API requests. However, any non-pointer, 1183 // non-interface field appearing in ForceSendFields will be sent to the 1184 // server regardless of whether the field is empty or not. This may be 1185 // used to include empty fields in Patch requests. 1186 ForceSendFields []string `json:"-"` 1187 1188 // NullFields is a list of field names (e.g. "BootDiskSizeGb") to 1189 // include in API requests with the JSON null value. By default, fields 1190 // with empty values are omitted from API requests. However, any field 1191 // with an empty value appearing in NullFields will be sent to the 1192 // server as null. It is an error if a field in this list has a 1193 // non-empty value. This may be used to include null fields in Patch 1194 // requests. 1195 NullFields []string `json:"-"` 1196} 1197 1198func (s *DiskConfig) MarshalJSON() ([]byte, error) { 1199 type NoMethod DiskConfig 1200 raw := NoMethod(*s) 1201 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1202} 1203 1204// Empty: A generic empty message that you can re-use to avoid defining 1205// duplicated empty messages in your APIs. A typical example is to use 1206// it as the request or the response type of an API method. For 1207// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 1208// (google.protobuf.Empty); } The JSON representation for Empty is empty 1209// JSON object {}. 1210type Empty struct { 1211 // ServerResponse contains the HTTP response code and headers from the 1212 // server. 1213 googleapi.ServerResponse `json:"-"` 1214} 1215 1216// EncryptionConfig: Encryption settings for the cluster. 1217type EncryptionConfig struct { 1218 // GcePdKmsKeyName: Optional. The Cloud KMS key name to use for PD disk 1219 // encryption for all instances in the cluster. 1220 GcePdKmsKeyName string `json:"gcePdKmsKeyName,omitempty"` 1221 1222 // ForceSendFields is a list of field names (e.g. "GcePdKmsKeyName") to 1223 // unconditionally include in API requests. By default, fields with 1224 // empty values are omitted from API requests. However, any non-pointer, 1225 // non-interface field appearing in ForceSendFields will be sent to the 1226 // server regardless of whether the field is empty or not. This may be 1227 // used to include empty fields in Patch requests. 1228 ForceSendFields []string `json:"-"` 1229 1230 // NullFields is a list of field names (e.g. "GcePdKmsKeyName") to 1231 // include in API requests with the JSON null value. By default, fields 1232 // with empty values are omitted from API requests. However, any field 1233 // with an empty value appearing in NullFields will be sent to the 1234 // server as null. It is an error if a field in this list has a 1235 // non-empty value. This may be used to include null fields in Patch 1236 // requests. 1237 NullFields []string `json:"-"` 1238} 1239 1240func (s *EncryptionConfig) MarshalJSON() ([]byte, error) { 1241 type NoMethod EncryptionConfig 1242 raw := NoMethod(*s) 1243 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1244} 1245 1246// EndpointConfig: Endpoint config for this cluster 1247type EndpointConfig struct { 1248 // EnableHttpPortAccess: Optional. If true, enable http access to 1249 // specific ports on the cluster from external sources. Defaults to 1250 // false. 1251 EnableHttpPortAccess bool `json:"enableHttpPortAccess,omitempty"` 1252 1253 // HttpPorts: Output only. The map of port descriptions to URLs. Will 1254 // only be populated if enable_http_port_access is true. 1255 HttpPorts map[string]string `json:"httpPorts,omitempty"` 1256 1257 // ForceSendFields is a list of field names (e.g. 1258 // "EnableHttpPortAccess") to unconditionally include in API requests. 1259 // By default, fields with empty values are omitted from API requests. 1260 // However, any non-pointer, non-interface field appearing in 1261 // ForceSendFields will be sent to the server regardless of whether the 1262 // field is empty or not. This may be used to include empty fields in 1263 // Patch requests. 1264 ForceSendFields []string `json:"-"` 1265 1266 // NullFields is a list of field names (e.g. "EnableHttpPortAccess") to 1267 // include in API requests with the JSON null value. By default, fields 1268 // with empty values are omitted from API requests. However, any field 1269 // with an empty value appearing in NullFields will be sent to the 1270 // server as null. It is an error if a field in this list has a 1271 // non-empty value. This may be used to include null fields in Patch 1272 // requests. 1273 NullFields []string `json:"-"` 1274} 1275 1276func (s *EndpointConfig) MarshalJSON() ([]byte, error) { 1277 type NoMethod EndpointConfig 1278 raw := NoMethod(*s) 1279 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1280} 1281 1282// Expr: Represents a textual expression in the Common Expression 1283// Language (CEL) syntax. CEL is a C-like expression language. The 1284// syntax and semantics of CEL are documented at 1285// https://github.com/google/cel-spec.Example (Comparison): title: 1286// "Summary size limit" description: "Determines if a summary is less 1287// than 100 chars" expression: "document.summary.size() < 100" Example 1288// (Equality): title: "Requestor is owner" description: "Determines if 1289// requestor is the document owner" expression: "document.owner == 1290// request.auth.claims.email" Example (Logic): title: "Public documents" 1291// description: "Determine whether the document should be publicly 1292// visible" expression: "document.type != 'private' && document.type != 1293// 'internal'" Example (Data Manipulation): title: "Notification string" 1294// description: "Create a notification string with a timestamp." 1295// expression: "'New message received at ' + 1296// string(document.create_time)" The exact variables and functions that 1297// may be referenced within an expression are determined by the service 1298// that evaluates it. See the service documentation for additional 1299// information. 1300type Expr struct { 1301 // Description: Optional. Description of the expression. This is a 1302 // longer text which describes the expression, e.g. when hovered over it 1303 // in a UI. 1304 Description string `json:"description,omitempty"` 1305 1306 // Expression: Textual representation of an expression in Common 1307 // Expression Language syntax. 1308 Expression string `json:"expression,omitempty"` 1309 1310 // Location: Optional. String indicating the location of the expression 1311 // for error reporting, e.g. a file name and a position in the file. 1312 Location string `json:"location,omitempty"` 1313 1314 // Title: Optional. Title for the expression, i.e. a short string 1315 // describing its purpose. This can be used e.g. in UIs which allow to 1316 // enter the expression. 1317 Title string `json:"title,omitempty"` 1318 1319 // ForceSendFields is a list of field names (e.g. "Description") to 1320 // unconditionally include in API requests. By default, fields with 1321 // empty values are omitted from API requests. However, any non-pointer, 1322 // non-interface field appearing in ForceSendFields will be sent to the 1323 // server regardless of whether the field is empty or not. This may be 1324 // used to include empty fields in Patch requests. 1325 ForceSendFields []string `json:"-"` 1326 1327 // NullFields is a list of field names (e.g. "Description") to include 1328 // in API requests with the JSON null value. By default, fields with 1329 // empty values are omitted from API requests. However, any field with 1330 // an empty value appearing in NullFields will be sent to the server as 1331 // null. It is an error if a field in this list has a non-empty value. 1332 // This may be used to include null fields in Patch requests. 1333 NullFields []string `json:"-"` 1334} 1335 1336func (s *Expr) MarshalJSON() ([]byte, error) { 1337 type NoMethod Expr 1338 raw := NoMethod(*s) 1339 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1340} 1341 1342// GceClusterConfig: Common config settings for resources of Compute 1343// Engine cluster instances, applicable to all instances in the cluster. 1344type GceClusterConfig struct { 1345 // ConfidentialInstanceConfig: Optional. Confidential Instance Config 1346 // for clusters using Confidential VMs 1347 // (https://cloud.google.com/compute/confidential-vm/docs). 1348 ConfidentialInstanceConfig *ConfidentialInstanceConfig `json:"confidentialInstanceConfig,omitempty"` 1349 1350 // InternalIpOnly: Optional. If true, all instances in the cluster will 1351 // only have internal IP addresses. By default, clusters are not 1352 // restricted to internal IP addresses, and will have ephemeral external 1353 // IP addresses assigned to each instance. This internal_ip_only 1354 // restriction can only be enabled for subnetwork enabled networks, and 1355 // all off-cluster dependencies must be configured to be accessible 1356 // without external IP addresses. 1357 InternalIpOnly bool `json:"internalIpOnly,omitempty"` 1358 1359 // Metadata: The Compute Engine metadata entries to add to all instances 1360 // (see Project and instance metadata 1361 // (https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). 1362 Metadata map[string]string `json:"metadata,omitempty"` 1363 1364 // NetworkUri: Optional. The Compute Engine network to be used for 1365 // machine communications. Cannot be specified with subnetwork_uri. If 1366 // neither network_uri nor subnetwork_uri is specified, the "default" 1367 // network of the project is used, if it exists. Cannot be a "Custom 1368 // Subnet Network" (see Using Subnetworks 1369 // (https://cloud.google.com/compute/docs/subnetworks) for more 1370 // information).A full URL, partial URI, or short name are valid. 1371 // Examples: 1372 // https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default 1373 // projects/[project_id]/regions/global/default default 1374 NetworkUri string `json:"networkUri,omitempty"` 1375 1376 // NodeGroupAffinity: Optional. Node Group Affinity for sole-tenant 1377 // clusters. 1378 NodeGroupAffinity *NodeGroupAffinity `json:"nodeGroupAffinity,omitempty"` 1379 1380 // PrivateIpv6GoogleAccess: Optional. The type of IPv6 access for a 1381 // cluster. 1382 // 1383 // Possible values: 1384 // "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED" - If unspecified, Compute 1385 // Engine default behavior will apply, which is the same as 1386 // INHERIT_FROM_SUBNETWORK. 1387 // "INHERIT_FROM_SUBNETWORK" - Private access to and from Google 1388 // Services configuration inherited from the subnetwork configuration. 1389 // This is the default Compute Engine behavior. 1390 // "OUTBOUND" - Enables outbound private IPv6 access to Google 1391 // Services from the Dataproc cluster. 1392 // "BIDIRECTIONAL" - Enables bidirectional private IPv6 access between 1393 // Google Services and the Dataproc cluster. 1394 PrivateIpv6GoogleAccess string `json:"privateIpv6GoogleAccess,omitempty"` 1395 1396 // ReservationAffinity: Optional. Reservation Affinity for consuming 1397 // Zonal reservation. 1398 ReservationAffinity *ReservationAffinity `json:"reservationAffinity,omitempty"` 1399 1400 // ServiceAccount: Optional. The Dataproc service account 1401 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/service-accounts#service_accounts_in_dataproc) 1402 // (also see VM Data Plane identity 1403 // (https://cloud.google.com/dataproc/docs/concepts/iam/dataproc-principals#vm_service_account_data_plane_identity)) 1404 // used by Dataproc cluster VM instances to access Google Cloud Platform 1405 // services.If not specified, the Compute Engine default service account 1406 // (https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) 1407 // is used. 1408 ServiceAccount string `json:"serviceAccount,omitempty"` 1409 1410 // ServiceAccountScopes: Optional. The URIs of service account scopes to 1411 // be included in Compute Engine instances. The following base set of 1412 // scopes is always included: 1413 // https://www.googleapis.com/auth/cloud.useraccounts.readonly 1414 // https://www.googleapis.com/auth/devstorage.read_write 1415 // https://www.googleapis.com/auth/logging.writeIf no scopes are 1416 // specified, the following defaults are also provided: 1417 // https://www.googleapis.com/auth/bigquery 1418 // https://www.googleapis.com/auth/bigtable.admin.table 1419 // https://www.googleapis.com/auth/bigtable.data 1420 // https://www.googleapis.com/auth/devstorage.full_control 1421 ServiceAccountScopes []string `json:"serviceAccountScopes,omitempty"` 1422 1423 // ShieldedInstanceConfig: Optional. Shielded Instance Config for 1424 // clusters using Compute Engine Shielded VMs 1425 // (https://cloud.google.com/security/shielded-cloud/shielded-vm). 1426 ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"` 1427 1428 // SubnetworkUri: Optional. The Compute Engine subnetwork to be used for 1429 // machine communications. Cannot be specified with network_uri.A full 1430 // URL, partial URI, or short name are valid. Examples: 1431 // https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/subnetworks/sub0 1432 // projects/[project_id]/regions/us-east1/subnetworks/sub0 sub0 1433 SubnetworkUri string `json:"subnetworkUri,omitempty"` 1434 1435 // Tags: The Compute Engine tags to add to all instances (see Tagging 1436 // instances 1437 // (https://cloud.google.com/compute/docs/label-or-tag-resources#tags)). 1438 Tags []string `json:"tags,omitempty"` 1439 1440 // ZoneUri: Optional. The zone where the Compute Engine cluster will be 1441 // located. On a create request, it is required in the "global" region. 1442 // If omitted in a non-global Dataproc region, the service will pick a 1443 // zone in the corresponding Compute Engine region. On a get request, 1444 // zone will always be present.A full URL, partial URI, or short name 1445 // are valid. Examples: 1446 // https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone] 1447 // projects/[project_id]/zones/[zone] us-central1-f 1448 ZoneUri string `json:"zoneUri,omitempty"` 1449 1450 // ForceSendFields is a list of field names (e.g. 1451 // "ConfidentialInstanceConfig") to unconditionally include in API 1452 // requests. By default, fields with empty values are omitted from API 1453 // requests. However, any non-pointer, non-interface field appearing in 1454 // ForceSendFields will be sent to the server regardless of whether the 1455 // field is empty or not. This may be used to include empty fields in 1456 // Patch requests. 1457 ForceSendFields []string `json:"-"` 1458 1459 // NullFields is a list of field names (e.g. 1460 // "ConfidentialInstanceConfig") to include in API requests with the 1461 // JSON null value. By default, fields with empty values are omitted 1462 // from API requests. However, any field with an empty value appearing 1463 // in NullFields will be sent to the server as null. It is an error if a 1464 // field in this list has a non-empty value. This may be used to include 1465 // null fields in Patch requests. 1466 NullFields []string `json:"-"` 1467} 1468 1469func (s *GceClusterConfig) MarshalJSON() ([]byte, error) { 1470 type NoMethod GceClusterConfig 1471 raw := NoMethod(*s) 1472 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1473} 1474 1475// GetIamPolicyRequest: Request message for GetIamPolicy method. 1476type GetIamPolicyRequest struct { 1477 // Options: OPTIONAL: A GetPolicyOptions object for specifying options 1478 // to GetIamPolicy. 1479 Options *GetPolicyOptions `json:"options,omitempty"` 1480 1481 // ForceSendFields is a list of field names (e.g. "Options") to 1482 // unconditionally include in API requests. By default, fields with 1483 // empty values are omitted from API requests. However, any non-pointer, 1484 // non-interface field appearing in ForceSendFields will be sent to the 1485 // server regardless of whether the field is empty or not. This may be 1486 // used to include empty fields in Patch requests. 1487 ForceSendFields []string `json:"-"` 1488 1489 // NullFields is a list of field names (e.g. "Options") to include in 1490 // API requests with the JSON null value. By default, fields with empty 1491 // values are omitted from API requests. However, any field with an 1492 // empty value appearing in NullFields will be sent to the server as 1493 // null. It is an error if a field in this list has a non-empty value. 1494 // This may be used to include null fields in Patch requests. 1495 NullFields []string `json:"-"` 1496} 1497 1498func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) { 1499 type NoMethod GetIamPolicyRequest 1500 raw := NoMethod(*s) 1501 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1502} 1503 1504// GetPolicyOptions: Encapsulates settings provided to GetIamPolicy. 1505type GetPolicyOptions struct { 1506 // RequestedPolicyVersion: Optional. The policy format version to be 1507 // returned.Valid values are 0, 1, and 3. Requests specifying an invalid 1508 // value will be rejected.Requests for policies with any conditional 1509 // bindings must specify version 3. Policies without any conditional 1510 // bindings may specify any valid value or leave the field unset.To 1511 // learn which resources support conditions in their IAM policies, see 1512 // the IAM documentation 1513 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1514 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"` 1515 1516 // ForceSendFields is a list of field names (e.g. 1517 // "RequestedPolicyVersion") to unconditionally include in API requests. 1518 // By default, fields with empty values are omitted from API requests. 1519 // However, any non-pointer, non-interface field appearing in 1520 // ForceSendFields will be sent to the server regardless of whether the 1521 // field is empty or not. This may be used to include empty fields in 1522 // Patch requests. 1523 ForceSendFields []string `json:"-"` 1524 1525 // NullFields is a list of field names (e.g. "RequestedPolicyVersion") 1526 // to include in API requests with the JSON null value. By default, 1527 // fields with empty values are omitted from API requests. However, any 1528 // field with an empty value appearing in NullFields will be sent to the 1529 // server as null. It is an error if a field in this list has a 1530 // non-empty value. This may be used to include null fields in Patch 1531 // requests. 1532 NullFields []string `json:"-"` 1533} 1534 1535func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) { 1536 type NoMethod GetPolicyOptions 1537 raw := NoMethod(*s) 1538 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1539} 1540 1541// GkeClusterConfig: The GKE config for this cluster. 1542type GkeClusterConfig struct { 1543 // NamespacedGkeDeploymentTarget: Optional. A target for the deployment. 1544 NamespacedGkeDeploymentTarget *NamespacedGkeDeploymentTarget `json:"namespacedGkeDeploymentTarget,omitempty"` 1545 1546 // ForceSendFields is a list of field names (e.g. 1547 // "NamespacedGkeDeploymentTarget") to unconditionally include in API 1548 // requests. By default, fields with empty values are omitted from API 1549 // requests. However, any non-pointer, non-interface field appearing in 1550 // ForceSendFields will be sent to the server regardless of whether the 1551 // field is empty or not. This may be used to include empty fields in 1552 // Patch requests. 1553 ForceSendFields []string `json:"-"` 1554 1555 // NullFields is a list of field names (e.g. 1556 // "NamespacedGkeDeploymentTarget") to include in API requests with the 1557 // JSON null value. By default, fields with empty values are omitted 1558 // from API requests. However, any field with an empty value appearing 1559 // in NullFields will be sent to the server as null. It is an error if a 1560 // field in this list has a non-empty value. This may be used to include 1561 // null fields in Patch requests. 1562 NullFields []string `json:"-"` 1563} 1564 1565func (s *GkeClusterConfig) MarshalJSON() ([]byte, error) { 1566 type NoMethod GkeClusterConfig 1567 raw := NoMethod(*s) 1568 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1569} 1570 1571// HadoopJob: A Dataproc job for running Apache Hadoop MapReduce 1572// (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) 1573// jobs on Apache Hadoop YARN 1574// (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). 1575type HadoopJob struct { 1576 // ArchiveUris: Optional. HCFS URIs of archives to be extracted in the 1577 // working directory of Hadoop drivers and tasks. Supported file types: 1578 // .jar, .tar, .tar.gz, .tgz, or .zip. 1579 ArchiveUris []string `json:"archiveUris,omitempty"` 1580 1581 // Args: Optional. The arguments to pass to the driver. Do not include 1582 // arguments, such as -libjars or -Dfoo=bar, that can be set as job 1583 // properties, since a collision may occur that causes an incorrect job 1584 // submission. 1585 Args []string `json:"args,omitempty"` 1586 1587 // FileUris: Optional. HCFS (Hadoop Compatible Filesystem) URIs of files 1588 // to be copied to the working directory of Hadoop drivers and 1589 // distributed tasks. Useful for naively parallel tasks. 1590 FileUris []string `json:"fileUris,omitempty"` 1591 1592 // JarFileUris: Optional. Jar file URIs to add to the CLASSPATHs of the 1593 // Hadoop driver and tasks. 1594 JarFileUris []string `json:"jarFileUris,omitempty"` 1595 1596 // LoggingConfig: Optional. The runtime log config for job execution. 1597 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 1598 1599 // MainClass: The name of the driver's main class. The jar file 1600 // containing the class must be in the default CLASSPATH or specified in 1601 // jar_file_uris. 1602 MainClass string `json:"mainClass,omitempty"` 1603 1604 // MainJarFileUri: The HCFS URI of the jar file containing the main 1605 // class. Examples: 1606 // 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' 1607 // 'hdfs:/tmp/test-samples/custom-wordcount.jar' 1608 // 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' 1609 MainJarFileUri string `json:"mainJarFileUri,omitempty"` 1610 1611 // Properties: Optional. A mapping of property names to values, used to 1612 // configure Hadoop. Properties that conflict with values set by the 1613 // Dataproc API may be overwritten. Can include properties set in 1614 // /etc/hadoop/conf/*-site and classes in user code. 1615 Properties map[string]string `json:"properties,omitempty"` 1616 1617 // ForceSendFields is a list of field names (e.g. "ArchiveUris") to 1618 // unconditionally include in API requests. By default, fields with 1619 // empty values are omitted from API requests. However, any non-pointer, 1620 // non-interface field appearing in ForceSendFields will be sent to the 1621 // server regardless of whether the field is empty or not. This may be 1622 // used to include empty fields in Patch requests. 1623 ForceSendFields []string `json:"-"` 1624 1625 // NullFields is a list of field names (e.g. "ArchiveUris") to include 1626 // in API requests with the JSON null value. By default, fields with 1627 // empty values are omitted from API requests. However, any field with 1628 // an empty value appearing in NullFields will be sent to the server as 1629 // null. It is an error if a field in this list has a non-empty value. 1630 // This may be used to include null fields in Patch requests. 1631 NullFields []string `json:"-"` 1632} 1633 1634func (s *HadoopJob) MarshalJSON() ([]byte, error) { 1635 type NoMethod HadoopJob 1636 raw := NoMethod(*s) 1637 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1638} 1639 1640// HiveJob: A Dataproc job for running Apache Hive 1641// (https://hive.apache.org/) queries on YARN. 1642type HiveJob struct { 1643 // ContinueOnFailure: Optional. Whether to continue executing queries if 1644 // a query fails. The default value is false. Setting to true can be 1645 // useful when executing independent parallel queries. 1646 ContinueOnFailure bool `json:"continueOnFailure,omitempty"` 1647 1648 // JarFileUris: Optional. HCFS URIs of jar files to add to the CLASSPATH 1649 // of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive 1650 // SerDes and UDFs. 1651 JarFileUris []string `json:"jarFileUris,omitempty"` 1652 1653 // Properties: Optional. A mapping of property names and values, used to 1654 // configure Hive. Properties that conflict with values set by the 1655 // Dataproc API may be overwritten. Can include properties set in 1656 // /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and 1657 // classes in user code. 1658 Properties map[string]string `json:"properties,omitempty"` 1659 1660 // QueryFileUri: The HCFS URI of the script that contains Hive queries. 1661 QueryFileUri string `json:"queryFileUri,omitempty"` 1662 1663 // QueryList: A list of queries. 1664 QueryList *QueryList `json:"queryList,omitempty"` 1665 1666 // ScriptVariables: Optional. Mapping of query variable names to values 1667 // (equivalent to the Hive command: SET name="value";). 1668 ScriptVariables map[string]string `json:"scriptVariables,omitempty"` 1669 1670 // ForceSendFields is a list of field names (e.g. "ContinueOnFailure") 1671 // to unconditionally include in API requests. By default, fields with 1672 // empty values are omitted from API requests. However, any non-pointer, 1673 // non-interface field appearing in ForceSendFields will be sent to the 1674 // server regardless of whether the field is empty or not. This may be 1675 // used to include empty fields in Patch requests. 1676 ForceSendFields []string `json:"-"` 1677 1678 // NullFields is a list of field names (e.g. "ContinueOnFailure") to 1679 // include in API requests with the JSON null value. By default, fields 1680 // with empty values are omitted from API requests. However, any field 1681 // with an empty value appearing in NullFields will be sent to the 1682 // server as null. It is an error if a field in this list has a 1683 // non-empty value. This may be used to include null fields in Patch 1684 // requests. 1685 NullFields []string `json:"-"` 1686} 1687 1688func (s *HiveJob) MarshalJSON() ([]byte, error) { 1689 type NoMethod HiveJob 1690 raw := NoMethod(*s) 1691 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1692} 1693 1694// IdentityConfig: Identity related configuration, including service 1695// account based secure multi-tenancy user mappings. 1696type IdentityConfig struct { 1697 // UserServiceAccountMapping: Required. Map of user to service account. 1698 UserServiceAccountMapping map[string]string `json:"userServiceAccountMapping,omitempty"` 1699 1700 // ForceSendFields is a list of field names (e.g. 1701 // "UserServiceAccountMapping") to unconditionally include in API 1702 // requests. By default, fields with empty values are omitted from API 1703 // requests. However, any non-pointer, non-interface field appearing in 1704 // ForceSendFields will be sent to the server regardless of whether the 1705 // field is empty or not. This may be used to include empty fields in 1706 // Patch requests. 1707 ForceSendFields []string `json:"-"` 1708 1709 // NullFields is a list of field names (e.g. 1710 // "UserServiceAccountMapping") to include in API requests with the JSON 1711 // null value. By default, fields with empty values are omitted from API 1712 // requests. However, any field with an empty value appearing in 1713 // NullFields will be sent to the server as null. It is an error if a 1714 // field in this list has a non-empty value. This may be used to include 1715 // null fields in Patch requests. 1716 NullFields []string `json:"-"` 1717} 1718 1719func (s *IdentityConfig) MarshalJSON() ([]byte, error) { 1720 type NoMethod IdentityConfig 1721 raw := NoMethod(*s) 1722 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1723} 1724 1725// InjectCredentialsRequest: A request to inject credentials into a 1726// cluster. 1727type InjectCredentialsRequest struct { 1728 // ClusterUuid: Required. The cluster UUID. 1729 ClusterUuid string `json:"clusterUuid,omitempty"` 1730 1731 // CredentialsCiphertext: Required. The encrypted credentials being 1732 // injected in to the cluster.The client is responsible for encrypting 1733 // the credentials in a way that is supported by the cluster.A wrapped 1734 // value is used here so that the actual contents of the encrypted 1735 // credentials are not written to audit logs. 1736 CredentialsCiphertext string `json:"credentialsCiphertext,omitempty"` 1737 1738 // ForceSendFields is a list of field names (e.g. "ClusterUuid") to 1739 // unconditionally include in API requests. By default, fields with 1740 // empty values are omitted from API requests. However, any non-pointer, 1741 // non-interface field appearing in ForceSendFields will be sent to the 1742 // server regardless of whether the field is empty or not. This may be 1743 // used to include empty fields in Patch requests. 1744 ForceSendFields []string `json:"-"` 1745 1746 // NullFields is a list of field names (e.g. "ClusterUuid") to include 1747 // in API requests with the JSON null value. By default, fields with 1748 // empty values are omitted from API requests. However, any field with 1749 // an empty value appearing in NullFields will be sent to the server as 1750 // null. It is an error if a field in this list has a non-empty value. 1751 // This may be used to include null fields in Patch requests. 1752 NullFields []string `json:"-"` 1753} 1754 1755func (s *InjectCredentialsRequest) MarshalJSON() ([]byte, error) { 1756 type NoMethod InjectCredentialsRequest 1757 raw := NoMethod(*s) 1758 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1759} 1760 1761// InstanceGroupAutoscalingPolicyConfig: Configuration for the size 1762// bounds of an instance group, including its proportional size to other 1763// groups. 1764type InstanceGroupAutoscalingPolicyConfig struct { 1765 // MaxInstances: Required. Maximum number of instances for this group. 1766 // Required for primary workers. Note that by default, clusters will not 1767 // use secondary workers. Required for secondary workers if the minimum 1768 // secondary instances is set.Primary workers - Bounds: [min_instances, 1769 // ). Secondary workers - Bounds: [min_instances, ). Default: 0. 1770 MaxInstances int64 `json:"maxInstances,omitempty"` 1771 1772 // MinInstances: Optional. Minimum number of instances for this 1773 // group.Primary workers - Bounds: 2, max_instances. Default: 2. 1774 // Secondary workers - Bounds: 0, max_instances. Default: 0. 1775 MinInstances int64 `json:"minInstances,omitempty"` 1776 1777 // Weight: Optional. Weight for the instance group, which is used to 1778 // determine the fraction of total workers in the cluster from this 1779 // instance group. For example, if primary workers have weight 2, and 1780 // secondary workers have weight 1, the cluster will have approximately 1781 // 2 primary workers for each secondary worker.The cluster may not reach 1782 // the specified balance if constrained by min/max bounds or other 1783 // autoscaling settings. For example, if max_instances for secondary 1784 // workers is 0, then only primary workers will be added. The cluster 1785 // can also be out of balance when created.If weight is not set on any 1786 // instance group, the cluster will default to equal weight for all 1787 // groups: the cluster will attempt to maintain an equal number of 1788 // workers in each group within the configured size bounds for each 1789 // group. If weight is set for one group only, the cluster will default 1790 // to zero weight on the unset group. For example if weight is set only 1791 // on primary workers, the cluster will use primary workers only and no 1792 // secondary workers. 1793 Weight int64 `json:"weight,omitempty"` 1794 1795 // ForceSendFields is a list of field names (e.g. "MaxInstances") to 1796 // unconditionally include in API requests. By default, fields with 1797 // empty values are omitted from API requests. However, any non-pointer, 1798 // non-interface field appearing in ForceSendFields will be sent to the 1799 // server regardless of whether the field is empty or not. This may be 1800 // used to include empty fields in Patch requests. 1801 ForceSendFields []string `json:"-"` 1802 1803 // NullFields is a list of field names (e.g. "MaxInstances") to include 1804 // in API requests with the JSON null value. By default, fields with 1805 // empty values are omitted from API requests. However, any field with 1806 // an empty value appearing in NullFields will be sent to the server as 1807 // null. It is an error if a field in this list has a non-empty value. 1808 // This may be used to include null fields in Patch requests. 1809 NullFields []string `json:"-"` 1810} 1811 1812func (s *InstanceGroupAutoscalingPolicyConfig) MarshalJSON() ([]byte, error) { 1813 type NoMethod InstanceGroupAutoscalingPolicyConfig 1814 raw := NoMethod(*s) 1815 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1816} 1817 1818// InstanceGroupConfig: The config settings for Compute Engine resources 1819// in an instance group, such as a master or worker group. 1820type InstanceGroupConfig struct { 1821 // Accelerators: Optional. The Compute Engine accelerator configuration 1822 // for these instances. 1823 Accelerators []*AcceleratorConfig `json:"accelerators,omitempty"` 1824 1825 // DiskConfig: Optional. Disk option config settings. 1826 DiskConfig *DiskConfig `json:"diskConfig,omitempty"` 1827 1828 // ImageUri: Optional. The Compute Engine image resource used for 1829 // cluster instances.The URI can represent an image or image 1830 // family.Image examples: 1831 // https://www.googleapis.com/compute/beta/projects/[project_id]/global/images/[image-id] 1832 // projects/[project_id]/global/images/[image-id] image-idImage family 1833 // examples. Dataproc will use the most recent image from the family: 1834 // https://www.googleapis.com/compute/beta/projects/[project_id]/global/images/family/[custom-image-family-name] 1835 // projects/[project_id]/global/images/family/[custom-image-family-name]I 1836 // f the URI is unspecified, it will be inferred from 1837 // SoftwareConfig.image_version or the system default. 1838 ImageUri string `json:"imageUri,omitempty"` 1839 1840 // InstanceNames: Output only. The list of instance names. Dataproc 1841 // derives the names from cluster_name, num_instances, and the instance 1842 // group. 1843 InstanceNames []string `json:"instanceNames,omitempty"` 1844 1845 // InstanceReferences: Output only. List of references to Compute Engine 1846 // instances. 1847 InstanceReferences []*InstanceReference `json:"instanceReferences,omitempty"` 1848 1849 // IsPreemptible: Output only. Specifies that this instance group 1850 // contains preemptible instances. 1851 IsPreemptible bool `json:"isPreemptible,omitempty"` 1852 1853 // MachineTypeUri: Optional. The Compute Engine machine type used for 1854 // cluster instances.A full URL, partial URI, or short name are valid. 1855 // Examples: 1856 // https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 1857 // projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 1858 // n1-standard-2Auto Zone Exception: If you are using the Dataproc Auto 1859 // Zone Placement 1860 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) 1861 // feature, you must use the short name of the machine type resource, 1862 // for example, n1-standard-2. 1863 MachineTypeUri string `json:"machineTypeUri,omitempty"` 1864 1865 // ManagedGroupConfig: Output only. The config for Compute Engine 1866 // Instance Group Manager that manages this group. This is only used for 1867 // preemptible instance groups. 1868 ManagedGroupConfig *ManagedGroupConfig `json:"managedGroupConfig,omitempty"` 1869 1870 // MinCpuPlatform: Optional. Specifies the minimum cpu platform for the 1871 // Instance Group. See Dataproc -> Minimum CPU Platform 1872 // (https://cloud.google.com/dataproc/docs/concepts/compute/dataproc-min-cpu). 1873 MinCpuPlatform string `json:"minCpuPlatform,omitempty"` 1874 1875 // NumInstances: Optional. The number of VM instances in the instance 1876 // group. For HA cluster master_config groups, must be set to 3. For 1877 // standard cluster master_config groups, must be set to 1. 1878 NumInstances int64 `json:"numInstances,omitempty"` 1879 1880 // Preemptibility: Optional. Specifies the preemptibility of the 1881 // instance group.The default value for master and worker groups is 1882 // NON_PREEMPTIBLE. This default cannot be changed.The default value for 1883 // secondary instances is PREEMPTIBLE. 1884 // 1885 // Possible values: 1886 // "PREEMPTIBILITY_UNSPECIFIED" - Preemptibility is unspecified, the 1887 // system will choose the appropriate setting for each instance group. 1888 // "NON_PREEMPTIBLE" - Instances are non-preemptible.This option is 1889 // allowed for all instance groups and is the only valid value for 1890 // Master and Worker instance groups. 1891 // "PREEMPTIBLE" - Instances are preemptible.This option is allowed 1892 // only for secondary worker groups. 1893 Preemptibility string `json:"preemptibility,omitempty"` 1894 1895 // ForceSendFields is a list of field names (e.g. "Accelerators") to 1896 // unconditionally include in API requests. By default, fields with 1897 // empty values are omitted from API requests. However, any non-pointer, 1898 // non-interface field appearing in ForceSendFields will be sent to the 1899 // server regardless of whether the field is empty or not. This may be 1900 // used to include empty fields in Patch requests. 1901 ForceSendFields []string `json:"-"` 1902 1903 // NullFields is a list of field names (e.g. "Accelerators") to include 1904 // in API requests with the JSON null value. By default, fields with 1905 // empty values are omitted from API requests. However, any field with 1906 // an empty value appearing in NullFields will be sent to the server as 1907 // null. It is an error if a field in this list has a non-empty value. 1908 // This may be used to include null fields in Patch requests. 1909 NullFields []string `json:"-"` 1910} 1911 1912func (s *InstanceGroupConfig) MarshalJSON() ([]byte, error) { 1913 type NoMethod InstanceGroupConfig 1914 raw := NoMethod(*s) 1915 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1916} 1917 1918// InstanceReference: A reference to a Compute Engine instance. 1919type InstanceReference struct { 1920 // InstanceId: The unique identifier of the Compute Engine instance. 1921 InstanceId string `json:"instanceId,omitempty"` 1922 1923 // InstanceName: The user-friendly name of the Compute Engine instance. 1924 InstanceName string `json:"instanceName,omitempty"` 1925 1926 // PublicEciesKey: The public ECIES key used for sharing data with this 1927 // instance. 1928 PublicEciesKey string `json:"publicEciesKey,omitempty"` 1929 1930 // PublicKey: The public RSA key used for sharing data with this 1931 // instance. 1932 PublicKey string `json:"publicKey,omitempty"` 1933 1934 // ForceSendFields is a list of field names (e.g. "InstanceId") to 1935 // unconditionally include in API requests. By default, fields with 1936 // empty values are omitted from API requests. However, any non-pointer, 1937 // non-interface field appearing in ForceSendFields will be sent to the 1938 // server regardless of whether the field is empty or not. This may be 1939 // used to include empty fields in Patch requests. 1940 ForceSendFields []string `json:"-"` 1941 1942 // NullFields is a list of field names (e.g. "InstanceId") to include in 1943 // API requests with the JSON null value. By default, fields with empty 1944 // values are omitted from API requests. However, any field with an 1945 // empty value appearing in NullFields will be sent to the server as 1946 // null. It is an error if a field in this list has a non-empty value. 1947 // This may be used to include null fields in Patch requests. 1948 NullFields []string `json:"-"` 1949} 1950 1951func (s *InstanceReference) MarshalJSON() ([]byte, error) { 1952 type NoMethod InstanceReference 1953 raw := NoMethod(*s) 1954 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1955} 1956 1957// InstantiateWorkflowTemplateRequest: A request to instantiate a 1958// workflow template. 1959type InstantiateWorkflowTemplateRequest struct { 1960 // Parameters: Optional. Map from parameter names to values that should 1961 // be used for those parameters. Values may not exceed 1000 characters. 1962 Parameters map[string]string `json:"parameters,omitempty"` 1963 1964 // RequestId: Optional. A tag that prevents multiple concurrent workflow 1965 // instances with the same tag from running. This mitigates risk of 1966 // concurrent instances started due to retries.It is recommended to 1967 // always set this value to a UUID 1968 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag 1969 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 1970 // and hyphens (-). The maximum length is 40 characters. 1971 RequestId string `json:"requestId,omitempty"` 1972 1973 // Version: Optional. The version of workflow template to instantiate. 1974 // If specified, the workflow will be instantiated only if the current 1975 // version of the workflow template has the supplied version.This option 1976 // cannot be used to instantiate a previous version of workflow 1977 // template. 1978 Version int64 `json:"version,omitempty"` 1979 1980 // ForceSendFields is a list of field names (e.g. "Parameters") to 1981 // unconditionally include in API requests. By default, fields with 1982 // empty values are omitted from API requests. However, any non-pointer, 1983 // non-interface field appearing in ForceSendFields will be sent to the 1984 // server regardless of whether the field is empty or not. This may be 1985 // used to include empty fields in Patch requests. 1986 ForceSendFields []string `json:"-"` 1987 1988 // NullFields is a list of field names (e.g. "Parameters") to include in 1989 // API requests with the JSON null value. By default, fields with empty 1990 // values are omitted from API requests. However, any field with an 1991 // empty value appearing in NullFields will be sent to the server as 1992 // null. It is an error if a field in this list has a non-empty value. 1993 // This may be used to include null fields in Patch requests. 1994 NullFields []string `json:"-"` 1995} 1996 1997func (s *InstantiateWorkflowTemplateRequest) MarshalJSON() ([]byte, error) { 1998 type NoMethod InstantiateWorkflowTemplateRequest 1999 raw := NoMethod(*s) 2000 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2001} 2002 2003// Job: A Dataproc job resource. 2004type Job struct { 2005 // Done: Output only. Indicates whether the job is completed. If the 2006 // value is false, the job is still in progress. If true, the job is 2007 // completed, and status.state field will indicate if it was successful, 2008 // failed, or cancelled. 2009 Done bool `json:"done,omitempty"` 2010 2011 // DriverControlFilesUri: Output only. If present, the location of 2012 // miscellaneous control files which may be used as part of job setup 2013 // and handling. If not present, control files may be placed in the same 2014 // location as driver_output_uri. 2015 DriverControlFilesUri string `json:"driverControlFilesUri,omitempty"` 2016 2017 // DriverOutputResourceUri: Output only. A URI pointing to the location 2018 // of the stdout of the job's driver program. 2019 DriverOutputResourceUri string `json:"driverOutputResourceUri,omitempty"` 2020 2021 // HadoopJob: Optional. Job is a Hadoop job. 2022 HadoopJob *HadoopJob `json:"hadoopJob,omitempty"` 2023 2024 // HiveJob: Optional. Job is a Hive job. 2025 HiveJob *HiveJob `json:"hiveJob,omitempty"` 2026 2027 // JobUuid: Output only. A UUID that uniquely identifies a job within 2028 // the project over time. This is in contrast to a user-settable 2029 // reference.job_id that may be reused over time. 2030 JobUuid string `json:"jobUuid,omitempty"` 2031 2032 // Labels: Optional. The labels to associate with this job. Label keys 2033 // must contain 1 to 63 characters, and must conform to RFC 1035 2034 // (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, 2035 // but, if present, must contain 1 to 63 characters, and must conform to 2036 // RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 2037 // labels can be associated with a job. 2038 Labels map[string]string `json:"labels,omitempty"` 2039 2040 // PigJob: Optional. Job is a Pig job. 2041 PigJob *PigJob `json:"pigJob,omitempty"` 2042 2043 // Placement: Required. Job information, including how, when, and where 2044 // to run the job. 2045 Placement *JobPlacement `json:"placement,omitempty"` 2046 2047 // PrestoJob: Optional. Job is a Presto job. 2048 PrestoJob *PrestoJob `json:"prestoJob,omitempty"` 2049 2050 // PysparkJob: Optional. Job is a PySpark job. 2051 PysparkJob *PySparkJob `json:"pysparkJob,omitempty"` 2052 2053 // Reference: Optional. The fully qualified reference to the job, which 2054 // can be used to obtain the equivalent REST path of the job resource. 2055 // If this property is not specified when a job is created, the server 2056 // generates a job_id. 2057 Reference *JobReference `json:"reference,omitempty"` 2058 2059 // Scheduling: Optional. Job scheduling configuration. 2060 Scheduling *JobScheduling `json:"scheduling,omitempty"` 2061 2062 // SparkJob: Optional. Job is a Spark job. 2063 SparkJob *SparkJob `json:"sparkJob,omitempty"` 2064 2065 // SparkRJob: Optional. Job is a SparkR job. 2066 SparkRJob *SparkRJob `json:"sparkRJob,omitempty"` 2067 2068 // SparkSqlJob: Optional. Job is a SparkSql job. 2069 SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"` 2070 2071 // Status: Output only. The job status. Additional application-specific 2072 // status information may be contained in the type_job and 2073 // yarn_applications fields. 2074 Status *JobStatus `json:"status,omitempty"` 2075 2076 // StatusHistory: Output only. The previous job status. 2077 StatusHistory []*JobStatus `json:"statusHistory,omitempty"` 2078 2079 // YarnApplications: Output only. The collection of YARN applications 2080 // spun up by this job.Beta Feature: This report is available for 2081 // testing purposes only. It may be changed before final release. 2082 YarnApplications []*YarnApplication `json:"yarnApplications,omitempty"` 2083 2084 // ServerResponse contains the HTTP response code and headers from the 2085 // server. 2086 googleapi.ServerResponse `json:"-"` 2087 2088 // ForceSendFields is a list of field names (e.g. "Done") to 2089 // unconditionally include in API requests. By default, fields with 2090 // empty values are omitted from API requests. However, any non-pointer, 2091 // non-interface field appearing in ForceSendFields will be sent to the 2092 // server regardless of whether the field is empty or not. This may be 2093 // used to include empty fields in Patch requests. 2094 ForceSendFields []string `json:"-"` 2095 2096 // NullFields is a list of field names (e.g. "Done") to include in API 2097 // requests with the JSON null value. By default, fields with empty 2098 // values are omitted from API requests. However, any field with an 2099 // empty value appearing in NullFields will be sent to the server as 2100 // null. It is an error if a field in this list has a non-empty value. 2101 // This may be used to include null fields in Patch requests. 2102 NullFields []string `json:"-"` 2103} 2104 2105func (s *Job) MarshalJSON() ([]byte, error) { 2106 type NoMethod Job 2107 raw := NoMethod(*s) 2108 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2109} 2110 2111// JobMetadata: Job Operation metadata. 2112type JobMetadata struct { 2113 // JobId: Output only. The job id. 2114 JobId string `json:"jobId,omitempty"` 2115 2116 // OperationType: Output only. Operation type. 2117 OperationType string `json:"operationType,omitempty"` 2118 2119 // StartTime: Output only. Job submission time. 2120 StartTime string `json:"startTime,omitempty"` 2121 2122 // Status: Output only. Most recent job status. 2123 Status *JobStatus `json:"status,omitempty"` 2124 2125 // ForceSendFields is a list of field names (e.g. "JobId") to 2126 // unconditionally include in API requests. By default, fields with 2127 // empty values are omitted from API requests. However, any non-pointer, 2128 // non-interface field appearing in ForceSendFields will be sent to the 2129 // server regardless of whether the field is empty or not. This may be 2130 // used to include empty fields in Patch requests. 2131 ForceSendFields []string `json:"-"` 2132 2133 // NullFields is a list of field names (e.g. "JobId") to include in API 2134 // requests with the JSON null value. By default, fields with empty 2135 // values are omitted from API requests. However, any field with an 2136 // empty value appearing in NullFields will be sent to the server as 2137 // null. It is an error if a field in this list has a non-empty value. 2138 // This may be used to include null fields in Patch requests. 2139 NullFields []string `json:"-"` 2140} 2141 2142func (s *JobMetadata) MarshalJSON() ([]byte, error) { 2143 type NoMethod JobMetadata 2144 raw := NoMethod(*s) 2145 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2146} 2147 2148// JobPlacement: Dataproc job config. 2149type JobPlacement struct { 2150 // ClusterLabels: Optional. Cluster labels to identify a cluster where 2151 // the job will be submitted. 2152 ClusterLabels map[string]string `json:"clusterLabels,omitempty"` 2153 2154 // ClusterName: Required. The name of the cluster where the job will be 2155 // submitted. 2156 ClusterName string `json:"clusterName,omitempty"` 2157 2158 // ClusterUuid: Output only. A cluster UUID generated by the Dataproc 2159 // service when the job is submitted. 2160 ClusterUuid string `json:"clusterUuid,omitempty"` 2161 2162 // ForceSendFields is a list of field names (e.g. "ClusterLabels") to 2163 // unconditionally include in API requests. By default, fields with 2164 // empty values are omitted from API requests. However, any non-pointer, 2165 // non-interface field appearing in ForceSendFields will be sent to the 2166 // server regardless of whether the field is empty or not. This may be 2167 // used to include empty fields in Patch requests. 2168 ForceSendFields []string `json:"-"` 2169 2170 // NullFields is a list of field names (e.g. "ClusterLabels") to include 2171 // in API requests with the JSON null value. By default, fields with 2172 // empty values are omitted from API requests. However, any field with 2173 // an empty value appearing in NullFields will be sent to the server as 2174 // null. It is an error if a field in this list has a non-empty value. 2175 // This may be used to include null fields in Patch requests. 2176 NullFields []string `json:"-"` 2177} 2178 2179func (s *JobPlacement) MarshalJSON() ([]byte, error) { 2180 type NoMethod JobPlacement 2181 raw := NoMethod(*s) 2182 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2183} 2184 2185// JobReference: Encapsulates the full scoping used to reference a job. 2186type JobReference struct { 2187 // JobId: Optional. The job ID, which must be unique within the 2188 // project.The ID must contain only letters (a-z, A-Z), numbers (0-9), 2189 // underscores (_), or hyphens (-). The maximum length is 100 2190 // characters.If not specified by the caller, the job ID will be 2191 // provided by the server. 2192 JobId string `json:"jobId,omitempty"` 2193 2194 // ProjectId: Optional. The ID of the Google Cloud Platform project that 2195 // the job belongs to. If specified, must match the request project ID. 2196 ProjectId string `json:"projectId,omitempty"` 2197 2198 // ForceSendFields is a list of field names (e.g. "JobId") to 2199 // unconditionally include in API requests. By default, fields with 2200 // empty values are omitted from API requests. However, any non-pointer, 2201 // non-interface field appearing in ForceSendFields will be sent to the 2202 // server regardless of whether the field is empty or not. This may be 2203 // used to include empty fields in Patch requests. 2204 ForceSendFields []string `json:"-"` 2205 2206 // NullFields is a list of field names (e.g. "JobId") to include in API 2207 // requests with the JSON null value. By default, fields with empty 2208 // values are omitted from API requests. However, any field with an 2209 // empty value appearing in NullFields will be sent to the server as 2210 // null. It is an error if a field in this list has a non-empty value. 2211 // This may be used to include null fields in Patch requests. 2212 NullFields []string `json:"-"` 2213} 2214 2215func (s *JobReference) MarshalJSON() ([]byte, error) { 2216 type NoMethod JobReference 2217 raw := NoMethod(*s) 2218 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2219} 2220 2221// JobScheduling: Job scheduling options. 2222type JobScheduling struct { 2223 // MaxFailuresPerHour: Optional. Maximum number of times per hour a 2224 // driver may be restarted as a result of driver exiting with non-zero 2225 // code before job is reported failed.A job may be reported as thrashing 2226 // if driver exits with non-zero code 4 times within 10 minute 2227 // window.Maximum value is 10. 2228 MaxFailuresPerHour int64 `json:"maxFailuresPerHour,omitempty"` 2229 2230 // MaxFailuresTotal: Optional. Maximum number of times in total a driver 2231 // may be restarted as a result of driver exiting with non-zero code 2232 // before job is reported failed. Maximum value is 240. 2233 MaxFailuresTotal int64 `json:"maxFailuresTotal,omitempty"` 2234 2235 // ForceSendFields is a list of field names (e.g. "MaxFailuresPerHour") 2236 // to unconditionally include in API requests. By default, fields with 2237 // empty values are omitted from API requests. However, any non-pointer, 2238 // non-interface field appearing in ForceSendFields will be sent to the 2239 // server regardless of whether the field is empty or not. This may be 2240 // used to include empty fields in Patch requests. 2241 ForceSendFields []string `json:"-"` 2242 2243 // NullFields is a list of field names (e.g. "MaxFailuresPerHour") to 2244 // include in API requests with the JSON null value. By default, fields 2245 // with empty values are omitted from API requests. However, any field 2246 // with an empty value appearing in NullFields will be sent to the 2247 // server as null. It is an error if a field in this list has a 2248 // non-empty value. This may be used to include null fields in Patch 2249 // requests. 2250 NullFields []string `json:"-"` 2251} 2252 2253func (s *JobScheduling) MarshalJSON() ([]byte, error) { 2254 type NoMethod JobScheduling 2255 raw := NoMethod(*s) 2256 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2257} 2258 2259// JobStatus: Dataproc job status. 2260type JobStatus struct { 2261 // Details: Optional. Output only. Job state details, such as an error 2262 // description if the state is ERROR. 2263 Details string `json:"details,omitempty"` 2264 2265 // State: Output only. A state message specifying the overall job state. 2266 // 2267 // Possible values: 2268 // "STATE_UNSPECIFIED" - The job state is unknown. 2269 // "PENDING" - The job is pending; it has been submitted, but is not 2270 // yet running. 2271 // "SETUP_DONE" - Job has been received by the service and completed 2272 // initial setup; it will soon be submitted to the cluster. 2273 // "RUNNING" - The job is running on the cluster. 2274 // "CANCEL_PENDING" - A CancelJob request has been received, but is 2275 // pending. 2276 // "CANCEL_STARTED" - Transient in-flight resources have been 2277 // canceled, and the request to cancel the running job has been issued 2278 // to the cluster. 2279 // "CANCELLED" - The job cancellation was successful. 2280 // "DONE" - The job has completed successfully. 2281 // "ERROR" - The job has completed, but encountered an error. 2282 // "ATTEMPT_FAILURE" - Job attempt has failed. The detail field 2283 // contains failure details for this attempt.Applies to restartable jobs 2284 // only. 2285 State string `json:"state,omitempty"` 2286 2287 // StateStartTime: Output only. The time when this state was entered. 2288 StateStartTime string `json:"stateStartTime,omitempty"` 2289 2290 // Substate: Output only. Additional state information, which includes 2291 // status reported by the agent. 2292 // 2293 // Possible values: 2294 // "UNSPECIFIED" - The job substate is unknown. 2295 // "SUBMITTED" - The Job is submitted to the agent.Applies to RUNNING 2296 // state. 2297 // "QUEUED" - The Job has been received and is awaiting execution (it 2298 // may be waiting for a condition to be met). See the "details" field 2299 // for the reason for the delay.Applies to RUNNING state. 2300 // "STALE_STATUS" - The agent-reported status is out of date, which 2301 // may be caused by a loss of communication between the agent and 2302 // Dataproc. If the agent does not send a timely update, the job will 2303 // fail.Applies to RUNNING state. 2304 Substate string `json:"substate,omitempty"` 2305 2306 // ForceSendFields is a list of field names (e.g. "Details") to 2307 // unconditionally include in API requests. By default, fields with 2308 // empty values are omitted from API requests. However, any non-pointer, 2309 // non-interface field appearing in ForceSendFields will be sent to the 2310 // server regardless of whether the field is empty or not. This may be 2311 // used to include empty fields in Patch requests. 2312 ForceSendFields []string `json:"-"` 2313 2314 // NullFields is a list of field names (e.g. "Details") to include in 2315 // API requests with the JSON null value. By default, fields with empty 2316 // values are omitted from API requests. However, any field with an 2317 // empty value appearing in NullFields will be sent to the server as 2318 // null. It is an error if a field in this list has a non-empty value. 2319 // This may be used to include null fields in Patch requests. 2320 NullFields []string `json:"-"` 2321} 2322 2323func (s *JobStatus) MarshalJSON() ([]byte, error) { 2324 type NoMethod JobStatus 2325 raw := NoMethod(*s) 2326 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2327} 2328 2329// KerberosConfig: Specifies Kerberos related configuration. 2330type KerberosConfig struct { 2331 // CrossRealmTrustAdminServer: Optional. The admin server (IP or 2332 // hostname) for the remote trusted realm in a cross realm trust 2333 // relationship. 2334 CrossRealmTrustAdminServer string `json:"crossRealmTrustAdminServer,omitempty"` 2335 2336 // CrossRealmTrustKdc: Optional. The KDC (IP or hostname) for the remote 2337 // trusted realm in a cross realm trust relationship. 2338 CrossRealmTrustKdc string `json:"crossRealmTrustKdc,omitempty"` 2339 2340 // CrossRealmTrustRealm: Optional. The remote realm the Dataproc 2341 // on-cluster KDC will trust, should the user enable cross realm trust. 2342 CrossRealmTrustRealm string `json:"crossRealmTrustRealm,omitempty"` 2343 2344 // CrossRealmTrustSharedPasswordUri: Optional. The Cloud Storage URI of 2345 // a KMS encrypted file containing the shared password between the 2346 // on-cluster Kerberos realm and the remote trusted realm, in a cross 2347 // realm trust relationship. 2348 CrossRealmTrustSharedPasswordUri string `json:"crossRealmTrustSharedPasswordUri,omitempty"` 2349 2350 // EnableKerberos: Optional. Flag to indicate whether to Kerberize the 2351 // cluster (default: false). Set this field to true to enable Kerberos 2352 // on a cluster. 2353 EnableKerberos bool `json:"enableKerberos,omitempty"` 2354 2355 // KdcDbKeyUri: Optional. The Cloud Storage URI of a KMS encrypted file 2356 // containing the master key of the KDC database. 2357 KdcDbKeyUri string `json:"kdcDbKeyUri,omitempty"` 2358 2359 // KeyPasswordUri: Optional. The Cloud Storage URI of a KMS encrypted 2360 // file containing the password to the user provided key. For the 2361 // self-signed certificate, this password is generated by Dataproc. 2362 KeyPasswordUri string `json:"keyPasswordUri,omitempty"` 2363 2364 // KeystorePasswordUri: Optional. The Cloud Storage URI of a KMS 2365 // encrypted file containing the password to the user provided keystore. 2366 // For the self-signed certificate, this password is generated by 2367 // Dataproc. 2368 KeystorePasswordUri string `json:"keystorePasswordUri,omitempty"` 2369 2370 // KeystoreUri: Optional. The Cloud Storage URI of the keystore file 2371 // used for SSL encryption. If not provided, Dataproc will provide a 2372 // self-signed certificate. 2373 KeystoreUri string `json:"keystoreUri,omitempty"` 2374 2375 // KmsKeyUri: Optional. The uri of the KMS key used to encrypt various 2376 // sensitive files. 2377 KmsKeyUri string `json:"kmsKeyUri,omitempty"` 2378 2379 // Realm: Optional. The name of the on-cluster Kerberos realm. If not 2380 // specified, the uppercased domain of hostnames will be the realm. 2381 Realm string `json:"realm,omitempty"` 2382 2383 // RootPrincipalPasswordUri: Optional. The Cloud Storage URI of a KMS 2384 // encrypted file containing the root principal password. 2385 RootPrincipalPasswordUri string `json:"rootPrincipalPasswordUri,omitempty"` 2386 2387 // TgtLifetimeHours: Optional. The lifetime of the ticket granting 2388 // ticket, in hours. If not specified, or user specifies 0, then default 2389 // value 10 will be used. 2390 TgtLifetimeHours int64 `json:"tgtLifetimeHours,omitempty"` 2391 2392 // TruststorePasswordUri: Optional. The Cloud Storage URI of a KMS 2393 // encrypted file containing the password to the user provided 2394 // truststore. For the self-signed certificate, this password is 2395 // generated by Dataproc. 2396 TruststorePasswordUri string `json:"truststorePasswordUri,omitempty"` 2397 2398 // TruststoreUri: Optional. The Cloud Storage URI of the truststore file 2399 // used for SSL encryption. If not provided, Dataproc will provide a 2400 // self-signed certificate. 2401 TruststoreUri string `json:"truststoreUri,omitempty"` 2402 2403 // ForceSendFields is a list of field names (e.g. 2404 // "CrossRealmTrustAdminServer") to unconditionally include in API 2405 // requests. By default, fields with empty values are omitted from API 2406 // requests. However, any non-pointer, non-interface field appearing in 2407 // ForceSendFields will be sent to the server regardless of whether the 2408 // field is empty or not. This may be used to include empty fields in 2409 // Patch requests. 2410 ForceSendFields []string `json:"-"` 2411 2412 // NullFields is a list of field names (e.g. 2413 // "CrossRealmTrustAdminServer") to include in API requests with the 2414 // JSON null value. By default, fields with empty values are omitted 2415 // from API requests. However, any field with an empty value appearing 2416 // in NullFields will be sent to the server as null. It is an error if a 2417 // field in this list has a non-empty value. This may be used to include 2418 // null fields in Patch requests. 2419 NullFields []string `json:"-"` 2420} 2421 2422func (s *KerberosConfig) MarshalJSON() ([]byte, error) { 2423 type NoMethod KerberosConfig 2424 raw := NoMethod(*s) 2425 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2426} 2427 2428// LifecycleConfig: Specifies the cluster auto-delete schedule 2429// configuration. 2430type LifecycleConfig struct { 2431 // AutoDeleteTime: Optional. The time when cluster will be auto-deleted 2432 // (see JSON representation of Timestamp 2433 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 2434 AutoDeleteTime string `json:"autoDeleteTime,omitempty"` 2435 2436 // AutoDeleteTtl: Optional. The lifetime duration of cluster. The 2437 // cluster will be auto-deleted at the end of this period. Minimum value 2438 // is 10 minutes; maximum value is 14 days (see JSON representation of 2439 // Duration 2440 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 2441 AutoDeleteTtl string `json:"autoDeleteTtl,omitempty"` 2442 2443 // IdleDeleteTtl: Optional. The duration to keep the cluster alive while 2444 // idling (when no jobs are running). Passing this threshold will cause 2445 // the cluster to be deleted. Minimum value is 5 minutes; maximum value 2446 // is 14 days (see JSON representation of Duration 2447 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 2448 IdleDeleteTtl string `json:"idleDeleteTtl,omitempty"` 2449 2450 // IdleStartTime: Output only. The time when cluster became idle (most 2451 // recent job finished) and became eligible for deletion due to idleness 2452 // (see JSON representation of Timestamp 2453 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 2454 IdleStartTime string `json:"idleStartTime,omitempty"` 2455 2456 // ForceSendFields is a list of field names (e.g. "AutoDeleteTime") to 2457 // unconditionally include in API requests. By default, fields with 2458 // empty values are omitted from API requests. However, any non-pointer, 2459 // non-interface field appearing in ForceSendFields will be sent to the 2460 // server regardless of whether the field is empty or not. This may be 2461 // used to include empty fields in Patch requests. 2462 ForceSendFields []string `json:"-"` 2463 2464 // NullFields is a list of field names (e.g. "AutoDeleteTime") to 2465 // include in API requests with the JSON null value. By default, fields 2466 // with empty values are omitted from API requests. However, any field 2467 // with an empty value appearing in NullFields will be sent to the 2468 // server as null. It is an error if a field in this list has a 2469 // non-empty value. This may be used to include null fields in Patch 2470 // requests. 2471 NullFields []string `json:"-"` 2472} 2473 2474func (s *LifecycleConfig) MarshalJSON() ([]byte, error) { 2475 type NoMethod LifecycleConfig 2476 raw := NoMethod(*s) 2477 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2478} 2479 2480// ListAutoscalingPoliciesResponse: A response to a request to list 2481// autoscaling policies in a project. 2482type ListAutoscalingPoliciesResponse struct { 2483 // NextPageToken: Output only. This token is included in the response if 2484 // there are more results to fetch. 2485 NextPageToken string `json:"nextPageToken,omitempty"` 2486 2487 // Policies: Output only. Autoscaling policies list. 2488 Policies []*AutoscalingPolicy `json:"policies,omitempty"` 2489 2490 // ServerResponse contains the HTTP response code and headers from the 2491 // server. 2492 googleapi.ServerResponse `json:"-"` 2493 2494 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2495 // unconditionally include in API requests. By default, fields with 2496 // empty values are omitted from API requests. However, any non-pointer, 2497 // non-interface field appearing in ForceSendFields will be sent to the 2498 // server regardless of whether the field is empty or not. This may be 2499 // used to include empty fields in Patch requests. 2500 ForceSendFields []string `json:"-"` 2501 2502 // NullFields is a list of field names (e.g. "NextPageToken") to include 2503 // in API requests with the JSON null value. By default, fields with 2504 // empty values are omitted from API requests. However, any field with 2505 // an empty value appearing in NullFields will be sent to the server as 2506 // null. It is an error if a field in this list has a non-empty value. 2507 // This may be used to include null fields in Patch requests. 2508 NullFields []string `json:"-"` 2509} 2510 2511func (s *ListAutoscalingPoliciesResponse) MarshalJSON() ([]byte, error) { 2512 type NoMethod ListAutoscalingPoliciesResponse 2513 raw := NoMethod(*s) 2514 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2515} 2516 2517// ListClustersResponse: The list of all clusters in a project. 2518type ListClustersResponse struct { 2519 // Clusters: Output only. The clusters in the project. 2520 Clusters []*Cluster `json:"clusters,omitempty"` 2521 2522 // NextPageToken: Output only. This token is included in the response if 2523 // there are more results to fetch. To fetch additional results, provide 2524 // this value as the page_token in a subsequent ListClustersRequest. 2525 NextPageToken string `json:"nextPageToken,omitempty"` 2526 2527 // ServerResponse contains the HTTP response code and headers from the 2528 // server. 2529 googleapi.ServerResponse `json:"-"` 2530 2531 // ForceSendFields is a list of field names (e.g. "Clusters") to 2532 // unconditionally include in API requests. By default, fields with 2533 // empty values are omitted from API requests. However, any non-pointer, 2534 // non-interface field appearing in ForceSendFields will be sent to the 2535 // server regardless of whether the field is empty or not. This may be 2536 // used to include empty fields in Patch requests. 2537 ForceSendFields []string `json:"-"` 2538 2539 // NullFields is a list of field names (e.g. "Clusters") to include in 2540 // API requests with the JSON null value. By default, fields with empty 2541 // values are omitted from API requests. However, any field with an 2542 // empty value appearing in NullFields will be sent to the server as 2543 // null. It is an error if a field in this list has a non-empty value. 2544 // This may be used to include null fields in Patch requests. 2545 NullFields []string `json:"-"` 2546} 2547 2548func (s *ListClustersResponse) MarshalJSON() ([]byte, error) { 2549 type NoMethod ListClustersResponse 2550 raw := NoMethod(*s) 2551 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2552} 2553 2554// ListJobsResponse: A list of jobs in a project. 2555type ListJobsResponse struct { 2556 // Jobs: Output only. Jobs list. 2557 Jobs []*Job `json:"jobs,omitempty"` 2558 2559 // NextPageToken: Optional. This token is included in the response if 2560 // there are more results to fetch. To fetch additional results, provide 2561 // this value as the page_token in a subsequent ListJobsRequest. 2562 NextPageToken string `json:"nextPageToken,omitempty"` 2563 2564 // ServerResponse contains the HTTP response code and headers from the 2565 // server. 2566 googleapi.ServerResponse `json:"-"` 2567 2568 // ForceSendFields is a list of field names (e.g. "Jobs") to 2569 // unconditionally include in API requests. By default, fields with 2570 // empty values are omitted from API requests. However, any non-pointer, 2571 // non-interface field appearing in ForceSendFields will be sent to the 2572 // server regardless of whether the field is empty or not. This may be 2573 // used to include empty fields in Patch requests. 2574 ForceSendFields []string `json:"-"` 2575 2576 // NullFields is a list of field names (e.g. "Jobs") to include in API 2577 // requests with the JSON null value. By default, fields with empty 2578 // values are omitted from API requests. However, any field with an 2579 // empty value appearing in NullFields will be sent to the server as 2580 // null. It is an error if a field in this list has a non-empty value. 2581 // This may be used to include null fields in Patch requests. 2582 NullFields []string `json:"-"` 2583} 2584 2585func (s *ListJobsResponse) MarshalJSON() ([]byte, error) { 2586 type NoMethod ListJobsResponse 2587 raw := NoMethod(*s) 2588 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2589} 2590 2591// ListOperationsResponse: The response message for 2592// Operations.ListOperations. 2593type ListOperationsResponse struct { 2594 // NextPageToken: The standard List next-page token. 2595 NextPageToken string `json:"nextPageToken,omitempty"` 2596 2597 // Operations: A list of operations that matches the specified filter in 2598 // the request. 2599 Operations []*Operation `json:"operations,omitempty"` 2600 2601 // ServerResponse contains the HTTP response code and headers from the 2602 // server. 2603 googleapi.ServerResponse `json:"-"` 2604 2605 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2606 // unconditionally include in API requests. By default, fields with 2607 // empty values are omitted from API requests. However, any non-pointer, 2608 // non-interface field appearing in ForceSendFields will be sent to the 2609 // server regardless of whether the field is empty or not. This may be 2610 // used to include empty fields in Patch requests. 2611 ForceSendFields []string `json:"-"` 2612 2613 // NullFields is a list of field names (e.g. "NextPageToken") to include 2614 // in API requests with the JSON null value. By default, fields with 2615 // empty values are omitted from API requests. However, any field with 2616 // an empty value appearing in NullFields will be sent to the server as 2617 // null. It is an error if a field in this list has a non-empty value. 2618 // This may be used to include null fields in Patch requests. 2619 NullFields []string `json:"-"` 2620} 2621 2622func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 2623 type NoMethod ListOperationsResponse 2624 raw := NoMethod(*s) 2625 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2626} 2627 2628// ListWorkflowTemplatesResponse: A response to a request to list 2629// workflow templates in a project. 2630type ListWorkflowTemplatesResponse struct { 2631 // NextPageToken: Output only. This token is included in the response if 2632 // there are more results to fetch. To fetch additional results, provide 2633 // this value as the page_token in a subsequent 2634 // ListWorkflowTemplatesRequest. 2635 NextPageToken string `json:"nextPageToken,omitempty"` 2636 2637 // Templates: Output only. WorkflowTemplates list. 2638 Templates []*WorkflowTemplate `json:"templates,omitempty"` 2639 2640 // ServerResponse contains the HTTP response code and headers from the 2641 // server. 2642 googleapi.ServerResponse `json:"-"` 2643 2644 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2645 // unconditionally include in API requests. By default, fields with 2646 // empty values are omitted from API requests. However, any non-pointer, 2647 // non-interface field appearing in ForceSendFields will be sent to the 2648 // server regardless of whether the field is empty or not. This may be 2649 // used to include empty fields in Patch requests. 2650 ForceSendFields []string `json:"-"` 2651 2652 // NullFields is a list of field names (e.g. "NextPageToken") to include 2653 // in API requests with the JSON null value. By default, fields with 2654 // empty values are omitted from API requests. However, any field with 2655 // an empty value appearing in NullFields will be sent to the server as 2656 // null. It is an error if a field in this list has a non-empty value. 2657 // This may be used to include null fields in Patch requests. 2658 NullFields []string `json:"-"` 2659} 2660 2661func (s *ListWorkflowTemplatesResponse) MarshalJSON() ([]byte, error) { 2662 type NoMethod ListWorkflowTemplatesResponse 2663 raw := NoMethod(*s) 2664 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2665} 2666 2667// LoggingConfig: The runtime logging config of the job. 2668type LoggingConfig struct { 2669 // DriverLogLevels: The per-package log levels for the driver. This may 2670 // include "root" package name to configure rootLogger. Examples: 2671 // 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG' 2672 DriverLogLevels map[string]string `json:"driverLogLevels,omitempty"` 2673 2674 // ForceSendFields is a list of field names (e.g. "DriverLogLevels") to 2675 // unconditionally include in API requests. By default, fields with 2676 // empty values are omitted from API requests. However, any non-pointer, 2677 // non-interface field appearing in ForceSendFields will be sent to the 2678 // server regardless of whether the field is empty or not. This may be 2679 // used to include empty fields in Patch requests. 2680 ForceSendFields []string `json:"-"` 2681 2682 // NullFields is a list of field names (e.g. "DriverLogLevels") to 2683 // include in API requests with the JSON null value. By default, fields 2684 // with empty values are omitted from API requests. However, any field 2685 // with an empty value appearing in NullFields will be sent to the 2686 // server as null. It is an error if a field in this list has a 2687 // non-empty value. This may be used to include null fields in Patch 2688 // requests. 2689 NullFields []string `json:"-"` 2690} 2691 2692func (s *LoggingConfig) MarshalJSON() ([]byte, error) { 2693 type NoMethod LoggingConfig 2694 raw := NoMethod(*s) 2695 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2696} 2697 2698// ManagedCluster: Cluster that is managed by the workflow. 2699type ManagedCluster struct { 2700 // ClusterName: Required. The cluster name prefix. A unique cluster name 2701 // will be formed by appending a random suffix.The name must contain 2702 // only lower-case letters (a-z), numbers (0-9), and hyphens (-). Must 2703 // begin with a letter. Cannot begin or end with hyphen. Must consist of 2704 // between 2 and 35 characters. 2705 ClusterName string `json:"clusterName,omitempty"` 2706 2707 // Config: Required. The cluster configuration. 2708 Config *ClusterConfig `json:"config,omitempty"` 2709 2710 // Labels: Optional. The labels to associate with this cluster.Label 2711 // keys must be between 1 and 63 characters long, and must conform to 2712 // the following PCRE regular expression: \p{Ll}\p{Lo}{0,62}Label values 2713 // must be between 1 and 63 characters long, and must conform to the 2714 // following PCRE regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more 2715 // than 32 labels can be associated with a given cluster. 2716 Labels map[string]string `json:"labels,omitempty"` 2717 2718 // ForceSendFields is a list of field names (e.g. "ClusterName") to 2719 // unconditionally include in API requests. By default, fields with 2720 // empty values are omitted from API requests. However, any non-pointer, 2721 // non-interface field appearing in ForceSendFields will be sent to the 2722 // server regardless of whether the field is empty or not. This may be 2723 // used to include empty fields in Patch requests. 2724 ForceSendFields []string `json:"-"` 2725 2726 // NullFields is a list of field names (e.g. "ClusterName") to include 2727 // in API requests with the JSON null value. By default, fields with 2728 // empty values are omitted from API requests. However, any field with 2729 // an empty value appearing in NullFields will be sent to the server as 2730 // null. It is an error if a field in this list has a non-empty value. 2731 // This may be used to include null fields in Patch requests. 2732 NullFields []string `json:"-"` 2733} 2734 2735func (s *ManagedCluster) MarshalJSON() ([]byte, error) { 2736 type NoMethod ManagedCluster 2737 raw := NoMethod(*s) 2738 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2739} 2740 2741// ManagedGroupConfig: Specifies the resources used to actively manage 2742// an instance group. 2743type ManagedGroupConfig struct { 2744 // InstanceGroupManagerName: Output only. The name of the Instance Group 2745 // Manager for this group. 2746 InstanceGroupManagerName string `json:"instanceGroupManagerName,omitempty"` 2747 2748 // InstanceTemplateName: Output only. The name of the Instance Template 2749 // used for the Managed Instance Group. 2750 InstanceTemplateName string `json:"instanceTemplateName,omitempty"` 2751 2752 // ForceSendFields is a list of field names (e.g. 2753 // "InstanceGroupManagerName") to unconditionally include in API 2754 // requests. By default, fields with empty values are omitted from API 2755 // requests. However, any non-pointer, non-interface field appearing in 2756 // ForceSendFields will be sent to the server regardless of whether the 2757 // field is empty or not. This may be used to include empty fields in 2758 // Patch requests. 2759 ForceSendFields []string `json:"-"` 2760 2761 // NullFields is a list of field names (e.g. "InstanceGroupManagerName") 2762 // to include in API requests with the JSON null value. By default, 2763 // fields with empty values are omitted from API requests. However, any 2764 // field with an empty value appearing in NullFields will be sent to the 2765 // server as null. It is an error if a field in this list has a 2766 // non-empty value. This may be used to include null fields in Patch 2767 // requests. 2768 NullFields []string `json:"-"` 2769} 2770 2771func (s *ManagedGroupConfig) MarshalJSON() ([]byte, error) { 2772 type NoMethod ManagedGroupConfig 2773 raw := NoMethod(*s) 2774 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2775} 2776 2777// MetastoreConfig: Specifies a Metastore configuration. 2778type MetastoreConfig struct { 2779 // DataprocMetastoreService: Required. Resource name of an existing 2780 // Dataproc Metastore service.Example: 2781 // projects/[project_id]/locations/[dataproc_region]/services/[service-na 2782 // me] 2783 DataprocMetastoreService string `json:"dataprocMetastoreService,omitempty"` 2784 2785 // ForceSendFields is a list of field names (e.g. 2786 // "DataprocMetastoreService") to unconditionally include in API 2787 // requests. By default, fields with empty values are omitted from API 2788 // requests. However, any non-pointer, non-interface field appearing in 2789 // ForceSendFields will be sent to the server regardless of whether the 2790 // field is empty or not. This may be used to include empty fields in 2791 // Patch requests. 2792 ForceSendFields []string `json:"-"` 2793 2794 // NullFields is a list of field names (e.g. "DataprocMetastoreService") 2795 // to include in API requests with the JSON null value. By default, 2796 // fields with empty values are omitted from API requests. However, any 2797 // field with an empty value appearing in NullFields will be sent to the 2798 // server as null. It is an error if a field in this list has a 2799 // non-empty value. This may be used to include null fields in Patch 2800 // requests. 2801 NullFields []string `json:"-"` 2802} 2803 2804func (s *MetastoreConfig) MarshalJSON() ([]byte, error) { 2805 type NoMethod MetastoreConfig 2806 raw := NoMethod(*s) 2807 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2808} 2809 2810// NamespacedGkeDeploymentTarget: A full, namespace-isolated deployment 2811// target for an existing GKE cluster. 2812type NamespacedGkeDeploymentTarget struct { 2813 // ClusterNamespace: Optional. A namespace within the GKE cluster to 2814 // deploy into. 2815 ClusterNamespace string `json:"clusterNamespace,omitempty"` 2816 2817 // TargetGkeCluster: Optional. The target GKE cluster to deploy to. 2818 // Format: 2819 // 'projects/{project}/locations/{location}/clusters/{cluster_id}' 2820 TargetGkeCluster string `json:"targetGkeCluster,omitempty"` 2821 2822 // ForceSendFields is a list of field names (e.g. "ClusterNamespace") to 2823 // unconditionally include in API requests. By default, fields with 2824 // empty values are omitted from API requests. However, any non-pointer, 2825 // non-interface field appearing in ForceSendFields will be sent to the 2826 // server regardless of whether the field is empty or not. This may be 2827 // used to include empty fields in Patch requests. 2828 ForceSendFields []string `json:"-"` 2829 2830 // NullFields is a list of field names (e.g. "ClusterNamespace") to 2831 // include in API requests with the JSON null value. By default, fields 2832 // with empty values are omitted from API requests. However, any field 2833 // with an empty value appearing in NullFields will be sent to the 2834 // server as null. It is an error if a field in this list has a 2835 // non-empty value. This may be used to include null fields in Patch 2836 // requests. 2837 NullFields []string `json:"-"` 2838} 2839 2840func (s *NamespacedGkeDeploymentTarget) MarshalJSON() ([]byte, error) { 2841 type NoMethod NamespacedGkeDeploymentTarget 2842 raw := NoMethod(*s) 2843 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2844} 2845 2846// NodeGroupAffinity: Node Group Affinity for clusters using sole-tenant 2847// node groups. 2848type NodeGroupAffinity struct { 2849 // NodeGroupUri: Required. The URI of a sole-tenant node group resource 2850 // (https://cloud.google.com/compute/docs/reference/rest/v1/nodeGroups) 2851 // that the cluster will be created on.A full URL, partial URI, or node 2852 // group name are valid. Examples: 2853 // https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-central1-a/nodeGroups/node-group-1 2854 // projects/[project_id]/zones/us-central1-a/nodeGroups/node-group-1 2855 // node-group-1 2856 NodeGroupUri string `json:"nodeGroupUri,omitempty"` 2857 2858 // ForceSendFields is a list of field names (e.g. "NodeGroupUri") to 2859 // unconditionally include in API requests. By default, fields with 2860 // empty values are omitted from API requests. However, any non-pointer, 2861 // non-interface field appearing in ForceSendFields will be sent to the 2862 // server regardless of whether the field is empty or not. This may be 2863 // used to include empty fields in Patch requests. 2864 ForceSendFields []string `json:"-"` 2865 2866 // NullFields is a list of field names (e.g. "NodeGroupUri") to include 2867 // in API requests with the JSON null value. By default, fields with 2868 // empty values are omitted from API requests. However, any field with 2869 // an empty value appearing in NullFields will be sent to the server as 2870 // null. It is an error if a field in this list has a non-empty value. 2871 // This may be used to include null fields in Patch requests. 2872 NullFields []string `json:"-"` 2873} 2874 2875func (s *NodeGroupAffinity) MarshalJSON() ([]byte, error) { 2876 type NoMethod NodeGroupAffinity 2877 raw := NoMethod(*s) 2878 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2879} 2880 2881// NodeInitializationAction: Specifies an executable to run on a fully 2882// configured node and a timeout period for executable completion. 2883type NodeInitializationAction struct { 2884 // ExecutableFile: Required. Cloud Storage URI of executable file. 2885 ExecutableFile string `json:"executableFile,omitempty"` 2886 2887 // ExecutionTimeout: Optional. Amount of time executable has to 2888 // complete. Default is 10 minutes (see JSON representation of Duration 2889 // (https://developers.google.com/protocol-buffers/docs/proto3#json)).Cluster 2890 // creation fails with an explanatory error message (the name of the 2891 // executable that caused the error and the exceeded timeout period) if 2892 // the executable is not completed at end of the timeout period. 2893 ExecutionTimeout string `json:"executionTimeout,omitempty"` 2894 2895 // ForceSendFields is a list of field names (e.g. "ExecutableFile") to 2896 // unconditionally include in API requests. By default, fields with 2897 // empty values are omitted from API requests. However, any non-pointer, 2898 // non-interface field appearing in ForceSendFields will be sent to the 2899 // server regardless of whether the field is empty or not. This may be 2900 // used to include empty fields in Patch requests. 2901 ForceSendFields []string `json:"-"` 2902 2903 // NullFields is a list of field names (e.g. "ExecutableFile") to 2904 // include in API requests with the JSON null value. By default, fields 2905 // with empty values are omitted from API requests. However, any field 2906 // with an empty value appearing in NullFields will be sent to the 2907 // server as null. It is an error if a field in this list has a 2908 // non-empty value. This may be used to include null fields in Patch 2909 // requests. 2910 NullFields []string `json:"-"` 2911} 2912 2913func (s *NodeInitializationAction) MarshalJSON() ([]byte, error) { 2914 type NoMethod NodeInitializationAction 2915 raw := NoMethod(*s) 2916 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2917} 2918 2919// Operation: This resource represents a long-running operation that is 2920// the result of a network API call. 2921type Operation struct { 2922 // Done: If the value is false, it means the operation is still in 2923 // progress. If true, the operation is completed, and either error or 2924 // response is available. 2925 Done bool `json:"done,omitempty"` 2926 2927 // Error: The error result of the operation in case of failure or 2928 // cancellation. 2929 Error *Status `json:"error,omitempty"` 2930 2931 // Metadata: Service-specific metadata associated with the operation. It 2932 // typically contains progress information and common metadata such as 2933 // create time. Some services might not provide such metadata. Any 2934 // method that returns a long-running operation should document the 2935 // metadata type, if any. 2936 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 2937 2938 // Name: The server-assigned name, which is only unique within the same 2939 // service that originally returns it. If you use the default HTTP 2940 // mapping, the name should be a resource name ending with 2941 // operations/{unique_id}. 2942 Name string `json:"name,omitempty"` 2943 2944 // Response: The normal response of the operation in case of success. If 2945 // the original method returns no data on success, such as Delete, the 2946 // response is google.protobuf.Empty. If the original method is standard 2947 // Get/Create/Update, the response should be the resource. For other 2948 // methods, the response should have the type XxxResponse, where Xxx is 2949 // the original method name. For example, if the original method name is 2950 // TakeSnapshot(), the inferred response type is TakeSnapshotResponse. 2951 Response googleapi.RawMessage `json:"response,omitempty"` 2952 2953 // ServerResponse contains the HTTP response code and headers from the 2954 // server. 2955 googleapi.ServerResponse `json:"-"` 2956 2957 // ForceSendFields is a list of field names (e.g. "Done") to 2958 // unconditionally include in API requests. By default, fields with 2959 // empty values are omitted from API requests. However, any non-pointer, 2960 // non-interface field appearing in ForceSendFields will be sent to the 2961 // server regardless of whether the field is empty or not. This may be 2962 // used to include empty fields in Patch requests. 2963 ForceSendFields []string `json:"-"` 2964 2965 // NullFields is a list of field names (e.g. "Done") to include in API 2966 // requests with the JSON null value. By default, fields with empty 2967 // values are omitted from API requests. However, any field with an 2968 // empty value appearing in NullFields will be sent to the server as 2969 // null. It is an error if a field in this list has a non-empty value. 2970 // This may be used to include null fields in Patch requests. 2971 NullFields []string `json:"-"` 2972} 2973 2974func (s *Operation) MarshalJSON() ([]byte, error) { 2975 type NoMethod Operation 2976 raw := NoMethod(*s) 2977 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2978} 2979 2980// OrderedJob: A job executed by the workflow. 2981type OrderedJob struct { 2982 // HadoopJob: Optional. Job is a Hadoop job. 2983 HadoopJob *HadoopJob `json:"hadoopJob,omitempty"` 2984 2985 // HiveJob: Optional. Job is a Hive job. 2986 HiveJob *HiveJob `json:"hiveJob,omitempty"` 2987 2988 // Labels: Optional. The labels to associate with this job.Label keys 2989 // must be between 1 and 63 characters long, and must conform to the 2990 // following regular expression: \p{Ll}\p{Lo}{0,62}Label values must be 2991 // between 1 and 63 characters long, and must conform to the following 2992 // regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels 2993 // can be associated with a given job. 2994 Labels map[string]string `json:"labels,omitempty"` 2995 2996 // PigJob: Optional. Job is a Pig job. 2997 PigJob *PigJob `json:"pigJob,omitempty"` 2998 2999 // PrerequisiteStepIds: Optional. The optional list of prerequisite job 3000 // step_ids. If not specified, the job will start at the beginning of 3001 // workflow. 3002 PrerequisiteStepIds []string `json:"prerequisiteStepIds,omitempty"` 3003 3004 // PrestoJob: Optional. Job is a Presto job. 3005 PrestoJob *PrestoJob `json:"prestoJob,omitempty"` 3006 3007 // PysparkJob: Optional. Job is a PySpark job. 3008 PysparkJob *PySparkJob `json:"pysparkJob,omitempty"` 3009 3010 // Scheduling: Optional. Job scheduling configuration. 3011 Scheduling *JobScheduling `json:"scheduling,omitempty"` 3012 3013 // SparkJob: Optional. Job is a Spark job. 3014 SparkJob *SparkJob `json:"sparkJob,omitempty"` 3015 3016 // SparkRJob: Optional. Job is a SparkR job. 3017 SparkRJob *SparkRJob `json:"sparkRJob,omitempty"` 3018 3019 // SparkSqlJob: Optional. Job is a SparkSql job. 3020 SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"` 3021 3022 // StepId: Required. The step id. The id must be unique among all jobs 3023 // within the template.The step id is used as prefix for job id, as job 3024 // goog-dataproc-workflow-step-id label, and in prerequisiteStepIds 3025 // field from other steps.The id must contain only letters (a-z, A-Z), 3026 // numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end 3027 // with underscore or hyphen. Must consist of between 3 and 50 3028 // characters. 3029 StepId string `json:"stepId,omitempty"` 3030 3031 // ForceSendFields is a list of field names (e.g. "HadoopJob") to 3032 // unconditionally include in API requests. By default, fields with 3033 // empty values are omitted from API requests. However, any non-pointer, 3034 // non-interface field appearing in ForceSendFields will be sent to the 3035 // server regardless of whether the field is empty or not. This may be 3036 // used to include empty fields in Patch requests. 3037 ForceSendFields []string `json:"-"` 3038 3039 // NullFields is a list of field names (e.g. "HadoopJob") to include in 3040 // API requests with the JSON null value. By default, fields with empty 3041 // values are omitted from API requests. However, any field with an 3042 // empty value appearing in NullFields will be sent to the server as 3043 // null. It is an error if a field in this list has a non-empty value. 3044 // This may be used to include null fields in Patch requests. 3045 NullFields []string `json:"-"` 3046} 3047 3048func (s *OrderedJob) MarshalJSON() ([]byte, error) { 3049 type NoMethod OrderedJob 3050 raw := NoMethod(*s) 3051 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3052} 3053 3054// ParameterValidation: Configuration for parameter validation. 3055type ParameterValidation struct { 3056 // Regex: Validation based on regular expressions. 3057 Regex *RegexValidation `json:"regex,omitempty"` 3058 3059 // Values: Validation based on a list of allowed values. 3060 Values *ValueValidation `json:"values,omitempty"` 3061 3062 // ForceSendFields is a list of field names (e.g. "Regex") to 3063 // unconditionally include in API requests. By default, fields with 3064 // empty values are omitted from API requests. However, any non-pointer, 3065 // non-interface field appearing in ForceSendFields will be sent to the 3066 // server regardless of whether the field is empty or not. This may be 3067 // used to include empty fields in Patch requests. 3068 ForceSendFields []string `json:"-"` 3069 3070 // NullFields is a list of field names (e.g. "Regex") to include in API 3071 // requests with the JSON null value. By default, fields with empty 3072 // values are omitted from API requests. However, any field with an 3073 // empty value appearing in NullFields will be sent to the server as 3074 // null. It is an error if a field in this list has a non-empty value. 3075 // This may be used to include null fields in Patch requests. 3076 NullFields []string `json:"-"` 3077} 3078 3079func (s *ParameterValidation) MarshalJSON() ([]byte, error) { 3080 type NoMethod ParameterValidation 3081 raw := NoMethod(*s) 3082 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3083} 3084 3085// PigJob: A Dataproc job for running Apache Pig 3086// (https://pig.apache.org/) queries on YARN. 3087type PigJob struct { 3088 // ContinueOnFailure: Optional. Whether to continue executing queries if 3089 // a query fails. The default value is false. Setting to true can be 3090 // useful when executing independent parallel queries. 3091 ContinueOnFailure bool `json:"continueOnFailure,omitempty"` 3092 3093 // JarFileUris: Optional. HCFS URIs of jar files to add to the CLASSPATH 3094 // of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig 3095 // UDFs. 3096 JarFileUris []string `json:"jarFileUris,omitempty"` 3097 3098 // LoggingConfig: Optional. The runtime log config for job execution. 3099 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3100 3101 // Properties: Optional. A mapping of property names to values, used to 3102 // configure Pig. Properties that conflict with values set by the 3103 // Dataproc API may be overwritten. Can include properties set in 3104 // /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and 3105 // classes in user code. 3106 Properties map[string]string `json:"properties,omitempty"` 3107 3108 // QueryFileUri: The HCFS URI of the script that contains the Pig 3109 // queries. 3110 QueryFileUri string `json:"queryFileUri,omitempty"` 3111 3112 // QueryList: A list of queries. 3113 QueryList *QueryList `json:"queryList,omitempty"` 3114 3115 // ScriptVariables: Optional. Mapping of query variable names to values 3116 // (equivalent to the Pig command: name=[value]). 3117 ScriptVariables map[string]string `json:"scriptVariables,omitempty"` 3118 3119 // ForceSendFields is a list of field names (e.g. "ContinueOnFailure") 3120 // to unconditionally include in API requests. By default, fields with 3121 // empty values are omitted from API requests. However, any non-pointer, 3122 // non-interface field appearing in ForceSendFields will be sent to the 3123 // server regardless of whether the field is empty or not. This may be 3124 // used to include empty fields in Patch requests. 3125 ForceSendFields []string `json:"-"` 3126 3127 // NullFields is a list of field names (e.g. "ContinueOnFailure") to 3128 // include in API requests with the JSON null value. By default, fields 3129 // with empty values are omitted from API requests. However, any field 3130 // with an empty value appearing in NullFields will be sent to the 3131 // server as null. It is an error if a field in this list has a 3132 // non-empty value. This may be used to include null fields in Patch 3133 // requests. 3134 NullFields []string `json:"-"` 3135} 3136 3137func (s *PigJob) MarshalJSON() ([]byte, error) { 3138 type NoMethod PigJob 3139 raw := NoMethod(*s) 3140 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3141} 3142 3143// Policy: An Identity and Access Management (IAM) policy, which 3144// specifies access controls for Google Cloud resources.A Policy is a 3145// collection of bindings. A binding binds one or more members to a 3146// single role. Members can be user accounts, service accounts, Google 3147// groups, and domains (such as G Suite). A role is a named list of 3148// permissions; each role can be an IAM predefined role or a 3149// user-created custom role.For some types of Google Cloud resources, a 3150// binding can also specify a condition, which is a logical expression 3151// that allows access to a resource only if the expression evaluates to 3152// true. A condition can add constraints based on attributes of the 3153// request, the resource, or both. To learn which resources support 3154// conditions in their IAM policies, see the IAM documentation 3155// (https://cloud.google.com/iam/help/conditions/resource-policies).JSON 3156// example: { "bindings": [ { "role": 3157// "roles/resourcemanager.organizationAdmin", "members": [ 3158// "user:mike@example.com", "group:admins@example.com", 3159// "domain:google.com", 3160// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { 3161// "role": "roles/resourcemanager.organizationViewer", "members": [ 3162// "user:eve@example.com" ], "condition": { "title": "expirable access", 3163// "description": "Does not grant access after Sep 2020", "expression": 3164// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], 3165// "etag": "BwWWja0YfJA=", "version": 3 } YAML example: bindings: - 3166// members: - user:mike@example.com - group:admins@example.com - 3167// domain:google.com - 3168// serviceAccount:my-project-id@appspot.gserviceaccount.com role: 3169// roles/resourcemanager.organizationAdmin - members: - 3170// user:eve@example.com role: roles/resourcemanager.organizationViewer 3171// condition: title: expirable access description: Does not grant access 3172// after Sep 2020 expression: request.time < 3173// timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3174// 3 For a description of IAM and its features, see the IAM 3175// documentation (https://cloud.google.com/iam/docs/). 3176type Policy struct { 3177 // Bindings: Associates a list of members to a role. Optionally, may 3178 // specify a condition that determines how and when the bindings are 3179 // applied. Each of the bindings must contain at least one member. 3180 Bindings []*Binding `json:"bindings,omitempty"` 3181 3182 // Etag: etag is used for optimistic concurrency control as a way to 3183 // help prevent simultaneous updates of a policy from overwriting each 3184 // other. It is strongly suggested that systems make use of the etag in 3185 // the read-modify-write cycle to perform policy updates in order to 3186 // avoid race conditions: An etag is returned in the response to 3187 // getIamPolicy, and systems are expected to put that etag in the 3188 // request to setIamPolicy to ensure that their change will be applied 3189 // to the same version of the policy.Important: If you use IAM 3190 // Conditions, you must include the etag field whenever you call 3191 // setIamPolicy. If you omit this field, then IAM allows you to 3192 // overwrite a version 3 policy with a version 1 policy, and all of the 3193 // conditions in the version 3 policy are lost. 3194 Etag string `json:"etag,omitempty"` 3195 3196 // Version: Specifies the format of the policy.Valid values are 0, 1, 3197 // and 3. Requests that specify an invalid value are rejected.Any 3198 // operation that affects conditional role bindings must specify version 3199 // 3. This requirement applies to the following operations: Getting a 3200 // policy that includes a conditional role binding Adding a conditional 3201 // role binding to a policy Changing a conditional role binding in a 3202 // policy Removing any role binding, with or without a condition, from a 3203 // policy that includes conditionsImportant: If you use IAM Conditions, 3204 // you must include the etag field whenever you call setIamPolicy. If 3205 // you omit this field, then IAM allows you to overwrite a version 3 3206 // policy with a version 1 policy, and all of the conditions in the 3207 // version 3 policy are lost.If a policy does not include any 3208 // conditions, operations on that policy may specify any valid version 3209 // or leave the field unset.To learn which resources support conditions 3210 // in their IAM policies, see the IAM documentation 3211 // (https://cloud.google.com/iam/help/conditions/resource-policies). 3212 Version int64 `json:"version,omitempty"` 3213 3214 // ServerResponse contains the HTTP response code and headers from the 3215 // server. 3216 googleapi.ServerResponse `json:"-"` 3217 3218 // ForceSendFields is a list of field names (e.g. "Bindings") to 3219 // unconditionally include in API requests. By default, fields with 3220 // empty values are omitted from API requests. However, any non-pointer, 3221 // non-interface field appearing in ForceSendFields will be sent to the 3222 // server regardless of whether the field is empty or not. This may be 3223 // used to include empty fields in Patch requests. 3224 ForceSendFields []string `json:"-"` 3225 3226 // NullFields is a list of field names (e.g. "Bindings") to include in 3227 // API requests with the JSON null value. By default, fields with empty 3228 // values are omitted from API requests. However, any field with an 3229 // empty value appearing in NullFields will be sent to the server as 3230 // null. It is an error if a field in this list has a non-empty value. 3231 // This may be used to include null fields in Patch requests. 3232 NullFields []string `json:"-"` 3233} 3234 3235func (s *Policy) MarshalJSON() ([]byte, error) { 3236 type NoMethod Policy 3237 raw := NoMethod(*s) 3238 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3239} 3240 3241// PrestoJob: A Dataproc job for running Presto (https://prestosql.io/) 3242// queries. IMPORTANT: The Dataproc Presto Optional Component 3243// (https://cloud.google.com/dataproc/docs/concepts/components/presto) 3244// must be enabled when the cluster is created to submit a Presto job to 3245// the cluster. 3246type PrestoJob struct { 3247 // ClientTags: Optional. Presto client tags to attach to this query 3248 ClientTags []string `json:"clientTags,omitempty"` 3249 3250 // ContinueOnFailure: Optional. Whether to continue executing queries if 3251 // a query fails. The default value is false. Setting to true can be 3252 // useful when executing independent parallel queries. 3253 ContinueOnFailure bool `json:"continueOnFailure,omitempty"` 3254 3255 // LoggingConfig: Optional. The runtime log config for job execution. 3256 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3257 3258 // OutputFormat: Optional. The format in which query output will be 3259 // displayed. See the Presto documentation for supported output formats 3260 OutputFormat string `json:"outputFormat,omitempty"` 3261 3262 // Properties: Optional. A mapping of property names to values. Used to 3263 // set Presto session properties 3264 // (https://prestodb.io/docs/current/sql/set-session.html) Equivalent to 3265 // using the --session flag in the Presto CLI 3266 Properties map[string]string `json:"properties,omitempty"` 3267 3268 // QueryFileUri: The HCFS URI of the script that contains SQL queries. 3269 QueryFileUri string `json:"queryFileUri,omitempty"` 3270 3271 // QueryList: A list of queries. 3272 QueryList *QueryList `json:"queryList,omitempty"` 3273 3274 // ForceSendFields is a list of field names (e.g. "ClientTags") to 3275 // unconditionally include in API requests. By default, fields with 3276 // empty values are omitted from API requests. However, any non-pointer, 3277 // non-interface field appearing in ForceSendFields will be sent to the 3278 // server regardless of whether the field is empty or not. This may be 3279 // used to include empty fields in Patch requests. 3280 ForceSendFields []string `json:"-"` 3281 3282 // NullFields is a list of field names (e.g. "ClientTags") to include in 3283 // API requests with the JSON null value. By default, fields with empty 3284 // values are omitted from API requests. However, any field with an 3285 // empty value appearing in NullFields will be sent to the server as 3286 // null. It is an error if a field in this list has a non-empty value. 3287 // This may be used to include null fields in Patch requests. 3288 NullFields []string `json:"-"` 3289} 3290 3291func (s *PrestoJob) MarshalJSON() ([]byte, error) { 3292 type NoMethod PrestoJob 3293 raw := NoMethod(*s) 3294 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3295} 3296 3297// PySparkJob: A Dataproc job for running Apache PySpark 3298// (https://spark.apache.org/docs/0.9.0/python-programming-guide.html) 3299// applications on YARN. 3300type PySparkJob struct { 3301 // ArchiveUris: Optional. HCFS URIs of archives to be extracted into the 3302 // working directory of each executor. Supported file types: .jar, .tar, 3303 // .tar.gz, .tgz, and .zip. 3304 ArchiveUris []string `json:"archiveUris,omitempty"` 3305 3306 // Args: Optional. The arguments to pass to the driver. Do not include 3307 // arguments, such as --conf, that can be set as job properties, since a 3308 // collision may occur that causes an incorrect job submission. 3309 Args []string `json:"args,omitempty"` 3310 3311 // FileUris: Optional. HCFS URIs of files to be placed in the working 3312 // directory of each executor. Useful for naively parallel tasks. 3313 FileUris []string `json:"fileUris,omitempty"` 3314 3315 // JarFileUris: Optional. HCFS URIs of jar files to add to the 3316 // CLASSPATHs of the Python driver and tasks. 3317 JarFileUris []string `json:"jarFileUris,omitempty"` 3318 3319 // LoggingConfig: Optional. The runtime log config for job execution. 3320 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3321 3322 // MainPythonFileUri: Required. The HCFS URI of the main Python file to 3323 // use as the driver. Must be a .py file. 3324 MainPythonFileUri string `json:"mainPythonFileUri,omitempty"` 3325 3326 // Properties: Optional. A mapping of property names to values, used to 3327 // configure PySpark. Properties that conflict with values set by the 3328 // Dataproc API may be overwritten. Can include properties set in 3329 // /etc/spark/conf/spark-defaults.conf and classes in user code. 3330 Properties map[string]string `json:"properties,omitempty"` 3331 3332 // PythonFileUris: Optional. HCFS file URIs of Python files to pass to 3333 // the PySpark framework. Supported file types: .py, .egg, and .zip. 3334 PythonFileUris []string `json:"pythonFileUris,omitempty"` 3335 3336 // ForceSendFields is a list of field names (e.g. "ArchiveUris") to 3337 // unconditionally include in API requests. By default, fields with 3338 // empty values are omitted from API requests. However, any non-pointer, 3339 // non-interface field appearing in ForceSendFields will be sent to the 3340 // server regardless of whether the field is empty or not. This may be 3341 // used to include empty fields in Patch requests. 3342 ForceSendFields []string `json:"-"` 3343 3344 // NullFields is a list of field names (e.g. "ArchiveUris") to include 3345 // in API requests with the JSON null value. By default, fields with 3346 // empty values are omitted from API requests. However, any field with 3347 // an empty value appearing in NullFields will be sent to the server as 3348 // null. It is an error if a field in this list has a non-empty value. 3349 // This may be used to include null fields in Patch requests. 3350 NullFields []string `json:"-"` 3351} 3352 3353func (s *PySparkJob) MarshalJSON() ([]byte, error) { 3354 type NoMethod PySparkJob 3355 raw := NoMethod(*s) 3356 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3357} 3358 3359// QueryList: A list of queries to run on a cluster. 3360type QueryList struct { 3361 // Queries: Required. The queries to execute. You do not need to end a 3362 // query expression with a semicolon. Multiple queries can be specified 3363 // in one string by separating each with a semicolon. Here is an example 3364 // of a Dataproc API snippet that uses a QueryList to specify a HiveJob: 3365 // "hiveJob": { "queryList": { "queries": [ "query1", "query2", 3366 // "query3;query4", ] } } 3367 Queries []string `json:"queries,omitempty"` 3368 3369 // ForceSendFields is a list of field names (e.g. "Queries") to 3370 // unconditionally include in API requests. By default, fields with 3371 // empty values are omitted from API requests. However, any non-pointer, 3372 // non-interface field appearing in ForceSendFields will be sent to the 3373 // server regardless of whether the field is empty or not. This may be 3374 // used to include empty fields in Patch requests. 3375 ForceSendFields []string `json:"-"` 3376 3377 // NullFields is a list of field names (e.g. "Queries") to include in 3378 // API requests with the JSON null value. By default, fields with empty 3379 // values are omitted from API requests. However, any field with an 3380 // empty value appearing in NullFields will be sent to the server as 3381 // null. It is an error if a field in this list has a non-empty value. 3382 // This may be used to include null fields in Patch requests. 3383 NullFields []string `json:"-"` 3384} 3385 3386func (s *QueryList) MarshalJSON() ([]byte, error) { 3387 type NoMethod QueryList 3388 raw := NoMethod(*s) 3389 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3390} 3391 3392// RegexValidation: Validation based on regular expressions. 3393type RegexValidation struct { 3394 // Regexes: Required. RE2 regular expressions used to validate the 3395 // parameter's value. The value must match the regex in its entirety 3396 // (substring matches are not sufficient). 3397 Regexes []string `json:"regexes,omitempty"` 3398 3399 // ForceSendFields is a list of field names (e.g. "Regexes") to 3400 // unconditionally include in API requests. By default, fields with 3401 // empty values are omitted from API requests. However, any non-pointer, 3402 // non-interface field appearing in ForceSendFields will be sent to the 3403 // server regardless of whether the field is empty or not. This may be 3404 // used to include empty fields in Patch requests. 3405 ForceSendFields []string `json:"-"` 3406 3407 // NullFields is a list of field names (e.g. "Regexes") to include in 3408 // API requests with the JSON null value. By default, fields with empty 3409 // values are omitted from API requests. However, any field with an 3410 // empty value appearing in NullFields will be sent to the server as 3411 // null. It is an error if a field in this list has a non-empty value. 3412 // This may be used to include null fields in Patch requests. 3413 NullFields []string `json:"-"` 3414} 3415 3416func (s *RegexValidation) MarshalJSON() ([]byte, error) { 3417 type NoMethod RegexValidation 3418 raw := NoMethod(*s) 3419 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3420} 3421 3422// RepairClusterRequest: A request to repair a cluster. 3423type RepairClusterRequest struct { 3424 // ClusterUuid: Optional. Specifying the cluster_uuid means the RPC will 3425 // fail (with error NOT_FOUND) if a cluster with the specified UUID does 3426 // not exist. 3427 ClusterUuid string `json:"clusterUuid,omitempty"` 3428 3429 // RequestId: Optional. A unique ID used to identify the request. If the 3430 // server receives two RepairClusterRequests with the same ID, the 3431 // second request is ignored, and the first google.longrunning.Operation 3432 // created and stored in the backend is returned.Recommendation: Set 3433 // this value to a UUID 3434 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The ID 3435 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 3436 // and hyphens (-). The maximum length is 40 characters. 3437 RequestId string `json:"requestId,omitempty"` 3438 3439 // ForceSendFields is a list of field names (e.g. "ClusterUuid") to 3440 // unconditionally include in API requests. By default, fields with 3441 // empty values are omitted from API requests. However, any non-pointer, 3442 // non-interface field appearing in ForceSendFields will be sent to the 3443 // server regardless of whether the field is empty or not. This may be 3444 // used to include empty fields in Patch requests. 3445 ForceSendFields []string `json:"-"` 3446 3447 // NullFields is a list of field names (e.g. "ClusterUuid") to include 3448 // in API requests with the JSON null value. By default, fields with 3449 // empty values are omitted from API requests. However, any field with 3450 // an empty value appearing in NullFields will be sent to the server as 3451 // null. It is an error if a field in this list has a non-empty value. 3452 // This may be used to include null fields in Patch requests. 3453 NullFields []string `json:"-"` 3454} 3455 3456func (s *RepairClusterRequest) MarshalJSON() ([]byte, error) { 3457 type NoMethod RepairClusterRequest 3458 raw := NoMethod(*s) 3459 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3460} 3461 3462// ReservationAffinity: Reservation Affinity for consuming Zonal 3463// reservation. 3464type ReservationAffinity struct { 3465 // ConsumeReservationType: Optional. Type of reservation to consume 3466 // 3467 // Possible values: 3468 // "TYPE_UNSPECIFIED" 3469 // "NO_RESERVATION" - Do not consume from any allocated capacity. 3470 // "ANY_RESERVATION" - Consume any reservation available. 3471 // "SPECIFIC_RESERVATION" - Must consume from a specific reservation. 3472 // Must specify key value fields for specifying the reservations. 3473 ConsumeReservationType string `json:"consumeReservationType,omitempty"` 3474 3475 // Key: Optional. Corresponds to the label key of reservation resource. 3476 Key string `json:"key,omitempty"` 3477 3478 // Values: Optional. Corresponds to the label values of reservation 3479 // resource. 3480 Values []string `json:"values,omitempty"` 3481 3482 // ForceSendFields is a list of field names (e.g. 3483 // "ConsumeReservationType") to unconditionally include in API requests. 3484 // By default, fields with empty values are omitted from API requests. 3485 // However, any non-pointer, non-interface field appearing in 3486 // ForceSendFields will be sent to the server regardless of whether the 3487 // field is empty or not. This may be used to include empty fields in 3488 // Patch requests. 3489 ForceSendFields []string `json:"-"` 3490 3491 // NullFields is a list of field names (e.g. "ConsumeReservationType") 3492 // to include in API requests with the JSON null value. By default, 3493 // fields with empty values are omitted from API requests. However, any 3494 // field with an empty value appearing in NullFields will be sent to the 3495 // server as null. It is an error if a field in this list has a 3496 // non-empty value. This may be used to include null fields in Patch 3497 // requests. 3498 NullFields []string `json:"-"` 3499} 3500 3501func (s *ReservationAffinity) MarshalJSON() ([]byte, error) { 3502 type NoMethod ReservationAffinity 3503 raw := NoMethod(*s) 3504 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3505} 3506 3507// SecurityConfig: Security related configuration, including encryption, 3508// Kerberos, etc. 3509type SecurityConfig struct { 3510 // IdentityConfig: Optional. Identity related configuration, including 3511 // service account based secure multi-tenancy user mappings. 3512 IdentityConfig *IdentityConfig `json:"identityConfig,omitempty"` 3513 3514 // KerberosConfig: Optional. Kerberos related configuration. 3515 KerberosConfig *KerberosConfig `json:"kerberosConfig,omitempty"` 3516 3517 // ForceSendFields is a list of field names (e.g. "IdentityConfig") to 3518 // unconditionally include in API requests. By default, fields with 3519 // empty values are omitted from API requests. However, any non-pointer, 3520 // non-interface field appearing in ForceSendFields will be sent to the 3521 // server regardless of whether the field is empty or not. This may be 3522 // used to include empty fields in Patch requests. 3523 ForceSendFields []string `json:"-"` 3524 3525 // NullFields is a list of field names (e.g. "IdentityConfig") to 3526 // include in API requests with the JSON null value. By default, fields 3527 // with empty values are omitted from API requests. However, any field 3528 // with an empty value appearing in NullFields will be sent to the 3529 // server as null. It is an error if a field in this list has a 3530 // non-empty value. This may be used to include null fields in Patch 3531 // requests. 3532 NullFields []string `json:"-"` 3533} 3534 3535func (s *SecurityConfig) MarshalJSON() ([]byte, error) { 3536 type NoMethod SecurityConfig 3537 raw := NoMethod(*s) 3538 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3539} 3540 3541// SetIamPolicyRequest: Request message for SetIamPolicy method. 3542type SetIamPolicyRequest struct { 3543 // Policy: REQUIRED: The complete policy to be applied to the resource. 3544 // The size of the policy is limited to a few 10s of KB. An empty policy 3545 // is a valid policy but certain Cloud Platform services (such as 3546 // Projects) might reject them. 3547 Policy *Policy `json:"policy,omitempty"` 3548 3549 // ForceSendFields is a list of field names (e.g. "Policy") to 3550 // unconditionally include in API requests. By default, fields with 3551 // empty values are omitted from API requests. However, any non-pointer, 3552 // non-interface field appearing in ForceSendFields will be sent to the 3553 // server regardless of whether the field is empty or not. This may be 3554 // used to include empty fields in Patch requests. 3555 ForceSendFields []string `json:"-"` 3556 3557 // NullFields is a list of field names (e.g. "Policy") to include in API 3558 // requests with the JSON null value. By default, fields with empty 3559 // values are omitted from API requests. However, any field with an 3560 // empty value appearing in NullFields will be sent to the server as 3561 // null. It is an error if a field in this list has a non-empty value. 3562 // This may be used to include null fields in Patch requests. 3563 NullFields []string `json:"-"` 3564} 3565 3566func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 3567 type NoMethod SetIamPolicyRequest 3568 raw := NoMethod(*s) 3569 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3570} 3571 3572// ShieldedInstanceConfig: Shielded Instance Config for clusters using 3573// Compute Engine Shielded VMs 3574// (https://cloud.google.com/security/shielded-cloud/shielded-vm). 3575type ShieldedInstanceConfig struct { 3576 // EnableIntegrityMonitoring: Optional. Defines whether instances have 3577 // integrity monitoring enabled. 3578 EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"` 3579 3580 // EnableSecureBoot: Optional. Defines whether instances have Secure 3581 // Boot enabled. 3582 EnableSecureBoot bool `json:"enableSecureBoot,omitempty"` 3583 3584 // EnableVtpm: Optional. Defines whether instances have the vTPM 3585 // enabled. 3586 EnableVtpm bool `json:"enableVtpm,omitempty"` 3587 3588 // ForceSendFields is a list of field names (e.g. 3589 // "EnableIntegrityMonitoring") to unconditionally include in API 3590 // requests. By default, fields with empty values are omitted from API 3591 // requests. However, any non-pointer, non-interface field appearing in 3592 // ForceSendFields will be sent to the server regardless of whether the 3593 // field is empty or not. This may be used to include empty fields in 3594 // Patch requests. 3595 ForceSendFields []string `json:"-"` 3596 3597 // NullFields is a list of field names (e.g. 3598 // "EnableIntegrityMonitoring") to include in API requests with the JSON 3599 // null value. By default, fields with empty values are omitted from API 3600 // requests. However, any field with an empty value appearing in 3601 // NullFields will be sent to the server as null. It is an error if a 3602 // field in this list has a non-empty value. This may be used to include 3603 // null fields in Patch requests. 3604 NullFields []string `json:"-"` 3605} 3606 3607func (s *ShieldedInstanceConfig) MarshalJSON() ([]byte, error) { 3608 type NoMethod ShieldedInstanceConfig 3609 raw := NoMethod(*s) 3610 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3611} 3612 3613// SoftwareConfig: Specifies the selection and config of software inside 3614// the cluster. 3615type SoftwareConfig struct { 3616 // ImageVersion: Optional. The version of software inside the cluster. 3617 // It must be one of the supported Dataproc Versions 3618 // (https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#supported_dataproc_versions), 3619 // such as "1.2" (including a subminor version, such as "1.2.29"), or 3620 // the "preview" version 3621 // (https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#other_versions). 3622 // If unspecified, it defaults to the latest Debian version. 3623 ImageVersion string `json:"imageVersion,omitempty"` 3624 3625 // OptionalComponents: Optional. The set of components to activate on 3626 // the cluster. 3627 // 3628 // Possible values: 3629 // "COMPONENT_UNSPECIFIED" - Unspecified component. Specifying this 3630 // will cause Cluster creation to fail. 3631 // "ANACONDA" - The Anaconda python distribution. The Anaconda 3632 // component is not supported in the Dataproc 2.0 image. The 2.0 image 3633 // is pre-installed with Miniconda. 3634 // "DOCKER" - Docker 3635 // "DRUID" - The Druid query engine. (alpha) 3636 // "FLINK" - Flink 3637 // "HBASE" - HBase. (beta) 3638 // "HIVE_WEBHCAT" - The Hive Web HCatalog (the REST service for 3639 // accessing HCatalog). 3640 // "JUPYTER" - The Jupyter Notebook. 3641 // "PRESTO" - The Presto query engine. 3642 // "RANGER" - The Ranger service. 3643 // "SOLR" - The Solr service. 3644 // "ZEPPELIN" - The Zeppelin notebook. 3645 // "ZOOKEEPER" - The Zookeeper service. 3646 OptionalComponents []string `json:"optionalComponents,omitempty"` 3647 3648 // Properties: Optional. The properties to set on daemon config 3649 // files.Property keys are specified in prefix:property format, for 3650 // example core:hadoop.tmp.dir. The following are supported prefixes and 3651 // their mappings: capacity-scheduler: capacity-scheduler.xml core: 3652 // core-site.xml distcp: distcp-default.xml hdfs: hdfs-site.xml hive: 3653 // hive-site.xml mapred: mapred-site.xml pig: pig.properties spark: 3654 // spark-defaults.conf yarn: yarn-site.xmlFor more information, see 3655 // Cluster properties 3656 // (https://cloud.google.com/dataproc/docs/concepts/cluster-properties). 3657 Properties map[string]string `json:"properties,omitempty"` 3658 3659 // ForceSendFields is a list of field names (e.g. "ImageVersion") to 3660 // unconditionally include in API requests. By default, fields with 3661 // empty values are omitted from API requests. However, any non-pointer, 3662 // non-interface field appearing in ForceSendFields will be sent to the 3663 // server regardless of whether the field is empty or not. This may be 3664 // used to include empty fields in Patch requests. 3665 ForceSendFields []string `json:"-"` 3666 3667 // NullFields is a list of field names (e.g. "ImageVersion") to include 3668 // in API requests with the JSON null value. By default, fields with 3669 // empty values are omitted from API requests. However, any field with 3670 // an empty value appearing in NullFields will be sent to the server as 3671 // null. It is an error if a field in this list has a non-empty value. 3672 // This may be used to include null fields in Patch requests. 3673 NullFields []string `json:"-"` 3674} 3675 3676func (s *SoftwareConfig) MarshalJSON() ([]byte, error) { 3677 type NoMethod SoftwareConfig 3678 raw := NoMethod(*s) 3679 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3680} 3681 3682// SparkJob: A Dataproc job for running Apache Spark 3683// (http://spark.apache.org/) applications on YARN. 3684type SparkJob struct { 3685 // ArchiveUris: Optional. HCFS URIs of archives to be extracted into the 3686 // working directory of each executor. Supported file types: .jar, .tar, 3687 // .tar.gz, .tgz, and .zip. 3688 ArchiveUris []string `json:"archiveUris,omitempty"` 3689 3690 // Args: Optional. The arguments to pass to the driver. Do not include 3691 // arguments, such as --conf, that can be set as job properties, since a 3692 // collision may occur that causes an incorrect job submission. 3693 Args []string `json:"args,omitempty"` 3694 3695 // FileUris: Optional. HCFS URIs of files to be placed in the working 3696 // directory of each executor. Useful for naively parallel tasks. 3697 FileUris []string `json:"fileUris,omitempty"` 3698 3699 // JarFileUris: Optional. HCFS URIs of jar files to add to the 3700 // CLASSPATHs of the Spark driver and tasks. 3701 JarFileUris []string `json:"jarFileUris,omitempty"` 3702 3703 // LoggingConfig: Optional. The runtime log config for job execution. 3704 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3705 3706 // MainClass: The name of the driver's main class. The jar file that 3707 // contains the class must be in the default CLASSPATH or specified in 3708 // jar_file_uris. 3709 MainClass string `json:"mainClass,omitempty"` 3710 3711 // MainJarFileUri: The HCFS URI of the jar file that contains the main 3712 // class. 3713 MainJarFileUri string `json:"mainJarFileUri,omitempty"` 3714 3715 // Properties: Optional. A mapping of property names to values, used to 3716 // configure Spark. Properties that conflict with values set by the 3717 // Dataproc API may be overwritten. Can include properties set in 3718 // /etc/spark/conf/spark-defaults.conf and classes in user code. 3719 Properties map[string]string `json:"properties,omitempty"` 3720 3721 // ForceSendFields is a list of field names (e.g. "ArchiveUris") to 3722 // unconditionally include in API requests. By default, fields with 3723 // empty values are omitted from API requests. However, any non-pointer, 3724 // non-interface field appearing in ForceSendFields will be sent to the 3725 // server regardless of whether the field is empty or not. This may be 3726 // used to include empty fields in Patch requests. 3727 ForceSendFields []string `json:"-"` 3728 3729 // NullFields is a list of field names (e.g. "ArchiveUris") to include 3730 // in API requests with the JSON null value. By default, fields with 3731 // empty values are omitted from API requests. However, any field with 3732 // an empty value appearing in NullFields will be sent to the server as 3733 // null. It is an error if a field in this list has a non-empty value. 3734 // This may be used to include null fields in Patch requests. 3735 NullFields []string `json:"-"` 3736} 3737 3738func (s *SparkJob) MarshalJSON() ([]byte, error) { 3739 type NoMethod SparkJob 3740 raw := NoMethod(*s) 3741 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3742} 3743 3744// SparkRJob: A Dataproc job for running Apache SparkR 3745// (https://spark.apache.org/docs/latest/sparkr.html) applications on 3746// YARN. 3747type SparkRJob struct { 3748 // ArchiveUris: Optional. HCFS URIs of archives to be extracted into the 3749 // working directory of each executor. Supported file types: .jar, .tar, 3750 // .tar.gz, .tgz, and .zip. 3751 ArchiveUris []string `json:"archiveUris,omitempty"` 3752 3753 // Args: Optional. The arguments to pass to the driver. Do not include 3754 // arguments, such as --conf, that can be set as job properties, since a 3755 // collision may occur that causes an incorrect job submission. 3756 Args []string `json:"args,omitempty"` 3757 3758 // FileUris: Optional. HCFS URIs of files to be placed in the working 3759 // directory of each executor. Useful for naively parallel tasks. 3760 FileUris []string `json:"fileUris,omitempty"` 3761 3762 // LoggingConfig: Optional. The runtime log config for job execution. 3763 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3764 3765 // MainRFileUri: Required. The HCFS URI of the main R file to use as the 3766 // driver. Must be a .R file. 3767 MainRFileUri string `json:"mainRFileUri,omitempty"` 3768 3769 // Properties: Optional. A mapping of property names to values, used to 3770 // configure SparkR. Properties that conflict with values set by the 3771 // Dataproc API may be overwritten. Can include properties set in 3772 // /etc/spark/conf/spark-defaults.conf and classes in user code. 3773 Properties map[string]string `json:"properties,omitempty"` 3774 3775 // ForceSendFields is a list of field names (e.g. "ArchiveUris") to 3776 // unconditionally include in API requests. By default, fields with 3777 // empty values are omitted from API requests. However, any non-pointer, 3778 // non-interface field appearing in ForceSendFields will be sent to the 3779 // server regardless of whether the field is empty or not. This may be 3780 // used to include empty fields in Patch requests. 3781 ForceSendFields []string `json:"-"` 3782 3783 // NullFields is a list of field names (e.g. "ArchiveUris") to include 3784 // in API requests with the JSON null value. By default, fields with 3785 // empty values are omitted from API requests. However, any field with 3786 // an empty value appearing in NullFields will be sent to the server as 3787 // null. It is an error if a field in this list has a non-empty value. 3788 // This may be used to include null fields in Patch requests. 3789 NullFields []string `json:"-"` 3790} 3791 3792func (s *SparkRJob) MarshalJSON() ([]byte, error) { 3793 type NoMethod SparkRJob 3794 raw := NoMethod(*s) 3795 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3796} 3797 3798// SparkSqlJob: A Dataproc job for running Apache Spark SQL 3799// (http://spark.apache.org/sql/) queries. 3800type SparkSqlJob struct { 3801 // JarFileUris: Optional. HCFS URIs of jar files to be added to the 3802 // Spark CLASSPATH. 3803 JarFileUris []string `json:"jarFileUris,omitempty"` 3804 3805 // LoggingConfig: Optional. The runtime log config for job execution. 3806 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3807 3808 // Properties: Optional. A mapping of property names to values, used to 3809 // configure Spark SQL's SparkConf. Properties that conflict with values 3810 // set by the Dataproc API may be overwritten. 3811 Properties map[string]string `json:"properties,omitempty"` 3812 3813 // QueryFileUri: The HCFS URI of the script that contains SQL queries. 3814 QueryFileUri string `json:"queryFileUri,omitempty"` 3815 3816 // QueryList: A list of queries. 3817 QueryList *QueryList `json:"queryList,omitempty"` 3818 3819 // ScriptVariables: Optional. Mapping of query variable names to values 3820 // (equivalent to the Spark SQL command: SET name="value";). 3821 ScriptVariables map[string]string `json:"scriptVariables,omitempty"` 3822 3823 // ForceSendFields is a list of field names (e.g. "JarFileUris") to 3824 // unconditionally include in API requests. By default, fields with 3825 // empty values are omitted from API requests. However, any non-pointer, 3826 // non-interface field appearing in ForceSendFields will be sent to the 3827 // server regardless of whether the field is empty or not. This may be 3828 // used to include empty fields in Patch requests. 3829 ForceSendFields []string `json:"-"` 3830 3831 // NullFields is a list of field names (e.g. "JarFileUris") to include 3832 // in API requests with the JSON null value. By default, fields with 3833 // empty values are omitted from API requests. However, any field with 3834 // an empty value appearing in NullFields will be sent to the server as 3835 // null. It is an error if a field in this list has a non-empty value. 3836 // This may be used to include null fields in Patch requests. 3837 NullFields []string `json:"-"` 3838} 3839 3840func (s *SparkSqlJob) MarshalJSON() ([]byte, error) { 3841 type NoMethod SparkSqlJob 3842 raw := NoMethod(*s) 3843 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3844} 3845 3846// StartClusterRequest: A request to start a cluster. 3847type StartClusterRequest struct { 3848 // ClusterUuid: Optional. Specifying the cluster_uuid means the RPC will 3849 // fail (with error NOT_FOUND) if a cluster with the specified UUID does 3850 // not exist. 3851 ClusterUuid string `json:"clusterUuid,omitempty"` 3852 3853 // RequestId: Optional. A unique ID used to identify the request. If the 3854 // server receives two StartClusterRequest 3855 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StartClusterRequest)s 3856 // with the same id, then the second request will be ignored and the 3857 // first google.longrunning.Operation created and stored in the backend 3858 // is returned.Recommendation: Set this value to a UUID 3859 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The ID 3860 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 3861 // and hyphens (-). The maximum length is 40 characters. 3862 RequestId string `json:"requestId,omitempty"` 3863 3864 // ForceSendFields is a list of field names (e.g. "ClusterUuid") to 3865 // unconditionally include in API requests. By default, fields with 3866 // empty values are omitted from API requests. However, any non-pointer, 3867 // non-interface field appearing in ForceSendFields will be sent to the 3868 // server regardless of whether the field is empty or not. This may be 3869 // used to include empty fields in Patch requests. 3870 ForceSendFields []string `json:"-"` 3871 3872 // NullFields is a list of field names (e.g. "ClusterUuid") to include 3873 // in API requests with the JSON null value. By default, fields with 3874 // empty values are omitted from API requests. However, any field with 3875 // an empty value appearing in NullFields will be sent to the server as 3876 // null. It is an error if a field in this list has a non-empty value. 3877 // This may be used to include null fields in Patch requests. 3878 NullFields []string `json:"-"` 3879} 3880 3881func (s *StartClusterRequest) MarshalJSON() ([]byte, error) { 3882 type NoMethod StartClusterRequest 3883 raw := NoMethod(*s) 3884 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3885} 3886 3887// Status: The Status type defines a logical error model that is 3888// suitable for different programming environments, including REST APIs 3889// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 3890// Status message contains three pieces of data: error code, error 3891// message, and error details.You can find out more about this error 3892// model and how to work with it in the API Design Guide 3893// (https://cloud.google.com/apis/design/errors). 3894type Status struct { 3895 // Code: The status code, which should be an enum value of 3896 // google.rpc.Code. 3897 Code int64 `json:"code,omitempty"` 3898 3899 // Details: A list of messages that carry the error details. There is a 3900 // common set of message types for APIs to use. 3901 Details []googleapi.RawMessage `json:"details,omitempty"` 3902 3903 // Message: A developer-facing error message, which should be in 3904 // English. Any user-facing error message should be localized and sent 3905 // in the google.rpc.Status.details field, or localized by the client. 3906 Message string `json:"message,omitempty"` 3907 3908 // ForceSendFields is a list of field names (e.g. "Code") to 3909 // unconditionally include in API requests. By default, fields with 3910 // empty values are omitted from API requests. However, any non-pointer, 3911 // non-interface field appearing in ForceSendFields will be sent to the 3912 // server regardless of whether the field is empty or not. This may be 3913 // used to include empty fields in Patch requests. 3914 ForceSendFields []string `json:"-"` 3915 3916 // NullFields is a list of field names (e.g. "Code") to include in API 3917 // requests with the JSON null value. By default, fields with empty 3918 // values are omitted from API requests. However, any field with an 3919 // empty value appearing in NullFields will be sent to the server as 3920 // null. It is an error if a field in this list has a non-empty value. 3921 // This may be used to include null fields in Patch requests. 3922 NullFields []string `json:"-"` 3923} 3924 3925func (s *Status) MarshalJSON() ([]byte, error) { 3926 type NoMethod Status 3927 raw := NoMethod(*s) 3928 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3929} 3930 3931// StopClusterRequest: A request to stop a cluster. 3932type StopClusterRequest struct { 3933 // ClusterUuid: Optional. Specifying the cluster_uuid means the RPC will 3934 // fail (with error NOT_FOUND) if a cluster with the specified UUID does 3935 // not exist. 3936 ClusterUuid string `json:"clusterUuid,omitempty"` 3937 3938 // RequestId: Optional. A unique ID used to identify the request. If the 3939 // server receives two StopClusterRequest 3940 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.StopClusterRequest)s 3941 // with the same id, then the second request will be ignored and the 3942 // first google.longrunning.Operation created and stored in the backend 3943 // is returned.Recommendation: Set this value to a UUID 3944 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The ID 3945 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 3946 // and hyphens (-). The maximum length is 40 characters. 3947 RequestId string `json:"requestId,omitempty"` 3948 3949 // ForceSendFields is a list of field names (e.g. "ClusterUuid") to 3950 // unconditionally include in API requests. By default, fields with 3951 // empty values are omitted from API requests. However, any non-pointer, 3952 // non-interface field appearing in ForceSendFields will be sent to the 3953 // server regardless of whether the field is empty or not. This may be 3954 // used to include empty fields in Patch requests. 3955 ForceSendFields []string `json:"-"` 3956 3957 // NullFields is a list of field names (e.g. "ClusterUuid") to include 3958 // in API requests with the JSON null value. By default, fields with 3959 // empty values are omitted from API requests. However, any field with 3960 // an empty value appearing in NullFields will be sent to the server as 3961 // null. It is an error if a field in this list has a non-empty value. 3962 // This may be used to include null fields in Patch requests. 3963 NullFields []string `json:"-"` 3964} 3965 3966func (s *StopClusterRequest) MarshalJSON() ([]byte, error) { 3967 type NoMethod StopClusterRequest 3968 raw := NoMethod(*s) 3969 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3970} 3971 3972// SubmitJobRequest: A request to submit a job. 3973type SubmitJobRequest struct { 3974 // Job: Required. The job resource. 3975 Job *Job `json:"job,omitempty"` 3976 3977 // RequestId: Optional. A unique id used to identify the request. If the 3978 // server receives two SubmitJobRequest 3979 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.SubmitJobRequest)s 3980 // with the same id, then the second request will be ignored and the 3981 // first Job created and stored in the backend is returned.It is 3982 // recommended to always set this value to a UUID 3983 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id 3984 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 3985 // and hyphens (-). The maximum length is 40 characters. 3986 RequestId string `json:"requestId,omitempty"` 3987 3988 // ForceSendFields is a list of field names (e.g. "Job") to 3989 // unconditionally include in API requests. By default, fields with 3990 // empty values are omitted from API requests. However, any non-pointer, 3991 // non-interface field appearing in ForceSendFields will be sent to the 3992 // server regardless of whether the field is empty or not. This may be 3993 // used to include empty fields in Patch requests. 3994 ForceSendFields []string `json:"-"` 3995 3996 // NullFields is a list of field names (e.g. "Job") to include in API 3997 // requests with the JSON null value. By default, fields with empty 3998 // values are omitted from API requests. However, any field with an 3999 // empty value appearing in NullFields will be sent to the server as 4000 // null. It is an error if a field in this list has a non-empty value. 4001 // This may be used to include null fields in Patch requests. 4002 NullFields []string `json:"-"` 4003} 4004 4005func (s *SubmitJobRequest) MarshalJSON() ([]byte, error) { 4006 type NoMethod SubmitJobRequest 4007 raw := NoMethod(*s) 4008 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4009} 4010 4011// TemplateParameter: A configurable parameter that replaces one or more 4012// fields in the template. Parameterizable fields: - Labels - File uris 4013// - Job properties - Job arguments - Script variables - Main class (in 4014// HadoopJob and SparkJob) - Zone (in ClusterSelector) 4015type TemplateParameter struct { 4016 // Description: Optional. Brief description of the parameter. Must not 4017 // exceed 1024 characters. 4018 Description string `json:"description,omitempty"` 4019 4020 // Fields: Required. Paths to all fields that the parameter replaces. A 4021 // field is allowed to appear in at most one parameter's list of field 4022 // paths.A field path is similar in syntax to a 4023 // google.protobuf.FieldMask. For example, a field path that references 4024 // the zone field of a workflow template's cluster selector would be 4025 // specified as placement.clusterSelector.zone.Also, field paths can 4026 // reference fields using the following syntax: Values in maps can be 4027 // referenced by key: labels'key' 4028 // placement.clusterSelector.clusterLabels'key' 4029 // placement.managedCluster.labels'key' 4030 // placement.clusterSelector.clusterLabels'key' 4031 // jobs'step-id'.labels'key' Jobs in the jobs list can be referenced by 4032 // step-id: jobs'step-id'.hadoopJob.mainJarFileUri 4033 // jobs'step-id'.hiveJob.queryFileUri 4034 // jobs'step-id'.pySparkJob.mainPythonFileUri 4035 // jobs'step-id'.hadoopJob.jarFileUris0 4036 // jobs'step-id'.hadoopJob.archiveUris0 4037 // jobs'step-id'.hadoopJob.fileUris0 4038 // jobs'step-id'.pySparkJob.pythonFileUris0 Items in repeated fields can 4039 // be referenced by a zero-based index: jobs'step-id'.sparkJob.args0 4040 // Other examples: jobs'step-id'.hadoopJob.properties'key' 4041 // jobs'step-id'.hadoopJob.args0 4042 // jobs'step-id'.hiveJob.scriptVariables'key' 4043 // jobs'step-id'.hadoopJob.mainJarFileUri 4044 // placement.clusterSelector.zoneIt may not be possible to parameterize 4045 // maps and repeated fields in their entirety since only individual map 4046 // values and individual items in repeated fields can be referenced. For 4047 // example, the following field paths are invalid: 4048 // placement.clusterSelector.clusterLabels jobs'step-id'.sparkJob.args 4049 Fields []string `json:"fields,omitempty"` 4050 4051 // Name: Required. Parameter name. The parameter name is used as the 4052 // key, and paired with the parameter value, which are passed to the 4053 // template when the template is instantiated. The name must contain 4054 // only capital letters (A-Z), numbers (0-9), and underscores (_), and 4055 // must not start with a number. The maximum length is 40 characters. 4056 Name string `json:"name,omitempty"` 4057 4058 // Validation: Optional. Validation rules to be applied to this 4059 // parameter's value. 4060 Validation *ParameterValidation `json:"validation,omitempty"` 4061 4062 // ForceSendFields is a list of field names (e.g. "Description") to 4063 // unconditionally include in API requests. By default, fields with 4064 // empty values are omitted from API requests. However, any non-pointer, 4065 // non-interface field appearing in ForceSendFields will be sent to the 4066 // server regardless of whether the field is empty or not. This may be 4067 // used to include empty fields in Patch requests. 4068 ForceSendFields []string `json:"-"` 4069 4070 // NullFields is a list of field names (e.g. "Description") to include 4071 // in API requests with the JSON null value. By default, fields with 4072 // empty values are omitted from API requests. However, any field with 4073 // an empty value appearing in NullFields will be sent to the server as 4074 // null. It is an error if a field in this list has a non-empty value. 4075 // This may be used to include null fields in Patch requests. 4076 NullFields []string `json:"-"` 4077} 4078 4079func (s *TemplateParameter) MarshalJSON() ([]byte, error) { 4080 type NoMethod TemplateParameter 4081 raw := NoMethod(*s) 4082 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4083} 4084 4085// TestIamPermissionsRequest: Request message for TestIamPermissions 4086// method. 4087type TestIamPermissionsRequest struct { 4088 // Permissions: The set of permissions to check for the resource. 4089 // Permissions with wildcards (such as '*' or 'storage.*') are not 4090 // allowed. For more information see IAM Overview 4091 // (https://cloud.google.com/iam/docs/overview#permissions). 4092 Permissions []string `json:"permissions,omitempty"` 4093 4094 // ForceSendFields is a list of field names (e.g. "Permissions") to 4095 // unconditionally include in API requests. By default, fields with 4096 // empty values are omitted from API requests. However, any non-pointer, 4097 // non-interface field appearing in ForceSendFields will be sent to the 4098 // server regardless of whether the field is empty or not. This may be 4099 // used to include empty fields in Patch requests. 4100 ForceSendFields []string `json:"-"` 4101 4102 // NullFields is a list of field names (e.g. "Permissions") to include 4103 // in API requests with the JSON null value. By default, fields with 4104 // empty values are omitted from API requests. However, any field with 4105 // an empty value appearing in NullFields will be sent to the server as 4106 // null. It is an error if a field in this list has a non-empty value. 4107 // This may be used to include null fields in Patch requests. 4108 NullFields []string `json:"-"` 4109} 4110 4111func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 4112 type NoMethod TestIamPermissionsRequest 4113 raw := NoMethod(*s) 4114 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4115} 4116 4117// TestIamPermissionsResponse: Response message for TestIamPermissions 4118// method. 4119type TestIamPermissionsResponse struct { 4120 // Permissions: A subset of TestPermissionsRequest.permissions that the 4121 // caller is allowed. 4122 Permissions []string `json:"permissions,omitempty"` 4123 4124 // ServerResponse contains the HTTP response code and headers from the 4125 // server. 4126 googleapi.ServerResponse `json:"-"` 4127 4128 // ForceSendFields is a list of field names (e.g. "Permissions") to 4129 // unconditionally include in API requests. By default, fields with 4130 // empty values are omitted from API requests. However, any non-pointer, 4131 // non-interface field appearing in ForceSendFields will be sent to the 4132 // server regardless of whether the field is empty or not. This may be 4133 // used to include empty fields in Patch requests. 4134 ForceSendFields []string `json:"-"` 4135 4136 // NullFields is a list of field names (e.g. "Permissions") to include 4137 // in API requests with the JSON null value. By default, fields with 4138 // empty values are omitted from API requests. However, any field with 4139 // an empty value appearing in NullFields will be sent to the server as 4140 // null. It is an error if a field in this list has a non-empty value. 4141 // This may be used to include null fields in Patch requests. 4142 NullFields []string `json:"-"` 4143} 4144 4145func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 4146 type NoMethod TestIamPermissionsResponse 4147 raw := NoMethod(*s) 4148 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4149} 4150 4151// ValueValidation: Validation based on a list of allowed values. 4152type ValueValidation struct { 4153 // Values: Required. List of allowed values for the parameter. 4154 Values []string `json:"values,omitempty"` 4155 4156 // ForceSendFields is a list of field names (e.g. "Values") to 4157 // unconditionally include in API requests. By default, fields with 4158 // empty values are omitted from API requests. However, any non-pointer, 4159 // non-interface field appearing in ForceSendFields will be sent to the 4160 // server regardless of whether the field is empty or not. This may be 4161 // used to include empty fields in Patch requests. 4162 ForceSendFields []string `json:"-"` 4163 4164 // NullFields is a list of field names (e.g. "Values") to include in API 4165 // requests with the JSON null value. By default, fields with empty 4166 // values are omitted from API requests. However, any field with an 4167 // empty value appearing in NullFields will be sent to the server as 4168 // null. It is an error if a field in this list has a non-empty value. 4169 // This may be used to include null fields in Patch requests. 4170 NullFields []string `json:"-"` 4171} 4172 4173func (s *ValueValidation) MarshalJSON() ([]byte, error) { 4174 type NoMethod ValueValidation 4175 raw := NoMethod(*s) 4176 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4177} 4178 4179// WorkflowGraph: The workflow graph. 4180type WorkflowGraph struct { 4181 // Nodes: Output only. The workflow nodes. 4182 Nodes []*WorkflowNode `json:"nodes,omitempty"` 4183 4184 // ForceSendFields is a list of field names (e.g. "Nodes") to 4185 // unconditionally include in API requests. By default, fields with 4186 // empty values are omitted from API requests. However, any non-pointer, 4187 // non-interface field appearing in ForceSendFields will be sent to the 4188 // server regardless of whether the field is empty or not. This may be 4189 // used to include empty fields in Patch requests. 4190 ForceSendFields []string `json:"-"` 4191 4192 // NullFields is a list of field names (e.g. "Nodes") to include in API 4193 // requests with the JSON null value. By default, fields with empty 4194 // values are omitted from API requests. However, any field with an 4195 // empty value appearing in NullFields will be sent to the server as 4196 // null. It is an error if a field in this list has a non-empty value. 4197 // This may be used to include null fields in Patch requests. 4198 NullFields []string `json:"-"` 4199} 4200 4201func (s *WorkflowGraph) MarshalJSON() ([]byte, error) { 4202 type NoMethod WorkflowGraph 4203 raw := NoMethod(*s) 4204 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4205} 4206 4207// WorkflowMetadata: A Dataproc workflow template resource. 4208type WorkflowMetadata struct { 4209 // ClusterName: Output only. The name of the target cluster. 4210 ClusterName string `json:"clusterName,omitempty"` 4211 4212 // ClusterUuid: Output only. The UUID of target cluster. 4213 ClusterUuid string `json:"clusterUuid,omitempty"` 4214 4215 // CreateCluster: Output only. The create cluster operation metadata. 4216 CreateCluster *ClusterOperation `json:"createCluster,omitempty"` 4217 4218 // DagEndTime: Output only. DAG end time, only set for workflows with 4219 // dag_timeout when DAG ends. 4220 DagEndTime string `json:"dagEndTime,omitempty"` 4221 4222 // DagStartTime: Output only. DAG start time, only set for workflows 4223 // with dag_timeout when DAG begins. 4224 DagStartTime string `json:"dagStartTime,omitempty"` 4225 4226 // DagTimeout: Output only. The timeout duration for the DAG of jobs, 4227 // expressed in seconds (see JSON representation of duration 4228 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 4229 DagTimeout string `json:"dagTimeout,omitempty"` 4230 4231 // DeleteCluster: Output only. The delete cluster operation metadata. 4232 DeleteCluster *ClusterOperation `json:"deleteCluster,omitempty"` 4233 4234 // EndTime: Output only. Workflow end time. 4235 EndTime string `json:"endTime,omitempty"` 4236 4237 // Graph: Output only. The workflow graph. 4238 Graph *WorkflowGraph `json:"graph,omitempty"` 4239 4240 // Parameters: Map from parameter names to values that were used for 4241 // those parameters. 4242 Parameters map[string]string `json:"parameters,omitempty"` 4243 4244 // StartTime: Output only. Workflow start time. 4245 StartTime string `json:"startTime,omitempty"` 4246 4247 // State: Output only. The workflow state. 4248 // 4249 // Possible values: 4250 // "UNKNOWN" - Unused. 4251 // "PENDING" - The operation has been created. 4252 // "RUNNING" - The operation is running. 4253 // "DONE" - The operation is done; either cancelled or completed. 4254 State string `json:"state,omitempty"` 4255 4256 // Template: Output only. The resource name of the workflow template as 4257 // described in https://cloud.google.com/apis/design/resource_names. For 4258 // projects.regions.workflowTemplates, the resource name of the template 4259 // has the following format: 4260 // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} 4261 // For projects.locations.workflowTemplates, the resource name of the 4262 // template has the following format: 4263 // projects/{project_id}/locations/{location}/workflowTemplates/{template 4264 // _id} 4265 Template string `json:"template,omitempty"` 4266 4267 // Version: Output only. The version of template at the time of workflow 4268 // instantiation. 4269 Version int64 `json:"version,omitempty"` 4270 4271 // ForceSendFields is a list of field names (e.g. "ClusterName") to 4272 // unconditionally include in API requests. By default, fields with 4273 // empty values are omitted from API requests. However, any non-pointer, 4274 // non-interface field appearing in ForceSendFields will be sent to the 4275 // server regardless of whether the field is empty or not. This may be 4276 // used to include empty fields in Patch requests. 4277 ForceSendFields []string `json:"-"` 4278 4279 // NullFields is a list of field names (e.g. "ClusterName") to include 4280 // in API requests with the JSON null value. By default, fields with 4281 // empty values are omitted from API requests. However, any field with 4282 // an empty value appearing in NullFields will be sent to the server as 4283 // null. It is an error if a field in this list has a non-empty value. 4284 // This may be used to include null fields in Patch requests. 4285 NullFields []string `json:"-"` 4286} 4287 4288func (s *WorkflowMetadata) MarshalJSON() ([]byte, error) { 4289 type NoMethod WorkflowMetadata 4290 raw := NoMethod(*s) 4291 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4292} 4293 4294// WorkflowNode: The workflow node. 4295type WorkflowNode struct { 4296 // Error: Output only. The error detail. 4297 Error string `json:"error,omitempty"` 4298 4299 // JobId: Output only. The job id; populated after the node enters 4300 // RUNNING state. 4301 JobId string `json:"jobId,omitempty"` 4302 4303 // PrerequisiteStepIds: Output only. Node's prerequisite nodes. 4304 PrerequisiteStepIds []string `json:"prerequisiteStepIds,omitempty"` 4305 4306 // State: Output only. The node state. 4307 // 4308 // Possible values: 4309 // "NODE_STATE_UNSPECIFIED" - State is unspecified. 4310 // "BLOCKED" - The node is awaiting prerequisite node to finish. 4311 // "RUNNABLE" - The node is runnable but not running. 4312 // "RUNNING" - The node is running. 4313 // "COMPLETED" - The node completed successfully. 4314 // "FAILED" - The node failed. A node can be marked FAILED because its 4315 // ancestor or peer failed. 4316 State string `json:"state,omitempty"` 4317 4318 // StepId: Output only. The name of the node. 4319 StepId string `json:"stepId,omitempty"` 4320 4321 // ForceSendFields is a list of field names (e.g. "Error") to 4322 // unconditionally include in API requests. By default, fields with 4323 // empty values are omitted from API requests. However, any non-pointer, 4324 // non-interface field appearing in ForceSendFields will be sent to the 4325 // server regardless of whether the field is empty or not. This may be 4326 // used to include empty fields in Patch requests. 4327 ForceSendFields []string `json:"-"` 4328 4329 // NullFields is a list of field names (e.g. "Error") to include in API 4330 // requests with the JSON null value. By default, fields with empty 4331 // values are omitted from API requests. However, any field with an 4332 // empty value appearing in NullFields will be sent to the server as 4333 // null. It is an error if a field in this list has a non-empty value. 4334 // This may be used to include null fields in Patch requests. 4335 NullFields []string `json:"-"` 4336} 4337 4338func (s *WorkflowNode) MarshalJSON() ([]byte, error) { 4339 type NoMethod WorkflowNode 4340 raw := NoMethod(*s) 4341 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4342} 4343 4344// WorkflowTemplate: A Dataproc workflow template resource. 4345type WorkflowTemplate struct { 4346 // CreateTime: Output only. The time template was created. 4347 CreateTime string `json:"createTime,omitempty"` 4348 4349 // DagTimeout: Optional. Timeout duration for the DAG of jobs, expressed 4350 // in seconds (see JSON representation of duration 4351 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 4352 // The timeout duration must be from 10 minutes ("600s") to 24 hours 4353 // ("86400s"). The timer begins when the first job is submitted. If the 4354 // workflow is running at the end of the timeout period, any remaining 4355 // jobs are cancelled, the workflow is ended, and if the workflow was 4356 // running on a managed cluster, the cluster is deleted. 4357 DagTimeout string `json:"dagTimeout,omitempty"` 4358 4359 Id string `json:"id,omitempty"` 4360 4361 // Jobs: Required. The Directed Acyclic Graph of Jobs to submit. 4362 Jobs []*OrderedJob `json:"jobs,omitempty"` 4363 4364 // Labels: Optional. The labels to associate with this template. These 4365 // labels will be propagated to all jobs and clusters created by the 4366 // workflow instance.Label keys must contain 1 to 63 characters, and 4367 // must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).Label 4368 // values may be empty, but, if present, must contain 1 to 63 4369 // characters, and must conform to RFC 1035 4370 // (https://www.ietf.org/rfc/rfc1035.txt).No more than 32 labels can be 4371 // associated with a template. 4372 Labels map[string]string `json:"labels,omitempty"` 4373 4374 // Name: Output only. The resource name of the workflow template, as 4375 // described in https://cloud.google.com/apis/design/resource_names. For 4376 // projects.regions.workflowTemplates, the resource name of the template 4377 // has the following format: 4378 // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} 4379 // For projects.locations.workflowTemplates, the resource name of the 4380 // template has the following format: 4381 // projects/{project_id}/locations/{location}/workflowTemplates/{template 4382 // _id} 4383 Name string `json:"name,omitempty"` 4384 4385 // Parameters: Optional. Template parameters whose values are 4386 // substituted into the template. Values for parameters must be provided 4387 // when the template is instantiated. 4388 Parameters []*TemplateParameter `json:"parameters,omitempty"` 4389 4390 // Placement: Required. WorkflowTemplate scheduling information. 4391 Placement *WorkflowTemplatePlacement `json:"placement,omitempty"` 4392 4393 // UpdateTime: Output only. The time template was last updated. 4394 UpdateTime string `json:"updateTime,omitempty"` 4395 4396 // Version: Optional. Used to perform a consistent 4397 // read-modify-write.This field should be left blank for a 4398 // CreateWorkflowTemplate request. It is required for an 4399 // UpdateWorkflowTemplate request, and must match the current server 4400 // version. A typical update template flow would fetch the current 4401 // template with a GetWorkflowTemplate request, which will return the 4402 // current template with the version field filled in with the current 4403 // server version. The user updates other fields in the template, then 4404 // returns it as part of the UpdateWorkflowTemplate request. 4405 Version int64 `json:"version,omitempty"` 4406 4407 // ServerResponse contains the HTTP response code and headers from the 4408 // server. 4409 googleapi.ServerResponse `json:"-"` 4410 4411 // ForceSendFields is a list of field names (e.g. "CreateTime") to 4412 // unconditionally include in API requests. By default, fields with 4413 // empty values are omitted from API requests. However, any non-pointer, 4414 // non-interface field appearing in ForceSendFields will be sent to the 4415 // server regardless of whether the field is empty or not. This may be 4416 // used to include empty fields in Patch requests. 4417 ForceSendFields []string `json:"-"` 4418 4419 // NullFields is a list of field names (e.g. "CreateTime") to include in 4420 // API requests with the JSON null value. By default, fields with empty 4421 // values are omitted from API requests. However, any field with an 4422 // empty value appearing in NullFields will be sent to the server as 4423 // null. It is an error if a field in this list has a non-empty value. 4424 // This may be used to include null fields in Patch requests. 4425 NullFields []string `json:"-"` 4426} 4427 4428func (s *WorkflowTemplate) MarshalJSON() ([]byte, error) { 4429 type NoMethod WorkflowTemplate 4430 raw := NoMethod(*s) 4431 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4432} 4433 4434// WorkflowTemplatePlacement: Specifies workflow execution target.Either 4435// managed_cluster or cluster_selector is required. 4436type WorkflowTemplatePlacement struct { 4437 // ClusterSelector: Optional. A selector that chooses target cluster for 4438 // jobs based on metadata.The selector is evaluated at the time each job 4439 // is submitted. 4440 ClusterSelector *ClusterSelector `json:"clusterSelector,omitempty"` 4441 4442 // ManagedCluster: A cluster that is managed by the workflow. 4443 ManagedCluster *ManagedCluster `json:"managedCluster,omitempty"` 4444 4445 // ForceSendFields is a list of field names (e.g. "ClusterSelector") to 4446 // unconditionally include in API requests. By default, fields with 4447 // empty values are omitted from API requests. However, any non-pointer, 4448 // non-interface field appearing in ForceSendFields will be sent to the 4449 // server regardless of whether the field is empty or not. This may be 4450 // used to include empty fields in Patch requests. 4451 ForceSendFields []string `json:"-"` 4452 4453 // NullFields is a list of field names (e.g. "ClusterSelector") to 4454 // include in API requests with the JSON null value. By default, fields 4455 // with empty values are omitted from API requests. However, any field 4456 // with an empty value appearing in NullFields will be sent to the 4457 // server as null. It is an error if a field in this list has a 4458 // non-empty value. This may be used to include null fields in Patch 4459 // requests. 4460 NullFields []string `json:"-"` 4461} 4462 4463func (s *WorkflowTemplatePlacement) MarshalJSON() ([]byte, error) { 4464 type NoMethod WorkflowTemplatePlacement 4465 raw := NoMethod(*s) 4466 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4467} 4468 4469// YarnApplication: A YARN application created by a job. Application 4470// information is a subset of 4471// org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto.Beta 4472// Feature: This report is available for testing purposes only. It may 4473// be changed before final release. 4474type YarnApplication struct { 4475 // Name: Required. The application name. 4476 Name string `json:"name,omitempty"` 4477 4478 // Progress: Required. The numerical progress of the application, from 1 4479 // to 100. 4480 Progress float64 `json:"progress,omitempty"` 4481 4482 // State: Required. The application state. 4483 // 4484 // Possible values: 4485 // "STATE_UNSPECIFIED" - Status is unspecified. 4486 // "NEW" - Status is NEW. 4487 // "NEW_SAVING" - Status is NEW_SAVING. 4488 // "SUBMITTED" - Status is SUBMITTED. 4489 // "ACCEPTED" - Status is ACCEPTED. 4490 // "RUNNING" - Status is RUNNING. 4491 // "FINISHED" - Status is FINISHED. 4492 // "FAILED" - Status is FAILED. 4493 // "KILLED" - Status is KILLED. 4494 State string `json:"state,omitempty"` 4495 4496 // TrackingUrl: Optional. The HTTP URL of the ApplicationMaster, 4497 // HistoryServer, or TimelineServer that provides application-specific 4498 // information. The URL uses the internal hostname, and requires a proxy 4499 // server for resolution and, possibly, access. 4500 TrackingUrl string `json:"trackingUrl,omitempty"` 4501 4502 // ForceSendFields is a list of field names (e.g. "Name") to 4503 // unconditionally include in API requests. By default, fields with 4504 // empty values are omitted from API requests. However, any non-pointer, 4505 // non-interface field appearing in ForceSendFields will be sent to the 4506 // server regardless of whether the field is empty or not. This may be 4507 // used to include empty fields in Patch requests. 4508 ForceSendFields []string `json:"-"` 4509 4510 // NullFields is a list of field names (e.g. "Name") to include in API 4511 // requests with the JSON null value. By default, fields with empty 4512 // values are omitted from API requests. However, any field with an 4513 // empty value appearing in NullFields will be sent to the server as 4514 // null. It is an error if a field in this list has a non-empty value. 4515 // This may be used to include null fields in Patch requests. 4516 NullFields []string `json:"-"` 4517} 4518 4519func (s *YarnApplication) MarshalJSON() ([]byte, error) { 4520 type NoMethod YarnApplication 4521 raw := NoMethod(*s) 4522 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4523} 4524 4525func (s *YarnApplication) UnmarshalJSON(data []byte) error { 4526 type NoMethod YarnApplication 4527 var s1 struct { 4528 Progress gensupport.JSONFloat64 `json:"progress"` 4529 *NoMethod 4530 } 4531 s1.NoMethod = (*NoMethod)(s) 4532 if err := json.Unmarshal(data, &s1); err != nil { 4533 return err 4534 } 4535 s.Progress = float64(s1.Progress) 4536 return nil 4537} 4538 4539// method id "dataproc.projects.locations.autoscalingPolicies.create": 4540 4541type ProjectsLocationsAutoscalingPoliciesCreateCall struct { 4542 s *Service 4543 parent string 4544 autoscalingpolicy *AutoscalingPolicy 4545 urlParams_ gensupport.URLParams 4546 ctx_ context.Context 4547 header_ http.Header 4548} 4549 4550// Create: Creates new autoscaling policy. 4551// 4552// - parent: The "resource name" of the region or location, as described 4553// in https://cloud.google.com/apis/design/resource_names. For 4554// projects.regions.autoscalingPolicies.create, the resource name of 4555// the region has the following format: 4556// projects/{project_id}/regions/{region} For 4557// projects.locations.autoscalingPolicies.create, the resource name of 4558// the location has the following format: 4559// projects/{project_id}/locations/{location}. 4560func (r *ProjectsLocationsAutoscalingPoliciesService) Create(parent string, autoscalingpolicy *AutoscalingPolicy) *ProjectsLocationsAutoscalingPoliciesCreateCall { 4561 c := &ProjectsLocationsAutoscalingPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4562 c.parent = parent 4563 c.autoscalingpolicy = autoscalingpolicy 4564 return c 4565} 4566 4567// Fields allows partial responses to be retrieved. See 4568// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4569// for more information. 4570func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesCreateCall { 4571 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4572 return c 4573} 4574 4575// Context sets the context to be used in this call's Do method. Any 4576// pending HTTP request will be aborted if the provided context is 4577// canceled. 4578func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesCreateCall { 4579 c.ctx_ = ctx 4580 return c 4581} 4582 4583// Header returns an http.Header that can be modified by the caller to 4584// add HTTP headers to the request. 4585func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Header() http.Header { 4586 if c.header_ == nil { 4587 c.header_ = make(http.Header) 4588 } 4589 return c.header_ 4590} 4591 4592func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { 4593 reqHeaders := make(http.Header) 4594 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 4595 for k, v := range c.header_ { 4596 reqHeaders[k] = v 4597 } 4598 reqHeaders.Set("User-Agent", c.s.userAgent()) 4599 var body io.Reader = nil 4600 body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) 4601 if err != nil { 4602 return nil, err 4603 } 4604 reqHeaders.Set("Content-Type", "application/json") 4605 c.urlParams_.Set("alt", alt) 4606 c.urlParams_.Set("prettyPrint", "false") 4607 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/autoscalingPolicies") 4608 urls += "?" + c.urlParams_.Encode() 4609 req, err := http.NewRequest("POST", urls, body) 4610 if err != nil { 4611 return nil, err 4612 } 4613 req.Header = reqHeaders 4614 googleapi.Expand(req.URL, map[string]string{ 4615 "parent": c.parent, 4616 }) 4617 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4618} 4619 4620// Do executes the "dataproc.projects.locations.autoscalingPolicies.create" call. 4621// Exactly one of *AutoscalingPolicy or error will be non-nil. Any 4622// non-2xx status code is an error. Response headers are in either 4623// *AutoscalingPolicy.ServerResponse.Header or (if a response was 4624// returned at all) in error.(*googleapi.Error).Header. Use 4625// googleapi.IsNotModified to check whether the returned error was 4626// because http.StatusNotModified was returned. 4627func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 4628 gensupport.SetOptions(c.urlParams_, opts...) 4629 res, err := c.doRequest("json") 4630 if res != nil && res.StatusCode == http.StatusNotModified { 4631 if res.Body != nil { 4632 res.Body.Close() 4633 } 4634 return nil, &googleapi.Error{ 4635 Code: res.StatusCode, 4636 Header: res.Header, 4637 } 4638 } 4639 if err != nil { 4640 return nil, err 4641 } 4642 defer googleapi.CloseBody(res) 4643 if err := googleapi.CheckResponse(res); err != nil { 4644 return nil, err 4645 } 4646 ret := &AutoscalingPolicy{ 4647 ServerResponse: googleapi.ServerResponse{ 4648 Header: res.Header, 4649 HTTPStatusCode: res.StatusCode, 4650 }, 4651 } 4652 target := &ret 4653 if err := gensupport.DecodeResponse(target, res); err != nil { 4654 return nil, err 4655 } 4656 return ret, nil 4657 // { 4658 // "description": "Creates new autoscaling policy.", 4659 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies", 4660 // "httpMethod": "POST", 4661 // "id": "dataproc.projects.locations.autoscalingPolicies.create", 4662 // "parameterOrder": [ 4663 // "parent" 4664 // ], 4665 // "parameters": { 4666 // "parent": { 4667 // "description": "Required. The \"resource name\" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region} For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}", 4668 // "location": "path", 4669 // "pattern": "^projects/[^/]+/locations/[^/]+$", 4670 // "required": true, 4671 // "type": "string" 4672 // } 4673 // }, 4674 // "path": "v1/{+parent}/autoscalingPolicies", 4675 // "request": { 4676 // "$ref": "AutoscalingPolicy" 4677 // }, 4678 // "response": { 4679 // "$ref": "AutoscalingPolicy" 4680 // }, 4681 // "scopes": [ 4682 // "https://www.googleapis.com/auth/cloud-platform" 4683 // ] 4684 // } 4685 4686} 4687 4688// method id "dataproc.projects.locations.autoscalingPolicies.delete": 4689 4690type ProjectsLocationsAutoscalingPoliciesDeleteCall struct { 4691 s *Service 4692 name string 4693 urlParams_ gensupport.URLParams 4694 ctx_ context.Context 4695 header_ http.Header 4696} 4697 4698// Delete: Deletes an autoscaling policy. It is an error to delete an 4699// autoscaling policy that is in use by one or more clusters. 4700// 4701// - name: The "resource name" of the autoscaling policy, as described 4702// in https://cloud.google.com/apis/design/resource_names. For 4703// projects.regions.autoscalingPolicies.delete, the resource name of 4704// the policy has the following format: 4705// projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 4706// d} For projects.locations.autoscalingPolicies.delete, the resource 4707// name of the policy has the following format: 4708// projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 4709// cy_id}. 4710func (r *ProjectsLocationsAutoscalingPoliciesService) Delete(name string) *ProjectsLocationsAutoscalingPoliciesDeleteCall { 4711 c := &ProjectsLocationsAutoscalingPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4712 c.name = name 4713 return c 4714} 4715 4716// Fields allows partial responses to be retrieved. See 4717// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4718// for more information. 4719func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesDeleteCall { 4720 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4721 return c 4722} 4723 4724// Context sets the context to be used in this call's Do method. Any 4725// pending HTTP request will be aborted if the provided context is 4726// canceled. 4727func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesDeleteCall { 4728 c.ctx_ = ctx 4729 return c 4730} 4731 4732// Header returns an http.Header that can be modified by the caller to 4733// add HTTP headers to the request. 4734func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Header() http.Header { 4735 if c.header_ == nil { 4736 c.header_ = make(http.Header) 4737 } 4738 return c.header_ 4739} 4740 4741func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { 4742 reqHeaders := make(http.Header) 4743 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 4744 for k, v := range c.header_ { 4745 reqHeaders[k] = v 4746 } 4747 reqHeaders.Set("User-Agent", c.s.userAgent()) 4748 var body io.Reader = nil 4749 c.urlParams_.Set("alt", alt) 4750 c.urlParams_.Set("prettyPrint", "false") 4751 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4752 urls += "?" + c.urlParams_.Encode() 4753 req, err := http.NewRequest("DELETE", urls, body) 4754 if err != nil { 4755 return nil, err 4756 } 4757 req.Header = reqHeaders 4758 googleapi.Expand(req.URL, map[string]string{ 4759 "name": c.name, 4760 }) 4761 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4762} 4763 4764// Do executes the "dataproc.projects.locations.autoscalingPolicies.delete" call. 4765// Exactly one of *Empty or error will be non-nil. Any non-2xx status 4766// code is an error. Response headers are in either 4767// *Empty.ServerResponse.Header or (if a response was returned at all) 4768// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4769// check whether the returned error was because http.StatusNotModified 4770// was returned. 4771func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 4772 gensupport.SetOptions(c.urlParams_, opts...) 4773 res, err := c.doRequest("json") 4774 if res != nil && res.StatusCode == http.StatusNotModified { 4775 if res.Body != nil { 4776 res.Body.Close() 4777 } 4778 return nil, &googleapi.Error{ 4779 Code: res.StatusCode, 4780 Header: res.Header, 4781 } 4782 } 4783 if err != nil { 4784 return nil, err 4785 } 4786 defer googleapi.CloseBody(res) 4787 if err := googleapi.CheckResponse(res); err != nil { 4788 return nil, err 4789 } 4790 ret := &Empty{ 4791 ServerResponse: googleapi.ServerResponse{ 4792 Header: res.Header, 4793 HTTPStatusCode: res.StatusCode, 4794 }, 4795 } 4796 target := &ret 4797 if err := gensupport.DecodeResponse(target, res); err != nil { 4798 return nil, err 4799 } 4800 return ret, nil 4801 // { 4802 // "description": "Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.", 4803 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}", 4804 // "httpMethod": "DELETE", 4805 // "id": "dataproc.projects.locations.autoscalingPolicies.delete", 4806 // "parameterOrder": [ 4807 // "name" 4808 // ], 4809 // "parameters": { 4810 // "name": { 4811 // "description": "Required. The \"resource name\" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}", 4812 // "location": "path", 4813 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 4814 // "required": true, 4815 // "type": "string" 4816 // } 4817 // }, 4818 // "path": "v1/{+name}", 4819 // "response": { 4820 // "$ref": "Empty" 4821 // }, 4822 // "scopes": [ 4823 // "https://www.googleapis.com/auth/cloud-platform" 4824 // ] 4825 // } 4826 4827} 4828 4829// method id "dataproc.projects.locations.autoscalingPolicies.get": 4830 4831type ProjectsLocationsAutoscalingPoliciesGetCall struct { 4832 s *Service 4833 name string 4834 urlParams_ gensupport.URLParams 4835 ifNoneMatch_ string 4836 ctx_ context.Context 4837 header_ http.Header 4838} 4839 4840// Get: Retrieves autoscaling policy. 4841// 4842// - name: The "resource name" of the autoscaling policy, as described 4843// in https://cloud.google.com/apis/design/resource_names. For 4844// projects.regions.autoscalingPolicies.get, the resource name of the 4845// policy has the following format: 4846// projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 4847// d} For projects.locations.autoscalingPolicies.get, the resource 4848// name of the policy has the following format: 4849// projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 4850// cy_id}. 4851func (r *ProjectsLocationsAutoscalingPoliciesService) Get(name string) *ProjectsLocationsAutoscalingPoliciesGetCall { 4852 c := &ProjectsLocationsAutoscalingPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4853 c.name = name 4854 return c 4855} 4856 4857// Fields allows partial responses to be retrieved. See 4858// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4859// for more information. 4860func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesGetCall { 4861 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4862 return c 4863} 4864 4865// IfNoneMatch sets the optional parameter which makes the operation 4866// fail if the object's ETag matches the given value. This is useful for 4867// getting updates only after the object has changed since the last 4868// request. Use googleapi.IsNotModified to check whether the response 4869// error from Do is the result of In-None-Match. 4870func (c *ProjectsLocationsAutoscalingPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAutoscalingPoliciesGetCall { 4871 c.ifNoneMatch_ = entityTag 4872 return c 4873} 4874 4875// Context sets the context to be used in this call's Do method. Any 4876// pending HTTP request will be aborted if the provided context is 4877// canceled. 4878func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesGetCall { 4879 c.ctx_ = ctx 4880 return c 4881} 4882 4883// Header returns an http.Header that can be modified by the caller to 4884// add HTTP headers to the request. 4885func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Header() http.Header { 4886 if c.header_ == nil { 4887 c.header_ = make(http.Header) 4888 } 4889 return c.header_ 4890} 4891 4892func (c *ProjectsLocationsAutoscalingPoliciesGetCall) doRequest(alt string) (*http.Response, error) { 4893 reqHeaders := make(http.Header) 4894 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 4895 for k, v := range c.header_ { 4896 reqHeaders[k] = v 4897 } 4898 reqHeaders.Set("User-Agent", c.s.userAgent()) 4899 if c.ifNoneMatch_ != "" { 4900 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4901 } 4902 var body io.Reader = nil 4903 c.urlParams_.Set("alt", alt) 4904 c.urlParams_.Set("prettyPrint", "false") 4905 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 4906 urls += "?" + c.urlParams_.Encode() 4907 req, err := http.NewRequest("GET", urls, body) 4908 if err != nil { 4909 return nil, err 4910 } 4911 req.Header = reqHeaders 4912 googleapi.Expand(req.URL, map[string]string{ 4913 "name": c.name, 4914 }) 4915 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4916} 4917 4918// Do executes the "dataproc.projects.locations.autoscalingPolicies.get" call. 4919// Exactly one of *AutoscalingPolicy or error will be non-nil. Any 4920// non-2xx status code is an error. Response headers are in either 4921// *AutoscalingPolicy.ServerResponse.Header or (if a response was 4922// returned at all) in error.(*googleapi.Error).Header. Use 4923// googleapi.IsNotModified to check whether the returned error was 4924// because http.StatusNotModified was returned. 4925func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 4926 gensupport.SetOptions(c.urlParams_, opts...) 4927 res, err := c.doRequest("json") 4928 if res != nil && res.StatusCode == http.StatusNotModified { 4929 if res.Body != nil { 4930 res.Body.Close() 4931 } 4932 return nil, &googleapi.Error{ 4933 Code: res.StatusCode, 4934 Header: res.Header, 4935 } 4936 } 4937 if err != nil { 4938 return nil, err 4939 } 4940 defer googleapi.CloseBody(res) 4941 if err := googleapi.CheckResponse(res); err != nil { 4942 return nil, err 4943 } 4944 ret := &AutoscalingPolicy{ 4945 ServerResponse: googleapi.ServerResponse{ 4946 Header: res.Header, 4947 HTTPStatusCode: res.StatusCode, 4948 }, 4949 } 4950 target := &ret 4951 if err := gensupport.DecodeResponse(target, res); err != nil { 4952 return nil, err 4953 } 4954 return ret, nil 4955 // { 4956 // "description": "Retrieves autoscaling policy.", 4957 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}", 4958 // "httpMethod": "GET", 4959 // "id": "dataproc.projects.locations.autoscalingPolicies.get", 4960 // "parameterOrder": [ 4961 // "name" 4962 // ], 4963 // "parameters": { 4964 // "name": { 4965 // "description": "Required. The \"resource name\" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}", 4966 // "location": "path", 4967 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 4968 // "required": true, 4969 // "type": "string" 4970 // } 4971 // }, 4972 // "path": "v1/{+name}", 4973 // "response": { 4974 // "$ref": "AutoscalingPolicy" 4975 // }, 4976 // "scopes": [ 4977 // "https://www.googleapis.com/auth/cloud-platform" 4978 // ] 4979 // } 4980 4981} 4982 4983// method id "dataproc.projects.locations.autoscalingPolicies.getIamPolicy": 4984 4985type ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall struct { 4986 s *Service 4987 resource string 4988 getiampolicyrequest *GetIamPolicyRequest 4989 urlParams_ gensupport.URLParams 4990 ctx_ context.Context 4991 header_ http.Header 4992} 4993 4994// GetIamPolicy: Gets the access control policy for a resource. Returns 4995// an empty policy if the resource exists and does not have a policy 4996// set. 4997// 4998// - resource: REQUIRED: The resource for which the policy is being 4999// requested. See the operation documentation for the appropriate 5000// value for this field. 5001func (r *ProjectsLocationsAutoscalingPoliciesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall { 5002 c := &ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5003 c.resource = resource 5004 c.getiampolicyrequest = getiampolicyrequest 5005 return c 5006} 5007 5008// Fields allows partial responses to be retrieved. See 5009// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5010// for more information. 5011func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall { 5012 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5013 return c 5014} 5015 5016// Context sets the context to be used in this call's Do method. Any 5017// pending HTTP request will be aborted if the provided context is 5018// canceled. 5019func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall { 5020 c.ctx_ = ctx 5021 return c 5022} 5023 5024// Header returns an http.Header that can be modified by the caller to 5025// add HTTP headers to the request. 5026func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Header() http.Header { 5027 if c.header_ == nil { 5028 c.header_ = make(http.Header) 5029 } 5030 return c.header_ 5031} 5032 5033func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 5034 reqHeaders := make(http.Header) 5035 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 5036 for k, v := range c.header_ { 5037 reqHeaders[k] = v 5038 } 5039 reqHeaders.Set("User-Agent", c.s.userAgent()) 5040 var body io.Reader = nil 5041 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 5042 if err != nil { 5043 return nil, err 5044 } 5045 reqHeaders.Set("Content-Type", "application/json") 5046 c.urlParams_.Set("alt", alt) 5047 c.urlParams_.Set("prettyPrint", "false") 5048 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") 5049 urls += "?" + c.urlParams_.Encode() 5050 req, err := http.NewRequest("POST", urls, body) 5051 if err != nil { 5052 return nil, err 5053 } 5054 req.Header = reqHeaders 5055 googleapi.Expand(req.URL, map[string]string{ 5056 "resource": c.resource, 5057 }) 5058 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5059} 5060 5061// Do executes the "dataproc.projects.locations.autoscalingPolicies.getIamPolicy" call. 5062// Exactly one of *Policy or error will be non-nil. Any non-2xx status 5063// code is an error. Response headers are in either 5064// *Policy.ServerResponse.Header or (if a response was returned at all) 5065// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5066// check whether the returned error was because http.StatusNotModified 5067// was returned. 5068func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 5069 gensupport.SetOptions(c.urlParams_, opts...) 5070 res, err := c.doRequest("json") 5071 if res != nil && res.StatusCode == http.StatusNotModified { 5072 if res.Body != nil { 5073 res.Body.Close() 5074 } 5075 return nil, &googleapi.Error{ 5076 Code: res.StatusCode, 5077 Header: res.Header, 5078 } 5079 } 5080 if err != nil { 5081 return nil, err 5082 } 5083 defer googleapi.CloseBody(res) 5084 if err := googleapi.CheckResponse(res); err != nil { 5085 return nil, err 5086 } 5087 ret := &Policy{ 5088 ServerResponse: googleapi.ServerResponse{ 5089 Header: res.Header, 5090 HTTPStatusCode: res.StatusCode, 5091 }, 5092 } 5093 target := &ret 5094 if err := gensupport.DecodeResponse(target, res); err != nil { 5095 return nil, err 5096 } 5097 return ret, nil 5098 // { 5099 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 5100 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}:getIamPolicy", 5101 // "httpMethod": "POST", 5102 // "id": "dataproc.projects.locations.autoscalingPolicies.getIamPolicy", 5103 // "parameterOrder": [ 5104 // "resource" 5105 // ], 5106 // "parameters": { 5107 // "resource": { 5108 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 5109 // "location": "path", 5110 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 5111 // "required": true, 5112 // "type": "string" 5113 // } 5114 // }, 5115 // "path": "v1/{+resource}:getIamPolicy", 5116 // "request": { 5117 // "$ref": "GetIamPolicyRequest" 5118 // }, 5119 // "response": { 5120 // "$ref": "Policy" 5121 // }, 5122 // "scopes": [ 5123 // "https://www.googleapis.com/auth/cloud-platform" 5124 // ] 5125 // } 5126 5127} 5128 5129// method id "dataproc.projects.locations.autoscalingPolicies.list": 5130 5131type ProjectsLocationsAutoscalingPoliciesListCall struct { 5132 s *Service 5133 parent string 5134 urlParams_ gensupport.URLParams 5135 ifNoneMatch_ string 5136 ctx_ context.Context 5137 header_ http.Header 5138} 5139 5140// List: Lists autoscaling policies in the project. 5141// 5142// - parent: The "resource name" of the region or location, as described 5143// in https://cloud.google.com/apis/design/resource_names. For 5144// projects.regions.autoscalingPolicies.list, the resource name of the 5145// region has the following format: 5146// projects/{project_id}/regions/{region} For 5147// projects.locations.autoscalingPolicies.list, the resource name of 5148// the location has the following format: 5149// projects/{project_id}/locations/{location}. 5150func (r *ProjectsLocationsAutoscalingPoliciesService) List(parent string) *ProjectsLocationsAutoscalingPoliciesListCall { 5151 c := &ProjectsLocationsAutoscalingPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5152 c.parent = parent 5153 return c 5154} 5155 5156// PageSize sets the optional parameter "pageSize": The maximum number 5157// of results to return in each response. Must be less than or equal to 5158// 1000. Defaults to 100. 5159func (c *ProjectsLocationsAutoscalingPoliciesListCall) PageSize(pageSize int64) *ProjectsLocationsAutoscalingPoliciesListCall { 5160 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5161 return c 5162} 5163 5164// PageToken sets the optional parameter "pageToken": The page token, 5165// returned by a previous call, to request the next page of results. 5166func (c *ProjectsLocationsAutoscalingPoliciesListCall) PageToken(pageToken string) *ProjectsLocationsAutoscalingPoliciesListCall { 5167 c.urlParams_.Set("pageToken", pageToken) 5168 return c 5169} 5170 5171// Fields allows partial responses to be retrieved. See 5172// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5173// for more information. 5174func (c *ProjectsLocationsAutoscalingPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesListCall { 5175 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5176 return c 5177} 5178 5179// IfNoneMatch sets the optional parameter which makes the operation 5180// fail if the object's ETag matches the given value. This is useful for 5181// getting updates only after the object has changed since the last 5182// request. Use googleapi.IsNotModified to check whether the response 5183// error from Do is the result of In-None-Match. 5184func (c *ProjectsLocationsAutoscalingPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsAutoscalingPoliciesListCall { 5185 c.ifNoneMatch_ = entityTag 5186 return c 5187} 5188 5189// Context sets the context to be used in this call's Do method. Any 5190// pending HTTP request will be aborted if the provided context is 5191// canceled. 5192func (c *ProjectsLocationsAutoscalingPoliciesListCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesListCall { 5193 c.ctx_ = ctx 5194 return c 5195} 5196 5197// Header returns an http.Header that can be modified by the caller to 5198// add HTTP headers to the request. 5199func (c *ProjectsLocationsAutoscalingPoliciesListCall) Header() http.Header { 5200 if c.header_ == nil { 5201 c.header_ = make(http.Header) 5202 } 5203 return c.header_ 5204} 5205 5206func (c *ProjectsLocationsAutoscalingPoliciesListCall) doRequest(alt string) (*http.Response, error) { 5207 reqHeaders := make(http.Header) 5208 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 5209 for k, v := range c.header_ { 5210 reqHeaders[k] = v 5211 } 5212 reqHeaders.Set("User-Agent", c.s.userAgent()) 5213 if c.ifNoneMatch_ != "" { 5214 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5215 } 5216 var body io.Reader = nil 5217 c.urlParams_.Set("alt", alt) 5218 c.urlParams_.Set("prettyPrint", "false") 5219 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/autoscalingPolicies") 5220 urls += "?" + c.urlParams_.Encode() 5221 req, err := http.NewRequest("GET", urls, body) 5222 if err != nil { 5223 return nil, err 5224 } 5225 req.Header = reqHeaders 5226 googleapi.Expand(req.URL, map[string]string{ 5227 "parent": c.parent, 5228 }) 5229 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5230} 5231 5232// Do executes the "dataproc.projects.locations.autoscalingPolicies.list" call. 5233// Exactly one of *ListAutoscalingPoliciesResponse or error will be 5234// non-nil. Any non-2xx status code is an error. Response headers are in 5235// either *ListAutoscalingPoliciesResponse.ServerResponse.Header or (if 5236// a response was returned at all) in error.(*googleapi.Error).Header. 5237// Use googleapi.IsNotModified to check whether the returned error was 5238// because http.StatusNotModified was returned. 5239func (c *ProjectsLocationsAutoscalingPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListAutoscalingPoliciesResponse, error) { 5240 gensupport.SetOptions(c.urlParams_, opts...) 5241 res, err := c.doRequest("json") 5242 if res != nil && res.StatusCode == http.StatusNotModified { 5243 if res.Body != nil { 5244 res.Body.Close() 5245 } 5246 return nil, &googleapi.Error{ 5247 Code: res.StatusCode, 5248 Header: res.Header, 5249 } 5250 } 5251 if err != nil { 5252 return nil, err 5253 } 5254 defer googleapi.CloseBody(res) 5255 if err := googleapi.CheckResponse(res); err != nil { 5256 return nil, err 5257 } 5258 ret := &ListAutoscalingPoliciesResponse{ 5259 ServerResponse: googleapi.ServerResponse{ 5260 Header: res.Header, 5261 HTTPStatusCode: res.StatusCode, 5262 }, 5263 } 5264 target := &ret 5265 if err := gensupport.DecodeResponse(target, res); err != nil { 5266 return nil, err 5267 } 5268 return ret, nil 5269 // { 5270 // "description": "Lists autoscaling policies in the project.", 5271 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies", 5272 // "httpMethod": "GET", 5273 // "id": "dataproc.projects.locations.autoscalingPolicies.list", 5274 // "parameterOrder": [ 5275 // "parent" 5276 // ], 5277 // "parameters": { 5278 // "pageSize": { 5279 // "description": "Optional. The maximum number of results to return in each response. Must be less than or equal to 1000. Defaults to 100.", 5280 // "format": "int32", 5281 // "location": "query", 5282 // "type": "integer" 5283 // }, 5284 // "pageToken": { 5285 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 5286 // "location": "query", 5287 // "type": "string" 5288 // }, 5289 // "parent": { 5290 // "description": "Required. The \"resource name\" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region} For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}", 5291 // "location": "path", 5292 // "pattern": "^projects/[^/]+/locations/[^/]+$", 5293 // "required": true, 5294 // "type": "string" 5295 // } 5296 // }, 5297 // "path": "v1/{+parent}/autoscalingPolicies", 5298 // "response": { 5299 // "$ref": "ListAutoscalingPoliciesResponse" 5300 // }, 5301 // "scopes": [ 5302 // "https://www.googleapis.com/auth/cloud-platform" 5303 // ] 5304 // } 5305 5306} 5307 5308// Pages invokes f for each page of results. 5309// A non-nil error returned from f will halt the iteration. 5310// The provided context supersedes any context provided to the Context method. 5311func (c *ProjectsLocationsAutoscalingPoliciesListCall) Pages(ctx context.Context, f func(*ListAutoscalingPoliciesResponse) error) error { 5312 c.ctx_ = ctx 5313 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5314 for { 5315 x, err := c.Do() 5316 if err != nil { 5317 return err 5318 } 5319 if err := f(x); err != nil { 5320 return err 5321 } 5322 if x.NextPageToken == "" { 5323 return nil 5324 } 5325 c.PageToken(x.NextPageToken) 5326 } 5327} 5328 5329// method id "dataproc.projects.locations.autoscalingPolicies.setIamPolicy": 5330 5331type ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall struct { 5332 s *Service 5333 resource string 5334 setiampolicyrequest *SetIamPolicyRequest 5335 urlParams_ gensupport.URLParams 5336 ctx_ context.Context 5337 header_ http.Header 5338} 5339 5340// SetIamPolicy: Sets the access control policy on the specified 5341// resource. Replaces any existing policy.Can return NOT_FOUND, 5342// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 5343// 5344// - resource: REQUIRED: The resource for which the policy is being 5345// specified. See the operation documentation for the appropriate 5346// value for this field. 5347func (r *ProjectsLocationsAutoscalingPoliciesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall { 5348 c := &ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5349 c.resource = resource 5350 c.setiampolicyrequest = setiampolicyrequest 5351 return c 5352} 5353 5354// Fields allows partial responses to be retrieved. See 5355// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5356// for more information. 5357func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall { 5358 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5359 return c 5360} 5361 5362// Context sets the context to be used in this call's Do method. Any 5363// pending HTTP request will be aborted if the provided context is 5364// canceled. 5365func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall { 5366 c.ctx_ = ctx 5367 return c 5368} 5369 5370// Header returns an http.Header that can be modified by the caller to 5371// add HTTP headers to the request. 5372func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Header() http.Header { 5373 if c.header_ == nil { 5374 c.header_ = make(http.Header) 5375 } 5376 return c.header_ 5377} 5378 5379func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 5380 reqHeaders := make(http.Header) 5381 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 5382 for k, v := range c.header_ { 5383 reqHeaders[k] = v 5384 } 5385 reqHeaders.Set("User-Agent", c.s.userAgent()) 5386 var body io.Reader = nil 5387 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 5388 if err != nil { 5389 return nil, err 5390 } 5391 reqHeaders.Set("Content-Type", "application/json") 5392 c.urlParams_.Set("alt", alt) 5393 c.urlParams_.Set("prettyPrint", "false") 5394 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") 5395 urls += "?" + c.urlParams_.Encode() 5396 req, err := http.NewRequest("POST", urls, body) 5397 if err != nil { 5398 return nil, err 5399 } 5400 req.Header = reqHeaders 5401 googleapi.Expand(req.URL, map[string]string{ 5402 "resource": c.resource, 5403 }) 5404 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5405} 5406 5407// Do executes the "dataproc.projects.locations.autoscalingPolicies.setIamPolicy" call. 5408// Exactly one of *Policy or error will be non-nil. Any non-2xx status 5409// code is an error. Response headers are in either 5410// *Policy.ServerResponse.Header or (if a response was returned at all) 5411// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5412// check whether the returned error was because http.StatusNotModified 5413// was returned. 5414func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 5415 gensupport.SetOptions(c.urlParams_, opts...) 5416 res, err := c.doRequest("json") 5417 if res != nil && res.StatusCode == http.StatusNotModified { 5418 if res.Body != nil { 5419 res.Body.Close() 5420 } 5421 return nil, &googleapi.Error{ 5422 Code: res.StatusCode, 5423 Header: res.Header, 5424 } 5425 } 5426 if err != nil { 5427 return nil, err 5428 } 5429 defer googleapi.CloseBody(res) 5430 if err := googleapi.CheckResponse(res); err != nil { 5431 return nil, err 5432 } 5433 ret := &Policy{ 5434 ServerResponse: googleapi.ServerResponse{ 5435 Header: res.Header, 5436 HTTPStatusCode: res.StatusCode, 5437 }, 5438 } 5439 target := &ret 5440 if err := gensupport.DecodeResponse(target, res); err != nil { 5441 return nil, err 5442 } 5443 return ret, nil 5444 // { 5445 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 5446 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}:setIamPolicy", 5447 // "httpMethod": "POST", 5448 // "id": "dataproc.projects.locations.autoscalingPolicies.setIamPolicy", 5449 // "parameterOrder": [ 5450 // "resource" 5451 // ], 5452 // "parameters": { 5453 // "resource": { 5454 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 5455 // "location": "path", 5456 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 5457 // "required": true, 5458 // "type": "string" 5459 // } 5460 // }, 5461 // "path": "v1/{+resource}:setIamPolicy", 5462 // "request": { 5463 // "$ref": "SetIamPolicyRequest" 5464 // }, 5465 // "response": { 5466 // "$ref": "Policy" 5467 // }, 5468 // "scopes": [ 5469 // "https://www.googleapis.com/auth/cloud-platform" 5470 // ] 5471 // } 5472 5473} 5474 5475// method id "dataproc.projects.locations.autoscalingPolicies.testIamPermissions": 5476 5477type ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall struct { 5478 s *Service 5479 resource string 5480 testiampermissionsrequest *TestIamPermissionsRequest 5481 urlParams_ gensupport.URLParams 5482 ctx_ context.Context 5483 header_ http.Header 5484} 5485 5486// TestIamPermissions: Returns permissions that a caller has on the 5487// specified resource. If the resource does not exist, this will return 5488// an empty set of permissions, not a NOT_FOUND error.Note: This 5489// operation is designed to be used for building permission-aware UIs 5490// and command-line tools, not for authorization checking. This 5491// operation may "fail open" without warning. 5492// 5493// - resource: REQUIRED: The resource for which the policy detail is 5494// being requested. See the operation documentation for the 5495// appropriate value for this field. 5496func (r *ProjectsLocationsAutoscalingPoliciesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall { 5497 c := &ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5498 c.resource = resource 5499 c.testiampermissionsrequest = testiampermissionsrequest 5500 return c 5501} 5502 5503// Fields allows partial responses to be retrieved. See 5504// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5505// for more information. 5506func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall { 5507 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5508 return c 5509} 5510 5511// Context sets the context to be used in this call's Do method. Any 5512// pending HTTP request will be aborted if the provided context is 5513// canceled. 5514func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall { 5515 c.ctx_ = ctx 5516 return c 5517} 5518 5519// Header returns an http.Header that can be modified by the caller to 5520// add HTTP headers to the request. 5521func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Header() http.Header { 5522 if c.header_ == nil { 5523 c.header_ = make(http.Header) 5524 } 5525 return c.header_ 5526} 5527 5528func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 5529 reqHeaders := make(http.Header) 5530 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 5531 for k, v := range c.header_ { 5532 reqHeaders[k] = v 5533 } 5534 reqHeaders.Set("User-Agent", c.s.userAgent()) 5535 var body io.Reader = nil 5536 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 5537 if err != nil { 5538 return nil, err 5539 } 5540 reqHeaders.Set("Content-Type", "application/json") 5541 c.urlParams_.Set("alt", alt) 5542 c.urlParams_.Set("prettyPrint", "false") 5543 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") 5544 urls += "?" + c.urlParams_.Encode() 5545 req, err := http.NewRequest("POST", urls, body) 5546 if err != nil { 5547 return nil, err 5548 } 5549 req.Header = reqHeaders 5550 googleapi.Expand(req.URL, map[string]string{ 5551 "resource": c.resource, 5552 }) 5553 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5554} 5555 5556// Do executes the "dataproc.projects.locations.autoscalingPolicies.testIamPermissions" call. 5557// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 5558// Any non-2xx status code is an error. Response headers are in either 5559// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 5560// was returned at all) in error.(*googleapi.Error).Header. Use 5561// googleapi.IsNotModified to check whether the returned error was 5562// because http.StatusNotModified was returned. 5563func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, 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 := &TestIamPermissionsResponse{ 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": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 5595 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}:testIamPermissions", 5596 // "httpMethod": "POST", 5597 // "id": "dataproc.projects.locations.autoscalingPolicies.testIamPermissions", 5598 // "parameterOrder": [ 5599 // "resource" 5600 // ], 5601 // "parameters": { 5602 // "resource": { 5603 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 5604 // "location": "path", 5605 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 5606 // "required": true, 5607 // "type": "string" 5608 // } 5609 // }, 5610 // "path": "v1/{+resource}:testIamPermissions", 5611 // "request": { 5612 // "$ref": "TestIamPermissionsRequest" 5613 // }, 5614 // "response": { 5615 // "$ref": "TestIamPermissionsResponse" 5616 // }, 5617 // "scopes": [ 5618 // "https://www.googleapis.com/auth/cloud-platform" 5619 // ] 5620 // } 5621 5622} 5623 5624// method id "dataproc.projects.locations.autoscalingPolicies.update": 5625 5626type ProjectsLocationsAutoscalingPoliciesUpdateCall struct { 5627 s *Service 5628 name string 5629 autoscalingpolicy *AutoscalingPolicy 5630 urlParams_ gensupport.URLParams 5631 ctx_ context.Context 5632 header_ http.Header 5633} 5634 5635// Update: Updates (replaces) autoscaling policy.Disabled check for 5636// update_mask, because all updates will be full replacements. 5637// 5638// - name: Output only. The "resource name" of the autoscaling policy, 5639// as described in 5640// https://cloud.google.com/apis/design/resource_names. For 5641// projects.regions.autoscalingPolicies, the resource name of the 5642// policy has the following format: 5643// projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 5644// d} For projects.locations.autoscalingPolicies, the resource name of 5645// the policy has the following format: 5646// projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 5647// cy_id}. 5648func (r *ProjectsLocationsAutoscalingPoliciesService) Update(name string, autoscalingpolicy *AutoscalingPolicy) *ProjectsLocationsAutoscalingPoliciesUpdateCall { 5649 c := &ProjectsLocationsAutoscalingPoliciesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5650 c.name = name 5651 c.autoscalingpolicy = autoscalingpolicy 5652 return c 5653} 5654 5655// Fields allows partial responses to be retrieved. See 5656// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5657// for more information. 5658func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesUpdateCall { 5659 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5660 return c 5661} 5662 5663// Context sets the context to be used in this call's Do method. Any 5664// pending HTTP request will be aborted if the provided context is 5665// canceled. 5666func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesUpdateCall { 5667 c.ctx_ = ctx 5668 return c 5669} 5670 5671// Header returns an http.Header that can be modified by the caller to 5672// add HTTP headers to the request. 5673func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Header() http.Header { 5674 if c.header_ == nil { 5675 c.header_ = make(http.Header) 5676 } 5677 return c.header_ 5678} 5679 5680func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { 5681 reqHeaders := make(http.Header) 5682 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 5683 for k, v := range c.header_ { 5684 reqHeaders[k] = v 5685 } 5686 reqHeaders.Set("User-Agent", c.s.userAgent()) 5687 var body io.Reader = nil 5688 body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) 5689 if err != nil { 5690 return nil, err 5691 } 5692 reqHeaders.Set("Content-Type", "application/json") 5693 c.urlParams_.Set("alt", alt) 5694 c.urlParams_.Set("prettyPrint", "false") 5695 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5696 urls += "?" + c.urlParams_.Encode() 5697 req, err := http.NewRequest("PUT", urls, body) 5698 if err != nil { 5699 return nil, err 5700 } 5701 req.Header = reqHeaders 5702 googleapi.Expand(req.URL, map[string]string{ 5703 "name": c.name, 5704 }) 5705 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5706} 5707 5708// Do executes the "dataproc.projects.locations.autoscalingPolicies.update" call. 5709// Exactly one of *AutoscalingPolicy or error will be non-nil. Any 5710// non-2xx status code is an error. Response headers are in either 5711// *AutoscalingPolicy.ServerResponse.Header or (if a response was 5712// returned at all) in error.(*googleapi.Error).Header. Use 5713// googleapi.IsNotModified to check whether the returned error was 5714// because http.StatusNotModified was returned. 5715func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 5716 gensupport.SetOptions(c.urlParams_, opts...) 5717 res, err := c.doRequest("json") 5718 if res != nil && res.StatusCode == http.StatusNotModified { 5719 if res.Body != nil { 5720 res.Body.Close() 5721 } 5722 return nil, &googleapi.Error{ 5723 Code: res.StatusCode, 5724 Header: res.Header, 5725 } 5726 } 5727 if err != nil { 5728 return nil, err 5729 } 5730 defer googleapi.CloseBody(res) 5731 if err := googleapi.CheckResponse(res); err != nil { 5732 return nil, err 5733 } 5734 ret := &AutoscalingPolicy{ 5735 ServerResponse: googleapi.ServerResponse{ 5736 Header: res.Header, 5737 HTTPStatusCode: res.StatusCode, 5738 }, 5739 } 5740 target := &ret 5741 if err := gensupport.DecodeResponse(target, res); err != nil { 5742 return nil, err 5743 } 5744 return ret, nil 5745 // { 5746 // "description": "Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements.", 5747 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}", 5748 // "httpMethod": "PUT", 5749 // "id": "dataproc.projects.locations.autoscalingPolicies.update", 5750 // "parameterOrder": [ 5751 // "name" 5752 // ], 5753 // "parameters": { 5754 // "name": { 5755 // "description": "Output only. The \"resource name\" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}", 5756 // "location": "path", 5757 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 5758 // "required": true, 5759 // "type": "string" 5760 // } 5761 // }, 5762 // "path": "v1/{+name}", 5763 // "request": { 5764 // "$ref": "AutoscalingPolicy" 5765 // }, 5766 // "response": { 5767 // "$ref": "AutoscalingPolicy" 5768 // }, 5769 // "scopes": [ 5770 // "https://www.googleapis.com/auth/cloud-platform" 5771 // ] 5772 // } 5773 5774} 5775 5776// method id "dataproc.projects.locations.workflowTemplates.create": 5777 5778type ProjectsLocationsWorkflowTemplatesCreateCall struct { 5779 s *Service 5780 parent string 5781 workflowtemplate *WorkflowTemplate 5782 urlParams_ gensupport.URLParams 5783 ctx_ context.Context 5784 header_ http.Header 5785} 5786 5787// Create: Creates new workflow template. 5788// 5789// - parent: The resource name of the region or location, as described 5790// in https://cloud.google.com/apis/design/resource_names. For 5791// projects.regions.workflowTemplates,create, the resource name of the 5792// region has the following format: 5793// projects/{project_id}/regions/{region} For 5794// projects.locations.workflowTemplates.create, the resource name of 5795// the location has the following format: 5796// projects/{project_id}/locations/{location}. 5797func (r *ProjectsLocationsWorkflowTemplatesService) Create(parent string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesCreateCall { 5798 c := &ProjectsLocationsWorkflowTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5799 c.parent = parent 5800 c.workflowtemplate = workflowtemplate 5801 return c 5802} 5803 5804// Fields allows partial responses to be retrieved. See 5805// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5806// for more information. 5807func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesCreateCall { 5808 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5809 return c 5810} 5811 5812// Context sets the context to be used in this call's Do method. Any 5813// pending HTTP request will be aborted if the provided context is 5814// canceled. 5815func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesCreateCall { 5816 c.ctx_ = ctx 5817 return c 5818} 5819 5820// Header returns an http.Header that can be modified by the caller to 5821// add HTTP headers to the request. 5822func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Header() http.Header { 5823 if c.header_ == nil { 5824 c.header_ = make(http.Header) 5825 } 5826 return c.header_ 5827} 5828 5829func (c *ProjectsLocationsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { 5830 reqHeaders := make(http.Header) 5831 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 5832 for k, v := range c.header_ { 5833 reqHeaders[k] = v 5834 } 5835 reqHeaders.Set("User-Agent", c.s.userAgent()) 5836 var body io.Reader = nil 5837 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 5838 if err != nil { 5839 return nil, err 5840 } 5841 reqHeaders.Set("Content-Type", "application/json") 5842 c.urlParams_.Set("alt", alt) 5843 c.urlParams_.Set("prettyPrint", "false") 5844 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates") 5845 urls += "?" + c.urlParams_.Encode() 5846 req, err := http.NewRequest("POST", urls, body) 5847 if err != nil { 5848 return nil, err 5849 } 5850 req.Header = reqHeaders 5851 googleapi.Expand(req.URL, map[string]string{ 5852 "parent": c.parent, 5853 }) 5854 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5855} 5856 5857// Do executes the "dataproc.projects.locations.workflowTemplates.create" call. 5858// Exactly one of *WorkflowTemplate or error will be non-nil. Any 5859// non-2xx status code is an error. Response headers are in either 5860// *WorkflowTemplate.ServerResponse.Header or (if a response was 5861// returned at all) in error.(*googleapi.Error).Header. Use 5862// googleapi.IsNotModified to check whether the returned error was 5863// because http.StatusNotModified was returned. 5864func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 5865 gensupport.SetOptions(c.urlParams_, opts...) 5866 res, err := c.doRequest("json") 5867 if res != nil && res.StatusCode == http.StatusNotModified { 5868 if res.Body != nil { 5869 res.Body.Close() 5870 } 5871 return nil, &googleapi.Error{ 5872 Code: res.StatusCode, 5873 Header: res.Header, 5874 } 5875 } 5876 if err != nil { 5877 return nil, err 5878 } 5879 defer googleapi.CloseBody(res) 5880 if err := googleapi.CheckResponse(res); err != nil { 5881 return nil, err 5882 } 5883 ret := &WorkflowTemplate{ 5884 ServerResponse: googleapi.ServerResponse{ 5885 Header: res.Header, 5886 HTTPStatusCode: res.StatusCode, 5887 }, 5888 } 5889 target := &ret 5890 if err := gensupport.DecodeResponse(target, res); err != nil { 5891 return nil, err 5892 } 5893 return ret, nil 5894 // { 5895 // "description": "Creates new workflow template.", 5896 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates", 5897 // "httpMethod": "POST", 5898 // "id": "dataproc.projects.locations.workflowTemplates.create", 5899 // "parameterOrder": [ 5900 // "parent" 5901 // ], 5902 // "parameters": { 5903 // "parent": { 5904 // "description": "Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates,create, the resource name of the region has the following format: projects/{project_id}/regions/{region} For projects.locations.workflowTemplates.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}", 5905 // "location": "path", 5906 // "pattern": "^projects/[^/]+/locations/[^/]+$", 5907 // "required": true, 5908 // "type": "string" 5909 // } 5910 // }, 5911 // "path": "v1/{+parent}/workflowTemplates", 5912 // "request": { 5913 // "$ref": "WorkflowTemplate" 5914 // }, 5915 // "response": { 5916 // "$ref": "WorkflowTemplate" 5917 // }, 5918 // "scopes": [ 5919 // "https://www.googleapis.com/auth/cloud-platform" 5920 // ] 5921 // } 5922 5923} 5924 5925// method id "dataproc.projects.locations.workflowTemplates.delete": 5926 5927type ProjectsLocationsWorkflowTemplatesDeleteCall struct { 5928 s *Service 5929 name string 5930 urlParams_ gensupport.URLParams 5931 ctx_ context.Context 5932 header_ http.Header 5933} 5934 5935// Delete: Deletes a workflow template. It does not cancel in-progress 5936// workflows. 5937// 5938// - name: The resource name of the workflow template, as described in 5939// https://cloud.google.com/apis/design/resource_names. For 5940// projects.regions.workflowTemplates.delete, the resource name of the 5941// template has the following format: 5942// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 5943// d} For projects.locations.workflowTemplates.instantiate, the 5944// resource name of the template has the following format: 5945// projects/{project_id}/locations/{location}/workflowTemplates/{templa 5946// te_id}. 5947func (r *ProjectsLocationsWorkflowTemplatesService) Delete(name string) *ProjectsLocationsWorkflowTemplatesDeleteCall { 5948 c := &ProjectsLocationsWorkflowTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5949 c.name = name 5950 return c 5951} 5952 5953// Version sets the optional parameter "version": The version of 5954// workflow template to delete. If specified, will only delete the 5955// template if the current server version matches specified version. 5956func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Version(version int64) *ProjectsLocationsWorkflowTemplatesDeleteCall { 5957 c.urlParams_.Set("version", fmt.Sprint(version)) 5958 return c 5959} 5960 5961// Fields allows partial responses to be retrieved. See 5962// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5963// for more information. 5964func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesDeleteCall { 5965 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5966 return c 5967} 5968 5969// Context sets the context to be used in this call's Do method. Any 5970// pending HTTP request will be aborted if the provided context is 5971// canceled. 5972func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesDeleteCall { 5973 c.ctx_ = ctx 5974 return c 5975} 5976 5977// Header returns an http.Header that can be modified by the caller to 5978// add HTTP headers to the request. 5979func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Header() http.Header { 5980 if c.header_ == nil { 5981 c.header_ = make(http.Header) 5982 } 5983 return c.header_ 5984} 5985 5986func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { 5987 reqHeaders := make(http.Header) 5988 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 5989 for k, v := range c.header_ { 5990 reqHeaders[k] = v 5991 } 5992 reqHeaders.Set("User-Agent", c.s.userAgent()) 5993 var body io.Reader = nil 5994 c.urlParams_.Set("alt", alt) 5995 c.urlParams_.Set("prettyPrint", "false") 5996 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 5997 urls += "?" + c.urlParams_.Encode() 5998 req, err := http.NewRequest("DELETE", urls, body) 5999 if err != nil { 6000 return nil, err 6001 } 6002 req.Header = reqHeaders 6003 googleapi.Expand(req.URL, map[string]string{ 6004 "name": c.name, 6005 }) 6006 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6007} 6008 6009// Do executes the "dataproc.projects.locations.workflowTemplates.delete" call. 6010// Exactly one of *Empty or error will be non-nil. Any non-2xx status 6011// code is an error. Response headers are in either 6012// *Empty.ServerResponse.Header or (if a response was returned at all) 6013// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6014// check whether the returned error was because http.StatusNotModified 6015// was returned. 6016func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 6017 gensupport.SetOptions(c.urlParams_, opts...) 6018 res, err := c.doRequest("json") 6019 if res != nil && res.StatusCode == http.StatusNotModified { 6020 if res.Body != nil { 6021 res.Body.Close() 6022 } 6023 return nil, &googleapi.Error{ 6024 Code: res.StatusCode, 6025 Header: res.Header, 6026 } 6027 } 6028 if err != nil { 6029 return nil, err 6030 } 6031 defer googleapi.CloseBody(res) 6032 if err := googleapi.CheckResponse(res); err != nil { 6033 return nil, err 6034 } 6035 ret := &Empty{ 6036 ServerResponse: googleapi.ServerResponse{ 6037 Header: res.Header, 6038 HTTPStatusCode: res.StatusCode, 6039 }, 6040 } 6041 target := &ret 6042 if err := gensupport.DecodeResponse(target, res); err != nil { 6043 return nil, err 6044 } 6045 return ret, nil 6046 // { 6047 // "description": "Deletes a workflow template. It does not cancel in-progress workflows.", 6048 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}", 6049 // "httpMethod": "DELETE", 6050 // "id": "dataproc.projects.locations.workflowTemplates.delete", 6051 // "parameterOrder": [ 6052 // "name" 6053 // ], 6054 // "parameters": { 6055 // "name": { 6056 // "description": "Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates.delete, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}", 6057 // "location": "path", 6058 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 6059 // "required": true, 6060 // "type": "string" 6061 // }, 6062 // "version": { 6063 // "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.", 6064 // "format": "int32", 6065 // "location": "query", 6066 // "type": "integer" 6067 // } 6068 // }, 6069 // "path": "v1/{+name}", 6070 // "response": { 6071 // "$ref": "Empty" 6072 // }, 6073 // "scopes": [ 6074 // "https://www.googleapis.com/auth/cloud-platform" 6075 // ] 6076 // } 6077 6078} 6079 6080// method id "dataproc.projects.locations.workflowTemplates.get": 6081 6082type ProjectsLocationsWorkflowTemplatesGetCall struct { 6083 s *Service 6084 name string 6085 urlParams_ gensupport.URLParams 6086 ifNoneMatch_ string 6087 ctx_ context.Context 6088 header_ http.Header 6089} 6090 6091// Get: Retrieves the latest workflow template.Can retrieve previously 6092// instantiated template by specifying optional version parameter. 6093// 6094// - name: The resource name of the workflow template, as described in 6095// https://cloud.google.com/apis/design/resource_names. For 6096// projects.regions.workflowTemplates.get, the resource name of the 6097// template has the following format: 6098// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 6099// d} For projects.locations.workflowTemplates.get, the resource name 6100// of the template has the following format: 6101// projects/{project_id}/locations/{location}/workflowTemplates/{templa 6102// te_id}. 6103func (r *ProjectsLocationsWorkflowTemplatesService) Get(name string) *ProjectsLocationsWorkflowTemplatesGetCall { 6104 c := &ProjectsLocationsWorkflowTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6105 c.name = name 6106 return c 6107} 6108 6109// Version sets the optional parameter "version": The version of 6110// workflow template to retrieve. Only previously instantiated versions 6111// can be retrieved.If unspecified, retrieves the current version. 6112func (c *ProjectsLocationsWorkflowTemplatesGetCall) Version(version int64) *ProjectsLocationsWorkflowTemplatesGetCall { 6113 c.urlParams_.Set("version", fmt.Sprint(version)) 6114 return c 6115} 6116 6117// Fields allows partial responses to be retrieved. See 6118// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6119// for more information. 6120func (c *ProjectsLocationsWorkflowTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesGetCall { 6121 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6122 return c 6123} 6124 6125// IfNoneMatch sets the optional parameter which makes the operation 6126// fail if the object's ETag matches the given value. This is useful for 6127// getting updates only after the object has changed since the last 6128// request. Use googleapi.IsNotModified to check whether the response 6129// error from Do is the result of In-None-Match. 6130func (c *ProjectsLocationsWorkflowTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesGetCall { 6131 c.ifNoneMatch_ = entityTag 6132 return c 6133} 6134 6135// Context sets the context to be used in this call's Do method. Any 6136// pending HTTP request will be aborted if the provided context is 6137// canceled. 6138func (c *ProjectsLocationsWorkflowTemplatesGetCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesGetCall { 6139 c.ctx_ = ctx 6140 return c 6141} 6142 6143// Header returns an http.Header that can be modified by the caller to 6144// add HTTP headers to the request. 6145func (c *ProjectsLocationsWorkflowTemplatesGetCall) Header() http.Header { 6146 if c.header_ == nil { 6147 c.header_ = make(http.Header) 6148 } 6149 return c.header_ 6150} 6151 6152func (c *ProjectsLocationsWorkflowTemplatesGetCall) doRequest(alt string) (*http.Response, error) { 6153 reqHeaders := make(http.Header) 6154 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 6155 for k, v := range c.header_ { 6156 reqHeaders[k] = v 6157 } 6158 reqHeaders.Set("User-Agent", c.s.userAgent()) 6159 if c.ifNoneMatch_ != "" { 6160 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6161 } 6162 var body io.Reader = nil 6163 c.urlParams_.Set("alt", alt) 6164 c.urlParams_.Set("prettyPrint", "false") 6165 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 6166 urls += "?" + c.urlParams_.Encode() 6167 req, err := http.NewRequest("GET", urls, body) 6168 if err != nil { 6169 return nil, err 6170 } 6171 req.Header = reqHeaders 6172 googleapi.Expand(req.URL, map[string]string{ 6173 "name": c.name, 6174 }) 6175 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6176} 6177 6178// Do executes the "dataproc.projects.locations.workflowTemplates.get" call. 6179// Exactly one of *WorkflowTemplate or error will be non-nil. Any 6180// non-2xx status code is an error. Response headers are in either 6181// *WorkflowTemplate.ServerResponse.Header or (if a response was 6182// returned at all) in error.(*googleapi.Error).Header. Use 6183// googleapi.IsNotModified to check whether the returned error was 6184// because http.StatusNotModified was returned. 6185func (c *ProjectsLocationsWorkflowTemplatesGetCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 6186 gensupport.SetOptions(c.urlParams_, opts...) 6187 res, err := c.doRequest("json") 6188 if res != nil && res.StatusCode == http.StatusNotModified { 6189 if res.Body != nil { 6190 res.Body.Close() 6191 } 6192 return nil, &googleapi.Error{ 6193 Code: res.StatusCode, 6194 Header: res.Header, 6195 } 6196 } 6197 if err != nil { 6198 return nil, err 6199 } 6200 defer googleapi.CloseBody(res) 6201 if err := googleapi.CheckResponse(res); err != nil { 6202 return nil, err 6203 } 6204 ret := &WorkflowTemplate{ 6205 ServerResponse: googleapi.ServerResponse{ 6206 Header: res.Header, 6207 HTTPStatusCode: res.StatusCode, 6208 }, 6209 } 6210 target := &ret 6211 if err := gensupport.DecodeResponse(target, res); err != nil { 6212 return nil, err 6213 } 6214 return ret, nil 6215 // { 6216 // "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.", 6217 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}", 6218 // "httpMethod": "GET", 6219 // "id": "dataproc.projects.locations.workflowTemplates.get", 6220 // "parameterOrder": [ 6221 // "name" 6222 // ], 6223 // "parameters": { 6224 // "name": { 6225 // "description": "Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For projects.locations.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}", 6226 // "location": "path", 6227 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 6228 // "required": true, 6229 // "type": "string" 6230 // }, 6231 // "version": { 6232 // "description": "Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.If unspecified, retrieves the current version.", 6233 // "format": "int32", 6234 // "location": "query", 6235 // "type": "integer" 6236 // } 6237 // }, 6238 // "path": "v1/{+name}", 6239 // "response": { 6240 // "$ref": "WorkflowTemplate" 6241 // }, 6242 // "scopes": [ 6243 // "https://www.googleapis.com/auth/cloud-platform" 6244 // ] 6245 // } 6246 6247} 6248 6249// method id "dataproc.projects.locations.workflowTemplates.getIamPolicy": 6250 6251type ProjectsLocationsWorkflowTemplatesGetIamPolicyCall struct { 6252 s *Service 6253 resource string 6254 getiampolicyrequest *GetIamPolicyRequest 6255 urlParams_ gensupport.URLParams 6256 ctx_ context.Context 6257 header_ http.Header 6258} 6259 6260// GetIamPolicy: Gets the access control policy for a resource. Returns 6261// an empty policy if the resource exists and does not have a policy 6262// set. 6263// 6264// - resource: REQUIRED: The resource for which the policy is being 6265// requested. See the operation documentation for the appropriate 6266// value for this field. 6267func (r *ProjectsLocationsWorkflowTemplatesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall { 6268 c := &ProjectsLocationsWorkflowTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6269 c.resource = resource 6270 c.getiampolicyrequest = getiampolicyrequest 6271 return c 6272} 6273 6274// Fields allows partial responses to be retrieved. See 6275// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6276// for more information. 6277func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall { 6278 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6279 return c 6280} 6281 6282// Context sets the context to be used in this call's Do method. Any 6283// pending HTTP request will be aborted if the provided context is 6284// canceled. 6285func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall { 6286 c.ctx_ = ctx 6287 return c 6288} 6289 6290// Header returns an http.Header that can be modified by the caller to 6291// add HTTP headers to the request. 6292func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Header() http.Header { 6293 if c.header_ == nil { 6294 c.header_ = make(http.Header) 6295 } 6296 return c.header_ 6297} 6298 6299func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 6300 reqHeaders := make(http.Header) 6301 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 6302 for k, v := range c.header_ { 6303 reqHeaders[k] = v 6304 } 6305 reqHeaders.Set("User-Agent", c.s.userAgent()) 6306 var body io.Reader = nil 6307 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 6308 if err != nil { 6309 return nil, err 6310 } 6311 reqHeaders.Set("Content-Type", "application/json") 6312 c.urlParams_.Set("alt", alt) 6313 c.urlParams_.Set("prettyPrint", "false") 6314 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") 6315 urls += "?" + c.urlParams_.Encode() 6316 req, err := http.NewRequest("POST", urls, body) 6317 if err != nil { 6318 return nil, err 6319 } 6320 req.Header = reqHeaders 6321 googleapi.Expand(req.URL, map[string]string{ 6322 "resource": c.resource, 6323 }) 6324 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6325} 6326 6327// Do executes the "dataproc.projects.locations.workflowTemplates.getIamPolicy" call. 6328// Exactly one of *Policy or error will be non-nil. Any non-2xx status 6329// code is an error. Response headers are in either 6330// *Policy.ServerResponse.Header or (if a response was returned at all) 6331// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6332// check whether the returned error was because http.StatusNotModified 6333// was returned. 6334func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 6335 gensupport.SetOptions(c.urlParams_, opts...) 6336 res, err := c.doRequest("json") 6337 if res != nil && res.StatusCode == http.StatusNotModified { 6338 if res.Body != nil { 6339 res.Body.Close() 6340 } 6341 return nil, &googleapi.Error{ 6342 Code: res.StatusCode, 6343 Header: res.Header, 6344 } 6345 } 6346 if err != nil { 6347 return nil, err 6348 } 6349 defer googleapi.CloseBody(res) 6350 if err := googleapi.CheckResponse(res); err != nil { 6351 return nil, err 6352 } 6353 ret := &Policy{ 6354 ServerResponse: googleapi.ServerResponse{ 6355 Header: res.Header, 6356 HTTPStatusCode: res.StatusCode, 6357 }, 6358 } 6359 target := &ret 6360 if err := gensupport.DecodeResponse(target, res); err != nil { 6361 return nil, err 6362 } 6363 return ret, nil 6364 // { 6365 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 6366 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:getIamPolicy", 6367 // "httpMethod": "POST", 6368 // "id": "dataproc.projects.locations.workflowTemplates.getIamPolicy", 6369 // "parameterOrder": [ 6370 // "resource" 6371 // ], 6372 // "parameters": { 6373 // "resource": { 6374 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 6375 // "location": "path", 6376 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 6377 // "required": true, 6378 // "type": "string" 6379 // } 6380 // }, 6381 // "path": "v1/{+resource}:getIamPolicy", 6382 // "request": { 6383 // "$ref": "GetIamPolicyRequest" 6384 // }, 6385 // "response": { 6386 // "$ref": "Policy" 6387 // }, 6388 // "scopes": [ 6389 // "https://www.googleapis.com/auth/cloud-platform" 6390 // ] 6391 // } 6392 6393} 6394 6395// method id "dataproc.projects.locations.workflowTemplates.instantiate": 6396 6397type ProjectsLocationsWorkflowTemplatesInstantiateCall struct { 6398 s *Service 6399 name string 6400 instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest 6401 urlParams_ gensupport.URLParams 6402 ctx_ context.Context 6403 header_ http.Header 6404} 6405 6406// Instantiate: Instantiates a template and begins execution.The 6407// returned Operation can be used to track execution of workflow by 6408// polling operations.get. The Operation will complete when entire 6409// workflow is finished.The running workflow can be aborted via 6410// operations.cancel. This will cause any inflight jobs to be cancelled 6411// and workflow-owned clusters to be deleted.The Operation.metadata will 6412// be WorkflowMetadata 6413// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). 6414// Also see Using WorkflowMetadata 6415// (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On 6416// successful completion, Operation.response will be Empty. 6417// 6418// - name: The resource name of the workflow template, as described in 6419// https://cloud.google.com/apis/design/resource_names. For 6420// projects.regions.workflowTemplates.instantiate, the resource name 6421// of the template has the following format: 6422// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 6423// d} For projects.locations.workflowTemplates.instantiate, the 6424// resource name of the template has the following format: 6425// projects/{project_id}/locations/{location}/workflowTemplates/{templa 6426// te_id}. 6427func (r *ProjectsLocationsWorkflowTemplatesService) Instantiate(name string, instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest) *ProjectsLocationsWorkflowTemplatesInstantiateCall { 6428 c := &ProjectsLocationsWorkflowTemplatesInstantiateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6429 c.name = name 6430 c.instantiateworkflowtemplaterequest = instantiateworkflowtemplaterequest 6431 return c 6432} 6433 6434// Fields allows partial responses to be retrieved. See 6435// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6436// for more information. 6437func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesInstantiateCall { 6438 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6439 return c 6440} 6441 6442// Context sets the context to be used in this call's Do method. Any 6443// pending HTTP request will be aborted if the provided context is 6444// canceled. 6445func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesInstantiateCall { 6446 c.ctx_ = ctx 6447 return c 6448} 6449 6450// Header returns an http.Header that can be modified by the caller to 6451// add HTTP headers to the request. 6452func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Header() http.Header { 6453 if c.header_ == nil { 6454 c.header_ = make(http.Header) 6455 } 6456 return c.header_ 6457} 6458 6459func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) { 6460 reqHeaders := make(http.Header) 6461 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 6462 for k, v := range c.header_ { 6463 reqHeaders[k] = v 6464 } 6465 reqHeaders.Set("User-Agent", c.s.userAgent()) 6466 var body io.Reader = nil 6467 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest) 6468 if err != nil { 6469 return nil, err 6470 } 6471 reqHeaders.Set("Content-Type", "application/json") 6472 c.urlParams_.Set("alt", alt) 6473 c.urlParams_.Set("prettyPrint", "false") 6474 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:instantiate") 6475 urls += "?" + c.urlParams_.Encode() 6476 req, err := http.NewRequest("POST", urls, body) 6477 if err != nil { 6478 return nil, err 6479 } 6480 req.Header = reqHeaders 6481 googleapi.Expand(req.URL, map[string]string{ 6482 "name": c.name, 6483 }) 6484 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6485} 6486 6487// Do executes the "dataproc.projects.locations.workflowTemplates.instantiate" call. 6488// Exactly one of *Operation or error will be non-nil. Any non-2xx 6489// status code is an error. Response headers are in either 6490// *Operation.ServerResponse.Header or (if a response was returned at 6491// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6492// to check whether the returned error was because 6493// http.StatusNotModified was returned. 6494func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6495 gensupport.SetOptions(c.urlParams_, opts...) 6496 res, err := c.doRequest("json") 6497 if res != nil && res.StatusCode == http.StatusNotModified { 6498 if res.Body != nil { 6499 res.Body.Close() 6500 } 6501 return nil, &googleapi.Error{ 6502 Code: res.StatusCode, 6503 Header: res.Header, 6504 } 6505 } 6506 if err != nil { 6507 return nil, err 6508 } 6509 defer googleapi.CloseBody(res) 6510 if err := googleapi.CheckResponse(res); err != nil { 6511 return nil, err 6512 } 6513 ret := &Operation{ 6514 ServerResponse: googleapi.ServerResponse{ 6515 Header: res.Header, 6516 HTTPStatusCode: res.StatusCode, 6517 }, 6518 } 6519 target := &ret 6520 if err := gensupport.DecodeResponse(target, res); err != nil { 6521 return nil, err 6522 } 6523 return ret, nil 6524 // { 6525 // "description": "Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty.", 6526 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:instantiate", 6527 // "httpMethod": "POST", 6528 // "id": "dataproc.projects.locations.workflowTemplates.instantiate", 6529 // "parameterOrder": [ 6530 // "name" 6531 // ], 6532 // "parameters": { 6533 // "name": { 6534 // "description": "Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}", 6535 // "location": "path", 6536 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 6537 // "required": true, 6538 // "type": "string" 6539 // } 6540 // }, 6541 // "path": "v1/{+name}:instantiate", 6542 // "request": { 6543 // "$ref": "InstantiateWorkflowTemplateRequest" 6544 // }, 6545 // "response": { 6546 // "$ref": "Operation" 6547 // }, 6548 // "scopes": [ 6549 // "https://www.googleapis.com/auth/cloud-platform" 6550 // ] 6551 // } 6552 6553} 6554 6555// method id "dataproc.projects.locations.workflowTemplates.instantiateInline": 6556 6557type ProjectsLocationsWorkflowTemplatesInstantiateInlineCall struct { 6558 s *Service 6559 parent string 6560 workflowtemplate *WorkflowTemplate 6561 urlParams_ gensupport.URLParams 6562 ctx_ context.Context 6563 header_ http.Header 6564} 6565 6566// InstantiateInline: Instantiates a template and begins execution.This 6567// method is equivalent to executing the sequence 6568// CreateWorkflowTemplate, InstantiateWorkflowTemplate, 6569// DeleteWorkflowTemplate.The returned Operation can be used to track 6570// execution of workflow by polling operations.get. The Operation will 6571// complete when entire workflow is finished.The running workflow can be 6572// aborted via operations.cancel. This will cause any inflight jobs to 6573// be cancelled and workflow-owned clusters to be deleted.The 6574// Operation.metadata will be WorkflowMetadata 6575// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). 6576// Also see Using WorkflowMetadata 6577// (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On 6578// successful completion, Operation.response will be Empty. 6579// 6580// - parent: The resource name of the region or location, as described 6581// in https://cloud.google.com/apis/design/resource_names. For 6582// projects.regions.workflowTemplates,instantiateinline, the resource 6583// name of the region has the following format: 6584// projects/{project_id}/regions/{region} For 6585// projects.locations.workflowTemplates.instantiateinline, the 6586// resource name of the location has the following format: 6587// projects/{project_id}/locations/{location}. 6588func (r *ProjectsLocationsWorkflowTemplatesService) InstantiateInline(parent string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6589 c := &ProjectsLocationsWorkflowTemplatesInstantiateInlineCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6590 c.parent = parent 6591 c.workflowtemplate = workflowtemplate 6592 return c 6593} 6594 6595// RequestId sets the optional parameter "requestId": A tag that 6596// prevents multiple concurrent workflow instances with the same tag 6597// from running. This mitigates risk of concurrent instances started due 6598// to retries.It is recommended to always set this value to a UUID 6599// (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag 6600// must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 6601// and hyphens (-). The maximum length is 40 characters. 6602func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) RequestId(requestId string) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6603 c.urlParams_.Set("requestId", requestId) 6604 return c 6605} 6606 6607// Fields allows partial responses to be retrieved. See 6608// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6609// for more information. 6610func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6611 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6612 return c 6613} 6614 6615// Context sets the context to be used in this call's Do method. Any 6616// pending HTTP request will be aborted if the provided context is 6617// canceled. 6618func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6619 c.ctx_ = ctx 6620 return c 6621} 6622 6623// Header returns an http.Header that can be modified by the caller to 6624// add HTTP headers to the request. 6625func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Header() http.Header { 6626 if c.header_ == nil { 6627 c.header_ = make(http.Header) 6628 } 6629 return c.header_ 6630} 6631 6632func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) { 6633 reqHeaders := make(http.Header) 6634 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 6635 for k, v := range c.header_ { 6636 reqHeaders[k] = v 6637 } 6638 reqHeaders.Set("User-Agent", c.s.userAgent()) 6639 var body io.Reader = nil 6640 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 6641 if err != nil { 6642 return nil, err 6643 } 6644 reqHeaders.Set("Content-Type", "application/json") 6645 c.urlParams_.Set("alt", alt) 6646 c.urlParams_.Set("prettyPrint", "false") 6647 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates:instantiateInline") 6648 urls += "?" + c.urlParams_.Encode() 6649 req, err := http.NewRequest("POST", urls, body) 6650 if err != nil { 6651 return nil, err 6652 } 6653 req.Header = reqHeaders 6654 googleapi.Expand(req.URL, map[string]string{ 6655 "parent": c.parent, 6656 }) 6657 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6658} 6659 6660// Do executes the "dataproc.projects.locations.workflowTemplates.instantiateInline" call. 6661// Exactly one of *Operation or error will be non-nil. Any non-2xx 6662// status code is an error. Response headers are in either 6663// *Operation.ServerResponse.Header or (if a response was returned at 6664// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6665// to check whether the returned error was because 6666// http.StatusNotModified was returned. 6667func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6668 gensupport.SetOptions(c.urlParams_, opts...) 6669 res, err := c.doRequest("json") 6670 if res != nil && res.StatusCode == http.StatusNotModified { 6671 if res.Body != nil { 6672 res.Body.Close() 6673 } 6674 return nil, &googleapi.Error{ 6675 Code: res.StatusCode, 6676 Header: res.Header, 6677 } 6678 } 6679 if err != nil { 6680 return nil, err 6681 } 6682 defer googleapi.CloseBody(res) 6683 if err := googleapi.CheckResponse(res); err != nil { 6684 return nil, err 6685 } 6686 ret := &Operation{ 6687 ServerResponse: googleapi.ServerResponse{ 6688 Header: res.Header, 6689 HTTPStatusCode: res.StatusCode, 6690 }, 6691 } 6692 target := &ret 6693 if err := gensupport.DecodeResponse(target, res); err != nil { 6694 return nil, err 6695 } 6696 return ret, nil 6697 // { 6698 // "description": "Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty.", 6699 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates:instantiateInline", 6700 // "httpMethod": "POST", 6701 // "id": "dataproc.projects.locations.workflowTemplates.instantiateInline", 6702 // "parameterOrder": [ 6703 // "parent" 6704 // ], 6705 // "parameters": { 6706 // "parent": { 6707 // "description": "Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates,instantiateinline, the resource name of the region has the following format: projects/{project_id}/regions/{region} For projects.locations.workflowTemplates.instantiateinline, the resource name of the location has the following format: projects/{project_id}/locations/{location}", 6708 // "location": "path", 6709 // "pattern": "^projects/[^/]+/locations/[^/]+$", 6710 // "required": true, 6711 // "type": "string" 6712 // }, 6713 // "requestId": { 6714 // "description": "Optional. A tag that prevents multiple concurrent workflow instances with the same tag from running. This mitigates risk of concurrent instances started due to retries.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", 6715 // "location": "query", 6716 // "type": "string" 6717 // } 6718 // }, 6719 // "path": "v1/{+parent}/workflowTemplates:instantiateInline", 6720 // "request": { 6721 // "$ref": "WorkflowTemplate" 6722 // }, 6723 // "response": { 6724 // "$ref": "Operation" 6725 // }, 6726 // "scopes": [ 6727 // "https://www.googleapis.com/auth/cloud-platform" 6728 // ] 6729 // } 6730 6731} 6732 6733// method id "dataproc.projects.locations.workflowTemplates.list": 6734 6735type ProjectsLocationsWorkflowTemplatesListCall struct { 6736 s *Service 6737 parent string 6738 urlParams_ gensupport.URLParams 6739 ifNoneMatch_ string 6740 ctx_ context.Context 6741 header_ http.Header 6742} 6743 6744// List: Lists workflows that match the specified filter in the request. 6745// 6746// - parent: The resource name of the region or location, as described 6747// in https://cloud.google.com/apis/design/resource_names. For 6748// projects.regions.workflowTemplates,list, the resource name of the 6749// region has the following format: 6750// projects/{project_id}/regions/{region} For 6751// projects.locations.workflowTemplates.list, the resource name of the 6752// location has the following format: 6753// projects/{project_id}/locations/{location}. 6754func (r *ProjectsLocationsWorkflowTemplatesService) List(parent string) *ProjectsLocationsWorkflowTemplatesListCall { 6755 c := &ProjectsLocationsWorkflowTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6756 c.parent = parent 6757 return c 6758} 6759 6760// PageSize sets the optional parameter "pageSize": The maximum number 6761// of results to return in each response. 6762func (c *ProjectsLocationsWorkflowTemplatesListCall) PageSize(pageSize int64) *ProjectsLocationsWorkflowTemplatesListCall { 6763 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6764 return c 6765} 6766 6767// PageToken sets the optional parameter "pageToken": The page token, 6768// returned by a previous call, to request the next page of results. 6769func (c *ProjectsLocationsWorkflowTemplatesListCall) PageToken(pageToken string) *ProjectsLocationsWorkflowTemplatesListCall { 6770 c.urlParams_.Set("pageToken", pageToken) 6771 return c 6772} 6773 6774// Fields allows partial responses to be retrieved. See 6775// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6776// for more information. 6777func (c *ProjectsLocationsWorkflowTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesListCall { 6778 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6779 return c 6780} 6781 6782// IfNoneMatch sets the optional parameter which makes the operation 6783// fail if the object's ETag matches the given value. This is useful for 6784// getting updates only after the object has changed since the last 6785// request. Use googleapi.IsNotModified to check whether the response 6786// error from Do is the result of In-None-Match. 6787func (c *ProjectsLocationsWorkflowTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesListCall { 6788 c.ifNoneMatch_ = entityTag 6789 return c 6790} 6791 6792// Context sets the context to be used in this call's Do method. Any 6793// pending HTTP request will be aborted if the provided context is 6794// canceled. 6795func (c *ProjectsLocationsWorkflowTemplatesListCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesListCall { 6796 c.ctx_ = ctx 6797 return c 6798} 6799 6800// Header returns an http.Header that can be modified by the caller to 6801// add HTTP headers to the request. 6802func (c *ProjectsLocationsWorkflowTemplatesListCall) Header() http.Header { 6803 if c.header_ == nil { 6804 c.header_ = make(http.Header) 6805 } 6806 return c.header_ 6807} 6808 6809func (c *ProjectsLocationsWorkflowTemplatesListCall) doRequest(alt string) (*http.Response, error) { 6810 reqHeaders := make(http.Header) 6811 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 6812 for k, v := range c.header_ { 6813 reqHeaders[k] = v 6814 } 6815 reqHeaders.Set("User-Agent", c.s.userAgent()) 6816 if c.ifNoneMatch_ != "" { 6817 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6818 } 6819 var body io.Reader = nil 6820 c.urlParams_.Set("alt", alt) 6821 c.urlParams_.Set("prettyPrint", "false") 6822 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates") 6823 urls += "?" + c.urlParams_.Encode() 6824 req, err := http.NewRequest("GET", urls, body) 6825 if err != nil { 6826 return nil, err 6827 } 6828 req.Header = reqHeaders 6829 googleapi.Expand(req.URL, map[string]string{ 6830 "parent": c.parent, 6831 }) 6832 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6833} 6834 6835// Do executes the "dataproc.projects.locations.workflowTemplates.list" call. 6836// Exactly one of *ListWorkflowTemplatesResponse or error will be 6837// non-nil. Any non-2xx status code is an error. Response headers are in 6838// either *ListWorkflowTemplatesResponse.ServerResponse.Header or (if a 6839// response was returned at all) in error.(*googleapi.Error).Header. Use 6840// googleapi.IsNotModified to check whether the returned error was 6841// because http.StatusNotModified was returned. 6842func (c *ProjectsLocationsWorkflowTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowTemplatesResponse, error) { 6843 gensupport.SetOptions(c.urlParams_, opts...) 6844 res, err := c.doRequest("json") 6845 if res != nil && res.StatusCode == http.StatusNotModified { 6846 if res.Body != nil { 6847 res.Body.Close() 6848 } 6849 return nil, &googleapi.Error{ 6850 Code: res.StatusCode, 6851 Header: res.Header, 6852 } 6853 } 6854 if err != nil { 6855 return nil, err 6856 } 6857 defer googleapi.CloseBody(res) 6858 if err := googleapi.CheckResponse(res); err != nil { 6859 return nil, err 6860 } 6861 ret := &ListWorkflowTemplatesResponse{ 6862 ServerResponse: googleapi.ServerResponse{ 6863 Header: res.Header, 6864 HTTPStatusCode: res.StatusCode, 6865 }, 6866 } 6867 target := &ret 6868 if err := gensupport.DecodeResponse(target, res); err != nil { 6869 return nil, err 6870 } 6871 return ret, nil 6872 // { 6873 // "description": "Lists workflows that match the specified filter in the request.", 6874 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates", 6875 // "httpMethod": "GET", 6876 // "id": "dataproc.projects.locations.workflowTemplates.list", 6877 // "parameterOrder": [ 6878 // "parent" 6879 // ], 6880 // "parameters": { 6881 // "pageSize": { 6882 // "description": "Optional. The maximum number of results to return in each response.", 6883 // "format": "int32", 6884 // "location": "query", 6885 // "type": "integer" 6886 // }, 6887 // "pageToken": { 6888 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 6889 // "location": "query", 6890 // "type": "string" 6891 // }, 6892 // "parent": { 6893 // "description": "Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates,list, the resource name of the region has the following format: projects/{project_id}/regions/{region} For projects.locations.workflowTemplates.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}", 6894 // "location": "path", 6895 // "pattern": "^projects/[^/]+/locations/[^/]+$", 6896 // "required": true, 6897 // "type": "string" 6898 // } 6899 // }, 6900 // "path": "v1/{+parent}/workflowTemplates", 6901 // "response": { 6902 // "$ref": "ListWorkflowTemplatesResponse" 6903 // }, 6904 // "scopes": [ 6905 // "https://www.googleapis.com/auth/cloud-platform" 6906 // ] 6907 // } 6908 6909} 6910 6911// Pages invokes f for each page of results. 6912// A non-nil error returned from f will halt the iteration. 6913// The provided context supersedes any context provided to the Context method. 6914func (c *ProjectsLocationsWorkflowTemplatesListCall) Pages(ctx context.Context, f func(*ListWorkflowTemplatesResponse) error) error { 6915 c.ctx_ = ctx 6916 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6917 for { 6918 x, err := c.Do() 6919 if err != nil { 6920 return err 6921 } 6922 if err := f(x); err != nil { 6923 return err 6924 } 6925 if x.NextPageToken == "" { 6926 return nil 6927 } 6928 c.PageToken(x.NextPageToken) 6929 } 6930} 6931 6932// method id "dataproc.projects.locations.workflowTemplates.setIamPolicy": 6933 6934type ProjectsLocationsWorkflowTemplatesSetIamPolicyCall struct { 6935 s *Service 6936 resource string 6937 setiampolicyrequest *SetIamPolicyRequest 6938 urlParams_ gensupport.URLParams 6939 ctx_ context.Context 6940 header_ http.Header 6941} 6942 6943// SetIamPolicy: Sets the access control policy on the specified 6944// resource. Replaces any existing policy.Can return NOT_FOUND, 6945// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 6946// 6947// - resource: REQUIRED: The resource for which the policy is being 6948// specified. See the operation documentation for the appropriate 6949// value for this field. 6950func (r *ProjectsLocationsWorkflowTemplatesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall { 6951 c := &ProjectsLocationsWorkflowTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6952 c.resource = resource 6953 c.setiampolicyrequest = setiampolicyrequest 6954 return c 6955} 6956 6957// Fields allows partial responses to be retrieved. See 6958// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6959// for more information. 6960func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall { 6961 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6962 return c 6963} 6964 6965// Context sets the context to be used in this call's Do method. Any 6966// pending HTTP request will be aborted if the provided context is 6967// canceled. 6968func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall { 6969 c.ctx_ = ctx 6970 return c 6971} 6972 6973// Header returns an http.Header that can be modified by the caller to 6974// add HTTP headers to the request. 6975func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Header() http.Header { 6976 if c.header_ == nil { 6977 c.header_ = make(http.Header) 6978 } 6979 return c.header_ 6980} 6981 6982func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 6983 reqHeaders := make(http.Header) 6984 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 6985 for k, v := range c.header_ { 6986 reqHeaders[k] = v 6987 } 6988 reqHeaders.Set("User-Agent", c.s.userAgent()) 6989 var body io.Reader = nil 6990 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 6991 if err != nil { 6992 return nil, err 6993 } 6994 reqHeaders.Set("Content-Type", "application/json") 6995 c.urlParams_.Set("alt", alt) 6996 c.urlParams_.Set("prettyPrint", "false") 6997 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") 6998 urls += "?" + c.urlParams_.Encode() 6999 req, err := http.NewRequest("POST", urls, body) 7000 if err != nil { 7001 return nil, err 7002 } 7003 req.Header = reqHeaders 7004 googleapi.Expand(req.URL, map[string]string{ 7005 "resource": c.resource, 7006 }) 7007 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7008} 7009 7010// Do executes the "dataproc.projects.locations.workflowTemplates.setIamPolicy" call. 7011// Exactly one of *Policy or error will be non-nil. Any non-2xx status 7012// code is an error. Response headers are in either 7013// *Policy.ServerResponse.Header or (if a response was returned at all) 7014// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7015// check whether the returned error was because http.StatusNotModified 7016// was returned. 7017func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 7018 gensupport.SetOptions(c.urlParams_, opts...) 7019 res, err := c.doRequest("json") 7020 if res != nil && res.StatusCode == http.StatusNotModified { 7021 if res.Body != nil { 7022 res.Body.Close() 7023 } 7024 return nil, &googleapi.Error{ 7025 Code: res.StatusCode, 7026 Header: res.Header, 7027 } 7028 } 7029 if err != nil { 7030 return nil, err 7031 } 7032 defer googleapi.CloseBody(res) 7033 if err := googleapi.CheckResponse(res); err != nil { 7034 return nil, err 7035 } 7036 ret := &Policy{ 7037 ServerResponse: googleapi.ServerResponse{ 7038 Header: res.Header, 7039 HTTPStatusCode: res.StatusCode, 7040 }, 7041 } 7042 target := &ret 7043 if err := gensupport.DecodeResponse(target, res); err != nil { 7044 return nil, err 7045 } 7046 return ret, nil 7047 // { 7048 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 7049 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:setIamPolicy", 7050 // "httpMethod": "POST", 7051 // "id": "dataproc.projects.locations.workflowTemplates.setIamPolicy", 7052 // "parameterOrder": [ 7053 // "resource" 7054 // ], 7055 // "parameters": { 7056 // "resource": { 7057 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 7058 // "location": "path", 7059 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 7060 // "required": true, 7061 // "type": "string" 7062 // } 7063 // }, 7064 // "path": "v1/{+resource}:setIamPolicy", 7065 // "request": { 7066 // "$ref": "SetIamPolicyRequest" 7067 // }, 7068 // "response": { 7069 // "$ref": "Policy" 7070 // }, 7071 // "scopes": [ 7072 // "https://www.googleapis.com/auth/cloud-platform" 7073 // ] 7074 // } 7075 7076} 7077 7078// method id "dataproc.projects.locations.workflowTemplates.testIamPermissions": 7079 7080type ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall struct { 7081 s *Service 7082 resource string 7083 testiampermissionsrequest *TestIamPermissionsRequest 7084 urlParams_ gensupport.URLParams 7085 ctx_ context.Context 7086 header_ http.Header 7087} 7088 7089// TestIamPermissions: Returns permissions that a caller has on the 7090// specified resource. If the resource does not exist, this will return 7091// an empty set of permissions, not a NOT_FOUND error.Note: This 7092// operation is designed to be used for building permission-aware UIs 7093// and command-line tools, not for authorization checking. This 7094// operation may "fail open" without warning. 7095// 7096// - resource: REQUIRED: The resource for which the policy detail is 7097// being requested. See the operation documentation for the 7098// appropriate value for this field. 7099func (r *ProjectsLocationsWorkflowTemplatesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall { 7100 c := &ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7101 c.resource = resource 7102 c.testiampermissionsrequest = testiampermissionsrequest 7103 return c 7104} 7105 7106// Fields allows partial responses to be retrieved. See 7107// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7108// for more information. 7109func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall { 7110 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7111 return c 7112} 7113 7114// Context sets the context to be used in this call's Do method. Any 7115// pending HTTP request will be aborted if the provided context is 7116// canceled. 7117func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall { 7118 c.ctx_ = ctx 7119 return c 7120} 7121 7122// Header returns an http.Header that can be modified by the caller to 7123// add HTTP headers to the request. 7124func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Header() http.Header { 7125 if c.header_ == nil { 7126 c.header_ = make(http.Header) 7127 } 7128 return c.header_ 7129} 7130 7131func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 7132 reqHeaders := make(http.Header) 7133 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 7134 for k, v := range c.header_ { 7135 reqHeaders[k] = v 7136 } 7137 reqHeaders.Set("User-Agent", c.s.userAgent()) 7138 var body io.Reader = nil 7139 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 7140 if err != nil { 7141 return nil, err 7142 } 7143 reqHeaders.Set("Content-Type", "application/json") 7144 c.urlParams_.Set("alt", alt) 7145 c.urlParams_.Set("prettyPrint", "false") 7146 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") 7147 urls += "?" + c.urlParams_.Encode() 7148 req, err := http.NewRequest("POST", urls, body) 7149 if err != nil { 7150 return nil, err 7151 } 7152 req.Header = reqHeaders 7153 googleapi.Expand(req.URL, map[string]string{ 7154 "resource": c.resource, 7155 }) 7156 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7157} 7158 7159// Do executes the "dataproc.projects.locations.workflowTemplates.testIamPermissions" call. 7160// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 7161// Any non-2xx status code is an error. Response headers are in either 7162// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 7163// was returned at all) in error.(*googleapi.Error).Header. Use 7164// googleapi.IsNotModified to check whether the returned error was 7165// because http.StatusNotModified was returned. 7166func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 7167 gensupport.SetOptions(c.urlParams_, opts...) 7168 res, err := c.doRequest("json") 7169 if res != nil && res.StatusCode == http.StatusNotModified { 7170 if res.Body != nil { 7171 res.Body.Close() 7172 } 7173 return nil, &googleapi.Error{ 7174 Code: res.StatusCode, 7175 Header: res.Header, 7176 } 7177 } 7178 if err != nil { 7179 return nil, err 7180 } 7181 defer googleapi.CloseBody(res) 7182 if err := googleapi.CheckResponse(res); err != nil { 7183 return nil, err 7184 } 7185 ret := &TestIamPermissionsResponse{ 7186 ServerResponse: googleapi.ServerResponse{ 7187 Header: res.Header, 7188 HTTPStatusCode: res.StatusCode, 7189 }, 7190 } 7191 target := &ret 7192 if err := gensupport.DecodeResponse(target, res); err != nil { 7193 return nil, err 7194 } 7195 return ret, nil 7196 // { 7197 // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 7198 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:testIamPermissions", 7199 // "httpMethod": "POST", 7200 // "id": "dataproc.projects.locations.workflowTemplates.testIamPermissions", 7201 // "parameterOrder": [ 7202 // "resource" 7203 // ], 7204 // "parameters": { 7205 // "resource": { 7206 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 7207 // "location": "path", 7208 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 7209 // "required": true, 7210 // "type": "string" 7211 // } 7212 // }, 7213 // "path": "v1/{+resource}:testIamPermissions", 7214 // "request": { 7215 // "$ref": "TestIamPermissionsRequest" 7216 // }, 7217 // "response": { 7218 // "$ref": "TestIamPermissionsResponse" 7219 // }, 7220 // "scopes": [ 7221 // "https://www.googleapis.com/auth/cloud-platform" 7222 // ] 7223 // } 7224 7225} 7226 7227// method id "dataproc.projects.locations.workflowTemplates.update": 7228 7229type ProjectsLocationsWorkflowTemplatesUpdateCall struct { 7230 s *Service 7231 name string 7232 workflowtemplate *WorkflowTemplate 7233 urlParams_ gensupport.URLParams 7234 ctx_ context.Context 7235 header_ http.Header 7236} 7237 7238// Update: Updates (replaces) workflow template. The updated template 7239// must contain version that matches the current server version. 7240// 7241// - name: Output only. The resource name of the workflow template, as 7242// described in https://cloud.google.com/apis/design/resource_names. 7243// For projects.regions.workflowTemplates, the resource name of the 7244// template has the following format: 7245// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 7246// d} For projects.locations.workflowTemplates, the resource name of 7247// the template has the following format: 7248// projects/{project_id}/locations/{location}/workflowTemplates/{templa 7249// te_id}. 7250func (r *ProjectsLocationsWorkflowTemplatesService) Update(name string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesUpdateCall { 7251 c := &ProjectsLocationsWorkflowTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7252 c.name = name 7253 c.workflowtemplate = workflowtemplate 7254 return c 7255} 7256 7257// Fields allows partial responses to be retrieved. See 7258// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7259// for more information. 7260func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesUpdateCall { 7261 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7262 return c 7263} 7264 7265// Context sets the context to be used in this call's Do method. Any 7266// pending HTTP request will be aborted if the provided context is 7267// canceled. 7268func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesUpdateCall { 7269 c.ctx_ = ctx 7270 return c 7271} 7272 7273// Header returns an http.Header that can be modified by the caller to 7274// add HTTP headers to the request. 7275func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Header() http.Header { 7276 if c.header_ == nil { 7277 c.header_ = make(http.Header) 7278 } 7279 return c.header_ 7280} 7281 7282func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) { 7283 reqHeaders := make(http.Header) 7284 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 7285 for k, v := range c.header_ { 7286 reqHeaders[k] = v 7287 } 7288 reqHeaders.Set("User-Agent", c.s.userAgent()) 7289 var body io.Reader = nil 7290 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 7291 if err != nil { 7292 return nil, err 7293 } 7294 reqHeaders.Set("Content-Type", "application/json") 7295 c.urlParams_.Set("alt", alt) 7296 c.urlParams_.Set("prettyPrint", "false") 7297 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7298 urls += "?" + c.urlParams_.Encode() 7299 req, err := http.NewRequest("PUT", urls, body) 7300 if err != nil { 7301 return nil, err 7302 } 7303 req.Header = reqHeaders 7304 googleapi.Expand(req.URL, map[string]string{ 7305 "name": c.name, 7306 }) 7307 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7308} 7309 7310// Do executes the "dataproc.projects.locations.workflowTemplates.update" call. 7311// Exactly one of *WorkflowTemplate or error will be non-nil. Any 7312// non-2xx status code is an error. Response headers are in either 7313// *WorkflowTemplate.ServerResponse.Header or (if a response was 7314// returned at all) in error.(*googleapi.Error).Header. Use 7315// googleapi.IsNotModified to check whether the returned error was 7316// because http.StatusNotModified was returned. 7317func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 7318 gensupport.SetOptions(c.urlParams_, opts...) 7319 res, err := c.doRequest("json") 7320 if res != nil && res.StatusCode == http.StatusNotModified { 7321 if res.Body != nil { 7322 res.Body.Close() 7323 } 7324 return nil, &googleapi.Error{ 7325 Code: res.StatusCode, 7326 Header: res.Header, 7327 } 7328 } 7329 if err != nil { 7330 return nil, err 7331 } 7332 defer googleapi.CloseBody(res) 7333 if err := googleapi.CheckResponse(res); err != nil { 7334 return nil, err 7335 } 7336 ret := &WorkflowTemplate{ 7337 ServerResponse: googleapi.ServerResponse{ 7338 Header: res.Header, 7339 HTTPStatusCode: res.StatusCode, 7340 }, 7341 } 7342 target := &ret 7343 if err := gensupport.DecodeResponse(target, res); err != nil { 7344 return nil, err 7345 } 7346 return ret, nil 7347 // { 7348 // "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version.", 7349 // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}", 7350 // "httpMethod": "PUT", 7351 // "id": "dataproc.projects.locations.workflowTemplates.update", 7352 // "parameterOrder": [ 7353 // "name" 7354 // ], 7355 // "parameters": { 7356 // "name": { 7357 // "description": "Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}", 7358 // "location": "path", 7359 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 7360 // "required": true, 7361 // "type": "string" 7362 // } 7363 // }, 7364 // "path": "v1/{+name}", 7365 // "request": { 7366 // "$ref": "WorkflowTemplate" 7367 // }, 7368 // "response": { 7369 // "$ref": "WorkflowTemplate" 7370 // }, 7371 // "scopes": [ 7372 // "https://www.googleapis.com/auth/cloud-platform" 7373 // ] 7374 // } 7375 7376} 7377 7378// method id "dataproc.projects.regions.autoscalingPolicies.create": 7379 7380type ProjectsRegionsAutoscalingPoliciesCreateCall struct { 7381 s *Service 7382 parent string 7383 autoscalingpolicy *AutoscalingPolicy 7384 urlParams_ gensupport.URLParams 7385 ctx_ context.Context 7386 header_ http.Header 7387} 7388 7389// Create: Creates new autoscaling policy. 7390// 7391// - parent: The "resource name" of the region or location, as described 7392// in https://cloud.google.com/apis/design/resource_names. For 7393// projects.regions.autoscalingPolicies.create, the resource name of 7394// the region has the following format: 7395// projects/{project_id}/regions/{region} For 7396// projects.locations.autoscalingPolicies.create, the resource name of 7397// the location has the following format: 7398// projects/{project_id}/locations/{location}. 7399func (r *ProjectsRegionsAutoscalingPoliciesService) Create(parent string, autoscalingpolicy *AutoscalingPolicy) *ProjectsRegionsAutoscalingPoliciesCreateCall { 7400 c := &ProjectsRegionsAutoscalingPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7401 c.parent = parent 7402 c.autoscalingpolicy = autoscalingpolicy 7403 return c 7404} 7405 7406// Fields allows partial responses to be retrieved. See 7407// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7408// for more information. 7409func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesCreateCall { 7410 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7411 return c 7412} 7413 7414// Context sets the context to be used in this call's Do method. Any 7415// pending HTTP request will be aborted if the provided context is 7416// canceled. 7417func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesCreateCall { 7418 c.ctx_ = ctx 7419 return c 7420} 7421 7422// Header returns an http.Header that can be modified by the caller to 7423// add HTTP headers to the request. 7424func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Header() http.Header { 7425 if c.header_ == nil { 7426 c.header_ = make(http.Header) 7427 } 7428 return c.header_ 7429} 7430 7431func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { 7432 reqHeaders := make(http.Header) 7433 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 7434 for k, v := range c.header_ { 7435 reqHeaders[k] = v 7436 } 7437 reqHeaders.Set("User-Agent", c.s.userAgent()) 7438 var body io.Reader = nil 7439 body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) 7440 if err != nil { 7441 return nil, err 7442 } 7443 reqHeaders.Set("Content-Type", "application/json") 7444 c.urlParams_.Set("alt", alt) 7445 c.urlParams_.Set("prettyPrint", "false") 7446 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/autoscalingPolicies") 7447 urls += "?" + c.urlParams_.Encode() 7448 req, err := http.NewRequest("POST", urls, body) 7449 if err != nil { 7450 return nil, err 7451 } 7452 req.Header = reqHeaders 7453 googleapi.Expand(req.URL, map[string]string{ 7454 "parent": c.parent, 7455 }) 7456 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7457} 7458 7459// Do executes the "dataproc.projects.regions.autoscalingPolicies.create" call. 7460// Exactly one of *AutoscalingPolicy or error will be non-nil. Any 7461// non-2xx status code is an error. Response headers are in either 7462// *AutoscalingPolicy.ServerResponse.Header or (if a response was 7463// returned at all) in error.(*googleapi.Error).Header. Use 7464// googleapi.IsNotModified to check whether the returned error was 7465// because http.StatusNotModified was returned. 7466func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 7467 gensupport.SetOptions(c.urlParams_, opts...) 7468 res, err := c.doRequest("json") 7469 if res != nil && res.StatusCode == http.StatusNotModified { 7470 if res.Body != nil { 7471 res.Body.Close() 7472 } 7473 return nil, &googleapi.Error{ 7474 Code: res.StatusCode, 7475 Header: res.Header, 7476 } 7477 } 7478 if err != nil { 7479 return nil, err 7480 } 7481 defer googleapi.CloseBody(res) 7482 if err := googleapi.CheckResponse(res); err != nil { 7483 return nil, err 7484 } 7485 ret := &AutoscalingPolicy{ 7486 ServerResponse: googleapi.ServerResponse{ 7487 Header: res.Header, 7488 HTTPStatusCode: res.StatusCode, 7489 }, 7490 } 7491 target := &ret 7492 if err := gensupport.DecodeResponse(target, res); err != nil { 7493 return nil, err 7494 } 7495 return ret, nil 7496 // { 7497 // "description": "Creates new autoscaling policy.", 7498 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies", 7499 // "httpMethod": "POST", 7500 // "id": "dataproc.projects.regions.autoscalingPolicies.create", 7501 // "parameterOrder": [ 7502 // "parent" 7503 // ], 7504 // "parameters": { 7505 // "parent": { 7506 // "description": "Required. The \"resource name\" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.autoscalingPolicies.create, the resource name of the region has the following format: projects/{project_id}/regions/{region} For projects.locations.autoscalingPolicies.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}", 7507 // "location": "path", 7508 // "pattern": "^projects/[^/]+/regions/[^/]+$", 7509 // "required": true, 7510 // "type": "string" 7511 // } 7512 // }, 7513 // "path": "v1/{+parent}/autoscalingPolicies", 7514 // "request": { 7515 // "$ref": "AutoscalingPolicy" 7516 // }, 7517 // "response": { 7518 // "$ref": "AutoscalingPolicy" 7519 // }, 7520 // "scopes": [ 7521 // "https://www.googleapis.com/auth/cloud-platform" 7522 // ] 7523 // } 7524 7525} 7526 7527// method id "dataproc.projects.regions.autoscalingPolicies.delete": 7528 7529type ProjectsRegionsAutoscalingPoliciesDeleteCall struct { 7530 s *Service 7531 name string 7532 urlParams_ gensupport.URLParams 7533 ctx_ context.Context 7534 header_ http.Header 7535} 7536 7537// Delete: Deletes an autoscaling policy. It is an error to delete an 7538// autoscaling policy that is in use by one or more clusters. 7539// 7540// - name: The "resource name" of the autoscaling policy, as described 7541// in https://cloud.google.com/apis/design/resource_names. For 7542// projects.regions.autoscalingPolicies.delete, the resource name of 7543// the policy has the following format: 7544// projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 7545// d} For projects.locations.autoscalingPolicies.delete, the resource 7546// name of the policy has the following format: 7547// projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 7548// cy_id}. 7549func (r *ProjectsRegionsAutoscalingPoliciesService) Delete(name string) *ProjectsRegionsAutoscalingPoliciesDeleteCall { 7550 c := &ProjectsRegionsAutoscalingPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7551 c.name = name 7552 return c 7553} 7554 7555// Fields allows partial responses to be retrieved. See 7556// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7557// for more information. 7558func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesDeleteCall { 7559 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7560 return c 7561} 7562 7563// Context sets the context to be used in this call's Do method. Any 7564// pending HTTP request will be aborted if the provided context is 7565// canceled. 7566func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesDeleteCall { 7567 c.ctx_ = ctx 7568 return c 7569} 7570 7571// Header returns an http.Header that can be modified by the caller to 7572// add HTTP headers to the request. 7573func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Header() http.Header { 7574 if c.header_ == nil { 7575 c.header_ = make(http.Header) 7576 } 7577 return c.header_ 7578} 7579 7580func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { 7581 reqHeaders := make(http.Header) 7582 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 7583 for k, v := range c.header_ { 7584 reqHeaders[k] = v 7585 } 7586 reqHeaders.Set("User-Agent", c.s.userAgent()) 7587 var body io.Reader = nil 7588 c.urlParams_.Set("alt", alt) 7589 c.urlParams_.Set("prettyPrint", "false") 7590 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7591 urls += "?" + c.urlParams_.Encode() 7592 req, err := http.NewRequest("DELETE", urls, body) 7593 if err != nil { 7594 return nil, err 7595 } 7596 req.Header = reqHeaders 7597 googleapi.Expand(req.URL, map[string]string{ 7598 "name": c.name, 7599 }) 7600 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7601} 7602 7603// Do executes the "dataproc.projects.regions.autoscalingPolicies.delete" call. 7604// Exactly one of *Empty or error will be non-nil. Any non-2xx status 7605// code is an error. Response headers are in either 7606// *Empty.ServerResponse.Header or (if a response was returned at all) 7607// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7608// check whether the returned error was because http.StatusNotModified 7609// was returned. 7610func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 7611 gensupport.SetOptions(c.urlParams_, opts...) 7612 res, err := c.doRequest("json") 7613 if res != nil && res.StatusCode == http.StatusNotModified { 7614 if res.Body != nil { 7615 res.Body.Close() 7616 } 7617 return nil, &googleapi.Error{ 7618 Code: res.StatusCode, 7619 Header: res.Header, 7620 } 7621 } 7622 if err != nil { 7623 return nil, err 7624 } 7625 defer googleapi.CloseBody(res) 7626 if err := googleapi.CheckResponse(res); err != nil { 7627 return nil, err 7628 } 7629 ret := &Empty{ 7630 ServerResponse: googleapi.ServerResponse{ 7631 Header: res.Header, 7632 HTTPStatusCode: res.StatusCode, 7633 }, 7634 } 7635 target := &ret 7636 if err := gensupport.DecodeResponse(target, res); err != nil { 7637 return nil, err 7638 } 7639 return ret, nil 7640 // { 7641 // "description": "Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.", 7642 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}", 7643 // "httpMethod": "DELETE", 7644 // "id": "dataproc.projects.regions.autoscalingPolicies.delete", 7645 // "parameterOrder": [ 7646 // "name" 7647 // ], 7648 // "parameters": { 7649 // "name": { 7650 // "description": "Required. The \"resource name\" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} For projects.locations.autoscalingPolicies.delete, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}", 7651 // "location": "path", 7652 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 7653 // "required": true, 7654 // "type": "string" 7655 // } 7656 // }, 7657 // "path": "v1/{+name}", 7658 // "response": { 7659 // "$ref": "Empty" 7660 // }, 7661 // "scopes": [ 7662 // "https://www.googleapis.com/auth/cloud-platform" 7663 // ] 7664 // } 7665 7666} 7667 7668// method id "dataproc.projects.regions.autoscalingPolicies.get": 7669 7670type ProjectsRegionsAutoscalingPoliciesGetCall struct { 7671 s *Service 7672 name string 7673 urlParams_ gensupport.URLParams 7674 ifNoneMatch_ string 7675 ctx_ context.Context 7676 header_ http.Header 7677} 7678 7679// Get: Retrieves autoscaling policy. 7680// 7681// - name: The "resource name" of the autoscaling policy, as described 7682// in https://cloud.google.com/apis/design/resource_names. For 7683// projects.regions.autoscalingPolicies.get, the resource name of the 7684// policy has the following format: 7685// projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 7686// d} For projects.locations.autoscalingPolicies.get, the resource 7687// name of the policy has the following format: 7688// projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 7689// cy_id}. 7690func (r *ProjectsRegionsAutoscalingPoliciesService) Get(name string) *ProjectsRegionsAutoscalingPoliciesGetCall { 7691 c := &ProjectsRegionsAutoscalingPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7692 c.name = name 7693 return c 7694} 7695 7696// Fields allows partial responses to be retrieved. See 7697// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7698// for more information. 7699func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesGetCall { 7700 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7701 return c 7702} 7703 7704// IfNoneMatch sets the optional parameter which makes the operation 7705// fail if the object's ETag matches the given value. This is useful for 7706// getting updates only after the object has changed since the last 7707// request. Use googleapi.IsNotModified to check whether the response 7708// error from Do is the result of In-None-Match. 7709func (c *ProjectsRegionsAutoscalingPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsAutoscalingPoliciesGetCall { 7710 c.ifNoneMatch_ = entityTag 7711 return c 7712} 7713 7714// Context sets the context to be used in this call's Do method. Any 7715// pending HTTP request will be aborted if the provided context is 7716// canceled. 7717func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesGetCall { 7718 c.ctx_ = ctx 7719 return c 7720} 7721 7722// Header returns an http.Header that can be modified by the caller to 7723// add HTTP headers to the request. 7724func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Header() http.Header { 7725 if c.header_ == nil { 7726 c.header_ = make(http.Header) 7727 } 7728 return c.header_ 7729} 7730 7731func (c *ProjectsRegionsAutoscalingPoliciesGetCall) doRequest(alt string) (*http.Response, error) { 7732 reqHeaders := make(http.Header) 7733 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 7734 for k, v := range c.header_ { 7735 reqHeaders[k] = v 7736 } 7737 reqHeaders.Set("User-Agent", c.s.userAgent()) 7738 if c.ifNoneMatch_ != "" { 7739 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7740 } 7741 var body io.Reader = nil 7742 c.urlParams_.Set("alt", alt) 7743 c.urlParams_.Set("prettyPrint", "false") 7744 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 7745 urls += "?" + c.urlParams_.Encode() 7746 req, err := http.NewRequest("GET", urls, body) 7747 if err != nil { 7748 return nil, err 7749 } 7750 req.Header = reqHeaders 7751 googleapi.Expand(req.URL, map[string]string{ 7752 "name": c.name, 7753 }) 7754 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7755} 7756 7757// Do executes the "dataproc.projects.regions.autoscalingPolicies.get" call. 7758// Exactly one of *AutoscalingPolicy or error will be non-nil. Any 7759// non-2xx status code is an error. Response headers are in either 7760// *AutoscalingPolicy.ServerResponse.Header or (if a response was 7761// returned at all) in error.(*googleapi.Error).Header. Use 7762// googleapi.IsNotModified to check whether the returned error was 7763// because http.StatusNotModified was returned. 7764func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 7765 gensupport.SetOptions(c.urlParams_, opts...) 7766 res, err := c.doRequest("json") 7767 if res != nil && res.StatusCode == http.StatusNotModified { 7768 if res.Body != nil { 7769 res.Body.Close() 7770 } 7771 return nil, &googleapi.Error{ 7772 Code: res.StatusCode, 7773 Header: res.Header, 7774 } 7775 } 7776 if err != nil { 7777 return nil, err 7778 } 7779 defer googleapi.CloseBody(res) 7780 if err := googleapi.CheckResponse(res); err != nil { 7781 return nil, err 7782 } 7783 ret := &AutoscalingPolicy{ 7784 ServerResponse: googleapi.ServerResponse{ 7785 Header: res.Header, 7786 HTTPStatusCode: res.StatusCode, 7787 }, 7788 } 7789 target := &ret 7790 if err := gensupport.DecodeResponse(target, res); err != nil { 7791 return nil, err 7792 } 7793 return ret, nil 7794 // { 7795 // "description": "Retrieves autoscaling policy.", 7796 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}", 7797 // "httpMethod": "GET", 7798 // "id": "dataproc.projects.regions.autoscalingPolicies.get", 7799 // "parameterOrder": [ 7800 // "name" 7801 // ], 7802 // "parameters": { 7803 // "name": { 7804 // "description": "Required. The \"resource name\" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} For projects.locations.autoscalingPolicies.get, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}", 7805 // "location": "path", 7806 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 7807 // "required": true, 7808 // "type": "string" 7809 // } 7810 // }, 7811 // "path": "v1/{+name}", 7812 // "response": { 7813 // "$ref": "AutoscalingPolicy" 7814 // }, 7815 // "scopes": [ 7816 // "https://www.googleapis.com/auth/cloud-platform" 7817 // ] 7818 // } 7819 7820} 7821 7822// method id "dataproc.projects.regions.autoscalingPolicies.getIamPolicy": 7823 7824type ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall struct { 7825 s *Service 7826 resource string 7827 getiampolicyrequest *GetIamPolicyRequest 7828 urlParams_ gensupport.URLParams 7829 ctx_ context.Context 7830 header_ http.Header 7831} 7832 7833// GetIamPolicy: Gets the access control policy for a resource. Returns 7834// an empty policy if the resource exists and does not have a policy 7835// set. 7836// 7837// - resource: REQUIRED: The resource for which the policy is being 7838// requested. See the operation documentation for the appropriate 7839// value for this field. 7840func (r *ProjectsRegionsAutoscalingPoliciesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall { 7841 c := &ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7842 c.resource = resource 7843 c.getiampolicyrequest = getiampolicyrequest 7844 return c 7845} 7846 7847// Fields allows partial responses to be retrieved. See 7848// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7849// for more information. 7850func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall { 7851 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7852 return c 7853} 7854 7855// Context sets the context to be used in this call's Do method. Any 7856// pending HTTP request will be aborted if the provided context is 7857// canceled. 7858func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall { 7859 c.ctx_ = ctx 7860 return c 7861} 7862 7863// Header returns an http.Header that can be modified by the caller to 7864// add HTTP headers to the request. 7865func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Header() http.Header { 7866 if c.header_ == nil { 7867 c.header_ = make(http.Header) 7868 } 7869 return c.header_ 7870} 7871 7872func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 7873 reqHeaders := make(http.Header) 7874 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 7875 for k, v := range c.header_ { 7876 reqHeaders[k] = v 7877 } 7878 reqHeaders.Set("User-Agent", c.s.userAgent()) 7879 var body io.Reader = nil 7880 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 7881 if err != nil { 7882 return nil, err 7883 } 7884 reqHeaders.Set("Content-Type", "application/json") 7885 c.urlParams_.Set("alt", alt) 7886 c.urlParams_.Set("prettyPrint", "false") 7887 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") 7888 urls += "?" + c.urlParams_.Encode() 7889 req, err := http.NewRequest("POST", urls, body) 7890 if err != nil { 7891 return nil, err 7892 } 7893 req.Header = reqHeaders 7894 googleapi.Expand(req.URL, map[string]string{ 7895 "resource": c.resource, 7896 }) 7897 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7898} 7899 7900// Do executes the "dataproc.projects.regions.autoscalingPolicies.getIamPolicy" call. 7901// Exactly one of *Policy or error will be non-nil. Any non-2xx status 7902// code is an error. Response headers are in either 7903// *Policy.ServerResponse.Header or (if a response was returned at all) 7904// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7905// check whether the returned error was because http.StatusNotModified 7906// was returned. 7907func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 7908 gensupport.SetOptions(c.urlParams_, opts...) 7909 res, err := c.doRequest("json") 7910 if res != nil && res.StatusCode == http.StatusNotModified { 7911 if res.Body != nil { 7912 res.Body.Close() 7913 } 7914 return nil, &googleapi.Error{ 7915 Code: res.StatusCode, 7916 Header: res.Header, 7917 } 7918 } 7919 if err != nil { 7920 return nil, err 7921 } 7922 defer googleapi.CloseBody(res) 7923 if err := googleapi.CheckResponse(res); err != nil { 7924 return nil, err 7925 } 7926 ret := &Policy{ 7927 ServerResponse: googleapi.ServerResponse{ 7928 Header: res.Header, 7929 HTTPStatusCode: res.StatusCode, 7930 }, 7931 } 7932 target := &ret 7933 if err := gensupport.DecodeResponse(target, res); err != nil { 7934 return nil, err 7935 } 7936 return ret, nil 7937 // { 7938 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 7939 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}:getIamPolicy", 7940 // "httpMethod": "POST", 7941 // "id": "dataproc.projects.regions.autoscalingPolicies.getIamPolicy", 7942 // "parameterOrder": [ 7943 // "resource" 7944 // ], 7945 // "parameters": { 7946 // "resource": { 7947 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 7948 // "location": "path", 7949 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 7950 // "required": true, 7951 // "type": "string" 7952 // } 7953 // }, 7954 // "path": "v1/{+resource}:getIamPolicy", 7955 // "request": { 7956 // "$ref": "GetIamPolicyRequest" 7957 // }, 7958 // "response": { 7959 // "$ref": "Policy" 7960 // }, 7961 // "scopes": [ 7962 // "https://www.googleapis.com/auth/cloud-platform" 7963 // ] 7964 // } 7965 7966} 7967 7968// method id "dataproc.projects.regions.autoscalingPolicies.list": 7969 7970type ProjectsRegionsAutoscalingPoliciesListCall struct { 7971 s *Service 7972 parent string 7973 urlParams_ gensupport.URLParams 7974 ifNoneMatch_ string 7975 ctx_ context.Context 7976 header_ http.Header 7977} 7978 7979// List: Lists autoscaling policies in the project. 7980// 7981// - parent: The "resource name" of the region or location, as described 7982// in https://cloud.google.com/apis/design/resource_names. For 7983// projects.regions.autoscalingPolicies.list, the resource name of the 7984// region has the following format: 7985// projects/{project_id}/regions/{region} For 7986// projects.locations.autoscalingPolicies.list, the resource name of 7987// the location has the following format: 7988// projects/{project_id}/locations/{location}. 7989func (r *ProjectsRegionsAutoscalingPoliciesService) List(parent string) *ProjectsRegionsAutoscalingPoliciesListCall { 7990 c := &ProjectsRegionsAutoscalingPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7991 c.parent = parent 7992 return c 7993} 7994 7995// PageSize sets the optional parameter "pageSize": The maximum number 7996// of results to return in each response. Must be less than or equal to 7997// 1000. Defaults to 100. 7998func (c *ProjectsRegionsAutoscalingPoliciesListCall) PageSize(pageSize int64) *ProjectsRegionsAutoscalingPoliciesListCall { 7999 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 8000 return c 8001} 8002 8003// PageToken sets the optional parameter "pageToken": The page token, 8004// returned by a previous call, to request the next page of results. 8005func (c *ProjectsRegionsAutoscalingPoliciesListCall) PageToken(pageToken string) *ProjectsRegionsAutoscalingPoliciesListCall { 8006 c.urlParams_.Set("pageToken", pageToken) 8007 return c 8008} 8009 8010// Fields allows partial responses to be retrieved. See 8011// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8012// for more information. 8013func (c *ProjectsRegionsAutoscalingPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesListCall { 8014 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8015 return c 8016} 8017 8018// IfNoneMatch sets the optional parameter which makes the operation 8019// fail if the object's ETag matches the given value. This is useful for 8020// getting updates only after the object has changed since the last 8021// request. Use googleapi.IsNotModified to check whether the response 8022// error from Do is the result of In-None-Match. 8023func (c *ProjectsRegionsAutoscalingPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsRegionsAutoscalingPoliciesListCall { 8024 c.ifNoneMatch_ = entityTag 8025 return c 8026} 8027 8028// Context sets the context to be used in this call's Do method. Any 8029// pending HTTP request will be aborted if the provided context is 8030// canceled. 8031func (c *ProjectsRegionsAutoscalingPoliciesListCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesListCall { 8032 c.ctx_ = ctx 8033 return c 8034} 8035 8036// Header returns an http.Header that can be modified by the caller to 8037// add HTTP headers to the request. 8038func (c *ProjectsRegionsAutoscalingPoliciesListCall) Header() http.Header { 8039 if c.header_ == nil { 8040 c.header_ = make(http.Header) 8041 } 8042 return c.header_ 8043} 8044 8045func (c *ProjectsRegionsAutoscalingPoliciesListCall) doRequest(alt string) (*http.Response, error) { 8046 reqHeaders := make(http.Header) 8047 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 8048 for k, v := range c.header_ { 8049 reqHeaders[k] = v 8050 } 8051 reqHeaders.Set("User-Agent", c.s.userAgent()) 8052 if c.ifNoneMatch_ != "" { 8053 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 8054 } 8055 var body io.Reader = nil 8056 c.urlParams_.Set("alt", alt) 8057 c.urlParams_.Set("prettyPrint", "false") 8058 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/autoscalingPolicies") 8059 urls += "?" + c.urlParams_.Encode() 8060 req, err := http.NewRequest("GET", urls, body) 8061 if err != nil { 8062 return nil, err 8063 } 8064 req.Header = reqHeaders 8065 googleapi.Expand(req.URL, map[string]string{ 8066 "parent": c.parent, 8067 }) 8068 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8069} 8070 8071// Do executes the "dataproc.projects.regions.autoscalingPolicies.list" call. 8072// Exactly one of *ListAutoscalingPoliciesResponse or error will be 8073// non-nil. Any non-2xx status code is an error. Response headers are in 8074// either *ListAutoscalingPoliciesResponse.ServerResponse.Header or (if 8075// a response was returned at all) in error.(*googleapi.Error).Header. 8076// Use googleapi.IsNotModified to check whether the returned error was 8077// because http.StatusNotModified was returned. 8078func (c *ProjectsRegionsAutoscalingPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListAutoscalingPoliciesResponse, error) { 8079 gensupport.SetOptions(c.urlParams_, opts...) 8080 res, err := c.doRequest("json") 8081 if res != nil && res.StatusCode == http.StatusNotModified { 8082 if res.Body != nil { 8083 res.Body.Close() 8084 } 8085 return nil, &googleapi.Error{ 8086 Code: res.StatusCode, 8087 Header: res.Header, 8088 } 8089 } 8090 if err != nil { 8091 return nil, err 8092 } 8093 defer googleapi.CloseBody(res) 8094 if err := googleapi.CheckResponse(res); err != nil { 8095 return nil, err 8096 } 8097 ret := &ListAutoscalingPoliciesResponse{ 8098 ServerResponse: googleapi.ServerResponse{ 8099 Header: res.Header, 8100 HTTPStatusCode: res.StatusCode, 8101 }, 8102 } 8103 target := &ret 8104 if err := gensupport.DecodeResponse(target, res); err != nil { 8105 return nil, err 8106 } 8107 return ret, nil 8108 // { 8109 // "description": "Lists autoscaling policies in the project.", 8110 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies", 8111 // "httpMethod": "GET", 8112 // "id": "dataproc.projects.regions.autoscalingPolicies.list", 8113 // "parameterOrder": [ 8114 // "parent" 8115 // ], 8116 // "parameters": { 8117 // "pageSize": { 8118 // "description": "Optional. The maximum number of results to return in each response. Must be less than or equal to 1000. Defaults to 100.", 8119 // "format": "int32", 8120 // "location": "query", 8121 // "type": "integer" 8122 // }, 8123 // "pageToken": { 8124 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 8125 // "location": "query", 8126 // "type": "string" 8127 // }, 8128 // "parent": { 8129 // "description": "Required. The \"resource name\" of the region or location, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.autoscalingPolicies.list, the resource name of the region has the following format: projects/{project_id}/regions/{region} For projects.locations.autoscalingPolicies.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}", 8130 // "location": "path", 8131 // "pattern": "^projects/[^/]+/regions/[^/]+$", 8132 // "required": true, 8133 // "type": "string" 8134 // } 8135 // }, 8136 // "path": "v1/{+parent}/autoscalingPolicies", 8137 // "response": { 8138 // "$ref": "ListAutoscalingPoliciesResponse" 8139 // }, 8140 // "scopes": [ 8141 // "https://www.googleapis.com/auth/cloud-platform" 8142 // ] 8143 // } 8144 8145} 8146 8147// Pages invokes f for each page of results. 8148// A non-nil error returned from f will halt the iteration. 8149// The provided context supersedes any context provided to the Context method. 8150func (c *ProjectsRegionsAutoscalingPoliciesListCall) Pages(ctx context.Context, f func(*ListAutoscalingPoliciesResponse) error) error { 8151 c.ctx_ = ctx 8152 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8153 for { 8154 x, err := c.Do() 8155 if err != nil { 8156 return err 8157 } 8158 if err := f(x); err != nil { 8159 return err 8160 } 8161 if x.NextPageToken == "" { 8162 return nil 8163 } 8164 c.PageToken(x.NextPageToken) 8165 } 8166} 8167 8168// method id "dataproc.projects.regions.autoscalingPolicies.setIamPolicy": 8169 8170type ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall struct { 8171 s *Service 8172 resource string 8173 setiampolicyrequest *SetIamPolicyRequest 8174 urlParams_ gensupport.URLParams 8175 ctx_ context.Context 8176 header_ http.Header 8177} 8178 8179// SetIamPolicy: Sets the access control policy on the specified 8180// resource. Replaces any existing policy.Can return NOT_FOUND, 8181// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 8182// 8183// - resource: REQUIRED: The resource for which the policy is being 8184// specified. See the operation documentation for the appropriate 8185// value for this field. 8186func (r *ProjectsRegionsAutoscalingPoliciesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall { 8187 c := &ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8188 c.resource = resource 8189 c.setiampolicyrequest = setiampolicyrequest 8190 return c 8191} 8192 8193// Fields allows partial responses to be retrieved. See 8194// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8195// for more information. 8196func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall { 8197 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8198 return c 8199} 8200 8201// Context sets the context to be used in this call's Do method. Any 8202// pending HTTP request will be aborted if the provided context is 8203// canceled. 8204func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall { 8205 c.ctx_ = ctx 8206 return c 8207} 8208 8209// Header returns an http.Header that can be modified by the caller to 8210// add HTTP headers to the request. 8211func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Header() http.Header { 8212 if c.header_ == nil { 8213 c.header_ = make(http.Header) 8214 } 8215 return c.header_ 8216} 8217 8218func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 8219 reqHeaders := make(http.Header) 8220 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 8221 for k, v := range c.header_ { 8222 reqHeaders[k] = v 8223 } 8224 reqHeaders.Set("User-Agent", c.s.userAgent()) 8225 var body io.Reader = nil 8226 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 8227 if err != nil { 8228 return nil, err 8229 } 8230 reqHeaders.Set("Content-Type", "application/json") 8231 c.urlParams_.Set("alt", alt) 8232 c.urlParams_.Set("prettyPrint", "false") 8233 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") 8234 urls += "?" + c.urlParams_.Encode() 8235 req, err := http.NewRequest("POST", urls, body) 8236 if err != nil { 8237 return nil, err 8238 } 8239 req.Header = reqHeaders 8240 googleapi.Expand(req.URL, map[string]string{ 8241 "resource": c.resource, 8242 }) 8243 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8244} 8245 8246// Do executes the "dataproc.projects.regions.autoscalingPolicies.setIamPolicy" call. 8247// Exactly one of *Policy or error will be non-nil. Any non-2xx status 8248// code is an error. Response headers are in either 8249// *Policy.ServerResponse.Header or (if a response was returned at all) 8250// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8251// check whether the returned error was because http.StatusNotModified 8252// was returned. 8253func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 8254 gensupport.SetOptions(c.urlParams_, opts...) 8255 res, err := c.doRequest("json") 8256 if res != nil && res.StatusCode == http.StatusNotModified { 8257 if res.Body != nil { 8258 res.Body.Close() 8259 } 8260 return nil, &googleapi.Error{ 8261 Code: res.StatusCode, 8262 Header: res.Header, 8263 } 8264 } 8265 if err != nil { 8266 return nil, err 8267 } 8268 defer googleapi.CloseBody(res) 8269 if err := googleapi.CheckResponse(res); err != nil { 8270 return nil, err 8271 } 8272 ret := &Policy{ 8273 ServerResponse: googleapi.ServerResponse{ 8274 Header: res.Header, 8275 HTTPStatusCode: res.StatusCode, 8276 }, 8277 } 8278 target := &ret 8279 if err := gensupport.DecodeResponse(target, res); err != nil { 8280 return nil, err 8281 } 8282 return ret, nil 8283 // { 8284 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 8285 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}:setIamPolicy", 8286 // "httpMethod": "POST", 8287 // "id": "dataproc.projects.regions.autoscalingPolicies.setIamPolicy", 8288 // "parameterOrder": [ 8289 // "resource" 8290 // ], 8291 // "parameters": { 8292 // "resource": { 8293 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 8294 // "location": "path", 8295 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 8296 // "required": true, 8297 // "type": "string" 8298 // } 8299 // }, 8300 // "path": "v1/{+resource}:setIamPolicy", 8301 // "request": { 8302 // "$ref": "SetIamPolicyRequest" 8303 // }, 8304 // "response": { 8305 // "$ref": "Policy" 8306 // }, 8307 // "scopes": [ 8308 // "https://www.googleapis.com/auth/cloud-platform" 8309 // ] 8310 // } 8311 8312} 8313 8314// method id "dataproc.projects.regions.autoscalingPolicies.testIamPermissions": 8315 8316type ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall struct { 8317 s *Service 8318 resource string 8319 testiampermissionsrequest *TestIamPermissionsRequest 8320 urlParams_ gensupport.URLParams 8321 ctx_ context.Context 8322 header_ http.Header 8323} 8324 8325// TestIamPermissions: Returns permissions that a caller has on the 8326// specified resource. If the resource does not exist, this will return 8327// an empty set of permissions, not a NOT_FOUND error.Note: This 8328// operation is designed to be used for building permission-aware UIs 8329// and command-line tools, not for authorization checking. This 8330// operation may "fail open" without warning. 8331// 8332// - resource: REQUIRED: The resource for which the policy detail is 8333// being requested. See the operation documentation for the 8334// appropriate value for this field. 8335func (r *ProjectsRegionsAutoscalingPoliciesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall { 8336 c := &ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8337 c.resource = resource 8338 c.testiampermissionsrequest = testiampermissionsrequest 8339 return c 8340} 8341 8342// Fields allows partial responses to be retrieved. See 8343// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8344// for more information. 8345func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall { 8346 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8347 return c 8348} 8349 8350// Context sets the context to be used in this call's Do method. Any 8351// pending HTTP request will be aborted if the provided context is 8352// canceled. 8353func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall { 8354 c.ctx_ = ctx 8355 return c 8356} 8357 8358// Header returns an http.Header that can be modified by the caller to 8359// add HTTP headers to the request. 8360func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Header() http.Header { 8361 if c.header_ == nil { 8362 c.header_ = make(http.Header) 8363 } 8364 return c.header_ 8365} 8366 8367func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 8368 reqHeaders := make(http.Header) 8369 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 8370 for k, v := range c.header_ { 8371 reqHeaders[k] = v 8372 } 8373 reqHeaders.Set("User-Agent", c.s.userAgent()) 8374 var body io.Reader = nil 8375 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 8376 if err != nil { 8377 return nil, err 8378 } 8379 reqHeaders.Set("Content-Type", "application/json") 8380 c.urlParams_.Set("alt", alt) 8381 c.urlParams_.Set("prettyPrint", "false") 8382 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") 8383 urls += "?" + c.urlParams_.Encode() 8384 req, err := http.NewRequest("POST", urls, body) 8385 if err != nil { 8386 return nil, err 8387 } 8388 req.Header = reqHeaders 8389 googleapi.Expand(req.URL, map[string]string{ 8390 "resource": c.resource, 8391 }) 8392 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8393} 8394 8395// Do executes the "dataproc.projects.regions.autoscalingPolicies.testIamPermissions" call. 8396// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 8397// Any non-2xx status code is an error. Response headers are in either 8398// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 8399// was returned at all) in error.(*googleapi.Error).Header. Use 8400// googleapi.IsNotModified to check whether the returned error was 8401// because http.StatusNotModified was returned. 8402func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 8403 gensupport.SetOptions(c.urlParams_, opts...) 8404 res, err := c.doRequest("json") 8405 if res != nil && res.StatusCode == http.StatusNotModified { 8406 if res.Body != nil { 8407 res.Body.Close() 8408 } 8409 return nil, &googleapi.Error{ 8410 Code: res.StatusCode, 8411 Header: res.Header, 8412 } 8413 } 8414 if err != nil { 8415 return nil, err 8416 } 8417 defer googleapi.CloseBody(res) 8418 if err := googleapi.CheckResponse(res); err != nil { 8419 return nil, err 8420 } 8421 ret := &TestIamPermissionsResponse{ 8422 ServerResponse: googleapi.ServerResponse{ 8423 Header: res.Header, 8424 HTTPStatusCode: res.StatusCode, 8425 }, 8426 } 8427 target := &ret 8428 if err := gensupport.DecodeResponse(target, res); err != nil { 8429 return nil, err 8430 } 8431 return ret, nil 8432 // { 8433 // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 8434 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}:testIamPermissions", 8435 // "httpMethod": "POST", 8436 // "id": "dataproc.projects.regions.autoscalingPolicies.testIamPermissions", 8437 // "parameterOrder": [ 8438 // "resource" 8439 // ], 8440 // "parameters": { 8441 // "resource": { 8442 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 8443 // "location": "path", 8444 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 8445 // "required": true, 8446 // "type": "string" 8447 // } 8448 // }, 8449 // "path": "v1/{+resource}:testIamPermissions", 8450 // "request": { 8451 // "$ref": "TestIamPermissionsRequest" 8452 // }, 8453 // "response": { 8454 // "$ref": "TestIamPermissionsResponse" 8455 // }, 8456 // "scopes": [ 8457 // "https://www.googleapis.com/auth/cloud-platform" 8458 // ] 8459 // } 8460 8461} 8462 8463// method id "dataproc.projects.regions.autoscalingPolicies.update": 8464 8465type ProjectsRegionsAutoscalingPoliciesUpdateCall struct { 8466 s *Service 8467 name string 8468 autoscalingpolicy *AutoscalingPolicy 8469 urlParams_ gensupport.URLParams 8470 ctx_ context.Context 8471 header_ http.Header 8472} 8473 8474// Update: Updates (replaces) autoscaling policy.Disabled check for 8475// update_mask, because all updates will be full replacements. 8476// 8477// - name: Output only. The "resource name" of the autoscaling policy, 8478// as described in 8479// https://cloud.google.com/apis/design/resource_names. For 8480// projects.regions.autoscalingPolicies, the resource name of the 8481// policy has the following format: 8482// projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 8483// d} For projects.locations.autoscalingPolicies, the resource name of 8484// the policy has the following format: 8485// projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 8486// cy_id}. 8487func (r *ProjectsRegionsAutoscalingPoliciesService) Update(name string, autoscalingpolicy *AutoscalingPolicy) *ProjectsRegionsAutoscalingPoliciesUpdateCall { 8488 c := &ProjectsRegionsAutoscalingPoliciesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8489 c.name = name 8490 c.autoscalingpolicy = autoscalingpolicy 8491 return c 8492} 8493 8494// Fields allows partial responses to be retrieved. See 8495// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8496// for more information. 8497func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesUpdateCall { 8498 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8499 return c 8500} 8501 8502// Context sets the context to be used in this call's Do method. Any 8503// pending HTTP request will be aborted if the provided context is 8504// canceled. 8505func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesUpdateCall { 8506 c.ctx_ = ctx 8507 return c 8508} 8509 8510// Header returns an http.Header that can be modified by the caller to 8511// add HTTP headers to the request. 8512func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Header() http.Header { 8513 if c.header_ == nil { 8514 c.header_ = make(http.Header) 8515 } 8516 return c.header_ 8517} 8518 8519func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { 8520 reqHeaders := make(http.Header) 8521 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 8522 for k, v := range c.header_ { 8523 reqHeaders[k] = v 8524 } 8525 reqHeaders.Set("User-Agent", c.s.userAgent()) 8526 var body io.Reader = nil 8527 body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) 8528 if err != nil { 8529 return nil, err 8530 } 8531 reqHeaders.Set("Content-Type", "application/json") 8532 c.urlParams_.Set("alt", alt) 8533 c.urlParams_.Set("prettyPrint", "false") 8534 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 8535 urls += "?" + c.urlParams_.Encode() 8536 req, err := http.NewRequest("PUT", urls, body) 8537 if err != nil { 8538 return nil, err 8539 } 8540 req.Header = reqHeaders 8541 googleapi.Expand(req.URL, map[string]string{ 8542 "name": c.name, 8543 }) 8544 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8545} 8546 8547// Do executes the "dataproc.projects.regions.autoscalingPolicies.update" call. 8548// Exactly one of *AutoscalingPolicy or error will be non-nil. Any 8549// non-2xx status code is an error. Response headers are in either 8550// *AutoscalingPolicy.ServerResponse.Header or (if a response was 8551// returned at all) in error.(*googleapi.Error).Header. Use 8552// googleapi.IsNotModified to check whether the returned error was 8553// because http.StatusNotModified was returned. 8554func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 8555 gensupport.SetOptions(c.urlParams_, opts...) 8556 res, err := c.doRequest("json") 8557 if res != nil && res.StatusCode == http.StatusNotModified { 8558 if res.Body != nil { 8559 res.Body.Close() 8560 } 8561 return nil, &googleapi.Error{ 8562 Code: res.StatusCode, 8563 Header: res.Header, 8564 } 8565 } 8566 if err != nil { 8567 return nil, err 8568 } 8569 defer googleapi.CloseBody(res) 8570 if err := googleapi.CheckResponse(res); err != nil { 8571 return nil, err 8572 } 8573 ret := &AutoscalingPolicy{ 8574 ServerResponse: googleapi.ServerResponse{ 8575 Header: res.Header, 8576 HTTPStatusCode: res.StatusCode, 8577 }, 8578 } 8579 target := &ret 8580 if err := gensupport.DecodeResponse(target, res); err != nil { 8581 return nil, err 8582 } 8583 return ret, nil 8584 // { 8585 // "description": "Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements.", 8586 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}", 8587 // "httpMethod": "PUT", 8588 // "id": "dataproc.projects.regions.autoscalingPolicies.update", 8589 // "parameterOrder": [ 8590 // "name" 8591 // ], 8592 // "parameters": { 8593 // "name": { 8594 // "description": "Output only. The \"resource name\" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} For projects.locations.autoscalingPolicies, the resource name of the policy has the following format: projects/{project_id}/locations/{location}/autoscalingPolicies/{policy_id}", 8595 // "location": "path", 8596 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 8597 // "required": true, 8598 // "type": "string" 8599 // } 8600 // }, 8601 // "path": "v1/{+name}", 8602 // "request": { 8603 // "$ref": "AutoscalingPolicy" 8604 // }, 8605 // "response": { 8606 // "$ref": "AutoscalingPolicy" 8607 // }, 8608 // "scopes": [ 8609 // "https://www.googleapis.com/auth/cloud-platform" 8610 // ] 8611 // } 8612 8613} 8614 8615// method id "dataproc.projects.regions.clusters.create": 8616 8617type ProjectsRegionsClustersCreateCall struct { 8618 s *Service 8619 projectId string 8620 region string 8621 cluster *Cluster 8622 urlParams_ gensupport.URLParams 8623 ctx_ context.Context 8624 header_ http.Header 8625} 8626 8627// Create: Creates a cluster in a project. The returned 8628// Operation.metadata will be ClusterOperationMetadata 8629// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). 8630// 8631// - projectId: The ID of the Google Cloud Platform project that the 8632// cluster belongs to. 8633// - region: The Dataproc region in which to handle the request. 8634func (r *ProjectsRegionsClustersService) Create(projectId string, region string, cluster *Cluster) *ProjectsRegionsClustersCreateCall { 8635 c := &ProjectsRegionsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8636 c.projectId = projectId 8637 c.region = region 8638 c.cluster = cluster 8639 return c 8640} 8641 8642// RequestId sets the optional parameter "requestId": A unique ID used 8643// to identify the request. If the server receives two 8644// CreateClusterRequest 8645// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s 8646// with the same id, then the second request will be ignored and the 8647// first google.longrunning.Operation created and stored in the backend 8648// is returned.It is recommended to always set this value to a UUID 8649// (https://en.wikipedia.org/wiki/Universally_unique_identifier).The ID 8650// must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 8651// and hyphens (-). The maximum length is 40 characters. 8652func (c *ProjectsRegionsClustersCreateCall) RequestId(requestId string) *ProjectsRegionsClustersCreateCall { 8653 c.urlParams_.Set("requestId", requestId) 8654 return c 8655} 8656 8657// Fields allows partial responses to be retrieved. See 8658// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8659// for more information. 8660func (c *ProjectsRegionsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersCreateCall { 8661 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8662 return c 8663} 8664 8665// Context sets the context to be used in this call's Do method. Any 8666// pending HTTP request will be aborted if the provided context is 8667// canceled. 8668func (c *ProjectsRegionsClustersCreateCall) Context(ctx context.Context) *ProjectsRegionsClustersCreateCall { 8669 c.ctx_ = ctx 8670 return c 8671} 8672 8673// Header returns an http.Header that can be modified by the caller to 8674// add HTTP headers to the request. 8675func (c *ProjectsRegionsClustersCreateCall) Header() http.Header { 8676 if c.header_ == nil { 8677 c.header_ = make(http.Header) 8678 } 8679 return c.header_ 8680} 8681 8682func (c *ProjectsRegionsClustersCreateCall) doRequest(alt string) (*http.Response, error) { 8683 reqHeaders := make(http.Header) 8684 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 8685 for k, v := range c.header_ { 8686 reqHeaders[k] = v 8687 } 8688 reqHeaders.Set("User-Agent", c.s.userAgent()) 8689 var body io.Reader = nil 8690 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) 8691 if err != nil { 8692 return nil, err 8693 } 8694 reqHeaders.Set("Content-Type", "application/json") 8695 c.urlParams_.Set("alt", alt) 8696 c.urlParams_.Set("prettyPrint", "false") 8697 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters") 8698 urls += "?" + c.urlParams_.Encode() 8699 req, err := http.NewRequest("POST", urls, body) 8700 if err != nil { 8701 return nil, err 8702 } 8703 req.Header = reqHeaders 8704 googleapi.Expand(req.URL, map[string]string{ 8705 "projectId": c.projectId, 8706 "region": c.region, 8707 }) 8708 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8709} 8710 8711// Do executes the "dataproc.projects.regions.clusters.create" call. 8712// Exactly one of *Operation or error will be non-nil. Any non-2xx 8713// status code is an error. Response headers are in either 8714// *Operation.ServerResponse.Header or (if a response was returned at 8715// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8716// to check whether the returned error was because 8717// http.StatusNotModified was returned. 8718func (c *ProjectsRegionsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8719 gensupport.SetOptions(c.urlParams_, opts...) 8720 res, err := c.doRequest("json") 8721 if res != nil && res.StatusCode == http.StatusNotModified { 8722 if res.Body != nil { 8723 res.Body.Close() 8724 } 8725 return nil, &googleapi.Error{ 8726 Code: res.StatusCode, 8727 Header: res.Header, 8728 } 8729 } 8730 if err != nil { 8731 return nil, err 8732 } 8733 defer googleapi.CloseBody(res) 8734 if err := googleapi.CheckResponse(res); err != nil { 8735 return nil, err 8736 } 8737 ret := &Operation{ 8738 ServerResponse: googleapi.ServerResponse{ 8739 Header: res.Header, 8740 HTTPStatusCode: res.StatusCode, 8741 }, 8742 } 8743 target := &ret 8744 if err := gensupport.DecodeResponse(target, res); err != nil { 8745 return nil, err 8746 } 8747 return ret, nil 8748 // { 8749 // "description": "Creates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).", 8750 // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters", 8751 // "httpMethod": "POST", 8752 // "id": "dataproc.projects.regions.clusters.create", 8753 // "parameterOrder": [ 8754 // "projectId", 8755 // "region" 8756 // ], 8757 // "parameters": { 8758 // "projectId": { 8759 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 8760 // "location": "path", 8761 // "required": true, 8762 // "type": "string" 8763 // }, 8764 // "region": { 8765 // "description": "Required. The Dataproc region in which to handle the request.", 8766 // "location": "path", 8767 // "required": true, 8768 // "type": "string" 8769 // }, 8770 // "requestId": { 8771 // "description": "Optional. A unique ID used to identify the request. If the server receives two CreateClusterRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.CreateClusterRequest)s with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", 8772 // "location": "query", 8773 // "type": "string" 8774 // } 8775 // }, 8776 // "path": "v1/projects/{projectId}/regions/{region}/clusters", 8777 // "request": { 8778 // "$ref": "Cluster" 8779 // }, 8780 // "response": { 8781 // "$ref": "Operation" 8782 // }, 8783 // "scopes": [ 8784 // "https://www.googleapis.com/auth/cloud-platform" 8785 // ] 8786 // } 8787 8788} 8789 8790// method id "dataproc.projects.regions.clusters.delete": 8791 8792type ProjectsRegionsClustersDeleteCall struct { 8793 s *Service 8794 projectId string 8795 region string 8796 clusterName string 8797 urlParams_ gensupport.URLParams 8798 ctx_ context.Context 8799 header_ http.Header 8800} 8801 8802// Delete: Deletes a cluster in a project. The returned 8803// Operation.metadata will be ClusterOperationMetadata 8804// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). 8805// 8806// - clusterName: The cluster name. 8807// - projectId: The ID of the Google Cloud Platform project that the 8808// cluster belongs to. 8809// - region: The Dataproc region in which to handle the request. 8810func (r *ProjectsRegionsClustersService) Delete(projectId string, region string, clusterName string) *ProjectsRegionsClustersDeleteCall { 8811 c := &ProjectsRegionsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8812 c.projectId = projectId 8813 c.region = region 8814 c.clusterName = clusterName 8815 return c 8816} 8817 8818// ClusterUuid sets the optional parameter "clusterUuid": Specifying the 8819// cluster_uuid means the RPC should fail (with error NOT_FOUND) if 8820// cluster with specified UUID does not exist. 8821func (c *ProjectsRegionsClustersDeleteCall) ClusterUuid(clusterUuid string) *ProjectsRegionsClustersDeleteCall { 8822 c.urlParams_.Set("clusterUuid", clusterUuid) 8823 return c 8824} 8825 8826// RequestId sets the optional parameter "requestId": A unique ID used 8827// to identify the request. If the server receives two 8828// DeleteClusterRequest 8829// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s 8830// with the same id, then the second request will be ignored and the 8831// first google.longrunning.Operation created and stored in the backend 8832// is returned.It is recommended to always set this value to a UUID 8833// (https://en.wikipedia.org/wiki/Universally_unique_identifier).The ID 8834// must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 8835// and hyphens (-). The maximum length is 40 characters. 8836func (c *ProjectsRegionsClustersDeleteCall) RequestId(requestId string) *ProjectsRegionsClustersDeleteCall { 8837 c.urlParams_.Set("requestId", requestId) 8838 return c 8839} 8840 8841// Fields allows partial responses to be retrieved. See 8842// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8843// for more information. 8844func (c *ProjectsRegionsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersDeleteCall { 8845 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8846 return c 8847} 8848 8849// Context sets the context to be used in this call's Do method. Any 8850// pending HTTP request will be aborted if the provided context is 8851// canceled. 8852func (c *ProjectsRegionsClustersDeleteCall) Context(ctx context.Context) *ProjectsRegionsClustersDeleteCall { 8853 c.ctx_ = ctx 8854 return c 8855} 8856 8857// Header returns an http.Header that can be modified by the caller to 8858// add HTTP headers to the request. 8859func (c *ProjectsRegionsClustersDeleteCall) Header() http.Header { 8860 if c.header_ == nil { 8861 c.header_ = make(http.Header) 8862 } 8863 return c.header_ 8864} 8865 8866func (c *ProjectsRegionsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { 8867 reqHeaders := make(http.Header) 8868 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 8869 for k, v := range c.header_ { 8870 reqHeaders[k] = v 8871 } 8872 reqHeaders.Set("User-Agent", c.s.userAgent()) 8873 var body io.Reader = nil 8874 c.urlParams_.Set("alt", alt) 8875 c.urlParams_.Set("prettyPrint", "false") 8876 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}") 8877 urls += "?" + c.urlParams_.Encode() 8878 req, err := http.NewRequest("DELETE", urls, body) 8879 if err != nil { 8880 return nil, err 8881 } 8882 req.Header = reqHeaders 8883 googleapi.Expand(req.URL, map[string]string{ 8884 "projectId": c.projectId, 8885 "region": c.region, 8886 "clusterName": c.clusterName, 8887 }) 8888 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8889} 8890 8891// Do executes the "dataproc.projects.regions.clusters.delete" call. 8892// Exactly one of *Operation or error will be non-nil. Any non-2xx 8893// status code is an error. Response headers are in either 8894// *Operation.ServerResponse.Header or (if a response was returned at 8895// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8896// to check whether the returned error was because 8897// http.StatusNotModified was returned. 8898func (c *ProjectsRegionsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8899 gensupport.SetOptions(c.urlParams_, opts...) 8900 res, err := c.doRequest("json") 8901 if res != nil && res.StatusCode == http.StatusNotModified { 8902 if res.Body != nil { 8903 res.Body.Close() 8904 } 8905 return nil, &googleapi.Error{ 8906 Code: res.StatusCode, 8907 Header: res.Header, 8908 } 8909 } 8910 if err != nil { 8911 return nil, err 8912 } 8913 defer googleapi.CloseBody(res) 8914 if err := googleapi.CheckResponse(res); err != nil { 8915 return nil, err 8916 } 8917 ret := &Operation{ 8918 ServerResponse: googleapi.ServerResponse{ 8919 Header: res.Header, 8920 HTTPStatusCode: res.StatusCode, 8921 }, 8922 } 8923 target := &ret 8924 if err := gensupport.DecodeResponse(target, res); err != nil { 8925 return nil, err 8926 } 8927 return ret, nil 8928 // { 8929 // "description": "Deletes a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).", 8930 // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", 8931 // "httpMethod": "DELETE", 8932 // "id": "dataproc.projects.regions.clusters.delete", 8933 // "parameterOrder": [ 8934 // "projectId", 8935 // "region", 8936 // "clusterName" 8937 // ], 8938 // "parameters": { 8939 // "clusterName": { 8940 // "description": "Required. The cluster name.", 8941 // "location": "path", 8942 // "required": true, 8943 // "type": "string" 8944 // }, 8945 // "clusterUuid": { 8946 // "description": "Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist.", 8947 // "location": "query", 8948 // "type": "string" 8949 // }, 8950 // "projectId": { 8951 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 8952 // "location": "path", 8953 // "required": true, 8954 // "type": "string" 8955 // }, 8956 // "region": { 8957 // "description": "Required. The Dataproc region in which to handle the request.", 8958 // "location": "path", 8959 // "required": true, 8960 // "type": "string" 8961 // }, 8962 // "requestId": { 8963 // "description": "Optional. A unique ID used to identify the request. If the server receives two DeleteClusterRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.DeleteClusterRequest)s with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", 8964 // "location": "query", 8965 // "type": "string" 8966 // } 8967 // }, 8968 // "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", 8969 // "response": { 8970 // "$ref": "Operation" 8971 // }, 8972 // "scopes": [ 8973 // "https://www.googleapis.com/auth/cloud-platform" 8974 // ] 8975 // } 8976 8977} 8978 8979// method id "dataproc.projects.regions.clusters.diagnose": 8980 8981type ProjectsRegionsClustersDiagnoseCall struct { 8982 s *Service 8983 projectId string 8984 region string 8985 clusterName string 8986 diagnoseclusterrequest *DiagnoseClusterRequest 8987 urlParams_ gensupport.URLParams 8988 ctx_ context.Context 8989 header_ http.Header 8990} 8991 8992// Diagnose: Gets cluster diagnostic information. The returned 8993// Operation.metadata will be ClusterOperationMetadata 8994// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). 8995// After the operation completes, Operation.response contains 8996// DiagnoseClusterResults 8997// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults). 8998// 8999// - clusterName: The cluster name. 9000// - projectId: The ID of the Google Cloud Platform project that the 9001// cluster belongs to. 9002// - region: The Dataproc region in which to handle the request. 9003func (r *ProjectsRegionsClustersService) Diagnose(projectId string, region string, clusterName string, diagnoseclusterrequest *DiagnoseClusterRequest) *ProjectsRegionsClustersDiagnoseCall { 9004 c := &ProjectsRegionsClustersDiagnoseCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9005 c.projectId = projectId 9006 c.region = region 9007 c.clusterName = clusterName 9008 c.diagnoseclusterrequest = diagnoseclusterrequest 9009 return c 9010} 9011 9012// Fields allows partial responses to be retrieved. See 9013// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9014// for more information. 9015func (c *ProjectsRegionsClustersDiagnoseCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersDiagnoseCall { 9016 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9017 return c 9018} 9019 9020// Context sets the context to be used in this call's Do method. Any 9021// pending HTTP request will be aborted if the provided context is 9022// canceled. 9023func (c *ProjectsRegionsClustersDiagnoseCall) Context(ctx context.Context) *ProjectsRegionsClustersDiagnoseCall { 9024 c.ctx_ = ctx 9025 return c 9026} 9027 9028// Header returns an http.Header that can be modified by the caller to 9029// add HTTP headers to the request. 9030func (c *ProjectsRegionsClustersDiagnoseCall) Header() http.Header { 9031 if c.header_ == nil { 9032 c.header_ = make(http.Header) 9033 } 9034 return c.header_ 9035} 9036 9037func (c *ProjectsRegionsClustersDiagnoseCall) doRequest(alt string) (*http.Response, error) { 9038 reqHeaders := make(http.Header) 9039 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 9040 for k, v := range c.header_ { 9041 reqHeaders[k] = v 9042 } 9043 reqHeaders.Set("User-Agent", c.s.userAgent()) 9044 var body io.Reader = nil 9045 body, err := googleapi.WithoutDataWrapper.JSONReader(c.diagnoseclusterrequest) 9046 if err != nil { 9047 return nil, err 9048 } 9049 reqHeaders.Set("Content-Type", "application/json") 9050 c.urlParams_.Set("alt", alt) 9051 c.urlParams_.Set("prettyPrint", "false") 9052 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose") 9053 urls += "?" + c.urlParams_.Encode() 9054 req, err := http.NewRequest("POST", urls, body) 9055 if err != nil { 9056 return nil, err 9057 } 9058 req.Header = reqHeaders 9059 googleapi.Expand(req.URL, map[string]string{ 9060 "projectId": c.projectId, 9061 "region": c.region, 9062 "clusterName": c.clusterName, 9063 }) 9064 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9065} 9066 9067// Do executes the "dataproc.projects.regions.clusters.diagnose" call. 9068// Exactly one of *Operation or error will be non-nil. Any non-2xx 9069// status code is an error. Response headers are in either 9070// *Operation.ServerResponse.Header or (if a response was returned at 9071// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9072// to check whether the returned error was because 9073// http.StatusNotModified was returned. 9074func (c *ProjectsRegionsClustersDiagnoseCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9075 gensupport.SetOptions(c.urlParams_, opts...) 9076 res, err := c.doRequest("json") 9077 if res != nil && res.StatusCode == http.StatusNotModified { 9078 if res.Body != nil { 9079 res.Body.Close() 9080 } 9081 return nil, &googleapi.Error{ 9082 Code: res.StatusCode, 9083 Header: res.Header, 9084 } 9085 } 9086 if err != nil { 9087 return nil, err 9088 } 9089 defer googleapi.CloseBody(res) 9090 if err := googleapi.CheckResponse(res); err != nil { 9091 return nil, err 9092 } 9093 ret := &Operation{ 9094 ServerResponse: googleapi.ServerResponse{ 9095 Header: res.Header, 9096 HTTPStatusCode: res.StatusCode, 9097 }, 9098 } 9099 target := &ret 9100 if err := gensupport.DecodeResponse(target, res); err != nil { 9101 return nil, err 9102 } 9103 return ret, nil 9104 // { 9105 // "description": "Gets cluster diagnostic information. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). After the operation completes, Operation.response contains DiagnoseClusterResults (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).", 9106 // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", 9107 // "httpMethod": "POST", 9108 // "id": "dataproc.projects.regions.clusters.diagnose", 9109 // "parameterOrder": [ 9110 // "projectId", 9111 // "region", 9112 // "clusterName" 9113 // ], 9114 // "parameters": { 9115 // "clusterName": { 9116 // "description": "Required. The cluster name.", 9117 // "location": "path", 9118 // "required": true, 9119 // "type": "string" 9120 // }, 9121 // "projectId": { 9122 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 9123 // "location": "path", 9124 // "required": true, 9125 // "type": "string" 9126 // }, 9127 // "region": { 9128 // "description": "Required. The Dataproc region in which to handle the request.", 9129 // "location": "path", 9130 // "required": true, 9131 // "type": "string" 9132 // } 9133 // }, 9134 // "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", 9135 // "request": { 9136 // "$ref": "DiagnoseClusterRequest" 9137 // }, 9138 // "response": { 9139 // "$ref": "Operation" 9140 // }, 9141 // "scopes": [ 9142 // "https://www.googleapis.com/auth/cloud-platform" 9143 // ] 9144 // } 9145 9146} 9147 9148// method id "dataproc.projects.regions.clusters.get": 9149 9150type ProjectsRegionsClustersGetCall struct { 9151 s *Service 9152 projectId string 9153 region string 9154 clusterName string 9155 urlParams_ gensupport.URLParams 9156 ifNoneMatch_ string 9157 ctx_ context.Context 9158 header_ http.Header 9159} 9160 9161// Get: Gets the resource representation for a cluster in a project. 9162// 9163// - clusterName: The cluster name. 9164// - projectId: The ID of the Google Cloud Platform project that the 9165// cluster belongs to. 9166// - region: The Dataproc region in which to handle the request. 9167func (r *ProjectsRegionsClustersService) Get(projectId string, region string, clusterName string) *ProjectsRegionsClustersGetCall { 9168 c := &ProjectsRegionsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9169 c.projectId = projectId 9170 c.region = region 9171 c.clusterName = clusterName 9172 return c 9173} 9174 9175// Fields allows partial responses to be retrieved. See 9176// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9177// for more information. 9178func (c *ProjectsRegionsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersGetCall { 9179 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9180 return c 9181} 9182 9183// IfNoneMatch sets the optional parameter which makes the operation 9184// fail if the object's ETag matches the given value. This is useful for 9185// getting updates only after the object has changed since the last 9186// request. Use googleapi.IsNotModified to check whether the response 9187// error from Do is the result of In-None-Match. 9188func (c *ProjectsRegionsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersGetCall { 9189 c.ifNoneMatch_ = entityTag 9190 return c 9191} 9192 9193// Context sets the context to be used in this call's Do method. Any 9194// pending HTTP request will be aborted if the provided context is 9195// canceled. 9196func (c *ProjectsRegionsClustersGetCall) Context(ctx context.Context) *ProjectsRegionsClustersGetCall { 9197 c.ctx_ = ctx 9198 return c 9199} 9200 9201// Header returns an http.Header that can be modified by the caller to 9202// add HTTP headers to the request. 9203func (c *ProjectsRegionsClustersGetCall) Header() http.Header { 9204 if c.header_ == nil { 9205 c.header_ = make(http.Header) 9206 } 9207 return c.header_ 9208} 9209 9210func (c *ProjectsRegionsClustersGetCall) doRequest(alt string) (*http.Response, error) { 9211 reqHeaders := make(http.Header) 9212 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 9213 for k, v := range c.header_ { 9214 reqHeaders[k] = v 9215 } 9216 reqHeaders.Set("User-Agent", c.s.userAgent()) 9217 if c.ifNoneMatch_ != "" { 9218 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9219 } 9220 var body io.Reader = nil 9221 c.urlParams_.Set("alt", alt) 9222 c.urlParams_.Set("prettyPrint", "false") 9223 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}") 9224 urls += "?" + c.urlParams_.Encode() 9225 req, err := http.NewRequest("GET", urls, body) 9226 if err != nil { 9227 return nil, err 9228 } 9229 req.Header = reqHeaders 9230 googleapi.Expand(req.URL, map[string]string{ 9231 "projectId": c.projectId, 9232 "region": c.region, 9233 "clusterName": c.clusterName, 9234 }) 9235 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9236} 9237 9238// Do executes the "dataproc.projects.regions.clusters.get" call. 9239// Exactly one of *Cluster or error will be non-nil. Any non-2xx status 9240// code is an error. Response headers are in either 9241// *Cluster.ServerResponse.Header or (if a response was returned at all) 9242// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9243// check whether the returned error was because http.StatusNotModified 9244// was returned. 9245func (c *ProjectsRegionsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) { 9246 gensupport.SetOptions(c.urlParams_, opts...) 9247 res, err := c.doRequest("json") 9248 if res != nil && res.StatusCode == http.StatusNotModified { 9249 if res.Body != nil { 9250 res.Body.Close() 9251 } 9252 return nil, &googleapi.Error{ 9253 Code: res.StatusCode, 9254 Header: res.Header, 9255 } 9256 } 9257 if err != nil { 9258 return nil, err 9259 } 9260 defer googleapi.CloseBody(res) 9261 if err := googleapi.CheckResponse(res); err != nil { 9262 return nil, err 9263 } 9264 ret := &Cluster{ 9265 ServerResponse: googleapi.ServerResponse{ 9266 Header: res.Header, 9267 HTTPStatusCode: res.StatusCode, 9268 }, 9269 } 9270 target := &ret 9271 if err := gensupport.DecodeResponse(target, res); err != nil { 9272 return nil, err 9273 } 9274 return ret, nil 9275 // { 9276 // "description": "Gets the resource representation for a cluster in a project.", 9277 // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", 9278 // "httpMethod": "GET", 9279 // "id": "dataproc.projects.regions.clusters.get", 9280 // "parameterOrder": [ 9281 // "projectId", 9282 // "region", 9283 // "clusterName" 9284 // ], 9285 // "parameters": { 9286 // "clusterName": { 9287 // "description": "Required. The cluster name.", 9288 // "location": "path", 9289 // "required": true, 9290 // "type": "string" 9291 // }, 9292 // "projectId": { 9293 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 9294 // "location": "path", 9295 // "required": true, 9296 // "type": "string" 9297 // }, 9298 // "region": { 9299 // "description": "Required. The Dataproc region in which to handle the request.", 9300 // "location": "path", 9301 // "required": true, 9302 // "type": "string" 9303 // } 9304 // }, 9305 // "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", 9306 // "response": { 9307 // "$ref": "Cluster" 9308 // }, 9309 // "scopes": [ 9310 // "https://www.googleapis.com/auth/cloud-platform" 9311 // ] 9312 // } 9313 9314} 9315 9316// method id "dataproc.projects.regions.clusters.getIamPolicy": 9317 9318type ProjectsRegionsClustersGetIamPolicyCall struct { 9319 s *Service 9320 resource string 9321 getiampolicyrequest *GetIamPolicyRequest 9322 urlParams_ gensupport.URLParams 9323 ctx_ context.Context 9324 header_ http.Header 9325} 9326 9327// GetIamPolicy: Gets the access control policy for a resource. Returns 9328// an empty policy if the resource exists and does not have a policy 9329// set. 9330// 9331// - resource: REQUIRED: The resource for which the policy is being 9332// requested. See the operation documentation for the appropriate 9333// value for this field. 9334func (r *ProjectsRegionsClustersService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsRegionsClustersGetIamPolicyCall { 9335 c := &ProjectsRegionsClustersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9336 c.resource = resource 9337 c.getiampolicyrequest = getiampolicyrequest 9338 return c 9339} 9340 9341// Fields allows partial responses to be retrieved. See 9342// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9343// for more information. 9344func (c *ProjectsRegionsClustersGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersGetIamPolicyCall { 9345 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9346 return c 9347} 9348 9349// Context sets the context to be used in this call's Do method. Any 9350// pending HTTP request will be aborted if the provided context is 9351// canceled. 9352func (c *ProjectsRegionsClustersGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsClustersGetIamPolicyCall { 9353 c.ctx_ = ctx 9354 return c 9355} 9356 9357// Header returns an http.Header that can be modified by the caller to 9358// add HTTP headers to the request. 9359func (c *ProjectsRegionsClustersGetIamPolicyCall) Header() http.Header { 9360 if c.header_ == nil { 9361 c.header_ = make(http.Header) 9362 } 9363 return c.header_ 9364} 9365 9366func (c *ProjectsRegionsClustersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 9367 reqHeaders := make(http.Header) 9368 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 9369 for k, v := range c.header_ { 9370 reqHeaders[k] = v 9371 } 9372 reqHeaders.Set("User-Agent", c.s.userAgent()) 9373 var body io.Reader = nil 9374 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 9375 if err != nil { 9376 return nil, err 9377 } 9378 reqHeaders.Set("Content-Type", "application/json") 9379 c.urlParams_.Set("alt", alt) 9380 c.urlParams_.Set("prettyPrint", "false") 9381 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") 9382 urls += "?" + c.urlParams_.Encode() 9383 req, err := http.NewRequest("POST", urls, body) 9384 if err != nil { 9385 return nil, err 9386 } 9387 req.Header = reqHeaders 9388 googleapi.Expand(req.URL, map[string]string{ 9389 "resource": c.resource, 9390 }) 9391 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9392} 9393 9394// Do executes the "dataproc.projects.regions.clusters.getIamPolicy" call. 9395// Exactly one of *Policy or error will be non-nil. Any non-2xx status 9396// code is an error. Response headers are in either 9397// *Policy.ServerResponse.Header or (if a response was returned at all) 9398// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9399// check whether the returned error was because http.StatusNotModified 9400// was returned. 9401func (c *ProjectsRegionsClustersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 9402 gensupport.SetOptions(c.urlParams_, opts...) 9403 res, err := c.doRequest("json") 9404 if res != nil && res.StatusCode == http.StatusNotModified { 9405 if res.Body != nil { 9406 res.Body.Close() 9407 } 9408 return nil, &googleapi.Error{ 9409 Code: res.StatusCode, 9410 Header: res.Header, 9411 } 9412 } 9413 if err != nil { 9414 return nil, err 9415 } 9416 defer googleapi.CloseBody(res) 9417 if err := googleapi.CheckResponse(res); err != nil { 9418 return nil, err 9419 } 9420 ret := &Policy{ 9421 ServerResponse: googleapi.ServerResponse{ 9422 Header: res.Header, 9423 HTTPStatusCode: res.StatusCode, 9424 }, 9425 } 9426 target := &ret 9427 if err := gensupport.DecodeResponse(target, res); err != nil { 9428 return nil, err 9429 } 9430 return ret, nil 9431 // { 9432 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 9433 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:getIamPolicy", 9434 // "httpMethod": "POST", 9435 // "id": "dataproc.projects.regions.clusters.getIamPolicy", 9436 // "parameterOrder": [ 9437 // "resource" 9438 // ], 9439 // "parameters": { 9440 // "resource": { 9441 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 9442 // "location": "path", 9443 // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$", 9444 // "required": true, 9445 // "type": "string" 9446 // } 9447 // }, 9448 // "path": "v1/{+resource}:getIamPolicy", 9449 // "request": { 9450 // "$ref": "GetIamPolicyRequest" 9451 // }, 9452 // "response": { 9453 // "$ref": "Policy" 9454 // }, 9455 // "scopes": [ 9456 // "https://www.googleapis.com/auth/cloud-platform" 9457 // ] 9458 // } 9459 9460} 9461 9462// method id "dataproc.projects.regions.clusters.injectCredentials": 9463 9464type ProjectsRegionsClustersInjectCredentialsCall struct { 9465 s *Service 9466 project string 9467 region string 9468 cluster string 9469 injectcredentialsrequest *InjectCredentialsRequest 9470 urlParams_ gensupport.URLParams 9471 ctx_ context.Context 9472 header_ http.Header 9473} 9474 9475// InjectCredentials: Inject encrypted credentials into all of the VMs 9476// in a cluster.The target cluster must be a personal auth cluster 9477// assigned to the user who is issuing the RPC. 9478// 9479// - cluster: The cluster, in the form clusters/. 9480// - project: The ID of the Google Cloud Platform project the cluster 9481// belongs to, of the form projects/. 9482// - region: The region containing the cluster, of the form regions/. 9483func (r *ProjectsRegionsClustersService) InjectCredentials(project string, region string, cluster string, injectcredentialsrequest *InjectCredentialsRequest) *ProjectsRegionsClustersInjectCredentialsCall { 9484 c := &ProjectsRegionsClustersInjectCredentialsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9485 c.project = project 9486 c.region = region 9487 c.cluster = cluster 9488 c.injectcredentialsrequest = injectcredentialsrequest 9489 return c 9490} 9491 9492// Fields allows partial responses to be retrieved. See 9493// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9494// for more information. 9495func (c *ProjectsRegionsClustersInjectCredentialsCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersInjectCredentialsCall { 9496 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9497 return c 9498} 9499 9500// Context sets the context to be used in this call's Do method. Any 9501// pending HTTP request will be aborted if the provided context is 9502// canceled. 9503func (c *ProjectsRegionsClustersInjectCredentialsCall) Context(ctx context.Context) *ProjectsRegionsClustersInjectCredentialsCall { 9504 c.ctx_ = ctx 9505 return c 9506} 9507 9508// Header returns an http.Header that can be modified by the caller to 9509// add HTTP headers to the request. 9510func (c *ProjectsRegionsClustersInjectCredentialsCall) Header() http.Header { 9511 if c.header_ == nil { 9512 c.header_ = make(http.Header) 9513 } 9514 return c.header_ 9515} 9516 9517func (c *ProjectsRegionsClustersInjectCredentialsCall) doRequest(alt string) (*http.Response, error) { 9518 reqHeaders := make(http.Header) 9519 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 9520 for k, v := range c.header_ { 9521 reqHeaders[k] = v 9522 } 9523 reqHeaders.Set("User-Agent", c.s.userAgent()) 9524 var body io.Reader = nil 9525 body, err := googleapi.WithoutDataWrapper.JSONReader(c.injectcredentialsrequest) 9526 if err != nil { 9527 return nil, err 9528 } 9529 reqHeaders.Set("Content-Type", "application/json") 9530 c.urlParams_.Set("alt", alt) 9531 c.urlParams_.Set("prettyPrint", "false") 9532 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+project}/{+region}/{+cluster}:injectCredentials") 9533 urls += "?" + c.urlParams_.Encode() 9534 req, err := http.NewRequest("POST", urls, body) 9535 if err != nil { 9536 return nil, err 9537 } 9538 req.Header = reqHeaders 9539 googleapi.Expand(req.URL, map[string]string{ 9540 "project": c.project, 9541 "region": c.region, 9542 "cluster": c.cluster, 9543 }) 9544 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9545} 9546 9547// Do executes the "dataproc.projects.regions.clusters.injectCredentials" call. 9548// Exactly one of *Operation or error will be non-nil. Any non-2xx 9549// status code is an error. Response headers are in either 9550// *Operation.ServerResponse.Header or (if a response was returned at 9551// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9552// to check whether the returned error was because 9553// http.StatusNotModified was returned. 9554func (c *ProjectsRegionsClustersInjectCredentialsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9555 gensupport.SetOptions(c.urlParams_, opts...) 9556 res, err := c.doRequest("json") 9557 if res != nil && res.StatusCode == http.StatusNotModified { 9558 if res.Body != nil { 9559 res.Body.Close() 9560 } 9561 return nil, &googleapi.Error{ 9562 Code: res.StatusCode, 9563 Header: res.Header, 9564 } 9565 } 9566 if err != nil { 9567 return nil, err 9568 } 9569 defer googleapi.CloseBody(res) 9570 if err := googleapi.CheckResponse(res); err != nil { 9571 return nil, err 9572 } 9573 ret := &Operation{ 9574 ServerResponse: googleapi.ServerResponse{ 9575 Header: res.Header, 9576 HTTPStatusCode: res.StatusCode, 9577 }, 9578 } 9579 target := &ret 9580 if err := gensupport.DecodeResponse(target, res); err != nil { 9581 return nil, err 9582 } 9583 return ret, nil 9584 // { 9585 // "description": "Inject encrypted credentials into all of the VMs in a cluster.The target cluster must be a personal auth cluster assigned to the user who is issuing the RPC.", 9586 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:injectCredentials", 9587 // "httpMethod": "POST", 9588 // "id": "dataproc.projects.regions.clusters.injectCredentials", 9589 // "parameterOrder": [ 9590 // "project", 9591 // "region", 9592 // "cluster" 9593 // ], 9594 // "parameters": { 9595 // "cluster": { 9596 // "description": "Required. The cluster, in the form clusters/.", 9597 // "location": "path", 9598 // "pattern": "^clusters/[^/]+$", 9599 // "required": true, 9600 // "type": "string" 9601 // }, 9602 // "project": { 9603 // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to, of the form projects/.", 9604 // "location": "path", 9605 // "pattern": "^projects/[^/]+$", 9606 // "required": true, 9607 // "type": "string" 9608 // }, 9609 // "region": { 9610 // "description": "Required. The region containing the cluster, of the form regions/.", 9611 // "location": "path", 9612 // "pattern": "^regions/[^/]+$", 9613 // "required": true, 9614 // "type": "string" 9615 // } 9616 // }, 9617 // "path": "v1/{+project}/{+region}/{+cluster}:injectCredentials", 9618 // "request": { 9619 // "$ref": "InjectCredentialsRequest" 9620 // }, 9621 // "response": { 9622 // "$ref": "Operation" 9623 // }, 9624 // "scopes": [ 9625 // "https://www.googleapis.com/auth/cloud-platform" 9626 // ] 9627 // } 9628 9629} 9630 9631// method id "dataproc.projects.regions.clusters.list": 9632 9633type ProjectsRegionsClustersListCall struct { 9634 s *Service 9635 projectId string 9636 region string 9637 urlParams_ gensupport.URLParams 9638 ifNoneMatch_ string 9639 ctx_ context.Context 9640 header_ http.Header 9641} 9642 9643// List: Lists all regions/{region}/clusters in a project 9644// alphabetically. 9645// 9646// - projectId: The ID of the Google Cloud Platform project that the 9647// cluster belongs to. 9648// - region: The Dataproc region in which to handle the request. 9649func (r *ProjectsRegionsClustersService) List(projectId string, region string) *ProjectsRegionsClustersListCall { 9650 c := &ProjectsRegionsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9651 c.projectId = projectId 9652 c.region = region 9653 return c 9654} 9655 9656// Filter sets the optional parameter "filter": A filter constraining 9657// the clusters to list. Filters are case-sensitive and have the 9658// following syntax:field = value AND field = value ...where field is 9659// one of status.state, clusterName, or labels.[KEY], and [KEY] is a 9660// label key. value can be * to match all values. status.state can be 9661// one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, 9662// DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and 9663// RUNNING states. INACTIVE contains the DELETING and ERROR states. 9664// clusterName is the name of the cluster provided at creation time. 9665// Only the logical AND operator is supported; space-separated items are 9666// treated as having an implicit AND operator.Example 9667// filter:status.state = ACTIVE AND clusterName = mycluster AND 9668// labels.env = staging AND labels.starred = * 9669func (c *ProjectsRegionsClustersListCall) Filter(filter string) *ProjectsRegionsClustersListCall { 9670 c.urlParams_.Set("filter", filter) 9671 return c 9672} 9673 9674// PageSize sets the optional parameter "pageSize": The standard List 9675// page size. 9676func (c *ProjectsRegionsClustersListCall) PageSize(pageSize int64) *ProjectsRegionsClustersListCall { 9677 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9678 return c 9679} 9680 9681// PageToken sets the optional parameter "pageToken": The standard List 9682// page token. 9683func (c *ProjectsRegionsClustersListCall) PageToken(pageToken string) *ProjectsRegionsClustersListCall { 9684 c.urlParams_.Set("pageToken", pageToken) 9685 return c 9686} 9687 9688// Fields allows partial responses to be retrieved. See 9689// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9690// for more information. 9691func (c *ProjectsRegionsClustersListCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersListCall { 9692 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9693 return c 9694} 9695 9696// IfNoneMatch sets the optional parameter which makes the operation 9697// fail if the object's ETag matches the given value. This is useful for 9698// getting updates only after the object has changed since the last 9699// request. Use googleapi.IsNotModified to check whether the response 9700// error from Do is the result of In-None-Match. 9701func (c *ProjectsRegionsClustersListCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersListCall { 9702 c.ifNoneMatch_ = entityTag 9703 return c 9704} 9705 9706// Context sets the context to be used in this call's Do method. Any 9707// pending HTTP request will be aborted if the provided context is 9708// canceled. 9709func (c *ProjectsRegionsClustersListCall) Context(ctx context.Context) *ProjectsRegionsClustersListCall { 9710 c.ctx_ = ctx 9711 return c 9712} 9713 9714// Header returns an http.Header that can be modified by the caller to 9715// add HTTP headers to the request. 9716func (c *ProjectsRegionsClustersListCall) Header() http.Header { 9717 if c.header_ == nil { 9718 c.header_ = make(http.Header) 9719 } 9720 return c.header_ 9721} 9722 9723func (c *ProjectsRegionsClustersListCall) doRequest(alt string) (*http.Response, error) { 9724 reqHeaders := make(http.Header) 9725 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 9726 for k, v := range c.header_ { 9727 reqHeaders[k] = v 9728 } 9729 reqHeaders.Set("User-Agent", c.s.userAgent()) 9730 if c.ifNoneMatch_ != "" { 9731 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9732 } 9733 var body io.Reader = nil 9734 c.urlParams_.Set("alt", alt) 9735 c.urlParams_.Set("prettyPrint", "false") 9736 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters") 9737 urls += "?" + c.urlParams_.Encode() 9738 req, err := http.NewRequest("GET", urls, body) 9739 if err != nil { 9740 return nil, err 9741 } 9742 req.Header = reqHeaders 9743 googleapi.Expand(req.URL, map[string]string{ 9744 "projectId": c.projectId, 9745 "region": c.region, 9746 }) 9747 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9748} 9749 9750// Do executes the "dataproc.projects.regions.clusters.list" call. 9751// Exactly one of *ListClustersResponse or error will be non-nil. Any 9752// non-2xx status code is an error. Response headers are in either 9753// *ListClustersResponse.ServerResponse.Header or (if a response was 9754// returned at all) in error.(*googleapi.Error).Header. Use 9755// googleapi.IsNotModified to check whether the returned error was 9756// because http.StatusNotModified was returned. 9757func (c *ProjectsRegionsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) { 9758 gensupport.SetOptions(c.urlParams_, opts...) 9759 res, err := c.doRequest("json") 9760 if res != nil && res.StatusCode == http.StatusNotModified { 9761 if res.Body != nil { 9762 res.Body.Close() 9763 } 9764 return nil, &googleapi.Error{ 9765 Code: res.StatusCode, 9766 Header: res.Header, 9767 } 9768 } 9769 if err != nil { 9770 return nil, err 9771 } 9772 defer googleapi.CloseBody(res) 9773 if err := googleapi.CheckResponse(res); err != nil { 9774 return nil, err 9775 } 9776 ret := &ListClustersResponse{ 9777 ServerResponse: googleapi.ServerResponse{ 9778 Header: res.Header, 9779 HTTPStatusCode: res.StatusCode, 9780 }, 9781 } 9782 target := &ret 9783 if err := gensupport.DecodeResponse(target, res); err != nil { 9784 return nil, err 9785 } 9786 return ret, nil 9787 // { 9788 // "description": "Lists all regions/{region}/clusters in a project alphabetically.", 9789 // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters", 9790 // "httpMethod": "GET", 9791 // "id": "dataproc.projects.regions.clusters.list", 9792 // "parameterOrder": [ 9793 // "projectId", 9794 // "region" 9795 // ], 9796 // "parameters": { 9797 // "filter": { 9798 // "description": "Optional. A filter constraining the clusters to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is one of status.state, clusterName, or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and RUNNING states. INACTIVE contains the DELETING and ERROR states. clusterName is the name of the cluster provided at creation time. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND clusterName = mycluster AND labels.env = staging AND labels.starred = *", 9799 // "location": "query", 9800 // "type": "string" 9801 // }, 9802 // "pageSize": { 9803 // "description": "Optional. The standard List page size.", 9804 // "format": "int32", 9805 // "location": "query", 9806 // "type": "integer" 9807 // }, 9808 // "pageToken": { 9809 // "description": "Optional. The standard List page token.", 9810 // "location": "query", 9811 // "type": "string" 9812 // }, 9813 // "projectId": { 9814 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 9815 // "location": "path", 9816 // "required": true, 9817 // "type": "string" 9818 // }, 9819 // "region": { 9820 // "description": "Required. The Dataproc region in which to handle the request.", 9821 // "location": "path", 9822 // "required": true, 9823 // "type": "string" 9824 // } 9825 // }, 9826 // "path": "v1/projects/{projectId}/regions/{region}/clusters", 9827 // "response": { 9828 // "$ref": "ListClustersResponse" 9829 // }, 9830 // "scopes": [ 9831 // "https://www.googleapis.com/auth/cloud-platform" 9832 // ] 9833 // } 9834 9835} 9836 9837// Pages invokes f for each page of results. 9838// A non-nil error returned from f will halt the iteration. 9839// The provided context supersedes any context provided to the Context method. 9840func (c *ProjectsRegionsClustersListCall) Pages(ctx context.Context, f func(*ListClustersResponse) error) error { 9841 c.ctx_ = ctx 9842 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9843 for { 9844 x, err := c.Do() 9845 if err != nil { 9846 return err 9847 } 9848 if err := f(x); err != nil { 9849 return err 9850 } 9851 if x.NextPageToken == "" { 9852 return nil 9853 } 9854 c.PageToken(x.NextPageToken) 9855 } 9856} 9857 9858// method id "dataproc.projects.regions.clusters.patch": 9859 9860type ProjectsRegionsClustersPatchCall struct { 9861 s *Service 9862 projectId string 9863 region string 9864 clusterName string 9865 cluster *Cluster 9866 urlParams_ gensupport.URLParams 9867 ctx_ context.Context 9868 header_ http.Header 9869} 9870 9871// Patch: Updates a cluster in a project. The returned 9872// Operation.metadata will be ClusterOperationMetadata 9873// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). 9874// The cluster must be in a RUNNING state or an error is returned. 9875// 9876// - clusterName: The cluster name. 9877// - projectId: The ID of the Google Cloud Platform project the cluster 9878// belongs to. 9879// - region: The Dataproc region in which to handle the request. 9880func (r *ProjectsRegionsClustersService) Patch(projectId string, region string, clusterName string, cluster *Cluster) *ProjectsRegionsClustersPatchCall { 9881 c := &ProjectsRegionsClustersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9882 c.projectId = projectId 9883 c.region = region 9884 c.clusterName = clusterName 9885 c.cluster = cluster 9886 return c 9887} 9888 9889// GracefulDecommissionTimeout sets the optional parameter 9890// "gracefulDecommissionTimeout": Timeout for graceful YARN 9891// decomissioning. Graceful decommissioning allows removing nodes from 9892// the cluster without interrupting jobs in progress. Timeout specifies 9893// how long to wait for jobs in progress to finish before forcefully 9894// removing nodes (and potentially interrupting jobs). Default timeout 9895// is 0 (for forceful decommission), and the maximum allowed timeout is 9896// 1 day. (see JSON representation of Duration 9897// (https://developers.google.com/protocol-buffers/docs/proto3#json)).Only 9898// supported on Dataproc image versions 1.2 and higher. 9899func (c *ProjectsRegionsClustersPatchCall) GracefulDecommissionTimeout(gracefulDecommissionTimeout string) *ProjectsRegionsClustersPatchCall { 9900 c.urlParams_.Set("gracefulDecommissionTimeout", gracefulDecommissionTimeout) 9901 return c 9902} 9903 9904// RequestId sets the optional parameter "requestId": A unique ID used 9905// to identify the request. If the server receives two 9906// UpdateClusterRequest 9907// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s 9908// with the same id, then the second request will be ignored and the 9909// first google.longrunning.Operation created and stored in the backend 9910// is returned.It is recommended to always set this value to a UUID 9911// (https://en.wikipedia.org/wiki/Universally_unique_identifier).The ID 9912// must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 9913// and hyphens (-). The maximum length is 40 characters. 9914func (c *ProjectsRegionsClustersPatchCall) RequestId(requestId string) *ProjectsRegionsClustersPatchCall { 9915 c.urlParams_.Set("requestId", requestId) 9916 return c 9917} 9918 9919// UpdateMask sets the optional parameter "updateMask": Required. 9920// Specifies the path, relative to Cluster, of the field to update. For 9921// example, to change the number of workers in a cluster to 5, the 9922// update_mask parameter would be specified as 9923// config.worker_config.num_instances, and the PATCH request body would 9924// specify the new value, as follows: { "config":{ "workerConfig":{ 9925// "numInstances":"5" } } } Similarly, to change the number of 9926// preemptible workers in a cluster to 5, the update_mask parameter 9927// would be config.secondary_worker_config.num_instances, and the PATCH 9928// request body would be set as follows: { "config":{ 9929// "secondaryWorkerConfig":{ "numInstances":"5" } } } *Note:* Currently, 9930// only the following fields can be updated: *Mask* *Purpose* *labels* 9931// Update labels *config.worker_config.num_instances* Resize primary 9932// worker group *config.secondary_worker_config.num_instances* Resize 9933// secondary worker group config.autoscaling_config.policy_uri Use, stop 9934// using, or change autoscaling policies 9935func (c *ProjectsRegionsClustersPatchCall) UpdateMask(updateMask string) *ProjectsRegionsClustersPatchCall { 9936 c.urlParams_.Set("updateMask", updateMask) 9937 return c 9938} 9939 9940// Fields allows partial responses to be retrieved. See 9941// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9942// for more information. 9943func (c *ProjectsRegionsClustersPatchCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersPatchCall { 9944 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9945 return c 9946} 9947 9948// Context sets the context to be used in this call's Do method. Any 9949// pending HTTP request will be aborted if the provided context is 9950// canceled. 9951func (c *ProjectsRegionsClustersPatchCall) Context(ctx context.Context) *ProjectsRegionsClustersPatchCall { 9952 c.ctx_ = ctx 9953 return c 9954} 9955 9956// Header returns an http.Header that can be modified by the caller to 9957// add HTTP headers to the request. 9958func (c *ProjectsRegionsClustersPatchCall) Header() http.Header { 9959 if c.header_ == nil { 9960 c.header_ = make(http.Header) 9961 } 9962 return c.header_ 9963} 9964 9965func (c *ProjectsRegionsClustersPatchCall) doRequest(alt string) (*http.Response, error) { 9966 reqHeaders := make(http.Header) 9967 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 9968 for k, v := range c.header_ { 9969 reqHeaders[k] = v 9970 } 9971 reqHeaders.Set("User-Agent", c.s.userAgent()) 9972 var body io.Reader = nil 9973 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) 9974 if err != nil { 9975 return nil, err 9976 } 9977 reqHeaders.Set("Content-Type", "application/json") 9978 c.urlParams_.Set("alt", alt) 9979 c.urlParams_.Set("prettyPrint", "false") 9980 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}") 9981 urls += "?" + c.urlParams_.Encode() 9982 req, err := http.NewRequest("PATCH", urls, body) 9983 if err != nil { 9984 return nil, err 9985 } 9986 req.Header = reqHeaders 9987 googleapi.Expand(req.URL, map[string]string{ 9988 "projectId": c.projectId, 9989 "region": c.region, 9990 "clusterName": c.clusterName, 9991 }) 9992 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9993} 9994 9995// Do executes the "dataproc.projects.regions.clusters.patch" call. 9996// Exactly one of *Operation or error will be non-nil. Any non-2xx 9997// status code is an error. Response headers are in either 9998// *Operation.ServerResponse.Header or (if a response was returned at 9999// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10000// to check whether the returned error was because 10001// http.StatusNotModified was returned. 10002func (c *ProjectsRegionsClustersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10003 gensupport.SetOptions(c.urlParams_, opts...) 10004 res, err := c.doRequest("json") 10005 if res != nil && res.StatusCode == http.StatusNotModified { 10006 if res.Body != nil { 10007 res.Body.Close() 10008 } 10009 return nil, &googleapi.Error{ 10010 Code: res.StatusCode, 10011 Header: res.Header, 10012 } 10013 } 10014 if err != nil { 10015 return nil, err 10016 } 10017 defer googleapi.CloseBody(res) 10018 if err := googleapi.CheckResponse(res); err != nil { 10019 return nil, err 10020 } 10021 ret := &Operation{ 10022 ServerResponse: googleapi.ServerResponse{ 10023 Header: res.Header, 10024 HTTPStatusCode: res.StatusCode, 10025 }, 10026 } 10027 target := &ret 10028 if err := gensupport.DecodeResponse(target, res); err != nil { 10029 return nil, err 10030 } 10031 return ret, nil 10032 // { 10033 // "description": "Updates a cluster in a project. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata). The cluster must be in a RUNNING state or an error is returned.", 10034 // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", 10035 // "httpMethod": "PATCH", 10036 // "id": "dataproc.projects.regions.clusters.patch", 10037 // "parameterOrder": [ 10038 // "projectId", 10039 // "region", 10040 // "clusterName" 10041 // ], 10042 // "parameters": { 10043 // "clusterName": { 10044 // "description": "Required. The cluster name.", 10045 // "location": "path", 10046 // "required": true, 10047 // "type": "string" 10048 // }, 10049 // "gracefulDecommissionTimeout": { 10050 // "description": "Optional. Timeout for graceful YARN decomissioning. Graceful decommissioning allows removing nodes from the cluster without interrupting jobs in progress. Timeout specifies how long to wait for jobs in progress to finish before forcefully removing nodes (and potentially interrupting jobs). Default timeout is 0 (for forceful decommission), and the maximum allowed timeout is 1 day. (see JSON representation of Duration (https://developers.google.com/protocol-buffers/docs/proto3#json)).Only supported on Dataproc image versions 1.2 and higher.", 10051 // "format": "google-duration", 10052 // "location": "query", 10053 // "type": "string" 10054 // }, 10055 // "projectId": { 10056 // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", 10057 // "location": "path", 10058 // "required": true, 10059 // "type": "string" 10060 // }, 10061 // "region": { 10062 // "description": "Required. The Dataproc region in which to handle the request.", 10063 // "location": "path", 10064 // "required": true, 10065 // "type": "string" 10066 // }, 10067 // "requestId": { 10068 // "description": "Optional. A unique ID used to identify the request. If the server receives two UpdateClusterRequest (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#google.cloud.dataproc.v1.UpdateClusterRequest)s with the same id, then the second request will be ignored and the first google.longrunning.Operation created and stored in the backend is returned.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The ID must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", 10069 // "location": "query", 10070 // "type": "string" 10071 // }, 10072 // "updateMask": { 10073 // "description": "Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows: { \"config\":{ \"workerConfig\":{ \"numInstances\":\"5\" } } } Similarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows: { \"config\":{ \"secondaryWorkerConfig\":{ \"numInstances\":\"5\" } } } *Note:* Currently, only the following fields can be updated: *Mask* *Purpose* *labels* Update labels *config.worker_config.num_instances* Resize primary worker group *config.secondary_worker_config.num_instances* Resize secondary worker group config.autoscaling_config.policy_uri Use, stop using, or change autoscaling policies ", 10074 // "format": "google-fieldmask", 10075 // "location": "query", 10076 // "type": "string" 10077 // } 10078 // }, 10079 // "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}", 10080 // "request": { 10081 // "$ref": "Cluster" 10082 // }, 10083 // "response": { 10084 // "$ref": "Operation" 10085 // }, 10086 // "scopes": [ 10087 // "https://www.googleapis.com/auth/cloud-platform" 10088 // ] 10089 // } 10090 10091} 10092 10093// method id "dataproc.projects.regions.clusters.repair": 10094 10095type ProjectsRegionsClustersRepairCall struct { 10096 s *Service 10097 projectId string 10098 region string 10099 clusterName string 10100 repairclusterrequest *RepairClusterRequest 10101 urlParams_ gensupport.URLParams 10102 ctx_ context.Context 10103 header_ http.Header 10104} 10105 10106// Repair: Repairs a cluster. 10107// 10108// - clusterName: The cluster name. 10109// - projectId: The ID of the Google Cloud Platform project the cluster 10110// belongs to. 10111// - region: The Dataproc region in which to handle the request. 10112func (r *ProjectsRegionsClustersService) Repair(projectId string, region string, clusterName string, repairclusterrequest *RepairClusterRequest) *ProjectsRegionsClustersRepairCall { 10113 c := &ProjectsRegionsClustersRepairCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10114 c.projectId = projectId 10115 c.region = region 10116 c.clusterName = clusterName 10117 c.repairclusterrequest = repairclusterrequest 10118 return c 10119} 10120 10121// Fields allows partial responses to be retrieved. See 10122// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10123// for more information. 10124func (c *ProjectsRegionsClustersRepairCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersRepairCall { 10125 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10126 return c 10127} 10128 10129// Context sets the context to be used in this call's Do method. Any 10130// pending HTTP request will be aborted if the provided context is 10131// canceled. 10132func (c *ProjectsRegionsClustersRepairCall) Context(ctx context.Context) *ProjectsRegionsClustersRepairCall { 10133 c.ctx_ = ctx 10134 return c 10135} 10136 10137// Header returns an http.Header that can be modified by the caller to 10138// add HTTP headers to the request. 10139func (c *ProjectsRegionsClustersRepairCall) Header() http.Header { 10140 if c.header_ == nil { 10141 c.header_ = make(http.Header) 10142 } 10143 return c.header_ 10144} 10145 10146func (c *ProjectsRegionsClustersRepairCall) doRequest(alt string) (*http.Response, error) { 10147 reqHeaders := make(http.Header) 10148 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 10149 for k, v := range c.header_ { 10150 reqHeaders[k] = v 10151 } 10152 reqHeaders.Set("User-Agent", c.s.userAgent()) 10153 var body io.Reader = nil 10154 body, err := googleapi.WithoutDataWrapper.JSONReader(c.repairclusterrequest) 10155 if err != nil { 10156 return nil, err 10157 } 10158 reqHeaders.Set("Content-Type", "application/json") 10159 c.urlParams_.Set("alt", alt) 10160 c.urlParams_.Set("prettyPrint", "false") 10161 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:repair") 10162 urls += "?" + c.urlParams_.Encode() 10163 req, err := http.NewRequest("POST", urls, body) 10164 if err != nil { 10165 return nil, err 10166 } 10167 req.Header = reqHeaders 10168 googleapi.Expand(req.URL, map[string]string{ 10169 "projectId": c.projectId, 10170 "region": c.region, 10171 "clusterName": c.clusterName, 10172 }) 10173 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10174} 10175 10176// Do executes the "dataproc.projects.regions.clusters.repair" call. 10177// Exactly one of *Operation or error will be non-nil. Any non-2xx 10178// status code is an error. Response headers are in either 10179// *Operation.ServerResponse.Header or (if a response was returned at 10180// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10181// to check whether the returned error was because 10182// http.StatusNotModified was returned. 10183func (c *ProjectsRegionsClustersRepairCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10184 gensupport.SetOptions(c.urlParams_, opts...) 10185 res, err := c.doRequest("json") 10186 if res != nil && res.StatusCode == http.StatusNotModified { 10187 if res.Body != nil { 10188 res.Body.Close() 10189 } 10190 return nil, &googleapi.Error{ 10191 Code: res.StatusCode, 10192 Header: res.Header, 10193 } 10194 } 10195 if err != nil { 10196 return nil, err 10197 } 10198 defer googleapi.CloseBody(res) 10199 if err := googleapi.CheckResponse(res); err != nil { 10200 return nil, err 10201 } 10202 ret := &Operation{ 10203 ServerResponse: googleapi.ServerResponse{ 10204 Header: res.Header, 10205 HTTPStatusCode: res.StatusCode, 10206 }, 10207 } 10208 target := &ret 10209 if err := gensupport.DecodeResponse(target, res); err != nil { 10210 return nil, err 10211 } 10212 return ret, nil 10213 // { 10214 // "description": "Repairs a cluster.", 10215 // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:repair", 10216 // "httpMethod": "POST", 10217 // "id": "dataproc.projects.regions.clusters.repair", 10218 // "parameterOrder": [ 10219 // "projectId", 10220 // "region", 10221 // "clusterName" 10222 // ], 10223 // "parameters": { 10224 // "clusterName": { 10225 // "description": "Required. The cluster name.", 10226 // "location": "path", 10227 // "required": true, 10228 // "type": "string" 10229 // }, 10230 // "projectId": { 10231 // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", 10232 // "location": "path", 10233 // "required": true, 10234 // "type": "string" 10235 // }, 10236 // "region": { 10237 // "description": "Required. The Dataproc region in which to handle the request.", 10238 // "location": "path", 10239 // "required": true, 10240 // "type": "string" 10241 // } 10242 // }, 10243 // "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:repair", 10244 // "request": { 10245 // "$ref": "RepairClusterRequest" 10246 // }, 10247 // "response": { 10248 // "$ref": "Operation" 10249 // }, 10250 // "scopes": [ 10251 // "https://www.googleapis.com/auth/cloud-platform" 10252 // ] 10253 // } 10254 10255} 10256 10257// method id "dataproc.projects.regions.clusters.setIamPolicy": 10258 10259type ProjectsRegionsClustersSetIamPolicyCall struct { 10260 s *Service 10261 resource string 10262 setiampolicyrequest *SetIamPolicyRequest 10263 urlParams_ gensupport.URLParams 10264 ctx_ context.Context 10265 header_ http.Header 10266} 10267 10268// SetIamPolicy: Sets the access control policy on the specified 10269// resource. Replaces any existing policy.Can return NOT_FOUND, 10270// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 10271// 10272// - resource: REQUIRED: The resource for which the policy is being 10273// specified. See the operation documentation for the appropriate 10274// value for this field. 10275func (r *ProjectsRegionsClustersService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsClustersSetIamPolicyCall { 10276 c := &ProjectsRegionsClustersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10277 c.resource = resource 10278 c.setiampolicyrequest = setiampolicyrequest 10279 return c 10280} 10281 10282// Fields allows partial responses to be retrieved. See 10283// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10284// for more information. 10285func (c *ProjectsRegionsClustersSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersSetIamPolicyCall { 10286 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10287 return c 10288} 10289 10290// Context sets the context to be used in this call's Do method. Any 10291// pending HTTP request will be aborted if the provided context is 10292// canceled. 10293func (c *ProjectsRegionsClustersSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsClustersSetIamPolicyCall { 10294 c.ctx_ = ctx 10295 return c 10296} 10297 10298// Header returns an http.Header that can be modified by the caller to 10299// add HTTP headers to the request. 10300func (c *ProjectsRegionsClustersSetIamPolicyCall) Header() http.Header { 10301 if c.header_ == nil { 10302 c.header_ = make(http.Header) 10303 } 10304 return c.header_ 10305} 10306 10307func (c *ProjectsRegionsClustersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 10308 reqHeaders := make(http.Header) 10309 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 10310 for k, v := range c.header_ { 10311 reqHeaders[k] = v 10312 } 10313 reqHeaders.Set("User-Agent", c.s.userAgent()) 10314 var body io.Reader = nil 10315 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 10316 if err != nil { 10317 return nil, err 10318 } 10319 reqHeaders.Set("Content-Type", "application/json") 10320 c.urlParams_.Set("alt", alt) 10321 c.urlParams_.Set("prettyPrint", "false") 10322 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") 10323 urls += "?" + c.urlParams_.Encode() 10324 req, err := http.NewRequest("POST", urls, body) 10325 if err != nil { 10326 return nil, err 10327 } 10328 req.Header = reqHeaders 10329 googleapi.Expand(req.URL, map[string]string{ 10330 "resource": c.resource, 10331 }) 10332 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10333} 10334 10335// Do executes the "dataproc.projects.regions.clusters.setIamPolicy" call. 10336// Exactly one of *Policy or error will be non-nil. Any non-2xx status 10337// code is an error. Response headers are in either 10338// *Policy.ServerResponse.Header or (if a response was returned at all) 10339// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10340// check whether the returned error was because http.StatusNotModified 10341// was returned. 10342func (c *ProjectsRegionsClustersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 10343 gensupport.SetOptions(c.urlParams_, opts...) 10344 res, err := c.doRequest("json") 10345 if res != nil && res.StatusCode == http.StatusNotModified { 10346 if res.Body != nil { 10347 res.Body.Close() 10348 } 10349 return nil, &googleapi.Error{ 10350 Code: res.StatusCode, 10351 Header: res.Header, 10352 } 10353 } 10354 if err != nil { 10355 return nil, err 10356 } 10357 defer googleapi.CloseBody(res) 10358 if err := googleapi.CheckResponse(res); err != nil { 10359 return nil, err 10360 } 10361 ret := &Policy{ 10362 ServerResponse: googleapi.ServerResponse{ 10363 Header: res.Header, 10364 HTTPStatusCode: res.StatusCode, 10365 }, 10366 } 10367 target := &ret 10368 if err := gensupport.DecodeResponse(target, res); err != nil { 10369 return nil, err 10370 } 10371 return ret, nil 10372 // { 10373 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 10374 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:setIamPolicy", 10375 // "httpMethod": "POST", 10376 // "id": "dataproc.projects.regions.clusters.setIamPolicy", 10377 // "parameterOrder": [ 10378 // "resource" 10379 // ], 10380 // "parameters": { 10381 // "resource": { 10382 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 10383 // "location": "path", 10384 // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$", 10385 // "required": true, 10386 // "type": "string" 10387 // } 10388 // }, 10389 // "path": "v1/{+resource}:setIamPolicy", 10390 // "request": { 10391 // "$ref": "SetIamPolicyRequest" 10392 // }, 10393 // "response": { 10394 // "$ref": "Policy" 10395 // }, 10396 // "scopes": [ 10397 // "https://www.googleapis.com/auth/cloud-platform" 10398 // ] 10399 // } 10400 10401} 10402 10403// method id "dataproc.projects.regions.clusters.start": 10404 10405type ProjectsRegionsClustersStartCall struct { 10406 s *Service 10407 projectId string 10408 region string 10409 clusterName string 10410 startclusterrequest *StartClusterRequest 10411 urlParams_ gensupport.URLParams 10412 ctx_ context.Context 10413 header_ http.Header 10414} 10415 10416// Start: Starts a cluster in a project. 10417// 10418// - clusterName: The cluster name. 10419// - projectId: The ID of the Google Cloud Platform project the cluster 10420// belongs to. 10421// - region: The Dataproc region in which to handle the request. 10422func (r *ProjectsRegionsClustersService) Start(projectId string, region string, clusterName string, startclusterrequest *StartClusterRequest) *ProjectsRegionsClustersStartCall { 10423 c := &ProjectsRegionsClustersStartCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10424 c.projectId = projectId 10425 c.region = region 10426 c.clusterName = clusterName 10427 c.startclusterrequest = startclusterrequest 10428 return c 10429} 10430 10431// Fields allows partial responses to be retrieved. See 10432// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10433// for more information. 10434func (c *ProjectsRegionsClustersStartCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersStartCall { 10435 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10436 return c 10437} 10438 10439// Context sets the context to be used in this call's Do method. Any 10440// pending HTTP request will be aborted if the provided context is 10441// canceled. 10442func (c *ProjectsRegionsClustersStartCall) Context(ctx context.Context) *ProjectsRegionsClustersStartCall { 10443 c.ctx_ = ctx 10444 return c 10445} 10446 10447// Header returns an http.Header that can be modified by the caller to 10448// add HTTP headers to the request. 10449func (c *ProjectsRegionsClustersStartCall) Header() http.Header { 10450 if c.header_ == nil { 10451 c.header_ = make(http.Header) 10452 } 10453 return c.header_ 10454} 10455 10456func (c *ProjectsRegionsClustersStartCall) doRequest(alt string) (*http.Response, error) { 10457 reqHeaders := make(http.Header) 10458 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 10459 for k, v := range c.header_ { 10460 reqHeaders[k] = v 10461 } 10462 reqHeaders.Set("User-Agent", c.s.userAgent()) 10463 var body io.Reader = nil 10464 body, err := googleapi.WithoutDataWrapper.JSONReader(c.startclusterrequest) 10465 if err != nil { 10466 return nil, err 10467 } 10468 reqHeaders.Set("Content-Type", "application/json") 10469 c.urlParams_.Set("alt", alt) 10470 c.urlParams_.Set("prettyPrint", "false") 10471 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:start") 10472 urls += "?" + c.urlParams_.Encode() 10473 req, err := http.NewRequest("POST", urls, body) 10474 if err != nil { 10475 return nil, err 10476 } 10477 req.Header = reqHeaders 10478 googleapi.Expand(req.URL, map[string]string{ 10479 "projectId": c.projectId, 10480 "region": c.region, 10481 "clusterName": c.clusterName, 10482 }) 10483 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10484} 10485 10486// Do executes the "dataproc.projects.regions.clusters.start" call. 10487// Exactly one of *Operation or error will be non-nil. Any non-2xx 10488// status code is an error. Response headers are in either 10489// *Operation.ServerResponse.Header or (if a response was returned at 10490// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10491// to check whether the returned error was because 10492// http.StatusNotModified was returned. 10493func (c *ProjectsRegionsClustersStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10494 gensupport.SetOptions(c.urlParams_, opts...) 10495 res, err := c.doRequest("json") 10496 if res != nil && res.StatusCode == http.StatusNotModified { 10497 if res.Body != nil { 10498 res.Body.Close() 10499 } 10500 return nil, &googleapi.Error{ 10501 Code: res.StatusCode, 10502 Header: res.Header, 10503 } 10504 } 10505 if err != nil { 10506 return nil, err 10507 } 10508 defer googleapi.CloseBody(res) 10509 if err := googleapi.CheckResponse(res); err != nil { 10510 return nil, err 10511 } 10512 ret := &Operation{ 10513 ServerResponse: googleapi.ServerResponse{ 10514 Header: res.Header, 10515 HTTPStatusCode: res.StatusCode, 10516 }, 10517 } 10518 target := &ret 10519 if err := gensupport.DecodeResponse(target, res); err != nil { 10520 return nil, err 10521 } 10522 return ret, nil 10523 // { 10524 // "description": "Starts a cluster in a project.", 10525 // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:start", 10526 // "httpMethod": "POST", 10527 // "id": "dataproc.projects.regions.clusters.start", 10528 // "parameterOrder": [ 10529 // "projectId", 10530 // "region", 10531 // "clusterName" 10532 // ], 10533 // "parameters": { 10534 // "clusterName": { 10535 // "description": "Required. The cluster name.", 10536 // "location": "path", 10537 // "required": true, 10538 // "type": "string" 10539 // }, 10540 // "projectId": { 10541 // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", 10542 // "location": "path", 10543 // "required": true, 10544 // "type": "string" 10545 // }, 10546 // "region": { 10547 // "description": "Required. The Dataproc region in which to handle the request.", 10548 // "location": "path", 10549 // "required": true, 10550 // "type": "string" 10551 // } 10552 // }, 10553 // "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:start", 10554 // "request": { 10555 // "$ref": "StartClusterRequest" 10556 // }, 10557 // "response": { 10558 // "$ref": "Operation" 10559 // }, 10560 // "scopes": [ 10561 // "https://www.googleapis.com/auth/cloud-platform" 10562 // ] 10563 // } 10564 10565} 10566 10567// method id "dataproc.projects.regions.clusters.stop": 10568 10569type ProjectsRegionsClustersStopCall struct { 10570 s *Service 10571 projectId string 10572 region string 10573 clusterName string 10574 stopclusterrequest *StopClusterRequest 10575 urlParams_ gensupport.URLParams 10576 ctx_ context.Context 10577 header_ http.Header 10578} 10579 10580// Stop: Stops a cluster in a project. 10581// 10582// - clusterName: The cluster name. 10583// - projectId: The ID of the Google Cloud Platform project the cluster 10584// belongs to. 10585// - region: The Dataproc region in which to handle the request. 10586func (r *ProjectsRegionsClustersService) Stop(projectId string, region string, clusterName string, stopclusterrequest *StopClusterRequest) *ProjectsRegionsClustersStopCall { 10587 c := &ProjectsRegionsClustersStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10588 c.projectId = projectId 10589 c.region = region 10590 c.clusterName = clusterName 10591 c.stopclusterrequest = stopclusterrequest 10592 return c 10593} 10594 10595// Fields allows partial responses to be retrieved. See 10596// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10597// for more information. 10598func (c *ProjectsRegionsClustersStopCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersStopCall { 10599 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10600 return c 10601} 10602 10603// Context sets the context to be used in this call's Do method. Any 10604// pending HTTP request will be aborted if the provided context is 10605// canceled. 10606func (c *ProjectsRegionsClustersStopCall) Context(ctx context.Context) *ProjectsRegionsClustersStopCall { 10607 c.ctx_ = ctx 10608 return c 10609} 10610 10611// Header returns an http.Header that can be modified by the caller to 10612// add HTTP headers to the request. 10613func (c *ProjectsRegionsClustersStopCall) Header() http.Header { 10614 if c.header_ == nil { 10615 c.header_ = make(http.Header) 10616 } 10617 return c.header_ 10618} 10619 10620func (c *ProjectsRegionsClustersStopCall) doRequest(alt string) (*http.Response, error) { 10621 reqHeaders := make(http.Header) 10622 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 10623 for k, v := range c.header_ { 10624 reqHeaders[k] = v 10625 } 10626 reqHeaders.Set("User-Agent", c.s.userAgent()) 10627 var body io.Reader = nil 10628 body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopclusterrequest) 10629 if err != nil { 10630 return nil, err 10631 } 10632 reqHeaders.Set("Content-Type", "application/json") 10633 c.urlParams_.Set("alt", alt) 10634 c.urlParams_.Set("prettyPrint", "false") 10635 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:stop") 10636 urls += "?" + c.urlParams_.Encode() 10637 req, err := http.NewRequest("POST", urls, body) 10638 if err != nil { 10639 return nil, err 10640 } 10641 req.Header = reqHeaders 10642 googleapi.Expand(req.URL, map[string]string{ 10643 "projectId": c.projectId, 10644 "region": c.region, 10645 "clusterName": c.clusterName, 10646 }) 10647 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10648} 10649 10650// Do executes the "dataproc.projects.regions.clusters.stop" call. 10651// Exactly one of *Operation or error will be non-nil. Any non-2xx 10652// status code is an error. Response headers are in either 10653// *Operation.ServerResponse.Header or (if a response was returned at 10654// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10655// to check whether the returned error was because 10656// http.StatusNotModified was returned. 10657func (c *ProjectsRegionsClustersStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10658 gensupport.SetOptions(c.urlParams_, opts...) 10659 res, err := c.doRequest("json") 10660 if res != nil && res.StatusCode == http.StatusNotModified { 10661 if res.Body != nil { 10662 res.Body.Close() 10663 } 10664 return nil, &googleapi.Error{ 10665 Code: res.StatusCode, 10666 Header: res.Header, 10667 } 10668 } 10669 if err != nil { 10670 return nil, err 10671 } 10672 defer googleapi.CloseBody(res) 10673 if err := googleapi.CheckResponse(res); err != nil { 10674 return nil, err 10675 } 10676 ret := &Operation{ 10677 ServerResponse: googleapi.ServerResponse{ 10678 Header: res.Header, 10679 HTTPStatusCode: res.StatusCode, 10680 }, 10681 } 10682 target := &ret 10683 if err := gensupport.DecodeResponse(target, res); err != nil { 10684 return nil, err 10685 } 10686 return ret, nil 10687 // { 10688 // "description": "Stops a cluster in a project.", 10689 // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:stop", 10690 // "httpMethod": "POST", 10691 // "id": "dataproc.projects.regions.clusters.stop", 10692 // "parameterOrder": [ 10693 // "projectId", 10694 // "region", 10695 // "clusterName" 10696 // ], 10697 // "parameters": { 10698 // "clusterName": { 10699 // "description": "Required. The cluster name.", 10700 // "location": "path", 10701 // "required": true, 10702 // "type": "string" 10703 // }, 10704 // "projectId": { 10705 // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", 10706 // "location": "path", 10707 // "required": true, 10708 // "type": "string" 10709 // }, 10710 // "region": { 10711 // "description": "Required. The Dataproc region in which to handle the request.", 10712 // "location": "path", 10713 // "required": true, 10714 // "type": "string" 10715 // } 10716 // }, 10717 // "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:stop", 10718 // "request": { 10719 // "$ref": "StopClusterRequest" 10720 // }, 10721 // "response": { 10722 // "$ref": "Operation" 10723 // }, 10724 // "scopes": [ 10725 // "https://www.googleapis.com/auth/cloud-platform" 10726 // ] 10727 // } 10728 10729} 10730 10731// method id "dataproc.projects.regions.clusters.testIamPermissions": 10732 10733type ProjectsRegionsClustersTestIamPermissionsCall struct { 10734 s *Service 10735 resource string 10736 testiampermissionsrequest *TestIamPermissionsRequest 10737 urlParams_ gensupport.URLParams 10738 ctx_ context.Context 10739 header_ http.Header 10740} 10741 10742// TestIamPermissions: Returns permissions that a caller has on the 10743// specified resource. If the resource does not exist, this will return 10744// an empty set of permissions, not a NOT_FOUND error.Note: This 10745// operation is designed to be used for building permission-aware UIs 10746// and command-line tools, not for authorization checking. This 10747// operation may "fail open" without warning. 10748// 10749// - resource: REQUIRED: The resource for which the policy detail is 10750// being requested. See the operation documentation for the 10751// appropriate value for this field. 10752func (r *ProjectsRegionsClustersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsClustersTestIamPermissionsCall { 10753 c := &ProjectsRegionsClustersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10754 c.resource = resource 10755 c.testiampermissionsrequest = testiampermissionsrequest 10756 return c 10757} 10758 10759// Fields allows partial responses to be retrieved. See 10760// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10761// for more information. 10762func (c *ProjectsRegionsClustersTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersTestIamPermissionsCall { 10763 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10764 return c 10765} 10766 10767// Context sets the context to be used in this call's Do method. Any 10768// pending HTTP request will be aborted if the provided context is 10769// canceled. 10770func (c *ProjectsRegionsClustersTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsClustersTestIamPermissionsCall { 10771 c.ctx_ = ctx 10772 return c 10773} 10774 10775// Header returns an http.Header that can be modified by the caller to 10776// add HTTP headers to the request. 10777func (c *ProjectsRegionsClustersTestIamPermissionsCall) Header() http.Header { 10778 if c.header_ == nil { 10779 c.header_ = make(http.Header) 10780 } 10781 return c.header_ 10782} 10783 10784func (c *ProjectsRegionsClustersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 10785 reqHeaders := make(http.Header) 10786 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 10787 for k, v := range c.header_ { 10788 reqHeaders[k] = v 10789 } 10790 reqHeaders.Set("User-Agent", c.s.userAgent()) 10791 var body io.Reader = nil 10792 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 10793 if err != nil { 10794 return nil, err 10795 } 10796 reqHeaders.Set("Content-Type", "application/json") 10797 c.urlParams_.Set("alt", alt) 10798 c.urlParams_.Set("prettyPrint", "false") 10799 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") 10800 urls += "?" + c.urlParams_.Encode() 10801 req, err := http.NewRequest("POST", urls, body) 10802 if err != nil { 10803 return nil, err 10804 } 10805 req.Header = reqHeaders 10806 googleapi.Expand(req.URL, map[string]string{ 10807 "resource": c.resource, 10808 }) 10809 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10810} 10811 10812// Do executes the "dataproc.projects.regions.clusters.testIamPermissions" call. 10813// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 10814// Any non-2xx status code is an error. Response headers are in either 10815// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 10816// was returned at all) in error.(*googleapi.Error).Header. Use 10817// googleapi.IsNotModified to check whether the returned error was 10818// because http.StatusNotModified was returned. 10819func (c *ProjectsRegionsClustersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 10820 gensupport.SetOptions(c.urlParams_, opts...) 10821 res, err := c.doRequest("json") 10822 if res != nil && res.StatusCode == http.StatusNotModified { 10823 if res.Body != nil { 10824 res.Body.Close() 10825 } 10826 return nil, &googleapi.Error{ 10827 Code: res.StatusCode, 10828 Header: res.Header, 10829 } 10830 } 10831 if err != nil { 10832 return nil, err 10833 } 10834 defer googleapi.CloseBody(res) 10835 if err := googleapi.CheckResponse(res); err != nil { 10836 return nil, err 10837 } 10838 ret := &TestIamPermissionsResponse{ 10839 ServerResponse: googleapi.ServerResponse{ 10840 Header: res.Header, 10841 HTTPStatusCode: res.StatusCode, 10842 }, 10843 } 10844 target := &ret 10845 if err := gensupport.DecodeResponse(target, res); err != nil { 10846 return nil, err 10847 } 10848 return ret, nil 10849 // { 10850 // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 10851 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:testIamPermissions", 10852 // "httpMethod": "POST", 10853 // "id": "dataproc.projects.regions.clusters.testIamPermissions", 10854 // "parameterOrder": [ 10855 // "resource" 10856 // ], 10857 // "parameters": { 10858 // "resource": { 10859 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 10860 // "location": "path", 10861 // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$", 10862 // "required": true, 10863 // "type": "string" 10864 // } 10865 // }, 10866 // "path": "v1/{+resource}:testIamPermissions", 10867 // "request": { 10868 // "$ref": "TestIamPermissionsRequest" 10869 // }, 10870 // "response": { 10871 // "$ref": "TestIamPermissionsResponse" 10872 // }, 10873 // "scopes": [ 10874 // "https://www.googleapis.com/auth/cloud-platform" 10875 // ] 10876 // } 10877 10878} 10879 10880// method id "dataproc.projects.regions.jobs.cancel": 10881 10882type ProjectsRegionsJobsCancelCall struct { 10883 s *Service 10884 projectId string 10885 region string 10886 jobId string 10887 canceljobrequest *CancelJobRequest 10888 urlParams_ gensupport.URLParams 10889 ctx_ context.Context 10890 header_ http.Header 10891} 10892 10893// Cancel: Starts a job cancellation request. To access the job resource 10894// after cancellation, call regions/{region}/jobs.list 10895// (https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) 10896// or regions/{region}/jobs.get 10897// (https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get). 10898// 10899// - jobId: The job ID. 10900// - projectId: The ID of the Google Cloud Platform project that the job 10901// belongs to. 10902// - region: The Dataproc region in which to handle the request. 10903func (r *ProjectsRegionsJobsService) Cancel(projectId string, region string, jobId string, canceljobrequest *CancelJobRequest) *ProjectsRegionsJobsCancelCall { 10904 c := &ProjectsRegionsJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10905 c.projectId = projectId 10906 c.region = region 10907 c.jobId = jobId 10908 c.canceljobrequest = canceljobrequest 10909 return c 10910} 10911 10912// Fields allows partial responses to be retrieved. See 10913// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10914// for more information. 10915func (c *ProjectsRegionsJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsCancelCall { 10916 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10917 return c 10918} 10919 10920// Context sets the context to be used in this call's Do method. Any 10921// pending HTTP request will be aborted if the provided context is 10922// canceled. 10923func (c *ProjectsRegionsJobsCancelCall) Context(ctx context.Context) *ProjectsRegionsJobsCancelCall { 10924 c.ctx_ = ctx 10925 return c 10926} 10927 10928// Header returns an http.Header that can be modified by the caller to 10929// add HTTP headers to the request. 10930func (c *ProjectsRegionsJobsCancelCall) Header() http.Header { 10931 if c.header_ == nil { 10932 c.header_ = make(http.Header) 10933 } 10934 return c.header_ 10935} 10936 10937func (c *ProjectsRegionsJobsCancelCall) doRequest(alt string) (*http.Response, error) { 10938 reqHeaders := make(http.Header) 10939 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 10940 for k, v := range c.header_ { 10941 reqHeaders[k] = v 10942 } 10943 reqHeaders.Set("User-Agent", c.s.userAgent()) 10944 var body io.Reader = nil 10945 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceljobrequest) 10946 if err != nil { 10947 return nil, err 10948 } 10949 reqHeaders.Set("Content-Type", "application/json") 10950 c.urlParams_.Set("alt", alt) 10951 c.urlParams_.Set("prettyPrint", "false") 10952 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel") 10953 urls += "?" + c.urlParams_.Encode() 10954 req, err := http.NewRequest("POST", urls, body) 10955 if err != nil { 10956 return nil, err 10957 } 10958 req.Header = reqHeaders 10959 googleapi.Expand(req.URL, map[string]string{ 10960 "projectId": c.projectId, 10961 "region": c.region, 10962 "jobId": c.jobId, 10963 }) 10964 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10965} 10966 10967// Do executes the "dataproc.projects.regions.jobs.cancel" call. 10968// Exactly one of *Job or error will be non-nil. Any non-2xx status code 10969// is an error. Response headers are in either 10970// *Job.ServerResponse.Header or (if a response was returned at all) in 10971// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10972// whether the returned error was because http.StatusNotModified was 10973// returned. 10974func (c *ProjectsRegionsJobsCancelCall) Do(opts ...googleapi.CallOption) (*Job, error) { 10975 gensupport.SetOptions(c.urlParams_, opts...) 10976 res, err := c.doRequest("json") 10977 if res != nil && res.StatusCode == http.StatusNotModified { 10978 if res.Body != nil { 10979 res.Body.Close() 10980 } 10981 return nil, &googleapi.Error{ 10982 Code: res.StatusCode, 10983 Header: res.Header, 10984 } 10985 } 10986 if err != nil { 10987 return nil, err 10988 } 10989 defer googleapi.CloseBody(res) 10990 if err := googleapi.CheckResponse(res); err != nil { 10991 return nil, err 10992 } 10993 ret := &Job{ 10994 ServerResponse: googleapi.ServerResponse{ 10995 Header: res.Header, 10996 HTTPStatusCode: res.StatusCode, 10997 }, 10998 } 10999 target := &ret 11000 if err := gensupport.DecodeResponse(target, res); err != nil { 11001 return nil, err 11002 } 11003 return ret, nil 11004 // { 11005 // "description": "Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list (https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list) or regions/{region}/jobs.get (https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).", 11006 // "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", 11007 // "httpMethod": "POST", 11008 // "id": "dataproc.projects.regions.jobs.cancel", 11009 // "parameterOrder": [ 11010 // "projectId", 11011 // "region", 11012 // "jobId" 11013 // ], 11014 // "parameters": { 11015 // "jobId": { 11016 // "description": "Required. The job ID.", 11017 // "location": "path", 11018 // "required": true, 11019 // "type": "string" 11020 // }, 11021 // "projectId": { 11022 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 11023 // "location": "path", 11024 // "required": true, 11025 // "type": "string" 11026 // }, 11027 // "region": { 11028 // "description": "Required. The Dataproc region in which to handle the request.", 11029 // "location": "path", 11030 // "required": true, 11031 // "type": "string" 11032 // } 11033 // }, 11034 // "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", 11035 // "request": { 11036 // "$ref": "CancelJobRequest" 11037 // }, 11038 // "response": { 11039 // "$ref": "Job" 11040 // }, 11041 // "scopes": [ 11042 // "https://www.googleapis.com/auth/cloud-platform" 11043 // ] 11044 // } 11045 11046} 11047 11048// method id "dataproc.projects.regions.jobs.delete": 11049 11050type ProjectsRegionsJobsDeleteCall struct { 11051 s *Service 11052 projectId string 11053 region string 11054 jobId string 11055 urlParams_ gensupport.URLParams 11056 ctx_ context.Context 11057 header_ http.Header 11058} 11059 11060// Delete: Deletes the job from the project. If the job is active, the 11061// delete fails, and the response returns FAILED_PRECONDITION. 11062// 11063// - jobId: The job ID. 11064// - projectId: The ID of the Google Cloud Platform project that the job 11065// belongs to. 11066// - region: The Dataproc region in which to handle the request. 11067func (r *ProjectsRegionsJobsService) Delete(projectId string, region string, jobId string) *ProjectsRegionsJobsDeleteCall { 11068 c := &ProjectsRegionsJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11069 c.projectId = projectId 11070 c.region = region 11071 c.jobId = jobId 11072 return c 11073} 11074 11075// Fields allows partial responses to be retrieved. See 11076// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11077// for more information. 11078func (c *ProjectsRegionsJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsDeleteCall { 11079 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11080 return c 11081} 11082 11083// Context sets the context to be used in this call's Do method. Any 11084// pending HTTP request will be aborted if the provided context is 11085// canceled. 11086func (c *ProjectsRegionsJobsDeleteCall) Context(ctx context.Context) *ProjectsRegionsJobsDeleteCall { 11087 c.ctx_ = ctx 11088 return c 11089} 11090 11091// Header returns an http.Header that can be modified by the caller to 11092// add HTTP headers to the request. 11093func (c *ProjectsRegionsJobsDeleteCall) Header() http.Header { 11094 if c.header_ == nil { 11095 c.header_ = make(http.Header) 11096 } 11097 return c.header_ 11098} 11099 11100func (c *ProjectsRegionsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { 11101 reqHeaders := make(http.Header) 11102 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 11103 for k, v := range c.header_ { 11104 reqHeaders[k] = v 11105 } 11106 reqHeaders.Set("User-Agent", c.s.userAgent()) 11107 var body io.Reader = nil 11108 c.urlParams_.Set("alt", alt) 11109 c.urlParams_.Set("prettyPrint", "false") 11110 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs/{jobId}") 11111 urls += "?" + c.urlParams_.Encode() 11112 req, err := http.NewRequest("DELETE", urls, body) 11113 if err != nil { 11114 return nil, err 11115 } 11116 req.Header = reqHeaders 11117 googleapi.Expand(req.URL, map[string]string{ 11118 "projectId": c.projectId, 11119 "region": c.region, 11120 "jobId": c.jobId, 11121 }) 11122 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11123} 11124 11125// Do executes the "dataproc.projects.regions.jobs.delete" call. 11126// Exactly one of *Empty or error will be non-nil. Any non-2xx status 11127// code is an error. Response headers are in either 11128// *Empty.ServerResponse.Header or (if a response was returned at all) 11129// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11130// check whether the returned error was because http.StatusNotModified 11131// was returned. 11132func (c *ProjectsRegionsJobsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 11133 gensupport.SetOptions(c.urlParams_, opts...) 11134 res, err := c.doRequest("json") 11135 if res != nil && res.StatusCode == http.StatusNotModified { 11136 if res.Body != nil { 11137 res.Body.Close() 11138 } 11139 return nil, &googleapi.Error{ 11140 Code: res.StatusCode, 11141 Header: res.Header, 11142 } 11143 } 11144 if err != nil { 11145 return nil, err 11146 } 11147 defer googleapi.CloseBody(res) 11148 if err := googleapi.CheckResponse(res); err != nil { 11149 return nil, err 11150 } 11151 ret := &Empty{ 11152 ServerResponse: googleapi.ServerResponse{ 11153 Header: res.Header, 11154 HTTPStatusCode: res.StatusCode, 11155 }, 11156 } 11157 target := &ret 11158 if err := gensupport.DecodeResponse(target, res); err != nil { 11159 return nil, err 11160 } 11161 return ret, nil 11162 // { 11163 // "description": "Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.", 11164 // "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", 11165 // "httpMethod": "DELETE", 11166 // "id": "dataproc.projects.regions.jobs.delete", 11167 // "parameterOrder": [ 11168 // "projectId", 11169 // "region", 11170 // "jobId" 11171 // ], 11172 // "parameters": { 11173 // "jobId": { 11174 // "description": "Required. The job ID.", 11175 // "location": "path", 11176 // "required": true, 11177 // "type": "string" 11178 // }, 11179 // "projectId": { 11180 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 11181 // "location": "path", 11182 // "required": true, 11183 // "type": "string" 11184 // }, 11185 // "region": { 11186 // "description": "Required. The Dataproc region in which to handle the request.", 11187 // "location": "path", 11188 // "required": true, 11189 // "type": "string" 11190 // } 11191 // }, 11192 // "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", 11193 // "response": { 11194 // "$ref": "Empty" 11195 // }, 11196 // "scopes": [ 11197 // "https://www.googleapis.com/auth/cloud-platform" 11198 // ] 11199 // } 11200 11201} 11202 11203// method id "dataproc.projects.regions.jobs.get": 11204 11205type ProjectsRegionsJobsGetCall struct { 11206 s *Service 11207 projectId string 11208 region string 11209 jobId string 11210 urlParams_ gensupport.URLParams 11211 ifNoneMatch_ string 11212 ctx_ context.Context 11213 header_ http.Header 11214} 11215 11216// Get: Gets the resource representation for a job in a project. 11217// 11218// - jobId: The job ID. 11219// - projectId: The ID of the Google Cloud Platform project that the job 11220// belongs to. 11221// - region: The Dataproc region in which to handle the request. 11222func (r *ProjectsRegionsJobsService) Get(projectId string, region string, jobId string) *ProjectsRegionsJobsGetCall { 11223 c := &ProjectsRegionsJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11224 c.projectId = projectId 11225 c.region = region 11226 c.jobId = jobId 11227 return c 11228} 11229 11230// Fields allows partial responses to be retrieved. See 11231// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11232// for more information. 11233func (c *ProjectsRegionsJobsGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsGetCall { 11234 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11235 return c 11236} 11237 11238// IfNoneMatch sets the optional parameter which makes the operation 11239// fail if the object's ETag matches the given value. This is useful for 11240// getting updates only after the object has changed since the last 11241// request. Use googleapi.IsNotModified to check whether the response 11242// error from Do is the result of In-None-Match. 11243func (c *ProjectsRegionsJobsGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsGetCall { 11244 c.ifNoneMatch_ = entityTag 11245 return c 11246} 11247 11248// Context sets the context to be used in this call's Do method. Any 11249// pending HTTP request will be aborted if the provided context is 11250// canceled. 11251func (c *ProjectsRegionsJobsGetCall) Context(ctx context.Context) *ProjectsRegionsJobsGetCall { 11252 c.ctx_ = ctx 11253 return c 11254} 11255 11256// Header returns an http.Header that can be modified by the caller to 11257// add HTTP headers to the request. 11258func (c *ProjectsRegionsJobsGetCall) Header() http.Header { 11259 if c.header_ == nil { 11260 c.header_ = make(http.Header) 11261 } 11262 return c.header_ 11263} 11264 11265func (c *ProjectsRegionsJobsGetCall) doRequest(alt string) (*http.Response, error) { 11266 reqHeaders := make(http.Header) 11267 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 11268 for k, v := range c.header_ { 11269 reqHeaders[k] = v 11270 } 11271 reqHeaders.Set("User-Agent", c.s.userAgent()) 11272 if c.ifNoneMatch_ != "" { 11273 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11274 } 11275 var body io.Reader = nil 11276 c.urlParams_.Set("alt", alt) 11277 c.urlParams_.Set("prettyPrint", "false") 11278 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs/{jobId}") 11279 urls += "?" + c.urlParams_.Encode() 11280 req, err := http.NewRequest("GET", urls, body) 11281 if err != nil { 11282 return nil, err 11283 } 11284 req.Header = reqHeaders 11285 googleapi.Expand(req.URL, map[string]string{ 11286 "projectId": c.projectId, 11287 "region": c.region, 11288 "jobId": c.jobId, 11289 }) 11290 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11291} 11292 11293// Do executes the "dataproc.projects.regions.jobs.get" call. 11294// Exactly one of *Job or error will be non-nil. Any non-2xx status code 11295// is an error. Response headers are in either 11296// *Job.ServerResponse.Header or (if a response was returned at all) in 11297// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11298// whether the returned error was because http.StatusNotModified was 11299// returned. 11300func (c *ProjectsRegionsJobsGetCall) Do(opts ...googleapi.CallOption) (*Job, error) { 11301 gensupport.SetOptions(c.urlParams_, opts...) 11302 res, err := c.doRequest("json") 11303 if res != nil && res.StatusCode == http.StatusNotModified { 11304 if res.Body != nil { 11305 res.Body.Close() 11306 } 11307 return nil, &googleapi.Error{ 11308 Code: res.StatusCode, 11309 Header: res.Header, 11310 } 11311 } 11312 if err != nil { 11313 return nil, err 11314 } 11315 defer googleapi.CloseBody(res) 11316 if err := googleapi.CheckResponse(res); err != nil { 11317 return nil, err 11318 } 11319 ret := &Job{ 11320 ServerResponse: googleapi.ServerResponse{ 11321 Header: res.Header, 11322 HTTPStatusCode: res.StatusCode, 11323 }, 11324 } 11325 target := &ret 11326 if err := gensupport.DecodeResponse(target, res); err != nil { 11327 return nil, err 11328 } 11329 return ret, nil 11330 // { 11331 // "description": "Gets the resource representation for a job in a project.", 11332 // "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", 11333 // "httpMethod": "GET", 11334 // "id": "dataproc.projects.regions.jobs.get", 11335 // "parameterOrder": [ 11336 // "projectId", 11337 // "region", 11338 // "jobId" 11339 // ], 11340 // "parameters": { 11341 // "jobId": { 11342 // "description": "Required. The job ID.", 11343 // "location": "path", 11344 // "required": true, 11345 // "type": "string" 11346 // }, 11347 // "projectId": { 11348 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 11349 // "location": "path", 11350 // "required": true, 11351 // "type": "string" 11352 // }, 11353 // "region": { 11354 // "description": "Required. The Dataproc region in which to handle the request.", 11355 // "location": "path", 11356 // "required": true, 11357 // "type": "string" 11358 // } 11359 // }, 11360 // "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", 11361 // "response": { 11362 // "$ref": "Job" 11363 // }, 11364 // "scopes": [ 11365 // "https://www.googleapis.com/auth/cloud-platform" 11366 // ] 11367 // } 11368 11369} 11370 11371// method id "dataproc.projects.regions.jobs.getIamPolicy": 11372 11373type ProjectsRegionsJobsGetIamPolicyCall struct { 11374 s *Service 11375 resource string 11376 getiampolicyrequest *GetIamPolicyRequest 11377 urlParams_ gensupport.URLParams 11378 ctx_ context.Context 11379 header_ http.Header 11380} 11381 11382// GetIamPolicy: Gets the access control policy for a resource. Returns 11383// an empty policy if the resource exists and does not have a policy 11384// set. 11385// 11386// - resource: REQUIRED: The resource for which the policy is being 11387// requested. See the operation documentation for the appropriate 11388// value for this field. 11389func (r *ProjectsRegionsJobsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsRegionsJobsGetIamPolicyCall { 11390 c := &ProjectsRegionsJobsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11391 c.resource = resource 11392 c.getiampolicyrequest = getiampolicyrequest 11393 return c 11394} 11395 11396// Fields allows partial responses to be retrieved. See 11397// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11398// for more information. 11399func (c *ProjectsRegionsJobsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsGetIamPolicyCall { 11400 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11401 return c 11402} 11403 11404// Context sets the context to be used in this call's Do method. Any 11405// pending HTTP request will be aborted if the provided context is 11406// canceled. 11407func (c *ProjectsRegionsJobsGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsJobsGetIamPolicyCall { 11408 c.ctx_ = ctx 11409 return c 11410} 11411 11412// Header returns an http.Header that can be modified by the caller to 11413// add HTTP headers to the request. 11414func (c *ProjectsRegionsJobsGetIamPolicyCall) Header() http.Header { 11415 if c.header_ == nil { 11416 c.header_ = make(http.Header) 11417 } 11418 return c.header_ 11419} 11420 11421func (c *ProjectsRegionsJobsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 11422 reqHeaders := make(http.Header) 11423 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 11424 for k, v := range c.header_ { 11425 reqHeaders[k] = v 11426 } 11427 reqHeaders.Set("User-Agent", c.s.userAgent()) 11428 var body io.Reader = nil 11429 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 11430 if err != nil { 11431 return nil, err 11432 } 11433 reqHeaders.Set("Content-Type", "application/json") 11434 c.urlParams_.Set("alt", alt) 11435 c.urlParams_.Set("prettyPrint", "false") 11436 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") 11437 urls += "?" + c.urlParams_.Encode() 11438 req, err := http.NewRequest("POST", urls, body) 11439 if err != nil { 11440 return nil, err 11441 } 11442 req.Header = reqHeaders 11443 googleapi.Expand(req.URL, map[string]string{ 11444 "resource": c.resource, 11445 }) 11446 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11447} 11448 11449// Do executes the "dataproc.projects.regions.jobs.getIamPolicy" call. 11450// Exactly one of *Policy or error will be non-nil. Any non-2xx status 11451// code is an error. Response headers are in either 11452// *Policy.ServerResponse.Header or (if a response was returned at all) 11453// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11454// check whether the returned error was because http.StatusNotModified 11455// was returned. 11456func (c *ProjectsRegionsJobsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 11457 gensupport.SetOptions(c.urlParams_, opts...) 11458 res, err := c.doRequest("json") 11459 if res != nil && res.StatusCode == http.StatusNotModified { 11460 if res.Body != nil { 11461 res.Body.Close() 11462 } 11463 return nil, &googleapi.Error{ 11464 Code: res.StatusCode, 11465 Header: res.Header, 11466 } 11467 } 11468 if err != nil { 11469 return nil, err 11470 } 11471 defer googleapi.CloseBody(res) 11472 if err := googleapi.CheckResponse(res); err != nil { 11473 return nil, err 11474 } 11475 ret := &Policy{ 11476 ServerResponse: googleapi.ServerResponse{ 11477 Header: res.Header, 11478 HTTPStatusCode: res.StatusCode, 11479 }, 11480 } 11481 target := &ret 11482 if err := gensupport.DecodeResponse(target, res); err != nil { 11483 return nil, err 11484 } 11485 return ret, nil 11486 // { 11487 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 11488 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:getIamPolicy", 11489 // "httpMethod": "POST", 11490 // "id": "dataproc.projects.regions.jobs.getIamPolicy", 11491 // "parameterOrder": [ 11492 // "resource" 11493 // ], 11494 // "parameters": { 11495 // "resource": { 11496 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 11497 // "location": "path", 11498 // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$", 11499 // "required": true, 11500 // "type": "string" 11501 // } 11502 // }, 11503 // "path": "v1/{+resource}:getIamPolicy", 11504 // "request": { 11505 // "$ref": "GetIamPolicyRequest" 11506 // }, 11507 // "response": { 11508 // "$ref": "Policy" 11509 // }, 11510 // "scopes": [ 11511 // "https://www.googleapis.com/auth/cloud-platform" 11512 // ] 11513 // } 11514 11515} 11516 11517// method id "dataproc.projects.regions.jobs.list": 11518 11519type ProjectsRegionsJobsListCall struct { 11520 s *Service 11521 projectId string 11522 region string 11523 urlParams_ gensupport.URLParams 11524 ifNoneMatch_ string 11525 ctx_ context.Context 11526 header_ http.Header 11527} 11528 11529// List: Lists regions/{region}/jobs in a project. 11530// 11531// - projectId: The ID of the Google Cloud Platform project that the job 11532// belongs to. 11533// - region: The Dataproc region in which to handle the request. 11534func (r *ProjectsRegionsJobsService) List(projectId string, region string) *ProjectsRegionsJobsListCall { 11535 c := &ProjectsRegionsJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11536 c.projectId = projectId 11537 c.region = region 11538 return c 11539} 11540 11541// ClusterName sets the optional parameter "clusterName": If set, the 11542// returned jobs list includes only jobs that were submitted to the 11543// named cluster. 11544func (c *ProjectsRegionsJobsListCall) ClusterName(clusterName string) *ProjectsRegionsJobsListCall { 11545 c.urlParams_.Set("clusterName", clusterName) 11546 return c 11547} 11548 11549// Filter sets the optional parameter "filter": A filter constraining 11550// the jobs to list. Filters are case-sensitive and have the following 11551// syntax:field = value AND field = value ...where field is status.state 11552// or labels.[KEY], and [KEY] is a label key. value can be * to match 11553// all values. status.state can be either ACTIVE or NON_ACTIVE. Only the 11554// logical AND operator is supported; space-separated items are treated 11555// as having an implicit AND operator.Example filter:status.state = 11556// ACTIVE AND labels.env = staging AND labels.starred = * 11557func (c *ProjectsRegionsJobsListCall) Filter(filter string) *ProjectsRegionsJobsListCall { 11558 c.urlParams_.Set("filter", filter) 11559 return c 11560} 11561 11562// JobStateMatcher sets the optional parameter "jobStateMatcher": 11563// Specifies enumerated categories of jobs to list. (default = match ALL 11564// jobs).If filter is provided, jobStateMatcher will be ignored. 11565// 11566// Possible values: 11567// "ALL" - Match all jobs, regardless of state. 11568// "ACTIVE" - Only match jobs in non-terminal states: PENDING, 11569// RUNNING, or CANCEL_PENDING. 11570// "NON_ACTIVE" - Only match jobs in terminal states: CANCELLED, DONE, 11571// or ERROR. 11572func (c *ProjectsRegionsJobsListCall) JobStateMatcher(jobStateMatcher string) *ProjectsRegionsJobsListCall { 11573 c.urlParams_.Set("jobStateMatcher", jobStateMatcher) 11574 return c 11575} 11576 11577// PageSize sets the optional parameter "pageSize": The number of 11578// results to return in each response. 11579func (c *ProjectsRegionsJobsListCall) PageSize(pageSize int64) *ProjectsRegionsJobsListCall { 11580 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 11581 return c 11582} 11583 11584// PageToken sets the optional parameter "pageToken": The page token, 11585// returned by a previous call, to request the next page of results. 11586func (c *ProjectsRegionsJobsListCall) PageToken(pageToken string) *ProjectsRegionsJobsListCall { 11587 c.urlParams_.Set("pageToken", pageToken) 11588 return c 11589} 11590 11591// Fields allows partial responses to be retrieved. See 11592// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11593// for more information. 11594func (c *ProjectsRegionsJobsListCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsListCall { 11595 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11596 return c 11597} 11598 11599// IfNoneMatch sets the optional parameter which makes the operation 11600// fail if the object's ETag matches the given value. This is useful for 11601// getting updates only after the object has changed since the last 11602// request. Use googleapi.IsNotModified to check whether the response 11603// error from Do is the result of In-None-Match. 11604func (c *ProjectsRegionsJobsListCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsListCall { 11605 c.ifNoneMatch_ = entityTag 11606 return c 11607} 11608 11609// Context sets the context to be used in this call's Do method. Any 11610// pending HTTP request will be aborted if the provided context is 11611// canceled. 11612func (c *ProjectsRegionsJobsListCall) Context(ctx context.Context) *ProjectsRegionsJobsListCall { 11613 c.ctx_ = ctx 11614 return c 11615} 11616 11617// Header returns an http.Header that can be modified by the caller to 11618// add HTTP headers to the request. 11619func (c *ProjectsRegionsJobsListCall) Header() http.Header { 11620 if c.header_ == nil { 11621 c.header_ = make(http.Header) 11622 } 11623 return c.header_ 11624} 11625 11626func (c *ProjectsRegionsJobsListCall) doRequest(alt string) (*http.Response, error) { 11627 reqHeaders := make(http.Header) 11628 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 11629 for k, v := range c.header_ { 11630 reqHeaders[k] = v 11631 } 11632 reqHeaders.Set("User-Agent", c.s.userAgent()) 11633 if c.ifNoneMatch_ != "" { 11634 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11635 } 11636 var body io.Reader = nil 11637 c.urlParams_.Set("alt", alt) 11638 c.urlParams_.Set("prettyPrint", "false") 11639 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs") 11640 urls += "?" + c.urlParams_.Encode() 11641 req, err := http.NewRequest("GET", urls, body) 11642 if err != nil { 11643 return nil, err 11644 } 11645 req.Header = reqHeaders 11646 googleapi.Expand(req.URL, map[string]string{ 11647 "projectId": c.projectId, 11648 "region": c.region, 11649 }) 11650 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11651} 11652 11653// Do executes the "dataproc.projects.regions.jobs.list" call. 11654// Exactly one of *ListJobsResponse or error will be non-nil. Any 11655// non-2xx status code is an error. Response headers are in either 11656// *ListJobsResponse.ServerResponse.Header or (if a response was 11657// returned at all) in error.(*googleapi.Error).Header. Use 11658// googleapi.IsNotModified to check whether the returned error was 11659// because http.StatusNotModified was returned. 11660func (c *ProjectsRegionsJobsListCall) Do(opts ...googleapi.CallOption) (*ListJobsResponse, error) { 11661 gensupport.SetOptions(c.urlParams_, opts...) 11662 res, err := c.doRequest("json") 11663 if res != nil && res.StatusCode == http.StatusNotModified { 11664 if res.Body != nil { 11665 res.Body.Close() 11666 } 11667 return nil, &googleapi.Error{ 11668 Code: res.StatusCode, 11669 Header: res.Header, 11670 } 11671 } 11672 if err != nil { 11673 return nil, err 11674 } 11675 defer googleapi.CloseBody(res) 11676 if err := googleapi.CheckResponse(res); err != nil { 11677 return nil, err 11678 } 11679 ret := &ListJobsResponse{ 11680 ServerResponse: googleapi.ServerResponse{ 11681 Header: res.Header, 11682 HTTPStatusCode: res.StatusCode, 11683 }, 11684 } 11685 target := &ret 11686 if err := gensupport.DecodeResponse(target, res); err != nil { 11687 return nil, err 11688 } 11689 return ret, nil 11690 // { 11691 // "description": "Lists regions/{region}/jobs in a project.", 11692 // "flatPath": "v1/projects/{projectId}/regions/{region}/jobs", 11693 // "httpMethod": "GET", 11694 // "id": "dataproc.projects.regions.jobs.list", 11695 // "parameterOrder": [ 11696 // "projectId", 11697 // "region" 11698 // ], 11699 // "parameters": { 11700 // "clusterName": { 11701 // "description": "Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster.", 11702 // "location": "query", 11703 // "type": "string" 11704 // }, 11705 // "filter": { 11706 // "description": "Optional. A filter constraining the jobs to list. Filters are case-sensitive and have the following syntax:field = value AND field = value ...where field is status.state or labels.[KEY], and [KEY] is a label key. value can be * to match all values. status.state can be either ACTIVE or NON_ACTIVE. Only the logical AND operator is supported; space-separated items are treated as having an implicit AND operator.Example filter:status.state = ACTIVE AND labels.env = staging AND labels.starred = *", 11707 // "location": "query", 11708 // "type": "string" 11709 // }, 11710 // "jobStateMatcher": { 11711 // "description": "Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored.", 11712 // "enum": [ 11713 // "ALL", 11714 // "ACTIVE", 11715 // "NON_ACTIVE" 11716 // ], 11717 // "enumDescriptions": [ 11718 // "Match all jobs, regardless of state.", 11719 // "Only match jobs in non-terminal states: PENDING, RUNNING, or CANCEL_PENDING.", 11720 // "Only match jobs in terminal states: CANCELLED, DONE, or ERROR." 11721 // ], 11722 // "location": "query", 11723 // "type": "string" 11724 // }, 11725 // "pageSize": { 11726 // "description": "Optional. The number of results to return in each response.", 11727 // "format": "int32", 11728 // "location": "query", 11729 // "type": "integer" 11730 // }, 11731 // "pageToken": { 11732 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 11733 // "location": "query", 11734 // "type": "string" 11735 // }, 11736 // "projectId": { 11737 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 11738 // "location": "path", 11739 // "required": true, 11740 // "type": "string" 11741 // }, 11742 // "region": { 11743 // "description": "Required. The Dataproc region in which to handle the request.", 11744 // "location": "path", 11745 // "required": true, 11746 // "type": "string" 11747 // } 11748 // }, 11749 // "path": "v1/projects/{projectId}/regions/{region}/jobs", 11750 // "response": { 11751 // "$ref": "ListJobsResponse" 11752 // }, 11753 // "scopes": [ 11754 // "https://www.googleapis.com/auth/cloud-platform" 11755 // ] 11756 // } 11757 11758} 11759 11760// Pages invokes f for each page of results. 11761// A non-nil error returned from f will halt the iteration. 11762// The provided context supersedes any context provided to the Context method. 11763func (c *ProjectsRegionsJobsListCall) Pages(ctx context.Context, f func(*ListJobsResponse) error) error { 11764 c.ctx_ = ctx 11765 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 11766 for { 11767 x, err := c.Do() 11768 if err != nil { 11769 return err 11770 } 11771 if err := f(x); err != nil { 11772 return err 11773 } 11774 if x.NextPageToken == "" { 11775 return nil 11776 } 11777 c.PageToken(x.NextPageToken) 11778 } 11779} 11780 11781// method id "dataproc.projects.regions.jobs.patch": 11782 11783type ProjectsRegionsJobsPatchCall struct { 11784 s *Service 11785 projectId string 11786 region string 11787 jobId string 11788 job *Job 11789 urlParams_ gensupport.URLParams 11790 ctx_ context.Context 11791 header_ http.Header 11792} 11793 11794// Patch: Updates a job in a project. 11795// 11796// - jobId: The job ID. 11797// - projectId: The ID of the Google Cloud Platform project that the job 11798// belongs to. 11799// - region: The Dataproc region in which to handle the request. 11800func (r *ProjectsRegionsJobsService) Patch(projectId string, region string, jobId string, job *Job) *ProjectsRegionsJobsPatchCall { 11801 c := &ProjectsRegionsJobsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11802 c.projectId = projectId 11803 c.region = region 11804 c.jobId = jobId 11805 c.job = job 11806 return c 11807} 11808 11809// UpdateMask sets the optional parameter "updateMask": Required. 11810// Specifies the path, relative to Job, of the field to update. For 11811// example, to update the labels of a Job the update_mask parameter 11812// would be specified as labels, and the PATCH request body would 11813// specify the new value. *Note:* Currently, labels is the only field 11814// that can be updated. 11815func (c *ProjectsRegionsJobsPatchCall) UpdateMask(updateMask string) *ProjectsRegionsJobsPatchCall { 11816 c.urlParams_.Set("updateMask", updateMask) 11817 return c 11818} 11819 11820// Fields allows partial responses to be retrieved. See 11821// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11822// for more information. 11823func (c *ProjectsRegionsJobsPatchCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsPatchCall { 11824 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11825 return c 11826} 11827 11828// Context sets the context to be used in this call's Do method. Any 11829// pending HTTP request will be aborted if the provided context is 11830// canceled. 11831func (c *ProjectsRegionsJobsPatchCall) Context(ctx context.Context) *ProjectsRegionsJobsPatchCall { 11832 c.ctx_ = ctx 11833 return c 11834} 11835 11836// Header returns an http.Header that can be modified by the caller to 11837// add HTTP headers to the request. 11838func (c *ProjectsRegionsJobsPatchCall) Header() http.Header { 11839 if c.header_ == nil { 11840 c.header_ = make(http.Header) 11841 } 11842 return c.header_ 11843} 11844 11845func (c *ProjectsRegionsJobsPatchCall) doRequest(alt string) (*http.Response, error) { 11846 reqHeaders := make(http.Header) 11847 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 11848 for k, v := range c.header_ { 11849 reqHeaders[k] = v 11850 } 11851 reqHeaders.Set("User-Agent", c.s.userAgent()) 11852 var body io.Reader = nil 11853 body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) 11854 if err != nil { 11855 return nil, err 11856 } 11857 reqHeaders.Set("Content-Type", "application/json") 11858 c.urlParams_.Set("alt", alt) 11859 c.urlParams_.Set("prettyPrint", "false") 11860 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs/{jobId}") 11861 urls += "?" + c.urlParams_.Encode() 11862 req, err := http.NewRequest("PATCH", urls, body) 11863 if err != nil { 11864 return nil, err 11865 } 11866 req.Header = reqHeaders 11867 googleapi.Expand(req.URL, map[string]string{ 11868 "projectId": c.projectId, 11869 "region": c.region, 11870 "jobId": c.jobId, 11871 }) 11872 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11873} 11874 11875// Do executes the "dataproc.projects.regions.jobs.patch" call. 11876// Exactly one of *Job or error will be non-nil. Any non-2xx status code 11877// is an error. Response headers are in either 11878// *Job.ServerResponse.Header or (if a response was returned at all) in 11879// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11880// whether the returned error was because http.StatusNotModified was 11881// returned. 11882func (c *ProjectsRegionsJobsPatchCall) Do(opts ...googleapi.CallOption) (*Job, error) { 11883 gensupport.SetOptions(c.urlParams_, opts...) 11884 res, err := c.doRequest("json") 11885 if res != nil && res.StatusCode == http.StatusNotModified { 11886 if res.Body != nil { 11887 res.Body.Close() 11888 } 11889 return nil, &googleapi.Error{ 11890 Code: res.StatusCode, 11891 Header: res.Header, 11892 } 11893 } 11894 if err != nil { 11895 return nil, err 11896 } 11897 defer googleapi.CloseBody(res) 11898 if err := googleapi.CheckResponse(res); err != nil { 11899 return nil, err 11900 } 11901 ret := &Job{ 11902 ServerResponse: googleapi.ServerResponse{ 11903 Header: res.Header, 11904 HTTPStatusCode: res.StatusCode, 11905 }, 11906 } 11907 target := &ret 11908 if err := gensupport.DecodeResponse(target, res); err != nil { 11909 return nil, err 11910 } 11911 return ret, nil 11912 // { 11913 // "description": "Updates a job in a project.", 11914 // "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", 11915 // "httpMethod": "PATCH", 11916 // "id": "dataproc.projects.regions.jobs.patch", 11917 // "parameterOrder": [ 11918 // "projectId", 11919 // "region", 11920 // "jobId" 11921 // ], 11922 // "parameters": { 11923 // "jobId": { 11924 // "description": "Required. The job ID.", 11925 // "location": "path", 11926 // "required": true, 11927 // "type": "string" 11928 // }, 11929 // "projectId": { 11930 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 11931 // "location": "path", 11932 // "required": true, 11933 // "type": "string" 11934 // }, 11935 // "region": { 11936 // "description": "Required. The Dataproc region in which to handle the request.", 11937 // "location": "path", 11938 // "required": true, 11939 // "type": "string" 11940 // }, 11941 // "updateMask": { 11942 // "description": "Required. Specifies the path, relative to Job, of the field to update. For example, to update the labels of a Job the update_mask parameter would be specified as labels, and the PATCH request body would specify the new value. *Note:* Currently, labels is the only field that can be updated.", 11943 // "format": "google-fieldmask", 11944 // "location": "query", 11945 // "type": "string" 11946 // } 11947 // }, 11948 // "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}", 11949 // "request": { 11950 // "$ref": "Job" 11951 // }, 11952 // "response": { 11953 // "$ref": "Job" 11954 // }, 11955 // "scopes": [ 11956 // "https://www.googleapis.com/auth/cloud-platform" 11957 // ] 11958 // } 11959 11960} 11961 11962// method id "dataproc.projects.regions.jobs.setIamPolicy": 11963 11964type ProjectsRegionsJobsSetIamPolicyCall struct { 11965 s *Service 11966 resource string 11967 setiampolicyrequest *SetIamPolicyRequest 11968 urlParams_ gensupport.URLParams 11969 ctx_ context.Context 11970 header_ http.Header 11971} 11972 11973// SetIamPolicy: Sets the access control policy on the specified 11974// resource. Replaces any existing policy.Can return NOT_FOUND, 11975// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 11976// 11977// - resource: REQUIRED: The resource for which the policy is being 11978// specified. See the operation documentation for the appropriate 11979// value for this field. 11980func (r *ProjectsRegionsJobsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsJobsSetIamPolicyCall { 11981 c := &ProjectsRegionsJobsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11982 c.resource = resource 11983 c.setiampolicyrequest = setiampolicyrequest 11984 return c 11985} 11986 11987// Fields allows partial responses to be retrieved. See 11988// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11989// for more information. 11990func (c *ProjectsRegionsJobsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSetIamPolicyCall { 11991 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11992 return c 11993} 11994 11995// Context sets the context to be used in this call's Do method. Any 11996// pending HTTP request will be aborted if the provided context is 11997// canceled. 11998func (c *ProjectsRegionsJobsSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsJobsSetIamPolicyCall { 11999 c.ctx_ = ctx 12000 return c 12001} 12002 12003// Header returns an http.Header that can be modified by the caller to 12004// add HTTP headers to the request. 12005func (c *ProjectsRegionsJobsSetIamPolicyCall) Header() http.Header { 12006 if c.header_ == nil { 12007 c.header_ = make(http.Header) 12008 } 12009 return c.header_ 12010} 12011 12012func (c *ProjectsRegionsJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 12013 reqHeaders := make(http.Header) 12014 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 12015 for k, v := range c.header_ { 12016 reqHeaders[k] = v 12017 } 12018 reqHeaders.Set("User-Agent", c.s.userAgent()) 12019 var body io.Reader = nil 12020 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 12021 if err != nil { 12022 return nil, err 12023 } 12024 reqHeaders.Set("Content-Type", "application/json") 12025 c.urlParams_.Set("alt", alt) 12026 c.urlParams_.Set("prettyPrint", "false") 12027 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") 12028 urls += "?" + c.urlParams_.Encode() 12029 req, err := http.NewRequest("POST", urls, body) 12030 if err != nil { 12031 return nil, err 12032 } 12033 req.Header = reqHeaders 12034 googleapi.Expand(req.URL, map[string]string{ 12035 "resource": c.resource, 12036 }) 12037 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12038} 12039 12040// Do executes the "dataproc.projects.regions.jobs.setIamPolicy" call. 12041// Exactly one of *Policy or error will be non-nil. Any non-2xx status 12042// code is an error. Response headers are in either 12043// *Policy.ServerResponse.Header or (if a response was returned at all) 12044// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12045// check whether the returned error was because http.StatusNotModified 12046// was returned. 12047func (c *ProjectsRegionsJobsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 12048 gensupport.SetOptions(c.urlParams_, opts...) 12049 res, err := c.doRequest("json") 12050 if res != nil && res.StatusCode == http.StatusNotModified { 12051 if res.Body != nil { 12052 res.Body.Close() 12053 } 12054 return nil, &googleapi.Error{ 12055 Code: res.StatusCode, 12056 Header: res.Header, 12057 } 12058 } 12059 if err != nil { 12060 return nil, err 12061 } 12062 defer googleapi.CloseBody(res) 12063 if err := googleapi.CheckResponse(res); err != nil { 12064 return nil, err 12065 } 12066 ret := &Policy{ 12067 ServerResponse: googleapi.ServerResponse{ 12068 Header: res.Header, 12069 HTTPStatusCode: res.StatusCode, 12070 }, 12071 } 12072 target := &ret 12073 if err := gensupport.DecodeResponse(target, res); err != nil { 12074 return nil, err 12075 } 12076 return ret, nil 12077 // { 12078 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 12079 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:setIamPolicy", 12080 // "httpMethod": "POST", 12081 // "id": "dataproc.projects.regions.jobs.setIamPolicy", 12082 // "parameterOrder": [ 12083 // "resource" 12084 // ], 12085 // "parameters": { 12086 // "resource": { 12087 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 12088 // "location": "path", 12089 // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$", 12090 // "required": true, 12091 // "type": "string" 12092 // } 12093 // }, 12094 // "path": "v1/{+resource}:setIamPolicy", 12095 // "request": { 12096 // "$ref": "SetIamPolicyRequest" 12097 // }, 12098 // "response": { 12099 // "$ref": "Policy" 12100 // }, 12101 // "scopes": [ 12102 // "https://www.googleapis.com/auth/cloud-platform" 12103 // ] 12104 // } 12105 12106} 12107 12108// method id "dataproc.projects.regions.jobs.submit": 12109 12110type ProjectsRegionsJobsSubmitCall struct { 12111 s *Service 12112 projectId string 12113 region string 12114 submitjobrequest *SubmitJobRequest 12115 urlParams_ gensupport.URLParams 12116 ctx_ context.Context 12117 header_ http.Header 12118} 12119 12120// Submit: Submits a job to a cluster. 12121// 12122// - projectId: The ID of the Google Cloud Platform project that the job 12123// belongs to. 12124// - region: The Dataproc region in which to handle the request. 12125func (r *ProjectsRegionsJobsService) Submit(projectId string, region string, submitjobrequest *SubmitJobRequest) *ProjectsRegionsJobsSubmitCall { 12126 c := &ProjectsRegionsJobsSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12127 c.projectId = projectId 12128 c.region = region 12129 c.submitjobrequest = submitjobrequest 12130 return c 12131} 12132 12133// Fields allows partial responses to be retrieved. See 12134// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12135// for more information. 12136func (c *ProjectsRegionsJobsSubmitCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSubmitCall { 12137 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12138 return c 12139} 12140 12141// Context sets the context to be used in this call's Do method. Any 12142// pending HTTP request will be aborted if the provided context is 12143// canceled. 12144func (c *ProjectsRegionsJobsSubmitCall) Context(ctx context.Context) *ProjectsRegionsJobsSubmitCall { 12145 c.ctx_ = ctx 12146 return c 12147} 12148 12149// Header returns an http.Header that can be modified by the caller to 12150// add HTTP headers to the request. 12151func (c *ProjectsRegionsJobsSubmitCall) Header() http.Header { 12152 if c.header_ == nil { 12153 c.header_ = make(http.Header) 12154 } 12155 return c.header_ 12156} 12157 12158func (c *ProjectsRegionsJobsSubmitCall) doRequest(alt string) (*http.Response, error) { 12159 reqHeaders := make(http.Header) 12160 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 12161 for k, v := range c.header_ { 12162 reqHeaders[k] = v 12163 } 12164 reqHeaders.Set("User-Agent", c.s.userAgent()) 12165 var body io.Reader = nil 12166 body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitjobrequest) 12167 if err != nil { 12168 return nil, err 12169 } 12170 reqHeaders.Set("Content-Type", "application/json") 12171 c.urlParams_.Set("alt", alt) 12172 c.urlParams_.Set("prettyPrint", "false") 12173 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs:submit") 12174 urls += "?" + c.urlParams_.Encode() 12175 req, err := http.NewRequest("POST", urls, body) 12176 if err != nil { 12177 return nil, err 12178 } 12179 req.Header = reqHeaders 12180 googleapi.Expand(req.URL, map[string]string{ 12181 "projectId": c.projectId, 12182 "region": c.region, 12183 }) 12184 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12185} 12186 12187// Do executes the "dataproc.projects.regions.jobs.submit" call. 12188// Exactly one of *Job or error will be non-nil. Any non-2xx status code 12189// is an error. Response headers are in either 12190// *Job.ServerResponse.Header or (if a response was returned at all) in 12191// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 12192// whether the returned error was because http.StatusNotModified was 12193// returned. 12194func (c *ProjectsRegionsJobsSubmitCall) Do(opts ...googleapi.CallOption) (*Job, error) { 12195 gensupport.SetOptions(c.urlParams_, opts...) 12196 res, err := c.doRequest("json") 12197 if res != nil && res.StatusCode == http.StatusNotModified { 12198 if res.Body != nil { 12199 res.Body.Close() 12200 } 12201 return nil, &googleapi.Error{ 12202 Code: res.StatusCode, 12203 Header: res.Header, 12204 } 12205 } 12206 if err != nil { 12207 return nil, err 12208 } 12209 defer googleapi.CloseBody(res) 12210 if err := googleapi.CheckResponse(res); err != nil { 12211 return nil, err 12212 } 12213 ret := &Job{ 12214 ServerResponse: googleapi.ServerResponse{ 12215 Header: res.Header, 12216 HTTPStatusCode: res.StatusCode, 12217 }, 12218 } 12219 target := &ret 12220 if err := gensupport.DecodeResponse(target, res); err != nil { 12221 return nil, err 12222 } 12223 return ret, nil 12224 // { 12225 // "description": "Submits a job to a cluster.", 12226 // "flatPath": "v1/projects/{projectId}/regions/{region}/jobs:submit", 12227 // "httpMethod": "POST", 12228 // "id": "dataproc.projects.regions.jobs.submit", 12229 // "parameterOrder": [ 12230 // "projectId", 12231 // "region" 12232 // ], 12233 // "parameters": { 12234 // "projectId": { 12235 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 12236 // "location": "path", 12237 // "required": true, 12238 // "type": "string" 12239 // }, 12240 // "region": { 12241 // "description": "Required. The Dataproc region in which to handle the request.", 12242 // "location": "path", 12243 // "required": true, 12244 // "type": "string" 12245 // } 12246 // }, 12247 // "path": "v1/projects/{projectId}/regions/{region}/jobs:submit", 12248 // "request": { 12249 // "$ref": "SubmitJobRequest" 12250 // }, 12251 // "response": { 12252 // "$ref": "Job" 12253 // }, 12254 // "scopes": [ 12255 // "https://www.googleapis.com/auth/cloud-platform" 12256 // ] 12257 // } 12258 12259} 12260 12261// method id "dataproc.projects.regions.jobs.submitAsOperation": 12262 12263type ProjectsRegionsJobsSubmitAsOperationCall struct { 12264 s *Service 12265 projectId string 12266 region string 12267 submitjobrequest *SubmitJobRequest 12268 urlParams_ gensupport.URLParams 12269 ctx_ context.Context 12270 header_ http.Header 12271} 12272 12273// SubmitAsOperation: Submits job to a cluster. 12274// 12275// - projectId: The ID of the Google Cloud Platform project that the job 12276// belongs to. 12277// - region: The Dataproc region in which to handle the request. 12278func (r *ProjectsRegionsJobsService) SubmitAsOperation(projectId string, region string, submitjobrequest *SubmitJobRequest) *ProjectsRegionsJobsSubmitAsOperationCall { 12279 c := &ProjectsRegionsJobsSubmitAsOperationCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12280 c.projectId = projectId 12281 c.region = region 12282 c.submitjobrequest = submitjobrequest 12283 return c 12284} 12285 12286// Fields allows partial responses to be retrieved. See 12287// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12288// for more information. 12289func (c *ProjectsRegionsJobsSubmitAsOperationCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSubmitAsOperationCall { 12290 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12291 return c 12292} 12293 12294// Context sets the context to be used in this call's Do method. Any 12295// pending HTTP request will be aborted if the provided context is 12296// canceled. 12297func (c *ProjectsRegionsJobsSubmitAsOperationCall) Context(ctx context.Context) *ProjectsRegionsJobsSubmitAsOperationCall { 12298 c.ctx_ = ctx 12299 return c 12300} 12301 12302// Header returns an http.Header that can be modified by the caller to 12303// add HTTP headers to the request. 12304func (c *ProjectsRegionsJobsSubmitAsOperationCall) Header() http.Header { 12305 if c.header_ == nil { 12306 c.header_ = make(http.Header) 12307 } 12308 return c.header_ 12309} 12310 12311func (c *ProjectsRegionsJobsSubmitAsOperationCall) doRequest(alt string) (*http.Response, error) { 12312 reqHeaders := make(http.Header) 12313 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 12314 for k, v := range c.header_ { 12315 reqHeaders[k] = v 12316 } 12317 reqHeaders.Set("User-Agent", c.s.userAgent()) 12318 var body io.Reader = nil 12319 body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitjobrequest) 12320 if err != nil { 12321 return nil, err 12322 } 12323 reqHeaders.Set("Content-Type", "application/json") 12324 c.urlParams_.Set("alt", alt) 12325 c.urlParams_.Set("prettyPrint", "false") 12326 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs:submitAsOperation") 12327 urls += "?" + c.urlParams_.Encode() 12328 req, err := http.NewRequest("POST", urls, body) 12329 if err != nil { 12330 return nil, err 12331 } 12332 req.Header = reqHeaders 12333 googleapi.Expand(req.URL, map[string]string{ 12334 "projectId": c.projectId, 12335 "region": c.region, 12336 }) 12337 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12338} 12339 12340// Do executes the "dataproc.projects.regions.jobs.submitAsOperation" call. 12341// Exactly one of *Operation or error will be non-nil. Any non-2xx 12342// status code is an error. Response headers are in either 12343// *Operation.ServerResponse.Header or (if a response was returned at 12344// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12345// to check whether the returned error was because 12346// http.StatusNotModified was returned. 12347func (c *ProjectsRegionsJobsSubmitAsOperationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 12348 gensupport.SetOptions(c.urlParams_, opts...) 12349 res, err := c.doRequest("json") 12350 if res != nil && res.StatusCode == http.StatusNotModified { 12351 if res.Body != nil { 12352 res.Body.Close() 12353 } 12354 return nil, &googleapi.Error{ 12355 Code: res.StatusCode, 12356 Header: res.Header, 12357 } 12358 } 12359 if err != nil { 12360 return nil, err 12361 } 12362 defer googleapi.CloseBody(res) 12363 if err := googleapi.CheckResponse(res); err != nil { 12364 return nil, err 12365 } 12366 ret := &Operation{ 12367 ServerResponse: googleapi.ServerResponse{ 12368 Header: res.Header, 12369 HTTPStatusCode: res.StatusCode, 12370 }, 12371 } 12372 target := &ret 12373 if err := gensupport.DecodeResponse(target, res); err != nil { 12374 return nil, err 12375 } 12376 return ret, nil 12377 // { 12378 // "description": "Submits job to a cluster.", 12379 // "flatPath": "v1/projects/{projectId}/regions/{region}/jobs:submitAsOperation", 12380 // "httpMethod": "POST", 12381 // "id": "dataproc.projects.regions.jobs.submitAsOperation", 12382 // "parameterOrder": [ 12383 // "projectId", 12384 // "region" 12385 // ], 12386 // "parameters": { 12387 // "projectId": { 12388 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 12389 // "location": "path", 12390 // "required": true, 12391 // "type": "string" 12392 // }, 12393 // "region": { 12394 // "description": "Required. The Dataproc region in which to handle the request.", 12395 // "location": "path", 12396 // "required": true, 12397 // "type": "string" 12398 // } 12399 // }, 12400 // "path": "v1/projects/{projectId}/regions/{region}/jobs:submitAsOperation", 12401 // "request": { 12402 // "$ref": "SubmitJobRequest" 12403 // }, 12404 // "response": { 12405 // "$ref": "Operation" 12406 // }, 12407 // "scopes": [ 12408 // "https://www.googleapis.com/auth/cloud-platform" 12409 // ] 12410 // } 12411 12412} 12413 12414// method id "dataproc.projects.regions.jobs.testIamPermissions": 12415 12416type ProjectsRegionsJobsTestIamPermissionsCall struct { 12417 s *Service 12418 resource string 12419 testiampermissionsrequest *TestIamPermissionsRequest 12420 urlParams_ gensupport.URLParams 12421 ctx_ context.Context 12422 header_ http.Header 12423} 12424 12425// TestIamPermissions: Returns permissions that a caller has on the 12426// specified resource. If the resource does not exist, this will return 12427// an empty set of permissions, not a NOT_FOUND error.Note: This 12428// operation is designed to be used for building permission-aware UIs 12429// and command-line tools, not for authorization checking. This 12430// operation may "fail open" without warning. 12431// 12432// - resource: REQUIRED: The resource for which the policy detail is 12433// being requested. See the operation documentation for the 12434// appropriate value for this field. 12435func (r *ProjectsRegionsJobsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsJobsTestIamPermissionsCall { 12436 c := &ProjectsRegionsJobsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12437 c.resource = resource 12438 c.testiampermissionsrequest = testiampermissionsrequest 12439 return c 12440} 12441 12442// Fields allows partial responses to be retrieved. See 12443// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12444// for more information. 12445func (c *ProjectsRegionsJobsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsTestIamPermissionsCall { 12446 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12447 return c 12448} 12449 12450// Context sets the context to be used in this call's Do method. Any 12451// pending HTTP request will be aborted if the provided context is 12452// canceled. 12453func (c *ProjectsRegionsJobsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsJobsTestIamPermissionsCall { 12454 c.ctx_ = ctx 12455 return c 12456} 12457 12458// Header returns an http.Header that can be modified by the caller to 12459// add HTTP headers to the request. 12460func (c *ProjectsRegionsJobsTestIamPermissionsCall) Header() http.Header { 12461 if c.header_ == nil { 12462 c.header_ = make(http.Header) 12463 } 12464 return c.header_ 12465} 12466 12467func (c *ProjectsRegionsJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 12468 reqHeaders := make(http.Header) 12469 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 12470 for k, v := range c.header_ { 12471 reqHeaders[k] = v 12472 } 12473 reqHeaders.Set("User-Agent", c.s.userAgent()) 12474 var body io.Reader = nil 12475 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 12476 if err != nil { 12477 return nil, err 12478 } 12479 reqHeaders.Set("Content-Type", "application/json") 12480 c.urlParams_.Set("alt", alt) 12481 c.urlParams_.Set("prettyPrint", "false") 12482 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") 12483 urls += "?" + c.urlParams_.Encode() 12484 req, err := http.NewRequest("POST", urls, body) 12485 if err != nil { 12486 return nil, err 12487 } 12488 req.Header = reqHeaders 12489 googleapi.Expand(req.URL, map[string]string{ 12490 "resource": c.resource, 12491 }) 12492 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12493} 12494 12495// Do executes the "dataproc.projects.regions.jobs.testIamPermissions" call. 12496// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 12497// Any non-2xx status code is an error. Response headers are in either 12498// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 12499// was returned at all) in error.(*googleapi.Error).Header. Use 12500// googleapi.IsNotModified to check whether the returned error was 12501// because http.StatusNotModified was returned. 12502func (c *ProjectsRegionsJobsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 12503 gensupport.SetOptions(c.urlParams_, opts...) 12504 res, err := c.doRequest("json") 12505 if res != nil && res.StatusCode == http.StatusNotModified { 12506 if res.Body != nil { 12507 res.Body.Close() 12508 } 12509 return nil, &googleapi.Error{ 12510 Code: res.StatusCode, 12511 Header: res.Header, 12512 } 12513 } 12514 if err != nil { 12515 return nil, err 12516 } 12517 defer googleapi.CloseBody(res) 12518 if err := googleapi.CheckResponse(res); err != nil { 12519 return nil, err 12520 } 12521 ret := &TestIamPermissionsResponse{ 12522 ServerResponse: googleapi.ServerResponse{ 12523 Header: res.Header, 12524 HTTPStatusCode: res.StatusCode, 12525 }, 12526 } 12527 target := &ret 12528 if err := gensupport.DecodeResponse(target, res); err != nil { 12529 return nil, err 12530 } 12531 return ret, nil 12532 // { 12533 // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 12534 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:testIamPermissions", 12535 // "httpMethod": "POST", 12536 // "id": "dataproc.projects.regions.jobs.testIamPermissions", 12537 // "parameterOrder": [ 12538 // "resource" 12539 // ], 12540 // "parameters": { 12541 // "resource": { 12542 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 12543 // "location": "path", 12544 // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$", 12545 // "required": true, 12546 // "type": "string" 12547 // } 12548 // }, 12549 // "path": "v1/{+resource}:testIamPermissions", 12550 // "request": { 12551 // "$ref": "TestIamPermissionsRequest" 12552 // }, 12553 // "response": { 12554 // "$ref": "TestIamPermissionsResponse" 12555 // }, 12556 // "scopes": [ 12557 // "https://www.googleapis.com/auth/cloud-platform" 12558 // ] 12559 // } 12560 12561} 12562 12563// method id "dataproc.projects.regions.operations.cancel": 12564 12565type ProjectsRegionsOperationsCancelCall struct { 12566 s *Service 12567 name string 12568 urlParams_ gensupport.URLParams 12569 ctx_ context.Context 12570 header_ http.Header 12571} 12572 12573// Cancel: Starts asynchronous cancellation on a long-running operation. 12574// The server makes a best effort to cancel the operation, but success 12575// is not guaranteed. If the server doesn't support this method, it 12576// returns google.rpc.Code.UNIMPLEMENTED. Clients can use 12577// Operations.GetOperation or other methods to check whether the 12578// cancellation succeeded or whether the operation completed despite 12579// cancellation. On successful cancellation, the operation is not 12580// deleted; instead, it becomes an operation with an Operation.error 12581// value with a google.rpc.Status.code of 1, corresponding to 12582// Code.CANCELLED. 12583// 12584// - name: The name of the operation resource to be cancelled. 12585func (r *ProjectsRegionsOperationsService) Cancel(name string) *ProjectsRegionsOperationsCancelCall { 12586 c := &ProjectsRegionsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12587 c.name = name 12588 return c 12589} 12590 12591// Fields allows partial responses to be retrieved. See 12592// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12593// for more information. 12594func (c *ProjectsRegionsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsCancelCall { 12595 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12596 return c 12597} 12598 12599// Context sets the context to be used in this call's Do method. Any 12600// pending HTTP request will be aborted if the provided context is 12601// canceled. 12602func (c *ProjectsRegionsOperationsCancelCall) Context(ctx context.Context) *ProjectsRegionsOperationsCancelCall { 12603 c.ctx_ = ctx 12604 return c 12605} 12606 12607// Header returns an http.Header that can be modified by the caller to 12608// add HTTP headers to the request. 12609func (c *ProjectsRegionsOperationsCancelCall) Header() http.Header { 12610 if c.header_ == nil { 12611 c.header_ = make(http.Header) 12612 } 12613 return c.header_ 12614} 12615 12616func (c *ProjectsRegionsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 12617 reqHeaders := make(http.Header) 12618 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 12619 for k, v := range c.header_ { 12620 reqHeaders[k] = v 12621 } 12622 reqHeaders.Set("User-Agent", c.s.userAgent()) 12623 var body io.Reader = nil 12624 c.urlParams_.Set("alt", alt) 12625 c.urlParams_.Set("prettyPrint", "false") 12626 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel") 12627 urls += "?" + c.urlParams_.Encode() 12628 req, err := http.NewRequest("POST", urls, body) 12629 if err != nil { 12630 return nil, err 12631 } 12632 req.Header = reqHeaders 12633 googleapi.Expand(req.URL, map[string]string{ 12634 "name": c.name, 12635 }) 12636 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12637} 12638 12639// Do executes the "dataproc.projects.regions.operations.cancel" call. 12640// Exactly one of *Empty or error will be non-nil. Any non-2xx status 12641// code is an error. Response headers are in either 12642// *Empty.ServerResponse.Header or (if a response was returned at all) 12643// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12644// check whether the returned error was because http.StatusNotModified 12645// was returned. 12646func (c *ProjectsRegionsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 12647 gensupport.SetOptions(c.urlParams_, opts...) 12648 res, err := c.doRequest("json") 12649 if res != nil && res.StatusCode == http.StatusNotModified { 12650 if res.Body != nil { 12651 res.Body.Close() 12652 } 12653 return nil, &googleapi.Error{ 12654 Code: res.StatusCode, 12655 Header: res.Header, 12656 } 12657 } 12658 if err != nil { 12659 return nil, err 12660 } 12661 defer googleapi.CloseBody(res) 12662 if err := googleapi.CheckResponse(res); err != nil { 12663 return nil, err 12664 } 12665 ret := &Empty{ 12666 ServerResponse: googleapi.ServerResponse{ 12667 Header: res.Header, 12668 HTTPStatusCode: res.StatusCode, 12669 }, 12670 } 12671 target := &ret 12672 if err := gensupport.DecodeResponse(target, res); err != nil { 12673 return nil, err 12674 } 12675 return ret, nil 12676 // { 12677 // "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.", 12678 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:cancel", 12679 // "httpMethod": "POST", 12680 // "id": "dataproc.projects.regions.operations.cancel", 12681 // "parameterOrder": [ 12682 // "name" 12683 // ], 12684 // "parameters": { 12685 // "name": { 12686 // "description": "The name of the operation resource to be cancelled.", 12687 // "location": "path", 12688 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 12689 // "required": true, 12690 // "type": "string" 12691 // } 12692 // }, 12693 // "path": "v1/{+name}:cancel", 12694 // "response": { 12695 // "$ref": "Empty" 12696 // }, 12697 // "scopes": [ 12698 // "https://www.googleapis.com/auth/cloud-platform" 12699 // ] 12700 // } 12701 12702} 12703 12704// method id "dataproc.projects.regions.operations.delete": 12705 12706type ProjectsRegionsOperationsDeleteCall struct { 12707 s *Service 12708 name string 12709 urlParams_ gensupport.URLParams 12710 ctx_ context.Context 12711 header_ http.Header 12712} 12713 12714// Delete: Deletes a long-running operation. This method indicates that 12715// the client is no longer interested in the operation result. It does 12716// not cancel the operation. If the server doesn't support this method, 12717// it returns google.rpc.Code.UNIMPLEMENTED. 12718// 12719// - name: The name of the operation resource to be deleted. 12720func (r *ProjectsRegionsOperationsService) Delete(name string) *ProjectsRegionsOperationsDeleteCall { 12721 c := &ProjectsRegionsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12722 c.name = name 12723 return c 12724} 12725 12726// Fields allows partial responses to be retrieved. See 12727// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12728// for more information. 12729func (c *ProjectsRegionsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsDeleteCall { 12730 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12731 return c 12732} 12733 12734// Context sets the context to be used in this call's Do method. Any 12735// pending HTTP request will be aborted if the provided context is 12736// canceled. 12737func (c *ProjectsRegionsOperationsDeleteCall) Context(ctx context.Context) *ProjectsRegionsOperationsDeleteCall { 12738 c.ctx_ = ctx 12739 return c 12740} 12741 12742// Header returns an http.Header that can be modified by the caller to 12743// add HTTP headers to the request. 12744func (c *ProjectsRegionsOperationsDeleteCall) Header() http.Header { 12745 if c.header_ == nil { 12746 c.header_ = make(http.Header) 12747 } 12748 return c.header_ 12749} 12750 12751func (c *ProjectsRegionsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 12752 reqHeaders := make(http.Header) 12753 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 12754 for k, v := range c.header_ { 12755 reqHeaders[k] = v 12756 } 12757 reqHeaders.Set("User-Agent", c.s.userAgent()) 12758 var body io.Reader = nil 12759 c.urlParams_.Set("alt", alt) 12760 c.urlParams_.Set("prettyPrint", "false") 12761 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 12762 urls += "?" + c.urlParams_.Encode() 12763 req, err := http.NewRequest("DELETE", urls, body) 12764 if err != nil { 12765 return nil, err 12766 } 12767 req.Header = reqHeaders 12768 googleapi.Expand(req.URL, map[string]string{ 12769 "name": c.name, 12770 }) 12771 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12772} 12773 12774// Do executes the "dataproc.projects.regions.operations.delete" call. 12775// Exactly one of *Empty or error will be non-nil. Any non-2xx status 12776// code is an error. Response headers are in either 12777// *Empty.ServerResponse.Header or (if a response was returned at all) 12778// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12779// check whether the returned error was because http.StatusNotModified 12780// was returned. 12781func (c *ProjectsRegionsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 12782 gensupport.SetOptions(c.urlParams_, opts...) 12783 res, err := c.doRequest("json") 12784 if res != nil && res.StatusCode == http.StatusNotModified { 12785 if res.Body != nil { 12786 res.Body.Close() 12787 } 12788 return nil, &googleapi.Error{ 12789 Code: res.StatusCode, 12790 Header: res.Header, 12791 } 12792 } 12793 if err != nil { 12794 return nil, err 12795 } 12796 defer googleapi.CloseBody(res) 12797 if err := googleapi.CheckResponse(res); err != nil { 12798 return nil, err 12799 } 12800 ret := &Empty{ 12801 ServerResponse: googleapi.ServerResponse{ 12802 Header: res.Header, 12803 HTTPStatusCode: res.StatusCode, 12804 }, 12805 } 12806 target := &ret 12807 if err := gensupport.DecodeResponse(target, res); err != nil { 12808 return nil, err 12809 } 12810 return ret, nil 12811 // { 12812 // "description": "Deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, it returns google.rpc.Code.UNIMPLEMENTED.", 12813 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}", 12814 // "httpMethod": "DELETE", 12815 // "id": "dataproc.projects.regions.operations.delete", 12816 // "parameterOrder": [ 12817 // "name" 12818 // ], 12819 // "parameters": { 12820 // "name": { 12821 // "description": "The name of the operation resource to be deleted.", 12822 // "location": "path", 12823 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 12824 // "required": true, 12825 // "type": "string" 12826 // } 12827 // }, 12828 // "path": "v1/{+name}", 12829 // "response": { 12830 // "$ref": "Empty" 12831 // }, 12832 // "scopes": [ 12833 // "https://www.googleapis.com/auth/cloud-platform" 12834 // ] 12835 // } 12836 12837} 12838 12839// method id "dataproc.projects.regions.operations.get": 12840 12841type ProjectsRegionsOperationsGetCall struct { 12842 s *Service 12843 name string 12844 urlParams_ gensupport.URLParams 12845 ifNoneMatch_ string 12846 ctx_ context.Context 12847 header_ http.Header 12848} 12849 12850// Get: Gets the latest state of a long-running operation. Clients can 12851// use this method to poll the operation result at intervals as 12852// recommended by the API service. 12853// 12854// - name: The name of the operation resource. 12855func (r *ProjectsRegionsOperationsService) Get(name string) *ProjectsRegionsOperationsGetCall { 12856 c := &ProjectsRegionsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12857 c.name = name 12858 return c 12859} 12860 12861// Fields allows partial responses to be retrieved. See 12862// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12863// for more information. 12864func (c *ProjectsRegionsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsGetCall { 12865 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12866 return c 12867} 12868 12869// IfNoneMatch sets the optional parameter which makes the operation 12870// fail if the object's ETag matches the given value. This is useful for 12871// getting updates only after the object has changed since the last 12872// request. Use googleapi.IsNotModified to check whether the response 12873// error from Do is the result of In-None-Match. 12874func (c *ProjectsRegionsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsGetCall { 12875 c.ifNoneMatch_ = entityTag 12876 return c 12877} 12878 12879// Context sets the context to be used in this call's Do method. Any 12880// pending HTTP request will be aborted if the provided context is 12881// canceled. 12882func (c *ProjectsRegionsOperationsGetCall) Context(ctx context.Context) *ProjectsRegionsOperationsGetCall { 12883 c.ctx_ = ctx 12884 return c 12885} 12886 12887// Header returns an http.Header that can be modified by the caller to 12888// add HTTP headers to the request. 12889func (c *ProjectsRegionsOperationsGetCall) Header() http.Header { 12890 if c.header_ == nil { 12891 c.header_ = make(http.Header) 12892 } 12893 return c.header_ 12894} 12895 12896func (c *ProjectsRegionsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 12897 reqHeaders := make(http.Header) 12898 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 12899 for k, v := range c.header_ { 12900 reqHeaders[k] = v 12901 } 12902 reqHeaders.Set("User-Agent", c.s.userAgent()) 12903 if c.ifNoneMatch_ != "" { 12904 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12905 } 12906 var body io.Reader = nil 12907 c.urlParams_.Set("alt", alt) 12908 c.urlParams_.Set("prettyPrint", "false") 12909 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 12910 urls += "?" + c.urlParams_.Encode() 12911 req, err := http.NewRequest("GET", urls, body) 12912 if err != nil { 12913 return nil, err 12914 } 12915 req.Header = reqHeaders 12916 googleapi.Expand(req.URL, map[string]string{ 12917 "name": c.name, 12918 }) 12919 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12920} 12921 12922// Do executes the "dataproc.projects.regions.operations.get" call. 12923// Exactly one of *Operation or error will be non-nil. Any non-2xx 12924// status code is an error. Response headers are in either 12925// *Operation.ServerResponse.Header or (if a response was returned at 12926// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12927// to check whether the returned error was because 12928// http.StatusNotModified was returned. 12929func (c *ProjectsRegionsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 12930 gensupport.SetOptions(c.urlParams_, opts...) 12931 res, err := c.doRequest("json") 12932 if res != nil && res.StatusCode == http.StatusNotModified { 12933 if res.Body != nil { 12934 res.Body.Close() 12935 } 12936 return nil, &googleapi.Error{ 12937 Code: res.StatusCode, 12938 Header: res.Header, 12939 } 12940 } 12941 if err != nil { 12942 return nil, err 12943 } 12944 defer googleapi.CloseBody(res) 12945 if err := googleapi.CheckResponse(res); err != nil { 12946 return nil, err 12947 } 12948 ret := &Operation{ 12949 ServerResponse: googleapi.ServerResponse{ 12950 Header: res.Header, 12951 HTTPStatusCode: res.StatusCode, 12952 }, 12953 } 12954 target := &ret 12955 if err := gensupport.DecodeResponse(target, res); err != nil { 12956 return nil, err 12957 } 12958 return ret, nil 12959 // { 12960 // "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.", 12961 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}", 12962 // "httpMethod": "GET", 12963 // "id": "dataproc.projects.regions.operations.get", 12964 // "parameterOrder": [ 12965 // "name" 12966 // ], 12967 // "parameters": { 12968 // "name": { 12969 // "description": "The name of the operation resource.", 12970 // "location": "path", 12971 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 12972 // "required": true, 12973 // "type": "string" 12974 // } 12975 // }, 12976 // "path": "v1/{+name}", 12977 // "response": { 12978 // "$ref": "Operation" 12979 // }, 12980 // "scopes": [ 12981 // "https://www.googleapis.com/auth/cloud-platform" 12982 // ] 12983 // } 12984 12985} 12986 12987// method id "dataproc.projects.regions.operations.getIamPolicy": 12988 12989type ProjectsRegionsOperationsGetIamPolicyCall struct { 12990 s *Service 12991 resource string 12992 getiampolicyrequest *GetIamPolicyRequest 12993 urlParams_ gensupport.URLParams 12994 ctx_ context.Context 12995 header_ http.Header 12996} 12997 12998// GetIamPolicy: Gets the access control policy for a resource. Returns 12999// an empty policy if the resource exists and does not have a policy 13000// set. 13001// 13002// - resource: REQUIRED: The resource for which the policy is being 13003// requested. See the operation documentation for the appropriate 13004// value for this field. 13005func (r *ProjectsRegionsOperationsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsRegionsOperationsGetIamPolicyCall { 13006 c := &ProjectsRegionsOperationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13007 c.resource = resource 13008 c.getiampolicyrequest = getiampolicyrequest 13009 return c 13010} 13011 13012// Fields allows partial responses to be retrieved. See 13013// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13014// for more information. 13015func (c *ProjectsRegionsOperationsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsGetIamPolicyCall { 13016 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13017 return c 13018} 13019 13020// Context sets the context to be used in this call's Do method. Any 13021// pending HTTP request will be aborted if the provided context is 13022// canceled. 13023func (c *ProjectsRegionsOperationsGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsOperationsGetIamPolicyCall { 13024 c.ctx_ = ctx 13025 return c 13026} 13027 13028// Header returns an http.Header that can be modified by the caller to 13029// add HTTP headers to the request. 13030func (c *ProjectsRegionsOperationsGetIamPolicyCall) Header() http.Header { 13031 if c.header_ == nil { 13032 c.header_ = make(http.Header) 13033 } 13034 return c.header_ 13035} 13036 13037func (c *ProjectsRegionsOperationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 13038 reqHeaders := make(http.Header) 13039 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 13040 for k, v := range c.header_ { 13041 reqHeaders[k] = v 13042 } 13043 reqHeaders.Set("User-Agent", c.s.userAgent()) 13044 var body io.Reader = nil 13045 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 13046 if err != nil { 13047 return nil, err 13048 } 13049 reqHeaders.Set("Content-Type", "application/json") 13050 c.urlParams_.Set("alt", alt) 13051 c.urlParams_.Set("prettyPrint", "false") 13052 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") 13053 urls += "?" + c.urlParams_.Encode() 13054 req, err := http.NewRequest("POST", urls, body) 13055 if err != nil { 13056 return nil, err 13057 } 13058 req.Header = reqHeaders 13059 googleapi.Expand(req.URL, map[string]string{ 13060 "resource": c.resource, 13061 }) 13062 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13063} 13064 13065// Do executes the "dataproc.projects.regions.operations.getIamPolicy" call. 13066// Exactly one of *Policy or error will be non-nil. Any non-2xx status 13067// code is an error. Response headers are in either 13068// *Policy.ServerResponse.Header or (if a response was returned at all) 13069// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13070// check whether the returned error was because http.StatusNotModified 13071// was returned. 13072func (c *ProjectsRegionsOperationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 13073 gensupport.SetOptions(c.urlParams_, opts...) 13074 res, err := c.doRequest("json") 13075 if res != nil && res.StatusCode == http.StatusNotModified { 13076 if res.Body != nil { 13077 res.Body.Close() 13078 } 13079 return nil, &googleapi.Error{ 13080 Code: res.StatusCode, 13081 Header: res.Header, 13082 } 13083 } 13084 if err != nil { 13085 return nil, err 13086 } 13087 defer googleapi.CloseBody(res) 13088 if err := googleapi.CheckResponse(res); err != nil { 13089 return nil, err 13090 } 13091 ret := &Policy{ 13092 ServerResponse: googleapi.ServerResponse{ 13093 Header: res.Header, 13094 HTTPStatusCode: res.StatusCode, 13095 }, 13096 } 13097 target := &ret 13098 if err := gensupport.DecodeResponse(target, res); err != nil { 13099 return nil, err 13100 } 13101 return ret, nil 13102 // { 13103 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 13104 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:getIamPolicy", 13105 // "httpMethod": "POST", 13106 // "id": "dataproc.projects.regions.operations.getIamPolicy", 13107 // "parameterOrder": [ 13108 // "resource" 13109 // ], 13110 // "parameters": { 13111 // "resource": { 13112 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 13113 // "location": "path", 13114 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 13115 // "required": true, 13116 // "type": "string" 13117 // } 13118 // }, 13119 // "path": "v1/{+resource}:getIamPolicy", 13120 // "request": { 13121 // "$ref": "GetIamPolicyRequest" 13122 // }, 13123 // "response": { 13124 // "$ref": "Policy" 13125 // }, 13126 // "scopes": [ 13127 // "https://www.googleapis.com/auth/cloud-platform" 13128 // ] 13129 // } 13130 13131} 13132 13133// method id "dataproc.projects.regions.operations.list": 13134 13135type ProjectsRegionsOperationsListCall struct { 13136 s *Service 13137 name string 13138 urlParams_ gensupport.URLParams 13139 ifNoneMatch_ string 13140 ctx_ context.Context 13141 header_ http.Header 13142} 13143 13144// List: Lists operations that match the specified filter in the 13145// request. If the server doesn't support this method, it returns 13146// UNIMPLEMENTED.NOTE: the name binding allows API services to override 13147// the binding to use different resource name schemes, such as 13148// users/*/operations. To override the binding, API services can add a 13149// binding such as "/v1/{name=users/*}/operations" to their service 13150// configuration. For backwards compatibility, the default name includes 13151// the operations collection id, however overriding users must ensure 13152// the name binding is the parent resource, without the operations 13153// collection id. 13154// 13155// - name: The name of the operation's parent resource. 13156func (r *ProjectsRegionsOperationsService) List(name string) *ProjectsRegionsOperationsListCall { 13157 c := &ProjectsRegionsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13158 c.name = name 13159 return c 13160} 13161 13162// Filter sets the optional parameter "filter": The standard list 13163// filter. 13164func (c *ProjectsRegionsOperationsListCall) Filter(filter string) *ProjectsRegionsOperationsListCall { 13165 c.urlParams_.Set("filter", filter) 13166 return c 13167} 13168 13169// PageSize sets the optional parameter "pageSize": The standard list 13170// page size. 13171func (c *ProjectsRegionsOperationsListCall) PageSize(pageSize int64) *ProjectsRegionsOperationsListCall { 13172 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 13173 return c 13174} 13175 13176// PageToken sets the optional parameter "pageToken": The standard list 13177// page token. 13178func (c *ProjectsRegionsOperationsListCall) PageToken(pageToken string) *ProjectsRegionsOperationsListCall { 13179 c.urlParams_.Set("pageToken", pageToken) 13180 return c 13181} 13182 13183// Fields allows partial responses to be retrieved. See 13184// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13185// for more information. 13186func (c *ProjectsRegionsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsListCall { 13187 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13188 return c 13189} 13190 13191// IfNoneMatch sets the optional parameter which makes the operation 13192// fail if the object's ETag matches the given value. This is useful for 13193// getting updates only after the object has changed since the last 13194// request. Use googleapi.IsNotModified to check whether the response 13195// error from Do is the result of In-None-Match. 13196func (c *ProjectsRegionsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsListCall { 13197 c.ifNoneMatch_ = entityTag 13198 return c 13199} 13200 13201// Context sets the context to be used in this call's Do method. Any 13202// pending HTTP request will be aborted if the provided context is 13203// canceled. 13204func (c *ProjectsRegionsOperationsListCall) Context(ctx context.Context) *ProjectsRegionsOperationsListCall { 13205 c.ctx_ = ctx 13206 return c 13207} 13208 13209// Header returns an http.Header that can be modified by the caller to 13210// add HTTP headers to the request. 13211func (c *ProjectsRegionsOperationsListCall) Header() http.Header { 13212 if c.header_ == nil { 13213 c.header_ = make(http.Header) 13214 } 13215 return c.header_ 13216} 13217 13218func (c *ProjectsRegionsOperationsListCall) doRequest(alt string) (*http.Response, error) { 13219 reqHeaders := make(http.Header) 13220 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 13221 for k, v := range c.header_ { 13222 reqHeaders[k] = v 13223 } 13224 reqHeaders.Set("User-Agent", c.s.userAgent()) 13225 if c.ifNoneMatch_ != "" { 13226 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13227 } 13228 var body io.Reader = nil 13229 c.urlParams_.Set("alt", alt) 13230 c.urlParams_.Set("prettyPrint", "false") 13231 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 13232 urls += "?" + c.urlParams_.Encode() 13233 req, err := http.NewRequest("GET", urls, body) 13234 if err != nil { 13235 return nil, err 13236 } 13237 req.Header = reqHeaders 13238 googleapi.Expand(req.URL, map[string]string{ 13239 "name": c.name, 13240 }) 13241 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13242} 13243 13244// Do executes the "dataproc.projects.regions.operations.list" call. 13245// Exactly one of *ListOperationsResponse or error will be non-nil. Any 13246// non-2xx status code is an error. Response headers are in either 13247// *ListOperationsResponse.ServerResponse.Header or (if a response was 13248// returned at all) in error.(*googleapi.Error).Header. Use 13249// googleapi.IsNotModified to check whether the returned error was 13250// because http.StatusNotModified was returned. 13251func (c *ProjectsRegionsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 13252 gensupport.SetOptions(c.urlParams_, opts...) 13253 res, err := c.doRequest("json") 13254 if res != nil && res.StatusCode == http.StatusNotModified { 13255 if res.Body != nil { 13256 res.Body.Close() 13257 } 13258 return nil, &googleapi.Error{ 13259 Code: res.StatusCode, 13260 Header: res.Header, 13261 } 13262 } 13263 if err != nil { 13264 return nil, err 13265 } 13266 defer googleapi.CloseBody(res) 13267 if err := googleapi.CheckResponse(res); err != nil { 13268 return nil, err 13269 } 13270 ret := &ListOperationsResponse{ 13271 ServerResponse: googleapi.ServerResponse{ 13272 Header: res.Header, 13273 HTTPStatusCode: res.StatusCode, 13274 }, 13275 } 13276 target := &ret 13277 if err := gensupport.DecodeResponse(target, res); err != nil { 13278 return nil, err 13279 } 13280 return ret, nil 13281 // { 13282 // "description": "Lists operations that match the specified filter in the request. If the server doesn't support this method, it returns UNIMPLEMENTED.NOTE: the name binding allows API services to override the binding to use different resource name schemes, such as users/*/operations. To override the binding, API services can add a binding such as \"/v1/{name=users/*}/operations\" to their service configuration. For backwards compatibility, the default name includes the operations collection id, however overriding users must ensure the name binding is the parent resource, without the operations collection id.", 13283 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations", 13284 // "httpMethod": "GET", 13285 // "id": "dataproc.projects.regions.operations.list", 13286 // "parameterOrder": [ 13287 // "name" 13288 // ], 13289 // "parameters": { 13290 // "filter": { 13291 // "description": "The standard list filter.", 13292 // "location": "query", 13293 // "type": "string" 13294 // }, 13295 // "name": { 13296 // "description": "The name of the operation's parent resource.", 13297 // "location": "path", 13298 // "pattern": "^projects/[^/]+/regions/[^/]+/operations$", 13299 // "required": true, 13300 // "type": "string" 13301 // }, 13302 // "pageSize": { 13303 // "description": "The standard list page size.", 13304 // "format": "int32", 13305 // "location": "query", 13306 // "type": "integer" 13307 // }, 13308 // "pageToken": { 13309 // "description": "The standard list page token.", 13310 // "location": "query", 13311 // "type": "string" 13312 // } 13313 // }, 13314 // "path": "v1/{+name}", 13315 // "response": { 13316 // "$ref": "ListOperationsResponse" 13317 // }, 13318 // "scopes": [ 13319 // "https://www.googleapis.com/auth/cloud-platform" 13320 // ] 13321 // } 13322 13323} 13324 13325// Pages invokes f for each page of results. 13326// A non-nil error returned from f will halt the iteration. 13327// The provided context supersedes any context provided to the Context method. 13328func (c *ProjectsRegionsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 13329 c.ctx_ = ctx 13330 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 13331 for { 13332 x, err := c.Do() 13333 if err != nil { 13334 return err 13335 } 13336 if err := f(x); err != nil { 13337 return err 13338 } 13339 if x.NextPageToken == "" { 13340 return nil 13341 } 13342 c.PageToken(x.NextPageToken) 13343 } 13344} 13345 13346// method id "dataproc.projects.regions.operations.setIamPolicy": 13347 13348type ProjectsRegionsOperationsSetIamPolicyCall struct { 13349 s *Service 13350 resource string 13351 setiampolicyrequest *SetIamPolicyRequest 13352 urlParams_ gensupport.URLParams 13353 ctx_ context.Context 13354 header_ http.Header 13355} 13356 13357// SetIamPolicy: Sets the access control policy on the specified 13358// resource. Replaces any existing policy.Can return NOT_FOUND, 13359// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 13360// 13361// - resource: REQUIRED: The resource for which the policy is being 13362// specified. See the operation documentation for the appropriate 13363// value for this field. 13364func (r *ProjectsRegionsOperationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsOperationsSetIamPolicyCall { 13365 c := &ProjectsRegionsOperationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13366 c.resource = resource 13367 c.setiampolicyrequest = setiampolicyrequest 13368 return c 13369} 13370 13371// Fields allows partial responses to be retrieved. See 13372// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13373// for more information. 13374func (c *ProjectsRegionsOperationsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsSetIamPolicyCall { 13375 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13376 return c 13377} 13378 13379// Context sets the context to be used in this call's Do method. Any 13380// pending HTTP request will be aborted if the provided context is 13381// canceled. 13382func (c *ProjectsRegionsOperationsSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsOperationsSetIamPolicyCall { 13383 c.ctx_ = ctx 13384 return c 13385} 13386 13387// Header returns an http.Header that can be modified by the caller to 13388// add HTTP headers to the request. 13389func (c *ProjectsRegionsOperationsSetIamPolicyCall) Header() http.Header { 13390 if c.header_ == nil { 13391 c.header_ = make(http.Header) 13392 } 13393 return c.header_ 13394} 13395 13396func (c *ProjectsRegionsOperationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 13397 reqHeaders := make(http.Header) 13398 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 13399 for k, v := range c.header_ { 13400 reqHeaders[k] = v 13401 } 13402 reqHeaders.Set("User-Agent", c.s.userAgent()) 13403 var body io.Reader = nil 13404 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 13405 if err != nil { 13406 return nil, err 13407 } 13408 reqHeaders.Set("Content-Type", "application/json") 13409 c.urlParams_.Set("alt", alt) 13410 c.urlParams_.Set("prettyPrint", "false") 13411 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") 13412 urls += "?" + c.urlParams_.Encode() 13413 req, err := http.NewRequest("POST", urls, body) 13414 if err != nil { 13415 return nil, err 13416 } 13417 req.Header = reqHeaders 13418 googleapi.Expand(req.URL, map[string]string{ 13419 "resource": c.resource, 13420 }) 13421 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13422} 13423 13424// Do executes the "dataproc.projects.regions.operations.setIamPolicy" call. 13425// Exactly one of *Policy or error will be non-nil. Any non-2xx status 13426// code is an error. Response headers are in either 13427// *Policy.ServerResponse.Header or (if a response was returned at all) 13428// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13429// check whether the returned error was because http.StatusNotModified 13430// was returned. 13431func (c *ProjectsRegionsOperationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 13432 gensupport.SetOptions(c.urlParams_, opts...) 13433 res, err := c.doRequest("json") 13434 if res != nil && res.StatusCode == http.StatusNotModified { 13435 if res.Body != nil { 13436 res.Body.Close() 13437 } 13438 return nil, &googleapi.Error{ 13439 Code: res.StatusCode, 13440 Header: res.Header, 13441 } 13442 } 13443 if err != nil { 13444 return nil, err 13445 } 13446 defer googleapi.CloseBody(res) 13447 if err := googleapi.CheckResponse(res); err != nil { 13448 return nil, err 13449 } 13450 ret := &Policy{ 13451 ServerResponse: googleapi.ServerResponse{ 13452 Header: res.Header, 13453 HTTPStatusCode: res.StatusCode, 13454 }, 13455 } 13456 target := &ret 13457 if err := gensupport.DecodeResponse(target, res); err != nil { 13458 return nil, err 13459 } 13460 return ret, nil 13461 // { 13462 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 13463 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:setIamPolicy", 13464 // "httpMethod": "POST", 13465 // "id": "dataproc.projects.regions.operations.setIamPolicy", 13466 // "parameterOrder": [ 13467 // "resource" 13468 // ], 13469 // "parameters": { 13470 // "resource": { 13471 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 13472 // "location": "path", 13473 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 13474 // "required": true, 13475 // "type": "string" 13476 // } 13477 // }, 13478 // "path": "v1/{+resource}:setIamPolicy", 13479 // "request": { 13480 // "$ref": "SetIamPolicyRequest" 13481 // }, 13482 // "response": { 13483 // "$ref": "Policy" 13484 // }, 13485 // "scopes": [ 13486 // "https://www.googleapis.com/auth/cloud-platform" 13487 // ] 13488 // } 13489 13490} 13491 13492// method id "dataproc.projects.regions.operations.testIamPermissions": 13493 13494type ProjectsRegionsOperationsTestIamPermissionsCall struct { 13495 s *Service 13496 resource string 13497 testiampermissionsrequest *TestIamPermissionsRequest 13498 urlParams_ gensupport.URLParams 13499 ctx_ context.Context 13500 header_ http.Header 13501} 13502 13503// TestIamPermissions: Returns permissions that a caller has on the 13504// specified resource. If the resource does not exist, this will return 13505// an empty set of permissions, not a NOT_FOUND error.Note: This 13506// operation is designed to be used for building permission-aware UIs 13507// and command-line tools, not for authorization checking. This 13508// operation may "fail open" without warning. 13509// 13510// - resource: REQUIRED: The resource for which the policy detail is 13511// being requested. See the operation documentation for the 13512// appropriate value for this field. 13513func (r *ProjectsRegionsOperationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsOperationsTestIamPermissionsCall { 13514 c := &ProjectsRegionsOperationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13515 c.resource = resource 13516 c.testiampermissionsrequest = testiampermissionsrequest 13517 return c 13518} 13519 13520// Fields allows partial responses to be retrieved. See 13521// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13522// for more information. 13523func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsTestIamPermissionsCall { 13524 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13525 return c 13526} 13527 13528// Context sets the context to be used in this call's Do method. Any 13529// pending HTTP request will be aborted if the provided context is 13530// canceled. 13531func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsOperationsTestIamPermissionsCall { 13532 c.ctx_ = ctx 13533 return c 13534} 13535 13536// Header returns an http.Header that can be modified by the caller to 13537// add HTTP headers to the request. 13538func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Header() http.Header { 13539 if c.header_ == nil { 13540 c.header_ = make(http.Header) 13541 } 13542 return c.header_ 13543} 13544 13545func (c *ProjectsRegionsOperationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 13546 reqHeaders := make(http.Header) 13547 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 13548 for k, v := range c.header_ { 13549 reqHeaders[k] = v 13550 } 13551 reqHeaders.Set("User-Agent", c.s.userAgent()) 13552 var body io.Reader = nil 13553 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 13554 if err != nil { 13555 return nil, err 13556 } 13557 reqHeaders.Set("Content-Type", "application/json") 13558 c.urlParams_.Set("alt", alt) 13559 c.urlParams_.Set("prettyPrint", "false") 13560 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") 13561 urls += "?" + c.urlParams_.Encode() 13562 req, err := http.NewRequest("POST", urls, body) 13563 if err != nil { 13564 return nil, err 13565 } 13566 req.Header = reqHeaders 13567 googleapi.Expand(req.URL, map[string]string{ 13568 "resource": c.resource, 13569 }) 13570 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13571} 13572 13573// Do executes the "dataproc.projects.regions.operations.testIamPermissions" call. 13574// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 13575// Any non-2xx status code is an error. Response headers are in either 13576// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 13577// was returned at all) in error.(*googleapi.Error).Header. Use 13578// googleapi.IsNotModified to check whether the returned error was 13579// because http.StatusNotModified was returned. 13580func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 13581 gensupport.SetOptions(c.urlParams_, opts...) 13582 res, err := c.doRequest("json") 13583 if res != nil && res.StatusCode == http.StatusNotModified { 13584 if res.Body != nil { 13585 res.Body.Close() 13586 } 13587 return nil, &googleapi.Error{ 13588 Code: res.StatusCode, 13589 Header: res.Header, 13590 } 13591 } 13592 if err != nil { 13593 return nil, err 13594 } 13595 defer googleapi.CloseBody(res) 13596 if err := googleapi.CheckResponse(res); err != nil { 13597 return nil, err 13598 } 13599 ret := &TestIamPermissionsResponse{ 13600 ServerResponse: googleapi.ServerResponse{ 13601 Header: res.Header, 13602 HTTPStatusCode: res.StatusCode, 13603 }, 13604 } 13605 target := &ret 13606 if err := gensupport.DecodeResponse(target, res); err != nil { 13607 return nil, err 13608 } 13609 return ret, nil 13610 // { 13611 // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 13612 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:testIamPermissions", 13613 // "httpMethod": "POST", 13614 // "id": "dataproc.projects.regions.operations.testIamPermissions", 13615 // "parameterOrder": [ 13616 // "resource" 13617 // ], 13618 // "parameters": { 13619 // "resource": { 13620 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 13621 // "location": "path", 13622 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 13623 // "required": true, 13624 // "type": "string" 13625 // } 13626 // }, 13627 // "path": "v1/{+resource}:testIamPermissions", 13628 // "request": { 13629 // "$ref": "TestIamPermissionsRequest" 13630 // }, 13631 // "response": { 13632 // "$ref": "TestIamPermissionsResponse" 13633 // }, 13634 // "scopes": [ 13635 // "https://www.googleapis.com/auth/cloud-platform" 13636 // ] 13637 // } 13638 13639} 13640 13641// method id "dataproc.projects.regions.workflowTemplates.create": 13642 13643type ProjectsRegionsWorkflowTemplatesCreateCall struct { 13644 s *Service 13645 parent string 13646 workflowtemplate *WorkflowTemplate 13647 urlParams_ gensupport.URLParams 13648 ctx_ context.Context 13649 header_ http.Header 13650} 13651 13652// Create: Creates new workflow template. 13653// 13654// - parent: The resource name of the region or location, as described 13655// in https://cloud.google.com/apis/design/resource_names. For 13656// projects.regions.workflowTemplates,create, the resource name of the 13657// region has the following format: 13658// projects/{project_id}/regions/{region} For 13659// projects.locations.workflowTemplates.create, the resource name of 13660// the location has the following format: 13661// projects/{project_id}/locations/{location}. 13662func (r *ProjectsRegionsWorkflowTemplatesService) Create(parent string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesCreateCall { 13663 c := &ProjectsRegionsWorkflowTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13664 c.parent = parent 13665 c.workflowtemplate = workflowtemplate 13666 return c 13667} 13668 13669// Fields allows partial responses to be retrieved. See 13670// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13671// for more information. 13672func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesCreateCall { 13673 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13674 return c 13675} 13676 13677// Context sets the context to be used in this call's Do method. Any 13678// pending HTTP request will be aborted if the provided context is 13679// canceled. 13680func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesCreateCall { 13681 c.ctx_ = ctx 13682 return c 13683} 13684 13685// Header returns an http.Header that can be modified by the caller to 13686// add HTTP headers to the request. 13687func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Header() http.Header { 13688 if c.header_ == nil { 13689 c.header_ = make(http.Header) 13690 } 13691 return c.header_ 13692} 13693 13694func (c *ProjectsRegionsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { 13695 reqHeaders := make(http.Header) 13696 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 13697 for k, v := range c.header_ { 13698 reqHeaders[k] = v 13699 } 13700 reqHeaders.Set("User-Agent", c.s.userAgent()) 13701 var body io.Reader = nil 13702 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 13703 if err != nil { 13704 return nil, err 13705 } 13706 reqHeaders.Set("Content-Type", "application/json") 13707 c.urlParams_.Set("alt", alt) 13708 c.urlParams_.Set("prettyPrint", "false") 13709 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates") 13710 urls += "?" + c.urlParams_.Encode() 13711 req, err := http.NewRequest("POST", urls, body) 13712 if err != nil { 13713 return nil, err 13714 } 13715 req.Header = reqHeaders 13716 googleapi.Expand(req.URL, map[string]string{ 13717 "parent": c.parent, 13718 }) 13719 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13720} 13721 13722// Do executes the "dataproc.projects.regions.workflowTemplates.create" call. 13723// Exactly one of *WorkflowTemplate or error will be non-nil. Any 13724// non-2xx status code is an error. Response headers are in either 13725// *WorkflowTemplate.ServerResponse.Header or (if a response was 13726// returned at all) in error.(*googleapi.Error).Header. Use 13727// googleapi.IsNotModified to check whether the returned error was 13728// because http.StatusNotModified was returned. 13729func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 13730 gensupport.SetOptions(c.urlParams_, opts...) 13731 res, err := c.doRequest("json") 13732 if res != nil && res.StatusCode == http.StatusNotModified { 13733 if res.Body != nil { 13734 res.Body.Close() 13735 } 13736 return nil, &googleapi.Error{ 13737 Code: res.StatusCode, 13738 Header: res.Header, 13739 } 13740 } 13741 if err != nil { 13742 return nil, err 13743 } 13744 defer googleapi.CloseBody(res) 13745 if err := googleapi.CheckResponse(res); err != nil { 13746 return nil, err 13747 } 13748 ret := &WorkflowTemplate{ 13749 ServerResponse: googleapi.ServerResponse{ 13750 Header: res.Header, 13751 HTTPStatusCode: res.StatusCode, 13752 }, 13753 } 13754 target := &ret 13755 if err := gensupport.DecodeResponse(target, res); err != nil { 13756 return nil, err 13757 } 13758 return ret, nil 13759 // { 13760 // "description": "Creates new workflow template.", 13761 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates", 13762 // "httpMethod": "POST", 13763 // "id": "dataproc.projects.regions.workflowTemplates.create", 13764 // "parameterOrder": [ 13765 // "parent" 13766 // ], 13767 // "parameters": { 13768 // "parent": { 13769 // "description": "Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates,create, the resource name of the region has the following format: projects/{project_id}/regions/{region} For projects.locations.workflowTemplates.create, the resource name of the location has the following format: projects/{project_id}/locations/{location}", 13770 // "location": "path", 13771 // "pattern": "^projects/[^/]+/regions/[^/]+$", 13772 // "required": true, 13773 // "type": "string" 13774 // } 13775 // }, 13776 // "path": "v1/{+parent}/workflowTemplates", 13777 // "request": { 13778 // "$ref": "WorkflowTemplate" 13779 // }, 13780 // "response": { 13781 // "$ref": "WorkflowTemplate" 13782 // }, 13783 // "scopes": [ 13784 // "https://www.googleapis.com/auth/cloud-platform" 13785 // ] 13786 // } 13787 13788} 13789 13790// method id "dataproc.projects.regions.workflowTemplates.delete": 13791 13792type ProjectsRegionsWorkflowTemplatesDeleteCall struct { 13793 s *Service 13794 name string 13795 urlParams_ gensupport.URLParams 13796 ctx_ context.Context 13797 header_ http.Header 13798} 13799 13800// Delete: Deletes a workflow template. It does not cancel in-progress 13801// workflows. 13802// 13803// - name: The resource name of the workflow template, as described in 13804// https://cloud.google.com/apis/design/resource_names. For 13805// projects.regions.workflowTemplates.delete, the resource name of the 13806// template has the following format: 13807// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 13808// d} For projects.locations.workflowTemplates.instantiate, the 13809// resource name of the template has the following format: 13810// projects/{project_id}/locations/{location}/workflowTemplates/{templa 13811// te_id}. 13812func (r *ProjectsRegionsWorkflowTemplatesService) Delete(name string) *ProjectsRegionsWorkflowTemplatesDeleteCall { 13813 c := &ProjectsRegionsWorkflowTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13814 c.name = name 13815 return c 13816} 13817 13818// Version sets the optional parameter "version": The version of 13819// workflow template to delete. If specified, will only delete the 13820// template if the current server version matches specified version. 13821func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Version(version int64) *ProjectsRegionsWorkflowTemplatesDeleteCall { 13822 c.urlParams_.Set("version", fmt.Sprint(version)) 13823 return c 13824} 13825 13826// Fields allows partial responses to be retrieved. See 13827// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13828// for more information. 13829func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesDeleteCall { 13830 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13831 return c 13832} 13833 13834// Context sets the context to be used in this call's Do method. Any 13835// pending HTTP request will be aborted if the provided context is 13836// canceled. 13837func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesDeleteCall { 13838 c.ctx_ = ctx 13839 return c 13840} 13841 13842// Header returns an http.Header that can be modified by the caller to 13843// add HTTP headers to the request. 13844func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Header() http.Header { 13845 if c.header_ == nil { 13846 c.header_ = make(http.Header) 13847 } 13848 return c.header_ 13849} 13850 13851func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { 13852 reqHeaders := make(http.Header) 13853 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 13854 for k, v := range c.header_ { 13855 reqHeaders[k] = v 13856 } 13857 reqHeaders.Set("User-Agent", c.s.userAgent()) 13858 var body io.Reader = nil 13859 c.urlParams_.Set("alt", alt) 13860 c.urlParams_.Set("prettyPrint", "false") 13861 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 13862 urls += "?" + c.urlParams_.Encode() 13863 req, err := http.NewRequest("DELETE", urls, body) 13864 if err != nil { 13865 return nil, err 13866 } 13867 req.Header = reqHeaders 13868 googleapi.Expand(req.URL, map[string]string{ 13869 "name": c.name, 13870 }) 13871 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13872} 13873 13874// Do executes the "dataproc.projects.regions.workflowTemplates.delete" call. 13875// Exactly one of *Empty or error will be non-nil. Any non-2xx status 13876// code is an error. Response headers are in either 13877// *Empty.ServerResponse.Header or (if a response was returned at all) 13878// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13879// check whether the returned error was because http.StatusNotModified 13880// was returned. 13881func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 13882 gensupport.SetOptions(c.urlParams_, opts...) 13883 res, err := c.doRequest("json") 13884 if res != nil && res.StatusCode == http.StatusNotModified { 13885 if res.Body != nil { 13886 res.Body.Close() 13887 } 13888 return nil, &googleapi.Error{ 13889 Code: res.StatusCode, 13890 Header: res.Header, 13891 } 13892 } 13893 if err != nil { 13894 return nil, err 13895 } 13896 defer googleapi.CloseBody(res) 13897 if err := googleapi.CheckResponse(res); err != nil { 13898 return nil, err 13899 } 13900 ret := &Empty{ 13901 ServerResponse: googleapi.ServerResponse{ 13902 Header: res.Header, 13903 HTTPStatusCode: res.StatusCode, 13904 }, 13905 } 13906 target := &ret 13907 if err := gensupport.DecodeResponse(target, res); err != nil { 13908 return nil, err 13909 } 13910 return ret, nil 13911 // { 13912 // "description": "Deletes a workflow template. It does not cancel in-progress workflows.", 13913 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}", 13914 // "httpMethod": "DELETE", 13915 // "id": "dataproc.projects.regions.workflowTemplates.delete", 13916 // "parameterOrder": [ 13917 // "name" 13918 // ], 13919 // "parameters": { 13920 // "name": { 13921 // "description": "Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates.delete, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}", 13922 // "location": "path", 13923 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 13924 // "required": true, 13925 // "type": "string" 13926 // }, 13927 // "version": { 13928 // "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.", 13929 // "format": "int32", 13930 // "location": "query", 13931 // "type": "integer" 13932 // } 13933 // }, 13934 // "path": "v1/{+name}", 13935 // "response": { 13936 // "$ref": "Empty" 13937 // }, 13938 // "scopes": [ 13939 // "https://www.googleapis.com/auth/cloud-platform" 13940 // ] 13941 // } 13942 13943} 13944 13945// method id "dataproc.projects.regions.workflowTemplates.get": 13946 13947type ProjectsRegionsWorkflowTemplatesGetCall struct { 13948 s *Service 13949 name string 13950 urlParams_ gensupport.URLParams 13951 ifNoneMatch_ string 13952 ctx_ context.Context 13953 header_ http.Header 13954} 13955 13956// Get: Retrieves the latest workflow template.Can retrieve previously 13957// instantiated template by specifying optional version parameter. 13958// 13959// - name: The resource name of the workflow template, as described in 13960// https://cloud.google.com/apis/design/resource_names. For 13961// projects.regions.workflowTemplates.get, the resource name of the 13962// template has the following format: 13963// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 13964// d} For projects.locations.workflowTemplates.get, the resource name 13965// of the template has the following format: 13966// projects/{project_id}/locations/{location}/workflowTemplates/{templa 13967// te_id}. 13968func (r *ProjectsRegionsWorkflowTemplatesService) Get(name string) *ProjectsRegionsWorkflowTemplatesGetCall { 13969 c := &ProjectsRegionsWorkflowTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13970 c.name = name 13971 return c 13972} 13973 13974// Version sets the optional parameter "version": The version of 13975// workflow template to retrieve. Only previously instantiated versions 13976// can be retrieved.If unspecified, retrieves the current version. 13977func (c *ProjectsRegionsWorkflowTemplatesGetCall) Version(version int64) *ProjectsRegionsWorkflowTemplatesGetCall { 13978 c.urlParams_.Set("version", fmt.Sprint(version)) 13979 return c 13980} 13981 13982// Fields allows partial responses to be retrieved. See 13983// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13984// for more information. 13985func (c *ProjectsRegionsWorkflowTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesGetCall { 13986 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13987 return c 13988} 13989 13990// IfNoneMatch sets the optional parameter which makes the operation 13991// fail if the object's ETag matches the given value. This is useful for 13992// getting updates only after the object has changed since the last 13993// request. Use googleapi.IsNotModified to check whether the response 13994// error from Do is the result of In-None-Match. 13995func (c *ProjectsRegionsWorkflowTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesGetCall { 13996 c.ifNoneMatch_ = entityTag 13997 return c 13998} 13999 14000// Context sets the context to be used in this call's Do method. Any 14001// pending HTTP request will be aborted if the provided context is 14002// canceled. 14003func (c *ProjectsRegionsWorkflowTemplatesGetCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesGetCall { 14004 c.ctx_ = ctx 14005 return c 14006} 14007 14008// Header returns an http.Header that can be modified by the caller to 14009// add HTTP headers to the request. 14010func (c *ProjectsRegionsWorkflowTemplatesGetCall) Header() http.Header { 14011 if c.header_ == nil { 14012 c.header_ = make(http.Header) 14013 } 14014 return c.header_ 14015} 14016 14017func (c *ProjectsRegionsWorkflowTemplatesGetCall) doRequest(alt string) (*http.Response, error) { 14018 reqHeaders := make(http.Header) 14019 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 14020 for k, v := range c.header_ { 14021 reqHeaders[k] = v 14022 } 14023 reqHeaders.Set("User-Agent", c.s.userAgent()) 14024 if c.ifNoneMatch_ != "" { 14025 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14026 } 14027 var body io.Reader = nil 14028 c.urlParams_.Set("alt", alt) 14029 c.urlParams_.Set("prettyPrint", "false") 14030 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 14031 urls += "?" + c.urlParams_.Encode() 14032 req, err := http.NewRequest("GET", urls, body) 14033 if err != nil { 14034 return nil, err 14035 } 14036 req.Header = reqHeaders 14037 googleapi.Expand(req.URL, map[string]string{ 14038 "name": c.name, 14039 }) 14040 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14041} 14042 14043// Do executes the "dataproc.projects.regions.workflowTemplates.get" call. 14044// Exactly one of *WorkflowTemplate or error will be non-nil. Any 14045// non-2xx status code is an error. Response headers are in either 14046// *WorkflowTemplate.ServerResponse.Header or (if a response was 14047// returned at all) in error.(*googleapi.Error).Header. Use 14048// googleapi.IsNotModified to check whether the returned error was 14049// because http.StatusNotModified was returned. 14050func (c *ProjectsRegionsWorkflowTemplatesGetCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 14051 gensupport.SetOptions(c.urlParams_, opts...) 14052 res, err := c.doRequest("json") 14053 if res != nil && res.StatusCode == http.StatusNotModified { 14054 if res.Body != nil { 14055 res.Body.Close() 14056 } 14057 return nil, &googleapi.Error{ 14058 Code: res.StatusCode, 14059 Header: res.Header, 14060 } 14061 } 14062 if err != nil { 14063 return nil, err 14064 } 14065 defer googleapi.CloseBody(res) 14066 if err := googleapi.CheckResponse(res); err != nil { 14067 return nil, err 14068 } 14069 ret := &WorkflowTemplate{ 14070 ServerResponse: googleapi.ServerResponse{ 14071 Header: res.Header, 14072 HTTPStatusCode: res.StatusCode, 14073 }, 14074 } 14075 target := &ret 14076 if err := gensupport.DecodeResponse(target, res); err != nil { 14077 return nil, err 14078 } 14079 return ret, nil 14080 // { 14081 // "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.", 14082 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}", 14083 // "httpMethod": "GET", 14084 // "id": "dataproc.projects.regions.workflowTemplates.get", 14085 // "parameterOrder": [ 14086 // "name" 14087 // ], 14088 // "parameters": { 14089 // "name": { 14090 // "description": "Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For projects.locations.workflowTemplates.get, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}", 14091 // "location": "path", 14092 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 14093 // "required": true, 14094 // "type": "string" 14095 // }, 14096 // "version": { 14097 // "description": "Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.If unspecified, retrieves the current version.", 14098 // "format": "int32", 14099 // "location": "query", 14100 // "type": "integer" 14101 // } 14102 // }, 14103 // "path": "v1/{+name}", 14104 // "response": { 14105 // "$ref": "WorkflowTemplate" 14106 // }, 14107 // "scopes": [ 14108 // "https://www.googleapis.com/auth/cloud-platform" 14109 // ] 14110 // } 14111 14112} 14113 14114// method id "dataproc.projects.regions.workflowTemplates.getIamPolicy": 14115 14116type ProjectsRegionsWorkflowTemplatesGetIamPolicyCall struct { 14117 s *Service 14118 resource string 14119 getiampolicyrequest *GetIamPolicyRequest 14120 urlParams_ gensupport.URLParams 14121 ctx_ context.Context 14122 header_ http.Header 14123} 14124 14125// GetIamPolicy: Gets the access control policy for a resource. Returns 14126// an empty policy if the resource exists and does not have a policy 14127// set. 14128// 14129// - resource: REQUIRED: The resource for which the policy is being 14130// requested. See the operation documentation for the appropriate 14131// value for this field. 14132func (r *ProjectsRegionsWorkflowTemplatesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall { 14133 c := &ProjectsRegionsWorkflowTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14134 c.resource = resource 14135 c.getiampolicyrequest = getiampolicyrequest 14136 return c 14137} 14138 14139// Fields allows partial responses to be retrieved. See 14140// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14141// for more information. 14142func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall { 14143 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14144 return c 14145} 14146 14147// Context sets the context to be used in this call's Do method. Any 14148// pending HTTP request will be aborted if the provided context is 14149// canceled. 14150func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall { 14151 c.ctx_ = ctx 14152 return c 14153} 14154 14155// Header returns an http.Header that can be modified by the caller to 14156// add HTTP headers to the request. 14157func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Header() http.Header { 14158 if c.header_ == nil { 14159 c.header_ = make(http.Header) 14160 } 14161 return c.header_ 14162} 14163 14164func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 14165 reqHeaders := make(http.Header) 14166 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 14167 for k, v := range c.header_ { 14168 reqHeaders[k] = v 14169 } 14170 reqHeaders.Set("User-Agent", c.s.userAgent()) 14171 var body io.Reader = nil 14172 body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest) 14173 if err != nil { 14174 return nil, err 14175 } 14176 reqHeaders.Set("Content-Type", "application/json") 14177 c.urlParams_.Set("alt", alt) 14178 c.urlParams_.Set("prettyPrint", "false") 14179 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy") 14180 urls += "?" + c.urlParams_.Encode() 14181 req, err := http.NewRequest("POST", urls, body) 14182 if err != nil { 14183 return nil, err 14184 } 14185 req.Header = reqHeaders 14186 googleapi.Expand(req.URL, map[string]string{ 14187 "resource": c.resource, 14188 }) 14189 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14190} 14191 14192// Do executes the "dataproc.projects.regions.workflowTemplates.getIamPolicy" call. 14193// Exactly one of *Policy or error will be non-nil. Any non-2xx status 14194// code is an error. Response headers are in either 14195// *Policy.ServerResponse.Header or (if a response was returned at all) 14196// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14197// check whether the returned error was because http.StatusNotModified 14198// was returned. 14199func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 14200 gensupport.SetOptions(c.urlParams_, opts...) 14201 res, err := c.doRequest("json") 14202 if res != nil && res.StatusCode == http.StatusNotModified { 14203 if res.Body != nil { 14204 res.Body.Close() 14205 } 14206 return nil, &googleapi.Error{ 14207 Code: res.StatusCode, 14208 Header: res.Header, 14209 } 14210 } 14211 if err != nil { 14212 return nil, err 14213 } 14214 defer googleapi.CloseBody(res) 14215 if err := googleapi.CheckResponse(res); err != nil { 14216 return nil, err 14217 } 14218 ret := &Policy{ 14219 ServerResponse: googleapi.ServerResponse{ 14220 Header: res.Header, 14221 HTTPStatusCode: res.StatusCode, 14222 }, 14223 } 14224 target := &ret 14225 if err := gensupport.DecodeResponse(target, res); err != nil { 14226 return nil, err 14227 } 14228 return ret, nil 14229 // { 14230 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 14231 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:getIamPolicy", 14232 // "httpMethod": "POST", 14233 // "id": "dataproc.projects.regions.workflowTemplates.getIamPolicy", 14234 // "parameterOrder": [ 14235 // "resource" 14236 // ], 14237 // "parameters": { 14238 // "resource": { 14239 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 14240 // "location": "path", 14241 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 14242 // "required": true, 14243 // "type": "string" 14244 // } 14245 // }, 14246 // "path": "v1/{+resource}:getIamPolicy", 14247 // "request": { 14248 // "$ref": "GetIamPolicyRequest" 14249 // }, 14250 // "response": { 14251 // "$ref": "Policy" 14252 // }, 14253 // "scopes": [ 14254 // "https://www.googleapis.com/auth/cloud-platform" 14255 // ] 14256 // } 14257 14258} 14259 14260// method id "dataproc.projects.regions.workflowTemplates.instantiate": 14261 14262type ProjectsRegionsWorkflowTemplatesInstantiateCall struct { 14263 s *Service 14264 name string 14265 instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest 14266 urlParams_ gensupport.URLParams 14267 ctx_ context.Context 14268 header_ http.Header 14269} 14270 14271// Instantiate: Instantiates a template and begins execution.The 14272// returned Operation can be used to track execution of workflow by 14273// polling operations.get. The Operation will complete when entire 14274// workflow is finished.The running workflow can be aborted via 14275// operations.cancel. This will cause any inflight jobs to be cancelled 14276// and workflow-owned clusters to be deleted.The Operation.metadata will 14277// be WorkflowMetadata 14278// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). 14279// Also see Using WorkflowMetadata 14280// (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On 14281// successful completion, Operation.response will be Empty. 14282// 14283// - name: The resource name of the workflow template, as described in 14284// https://cloud.google.com/apis/design/resource_names. For 14285// projects.regions.workflowTemplates.instantiate, the resource name 14286// of the template has the following format: 14287// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 14288// d} For projects.locations.workflowTemplates.instantiate, the 14289// resource name of the template has the following format: 14290// projects/{project_id}/locations/{location}/workflowTemplates/{templa 14291// te_id}. 14292func (r *ProjectsRegionsWorkflowTemplatesService) Instantiate(name string, instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest) *ProjectsRegionsWorkflowTemplatesInstantiateCall { 14293 c := &ProjectsRegionsWorkflowTemplatesInstantiateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14294 c.name = name 14295 c.instantiateworkflowtemplaterequest = instantiateworkflowtemplaterequest 14296 return c 14297} 14298 14299// Fields allows partial responses to be retrieved. See 14300// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14301// for more information. 14302func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesInstantiateCall { 14303 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14304 return c 14305} 14306 14307// Context sets the context to be used in this call's Do method. Any 14308// pending HTTP request will be aborted if the provided context is 14309// canceled. 14310func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesInstantiateCall { 14311 c.ctx_ = ctx 14312 return c 14313} 14314 14315// Header returns an http.Header that can be modified by the caller to 14316// add HTTP headers to the request. 14317func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Header() http.Header { 14318 if c.header_ == nil { 14319 c.header_ = make(http.Header) 14320 } 14321 return c.header_ 14322} 14323 14324func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) { 14325 reqHeaders := make(http.Header) 14326 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 14327 for k, v := range c.header_ { 14328 reqHeaders[k] = v 14329 } 14330 reqHeaders.Set("User-Agent", c.s.userAgent()) 14331 var body io.Reader = nil 14332 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest) 14333 if err != nil { 14334 return nil, err 14335 } 14336 reqHeaders.Set("Content-Type", "application/json") 14337 c.urlParams_.Set("alt", alt) 14338 c.urlParams_.Set("prettyPrint", "false") 14339 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:instantiate") 14340 urls += "?" + c.urlParams_.Encode() 14341 req, err := http.NewRequest("POST", urls, body) 14342 if err != nil { 14343 return nil, err 14344 } 14345 req.Header = reqHeaders 14346 googleapi.Expand(req.URL, map[string]string{ 14347 "name": c.name, 14348 }) 14349 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14350} 14351 14352// Do executes the "dataproc.projects.regions.workflowTemplates.instantiate" call. 14353// Exactly one of *Operation or error will be non-nil. Any non-2xx 14354// status code is an error. Response headers are in either 14355// *Operation.ServerResponse.Header or (if a response was returned at 14356// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14357// to check whether the returned error was because 14358// http.StatusNotModified was returned. 14359func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 14360 gensupport.SetOptions(c.urlParams_, opts...) 14361 res, err := c.doRequest("json") 14362 if res != nil && res.StatusCode == http.StatusNotModified { 14363 if res.Body != nil { 14364 res.Body.Close() 14365 } 14366 return nil, &googleapi.Error{ 14367 Code: res.StatusCode, 14368 Header: res.Header, 14369 } 14370 } 14371 if err != nil { 14372 return nil, err 14373 } 14374 defer googleapi.CloseBody(res) 14375 if err := googleapi.CheckResponse(res); err != nil { 14376 return nil, err 14377 } 14378 ret := &Operation{ 14379 ServerResponse: googleapi.ServerResponse{ 14380 Header: res.Header, 14381 HTTPStatusCode: res.StatusCode, 14382 }, 14383 } 14384 target := &ret 14385 if err := gensupport.DecodeResponse(target, res); err != nil { 14386 return nil, err 14387 } 14388 return ret, nil 14389 // { 14390 // "description": "Instantiates a template and begins execution.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty.", 14391 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:instantiate", 14392 // "httpMethod": "POST", 14393 // "id": "dataproc.projects.regions.workflowTemplates.instantiate", 14394 // "parameterOrder": [ 14395 // "name" 14396 // ], 14397 // "parameters": { 14398 // "name": { 14399 // "description": "Required. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For projects.locations.workflowTemplates.instantiate, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}", 14400 // "location": "path", 14401 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 14402 // "required": true, 14403 // "type": "string" 14404 // } 14405 // }, 14406 // "path": "v1/{+name}:instantiate", 14407 // "request": { 14408 // "$ref": "InstantiateWorkflowTemplateRequest" 14409 // }, 14410 // "response": { 14411 // "$ref": "Operation" 14412 // }, 14413 // "scopes": [ 14414 // "https://www.googleapis.com/auth/cloud-platform" 14415 // ] 14416 // } 14417 14418} 14419 14420// method id "dataproc.projects.regions.workflowTemplates.instantiateInline": 14421 14422type ProjectsRegionsWorkflowTemplatesInstantiateInlineCall struct { 14423 s *Service 14424 parent string 14425 workflowtemplate *WorkflowTemplate 14426 urlParams_ gensupport.URLParams 14427 ctx_ context.Context 14428 header_ http.Header 14429} 14430 14431// InstantiateInline: Instantiates a template and begins execution.This 14432// method is equivalent to executing the sequence 14433// CreateWorkflowTemplate, InstantiateWorkflowTemplate, 14434// DeleteWorkflowTemplate.The returned Operation can be used to track 14435// execution of workflow by polling operations.get. The Operation will 14436// complete when entire workflow is finished.The running workflow can be 14437// aborted via operations.cancel. This will cause any inflight jobs to 14438// be cancelled and workflow-owned clusters to be deleted.The 14439// Operation.metadata will be WorkflowMetadata 14440// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). 14441// Also see Using WorkflowMetadata 14442// (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On 14443// successful completion, Operation.response will be Empty. 14444// 14445// - parent: The resource name of the region or location, as described 14446// in https://cloud.google.com/apis/design/resource_names. For 14447// projects.regions.workflowTemplates,instantiateinline, the resource 14448// name of the region has the following format: 14449// projects/{project_id}/regions/{region} For 14450// projects.locations.workflowTemplates.instantiateinline, the 14451// resource name of the location has the following format: 14452// projects/{project_id}/locations/{location}. 14453func (r *ProjectsRegionsWorkflowTemplatesService) InstantiateInline(parent string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14454 c := &ProjectsRegionsWorkflowTemplatesInstantiateInlineCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14455 c.parent = parent 14456 c.workflowtemplate = workflowtemplate 14457 return c 14458} 14459 14460// RequestId sets the optional parameter "requestId": A tag that 14461// prevents multiple concurrent workflow instances with the same tag 14462// from running. This mitigates risk of concurrent instances started due 14463// to retries.It is recommended to always set this value to a UUID 14464// (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag 14465// must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 14466// and hyphens (-). The maximum length is 40 characters. 14467func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) RequestId(requestId string) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14468 c.urlParams_.Set("requestId", requestId) 14469 return c 14470} 14471 14472// Fields allows partial responses to be retrieved. See 14473// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14474// for more information. 14475func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14476 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14477 return c 14478} 14479 14480// Context sets the context to be used in this call's Do method. Any 14481// pending HTTP request will be aborted if the provided context is 14482// canceled. 14483func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14484 c.ctx_ = ctx 14485 return c 14486} 14487 14488// Header returns an http.Header that can be modified by the caller to 14489// add HTTP headers to the request. 14490func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Header() http.Header { 14491 if c.header_ == nil { 14492 c.header_ = make(http.Header) 14493 } 14494 return c.header_ 14495} 14496 14497func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) { 14498 reqHeaders := make(http.Header) 14499 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 14500 for k, v := range c.header_ { 14501 reqHeaders[k] = v 14502 } 14503 reqHeaders.Set("User-Agent", c.s.userAgent()) 14504 var body io.Reader = nil 14505 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 14506 if err != nil { 14507 return nil, err 14508 } 14509 reqHeaders.Set("Content-Type", "application/json") 14510 c.urlParams_.Set("alt", alt) 14511 c.urlParams_.Set("prettyPrint", "false") 14512 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates:instantiateInline") 14513 urls += "?" + c.urlParams_.Encode() 14514 req, err := http.NewRequest("POST", urls, body) 14515 if err != nil { 14516 return nil, err 14517 } 14518 req.Header = reqHeaders 14519 googleapi.Expand(req.URL, map[string]string{ 14520 "parent": c.parent, 14521 }) 14522 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14523} 14524 14525// Do executes the "dataproc.projects.regions.workflowTemplates.instantiateInline" call. 14526// Exactly one of *Operation or error will be non-nil. Any non-2xx 14527// status code is an error. Response headers are in either 14528// *Operation.ServerResponse.Header or (if a response was returned at 14529// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14530// to check whether the returned error was because 14531// http.StatusNotModified was returned. 14532func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 14533 gensupport.SetOptions(c.urlParams_, opts...) 14534 res, err := c.doRequest("json") 14535 if res != nil && res.StatusCode == http.StatusNotModified { 14536 if res.Body != nil { 14537 res.Body.Close() 14538 } 14539 return nil, &googleapi.Error{ 14540 Code: res.StatusCode, 14541 Header: res.Header, 14542 } 14543 } 14544 if err != nil { 14545 return nil, err 14546 } 14547 defer googleapi.CloseBody(res) 14548 if err := googleapi.CheckResponse(res); err != nil { 14549 return nil, err 14550 } 14551 ret := &Operation{ 14552 ServerResponse: googleapi.ServerResponse{ 14553 Header: res.Header, 14554 HTTPStatusCode: res.StatusCode, 14555 }, 14556 } 14557 target := &ret 14558 if err := gensupport.DecodeResponse(target, res); err != nil { 14559 return nil, err 14560 } 14561 return ret, nil 14562 // { 14563 // "description": "Instantiates a template and begins execution.This method is equivalent to executing the sequence CreateWorkflowTemplate, InstantiateWorkflowTemplate, DeleteWorkflowTemplate.The returned Operation can be used to track execution of workflow by polling operations.get. The Operation will complete when entire workflow is finished.The running workflow can be aborted via operations.cancel. This will cause any inflight jobs to be cancelled and workflow-owned clusters to be deleted.The Operation.metadata will be WorkflowMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty.", 14564 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates:instantiateInline", 14565 // "httpMethod": "POST", 14566 // "id": "dataproc.projects.regions.workflowTemplates.instantiateInline", 14567 // "parameterOrder": [ 14568 // "parent" 14569 // ], 14570 // "parameters": { 14571 // "parent": { 14572 // "description": "Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates,instantiateinline, the resource name of the region has the following format: projects/{project_id}/regions/{region} For projects.locations.workflowTemplates.instantiateinline, the resource name of the location has the following format: projects/{project_id}/locations/{location}", 14573 // "location": "path", 14574 // "pattern": "^projects/[^/]+/regions/[^/]+$", 14575 // "required": true, 14576 // "type": "string" 14577 // }, 14578 // "requestId": { 14579 // "description": "Optional. A tag that prevents multiple concurrent workflow instances with the same tag from running. This mitigates risk of concurrent instances started due to retries.It is recommended to always set this value to a UUID (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), and hyphens (-). The maximum length is 40 characters.", 14580 // "location": "query", 14581 // "type": "string" 14582 // } 14583 // }, 14584 // "path": "v1/{+parent}/workflowTemplates:instantiateInline", 14585 // "request": { 14586 // "$ref": "WorkflowTemplate" 14587 // }, 14588 // "response": { 14589 // "$ref": "Operation" 14590 // }, 14591 // "scopes": [ 14592 // "https://www.googleapis.com/auth/cloud-platform" 14593 // ] 14594 // } 14595 14596} 14597 14598// method id "dataproc.projects.regions.workflowTemplates.list": 14599 14600type ProjectsRegionsWorkflowTemplatesListCall struct { 14601 s *Service 14602 parent string 14603 urlParams_ gensupport.URLParams 14604 ifNoneMatch_ string 14605 ctx_ context.Context 14606 header_ http.Header 14607} 14608 14609// List: Lists workflows that match the specified filter in the request. 14610// 14611// - parent: The resource name of the region or location, as described 14612// in https://cloud.google.com/apis/design/resource_names. For 14613// projects.regions.workflowTemplates,list, the resource name of the 14614// region has the following format: 14615// projects/{project_id}/regions/{region} For 14616// projects.locations.workflowTemplates.list, the resource name of the 14617// location has the following format: 14618// projects/{project_id}/locations/{location}. 14619func (r *ProjectsRegionsWorkflowTemplatesService) List(parent string) *ProjectsRegionsWorkflowTemplatesListCall { 14620 c := &ProjectsRegionsWorkflowTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14621 c.parent = parent 14622 return c 14623} 14624 14625// PageSize sets the optional parameter "pageSize": The maximum number 14626// of results to return in each response. 14627func (c *ProjectsRegionsWorkflowTemplatesListCall) PageSize(pageSize int64) *ProjectsRegionsWorkflowTemplatesListCall { 14628 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 14629 return c 14630} 14631 14632// PageToken sets the optional parameter "pageToken": The page token, 14633// returned by a previous call, to request the next page of results. 14634func (c *ProjectsRegionsWorkflowTemplatesListCall) PageToken(pageToken string) *ProjectsRegionsWorkflowTemplatesListCall { 14635 c.urlParams_.Set("pageToken", pageToken) 14636 return c 14637} 14638 14639// Fields allows partial responses to be retrieved. See 14640// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14641// for more information. 14642func (c *ProjectsRegionsWorkflowTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesListCall { 14643 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14644 return c 14645} 14646 14647// IfNoneMatch sets the optional parameter which makes the operation 14648// fail if the object's ETag matches the given value. This is useful for 14649// getting updates only after the object has changed since the last 14650// request. Use googleapi.IsNotModified to check whether the response 14651// error from Do is the result of In-None-Match. 14652func (c *ProjectsRegionsWorkflowTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesListCall { 14653 c.ifNoneMatch_ = entityTag 14654 return c 14655} 14656 14657// Context sets the context to be used in this call's Do method. Any 14658// pending HTTP request will be aborted if the provided context is 14659// canceled. 14660func (c *ProjectsRegionsWorkflowTemplatesListCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesListCall { 14661 c.ctx_ = ctx 14662 return c 14663} 14664 14665// Header returns an http.Header that can be modified by the caller to 14666// add HTTP headers to the request. 14667func (c *ProjectsRegionsWorkflowTemplatesListCall) Header() http.Header { 14668 if c.header_ == nil { 14669 c.header_ = make(http.Header) 14670 } 14671 return c.header_ 14672} 14673 14674func (c *ProjectsRegionsWorkflowTemplatesListCall) doRequest(alt string) (*http.Response, error) { 14675 reqHeaders := make(http.Header) 14676 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 14677 for k, v := range c.header_ { 14678 reqHeaders[k] = v 14679 } 14680 reqHeaders.Set("User-Agent", c.s.userAgent()) 14681 if c.ifNoneMatch_ != "" { 14682 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14683 } 14684 var body io.Reader = nil 14685 c.urlParams_.Set("alt", alt) 14686 c.urlParams_.Set("prettyPrint", "false") 14687 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates") 14688 urls += "?" + c.urlParams_.Encode() 14689 req, err := http.NewRequest("GET", urls, body) 14690 if err != nil { 14691 return nil, err 14692 } 14693 req.Header = reqHeaders 14694 googleapi.Expand(req.URL, map[string]string{ 14695 "parent": c.parent, 14696 }) 14697 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14698} 14699 14700// Do executes the "dataproc.projects.regions.workflowTemplates.list" call. 14701// Exactly one of *ListWorkflowTemplatesResponse or error will be 14702// non-nil. Any non-2xx status code is an error. Response headers are in 14703// either *ListWorkflowTemplatesResponse.ServerResponse.Header or (if a 14704// response was returned at all) in error.(*googleapi.Error).Header. Use 14705// googleapi.IsNotModified to check whether the returned error was 14706// because http.StatusNotModified was returned. 14707func (c *ProjectsRegionsWorkflowTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowTemplatesResponse, error) { 14708 gensupport.SetOptions(c.urlParams_, opts...) 14709 res, err := c.doRequest("json") 14710 if res != nil && res.StatusCode == http.StatusNotModified { 14711 if res.Body != nil { 14712 res.Body.Close() 14713 } 14714 return nil, &googleapi.Error{ 14715 Code: res.StatusCode, 14716 Header: res.Header, 14717 } 14718 } 14719 if err != nil { 14720 return nil, err 14721 } 14722 defer googleapi.CloseBody(res) 14723 if err := googleapi.CheckResponse(res); err != nil { 14724 return nil, err 14725 } 14726 ret := &ListWorkflowTemplatesResponse{ 14727 ServerResponse: googleapi.ServerResponse{ 14728 Header: res.Header, 14729 HTTPStatusCode: res.StatusCode, 14730 }, 14731 } 14732 target := &ret 14733 if err := gensupport.DecodeResponse(target, res); err != nil { 14734 return nil, err 14735 } 14736 return ret, nil 14737 // { 14738 // "description": "Lists workflows that match the specified filter in the request.", 14739 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates", 14740 // "httpMethod": "GET", 14741 // "id": "dataproc.projects.regions.workflowTemplates.list", 14742 // "parameterOrder": [ 14743 // "parent" 14744 // ], 14745 // "parameters": { 14746 // "pageSize": { 14747 // "description": "Optional. The maximum number of results to return in each response.", 14748 // "format": "int32", 14749 // "location": "query", 14750 // "type": "integer" 14751 // }, 14752 // "pageToken": { 14753 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 14754 // "location": "query", 14755 // "type": "string" 14756 // }, 14757 // "parent": { 14758 // "description": "Required. The resource name of the region or location, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates,list, the resource name of the region has the following format: projects/{project_id}/regions/{region} For projects.locations.workflowTemplates.list, the resource name of the location has the following format: projects/{project_id}/locations/{location}", 14759 // "location": "path", 14760 // "pattern": "^projects/[^/]+/regions/[^/]+$", 14761 // "required": true, 14762 // "type": "string" 14763 // } 14764 // }, 14765 // "path": "v1/{+parent}/workflowTemplates", 14766 // "response": { 14767 // "$ref": "ListWorkflowTemplatesResponse" 14768 // }, 14769 // "scopes": [ 14770 // "https://www.googleapis.com/auth/cloud-platform" 14771 // ] 14772 // } 14773 14774} 14775 14776// Pages invokes f for each page of results. 14777// A non-nil error returned from f will halt the iteration. 14778// The provided context supersedes any context provided to the Context method. 14779func (c *ProjectsRegionsWorkflowTemplatesListCall) Pages(ctx context.Context, f func(*ListWorkflowTemplatesResponse) error) error { 14780 c.ctx_ = ctx 14781 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 14782 for { 14783 x, err := c.Do() 14784 if err != nil { 14785 return err 14786 } 14787 if err := f(x); err != nil { 14788 return err 14789 } 14790 if x.NextPageToken == "" { 14791 return nil 14792 } 14793 c.PageToken(x.NextPageToken) 14794 } 14795} 14796 14797// method id "dataproc.projects.regions.workflowTemplates.setIamPolicy": 14798 14799type ProjectsRegionsWorkflowTemplatesSetIamPolicyCall struct { 14800 s *Service 14801 resource string 14802 setiampolicyrequest *SetIamPolicyRequest 14803 urlParams_ gensupport.URLParams 14804 ctx_ context.Context 14805 header_ http.Header 14806} 14807 14808// SetIamPolicy: Sets the access control policy on the specified 14809// resource. Replaces any existing policy.Can return NOT_FOUND, 14810// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 14811// 14812// - resource: REQUIRED: The resource for which the policy is being 14813// specified. See the operation documentation for the appropriate 14814// value for this field. 14815func (r *ProjectsRegionsWorkflowTemplatesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall { 14816 c := &ProjectsRegionsWorkflowTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14817 c.resource = resource 14818 c.setiampolicyrequest = setiampolicyrequest 14819 return c 14820} 14821 14822// Fields allows partial responses to be retrieved. See 14823// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14824// for more information. 14825func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall { 14826 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14827 return c 14828} 14829 14830// Context sets the context to be used in this call's Do method. Any 14831// pending HTTP request will be aborted if the provided context is 14832// canceled. 14833func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall { 14834 c.ctx_ = ctx 14835 return c 14836} 14837 14838// Header returns an http.Header that can be modified by the caller to 14839// add HTTP headers to the request. 14840func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Header() http.Header { 14841 if c.header_ == nil { 14842 c.header_ = make(http.Header) 14843 } 14844 return c.header_ 14845} 14846 14847func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 14848 reqHeaders := make(http.Header) 14849 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 14850 for k, v := range c.header_ { 14851 reqHeaders[k] = v 14852 } 14853 reqHeaders.Set("User-Agent", c.s.userAgent()) 14854 var body io.Reader = nil 14855 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 14856 if err != nil { 14857 return nil, err 14858 } 14859 reqHeaders.Set("Content-Type", "application/json") 14860 c.urlParams_.Set("alt", alt) 14861 c.urlParams_.Set("prettyPrint", "false") 14862 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy") 14863 urls += "?" + c.urlParams_.Encode() 14864 req, err := http.NewRequest("POST", urls, body) 14865 if err != nil { 14866 return nil, err 14867 } 14868 req.Header = reqHeaders 14869 googleapi.Expand(req.URL, map[string]string{ 14870 "resource": c.resource, 14871 }) 14872 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14873} 14874 14875// Do executes the "dataproc.projects.regions.workflowTemplates.setIamPolicy" call. 14876// Exactly one of *Policy or error will be non-nil. Any non-2xx status 14877// code is an error. Response headers are in either 14878// *Policy.ServerResponse.Header or (if a response was returned at all) 14879// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14880// check whether the returned error was because http.StatusNotModified 14881// was returned. 14882func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 14883 gensupport.SetOptions(c.urlParams_, opts...) 14884 res, err := c.doRequest("json") 14885 if res != nil && res.StatusCode == http.StatusNotModified { 14886 if res.Body != nil { 14887 res.Body.Close() 14888 } 14889 return nil, &googleapi.Error{ 14890 Code: res.StatusCode, 14891 Header: res.Header, 14892 } 14893 } 14894 if err != nil { 14895 return nil, err 14896 } 14897 defer googleapi.CloseBody(res) 14898 if err := googleapi.CheckResponse(res); err != nil { 14899 return nil, err 14900 } 14901 ret := &Policy{ 14902 ServerResponse: googleapi.ServerResponse{ 14903 Header: res.Header, 14904 HTTPStatusCode: res.StatusCode, 14905 }, 14906 } 14907 target := &ret 14908 if err := gensupport.DecodeResponse(target, res); err != nil { 14909 return nil, err 14910 } 14911 return ret, nil 14912 // { 14913 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 14914 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:setIamPolicy", 14915 // "httpMethod": "POST", 14916 // "id": "dataproc.projects.regions.workflowTemplates.setIamPolicy", 14917 // "parameterOrder": [ 14918 // "resource" 14919 // ], 14920 // "parameters": { 14921 // "resource": { 14922 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 14923 // "location": "path", 14924 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 14925 // "required": true, 14926 // "type": "string" 14927 // } 14928 // }, 14929 // "path": "v1/{+resource}:setIamPolicy", 14930 // "request": { 14931 // "$ref": "SetIamPolicyRequest" 14932 // }, 14933 // "response": { 14934 // "$ref": "Policy" 14935 // }, 14936 // "scopes": [ 14937 // "https://www.googleapis.com/auth/cloud-platform" 14938 // ] 14939 // } 14940 14941} 14942 14943// method id "dataproc.projects.regions.workflowTemplates.testIamPermissions": 14944 14945type ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall struct { 14946 s *Service 14947 resource string 14948 testiampermissionsrequest *TestIamPermissionsRequest 14949 urlParams_ gensupport.URLParams 14950 ctx_ context.Context 14951 header_ http.Header 14952} 14953 14954// TestIamPermissions: Returns permissions that a caller has on the 14955// specified resource. If the resource does not exist, this will return 14956// an empty set of permissions, not a NOT_FOUND error.Note: This 14957// operation is designed to be used for building permission-aware UIs 14958// and command-line tools, not for authorization checking. This 14959// operation may "fail open" without warning. 14960// 14961// - resource: REQUIRED: The resource for which the policy detail is 14962// being requested. See the operation documentation for the 14963// appropriate value for this field. 14964func (r *ProjectsRegionsWorkflowTemplatesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall { 14965 c := &ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14966 c.resource = resource 14967 c.testiampermissionsrequest = testiampermissionsrequest 14968 return c 14969} 14970 14971// Fields allows partial responses to be retrieved. See 14972// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14973// for more information. 14974func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall { 14975 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14976 return c 14977} 14978 14979// Context sets the context to be used in this call's Do method. Any 14980// pending HTTP request will be aborted if the provided context is 14981// canceled. 14982func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall { 14983 c.ctx_ = ctx 14984 return c 14985} 14986 14987// Header returns an http.Header that can be modified by the caller to 14988// add HTTP headers to the request. 14989func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Header() http.Header { 14990 if c.header_ == nil { 14991 c.header_ = make(http.Header) 14992 } 14993 return c.header_ 14994} 14995 14996func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 14997 reqHeaders := make(http.Header) 14998 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 14999 for k, v := range c.header_ { 15000 reqHeaders[k] = v 15001 } 15002 reqHeaders.Set("User-Agent", c.s.userAgent()) 15003 var body io.Reader = nil 15004 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 15005 if err != nil { 15006 return nil, err 15007 } 15008 reqHeaders.Set("Content-Type", "application/json") 15009 c.urlParams_.Set("alt", alt) 15010 c.urlParams_.Set("prettyPrint", "false") 15011 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions") 15012 urls += "?" + c.urlParams_.Encode() 15013 req, err := http.NewRequest("POST", urls, body) 15014 if err != nil { 15015 return nil, err 15016 } 15017 req.Header = reqHeaders 15018 googleapi.Expand(req.URL, map[string]string{ 15019 "resource": c.resource, 15020 }) 15021 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15022} 15023 15024// Do executes the "dataproc.projects.regions.workflowTemplates.testIamPermissions" call. 15025// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 15026// Any non-2xx status code is an error. Response headers are in either 15027// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 15028// was returned at all) in error.(*googleapi.Error).Header. Use 15029// googleapi.IsNotModified to check whether the returned error was 15030// because http.StatusNotModified was returned. 15031func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 15032 gensupport.SetOptions(c.urlParams_, opts...) 15033 res, err := c.doRequest("json") 15034 if res != nil && res.StatusCode == http.StatusNotModified { 15035 if res.Body != nil { 15036 res.Body.Close() 15037 } 15038 return nil, &googleapi.Error{ 15039 Code: res.StatusCode, 15040 Header: res.Header, 15041 } 15042 } 15043 if err != nil { 15044 return nil, err 15045 } 15046 defer googleapi.CloseBody(res) 15047 if err := googleapi.CheckResponse(res); err != nil { 15048 return nil, err 15049 } 15050 ret := &TestIamPermissionsResponse{ 15051 ServerResponse: googleapi.ServerResponse{ 15052 Header: res.Header, 15053 HTTPStatusCode: res.StatusCode, 15054 }, 15055 } 15056 target := &ret 15057 if err := gensupport.DecodeResponse(target, res); err != nil { 15058 return nil, err 15059 } 15060 return ret, nil 15061 // { 15062 // "description": "Returns permissions that a caller has on the specified resource. If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error.Note: This operation is designed to be used for building permission-aware UIs and command-line tools, not for authorization checking. This operation may \"fail open\" without warning.", 15063 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:testIamPermissions", 15064 // "httpMethod": "POST", 15065 // "id": "dataproc.projects.regions.workflowTemplates.testIamPermissions", 15066 // "parameterOrder": [ 15067 // "resource" 15068 // ], 15069 // "parameters": { 15070 // "resource": { 15071 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 15072 // "location": "path", 15073 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 15074 // "required": true, 15075 // "type": "string" 15076 // } 15077 // }, 15078 // "path": "v1/{+resource}:testIamPermissions", 15079 // "request": { 15080 // "$ref": "TestIamPermissionsRequest" 15081 // }, 15082 // "response": { 15083 // "$ref": "TestIamPermissionsResponse" 15084 // }, 15085 // "scopes": [ 15086 // "https://www.googleapis.com/auth/cloud-platform" 15087 // ] 15088 // } 15089 15090} 15091 15092// method id "dataproc.projects.regions.workflowTemplates.update": 15093 15094type ProjectsRegionsWorkflowTemplatesUpdateCall struct { 15095 s *Service 15096 name string 15097 workflowtemplate *WorkflowTemplate 15098 urlParams_ gensupport.URLParams 15099 ctx_ context.Context 15100 header_ http.Header 15101} 15102 15103// Update: Updates (replaces) workflow template. The updated template 15104// must contain version that matches the current server version. 15105// 15106// - name: Output only. The resource name of the workflow template, as 15107// described in https://cloud.google.com/apis/design/resource_names. 15108// For projects.regions.workflowTemplates, the resource name of the 15109// template has the following format: 15110// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 15111// d} For projects.locations.workflowTemplates, the resource name of 15112// the template has the following format: 15113// projects/{project_id}/locations/{location}/workflowTemplates/{templa 15114// te_id}. 15115func (r *ProjectsRegionsWorkflowTemplatesService) Update(name string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesUpdateCall { 15116 c := &ProjectsRegionsWorkflowTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 15117 c.name = name 15118 c.workflowtemplate = workflowtemplate 15119 return c 15120} 15121 15122// Fields allows partial responses to be retrieved. See 15123// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15124// for more information. 15125func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesUpdateCall { 15126 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15127 return c 15128} 15129 15130// Context sets the context to be used in this call's Do method. Any 15131// pending HTTP request will be aborted if the provided context is 15132// canceled. 15133func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesUpdateCall { 15134 c.ctx_ = ctx 15135 return c 15136} 15137 15138// Header returns an http.Header that can be modified by the caller to 15139// add HTTP headers to the request. 15140func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Header() http.Header { 15141 if c.header_ == nil { 15142 c.header_ = make(http.Header) 15143 } 15144 return c.header_ 15145} 15146 15147func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) { 15148 reqHeaders := make(http.Header) 15149 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210804") 15150 for k, v := range c.header_ { 15151 reqHeaders[k] = v 15152 } 15153 reqHeaders.Set("User-Agent", c.s.userAgent()) 15154 var body io.Reader = nil 15155 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 15156 if err != nil { 15157 return nil, err 15158 } 15159 reqHeaders.Set("Content-Type", "application/json") 15160 c.urlParams_.Set("alt", alt) 15161 c.urlParams_.Set("prettyPrint", "false") 15162 urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}") 15163 urls += "?" + c.urlParams_.Encode() 15164 req, err := http.NewRequest("PUT", urls, body) 15165 if err != nil { 15166 return nil, err 15167 } 15168 req.Header = reqHeaders 15169 googleapi.Expand(req.URL, map[string]string{ 15170 "name": c.name, 15171 }) 15172 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15173} 15174 15175// Do executes the "dataproc.projects.regions.workflowTemplates.update" call. 15176// Exactly one of *WorkflowTemplate or error will be non-nil. Any 15177// non-2xx status code is an error. Response headers are in either 15178// *WorkflowTemplate.ServerResponse.Header or (if a response was 15179// returned at all) in error.(*googleapi.Error).Header. Use 15180// googleapi.IsNotModified to check whether the returned error was 15181// because http.StatusNotModified was returned. 15182func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 15183 gensupport.SetOptions(c.urlParams_, opts...) 15184 res, err := c.doRequest("json") 15185 if res != nil && res.StatusCode == http.StatusNotModified { 15186 if res.Body != nil { 15187 res.Body.Close() 15188 } 15189 return nil, &googleapi.Error{ 15190 Code: res.StatusCode, 15191 Header: res.Header, 15192 } 15193 } 15194 if err != nil { 15195 return nil, err 15196 } 15197 defer googleapi.CloseBody(res) 15198 if err := googleapi.CheckResponse(res); err != nil { 15199 return nil, err 15200 } 15201 ret := &WorkflowTemplate{ 15202 ServerResponse: googleapi.ServerResponse{ 15203 Header: res.Header, 15204 HTTPStatusCode: res.StatusCode, 15205 }, 15206 } 15207 target := &ret 15208 if err := gensupport.DecodeResponse(target, res); err != nil { 15209 return nil, err 15210 } 15211 return ret, nil 15212 // { 15213 // "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version.", 15214 // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}", 15215 // "httpMethod": "PUT", 15216 // "id": "dataproc.projects.regions.workflowTemplates.update", 15217 // "parameterOrder": [ 15218 // "name" 15219 // ], 15220 // "parameters": { 15221 // "name": { 15222 // "description": "Output only. The resource name of the workflow template, as described in https://cloud.google.com/apis/design/resource_names. For projects.regions.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/regions/{region}/workflowTemplates/{template_id} For projects.locations.workflowTemplates, the resource name of the template has the following format: projects/{project_id}/locations/{location}/workflowTemplates/{template_id}", 15223 // "location": "path", 15224 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 15225 // "required": true, 15226 // "type": "string" 15227 // } 15228 // }, 15229 // "path": "v1/{+name}", 15230 // "request": { 15231 // "$ref": "WorkflowTemplate" 15232 // }, 15233 // "response": { 15234 // "$ref": "WorkflowTemplate" 15235 // }, 15236 // "scopes": [ 15237 // "https://www.googleapis.com/auth/cloud-platform" 15238 // ] 15239 // } 15240 15241} 15242