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/v1beta2" 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/v1beta2" 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:v1beta2" 77const apiName = "dataproc" 78const apiVersion = "v1beta2" 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 Platform data 85 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 86) 87 88// NewService creates a new Service. 89func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 90 scopesOption := option.WithScopes( 91 "https://www.googleapis.com/auth/cloud-platform", 92 ) 93 // NOTE: prepend, so we don't override user-specified scopes. 94 opts = append([]option.ClientOption{scopesOption}, opts...) 95 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 96 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 97 client, endpoint, err := htransport.NewClient(ctx, opts...) 98 if err != nil { 99 return nil, err 100 } 101 s, err := New(client) 102 if err != nil { 103 return nil, err 104 } 105 if endpoint != "" { 106 s.BasePath = endpoint 107 } 108 return s, nil 109} 110 111// New creates a new Service. It uses the provided http.Client for requests. 112// 113// Deprecated: please use NewService instead. 114// To provide a custom HTTP client, use option.WithHTTPClient. 115// If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 116func New(client *http.Client) (*Service, error) { 117 if client == nil { 118 return nil, errors.New("client is nil") 119 } 120 s := &Service{client: client, BasePath: basePath} 121 s.Projects = NewProjectsService(s) 122 return s, nil 123} 124 125type Service struct { 126 client *http.Client 127 BasePath string // API endpoint base URL 128 UserAgent string // optional additional User-Agent fragment 129 130 Projects *ProjectsService 131} 132 133func (s *Service) userAgent() string { 134 if s.UserAgent == "" { 135 return googleapi.UserAgent 136 } 137 return googleapi.UserAgent + " " + s.UserAgent 138} 139 140func NewProjectsService(s *Service) *ProjectsService { 141 rs := &ProjectsService{s: s} 142 rs.Locations = NewProjectsLocationsService(s) 143 rs.Regions = NewProjectsRegionsService(s) 144 return rs 145} 146 147type ProjectsService struct { 148 s *Service 149 150 Locations *ProjectsLocationsService 151 152 Regions *ProjectsRegionsService 153} 154 155func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 156 rs := &ProjectsLocationsService{s: s} 157 rs.AutoscalingPolicies = NewProjectsLocationsAutoscalingPoliciesService(s) 158 rs.WorkflowTemplates = NewProjectsLocationsWorkflowTemplatesService(s) 159 return rs 160} 161 162type ProjectsLocationsService struct { 163 s *Service 164 165 AutoscalingPolicies *ProjectsLocationsAutoscalingPoliciesService 166 167 WorkflowTemplates *ProjectsLocationsWorkflowTemplatesService 168} 169 170func NewProjectsLocationsAutoscalingPoliciesService(s *Service) *ProjectsLocationsAutoscalingPoliciesService { 171 rs := &ProjectsLocationsAutoscalingPoliciesService{s: s} 172 return rs 173} 174 175type ProjectsLocationsAutoscalingPoliciesService struct { 176 s *Service 177} 178 179func NewProjectsLocationsWorkflowTemplatesService(s *Service) *ProjectsLocationsWorkflowTemplatesService { 180 rs := &ProjectsLocationsWorkflowTemplatesService{s: s} 181 return rs 182} 183 184type ProjectsLocationsWorkflowTemplatesService struct { 185 s *Service 186} 187 188func NewProjectsRegionsService(s *Service) *ProjectsRegionsService { 189 rs := &ProjectsRegionsService{s: s} 190 rs.AutoscalingPolicies = NewProjectsRegionsAutoscalingPoliciesService(s) 191 rs.Clusters = NewProjectsRegionsClustersService(s) 192 rs.Jobs = NewProjectsRegionsJobsService(s) 193 rs.Operations = NewProjectsRegionsOperationsService(s) 194 rs.WorkflowTemplates = NewProjectsRegionsWorkflowTemplatesService(s) 195 return rs 196} 197 198type ProjectsRegionsService struct { 199 s *Service 200 201 AutoscalingPolicies *ProjectsRegionsAutoscalingPoliciesService 202 203 Clusters *ProjectsRegionsClustersService 204 205 Jobs *ProjectsRegionsJobsService 206 207 Operations *ProjectsRegionsOperationsService 208 209 WorkflowTemplates *ProjectsRegionsWorkflowTemplatesService 210} 211 212func NewProjectsRegionsAutoscalingPoliciesService(s *Service) *ProjectsRegionsAutoscalingPoliciesService { 213 rs := &ProjectsRegionsAutoscalingPoliciesService{s: s} 214 return rs 215} 216 217type ProjectsRegionsAutoscalingPoliciesService struct { 218 s *Service 219} 220 221func NewProjectsRegionsClustersService(s *Service) *ProjectsRegionsClustersService { 222 rs := &ProjectsRegionsClustersService{s: s} 223 return rs 224} 225 226type ProjectsRegionsClustersService struct { 227 s *Service 228} 229 230func NewProjectsRegionsJobsService(s *Service) *ProjectsRegionsJobsService { 231 rs := &ProjectsRegionsJobsService{s: s} 232 return rs 233} 234 235type ProjectsRegionsJobsService struct { 236 s *Service 237} 238 239func NewProjectsRegionsOperationsService(s *Service) *ProjectsRegionsOperationsService { 240 rs := &ProjectsRegionsOperationsService{s: s} 241 return rs 242} 243 244type ProjectsRegionsOperationsService struct { 245 s *Service 246} 247 248func NewProjectsRegionsWorkflowTemplatesService(s *Service) *ProjectsRegionsWorkflowTemplatesService { 249 rs := &ProjectsRegionsWorkflowTemplatesService{s: s} 250 return rs 251} 252 253type ProjectsRegionsWorkflowTemplatesService struct { 254 s *Service 255} 256 257// AcceleratorConfig: Specifies the type and number of accelerator cards 258// attached to the instances of an instance group (see GPUs on Compute 259// Engine (https://cloud.google.com/compute/docs/gpus/)). 260type AcceleratorConfig struct { 261 // AcceleratorCount: The number of the accelerator cards of this type 262 // exposed to this instance. 263 AcceleratorCount int64 `json:"acceleratorCount,omitempty"` 264 265 // AcceleratorTypeUri: Full URL, partial URI, or short name of the 266 // accelerator type resource to expose to this instance. See Compute 267 // Engine AcceleratorTypes 268 // (https://cloud.google.com/compute/docs/reference/beta/acceleratorTypes)Examples 269 // * 270 // https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 271 // * 272 // projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k 273 // 80 * nvidia-tesla-k80Auto Zone Exception: If you are using the 274 // Dataproc Auto Zone Placement 275 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) 276 // feature, you must use the short name of the accelerator type 277 // resource, for example, nvidia-tesla-k80. 278 AcceleratorTypeUri string `json:"acceleratorTypeUri,omitempty"` 279 280 // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to 281 // unconditionally include in API requests. By default, fields with 282 // empty values are omitted from API requests. However, any non-pointer, 283 // non-interface field appearing in ForceSendFields will be sent to the 284 // server regardless of whether the field is empty or not. This may be 285 // used to include empty fields in Patch requests. 286 ForceSendFields []string `json:"-"` 287 288 // NullFields is a list of field names (e.g. "AcceleratorCount") to 289 // include in API requests with the JSON null value. By default, fields 290 // with empty values are omitted from API requests. However, any field 291 // with an empty value appearing in NullFields will be sent to the 292 // server as null. It is an error if a field in this list has a 293 // non-empty value. This may be used to include null fields in Patch 294 // requests. 295 NullFields []string `json:"-"` 296} 297 298func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) { 299 type NoMethod AcceleratorConfig 300 raw := NoMethod(*s) 301 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 302} 303 304// AutoscalingConfig: Autoscaling Policy config associated with the 305// cluster. 306type AutoscalingConfig struct { 307 // PolicyUri: Optional. The autoscaling policy used by the cluster.Only 308 // resource names including projectid and location (region) are valid. 309 // Examples: 310 // https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id] 311 // projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/ 312 // [policy_id]Note that the policy must be in the same project and 313 // Dataproc region. 314 PolicyUri string `json:"policyUri,omitempty"` 315 316 // ForceSendFields is a list of field names (e.g. "PolicyUri") to 317 // unconditionally include in API requests. By default, fields with 318 // empty values are omitted from API requests. However, any non-pointer, 319 // non-interface field appearing in ForceSendFields will be sent to the 320 // server regardless of whether the field is empty or not. This may be 321 // used to include empty fields in Patch requests. 322 ForceSendFields []string `json:"-"` 323 324 // NullFields is a list of field names (e.g. "PolicyUri") to include in 325 // API requests with the JSON null value. By default, fields with empty 326 // values are omitted from API requests. However, any field with an 327 // empty value appearing in NullFields will be sent to the server as 328 // null. It is an error if a field in this list has a non-empty value. 329 // This may be used to include null fields in Patch requests. 330 NullFields []string `json:"-"` 331} 332 333func (s *AutoscalingConfig) MarshalJSON() ([]byte, error) { 334 type NoMethod AutoscalingConfig 335 raw := NoMethod(*s) 336 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 337} 338 339// AutoscalingPolicy: Describes an autoscaling policy for Dataproc 340// cluster autoscaler. 341type AutoscalingPolicy struct { 342 BasicAlgorithm *BasicAutoscalingAlgorithm `json:"basicAlgorithm,omitempty"` 343 344 // Id: Required. The policy id.The id must contain only letters (a-z, 345 // A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin 346 // or end with underscore or hyphen. Must consist of between 3 and 50 347 // characters. 348 Id string `json:"id,omitempty"` 349 350 // Name: Output only. The "resource name" of the autoscaling policy, as 351 // described in https://cloud.google.com/apis/design/resource_names. For 352 // projects.regions.autoscalingPolicies, the resource name of the policy 353 // has the following format: 354 // projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} 355 // For projects.locations.autoscalingPolicies, the resource name of the 356 // policy has the following format: 357 // projects/{project_id}/locations/{location}/autoscalingPolicies/{policy 358 // _id} 359 Name string `json:"name,omitempty"` 360 361 // SecondaryWorkerConfig: Optional. Describes how the autoscaler will 362 // operate for secondary workers. 363 SecondaryWorkerConfig *InstanceGroupAutoscalingPolicyConfig `json:"secondaryWorkerConfig,omitempty"` 364 365 // WorkerConfig: Required. Describes how the autoscaler will operate for 366 // primary workers. 367 WorkerConfig *InstanceGroupAutoscalingPolicyConfig `json:"workerConfig,omitempty"` 368 369 // ServerResponse contains the HTTP response code and headers from the 370 // server. 371 googleapi.ServerResponse `json:"-"` 372 373 // ForceSendFields is a list of field names (e.g. "BasicAlgorithm") to 374 // unconditionally include in API requests. By default, fields with 375 // empty values are omitted from API requests. However, any non-pointer, 376 // non-interface field appearing in ForceSendFields will be sent to the 377 // server regardless of whether the field is empty or not. This may be 378 // used to include empty fields in Patch requests. 379 ForceSendFields []string `json:"-"` 380 381 // NullFields is a list of field names (e.g. "BasicAlgorithm") to 382 // include in API requests with the JSON null value. By default, fields 383 // with empty values are omitted from API requests. However, any field 384 // with an empty value appearing in NullFields will be sent to the 385 // server as null. It is an error if a field in this list has a 386 // non-empty value. This may be used to include null fields in Patch 387 // requests. 388 NullFields []string `json:"-"` 389} 390 391func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) { 392 type NoMethod AutoscalingPolicy 393 raw := NoMethod(*s) 394 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 395} 396 397// BasicAutoscalingAlgorithm: Basic algorithm for autoscaling. 398type BasicAutoscalingAlgorithm struct { 399 // CooldownPeriod: Optional. Duration between scaling events. A scaling 400 // period starts after the update operation from the previous event has 401 // completed.Bounds: 2m, 1d. Default: 2m. 402 CooldownPeriod string `json:"cooldownPeriod,omitempty"` 403 404 // YarnConfig: Required. YARN autoscaling configuration. 405 YarnConfig *BasicYarnAutoscalingConfig `json:"yarnConfig,omitempty"` 406 407 // ForceSendFields is a list of field names (e.g. "CooldownPeriod") to 408 // unconditionally include in API requests. By default, fields with 409 // empty values are omitted from API requests. However, any non-pointer, 410 // non-interface field appearing in ForceSendFields will be sent to the 411 // server regardless of whether the field is empty or not. This may be 412 // used to include empty fields in Patch requests. 413 ForceSendFields []string `json:"-"` 414 415 // NullFields is a list of field names (e.g. "CooldownPeriod") to 416 // include in API requests with the JSON null value. By default, fields 417 // with empty values are omitted from API requests. However, any field 418 // with an empty value appearing in NullFields will be sent to the 419 // server as null. It is an error if a field in this list has a 420 // non-empty value. This may be used to include null fields in Patch 421 // requests. 422 NullFields []string `json:"-"` 423} 424 425func (s *BasicAutoscalingAlgorithm) MarshalJSON() ([]byte, error) { 426 type NoMethod BasicAutoscalingAlgorithm 427 raw := NoMethod(*s) 428 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 429} 430 431// BasicYarnAutoscalingConfig: Basic autoscaling configurations for 432// YARN. 433type BasicYarnAutoscalingConfig struct { 434 // GracefulDecommissionTimeout: Required. Timeout for YARN graceful 435 // decommissioning of Node Managers. Specifies the duration to wait for 436 // jobs to complete before forcefully removing workers (and potentially 437 // interrupting jobs). Only applicable to downscaling operations.Bounds: 438 // 0s, 1d. 439 GracefulDecommissionTimeout string `json:"gracefulDecommissionTimeout,omitempty"` 440 441 // ScaleDownFactor: Required. Fraction of average YARN pending memory in 442 // the last cooldown period for which to remove workers. A scale-down 443 // factor of 1 will result in scaling down so that there is no available 444 // memory remaining after the update (more aggressive scaling). A 445 // scale-down factor of 0 disables removing workers, which can be 446 // beneficial for autoscaling a single job. See 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 for more 464 // information.Bounds: 0.0, 1.0. 465 ScaleUpFactor float64 `json:"scaleUpFactor,omitempty"` 466 467 // ScaleUpMinWorkerFraction: Optional. Minimum scale-up threshold as a 468 // fraction of total cluster size before scaling occurs. For example, in 469 // a 20-worker cluster, a threshold of 0.1 means the autoscaler must 470 // recommend at least a 2-worker scale-up for the cluster to scale. A 471 // threshold of 0 means the autoscaler will scale up on any recommended 472 // change.Bounds: 0.0, 1.0. Default: 0.0. 473 ScaleUpMinWorkerFraction float64 `json:"scaleUpMinWorkerFraction,omitempty"` 474 475 // ForceSendFields is a list of field names (e.g. 476 // "GracefulDecommissionTimeout") to unconditionally include in API 477 // requests. By default, fields with empty values are omitted from API 478 // requests. However, any non-pointer, non-interface field appearing in 479 // ForceSendFields will be sent to the server regardless of whether the 480 // field is empty or not. This may be used to include empty fields in 481 // Patch requests. 482 ForceSendFields []string `json:"-"` 483 484 // NullFields is a list of field names (e.g. 485 // "GracefulDecommissionTimeout") to include in API requests with the 486 // JSON null value. By default, fields with empty values are omitted 487 // from API requests. However, any field with an empty value appearing 488 // in NullFields will be sent to the server as null. It is an error if a 489 // field in this list has a non-empty value. This may be used to include 490 // null fields in Patch requests. 491 NullFields []string `json:"-"` 492} 493 494func (s *BasicYarnAutoscalingConfig) MarshalJSON() ([]byte, error) { 495 type NoMethod BasicYarnAutoscalingConfig 496 raw := NoMethod(*s) 497 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 498} 499 500func (s *BasicYarnAutoscalingConfig) UnmarshalJSON(data []byte) error { 501 type NoMethod BasicYarnAutoscalingConfig 502 var s1 struct { 503 ScaleDownFactor gensupport.JSONFloat64 `json:"scaleDownFactor"` 504 ScaleDownMinWorkerFraction gensupport.JSONFloat64 `json:"scaleDownMinWorkerFraction"` 505 ScaleUpFactor gensupport.JSONFloat64 `json:"scaleUpFactor"` 506 ScaleUpMinWorkerFraction gensupport.JSONFloat64 `json:"scaleUpMinWorkerFraction"` 507 *NoMethod 508 } 509 s1.NoMethod = (*NoMethod)(s) 510 if err := json.Unmarshal(data, &s1); err != nil { 511 return err 512 } 513 s.ScaleDownFactor = float64(s1.ScaleDownFactor) 514 s.ScaleDownMinWorkerFraction = float64(s1.ScaleDownMinWorkerFraction) 515 s.ScaleUpFactor = float64(s1.ScaleUpFactor) 516 s.ScaleUpMinWorkerFraction = float64(s1.ScaleUpMinWorkerFraction) 517 return nil 518} 519 520// Binding: Associates members with a role. 521type Binding struct { 522 // Condition: The condition that is associated with this binding.If the 523 // condition evaluates to true, then this binding applies to the current 524 // request.If the condition evaluates to false, then this binding does 525 // not apply to the current request. However, a different role binding 526 // might grant the same role to one or more of the members in this 527 // binding.To learn which resources support conditions in their IAM 528 // policies, see the IAM documentation 529 // (https://cloud.google.com/iam/help/conditions/resource-policies). 530 Condition *Expr `json:"condition,omitempty"` 531 532 // Members: Specifies the identities requesting access for a Cloud 533 // Platform resource. members can have the following values: allUsers: A 534 // special identifier that represents anyone who is on the internet; 535 // with or without a Google account. allAuthenticatedUsers: A special 536 // identifier that represents anyone who is authenticated with a Google 537 // account or a service account. user:{emailid}: An email address that 538 // represents a specific Google account. For example, alice@example.com 539 // . serviceAccount:{emailid}: An email address that represents a 540 // service account. For example, 541 // my-other-app@appspot.gserviceaccount.com. group:{emailid}: An email 542 // address that represents a Google group. For example, 543 // admins@example.com. deleted:user:{emailid}?uid={uniqueid}: An email 544 // address (plus unique identifier) representing a user that has been 545 // recently deleted. For example, 546 // alice@example.com?uid=123456789012345678901. If the user is 547 // recovered, this value reverts to user:{emailid} and the recovered 548 // user retains the role in the binding. 549 // deleted:serviceAccount:{emailid}?uid={uniqueid}: An email address 550 // (plus unique identifier) representing a service account that has been 551 // recently deleted. For example, 552 // my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901. 553 // If the service account is undeleted, this value reverts to 554 // serviceAccount:{emailid} and the undeleted service account retains 555 // the role in the binding. deleted:group:{emailid}?uid={uniqueid}: An 556 // email address (plus unique identifier) representing a Google group 557 // that has been recently deleted. For example, 558 // admins@example.com?uid=123456789012345678901. If the group is 559 // recovered, this value reverts to group:{emailid} and the recovered 560 // group retains the role in the binding. domain:{domain}: The G Suite 561 // domain (primary) that represents all the users of that domain. For 562 // example, google.com or example.com. 563 Members []string `json:"members,omitempty"` 564 565 // Role: Role that is assigned to members. For example, roles/viewer, 566 // roles/editor, or roles/owner. 567 Role string `json:"role,omitempty"` 568 569 // ForceSendFields is a list of field names (e.g. "Condition") to 570 // unconditionally include in API requests. By default, fields with 571 // empty values are omitted from API requests. However, any non-pointer, 572 // non-interface field appearing in ForceSendFields will be sent to the 573 // server regardless of whether the field is empty or not. This may be 574 // used to include empty fields in Patch requests. 575 ForceSendFields []string `json:"-"` 576 577 // NullFields is a list of field names (e.g. "Condition") to include in 578 // API requests with the JSON null value. By default, fields with empty 579 // values are omitted from API requests. However, any field with an 580 // empty value appearing in NullFields will be sent to the server as 581 // null. It is an error if a field in this list has a non-empty value. 582 // This may be used to include null fields in Patch requests. 583 NullFields []string `json:"-"` 584} 585 586func (s *Binding) MarshalJSON() ([]byte, error) { 587 type NoMethod Binding 588 raw := NoMethod(*s) 589 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 590} 591 592// CancelJobRequest: A request to cancel a job. 593type CancelJobRequest struct { 594} 595 596// Cluster: Describes the identifying information, config, and status of 597// a cluster of Compute Engine instances. 598type Cluster struct { 599 // ClusterName: Required. The cluster name. Cluster names within a 600 // project must be unique. Names of deleted clusters can be reused. 601 ClusterName string `json:"clusterName,omitempty"` 602 603 // ClusterUuid: Output only. A cluster UUID (Unique Universal 604 // Identifier). Dataproc generates this value when it creates the 605 // cluster. 606 ClusterUuid string `json:"clusterUuid,omitempty"` 607 608 // Config: Required. The cluster config. Note that Dataproc may set 609 // default values, and values may change when clusters are updated. 610 Config *ClusterConfig `json:"config,omitempty"` 611 612 // Labels: Optional. The labels to associate with this cluster. Label 613 // keys must contain 1 to 63 characters, and must conform to RFC 1035 614 // (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, 615 // but, if present, must contain 1 to 63 characters, and must conform to 616 // RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 617 // labels can be associated with a cluster. 618 Labels map[string]string `json:"labels,omitempty"` 619 620 // Metrics: Output only. Contains cluster daemon metrics such as HDFS 621 // and YARN stats.Beta Feature: This report is available for testing 622 // purposes only. It may be changed before final release. 623 Metrics *ClusterMetrics `json:"metrics,omitempty"` 624 625 // ProjectId: Required. The Google Cloud Platform project ID that the 626 // cluster belongs to. 627 ProjectId string `json:"projectId,omitempty"` 628 629 // Status: Output only. Cluster status. 630 Status *ClusterStatus `json:"status,omitempty"` 631 632 // StatusHistory: Output only. The previous cluster status. 633 StatusHistory []*ClusterStatus `json:"statusHistory,omitempty"` 634 635 // ServerResponse contains the HTTP response code and headers from the 636 // server. 637 googleapi.ServerResponse `json:"-"` 638 639 // ForceSendFields is a list of field names (e.g. "ClusterName") to 640 // unconditionally include in API requests. By default, fields with 641 // empty values are omitted from API requests. However, any non-pointer, 642 // non-interface field appearing in ForceSendFields will be sent to the 643 // server regardless of whether the field is empty or not. This may be 644 // used to include empty fields in Patch requests. 645 ForceSendFields []string `json:"-"` 646 647 // NullFields is a list of field names (e.g. "ClusterName") to include 648 // in API requests with the JSON null value. By default, fields with 649 // empty values are omitted from API requests. However, any field with 650 // an empty value appearing in NullFields will be sent to the server as 651 // null. It is an error if a field in this list has a non-empty value. 652 // This may be used to include null fields in Patch requests. 653 NullFields []string `json:"-"` 654} 655 656func (s *Cluster) MarshalJSON() ([]byte, error) { 657 type NoMethod Cluster 658 raw := NoMethod(*s) 659 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 660} 661 662// ClusterConfig: The cluster config. 663type ClusterConfig struct { 664 // AutoscalingConfig: Optional. Autoscaling config for the policy 665 // associated with the cluster. Cluster does not autoscale if this field 666 // is unset. 667 AutoscalingConfig *AutoscalingConfig `json:"autoscalingConfig,omitempty"` 668 669 // ConfigBucket: Optional. A Cloud Storage bucket used to stage job 670 // dependencies, config files, and job driver console output. If you do 671 // not specify a staging bucket, Cloud Dataproc will determine a Cloud 672 // Storage location (US, ASIA, or EU) for your cluster's staging bucket 673 // according to the Compute Engine zone where your cluster is deployed, 674 // and then create and manage this project-level, per-location bucket 675 // (see Dataproc staging bucket 676 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). 677 // This field requires a Cloud Storage bucket name, not a URI to a Cloud 678 // Storage bucket. 679 ConfigBucket string `json:"configBucket,omitempty"` 680 681 // EncryptionConfig: Optional. Encryption settings for the cluster. 682 EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"` 683 684 // EndpointConfig: Optional. Port/endpoint configuration for this 685 // cluster 686 EndpointConfig *EndpointConfig `json:"endpointConfig,omitempty"` 687 688 // GceClusterConfig: Optional. The shared Compute Engine config settings 689 // for all instances in a cluster. 690 GceClusterConfig *GceClusterConfig `json:"gceClusterConfig,omitempty"` 691 692 // GkeClusterConfig: Optional. The Kubernetes Engine config for Dataproc 693 // clusters deployed to Kubernetes. Setting this is considered mutually 694 // exclusive with Compute Engine-based options such as 695 // gce_cluster_config, master_config, worker_config, 696 // secondary_worker_config, and autoscaling_config. 697 GkeClusterConfig *GkeClusterConfig `json:"gkeClusterConfig,omitempty"` 698 699 // InitializationActions: Optional. Commands to execute on each node 700 // after config is completed. By default, executables are run on master 701 // and all worker nodes. You can test a node's role metadata to run an 702 // executable on a master or worker node, as shown below using curl (you 703 // can also use wget): ROLE=$(curl -H Metadata-Flavor:Google 704 // http://metadata/computeMetadata/v1beta2/instance/attributes/dataproc-role) 705 // if [[ "${ROLE}" == 'Master' ]]; then ... master specific actions ... 706 // else ... worker specific actions ... fi 707 InitializationActions []*NodeInitializationAction `json:"initializationActions,omitempty"` 708 709 // LifecycleConfig: Optional. The config setting for auto delete cluster 710 // schedule. 711 LifecycleConfig *LifecycleConfig `json:"lifecycleConfig,omitempty"` 712 713 // MasterConfig: Optional. The Compute Engine config settings for the 714 // master instance in a cluster. 715 MasterConfig *InstanceGroupConfig `json:"masterConfig,omitempty"` 716 717 // MetastoreConfig: Optional. Metastore configuration. 718 MetastoreConfig *MetastoreConfig `json:"metastoreConfig,omitempty"` 719 720 // SecondaryWorkerConfig: Optional. The Compute Engine config settings 721 // for additional worker instances in a cluster. 722 SecondaryWorkerConfig *InstanceGroupConfig `json:"secondaryWorkerConfig,omitempty"` 723 724 // SecurityConfig: Optional. Security related configuration. 725 SecurityConfig *SecurityConfig `json:"securityConfig,omitempty"` 726 727 // SoftwareConfig: Optional. The config settings for software inside the 728 // cluster. 729 SoftwareConfig *SoftwareConfig `json:"softwareConfig,omitempty"` 730 731 // TempBucket: Optional. A Cloud Storage bucket used to store ephemeral 732 // cluster and jobs data, such as Spark and MapReduce history files. If 733 // you do not specify a temp bucket, Dataproc will determine a Cloud 734 // Storage location (US, ASIA, or EU) for your cluster's temp bucket 735 // according to the Compute Engine zone where your cluster is deployed, 736 // and then create and manage this project-level, per-location bucket. 737 // The default bucket has a TTL of 90 days, but you can use any TTL (or 738 // none) if you specify a bucket. This field requires a Cloud Storage 739 // bucket name, not a URI to a Cloud Storage bucket. 740 TempBucket string `json:"tempBucket,omitempty"` 741 742 // WorkerConfig: Optional. The Compute Engine config settings for worker 743 // instances in a cluster. 744 WorkerConfig *InstanceGroupConfig `json:"workerConfig,omitempty"` 745 746 // ForceSendFields is a list of field names (e.g. "AutoscalingConfig") 747 // to unconditionally include in API requests. By default, fields with 748 // empty values are omitted from API requests. However, any non-pointer, 749 // non-interface field appearing in ForceSendFields will be sent to the 750 // server regardless of whether the field is empty or not. This may be 751 // used to include empty fields in Patch requests. 752 ForceSendFields []string `json:"-"` 753 754 // NullFields is a list of field names (e.g. "AutoscalingConfig") to 755 // include in API requests with the JSON null value. By default, fields 756 // with empty values are omitted from API requests. However, any field 757 // with an empty value appearing in NullFields will be sent to the 758 // server as null. It is an error if a field in this list has a 759 // non-empty value. This may be used to include null fields in Patch 760 // requests. 761 NullFields []string `json:"-"` 762} 763 764func (s *ClusterConfig) MarshalJSON() ([]byte, error) { 765 type NoMethod ClusterConfig 766 raw := NoMethod(*s) 767 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 768} 769 770// ClusterMetrics: Contains cluster daemon metrics, such as HDFS and 771// YARN stats.Beta Feature: This report is available for testing 772// purposes only. It may be changed before final release. 773type ClusterMetrics struct { 774 // HdfsMetrics: The HDFS metrics. 775 HdfsMetrics map[string]string `json:"hdfsMetrics,omitempty"` 776 777 // YarnMetrics: The YARN metrics. 778 YarnMetrics map[string]string `json:"yarnMetrics,omitempty"` 779 780 // ForceSendFields is a list of field names (e.g. "HdfsMetrics") to 781 // unconditionally include in API requests. By default, fields with 782 // empty values are omitted from API requests. However, any non-pointer, 783 // non-interface field appearing in ForceSendFields will be sent to the 784 // server regardless of whether the field is empty or not. This may be 785 // used to include empty fields in Patch requests. 786 ForceSendFields []string `json:"-"` 787 788 // NullFields is a list of field names (e.g. "HdfsMetrics") to include 789 // in API requests with the JSON null value. By default, fields with 790 // empty values are omitted from API requests. However, any field with 791 // an empty value appearing in NullFields will be sent to the server as 792 // null. It is an error if a field in this list has a non-empty value. 793 // This may be used to include null fields in Patch requests. 794 NullFields []string `json:"-"` 795} 796 797func (s *ClusterMetrics) MarshalJSON() ([]byte, error) { 798 type NoMethod ClusterMetrics 799 raw := NoMethod(*s) 800 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 801} 802 803// ClusterOperation: The cluster operation triggered by a workflow. 804type ClusterOperation struct { 805 // Done: Output only. Indicates the operation is done. 806 Done bool `json:"done,omitempty"` 807 808 // Error: Output only. Error, if operation failed. 809 Error string `json:"error,omitempty"` 810 811 // OperationId: Output only. The id of the cluster operation. 812 OperationId string `json:"operationId,omitempty"` 813 814 // ForceSendFields is a list of field names (e.g. "Done") to 815 // unconditionally include in API requests. By default, fields with 816 // empty values are omitted from API requests. However, any non-pointer, 817 // non-interface field appearing in ForceSendFields will be sent to the 818 // server regardless of whether the field is empty or not. This may be 819 // used to include empty fields in Patch requests. 820 ForceSendFields []string `json:"-"` 821 822 // NullFields is a list of field names (e.g. "Done") to include in API 823 // requests with the JSON null value. By default, fields with empty 824 // values are omitted from API requests. However, any field with an 825 // empty value appearing in NullFields will be sent to the server as 826 // null. It is an error if a field in this list has a non-empty value. 827 // This may be used to include null fields in Patch requests. 828 NullFields []string `json:"-"` 829} 830 831func (s *ClusterOperation) MarshalJSON() ([]byte, error) { 832 type NoMethod ClusterOperation 833 raw := NoMethod(*s) 834 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 835} 836 837// ClusterOperationMetadata: Metadata describing the operation. 838type ClusterOperationMetadata struct { 839 // ClusterName: Output only. Name of the cluster for the operation. 840 ClusterName string `json:"clusterName,omitempty"` 841 842 // ClusterUuid: Output only. Cluster UUID for the operation. 843 ClusterUuid string `json:"clusterUuid,omitempty"` 844 845 // Description: Output only. Short description of operation. 846 Description string `json:"description,omitempty"` 847 848 // Labels: Output only. Labels associated with the operation 849 Labels map[string]string `json:"labels,omitempty"` 850 851 // OperationType: Output only. The operation type. 852 OperationType string `json:"operationType,omitempty"` 853 854 // Status: Output only. Current operation status. 855 Status *ClusterOperationStatus `json:"status,omitempty"` 856 857 // StatusHistory: Output only. The previous operation status. 858 StatusHistory []*ClusterOperationStatus `json:"statusHistory,omitempty"` 859 860 // Warnings: Output only. Errors encountered during operation execution. 861 Warnings []string `json:"warnings,omitempty"` 862 863 // ForceSendFields is a list of field names (e.g. "ClusterName") to 864 // unconditionally include in API requests. By default, fields with 865 // empty values are omitted from API requests. However, any non-pointer, 866 // non-interface field appearing in ForceSendFields will be sent to the 867 // server regardless of whether the field is empty or not. This may be 868 // used to include empty fields in Patch requests. 869 ForceSendFields []string `json:"-"` 870 871 // NullFields is a list of field names (e.g. "ClusterName") to include 872 // in API requests with the JSON null value. By default, fields with 873 // empty values are omitted from API requests. However, any field with 874 // an empty value appearing in NullFields will be sent to the server as 875 // null. It is an error if a field in this list has a non-empty value. 876 // This may be used to include null fields in Patch requests. 877 NullFields []string `json:"-"` 878} 879 880func (s *ClusterOperationMetadata) MarshalJSON() ([]byte, error) { 881 type NoMethod ClusterOperationMetadata 882 raw := NoMethod(*s) 883 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 884} 885 886// ClusterOperationStatus: The status of the operation. 887type ClusterOperationStatus struct { 888 // Details: Output only. A message containing any operation metadata 889 // details. 890 Details string `json:"details,omitempty"` 891 892 // InnerState: Output only. A message containing the detailed operation 893 // state. 894 InnerState string `json:"innerState,omitempty"` 895 896 // State: Output only. A message containing the operation state. 897 // 898 // Possible values: 899 // "UNKNOWN" - Unused. 900 // "PENDING" - The operation has been created. 901 // "RUNNING" - The operation is running. 902 // "DONE" - The operation is done; either cancelled or completed. 903 State string `json:"state,omitempty"` 904 905 // StateStartTime: Output only. The time this state was entered. 906 StateStartTime string `json:"stateStartTime,omitempty"` 907 908 // ForceSendFields is a list of field names (e.g. "Details") to 909 // unconditionally include in API requests. By default, fields with 910 // empty values are omitted from API requests. However, any non-pointer, 911 // non-interface field appearing in ForceSendFields will be sent to the 912 // server regardless of whether the field is empty or not. This may be 913 // used to include empty fields in Patch requests. 914 ForceSendFields []string `json:"-"` 915 916 // NullFields is a list of field names (e.g. "Details") to include in 917 // API requests with the JSON null value. By default, fields with empty 918 // values are omitted from API requests. However, any field with an 919 // empty value appearing in NullFields will be sent to the server as 920 // null. It is an error if a field in this list has a non-empty value. 921 // This may be used to include null fields in Patch requests. 922 NullFields []string `json:"-"` 923} 924 925func (s *ClusterOperationStatus) MarshalJSON() ([]byte, error) { 926 type NoMethod ClusterOperationStatus 927 raw := NoMethod(*s) 928 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 929} 930 931// ClusterSelector: A selector that chooses target cluster for jobs 932// based on metadata. 933type ClusterSelector struct { 934 // ClusterLabels: Required. The cluster labels. Cluster must have all 935 // labels to match. 936 ClusterLabels map[string]string `json:"clusterLabels,omitempty"` 937 938 // Zone: Optional. The zone where workflow process executes. This 939 // parameter does not affect the selection of the cluster.If 940 // unspecified, the zone of the first cluster matching the selector is 941 // used. 942 Zone string `json:"zone,omitempty"` 943 944 // ForceSendFields is a list of field names (e.g. "ClusterLabels") to 945 // unconditionally include in API requests. By default, fields with 946 // empty values are omitted from API requests. However, any non-pointer, 947 // non-interface field appearing in ForceSendFields will be sent to the 948 // server regardless of whether the field is empty or not. This may be 949 // used to include empty fields in Patch requests. 950 ForceSendFields []string `json:"-"` 951 952 // NullFields is a list of field names (e.g. "ClusterLabels") to include 953 // in API requests with the JSON null value. By default, fields with 954 // empty values are omitted from API requests. However, any field with 955 // an empty value appearing in NullFields will be sent to the server as 956 // null. It is an error if a field in this list has a non-empty value. 957 // This may be used to include null fields in Patch requests. 958 NullFields []string `json:"-"` 959} 960 961func (s *ClusterSelector) MarshalJSON() ([]byte, error) { 962 type NoMethod ClusterSelector 963 raw := NoMethod(*s) 964 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 965} 966 967// ClusterStatus: The status of a cluster and its instances. 968type ClusterStatus struct { 969 // Detail: Output only. Optional details of cluster's state. 970 Detail string `json:"detail,omitempty"` 971 972 // State: Output only. The cluster's state. 973 // 974 // Possible values: 975 // "UNKNOWN" - The cluster state is unknown. 976 // "CREATING" - The cluster is being created and set up. It is not 977 // ready for use. 978 // "RUNNING" - The cluster is currently running and healthy. It is 979 // ready for use. 980 // "ERROR" - The cluster encountered an error. It is not ready for 981 // use. 982 // "DELETING" - The cluster is being deleted. It cannot be used. 983 // "UPDATING" - The cluster is being updated. It continues to accept 984 // and process jobs. 985 // "STOPPING" - The cluster is being stopped. It cannot be used. 986 // "STOPPED" - The cluster is currently stopped. It is not ready for 987 // use. 988 // "STARTING" - The cluster is being started. It is not ready for use. 989 State string `json:"state,omitempty"` 990 991 // StateStartTime: Output only. Time when this state was entered (see 992 // JSON representation of Timestamp 993 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 994 StateStartTime string `json:"stateStartTime,omitempty"` 995 996 // Substate: Output only. Additional state information that includes 997 // status reported by the agent. 998 // 999 // Possible values: 1000 // "UNSPECIFIED" - The cluster substate is unknown. 1001 // "UNHEALTHY" - The cluster is known to be in an unhealthy state (for 1002 // example, critical daemons are not running or HDFS capacity is 1003 // exhausted).Applies to RUNNING state. 1004 // "STALE_STATUS" - The agent-reported status is out of date (may 1005 // occur if Dataproc loses communication with Agent).Applies to RUNNING 1006 // state. 1007 Substate string `json:"substate,omitempty"` 1008 1009 // ForceSendFields is a list of field names (e.g. "Detail") to 1010 // unconditionally include in API requests. By default, fields with 1011 // empty values are omitted from API requests. However, any non-pointer, 1012 // non-interface field appearing in ForceSendFields will be sent to the 1013 // server regardless of whether the field is empty or not. This may be 1014 // used to include empty fields in Patch requests. 1015 ForceSendFields []string `json:"-"` 1016 1017 // NullFields is a list of field names (e.g. "Detail") to include in API 1018 // requests with the JSON null value. By default, fields with empty 1019 // values are omitted from API requests. However, any field with an 1020 // empty value appearing in NullFields will be sent to the server as 1021 // null. It is an error if a field in this list has a non-empty value. 1022 // This may be used to include null fields in Patch requests. 1023 NullFields []string `json:"-"` 1024} 1025 1026func (s *ClusterStatus) MarshalJSON() ([]byte, error) { 1027 type NoMethod ClusterStatus 1028 raw := NoMethod(*s) 1029 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1030} 1031 1032// DiagnoseClusterRequest: A request to collect cluster diagnostic 1033// information. 1034type DiagnoseClusterRequest struct { 1035} 1036 1037// DiagnoseClusterResults: The location of diagnostic output. 1038type DiagnoseClusterResults struct { 1039 // OutputUri: Output only. The Cloud Storage URI of the diagnostic 1040 // output. The output report is a plain text file with a summary of 1041 // collected diagnostics. 1042 OutputUri string `json:"outputUri,omitempty"` 1043 1044 // ForceSendFields is a list of field names (e.g. "OutputUri") to 1045 // unconditionally include in API requests. By default, fields with 1046 // empty values are omitted from API requests. However, any non-pointer, 1047 // non-interface field appearing in ForceSendFields will be sent to the 1048 // server regardless of whether the field is empty or not. This may be 1049 // used to include empty fields in Patch requests. 1050 ForceSendFields []string `json:"-"` 1051 1052 // NullFields is a list of field names (e.g. "OutputUri") to include in 1053 // API requests with the JSON null value. By default, fields with empty 1054 // values are omitted from API requests. However, any field with an 1055 // empty value appearing in NullFields will be sent to the server as 1056 // null. It is an error if a field in this list has a non-empty value. 1057 // This may be used to include null fields in Patch requests. 1058 NullFields []string `json:"-"` 1059} 1060 1061func (s *DiagnoseClusterResults) MarshalJSON() ([]byte, error) { 1062 type NoMethod DiagnoseClusterResults 1063 raw := NoMethod(*s) 1064 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1065} 1066 1067// DiskConfig: Specifies the config of disk options for a group of VM 1068// instances. 1069type DiskConfig struct { 1070 // BootDiskSizeGb: Optional. Size in GB of the boot disk (default is 1071 // 500GB). 1072 BootDiskSizeGb int64 `json:"bootDiskSizeGb,omitempty"` 1073 1074 // BootDiskType: Optional. Type of the boot disk (default is 1075 // "pd-standard"). Valid values: "pd-balanced" (Persistent Disk Balanced 1076 // Solid State Drive), "pd-ssd" (Persistent Disk Solid State Drive), or 1077 // "pd-standard" (Persistent Disk Hard Disk Drive). See Disk types 1078 // (https://cloud.google.com/compute/docs/disks#disk-types). 1079 BootDiskType string `json:"bootDiskType,omitempty"` 1080 1081 // NumLocalSsds: Number of attached SSDs, from 0 to 4 (default is 0). If 1082 // SSDs are not attached, the boot disk is used to store runtime logs 1083 // and HDFS (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) 1084 // data. If one or more SSDs are attached, this runtime bulk data is 1085 // spread across them, and the boot disk contains only basic config and 1086 // installed binaries. 1087 NumLocalSsds int64 `json:"numLocalSsds,omitempty"` 1088 1089 // ForceSendFields is a list of field names (e.g. "BootDiskSizeGb") to 1090 // unconditionally include in API requests. By default, fields with 1091 // empty values are omitted from API requests. However, any non-pointer, 1092 // non-interface field appearing in ForceSendFields will be sent to the 1093 // server regardless of whether the field is empty or not. This may be 1094 // used to include empty fields in Patch requests. 1095 ForceSendFields []string `json:"-"` 1096 1097 // NullFields is a list of field names (e.g. "BootDiskSizeGb") to 1098 // include in API requests with the JSON null value. By default, fields 1099 // with empty values are omitted from API requests. However, any field 1100 // with an empty value appearing in NullFields will be sent to the 1101 // server as null. It is an error if a field in this list has a 1102 // non-empty value. This may be used to include null fields in Patch 1103 // requests. 1104 NullFields []string `json:"-"` 1105} 1106 1107func (s *DiskConfig) MarshalJSON() ([]byte, error) { 1108 type NoMethod DiskConfig 1109 raw := NoMethod(*s) 1110 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1111} 1112 1113// Empty: A generic empty message that you can re-use to avoid defining 1114// duplicated empty messages in your APIs. A typical example is to use 1115// it as the request or the response type of an API method. For 1116// instance: service Foo { rpc Bar(google.protobuf.Empty) returns 1117// (google.protobuf.Empty); } The JSON representation for Empty is empty 1118// JSON object {}. 1119type Empty struct { 1120 // ServerResponse contains the HTTP response code and headers from the 1121 // server. 1122 googleapi.ServerResponse `json:"-"` 1123} 1124 1125// EncryptionConfig: Encryption settings for the cluster. 1126type EncryptionConfig struct { 1127 // GcePdKmsKeyName: Optional. The Cloud KMS key name to use for PD disk 1128 // encryption for all instances in the cluster. 1129 GcePdKmsKeyName string `json:"gcePdKmsKeyName,omitempty"` 1130 1131 // ForceSendFields is a list of field names (e.g. "GcePdKmsKeyName") to 1132 // unconditionally include in API requests. By default, fields with 1133 // empty values are omitted from API requests. However, any non-pointer, 1134 // non-interface field appearing in ForceSendFields will be sent to the 1135 // server regardless of whether the field is empty or not. This may be 1136 // used to include empty fields in Patch requests. 1137 ForceSendFields []string `json:"-"` 1138 1139 // NullFields is a list of field names (e.g. "GcePdKmsKeyName") to 1140 // include in API requests with the JSON null value. By default, fields 1141 // with empty values are omitted from API requests. However, any field 1142 // with an empty value appearing in NullFields will be sent to the 1143 // server as null. It is an error if a field in this list has a 1144 // non-empty value. This may be used to include null fields in Patch 1145 // requests. 1146 NullFields []string `json:"-"` 1147} 1148 1149func (s *EncryptionConfig) MarshalJSON() ([]byte, error) { 1150 type NoMethod EncryptionConfig 1151 raw := NoMethod(*s) 1152 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1153} 1154 1155// EndpointConfig: Endpoint config for this cluster 1156type EndpointConfig struct { 1157 // EnableHttpPortAccess: Optional. If true, enable http access to 1158 // specific ports on the cluster from external sources. Defaults to 1159 // false. 1160 EnableHttpPortAccess bool `json:"enableHttpPortAccess,omitempty"` 1161 1162 // HttpPorts: Output only. The map of port descriptions to URLs. Will 1163 // only be populated if enable_http_port_access is true. 1164 HttpPorts map[string]string `json:"httpPorts,omitempty"` 1165 1166 // ForceSendFields is a list of field names (e.g. 1167 // "EnableHttpPortAccess") to unconditionally include in API requests. 1168 // By default, fields with empty values are omitted from API requests. 1169 // However, any non-pointer, non-interface field appearing in 1170 // ForceSendFields will be sent to the server regardless of whether the 1171 // field is empty or not. This may be used to include empty fields in 1172 // Patch requests. 1173 ForceSendFields []string `json:"-"` 1174 1175 // NullFields is a list of field names (e.g. "EnableHttpPortAccess") to 1176 // include in API requests with the JSON null value. By default, fields 1177 // with empty values are omitted from API requests. However, any field 1178 // with an empty value appearing in NullFields will be sent to the 1179 // server as null. It is an error if a field in this list has a 1180 // non-empty value. This may be used to include null fields in Patch 1181 // requests. 1182 NullFields []string `json:"-"` 1183} 1184 1185func (s *EndpointConfig) MarshalJSON() ([]byte, error) { 1186 type NoMethod EndpointConfig 1187 raw := NoMethod(*s) 1188 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1189} 1190 1191// Expr: Represents a textual expression in the Common Expression 1192// Language (CEL) syntax. CEL is a C-like expression language. The 1193// syntax and semantics of CEL are documented at 1194// https://github.com/google/cel-spec.Example (Comparison): title: 1195// "Summary size limit" description: "Determines if a summary is less 1196// than 100 chars" expression: "document.summary.size() < 100" Example 1197// (Equality): title: "Requestor is owner" description: "Determines if 1198// requestor is the document owner" expression: "document.owner == 1199// request.auth.claims.email" Example (Logic): title: "Public documents" 1200// description: "Determine whether the document should be publicly 1201// visible" expression: "document.type != 'private' && document.type != 1202// 'internal'" Example (Data Manipulation): title: "Notification string" 1203// description: "Create a notification string with a timestamp." 1204// expression: "'New message received at ' + 1205// string(document.create_time)" The exact variables and functions that 1206// may be referenced within an expression are determined by the service 1207// that evaluates it. See the service documentation for additional 1208// information. 1209type Expr struct { 1210 // Description: Optional. Description of the expression. This is a 1211 // longer text which describes the expression, e.g. when hovered over it 1212 // in a UI. 1213 Description string `json:"description,omitempty"` 1214 1215 // Expression: Textual representation of an expression in Common 1216 // Expression Language syntax. 1217 Expression string `json:"expression,omitempty"` 1218 1219 // Location: Optional. String indicating the location of the expression 1220 // for error reporting, e.g. a file name and a position in the file. 1221 Location string `json:"location,omitempty"` 1222 1223 // Title: Optional. Title for the expression, i.e. a short string 1224 // describing its purpose. This can be used e.g. in UIs which allow to 1225 // enter the expression. 1226 Title string `json:"title,omitempty"` 1227 1228 // ForceSendFields is a list of field names (e.g. "Description") to 1229 // unconditionally include in API requests. By default, fields with 1230 // empty values are omitted from API requests. However, any non-pointer, 1231 // non-interface field appearing in ForceSendFields will be sent to the 1232 // server regardless of whether the field is empty or not. This may be 1233 // used to include empty fields in Patch requests. 1234 ForceSendFields []string `json:"-"` 1235 1236 // NullFields is a list of field names (e.g. "Description") to include 1237 // in API requests with the JSON null value. By default, fields with 1238 // empty values are omitted from API requests. However, any field with 1239 // an empty value appearing in NullFields will be sent to the server as 1240 // null. It is an error if a field in this list has a non-empty value. 1241 // This may be used to include null fields in Patch requests. 1242 NullFields []string `json:"-"` 1243} 1244 1245func (s *Expr) MarshalJSON() ([]byte, error) { 1246 type NoMethod Expr 1247 raw := NoMethod(*s) 1248 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1249} 1250 1251// GceClusterConfig: Common config settings for resources of Compute 1252// Engine cluster instances, applicable to all instances in the cluster. 1253type GceClusterConfig struct { 1254 // InternalIpOnly: Optional. If true, all instances in the cluster will 1255 // only have internal IP addresses. By default, clusters are not 1256 // restricted to internal IP addresses, and will have ephemeral external 1257 // IP addresses assigned to each instance. This internal_ip_only 1258 // restriction can only be enabled for subnetwork enabled networks, and 1259 // all off-cluster dependencies must be configured to be accessible 1260 // without external IP addresses. 1261 InternalIpOnly bool `json:"internalIpOnly,omitempty"` 1262 1263 // Metadata: The Compute Engine metadata entries to add to all instances 1264 // (see Project and instance metadata 1265 // (https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). 1266 Metadata map[string]string `json:"metadata,omitempty"` 1267 1268 // NetworkUri: Optional. The Compute Engine network to be used for 1269 // machine communications. Cannot be specified with subnetwork_uri. If 1270 // neither network_uri nor subnetwork_uri is specified, the "default" 1271 // network of the project is used, if it exists. Cannot be a "Custom 1272 // Subnet Network" (see Using Subnetworks 1273 // (https://cloud.google.com/compute/docs/subnetworks) for more 1274 // information).A full URL, partial URI, or short name are valid. 1275 // Examples: 1276 // https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default 1277 // projects/[project_id]/regions/global/default default 1278 NetworkUri string `json:"networkUri,omitempty"` 1279 1280 // NodeGroupAffinity: Optional. Node Group Affinity for sole-tenant 1281 // clusters. 1282 NodeGroupAffinity *NodeGroupAffinity `json:"nodeGroupAffinity,omitempty"` 1283 1284 // PrivateIpv6GoogleAccess: Optional. The type of IPv6 access for a 1285 // cluster. 1286 // 1287 // Possible values: 1288 // "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED" - If unspecified, Compute 1289 // Engine default behavior will apply, which is the same as 1290 // INHERIT_FROM_SUBNETWORK. 1291 // "INHERIT_FROM_SUBNETWORK" - Private access to and from Google 1292 // Services configuration inherited from the subnetwork configuration. 1293 // This is the default Compute Engine behavior. 1294 // "OUTBOUND" - Enables outbound private IPv6 access to Google 1295 // Services from the Dataproc cluster. 1296 // "BIDIRECTIONAL" - Enables bidirectional private IPv6 access between 1297 // Google Services and the Dataproc cluster. 1298 PrivateIpv6GoogleAccess string `json:"privateIpv6GoogleAccess,omitempty"` 1299 1300 // ReservationAffinity: Optional. Reservation Affinity for consuming 1301 // Zonal reservation. 1302 ReservationAffinity *ReservationAffinity `json:"reservationAffinity,omitempty"` 1303 1304 // ServiceAccount: Optional. The Dataproc service account 1305 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/service-accounts#service_accounts_in_dataproc) 1306 // (also see VM Data Plane identity 1307 // (https://cloud.google.com/dataproc/docs/concepts/iam/dataproc-principals#vm_service_account_data_plane_identity)) 1308 // used by Dataproc cluster VM instances to access Google Cloud Platform 1309 // services.If not specified, the Compute Engine default service account 1310 // (https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) 1311 // is used. 1312 ServiceAccount string `json:"serviceAccount,omitempty"` 1313 1314 // ServiceAccountScopes: Optional. The URIs of service account scopes to 1315 // be included in Compute Engine instances. The following base set of 1316 // scopes is always included: 1317 // https://www.googleapis.com/auth/cloud.useraccounts.readonly 1318 // https://www.googleapis.com/auth/devstorage.read_write 1319 // https://www.googleapis.com/auth/logging.writeIf no scopes are 1320 // specified, the following defaults are also provided: 1321 // https://www.googleapis.com/auth/bigquery 1322 // https://www.googleapis.com/auth/bigtable.admin.table 1323 // https://www.googleapis.com/auth/bigtable.data 1324 // https://www.googleapis.com/auth/devstorage.full_control 1325 ServiceAccountScopes []string `json:"serviceAccountScopes,omitempty"` 1326 1327 // ShieldedInstanceConfig: Optional. Shielded Instance Config for 1328 // clusters using Compute Engine Shielded VMs 1329 // (https://cloud.google.com/security/shielded-cloud/shielded-vm). 1330 ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"` 1331 1332 // SubnetworkUri: Optional. The Compute Engine subnetwork to be used for 1333 // machine communications. Cannot be specified with network_uri.A full 1334 // URL, partial URI, or short name are valid. Examples: 1335 // https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/subnetworks/sub0 1336 // projects/[project_id]/regions/us-east1/subnetworks/sub0 sub0 1337 SubnetworkUri string `json:"subnetworkUri,omitempty"` 1338 1339 // Tags: The Compute Engine tags to add to all instances (see Tagging 1340 // instances 1341 // (https://cloud.google.com/compute/docs/label-or-tag-resources#tags)). 1342 Tags []string `json:"tags,omitempty"` 1343 1344 // ZoneUri: Optional. The zone where the Compute Engine cluster will be 1345 // located. On a create request, it is required in the "global" region. 1346 // If omitted in a non-global Dataproc region, the service will pick a 1347 // zone in the corresponding Compute Engine region. On a get request, 1348 // zone will always be present.A full URL, partial URI, or short name 1349 // are valid. Examples: 1350 // https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone] 1351 // projects/[project_id]/zones/[zone] us-central1-f 1352 ZoneUri string `json:"zoneUri,omitempty"` 1353 1354 // ForceSendFields is a list of field names (e.g. "InternalIpOnly") to 1355 // unconditionally include in API requests. By default, fields with 1356 // empty values are omitted from API requests. However, any non-pointer, 1357 // non-interface field appearing in ForceSendFields will be sent to the 1358 // server regardless of whether the field is empty or not. This may be 1359 // used to include empty fields in Patch requests. 1360 ForceSendFields []string `json:"-"` 1361 1362 // NullFields is a list of field names (e.g. "InternalIpOnly") to 1363 // include in API requests with the JSON null value. By default, fields 1364 // with empty values are omitted from API requests. However, any field 1365 // with an empty value appearing in NullFields will be sent to the 1366 // server as null. It is an error if a field in this list has a 1367 // non-empty value. This may be used to include null fields in Patch 1368 // requests. 1369 NullFields []string `json:"-"` 1370} 1371 1372func (s *GceClusterConfig) MarshalJSON() ([]byte, error) { 1373 type NoMethod GceClusterConfig 1374 raw := NoMethod(*s) 1375 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1376} 1377 1378// GetIamPolicyRequest: Request message for GetIamPolicy method. 1379type GetIamPolicyRequest struct { 1380 // Options: OPTIONAL: A GetPolicyOptions object for specifying options 1381 // to GetIamPolicy. 1382 Options *GetPolicyOptions `json:"options,omitempty"` 1383 1384 // ForceSendFields is a list of field names (e.g. "Options") to 1385 // unconditionally include in API requests. By default, fields with 1386 // empty values are omitted from API requests. However, any non-pointer, 1387 // non-interface field appearing in ForceSendFields will be sent to the 1388 // server regardless of whether the field is empty or not. This may be 1389 // used to include empty fields in Patch requests. 1390 ForceSendFields []string `json:"-"` 1391 1392 // NullFields is a list of field names (e.g. "Options") to include in 1393 // API requests with the JSON null value. By default, fields with empty 1394 // values are omitted from API requests. However, any field with an 1395 // empty value appearing in NullFields will be sent to the server as 1396 // null. It is an error if a field in this list has a non-empty value. 1397 // This may be used to include null fields in Patch requests. 1398 NullFields []string `json:"-"` 1399} 1400 1401func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) { 1402 type NoMethod GetIamPolicyRequest 1403 raw := NoMethod(*s) 1404 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1405} 1406 1407// GetPolicyOptions: Encapsulates settings provided to GetIamPolicy. 1408type GetPolicyOptions struct { 1409 // RequestedPolicyVersion: Optional. The policy format version to be 1410 // returned.Valid values are 0, 1, and 3. Requests specifying an invalid 1411 // value will be rejected.Requests for policies with any conditional 1412 // bindings must specify version 3. Policies without any conditional 1413 // bindings may specify any valid value or leave the field unset.To 1414 // learn which resources support conditions in their IAM policies, see 1415 // the IAM documentation 1416 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1417 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"` 1418 1419 // ForceSendFields is a list of field names (e.g. 1420 // "RequestedPolicyVersion") to unconditionally include in API requests. 1421 // By default, fields with empty values are omitted from API requests. 1422 // However, any non-pointer, non-interface field appearing in 1423 // ForceSendFields will be sent to the server regardless of whether the 1424 // field is empty or not. This may be used to include empty fields in 1425 // Patch requests. 1426 ForceSendFields []string `json:"-"` 1427 1428 // NullFields is a list of field names (e.g. "RequestedPolicyVersion") 1429 // to include in API requests with the JSON null value. By default, 1430 // fields with empty values are omitted from API requests. However, any 1431 // field with an empty value appearing in NullFields will be sent to the 1432 // server as null. It is an error if a field in this list has a 1433 // non-empty value. This may be used to include null fields in Patch 1434 // requests. 1435 NullFields []string `json:"-"` 1436} 1437 1438func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) { 1439 type NoMethod GetPolicyOptions 1440 raw := NoMethod(*s) 1441 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1442} 1443 1444// GkeClusterConfig: The GKE config for this cluster. 1445type GkeClusterConfig struct { 1446 // NamespacedGkeDeploymentTarget: Optional. A target for the deployment. 1447 NamespacedGkeDeploymentTarget *NamespacedGkeDeploymentTarget `json:"namespacedGkeDeploymentTarget,omitempty"` 1448 1449 // ForceSendFields is a list of field names (e.g. 1450 // "NamespacedGkeDeploymentTarget") to unconditionally include in API 1451 // requests. By default, fields with empty values are omitted from API 1452 // requests. However, any non-pointer, non-interface field appearing in 1453 // ForceSendFields will be sent to the server regardless of whether the 1454 // field is empty or not. This may be used to include empty fields in 1455 // Patch requests. 1456 ForceSendFields []string `json:"-"` 1457 1458 // NullFields is a list of field names (e.g. 1459 // "NamespacedGkeDeploymentTarget") to include in API requests with the 1460 // JSON null value. By default, fields with empty values are omitted 1461 // from API requests. However, any field with an empty value appearing 1462 // in NullFields will be sent to the server as null. It is an error if a 1463 // field in this list has a non-empty value. This may be used to include 1464 // null fields in Patch requests. 1465 NullFields []string `json:"-"` 1466} 1467 1468func (s *GkeClusterConfig) MarshalJSON() ([]byte, error) { 1469 type NoMethod GkeClusterConfig 1470 raw := NoMethod(*s) 1471 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1472} 1473 1474// HadoopJob: A Dataproc job for running Apache Hadoop MapReduce 1475// (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) 1476// jobs on Apache Hadoop YARN 1477// (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). 1478type HadoopJob struct { 1479 // ArchiveUris: Optional. HCFS URIs of archives to be extracted in the 1480 // working directory of Hadoop drivers and tasks. Supported file types: 1481 // .jar, .tar, .tar.gz, .tgz, or .zip. 1482 ArchiveUris []string `json:"archiveUris,omitempty"` 1483 1484 // Args: Optional. The arguments to pass to the driver. Do not include 1485 // arguments, such as -libjars or -Dfoo=bar, that can be set as job 1486 // properties, since a collision may occur that causes an incorrect job 1487 // submission. 1488 Args []string `json:"args,omitempty"` 1489 1490 // FileUris: Optional. HCFS (Hadoop Compatible Filesystem) URIs of files 1491 // to be copied to the working directory of Hadoop drivers and 1492 // distributed tasks. Useful for naively parallel tasks. 1493 FileUris []string `json:"fileUris,omitempty"` 1494 1495 // JarFileUris: Optional. Jar file URIs to add to the CLASSPATHs of the 1496 // Hadoop driver and tasks. 1497 JarFileUris []string `json:"jarFileUris,omitempty"` 1498 1499 // LoggingConfig: Optional. The runtime log config for job execution. 1500 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 1501 1502 // MainClass: The name of the driver's main class. The jar file 1503 // containing the class must be in the default CLASSPATH or specified in 1504 // jar_file_uris. 1505 MainClass string `json:"mainClass,omitempty"` 1506 1507 // MainJarFileUri: The HCFS URI of the jar file containing the main 1508 // class. Examples: 1509 // 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' 1510 // 'hdfs:/tmp/test-samples/custom-wordcount.jar' 1511 // 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' 1512 MainJarFileUri string `json:"mainJarFileUri,omitempty"` 1513 1514 // Properties: Optional. A mapping of property names to values, used to 1515 // configure Hadoop. Properties that conflict with values set by the 1516 // Dataproc API may be overwritten. Can include properties set in 1517 // /etc/hadoop/conf/*-site and classes in user code. 1518 Properties map[string]string `json:"properties,omitempty"` 1519 1520 // ForceSendFields is a list of field names (e.g. "ArchiveUris") to 1521 // unconditionally include in API requests. By default, fields with 1522 // empty values are omitted from API requests. However, any non-pointer, 1523 // non-interface field appearing in ForceSendFields will be sent to the 1524 // server regardless of whether the field is empty or not. This may be 1525 // used to include empty fields in Patch requests. 1526 ForceSendFields []string `json:"-"` 1527 1528 // NullFields is a list of field names (e.g. "ArchiveUris") to include 1529 // in API requests with the JSON null value. By default, fields with 1530 // empty values are omitted from API requests. However, any field with 1531 // an empty value appearing in NullFields will be sent to the server as 1532 // null. It is an error if a field in this list has a non-empty value. 1533 // This may be used to include null fields in Patch requests. 1534 NullFields []string `json:"-"` 1535} 1536 1537func (s *HadoopJob) MarshalJSON() ([]byte, error) { 1538 type NoMethod HadoopJob 1539 raw := NoMethod(*s) 1540 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1541} 1542 1543// HiveJob: A Dataproc job for running Apache Hive 1544// (https://hive.apache.org/) queries on YARN. 1545type HiveJob struct { 1546 // ContinueOnFailure: Optional. Whether to continue executing queries if 1547 // a query fails. The default value is false. Setting to true can be 1548 // useful when executing independent parallel queries. 1549 ContinueOnFailure bool `json:"continueOnFailure,omitempty"` 1550 1551 // JarFileUris: Optional. HCFS URIs of jar files to add to the CLASSPATH 1552 // of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive 1553 // SerDes and UDFs. 1554 JarFileUris []string `json:"jarFileUris,omitempty"` 1555 1556 // Properties: Optional. A mapping of property names and values, used to 1557 // configure Hive. Properties that conflict with values set by the 1558 // Dataproc API may be overwritten. Can include properties set in 1559 // /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and 1560 // classes in user code. 1561 Properties map[string]string `json:"properties,omitempty"` 1562 1563 // QueryFileUri: The HCFS URI of the script that contains Hive queries. 1564 QueryFileUri string `json:"queryFileUri,omitempty"` 1565 1566 // QueryList: A list of queries. 1567 QueryList *QueryList `json:"queryList,omitempty"` 1568 1569 // ScriptVariables: Optional. Mapping of query variable names to values 1570 // (equivalent to the Hive command: SET name="value";). 1571 ScriptVariables map[string]string `json:"scriptVariables,omitempty"` 1572 1573 // ForceSendFields is a list of field names (e.g. "ContinueOnFailure") 1574 // to unconditionally include in API requests. By default, fields with 1575 // empty values are omitted from API requests. However, any non-pointer, 1576 // non-interface field appearing in ForceSendFields will be sent to the 1577 // server regardless of whether the field is empty or not. This may be 1578 // used to include empty fields in Patch requests. 1579 ForceSendFields []string `json:"-"` 1580 1581 // NullFields is a list of field names (e.g. "ContinueOnFailure") to 1582 // include in API requests with the JSON null value. By default, fields 1583 // with empty values are omitted from API requests. However, any field 1584 // with an empty value appearing in NullFields will be sent to the 1585 // server as null. It is an error if a field in this list has a 1586 // non-empty value. This may be used to include null fields in Patch 1587 // requests. 1588 NullFields []string `json:"-"` 1589} 1590 1591func (s *HiveJob) MarshalJSON() ([]byte, error) { 1592 type NoMethod HiveJob 1593 raw := NoMethod(*s) 1594 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1595} 1596 1597// InjectCredentialsRequest: A request to inject credentials into a 1598// cluster. 1599type InjectCredentialsRequest struct { 1600 // ClusterUuid: Required. The cluster UUID. 1601 ClusterUuid string `json:"clusterUuid,omitempty"` 1602 1603 // CredentialsCiphertext: Required. The encrypted credentials being 1604 // injected in to the cluster.The client is responsible for encrypting 1605 // the credentials in a way that is supported by the cluster.A wrapped 1606 // value is used here so that the actual contents of the encrypted 1607 // credentials are not written to audit logs. 1608 CredentialsCiphertext string `json:"credentialsCiphertext,omitempty"` 1609 1610 // ForceSendFields is a list of field names (e.g. "ClusterUuid") to 1611 // unconditionally include in API requests. By default, fields with 1612 // empty values are omitted from API requests. However, any non-pointer, 1613 // non-interface field appearing in ForceSendFields will be sent to the 1614 // server regardless of whether the field is empty or not. This may be 1615 // used to include empty fields in Patch requests. 1616 ForceSendFields []string `json:"-"` 1617 1618 // NullFields is a list of field names (e.g. "ClusterUuid") to include 1619 // in API requests with the JSON null value. By default, fields with 1620 // empty values are omitted from API requests. However, any field with 1621 // an empty value appearing in NullFields will be sent to the server as 1622 // null. It is an error if a field in this list has a non-empty value. 1623 // This may be used to include null fields in Patch requests. 1624 NullFields []string `json:"-"` 1625} 1626 1627func (s *InjectCredentialsRequest) MarshalJSON() ([]byte, error) { 1628 type NoMethod InjectCredentialsRequest 1629 raw := NoMethod(*s) 1630 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1631} 1632 1633// InstanceGroupAutoscalingPolicyConfig: Configuration for the size 1634// bounds of an instance group, including its proportional size to other 1635// groups. 1636type InstanceGroupAutoscalingPolicyConfig struct { 1637 // MaxInstances: Optional. Maximum number of instances for this group. 1638 // Required for primary workers. Note that by default, clusters will not 1639 // use secondary workers. Required for secondary workers if the minimum 1640 // secondary instances is set.Primary workers - Bounds: [min_instances, 1641 // ). Required. Secondary workers - Bounds: [min_instances, ). Default: 1642 // 0. 1643 MaxInstances int64 `json:"maxInstances,omitempty"` 1644 1645 // MinInstances: Optional. Minimum number of instances for this 1646 // group.Primary workers - Bounds: 2, max_instances. Default: 2. 1647 // Secondary workers - Bounds: 0, max_instances. Default: 0. 1648 MinInstances int64 `json:"minInstances,omitempty"` 1649 1650 // Weight: Optional. Weight for the instance group, which is used to 1651 // determine the fraction of total workers in the cluster from this 1652 // instance group. For example, if primary workers have weight 2, and 1653 // secondary workers have weight 1, the cluster will have approximately 1654 // 2 primary workers for each secondary worker.The cluster may not reach 1655 // the specified balance if constrained by min/max bounds or other 1656 // autoscaling settings. For example, if max_instances for secondary 1657 // workers is 0, then only primary workers will be added. The cluster 1658 // can also be out of balance when created.If weight is not set on any 1659 // instance group, the cluster will default to equal weight for all 1660 // groups: the cluster will attempt to maintain an equal number of 1661 // workers in each group within the configured size bounds for each 1662 // group. If weight is set for one group only, the cluster will default 1663 // to zero weight on the unset group. For example if weight is set only 1664 // on primary workers, the cluster will use primary workers only and no 1665 // secondary workers. 1666 Weight int64 `json:"weight,omitempty"` 1667 1668 // ForceSendFields is a list of field names (e.g. "MaxInstances") to 1669 // unconditionally include in API requests. By default, fields with 1670 // empty values are omitted from API requests. However, any non-pointer, 1671 // non-interface field appearing in ForceSendFields will be sent to the 1672 // server regardless of whether the field is empty or not. This may be 1673 // used to include empty fields in Patch requests. 1674 ForceSendFields []string `json:"-"` 1675 1676 // NullFields is a list of field names (e.g. "MaxInstances") to include 1677 // in API requests with the JSON null value. By default, fields with 1678 // empty values are omitted from API requests. However, any field with 1679 // an empty value appearing in NullFields will be sent to the server as 1680 // null. It is an error if a field in this list has a non-empty value. 1681 // This may be used to include null fields in Patch requests. 1682 NullFields []string `json:"-"` 1683} 1684 1685func (s *InstanceGroupAutoscalingPolicyConfig) MarshalJSON() ([]byte, error) { 1686 type NoMethod InstanceGroupAutoscalingPolicyConfig 1687 raw := NoMethod(*s) 1688 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1689} 1690 1691// InstanceGroupConfig: The config settings for Compute Engine resources 1692// in an instance group, such as a master or worker group. 1693type InstanceGroupConfig struct { 1694 // Accelerators: Optional. The Compute Engine accelerator configuration 1695 // for these instances. 1696 Accelerators []*AcceleratorConfig `json:"accelerators,omitempty"` 1697 1698 // DiskConfig: Optional. Disk option config settings. 1699 DiskConfig *DiskConfig `json:"diskConfig,omitempty"` 1700 1701 // ImageUri: Optional. The Compute Engine image resource used for 1702 // cluster instances.The URI can represent an image or image 1703 // family.Image examples: 1704 // https://www.googleapis.com/compute/beta/projects/[project_id]/global/images/[image-id] 1705 // projects/[project_id]/global/images/[image-id] image-idImage family 1706 // examples. Dataproc will use the most recent image from the family: 1707 // https://www.googleapis.com/compute/beta/projects/[project_id]/global/images/family/[custom-image-family-name] 1708 // projects/[project_id]/global/images/family/[custom-image-family-name]I 1709 // f the URI is unspecified, it will be inferred from 1710 // SoftwareConfig.image_version or the system default. 1711 ImageUri string `json:"imageUri,omitempty"` 1712 1713 // InstanceNames: Output only. The list of instance names. Dataproc 1714 // derives the names from cluster_name, num_instances, and the instance 1715 // group. 1716 InstanceNames []string `json:"instanceNames,omitempty"` 1717 1718 // InstanceReferences: Output only. List of references to Compute Engine 1719 // instances. 1720 InstanceReferences []*InstanceReference `json:"instanceReferences,omitempty"` 1721 1722 // IsPreemptible: Output only. Specifies that this instance group 1723 // contains preemptible instances. 1724 IsPreemptible bool `json:"isPreemptible,omitempty"` 1725 1726 // MachineTypeUri: Optional. The Compute Engine machine type used for 1727 // cluster instances.A full URL, partial URI, or short name are valid. 1728 // Examples: 1729 // https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 1730 // projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 1731 // n1-standard-2Auto Zone Exception: If you are using the Dataproc Auto 1732 // Zone Placement 1733 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) 1734 // feature, you must use the short name of the machine type resource, 1735 // for example, n1-standard-2. 1736 MachineTypeUri string `json:"machineTypeUri,omitempty"` 1737 1738 // ManagedGroupConfig: Output only. The config for Compute Engine 1739 // Instance Group Manager that manages this group. This is only used for 1740 // preemptible instance groups. 1741 ManagedGroupConfig *ManagedGroupConfig `json:"managedGroupConfig,omitempty"` 1742 1743 // MinCpuPlatform: Specifies the minimum cpu platform for the Instance 1744 // Group. See Dataproc -> Minimum CPU Platform 1745 // (https://cloud.google.com/dataproc/docs/concepts/compute/dataproc-min-cpu). 1746 MinCpuPlatform string `json:"minCpuPlatform,omitempty"` 1747 1748 // NumInstances: Optional. The number of VM instances in the instance 1749 // group. For HA cluster master_config groups, must be set to 3. For 1750 // standard cluster master_config groups, must be set to 1. 1751 NumInstances int64 `json:"numInstances,omitempty"` 1752 1753 // Preemptibility: Optional. Specifies the preemptibility of the 1754 // instance group.The default value for master and worker groups is 1755 // NON_PREEMPTIBLE. This default cannot be changed.The default value for 1756 // secondary instances is PREEMPTIBLE. 1757 // 1758 // Possible values: 1759 // "PREEMPTIBILITY_UNSPECIFIED" - Preemptibility is unspecified, the 1760 // system will choose the appropriate setting for each instance group. 1761 // "NON_PREEMPTIBLE" - Instances are non-preemptible.This option is 1762 // allowed for all instance groups and is the only valid value for 1763 // Master and Worker instance groups. 1764 // "PREEMPTIBLE" - Instances are preemptible.This option is allowed 1765 // only for secondary worker groups. 1766 Preemptibility string `json:"preemptibility,omitempty"` 1767 1768 // ForceSendFields is a list of field names (e.g. "Accelerators") to 1769 // unconditionally include in API requests. By default, fields with 1770 // empty values are omitted from API requests. However, any non-pointer, 1771 // non-interface field appearing in ForceSendFields will be sent to the 1772 // server regardless of whether the field is empty or not. This may be 1773 // used to include empty fields in Patch requests. 1774 ForceSendFields []string `json:"-"` 1775 1776 // NullFields is a list of field names (e.g. "Accelerators") to include 1777 // in API requests with the JSON null value. By default, fields with 1778 // empty values are omitted from API requests. However, any field with 1779 // an empty value appearing in NullFields will be sent to the server as 1780 // null. It is an error if a field in this list has a non-empty value. 1781 // This may be used to include null fields in Patch requests. 1782 NullFields []string `json:"-"` 1783} 1784 1785func (s *InstanceGroupConfig) MarshalJSON() ([]byte, error) { 1786 type NoMethod InstanceGroupConfig 1787 raw := NoMethod(*s) 1788 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1789} 1790 1791// InstanceReference: A reference to a Compute Engine instance. 1792type InstanceReference struct { 1793 // InstanceId: The unique identifier of the Compute Engine instance. 1794 InstanceId string `json:"instanceId,omitempty"` 1795 1796 // InstanceName: The user-friendly name of the Compute Engine instance. 1797 InstanceName string `json:"instanceName,omitempty"` 1798 1799 // PublicKey: The public key used for sharing data with this instance. 1800 PublicKey string `json:"publicKey,omitempty"` 1801 1802 // ForceSendFields is a list of field names (e.g. "InstanceId") to 1803 // unconditionally include in API requests. By default, fields with 1804 // empty values are omitted from API requests. However, any non-pointer, 1805 // non-interface field appearing in ForceSendFields will be sent to the 1806 // server regardless of whether the field is empty or not. This may be 1807 // used to include empty fields in Patch requests. 1808 ForceSendFields []string `json:"-"` 1809 1810 // NullFields is a list of field names (e.g. "InstanceId") to include in 1811 // API requests with the JSON null value. By default, fields with empty 1812 // values are omitted from API requests. However, any field with an 1813 // empty value appearing in NullFields will be sent to the server as 1814 // null. It is an error if a field in this list has a non-empty value. 1815 // This may be used to include null fields in Patch requests. 1816 NullFields []string `json:"-"` 1817} 1818 1819func (s *InstanceReference) MarshalJSON() ([]byte, error) { 1820 type NoMethod InstanceReference 1821 raw := NoMethod(*s) 1822 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1823} 1824 1825// InstantiateWorkflowTemplateRequest: A request to instantiate a 1826// workflow template. 1827type InstantiateWorkflowTemplateRequest struct { 1828 // InstanceId: Deprecated. Please use request_id field instead. 1829 InstanceId string `json:"instanceId,omitempty"` 1830 1831 // Parameters: Optional. Map from parameter names to values that should 1832 // be used for those parameters. Values may not exceed 1000 characters. 1833 Parameters map[string]string `json:"parameters,omitempty"` 1834 1835 // RequestId: Optional. A tag that prevents multiple concurrent workflow 1836 // instances with the same tag from running. This mitigates risk of 1837 // concurrent instances started due to retries.It is recommended to 1838 // always set this value to a UUID 1839 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag 1840 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 1841 // and hyphens (-). The maximum length is 40 characters. 1842 RequestId string `json:"requestId,omitempty"` 1843 1844 // Version: Optional. The version of workflow template to instantiate. 1845 // If specified, the workflow will be instantiated only if the current 1846 // version of the workflow template has the supplied version.This option 1847 // cannot be used to instantiate a previous version of workflow 1848 // template. 1849 Version int64 `json:"version,omitempty"` 1850 1851 // ForceSendFields is a list of field names (e.g. "InstanceId") to 1852 // unconditionally include in API requests. By default, fields with 1853 // empty values are omitted from API requests. However, any non-pointer, 1854 // non-interface field appearing in ForceSendFields will be sent to the 1855 // server regardless of whether the field is empty or not. This may be 1856 // used to include empty fields in Patch requests. 1857 ForceSendFields []string `json:"-"` 1858 1859 // NullFields is a list of field names (e.g. "InstanceId") to include in 1860 // API requests with the JSON null value. By default, fields with empty 1861 // values are omitted from API requests. However, any field with an 1862 // empty value appearing in NullFields will be sent to the server as 1863 // null. It is an error if a field in this list has a non-empty value. 1864 // This may be used to include null fields in Patch requests. 1865 NullFields []string `json:"-"` 1866} 1867 1868func (s *InstantiateWorkflowTemplateRequest) MarshalJSON() ([]byte, error) { 1869 type NoMethod InstantiateWorkflowTemplateRequest 1870 raw := NoMethod(*s) 1871 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1872} 1873 1874// Job: A Dataproc job resource. 1875type Job struct { 1876 // Done: Output only. Indicates whether the job is completed. If the 1877 // value is false, the job is still in progress. If true, the job is 1878 // completed, and status.state field will indicate if it was successful, 1879 // failed, or cancelled. 1880 Done bool `json:"done,omitempty"` 1881 1882 // DriverControlFilesUri: Output only. If present, the location of 1883 // miscellaneous control files which may be used as part of job setup 1884 // and handling. If not present, control files may be placed in the same 1885 // location as driver_output_uri. 1886 DriverControlFilesUri string `json:"driverControlFilesUri,omitempty"` 1887 1888 // DriverOutputResourceUri: Output only. A URI pointing to the location 1889 // of the stdout of the job's driver program. 1890 DriverOutputResourceUri string `json:"driverOutputResourceUri,omitempty"` 1891 1892 // HadoopJob: Optional. Job is a Hadoop job. 1893 HadoopJob *HadoopJob `json:"hadoopJob,omitempty"` 1894 1895 // HiveJob: Optional. Job is a Hive job. 1896 HiveJob *HiveJob `json:"hiveJob,omitempty"` 1897 1898 // JobUuid: Output only. A UUID that uniquely identifies a job within 1899 // the project over time. This is in contrast to a user-settable 1900 // reference.job_id that may be reused over time. 1901 JobUuid string `json:"jobUuid,omitempty"` 1902 1903 // Labels: Optional. The labels to associate with this job. Label keys 1904 // must contain 1 to 63 characters, and must conform to RFC 1035 1905 // (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, 1906 // but, if present, must contain 1 to 63 characters, and must conform to 1907 // RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 1908 // labels can be associated with a job. 1909 Labels map[string]string `json:"labels,omitempty"` 1910 1911 // PigJob: Optional. Job is a Pig job. 1912 PigJob *PigJob `json:"pigJob,omitempty"` 1913 1914 // Placement: Required. Job information, including how, when, and where 1915 // to run the job. 1916 Placement *JobPlacement `json:"placement,omitempty"` 1917 1918 // PrestoJob: Optional. Job is a Presto job. 1919 PrestoJob *PrestoJob `json:"prestoJob,omitempty"` 1920 1921 // PysparkJob: Optional. Job is a PySpark job. 1922 PysparkJob *PySparkJob `json:"pysparkJob,omitempty"` 1923 1924 // Reference: Optional. The fully qualified reference to the job, which 1925 // can be used to obtain the equivalent REST path of the job resource. 1926 // If this property is not specified when a job is created, the server 1927 // generates a job_id. 1928 Reference *JobReference `json:"reference,omitempty"` 1929 1930 // Scheduling: Optional. Job scheduling configuration. 1931 Scheduling *JobScheduling `json:"scheduling,omitempty"` 1932 1933 // SparkJob: Optional. Job is a Spark job. 1934 SparkJob *SparkJob `json:"sparkJob,omitempty"` 1935 1936 // SparkRJob: Optional. Job is a SparkR job. 1937 SparkRJob *SparkRJob `json:"sparkRJob,omitempty"` 1938 1939 // SparkSqlJob: Optional. Job is a SparkSql job. 1940 SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"` 1941 1942 // Status: Output only. The job status. Additional application-specific 1943 // status information may be contained in the type_job and 1944 // yarn_applications fields. 1945 Status *JobStatus `json:"status,omitempty"` 1946 1947 // StatusHistory: Output only. The previous job status. 1948 StatusHistory []*JobStatus `json:"statusHistory,omitempty"` 1949 1950 // SubmittedBy: Output only. The email address of the user submitting 1951 // the job. For jobs submitted on the cluster, the address is 1952 // username@hostname. 1953 SubmittedBy string `json:"submittedBy,omitempty"` 1954 1955 // YarnApplications: Output only. The collection of YARN applications 1956 // spun up by this job.Beta Feature: This report is available for 1957 // testing purposes only. It may be changed before final release. 1958 YarnApplications []*YarnApplication `json:"yarnApplications,omitempty"` 1959 1960 // ServerResponse contains the HTTP response code and headers from the 1961 // server. 1962 googleapi.ServerResponse `json:"-"` 1963 1964 // ForceSendFields is a list of field names (e.g. "Done") to 1965 // unconditionally include in API requests. By default, fields with 1966 // empty values are omitted from API requests. However, any non-pointer, 1967 // non-interface field appearing in ForceSendFields will be sent to the 1968 // server regardless of whether the field is empty or not. This may be 1969 // used to include empty fields in Patch requests. 1970 ForceSendFields []string `json:"-"` 1971 1972 // NullFields is a list of field names (e.g. "Done") to include in API 1973 // requests with the JSON null value. By default, fields with empty 1974 // values are omitted from API requests. However, any field with an 1975 // empty value appearing in NullFields will be sent to the server as 1976 // null. It is an error if a field in this list has a non-empty value. 1977 // This may be used to include null fields in Patch requests. 1978 NullFields []string `json:"-"` 1979} 1980 1981func (s *Job) MarshalJSON() ([]byte, error) { 1982 type NoMethod Job 1983 raw := NoMethod(*s) 1984 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1985} 1986 1987// JobMetadata: Job Operation metadata. 1988type JobMetadata struct { 1989 // JobId: Output only. The job id. 1990 JobId string `json:"jobId,omitempty"` 1991 1992 // OperationType: Output only. Operation type. 1993 OperationType string `json:"operationType,omitempty"` 1994 1995 // StartTime: Output only. Job submission time. 1996 StartTime string `json:"startTime,omitempty"` 1997 1998 // Status: Output only. Most recent job status. 1999 Status *JobStatus `json:"status,omitempty"` 2000 2001 // ForceSendFields is a list of field names (e.g. "JobId") to 2002 // unconditionally include in API requests. By default, fields with 2003 // empty values are omitted from API requests. However, any non-pointer, 2004 // non-interface field appearing in ForceSendFields will be sent to the 2005 // server regardless of whether the field is empty or not. This may be 2006 // used to include empty fields in Patch requests. 2007 ForceSendFields []string `json:"-"` 2008 2009 // NullFields is a list of field names (e.g. "JobId") to include in API 2010 // requests with the JSON null value. By default, fields with empty 2011 // values are omitted from API requests. However, any field with an 2012 // empty value appearing in NullFields will be sent to the server as 2013 // null. It is an error if a field in this list has a non-empty value. 2014 // This may be used to include null fields in Patch requests. 2015 NullFields []string `json:"-"` 2016} 2017 2018func (s *JobMetadata) MarshalJSON() ([]byte, error) { 2019 type NoMethod JobMetadata 2020 raw := NoMethod(*s) 2021 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2022} 2023 2024// JobPlacement: Dataproc job config. 2025type JobPlacement struct { 2026 // ClusterLabels: Optional. Cluster labels to identify a cluster where 2027 // the job will be submitted. 2028 ClusterLabels map[string]string `json:"clusterLabels,omitempty"` 2029 2030 // ClusterName: Required. The name of the cluster where the job will be 2031 // submitted. 2032 ClusterName string `json:"clusterName,omitempty"` 2033 2034 // ClusterUuid: Output only. A cluster UUID generated by the Dataproc 2035 // service when the job is submitted. 2036 ClusterUuid string `json:"clusterUuid,omitempty"` 2037 2038 // ForceSendFields is a list of field names (e.g. "ClusterLabels") to 2039 // unconditionally include in API requests. By default, fields with 2040 // empty values are omitted from API requests. However, any non-pointer, 2041 // non-interface field appearing in ForceSendFields will be sent to the 2042 // server regardless of whether the field is empty or not. This may be 2043 // used to include empty fields in Patch requests. 2044 ForceSendFields []string `json:"-"` 2045 2046 // NullFields is a list of field names (e.g. "ClusterLabels") to include 2047 // in API requests with the JSON null value. By default, fields with 2048 // empty values are omitted from API requests. However, any field with 2049 // an empty value appearing in NullFields will be sent to the server as 2050 // null. It is an error if a field in this list has a non-empty value. 2051 // This may be used to include null fields in Patch requests. 2052 NullFields []string `json:"-"` 2053} 2054 2055func (s *JobPlacement) MarshalJSON() ([]byte, error) { 2056 type NoMethod JobPlacement 2057 raw := NoMethod(*s) 2058 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2059} 2060 2061// JobReference: Encapsulates the full scoping used to reference a job. 2062type JobReference struct { 2063 // JobId: Optional. The job ID, which must be unique within the project. 2064 // The ID must contain only letters (a-z, A-Z), numbers (0-9), 2065 // underscores (_), or hyphens (-). The maximum length is 100 2066 // characters.If not specified by the caller, the job ID will be 2067 // provided by the server. 2068 JobId string `json:"jobId,omitempty"` 2069 2070 // ProjectId: Optional. The ID of the Google Cloud Platform project that 2071 // the job belongs to. If specified, must match the request project ID. 2072 ProjectId string `json:"projectId,omitempty"` 2073 2074 // ForceSendFields is a list of field names (e.g. "JobId") to 2075 // unconditionally include in API requests. By default, fields with 2076 // empty values are omitted from API requests. However, any non-pointer, 2077 // non-interface field appearing in ForceSendFields will be sent to the 2078 // server regardless of whether the field is empty or not. This may be 2079 // used to include empty fields in Patch requests. 2080 ForceSendFields []string `json:"-"` 2081 2082 // NullFields is a list of field names (e.g. "JobId") to include in API 2083 // requests with the JSON null value. By default, fields with empty 2084 // values are omitted from API requests. However, any field with an 2085 // empty value appearing in NullFields will be sent to the server as 2086 // null. It is an error if a field in this list has a non-empty value. 2087 // This may be used to include null fields in Patch requests. 2088 NullFields []string `json:"-"` 2089} 2090 2091func (s *JobReference) MarshalJSON() ([]byte, error) { 2092 type NoMethod JobReference 2093 raw := NoMethod(*s) 2094 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2095} 2096 2097// JobScheduling: Job scheduling options. 2098type JobScheduling struct { 2099 // MaxFailuresPerHour: Optional. Maximum number of times per hour a 2100 // driver may be restarted as a result of driver terminating with 2101 // non-zero code before job is reported failed.A job may be reported as 2102 // thrashing if driver exits with non-zero code 4 times within 10 minute 2103 // window.Maximum value is 10. 2104 MaxFailuresPerHour int64 `json:"maxFailuresPerHour,omitempty"` 2105 2106 // MaxFailuresTotal: Optional. Maximum number of times in total a driver 2107 // may be restarted as a result of driver exiting with non-zero code 2108 // before job is reported failed. Maximum value is 240. 2109 MaxFailuresTotal int64 `json:"maxFailuresTotal,omitempty"` 2110 2111 // ForceSendFields is a list of field names (e.g. "MaxFailuresPerHour") 2112 // to unconditionally include in API requests. By default, fields with 2113 // empty values are omitted from API requests. However, any non-pointer, 2114 // non-interface field appearing in ForceSendFields will be sent to the 2115 // server regardless of whether the field is empty or not. This may be 2116 // used to include empty fields in Patch requests. 2117 ForceSendFields []string `json:"-"` 2118 2119 // NullFields is a list of field names (e.g. "MaxFailuresPerHour") to 2120 // include in API requests with the JSON null value. By default, fields 2121 // with empty values are omitted from API requests. However, any field 2122 // with an empty value appearing in NullFields will be sent to the 2123 // server as null. It is an error if a field in this list has a 2124 // non-empty value. This may be used to include null fields in Patch 2125 // requests. 2126 NullFields []string `json:"-"` 2127} 2128 2129func (s *JobScheduling) MarshalJSON() ([]byte, error) { 2130 type NoMethod JobScheduling 2131 raw := NoMethod(*s) 2132 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2133} 2134 2135// JobStatus: Dataproc job status. 2136type JobStatus struct { 2137 // Details: Output only. Optional Job state details, such as an error 2138 // description if the state is ERROR. 2139 Details string `json:"details,omitempty"` 2140 2141 // State: Output only. A state message specifying the overall job state. 2142 // 2143 // Possible values: 2144 // "STATE_UNSPECIFIED" - The job state is unknown. 2145 // "PENDING" - The job is pending; it has been submitted, but is not 2146 // yet running. 2147 // "SETUP_DONE" - Job has been received by the service and completed 2148 // initial setup; it will soon be submitted to the cluster. 2149 // "RUNNING" - The job is running on the cluster. 2150 // "CANCEL_PENDING" - A CancelJob request has been received, but is 2151 // pending. 2152 // "CANCEL_STARTED" - Transient in-flight resources have been 2153 // canceled, and the request to cancel the running job has been issued 2154 // to the cluster. 2155 // "CANCELLED" - The job cancellation was successful. 2156 // "DONE" - The job has completed successfully. 2157 // "ERROR" - The job has completed, but encountered an error. 2158 // "ATTEMPT_FAILURE" - Job attempt has failed. The detail field 2159 // contains failure details for this attempt.Applies to restartable jobs 2160 // only. 2161 State string `json:"state,omitempty"` 2162 2163 // StateStartTime: Output only. The time when this state was entered. 2164 StateStartTime string `json:"stateStartTime,omitempty"` 2165 2166 // Substate: Output only. Additional state information, which includes 2167 // status reported by the agent. 2168 // 2169 // Possible values: 2170 // "UNSPECIFIED" - The job substate is unknown. 2171 // "SUBMITTED" - The Job is submitted to the agent.Applies to RUNNING 2172 // state. 2173 // "QUEUED" - The Job has been received and is awaiting execution (it 2174 // may be waiting for a condition to be met). See the "details" field 2175 // for the reason for the delay.Applies to RUNNING state. 2176 // "STALE_STATUS" - The agent-reported status is out of date, which 2177 // may be caused by a loss of communication between the agent and 2178 // Dataproc. If the agent does not send a timely update, the job will 2179 // fail.Applies to RUNNING state. 2180 Substate string `json:"substate,omitempty"` 2181 2182 // ForceSendFields is a list of field names (e.g. "Details") to 2183 // unconditionally include in API requests. By default, fields with 2184 // empty values are omitted from API requests. However, any non-pointer, 2185 // non-interface field appearing in ForceSendFields will be sent to the 2186 // server regardless of whether the field is empty or not. This may be 2187 // used to include empty fields in Patch requests. 2188 ForceSendFields []string `json:"-"` 2189 2190 // NullFields is a list of field names (e.g. "Details") to include in 2191 // API requests with the JSON null value. By default, fields with empty 2192 // values are omitted from API requests. However, any field with an 2193 // empty value appearing in NullFields will be sent to the server as 2194 // null. It is an error if a field in this list has a non-empty value. 2195 // This may be used to include null fields in Patch requests. 2196 NullFields []string `json:"-"` 2197} 2198 2199func (s *JobStatus) MarshalJSON() ([]byte, error) { 2200 type NoMethod JobStatus 2201 raw := NoMethod(*s) 2202 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2203} 2204 2205// KerberosConfig: Specifies Kerberos related configuration. 2206type KerberosConfig struct { 2207 // CrossRealmTrustAdminServer: Optional. The admin server (IP or 2208 // hostname) for the remote trusted realm in a cross realm trust 2209 // relationship. 2210 CrossRealmTrustAdminServer string `json:"crossRealmTrustAdminServer,omitempty"` 2211 2212 // CrossRealmTrustKdc: Optional. The KDC (IP or hostname) for the remote 2213 // trusted realm in a cross realm trust relationship. 2214 CrossRealmTrustKdc string `json:"crossRealmTrustKdc,omitempty"` 2215 2216 // CrossRealmTrustRealm: Optional. The remote realm the Dataproc 2217 // on-cluster KDC will trust, should the user enable cross realm trust. 2218 CrossRealmTrustRealm string `json:"crossRealmTrustRealm,omitempty"` 2219 2220 // CrossRealmTrustSharedPasswordUri: Optional. The Cloud Storage URI of 2221 // a KMS encrypted file containing the shared password between the 2222 // on-cluster Kerberos realm and the remote trusted realm, in a cross 2223 // realm trust relationship. 2224 CrossRealmTrustSharedPasswordUri string `json:"crossRealmTrustSharedPasswordUri,omitempty"` 2225 2226 // EnableKerberos: Optional. Flag to indicate whether to Kerberize the 2227 // cluster (default: false). Set this field to true to enable Kerberos 2228 // on a cluster. 2229 EnableKerberos bool `json:"enableKerberos,omitempty"` 2230 2231 // KdcDbKeyUri: Optional. The Cloud Storage URI of a KMS encrypted file 2232 // containing the master key of the KDC database. 2233 KdcDbKeyUri string `json:"kdcDbKeyUri,omitempty"` 2234 2235 // KeyPasswordUri: Optional. The Cloud Storage URI of a KMS encrypted 2236 // file containing the password to the user provided key. For the 2237 // self-signed certificate, this password is generated by Dataproc. 2238 KeyPasswordUri string `json:"keyPasswordUri,omitempty"` 2239 2240 // KeystorePasswordUri: Optional. The Cloud Storage URI of a KMS 2241 // encrypted file containing the password to the user provided keystore. 2242 // For the self-signed certificate, this password is generated by 2243 // Dataproc. 2244 KeystorePasswordUri string `json:"keystorePasswordUri,omitempty"` 2245 2246 // KeystoreUri: Optional. The Cloud Storage URI of the keystore file 2247 // used for SSL encryption. If not provided, Dataproc will provide a 2248 // self-signed certificate. 2249 KeystoreUri string `json:"keystoreUri,omitempty"` 2250 2251 // KmsKeyUri: Optional. The uri of the KMS key used to encrypt various 2252 // sensitive files. 2253 KmsKeyUri string `json:"kmsKeyUri,omitempty"` 2254 2255 // Realm: Optional. The name of the on-cluster Kerberos realm. If not 2256 // specified, the uppercased domain of hostnames will be the realm. 2257 Realm string `json:"realm,omitempty"` 2258 2259 // RootPrincipalPasswordUri: Optional. The Cloud Storage URI of a KMS 2260 // encrypted file containing the root principal password. 2261 RootPrincipalPasswordUri string `json:"rootPrincipalPasswordUri,omitempty"` 2262 2263 // TgtLifetimeHours: Optional. The lifetime of the ticket granting 2264 // ticket, in hours. If not specified, or user specifies 0, then default 2265 // value 10 will be used. 2266 TgtLifetimeHours int64 `json:"tgtLifetimeHours,omitempty"` 2267 2268 // TruststorePasswordUri: Optional. The Cloud Storage URI of a KMS 2269 // encrypted file containing the password to the user provided 2270 // truststore. For the self-signed certificate, this password is 2271 // generated by Dataproc. 2272 TruststorePasswordUri string `json:"truststorePasswordUri,omitempty"` 2273 2274 // TruststoreUri: Optional. The Cloud Storage URI of the truststore file 2275 // used for SSL encryption. If not provided, Dataproc will provide a 2276 // self-signed certificate. 2277 TruststoreUri string `json:"truststoreUri,omitempty"` 2278 2279 // ForceSendFields is a list of field names (e.g. 2280 // "CrossRealmTrustAdminServer") to unconditionally include in API 2281 // requests. By default, fields with empty values are omitted from API 2282 // requests. However, any non-pointer, non-interface field appearing in 2283 // ForceSendFields will be sent to the server regardless of whether the 2284 // field is empty or not. This may be used to include empty fields in 2285 // Patch requests. 2286 ForceSendFields []string `json:"-"` 2287 2288 // NullFields is a list of field names (e.g. 2289 // "CrossRealmTrustAdminServer") to include in API requests with the 2290 // JSON null value. By default, fields with empty values are omitted 2291 // from API requests. However, any field with an empty value appearing 2292 // in NullFields will be sent to the server as null. It is an error if a 2293 // field in this list has a non-empty value. This may be used to include 2294 // null fields in Patch requests. 2295 NullFields []string `json:"-"` 2296} 2297 2298func (s *KerberosConfig) MarshalJSON() ([]byte, error) { 2299 type NoMethod KerberosConfig 2300 raw := NoMethod(*s) 2301 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2302} 2303 2304// LifecycleConfig: Specifies the cluster auto-delete schedule 2305// configuration. 2306type LifecycleConfig struct { 2307 // AutoDeleteTime: Optional. The time when cluster will be auto-deleted. 2308 // (see JSON representation of Timestamp 2309 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 2310 AutoDeleteTime string `json:"autoDeleteTime,omitempty"` 2311 2312 // AutoDeleteTtl: Optional. The lifetime duration of cluster. The 2313 // cluster will be auto-deleted at the end of this period. Minimum value 2314 // is 10 minutes; maximum value is 14 days (see JSON representation of 2315 // Duration 2316 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 2317 AutoDeleteTtl string `json:"autoDeleteTtl,omitempty"` 2318 2319 // IdleDeleteTtl: Optional. The duration to keep the cluster alive while 2320 // idling (when no jobs are running). Passing this threshold will cause 2321 // the cluster to be deleted. Minimum value is 5 minutes; maximum value 2322 // is 14 days (see JSON representation of Duration 2323 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 2324 IdleDeleteTtl string `json:"idleDeleteTtl,omitempty"` 2325 2326 // IdleStartTime: Output only. The time when cluster became idle (most 2327 // recent job finished) and became eligible for deletion due to idleness 2328 // (see JSON representation of Timestamp 2329 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 2330 IdleStartTime string `json:"idleStartTime,omitempty"` 2331 2332 // ForceSendFields is a list of field names (e.g. "AutoDeleteTime") to 2333 // unconditionally include in API requests. By default, fields with 2334 // empty values are omitted from API requests. However, any non-pointer, 2335 // non-interface field appearing in ForceSendFields will be sent to the 2336 // server regardless of whether the field is empty or not. This may be 2337 // used to include empty fields in Patch requests. 2338 ForceSendFields []string `json:"-"` 2339 2340 // NullFields is a list of field names (e.g. "AutoDeleteTime") to 2341 // include in API requests with the JSON null value. By default, fields 2342 // with empty values are omitted from API requests. However, any field 2343 // with an empty value appearing in NullFields will be sent to the 2344 // server as null. It is an error if a field in this list has a 2345 // non-empty value. This may be used to include null fields in Patch 2346 // requests. 2347 NullFields []string `json:"-"` 2348} 2349 2350func (s *LifecycleConfig) MarshalJSON() ([]byte, error) { 2351 type NoMethod LifecycleConfig 2352 raw := NoMethod(*s) 2353 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2354} 2355 2356// ListAutoscalingPoliciesResponse: A response to a request to list 2357// autoscaling policies in a project. 2358type ListAutoscalingPoliciesResponse struct { 2359 // NextPageToken: Output only. This token is included in the response if 2360 // there are more results to fetch. 2361 NextPageToken string `json:"nextPageToken,omitempty"` 2362 2363 // Policies: Output only. Autoscaling policies list. 2364 Policies []*AutoscalingPolicy `json:"policies,omitempty"` 2365 2366 // ServerResponse contains the HTTP response code and headers from the 2367 // server. 2368 googleapi.ServerResponse `json:"-"` 2369 2370 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2371 // unconditionally include in API requests. By default, fields with 2372 // empty values are omitted from API requests. However, any non-pointer, 2373 // non-interface field appearing in ForceSendFields will be sent to the 2374 // server regardless of whether the field is empty or not. This may be 2375 // used to include empty fields in Patch requests. 2376 ForceSendFields []string `json:"-"` 2377 2378 // NullFields is a list of field names (e.g. "NextPageToken") to include 2379 // in API requests with the JSON null value. By default, fields with 2380 // empty values are omitted from API requests. However, any field with 2381 // an empty value appearing in NullFields will be sent to the server as 2382 // null. It is an error if a field in this list has a non-empty value. 2383 // This may be used to include null fields in Patch requests. 2384 NullFields []string `json:"-"` 2385} 2386 2387func (s *ListAutoscalingPoliciesResponse) MarshalJSON() ([]byte, error) { 2388 type NoMethod ListAutoscalingPoliciesResponse 2389 raw := NoMethod(*s) 2390 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2391} 2392 2393// ListClustersResponse: The list of all clusters in a project. 2394type ListClustersResponse struct { 2395 // Clusters: Output only. The clusters in the project. 2396 Clusters []*Cluster `json:"clusters,omitempty"` 2397 2398 // NextPageToken: Output only. This token is included in the response if 2399 // there are more results to fetch. To fetch additional results, provide 2400 // this value as the page_token in a subsequent ListClustersRequest. 2401 NextPageToken string `json:"nextPageToken,omitempty"` 2402 2403 // ServerResponse contains the HTTP response code and headers from the 2404 // server. 2405 googleapi.ServerResponse `json:"-"` 2406 2407 // ForceSendFields is a list of field names (e.g. "Clusters") to 2408 // unconditionally include in API requests. By default, fields with 2409 // empty values are omitted from API requests. However, any non-pointer, 2410 // non-interface field appearing in ForceSendFields will be sent to the 2411 // server regardless of whether the field is empty or not. This may be 2412 // used to include empty fields in Patch requests. 2413 ForceSendFields []string `json:"-"` 2414 2415 // NullFields is a list of field names (e.g. "Clusters") to include in 2416 // API requests with the JSON null value. By default, fields with empty 2417 // values are omitted from API requests. However, any field with an 2418 // empty value appearing in NullFields will be sent to the server as 2419 // null. It is an error if a field in this list has a non-empty value. 2420 // This may be used to include null fields in Patch requests. 2421 NullFields []string `json:"-"` 2422} 2423 2424func (s *ListClustersResponse) MarshalJSON() ([]byte, error) { 2425 type NoMethod ListClustersResponse 2426 raw := NoMethod(*s) 2427 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2428} 2429 2430// ListJobsResponse: A list of jobs in a project. 2431type ListJobsResponse struct { 2432 // Jobs: Output only. Jobs list. 2433 Jobs []*Job `json:"jobs,omitempty"` 2434 2435 // NextPageToken: Optional. This token is included in the response if 2436 // there are more results to fetch. To fetch additional results, provide 2437 // this value as the page_token in a subsequent ListJobsRequest. 2438 NextPageToken string `json:"nextPageToken,omitempty"` 2439 2440 // ServerResponse contains the HTTP response code and headers from the 2441 // server. 2442 googleapi.ServerResponse `json:"-"` 2443 2444 // ForceSendFields is a list of field names (e.g. "Jobs") to 2445 // unconditionally include in API requests. By default, fields with 2446 // empty values are omitted from API requests. However, any non-pointer, 2447 // non-interface field appearing in ForceSendFields will be sent to the 2448 // server regardless of whether the field is empty or not. This may be 2449 // used to include empty fields in Patch requests. 2450 ForceSendFields []string `json:"-"` 2451 2452 // NullFields is a list of field names (e.g. "Jobs") to include in API 2453 // requests with the JSON null value. By default, fields with empty 2454 // values are omitted from API requests. However, any field with an 2455 // empty value appearing in NullFields will be sent to the server as 2456 // null. It is an error if a field in this list has a non-empty value. 2457 // This may be used to include null fields in Patch requests. 2458 NullFields []string `json:"-"` 2459} 2460 2461func (s *ListJobsResponse) MarshalJSON() ([]byte, error) { 2462 type NoMethod ListJobsResponse 2463 raw := NoMethod(*s) 2464 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2465} 2466 2467// ListOperationsResponse: The response message for 2468// Operations.ListOperations. 2469type ListOperationsResponse struct { 2470 // NextPageToken: The standard List next-page token. 2471 NextPageToken string `json:"nextPageToken,omitempty"` 2472 2473 // Operations: A list of operations that matches the specified filter in 2474 // the request. 2475 Operations []*Operation `json:"operations,omitempty"` 2476 2477 // ServerResponse contains the HTTP response code and headers from the 2478 // server. 2479 googleapi.ServerResponse `json:"-"` 2480 2481 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2482 // unconditionally include in API requests. By default, fields with 2483 // empty values are omitted from API requests. However, any non-pointer, 2484 // non-interface field appearing in ForceSendFields will be sent to the 2485 // server regardless of whether the field is empty or not. This may be 2486 // used to include empty fields in Patch requests. 2487 ForceSendFields []string `json:"-"` 2488 2489 // NullFields is a list of field names (e.g. "NextPageToken") to include 2490 // in API requests with the JSON null value. By default, fields with 2491 // empty values are omitted from API requests. However, any field with 2492 // an empty value appearing in NullFields will be sent to the server as 2493 // null. It is an error if a field in this list has a non-empty value. 2494 // This may be used to include null fields in Patch requests. 2495 NullFields []string `json:"-"` 2496} 2497 2498func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 2499 type NoMethod ListOperationsResponse 2500 raw := NoMethod(*s) 2501 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2502} 2503 2504// ListWorkflowTemplatesResponse: A response to a request to list 2505// workflow templates in a project. 2506type ListWorkflowTemplatesResponse struct { 2507 // NextPageToken: Output only. This token is included in the response if 2508 // there are more results to fetch. To fetch additional results, provide 2509 // this value as the page_token in a subsequent 2510 // ListWorkflowTemplatesRequest. 2511 NextPageToken string `json:"nextPageToken,omitempty"` 2512 2513 // Templates: Output only. WorkflowTemplates list. 2514 Templates []*WorkflowTemplate `json:"templates,omitempty"` 2515 2516 // ServerResponse contains the HTTP response code and headers from the 2517 // server. 2518 googleapi.ServerResponse `json:"-"` 2519 2520 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2521 // unconditionally include in API requests. By default, fields with 2522 // empty values are omitted from API requests. However, any non-pointer, 2523 // non-interface field appearing in ForceSendFields will be sent to the 2524 // server regardless of whether the field is empty or not. This may be 2525 // used to include empty fields in Patch requests. 2526 ForceSendFields []string `json:"-"` 2527 2528 // NullFields is a list of field names (e.g. "NextPageToken") to include 2529 // in API requests with the JSON null value. By default, fields with 2530 // empty values are omitted from API requests. However, any field with 2531 // an empty value appearing in NullFields will be sent to the server as 2532 // null. It is an error if a field in this list has a non-empty value. 2533 // This may be used to include null fields in Patch requests. 2534 NullFields []string `json:"-"` 2535} 2536 2537func (s *ListWorkflowTemplatesResponse) MarshalJSON() ([]byte, error) { 2538 type NoMethod ListWorkflowTemplatesResponse 2539 raw := NoMethod(*s) 2540 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2541} 2542 2543// LoggingConfig: The runtime logging config of the job. 2544type LoggingConfig struct { 2545 // DriverLogLevels: The per-package log levels for the driver. This may 2546 // include "root" package name to configure rootLogger. Examples: 2547 // 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG' 2548 DriverLogLevels map[string]string `json:"driverLogLevels,omitempty"` 2549 2550 // ForceSendFields is a list of field names (e.g. "DriverLogLevels") to 2551 // unconditionally include in API requests. By default, fields with 2552 // empty values are omitted from API requests. However, any non-pointer, 2553 // non-interface field appearing in ForceSendFields will be sent to the 2554 // server regardless of whether the field is empty or not. This may be 2555 // used to include empty fields in Patch requests. 2556 ForceSendFields []string `json:"-"` 2557 2558 // NullFields is a list of field names (e.g. "DriverLogLevels") to 2559 // include in API requests with the JSON null value. By default, fields 2560 // with empty values are omitted from API requests. However, any field 2561 // with an empty value appearing in NullFields will be sent to the 2562 // server as null. It is an error if a field in this list has a 2563 // non-empty value. This may be used to include null fields in Patch 2564 // requests. 2565 NullFields []string `json:"-"` 2566} 2567 2568func (s *LoggingConfig) MarshalJSON() ([]byte, error) { 2569 type NoMethod LoggingConfig 2570 raw := NoMethod(*s) 2571 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2572} 2573 2574// ManagedCluster: Cluster that is managed by the workflow. 2575type ManagedCluster struct { 2576 // ClusterName: Required. The cluster name prefix. A unique cluster name 2577 // will be formed by appending a random suffix.The name must contain 2578 // only lower-case letters (a-z), numbers (0-9), and hyphens (-). Must 2579 // begin with a letter. Cannot begin or end with hyphen. Must consist of 2580 // between 2 and 35 characters. 2581 ClusterName string `json:"clusterName,omitempty"` 2582 2583 // Config: Required. The cluster configuration. 2584 Config *ClusterConfig `json:"config,omitempty"` 2585 2586 // Labels: Optional. The labels to associate with this cluster.Label 2587 // keys must be between 1 and 63 characters long, and must conform to 2588 // the following PCRE regular expression: \p{Ll}\p{Lo}{0,62}Label values 2589 // must be between 1 and 63 characters long, and must conform to the 2590 // following PCRE regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more 2591 // than 32 labels can be associated with a given cluster. 2592 Labels map[string]string `json:"labels,omitempty"` 2593 2594 // ForceSendFields is a list of field names (e.g. "ClusterName") to 2595 // unconditionally include in API requests. By default, fields with 2596 // empty values are omitted from API requests. However, any non-pointer, 2597 // non-interface field appearing in ForceSendFields will be sent to the 2598 // server regardless of whether the field is empty or not. This may be 2599 // used to include empty fields in Patch requests. 2600 ForceSendFields []string `json:"-"` 2601 2602 // NullFields is a list of field names (e.g. "ClusterName") to include 2603 // in API requests with the JSON null value. By default, fields with 2604 // empty values are omitted from API requests. However, any field with 2605 // an empty value appearing in NullFields will be sent to the server as 2606 // null. It is an error if a field in this list has a non-empty value. 2607 // This may be used to include null fields in Patch requests. 2608 NullFields []string `json:"-"` 2609} 2610 2611func (s *ManagedCluster) MarshalJSON() ([]byte, error) { 2612 type NoMethod ManagedCluster 2613 raw := NoMethod(*s) 2614 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2615} 2616 2617// ManagedGroupConfig: Specifies the resources used to actively manage 2618// an instance group. 2619type ManagedGroupConfig struct { 2620 // InstanceGroupManagerName: Output only. The name of the Instance Group 2621 // Manager for this group. 2622 InstanceGroupManagerName string `json:"instanceGroupManagerName,omitempty"` 2623 2624 // InstanceTemplateName: Output only. The name of the Instance Template 2625 // used for the Managed Instance Group. 2626 InstanceTemplateName string `json:"instanceTemplateName,omitempty"` 2627 2628 // ForceSendFields is a list of field names (e.g. 2629 // "InstanceGroupManagerName") to unconditionally include in API 2630 // requests. By default, fields with empty values are omitted from API 2631 // requests. However, any non-pointer, non-interface field appearing in 2632 // ForceSendFields will be sent to the server regardless of whether the 2633 // field is empty or not. This may be used to include empty fields in 2634 // Patch requests. 2635 ForceSendFields []string `json:"-"` 2636 2637 // NullFields is a list of field names (e.g. "InstanceGroupManagerName") 2638 // to include in API requests with the JSON null value. By default, 2639 // fields with empty values are omitted from API requests. However, any 2640 // field with an empty value appearing in NullFields will be sent to the 2641 // server as null. It is an error if a field in this list has a 2642 // non-empty value. This may be used to include null fields in Patch 2643 // requests. 2644 NullFields []string `json:"-"` 2645} 2646 2647func (s *ManagedGroupConfig) MarshalJSON() ([]byte, error) { 2648 type NoMethod ManagedGroupConfig 2649 raw := NoMethod(*s) 2650 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2651} 2652 2653// MetastoreConfig: Specifies a Metastore configuration. 2654type MetastoreConfig struct { 2655 // DataprocMetastoreService: Required. Resource name of an existing 2656 // Dataproc Metastore service.Example: 2657 // projects/[project_id]/locations/[dataproc_region]/services/[service-na 2658 // me] 2659 DataprocMetastoreService string `json:"dataprocMetastoreService,omitempty"` 2660 2661 // ForceSendFields is a list of field names (e.g. 2662 // "DataprocMetastoreService") to unconditionally include in API 2663 // requests. By default, fields with empty values are omitted from API 2664 // requests. However, any non-pointer, non-interface field appearing in 2665 // ForceSendFields will be sent to the server regardless of whether the 2666 // field is empty or not. This may be used to include empty fields in 2667 // Patch requests. 2668 ForceSendFields []string `json:"-"` 2669 2670 // NullFields is a list of field names (e.g. "DataprocMetastoreService") 2671 // to include in API requests with the JSON null value. By default, 2672 // fields with empty values are omitted from API requests. However, any 2673 // field with an empty value appearing in NullFields will be sent to the 2674 // server as null. It is an error if a field in this list has a 2675 // non-empty value. This may be used to include null fields in Patch 2676 // requests. 2677 NullFields []string `json:"-"` 2678} 2679 2680func (s *MetastoreConfig) MarshalJSON() ([]byte, error) { 2681 type NoMethod MetastoreConfig 2682 raw := NoMethod(*s) 2683 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2684} 2685 2686// NamespacedGkeDeploymentTarget: A full, namespace-isolated deployment 2687// target for an existing GKE cluster. 2688type NamespacedGkeDeploymentTarget struct { 2689 // ClusterNamespace: Optional. A namespace within the GKE cluster to 2690 // deploy into. 2691 ClusterNamespace string `json:"clusterNamespace,omitempty"` 2692 2693 // TargetGkeCluster: Optional. The target GKE cluster to deploy to. 2694 // Format: 2695 // 'projects/{project}/locations/{location}/clusters/{cluster_id}' 2696 TargetGkeCluster string `json:"targetGkeCluster,omitempty"` 2697 2698 // ForceSendFields is a list of field names (e.g. "ClusterNamespace") to 2699 // unconditionally include in API requests. By default, fields with 2700 // empty values are omitted from API requests. However, any non-pointer, 2701 // non-interface field appearing in ForceSendFields will be sent to the 2702 // server regardless of whether the field is empty or not. This may be 2703 // used to include empty fields in Patch requests. 2704 ForceSendFields []string `json:"-"` 2705 2706 // NullFields is a list of field names (e.g. "ClusterNamespace") to 2707 // include in API requests with the JSON null value. By default, fields 2708 // with empty values are omitted from API requests. However, any field 2709 // with an empty value appearing in NullFields will be sent to the 2710 // server as null. It is an error if a field in this list has a 2711 // non-empty value. This may be used to include null fields in Patch 2712 // requests. 2713 NullFields []string `json:"-"` 2714} 2715 2716func (s *NamespacedGkeDeploymentTarget) MarshalJSON() ([]byte, error) { 2717 type NoMethod NamespacedGkeDeploymentTarget 2718 raw := NoMethod(*s) 2719 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2720} 2721 2722// NodeGroupAffinity: Node Group Affinity for clusters using sole-tenant 2723// node groups. 2724type NodeGroupAffinity struct { 2725 // NodeGroupUri: Required. The URI of a sole-tenant node group resource 2726 // (https://cloud.google.com/compute/docs/reference/rest/v1/nodeGroups) 2727 // that the cluster will be created on.A full URL, partial URI, or node 2728 // group name are valid. Examples: 2729 // https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-central1-a/nodeGroups/node-group-1 2730 // projects/[project_id]/zones/us-central1-a/nodeGroups/node-group-1 2731 // node-group-1 2732 NodeGroupUri string `json:"nodeGroupUri,omitempty"` 2733 2734 // ForceSendFields is a list of field names (e.g. "NodeGroupUri") to 2735 // unconditionally include in API requests. By default, fields with 2736 // empty values are omitted from API requests. However, any non-pointer, 2737 // non-interface field appearing in ForceSendFields will be sent to the 2738 // server regardless of whether the field is empty or not. This may be 2739 // used to include empty fields in Patch requests. 2740 ForceSendFields []string `json:"-"` 2741 2742 // NullFields is a list of field names (e.g. "NodeGroupUri") to include 2743 // in API requests with the JSON null value. By default, fields with 2744 // empty values are omitted from API requests. However, any field with 2745 // an empty value appearing in NullFields will be sent to the server as 2746 // null. It is an error if a field in this list has a non-empty value. 2747 // This may be used to include null fields in Patch requests. 2748 NullFields []string `json:"-"` 2749} 2750 2751func (s *NodeGroupAffinity) MarshalJSON() ([]byte, error) { 2752 type NoMethod NodeGroupAffinity 2753 raw := NoMethod(*s) 2754 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2755} 2756 2757// NodeInitializationAction: Specifies an executable to run on a fully 2758// configured node and a timeout period for executable completion. 2759type NodeInitializationAction struct { 2760 // ExecutableFile: Required. Cloud Storage URI of executable file. 2761 ExecutableFile string `json:"executableFile,omitempty"` 2762 2763 // ExecutionTimeout: Optional. Amount of time executable has to 2764 // complete. Default is 10 minutes (see JSON representation of Duration 2765 // (https://developers.google.com/protocol-buffers/docs/proto3#json)).Cluster 2766 // creation fails with an explanatory error message (the name of the 2767 // executable that caused the error and the exceeded timeout period) if 2768 // the executable is not completed at end of the timeout period. 2769 ExecutionTimeout string `json:"executionTimeout,omitempty"` 2770 2771 // ForceSendFields is a list of field names (e.g. "ExecutableFile") to 2772 // unconditionally include in API requests. By default, fields with 2773 // empty values are omitted from API requests. However, any non-pointer, 2774 // non-interface field appearing in ForceSendFields will be sent to the 2775 // server regardless of whether the field is empty or not. This may be 2776 // used to include empty fields in Patch requests. 2777 ForceSendFields []string `json:"-"` 2778 2779 // NullFields is a list of field names (e.g. "ExecutableFile") to 2780 // include in API requests with the JSON null value. By default, fields 2781 // with empty values are omitted from API requests. However, any field 2782 // with an empty value appearing in NullFields will be sent to the 2783 // server as null. It is an error if a field in this list has a 2784 // non-empty value. This may be used to include null fields in Patch 2785 // requests. 2786 NullFields []string `json:"-"` 2787} 2788 2789func (s *NodeInitializationAction) MarshalJSON() ([]byte, error) { 2790 type NoMethod NodeInitializationAction 2791 raw := NoMethod(*s) 2792 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2793} 2794 2795// Operation: This resource represents a long-running operation that is 2796// the result of a network API call. 2797type Operation struct { 2798 // Done: If the value is false, it means the operation is still in 2799 // progress. If true, the operation is completed, and either error or 2800 // response is available. 2801 Done bool `json:"done,omitempty"` 2802 2803 // Error: The error result of the operation in case of failure or 2804 // cancellation. 2805 Error *Status `json:"error,omitempty"` 2806 2807 // Metadata: Service-specific metadata associated with the operation. It 2808 // typically contains progress information and common metadata such as 2809 // create time. Some services might not provide such metadata. Any 2810 // method that returns a long-running operation should document the 2811 // metadata type, if any. 2812 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 2813 2814 // Name: The server-assigned name, which is only unique within the same 2815 // service that originally returns it. If you use the default HTTP 2816 // mapping, the name should be a resource name ending with 2817 // operations/{unique_id}. 2818 Name string `json:"name,omitempty"` 2819 2820 // Response: The normal response of the operation in case of success. If 2821 // the original method returns no data on success, such as Delete, the 2822 // response is google.protobuf.Empty. If the original method is standard 2823 // Get/Create/Update, the response should be the resource. For other 2824 // methods, the response should have the type XxxResponse, where Xxx is 2825 // the original method name. For example, if the original method name is 2826 // TakeSnapshot(), the inferred response type is TakeSnapshotResponse. 2827 Response googleapi.RawMessage `json:"response,omitempty"` 2828 2829 // ServerResponse contains the HTTP response code and headers from the 2830 // server. 2831 googleapi.ServerResponse `json:"-"` 2832 2833 // ForceSendFields is a list of field names (e.g. "Done") to 2834 // unconditionally include in API requests. By default, fields with 2835 // empty values are omitted from API requests. However, any non-pointer, 2836 // non-interface field appearing in ForceSendFields will be sent to the 2837 // server regardless of whether the field is empty or not. This may be 2838 // used to include empty fields in Patch requests. 2839 ForceSendFields []string `json:"-"` 2840 2841 // NullFields is a list of field names (e.g. "Done") to include in API 2842 // requests with the JSON null value. By default, fields with empty 2843 // values are omitted from API requests. However, any field with an 2844 // empty value appearing in NullFields will be sent to the server as 2845 // null. It is an error if a field in this list has a non-empty value. 2846 // This may be used to include null fields in Patch requests. 2847 NullFields []string `json:"-"` 2848} 2849 2850func (s *Operation) MarshalJSON() ([]byte, error) { 2851 type NoMethod Operation 2852 raw := NoMethod(*s) 2853 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2854} 2855 2856// OrderedJob: A job executed by the workflow. 2857type OrderedJob struct { 2858 // HadoopJob: Optional. Job is a Hadoop job. 2859 HadoopJob *HadoopJob `json:"hadoopJob,omitempty"` 2860 2861 // HiveJob: Optional. Job is a Hive job. 2862 HiveJob *HiveJob `json:"hiveJob,omitempty"` 2863 2864 // Labels: Optional. The labels to associate with this job.Label keys 2865 // must be between 1 and 63 characters long, and must conform to the 2866 // following regular expression: \p{Ll}\p{Lo}{0,62}Label values must be 2867 // between 1 and 63 characters long, and must conform to the following 2868 // regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels 2869 // can be associated with a given job. 2870 Labels map[string]string `json:"labels,omitempty"` 2871 2872 // PigJob: Optional. Job is a Pig job. 2873 PigJob *PigJob `json:"pigJob,omitempty"` 2874 2875 // PrerequisiteStepIds: Optional. The optional list of prerequisite job 2876 // step_ids. If not specified, the job will start at the beginning of 2877 // workflow. 2878 PrerequisiteStepIds []string `json:"prerequisiteStepIds,omitempty"` 2879 2880 // PrestoJob: Optional. Job is a Presto job. 2881 PrestoJob *PrestoJob `json:"prestoJob,omitempty"` 2882 2883 // PysparkJob: Optional. Job is a PySpark job. 2884 PysparkJob *PySparkJob `json:"pysparkJob,omitempty"` 2885 2886 // Scheduling: Optional. Job scheduling configuration. 2887 Scheduling *JobScheduling `json:"scheduling,omitempty"` 2888 2889 // SparkJob: Optional. Job is a Spark job. 2890 SparkJob *SparkJob `json:"sparkJob,omitempty"` 2891 2892 // SparkRJob: Optional. Job is a SparkR job. 2893 SparkRJob *SparkRJob `json:"sparkRJob,omitempty"` 2894 2895 // SparkSqlJob: Optional. Job is a SparkSql job. 2896 SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"` 2897 2898 // StepId: Required. The step id. The id must be unique among all jobs 2899 // within the template.The step id is used as prefix for job id, as job 2900 // goog-dataproc-workflow-step-id label, and in prerequisiteStepIds 2901 // field from other steps.The id must contain only letters (a-z, A-Z), 2902 // numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end 2903 // with underscore or hyphen. Must consist of between 3 and 50 2904 // characters. 2905 StepId string `json:"stepId,omitempty"` 2906 2907 // ForceSendFields is a list of field names (e.g. "HadoopJob") to 2908 // unconditionally include in API requests. By default, fields with 2909 // empty values are omitted from API requests. However, any non-pointer, 2910 // non-interface field appearing in ForceSendFields will be sent to the 2911 // server regardless of whether the field is empty or not. This may be 2912 // used to include empty fields in Patch requests. 2913 ForceSendFields []string `json:"-"` 2914 2915 // NullFields is a list of field names (e.g. "HadoopJob") to include in 2916 // API requests with the JSON null value. By default, fields with empty 2917 // values are omitted from API requests. However, any field with an 2918 // empty value appearing in NullFields will be sent to the server as 2919 // null. It is an error if a field in this list has a non-empty value. 2920 // This may be used to include null fields in Patch requests. 2921 NullFields []string `json:"-"` 2922} 2923 2924func (s *OrderedJob) MarshalJSON() ([]byte, error) { 2925 type NoMethod OrderedJob 2926 raw := NoMethod(*s) 2927 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2928} 2929 2930// ParameterValidation: Configuration for parameter validation. 2931type ParameterValidation struct { 2932 // Regex: Validation based on regular expressions. 2933 Regex *RegexValidation `json:"regex,omitempty"` 2934 2935 // Values: Validation based on a list of allowed values. 2936 Values *ValueValidation `json:"values,omitempty"` 2937 2938 // ForceSendFields is a list of field names (e.g. "Regex") to 2939 // unconditionally include in API requests. By default, fields with 2940 // empty values are omitted from API requests. However, any non-pointer, 2941 // non-interface field appearing in ForceSendFields will be sent to the 2942 // server regardless of whether the field is empty or not. This may be 2943 // used to include empty fields in Patch requests. 2944 ForceSendFields []string `json:"-"` 2945 2946 // NullFields is a list of field names (e.g. "Regex") to include in API 2947 // requests with the JSON null value. By default, fields with empty 2948 // values are omitted from API requests. However, any field with an 2949 // empty value appearing in NullFields will be sent to the server as 2950 // null. It is an error if a field in this list has a non-empty value. 2951 // This may be used to include null fields in Patch requests. 2952 NullFields []string `json:"-"` 2953} 2954 2955func (s *ParameterValidation) MarshalJSON() ([]byte, error) { 2956 type NoMethod ParameterValidation 2957 raw := NoMethod(*s) 2958 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2959} 2960 2961// PigJob: A Dataproc job for running Apache Pig 2962// (https://pig.apache.org/) queries on YARN. 2963type PigJob struct { 2964 // ContinueOnFailure: Optional. Whether to continue executing queries if 2965 // a query fails. The default value is false. Setting to true can be 2966 // useful when executing independent parallel queries. 2967 ContinueOnFailure bool `json:"continueOnFailure,omitempty"` 2968 2969 // JarFileUris: Optional. HCFS URIs of jar files to add to the CLASSPATH 2970 // of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig 2971 // UDFs. 2972 JarFileUris []string `json:"jarFileUris,omitempty"` 2973 2974 // LoggingConfig: Optional. The runtime log config for job execution. 2975 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 2976 2977 // Properties: Optional. A mapping of property names to values, used to 2978 // configure Pig. Properties that conflict with values set by the 2979 // Dataproc API may be overwritten. Can include properties set in 2980 // /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and 2981 // classes in user code. 2982 Properties map[string]string `json:"properties,omitempty"` 2983 2984 // QueryFileUri: The HCFS URI of the script that contains the Pig 2985 // queries. 2986 QueryFileUri string `json:"queryFileUri,omitempty"` 2987 2988 // QueryList: A list of queries. 2989 QueryList *QueryList `json:"queryList,omitempty"` 2990 2991 // ScriptVariables: Optional. Mapping of query variable names to values 2992 // (equivalent to the Pig command: name=[value]). 2993 ScriptVariables map[string]string `json:"scriptVariables,omitempty"` 2994 2995 // ForceSendFields is a list of field names (e.g. "ContinueOnFailure") 2996 // to unconditionally include in API requests. By default, fields with 2997 // empty values are omitted from API requests. However, any non-pointer, 2998 // non-interface field appearing in ForceSendFields will be sent to the 2999 // server regardless of whether the field is empty or not. This may be 3000 // used to include empty fields in Patch requests. 3001 ForceSendFields []string `json:"-"` 3002 3003 // NullFields is a list of field names (e.g. "ContinueOnFailure") to 3004 // include in API requests with the JSON null value. By default, fields 3005 // with empty values are omitted from API requests. However, any field 3006 // with an empty value appearing in NullFields will be sent to the 3007 // server as null. It is an error if a field in this list has a 3008 // non-empty value. This may be used to include null fields in Patch 3009 // requests. 3010 NullFields []string `json:"-"` 3011} 3012 3013func (s *PigJob) MarshalJSON() ([]byte, error) { 3014 type NoMethod PigJob 3015 raw := NoMethod(*s) 3016 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3017} 3018 3019// Policy: An Identity and Access Management (IAM) policy, which 3020// specifies access controls for Google Cloud resources.A Policy is a 3021// collection of bindings. A binding binds one or more members to a 3022// single role. Members can be user accounts, service accounts, Google 3023// groups, and domains (such as G Suite). A role is a named list of 3024// permissions; each role can be an IAM predefined role or a 3025// user-created custom role.For some types of Google Cloud resources, a 3026// binding can also specify a condition, which is a logical expression 3027// that allows access to a resource only if the expression evaluates to 3028// true. A condition can add constraints based on attributes of the 3029// request, the resource, or both. To learn which resources support 3030// conditions in their IAM policies, see the IAM documentation 3031// (https://cloud.google.com/iam/help/conditions/resource-policies).JSON 3032// example: { "bindings": [ { "role": 3033// "roles/resourcemanager.organizationAdmin", "members": [ 3034// "user:mike@example.com", "group:admins@example.com", 3035// "domain:google.com", 3036// "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { 3037// "role": "roles/resourcemanager.organizationViewer", "members": [ 3038// "user:eve@example.com" ], "condition": { "title": "expirable access", 3039// "description": "Does not grant access after Sep 2020", "expression": 3040// "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], 3041// "etag": "BwWWja0YfJA=", "version": 3 } YAML example: bindings: - 3042// members: - user:mike@example.com - group:admins@example.com - 3043// domain:google.com - 3044// serviceAccount:my-project-id@appspot.gserviceaccount.com role: 3045// roles/resourcemanager.organizationAdmin - members: - 3046// user:eve@example.com role: roles/resourcemanager.organizationViewer 3047// condition: title: expirable access description: Does not grant access 3048// after Sep 2020 expression: request.time < 3049// timestamp('2020-10-01T00:00:00.000Z') - etag: BwWWja0YfJA= - version: 3050// 3 For a description of IAM and its features, see the IAM 3051// documentation (https://cloud.google.com/iam/docs/). 3052type Policy struct { 3053 // Bindings: Associates a list of members to a role. Optionally, may 3054 // specify a condition that determines how and when the bindings are 3055 // applied. Each of the bindings must contain at least one member. 3056 Bindings []*Binding `json:"bindings,omitempty"` 3057 3058 // Etag: etag is used for optimistic concurrency control as a way to 3059 // help prevent simultaneous updates of a policy from overwriting each 3060 // other. It is strongly suggested that systems make use of the etag in 3061 // the read-modify-write cycle to perform policy updates in order to 3062 // avoid race conditions: An etag is returned in the response to 3063 // getIamPolicy, and systems are expected to put that etag in the 3064 // request to setIamPolicy to ensure that their change will be applied 3065 // to the same version of the policy.Important: If you use IAM 3066 // Conditions, you must include the etag field whenever you call 3067 // setIamPolicy. If you omit this field, then IAM allows you to 3068 // overwrite a version 3 policy with a version 1 policy, and all of the 3069 // conditions in the version 3 policy are lost. 3070 Etag string `json:"etag,omitempty"` 3071 3072 // Version: Specifies the format of the policy.Valid values are 0, 1, 3073 // and 3. Requests that specify an invalid value are rejected.Any 3074 // operation that affects conditional role bindings must specify version 3075 // 3. This requirement applies to the following operations: Getting a 3076 // policy that includes a conditional role binding Adding a conditional 3077 // role binding to a policy Changing a conditional role binding in a 3078 // policy Removing any role binding, with or without a condition, from a 3079 // policy that includes conditionsImportant: If you use IAM Conditions, 3080 // you must include the etag field whenever you call setIamPolicy. If 3081 // you omit this field, then IAM allows you to overwrite a version 3 3082 // policy with a version 1 policy, and all of the conditions in the 3083 // version 3 policy are lost.If a policy does not include any 3084 // conditions, operations on that policy may specify any valid version 3085 // or leave the field unset.To learn which resources support conditions 3086 // in their IAM policies, see the IAM documentation 3087 // (https://cloud.google.com/iam/help/conditions/resource-policies). 3088 Version int64 `json:"version,omitempty"` 3089 3090 // ServerResponse contains the HTTP response code and headers from the 3091 // server. 3092 googleapi.ServerResponse `json:"-"` 3093 3094 // ForceSendFields is a list of field names (e.g. "Bindings") to 3095 // unconditionally include in API requests. By default, fields with 3096 // empty values are omitted from API requests. However, any non-pointer, 3097 // non-interface field appearing in ForceSendFields will be sent to the 3098 // server regardless of whether the field is empty or not. This may be 3099 // used to include empty fields in Patch requests. 3100 ForceSendFields []string `json:"-"` 3101 3102 // NullFields is a list of field names (e.g. "Bindings") to include in 3103 // API requests with the JSON null value. By default, fields with empty 3104 // values are omitted from API requests. However, any field with an 3105 // empty value appearing in NullFields will be sent to the server as 3106 // null. It is an error if a field in this list has a non-empty value. 3107 // This may be used to include null fields in Patch requests. 3108 NullFields []string `json:"-"` 3109} 3110 3111func (s *Policy) MarshalJSON() ([]byte, error) { 3112 type NoMethod Policy 3113 raw := NoMethod(*s) 3114 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3115} 3116 3117// PrestoJob: A Dataproc job for running Presto (https://prestosql.io/) 3118// queries. IMPORTANT: The Dataproc Presto Optional Component 3119// (https://cloud.google.com/dataproc/docs/concepts/components/presto) 3120// must be enabled when the cluster is created to submit a Presto job to 3121// the cluster. 3122type PrestoJob struct { 3123 // ClientTags: Optional. Presto client tags to attach to this query 3124 ClientTags []string `json:"clientTags,omitempty"` 3125 3126 // ContinueOnFailure: Optional. Whether to continue executing queries if 3127 // a query fails. The default value is false. Setting to true can be 3128 // useful when executing independent parallel queries. 3129 ContinueOnFailure bool `json:"continueOnFailure,omitempty"` 3130 3131 // LoggingConfig: Optional. The runtime log config for job execution. 3132 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3133 3134 // OutputFormat: Optional. The format in which query output will be 3135 // displayed. See the Presto documentation for supported output formats 3136 OutputFormat string `json:"outputFormat,omitempty"` 3137 3138 // Properties: Optional. A mapping of property names to values. Used to 3139 // set Presto session properties 3140 // (https://prestodb.io/docs/current/sql/set-session.html) Equivalent to 3141 // using the --session flag in the Presto CLI 3142 Properties map[string]string `json:"properties,omitempty"` 3143 3144 // QueryFileUri: The HCFS URI of the script that contains SQL queries. 3145 QueryFileUri string `json:"queryFileUri,omitempty"` 3146 3147 // QueryList: A list of queries. 3148 QueryList *QueryList `json:"queryList,omitempty"` 3149 3150 // ForceSendFields is a list of field names (e.g. "ClientTags") to 3151 // unconditionally include in API requests. By default, fields with 3152 // empty values are omitted from API requests. However, any non-pointer, 3153 // non-interface field appearing in ForceSendFields will be sent to the 3154 // server regardless of whether the field is empty or not. This may be 3155 // used to include empty fields in Patch requests. 3156 ForceSendFields []string `json:"-"` 3157 3158 // NullFields is a list of field names (e.g. "ClientTags") to include in 3159 // API requests with the JSON null value. By default, fields with empty 3160 // values are omitted from API requests. However, any field with an 3161 // empty value appearing in NullFields will be sent to the server as 3162 // null. It is an error if a field in this list has a non-empty value. 3163 // This may be used to include null fields in Patch requests. 3164 NullFields []string `json:"-"` 3165} 3166 3167func (s *PrestoJob) MarshalJSON() ([]byte, error) { 3168 type NoMethod PrestoJob 3169 raw := NoMethod(*s) 3170 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3171} 3172 3173// PySparkJob: A Dataproc job for running Apache PySpark 3174// (https://spark.apache.org/docs/0.9.0/python-programming-guide.html) 3175// applications on YARN. 3176type PySparkJob struct { 3177 // ArchiveUris: Optional. HCFS URIs of archives to be extracted into the 3178 // working directory of each executor. Supported file types: .jar, .tar, 3179 // .tar.gz, .tgz, and .zip. 3180 ArchiveUris []string `json:"archiveUris,omitempty"` 3181 3182 // Args: Optional. The arguments to pass to the driver. Do not include 3183 // arguments, such as --conf, that can be set as job properties, since a 3184 // collision may occur that causes an incorrect job submission. 3185 Args []string `json:"args,omitempty"` 3186 3187 // FileUris: Optional. HCFS URIs of files to be placed in the working 3188 // directory of each executor. Useful for naively parallel tasks. 3189 FileUris []string `json:"fileUris,omitempty"` 3190 3191 // JarFileUris: Optional. HCFS URIs of jar files to add to the 3192 // CLASSPATHs of the Python driver and tasks. 3193 JarFileUris []string `json:"jarFileUris,omitempty"` 3194 3195 // LoggingConfig: Optional. The runtime log config for job execution. 3196 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3197 3198 // MainPythonFileUri: Required. The HCFS URI of the main Python file to 3199 // use as the driver. Must be a .py file. 3200 MainPythonFileUri string `json:"mainPythonFileUri,omitempty"` 3201 3202 // Properties: Optional. A mapping of property names to values, used to 3203 // configure PySpark. Properties that conflict with values set by the 3204 // Dataproc API may be overwritten. Can include properties set in 3205 // /etc/spark/conf/spark-defaults.conf and classes in user code. 3206 Properties map[string]string `json:"properties,omitempty"` 3207 3208 // PythonFileUris: Optional. HCFS file URIs of Python files to pass to 3209 // the PySpark framework. Supported file types: .py, .egg, and .zip. 3210 PythonFileUris []string `json:"pythonFileUris,omitempty"` 3211 3212 // ForceSendFields is a list of field names (e.g. "ArchiveUris") to 3213 // unconditionally include in API requests. By default, fields with 3214 // empty values are omitted from API requests. However, any non-pointer, 3215 // non-interface field appearing in ForceSendFields will be sent to the 3216 // server regardless of whether the field is empty or not. This may be 3217 // used to include empty fields in Patch requests. 3218 ForceSendFields []string `json:"-"` 3219 3220 // NullFields is a list of field names (e.g. "ArchiveUris") to include 3221 // in API requests with the JSON null value. By default, fields with 3222 // empty values are omitted from API requests. However, any field with 3223 // an empty value appearing in NullFields will be sent to the server as 3224 // null. It is an error if a field in this list has a non-empty value. 3225 // This may be used to include null fields in Patch requests. 3226 NullFields []string `json:"-"` 3227} 3228 3229func (s *PySparkJob) MarshalJSON() ([]byte, error) { 3230 type NoMethod PySparkJob 3231 raw := NoMethod(*s) 3232 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3233} 3234 3235// QueryList: A list of queries to run on a cluster. 3236type QueryList struct { 3237 // Queries: Required. The queries to execute. You do not need to end a 3238 // query expression with a semicolon. Multiple queries can be specified 3239 // in one string by separating each with a semicolon. Here is an example 3240 // of a Dataproc API snippet that uses a QueryList to specify a HiveJob: 3241 // "hiveJob": { "queryList": { "queries": [ "query1", "query2", 3242 // "query3;query4", ] } } 3243 Queries []string `json:"queries,omitempty"` 3244 3245 // ForceSendFields is a list of field names (e.g. "Queries") to 3246 // unconditionally include in API requests. By default, fields with 3247 // empty values are omitted from API requests. However, any non-pointer, 3248 // non-interface field appearing in ForceSendFields will be sent to the 3249 // server regardless of whether the field is empty or not. This may be 3250 // used to include empty fields in Patch requests. 3251 ForceSendFields []string `json:"-"` 3252 3253 // NullFields is a list of field names (e.g. "Queries") to include in 3254 // API requests with the JSON null value. By default, fields with empty 3255 // values are omitted from API requests. However, any field with an 3256 // empty value appearing in NullFields will be sent to the server as 3257 // null. It is an error if a field in this list has a non-empty value. 3258 // This may be used to include null fields in Patch requests. 3259 NullFields []string `json:"-"` 3260} 3261 3262func (s *QueryList) MarshalJSON() ([]byte, error) { 3263 type NoMethod QueryList 3264 raw := NoMethod(*s) 3265 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3266} 3267 3268// RegexValidation: Validation based on regular expressions. 3269type RegexValidation struct { 3270 // Regexes: Required. RE2 regular expressions used to validate the 3271 // parameter's value. The value must match the regex in its entirety 3272 // (substring matches are not sufficient). 3273 Regexes []string `json:"regexes,omitempty"` 3274 3275 // ForceSendFields is a list of field names (e.g. "Regexes") to 3276 // unconditionally include in API requests. By default, fields with 3277 // empty values are omitted from API requests. However, any non-pointer, 3278 // non-interface field appearing in ForceSendFields will be sent to the 3279 // server regardless of whether the field is empty or not. This may be 3280 // used to include empty fields in Patch requests. 3281 ForceSendFields []string `json:"-"` 3282 3283 // NullFields is a list of field names (e.g. "Regexes") to include in 3284 // API requests with the JSON null value. By default, fields with empty 3285 // values are omitted from API requests. However, any field with an 3286 // empty value appearing in NullFields will be sent to the server as 3287 // null. It is an error if a field in this list has a non-empty value. 3288 // This may be used to include null fields in Patch requests. 3289 NullFields []string `json:"-"` 3290} 3291 3292func (s *RegexValidation) MarshalJSON() ([]byte, error) { 3293 type NoMethod RegexValidation 3294 raw := NoMethod(*s) 3295 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3296} 3297 3298// ReservationAffinity: Reservation Affinity for consuming Zonal 3299// reservation. 3300type ReservationAffinity struct { 3301 // ConsumeReservationType: Optional. Type of reservation to consume 3302 // 3303 // Possible values: 3304 // "TYPE_UNSPECIFIED" 3305 // "NO_RESERVATION" - Do not consume from any allocated capacity. 3306 // "ANY_RESERVATION" - Consume any reservation available. 3307 // "SPECIFIC_RESERVATION" - Must consume from a specific reservation. 3308 // Must specify key value fields for specifying the reservations. 3309 ConsumeReservationType string `json:"consumeReservationType,omitempty"` 3310 3311 // Key: Optional. Corresponds to the label key of reservation resource. 3312 Key string `json:"key,omitempty"` 3313 3314 // Values: Optional. Corresponds to the label values of reservation 3315 // resource. 3316 Values []string `json:"values,omitempty"` 3317 3318 // ForceSendFields is a list of field names (e.g. 3319 // "ConsumeReservationType") to unconditionally include in API requests. 3320 // By default, fields with empty values are omitted from API requests. 3321 // However, any non-pointer, non-interface field appearing in 3322 // ForceSendFields will be sent to the server regardless of whether the 3323 // field is empty or not. This may be used to include empty fields in 3324 // Patch requests. 3325 ForceSendFields []string `json:"-"` 3326 3327 // NullFields is a list of field names (e.g. "ConsumeReservationType") 3328 // to include in API requests with the JSON null value. By default, 3329 // fields with empty values are omitted from API requests. However, any 3330 // field with an empty value appearing in NullFields will be sent to the 3331 // server as null. It is an error if a field in this list has a 3332 // non-empty value. This may be used to include null fields in Patch 3333 // requests. 3334 NullFields []string `json:"-"` 3335} 3336 3337func (s *ReservationAffinity) MarshalJSON() ([]byte, error) { 3338 type NoMethod ReservationAffinity 3339 raw := NoMethod(*s) 3340 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3341} 3342 3343// SecurityConfig: Security related configuration, including encryption, 3344// Kerberos, etc. 3345type SecurityConfig struct { 3346 // KerberosConfig: Optional. Kerberos related configuration. 3347 KerberosConfig *KerberosConfig `json:"kerberosConfig,omitempty"` 3348 3349 // ForceSendFields is a list of field names (e.g. "KerberosConfig") to 3350 // unconditionally include in API requests. By default, fields with 3351 // empty values are omitted from API requests. However, any non-pointer, 3352 // non-interface field appearing in ForceSendFields will be sent to the 3353 // server regardless of whether the field is empty or not. This may be 3354 // used to include empty fields in Patch requests. 3355 ForceSendFields []string `json:"-"` 3356 3357 // NullFields is a list of field names (e.g. "KerberosConfig") to 3358 // include in API requests with the JSON null value. By default, fields 3359 // with empty values are omitted from API requests. However, any field 3360 // with an empty value appearing in NullFields will be sent to the 3361 // server as null. It is an error if a field in this list has a 3362 // non-empty value. This may be used to include null fields in Patch 3363 // requests. 3364 NullFields []string `json:"-"` 3365} 3366 3367func (s *SecurityConfig) MarshalJSON() ([]byte, error) { 3368 type NoMethod SecurityConfig 3369 raw := NoMethod(*s) 3370 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3371} 3372 3373// SetIamPolicyRequest: Request message for SetIamPolicy method. 3374type SetIamPolicyRequest struct { 3375 // Policy: REQUIRED: The complete policy to be applied to the resource. 3376 // The size of the policy is limited to a few 10s of KB. An empty policy 3377 // is a valid policy but certain Cloud Platform services (such as 3378 // Projects) might reject them. 3379 Policy *Policy `json:"policy,omitempty"` 3380 3381 // ForceSendFields is a list of field names (e.g. "Policy") to 3382 // unconditionally include in API requests. By default, fields with 3383 // empty values are omitted from API requests. However, any non-pointer, 3384 // non-interface field appearing in ForceSendFields will be sent to the 3385 // server regardless of whether the field is empty or not. This may be 3386 // used to include empty fields in Patch requests. 3387 ForceSendFields []string `json:"-"` 3388 3389 // NullFields is a list of field names (e.g. "Policy") to include in API 3390 // requests with the JSON null value. By default, fields with empty 3391 // values are omitted from API requests. However, any field with an 3392 // empty value appearing in NullFields will be sent to the server as 3393 // null. It is an error if a field in this list has a non-empty value. 3394 // This may be used to include null fields in Patch requests. 3395 NullFields []string `json:"-"` 3396} 3397 3398func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 3399 type NoMethod SetIamPolicyRequest 3400 raw := NoMethod(*s) 3401 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3402} 3403 3404// ShieldedInstanceConfig: Shielded Instance Config for clusters using 3405// Compute Engine Shielded VMs 3406// (https://cloud.google.com/security/shielded-cloud/shielded-vm). 3407type ShieldedInstanceConfig struct { 3408 // EnableIntegrityMonitoring: Optional. Defines whether instances have 3409 // integrity monitoring enabled. 3410 EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"` 3411 3412 // EnableSecureBoot: Optional. Defines whether instances have Secure 3413 // Boot enabled. 3414 EnableSecureBoot bool `json:"enableSecureBoot,omitempty"` 3415 3416 // EnableVtpm: Optional. Defines whether instances have the vTPM 3417 // enabled. 3418 EnableVtpm bool `json:"enableVtpm,omitempty"` 3419 3420 // ForceSendFields is a list of field names (e.g. 3421 // "EnableIntegrityMonitoring") to unconditionally include in API 3422 // requests. By default, fields with empty values are omitted from API 3423 // requests. However, any non-pointer, non-interface field appearing in 3424 // ForceSendFields will be sent to the server regardless of whether the 3425 // field is empty or not. This may be used to include empty fields in 3426 // Patch requests. 3427 ForceSendFields []string `json:"-"` 3428 3429 // NullFields is a list of field names (e.g. 3430 // "EnableIntegrityMonitoring") to include in API requests with the JSON 3431 // null value. By default, fields with empty values are omitted from API 3432 // requests. However, any field with an empty value appearing in 3433 // NullFields will be sent to the server as null. It is an error if a 3434 // field in this list has a non-empty value. This may be used to include 3435 // null fields in Patch requests. 3436 NullFields []string `json:"-"` 3437} 3438 3439func (s *ShieldedInstanceConfig) MarshalJSON() ([]byte, error) { 3440 type NoMethod ShieldedInstanceConfig 3441 raw := NoMethod(*s) 3442 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3443} 3444 3445// SoftwareConfig: Specifies the selection and config of software inside 3446// the cluster. 3447type SoftwareConfig struct { 3448 // ImageVersion: Optional. The version of software inside the cluster. 3449 // It must be one of the supported Dataproc Versions 3450 // (https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#supported_dataproc_versions), 3451 // such as "1.2" (including a subminor version, such as "1.2.29"), or 3452 // the "preview" version 3453 // (https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#other_versions). 3454 // If unspecified, it defaults to the latest Debian version. 3455 ImageVersion string `json:"imageVersion,omitempty"` 3456 3457 // OptionalComponents: The set of optional components to activate on the 3458 // cluster. 3459 // 3460 // Possible values: 3461 // "COMPONENT_UNSPECIFIED" - Unspecified component. Specifying this 3462 // will cause Cluster creation to fail. 3463 // "ANACONDA" - The Anaconda python distribution. The Anaconda 3464 // component is not supported in the Dataproc 2.0 image. The 2.0 image 3465 // is pre-installed with Miniconda. 3466 // "DOCKER" - Docker 3467 // "DRUID" - The Druid query engine. 3468 // "FLINK" - Flink 3469 // "HBASE" - HBase. 3470 // "HIVE_WEBHCAT" - The Hive Web HCatalog (the REST service for 3471 // accessing HCatalog). 3472 // "JUPYTER" - The Jupyter Notebook. 3473 // "KERBEROS" - The Kerberos security feature. 3474 // "PRESTO" - The Presto query engine. 3475 // "RANGER" - The Ranger service. 3476 // "SOLR" - The Solr service. 3477 // "ZEPPELIN" - The Zeppelin notebook. 3478 // "ZOOKEEPER" - The Zookeeper service. 3479 OptionalComponents []string `json:"optionalComponents,omitempty"` 3480 3481 // Properties: Optional. The properties to set on daemon config 3482 // files.Property keys are specified in prefix:property format, for 3483 // example core:hadoop.tmp.dir. The following are supported prefixes and 3484 // their mappings: capacity-scheduler: capacity-scheduler.xml core: 3485 // core-site.xml distcp: distcp-default.xml hdfs: hdfs-site.xml hive: 3486 // hive-site.xml mapred: mapred-site.xml pig: pig.properties spark: 3487 // spark-defaults.conf yarn: yarn-site.xmlFor more information, see 3488 // Cluster properties 3489 // (https://cloud.google.com/dataproc/docs/concepts/cluster-properties). 3490 Properties map[string]string `json:"properties,omitempty"` 3491 3492 // ForceSendFields is a list of field names (e.g. "ImageVersion") to 3493 // unconditionally include in API requests. By default, fields with 3494 // empty values are omitted from API requests. However, any non-pointer, 3495 // non-interface field appearing in ForceSendFields will be sent to the 3496 // server regardless of whether the field is empty or not. This may be 3497 // used to include empty fields in Patch requests. 3498 ForceSendFields []string `json:"-"` 3499 3500 // NullFields is a list of field names (e.g. "ImageVersion") to include 3501 // in API requests with the JSON null value. By default, fields with 3502 // empty values are omitted from API requests. However, any field with 3503 // an empty value appearing in NullFields will be sent to the server as 3504 // null. It is an error if a field in this list has a non-empty value. 3505 // This may be used to include null fields in Patch requests. 3506 NullFields []string `json:"-"` 3507} 3508 3509func (s *SoftwareConfig) MarshalJSON() ([]byte, error) { 3510 type NoMethod SoftwareConfig 3511 raw := NoMethod(*s) 3512 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3513} 3514 3515// SparkJob: A Dataproc job for running Apache Spark 3516// (http://spark.apache.org/) applications on YARN. The specification of 3517// the main method to call to drive the job. Specify either the jar file 3518// that contains the main class or the main class name. To pass both a 3519// main jar and a main class in that jar, add the jar to 3520// CommonJob.jar_file_uris, and then specify the main class name in 3521// main_class. 3522type SparkJob struct { 3523 // ArchiveUris: Optional. HCFS URIs of archives to be extracted into the 3524 // working directory of each executor. Supported file types: .jar, .tar, 3525 // .tar.gz, .tgz, and .zip. 3526 ArchiveUris []string `json:"archiveUris,omitempty"` 3527 3528 // Args: Optional. The arguments to pass to the driver. Do not include 3529 // arguments, such as --conf, that can be set as job properties, since a 3530 // collision may occur that causes an incorrect job submission. 3531 Args []string `json:"args,omitempty"` 3532 3533 // FileUris: Optional. HCFS URIs of files to be placed in the working 3534 // directory of each executor. Useful for naively parallel tasks. 3535 FileUris []string `json:"fileUris,omitempty"` 3536 3537 // JarFileUris: Optional. HCFS URIs of jar files to add to the 3538 // CLASSPATHs of the Spark driver and tasks. 3539 JarFileUris []string `json:"jarFileUris,omitempty"` 3540 3541 // LoggingConfig: Optional. The runtime log config for job execution. 3542 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3543 3544 // MainClass: The name of the driver's main class. The jar file that 3545 // contains the class must be in the default CLASSPATH or specified in 3546 // jar_file_uris. 3547 MainClass string `json:"mainClass,omitempty"` 3548 3549 // MainJarFileUri: The HCFS URI of the jar file that contains the main 3550 // class. 3551 MainJarFileUri string `json:"mainJarFileUri,omitempty"` 3552 3553 // Properties: Optional. A mapping of property names to values, used to 3554 // configure Spark. Properties that conflict with values set by the 3555 // Dataproc API may be overwritten. Can include properties set in 3556 // /etc/spark/conf/spark-defaults.conf and classes in user code. 3557 Properties map[string]string `json:"properties,omitempty"` 3558 3559 // ForceSendFields is a list of field names (e.g. "ArchiveUris") to 3560 // unconditionally include in API requests. By default, fields with 3561 // empty values are omitted from API requests. However, any non-pointer, 3562 // non-interface field appearing in ForceSendFields will be sent to the 3563 // server regardless of whether the field is empty or not. This may be 3564 // used to include empty fields in Patch requests. 3565 ForceSendFields []string `json:"-"` 3566 3567 // NullFields is a list of field names (e.g. "ArchiveUris") to include 3568 // in API requests with the JSON null value. By default, fields with 3569 // empty values are omitted from API requests. However, any field with 3570 // an empty value appearing in NullFields will be sent to the server as 3571 // null. It is an error if a field in this list has a non-empty value. 3572 // This may be used to include null fields in Patch requests. 3573 NullFields []string `json:"-"` 3574} 3575 3576func (s *SparkJob) MarshalJSON() ([]byte, error) { 3577 type NoMethod SparkJob 3578 raw := NoMethod(*s) 3579 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3580} 3581 3582// SparkRJob: A Dataproc job for running Apache SparkR 3583// (https://spark.apache.org/docs/latest/sparkr.html) applications on 3584// YARN. 3585type SparkRJob struct { 3586 // ArchiveUris: Optional. HCFS URIs of archives to be extracted into the 3587 // working directory of each executor. Supported file types: .jar, .tar, 3588 // .tar.gz, .tgz, and .zip. 3589 ArchiveUris []string `json:"archiveUris,omitempty"` 3590 3591 // Args: Optional. The arguments to pass to the driver. Do not include 3592 // arguments, such as --conf, that can be set as job properties, since a 3593 // collision may occur that causes an incorrect job submission. 3594 Args []string `json:"args,omitempty"` 3595 3596 // FileUris: Optional. HCFS URIs of files to be placed in the working 3597 // directory of each executor. Useful for naively parallel tasks. 3598 FileUris []string `json:"fileUris,omitempty"` 3599 3600 // LoggingConfig: Optional. The runtime log config for job execution. 3601 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3602 3603 // MainRFileUri: Required. The HCFS URI of the main R file to use as the 3604 // driver. Must be a .R file. 3605 MainRFileUri string `json:"mainRFileUri,omitempty"` 3606 3607 // Properties: Optional. A mapping of property names to values, used to 3608 // configure SparkR. Properties that conflict with values set by the 3609 // Dataproc API may be overwritten. Can include properties set in 3610 // /etc/spark/conf/spark-defaults.conf and classes in user code. 3611 Properties map[string]string `json:"properties,omitempty"` 3612 3613 // ForceSendFields is a list of field names (e.g. "ArchiveUris") to 3614 // unconditionally include in API requests. By default, fields with 3615 // empty values are omitted from API requests. However, any non-pointer, 3616 // non-interface field appearing in ForceSendFields will be sent to the 3617 // server regardless of whether the field is empty or not. This may be 3618 // used to include empty fields in Patch requests. 3619 ForceSendFields []string `json:"-"` 3620 3621 // NullFields is a list of field names (e.g. "ArchiveUris") to include 3622 // in API requests with the JSON null value. By default, fields with 3623 // empty values are omitted from API requests. However, any field with 3624 // an empty value appearing in NullFields will be sent to the server as 3625 // null. It is an error if a field in this list has a non-empty value. 3626 // This may be used to include null fields in Patch requests. 3627 NullFields []string `json:"-"` 3628} 3629 3630func (s *SparkRJob) MarshalJSON() ([]byte, error) { 3631 type NoMethod SparkRJob 3632 raw := NoMethod(*s) 3633 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3634} 3635 3636// SparkSqlJob: A Dataproc job for running Apache Spark SQL 3637// (http://spark.apache.org/sql/) queries. 3638type SparkSqlJob struct { 3639 // JarFileUris: Optional. HCFS URIs of jar files to be added to the 3640 // Spark CLASSPATH. 3641 JarFileUris []string `json:"jarFileUris,omitempty"` 3642 3643 // LoggingConfig: Optional. The runtime log config for job execution. 3644 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3645 3646 // Properties: Optional. A mapping of property names to values, used to 3647 // configure Spark SQL's SparkConf. Properties that conflict with values 3648 // set by the Dataproc API may be overwritten. 3649 Properties map[string]string `json:"properties,omitempty"` 3650 3651 // QueryFileUri: The HCFS URI of the script that contains SQL queries. 3652 QueryFileUri string `json:"queryFileUri,omitempty"` 3653 3654 // QueryList: A list of queries. 3655 QueryList *QueryList `json:"queryList,omitempty"` 3656 3657 // ScriptVariables: Optional. Mapping of query variable names to values 3658 // (equivalent to the Spark SQL command: SET name="value";). 3659 ScriptVariables map[string]string `json:"scriptVariables,omitempty"` 3660 3661 // ForceSendFields is a list of field names (e.g. "JarFileUris") to 3662 // unconditionally include in API requests. By default, fields with 3663 // empty values are omitted from API requests. However, any non-pointer, 3664 // non-interface field appearing in ForceSendFields will be sent to the 3665 // server regardless of whether the field is empty or not. This may be 3666 // used to include empty fields in Patch requests. 3667 ForceSendFields []string `json:"-"` 3668 3669 // NullFields is a list of field names (e.g. "JarFileUris") to include 3670 // in API requests with the JSON null value. By default, fields with 3671 // empty values are omitted from API requests. However, any field with 3672 // an empty value appearing in NullFields will be sent to the server as 3673 // null. It is an error if a field in this list has a non-empty value. 3674 // This may be used to include null fields in Patch requests. 3675 NullFields []string `json:"-"` 3676} 3677 3678func (s *SparkSqlJob) MarshalJSON() ([]byte, error) { 3679 type NoMethod SparkSqlJob 3680 raw := NoMethod(*s) 3681 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3682} 3683 3684// StartClusterRequest: A request to start a cluster. 3685type StartClusterRequest struct { 3686 // ClusterUuid: Optional. Specifying the cluster_uuid means the RPC will 3687 // fail (with error NOT_FOUND) if a cluster with the specified UUID does 3688 // not exist. 3689 ClusterUuid string `json:"clusterUuid,omitempty"` 3690 3691 // RequestId: Optional. A unique id used to identify the request. If the 3692 // server receives two StartClusterRequest 3693 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#google.cloud.dataproc.v1beta2.StartClusterRequest)s 3694 // with the same id, then the second request will be ignored and the 3695 // first google.longrunning.Operation created and stored in the backend 3696 // is returned.Recommendation: Set this value to a UUID 3697 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id 3698 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 3699 // and hyphens (-). The maximum length is 40 characters. 3700 RequestId string `json:"requestId,omitempty"` 3701 3702 // ForceSendFields is a list of field names (e.g. "ClusterUuid") to 3703 // unconditionally include in API requests. By default, fields with 3704 // empty values are omitted from API requests. However, any non-pointer, 3705 // non-interface field appearing in ForceSendFields will be sent to the 3706 // server regardless of whether the field is empty or not. This may be 3707 // used to include empty fields in Patch requests. 3708 ForceSendFields []string `json:"-"` 3709 3710 // NullFields is a list of field names (e.g. "ClusterUuid") to include 3711 // in API requests with the JSON null value. By default, fields with 3712 // empty values are omitted from API requests. However, any field with 3713 // an empty value appearing in NullFields will be sent to the server as 3714 // null. It is an error if a field in this list has a non-empty value. 3715 // This may be used to include null fields in Patch requests. 3716 NullFields []string `json:"-"` 3717} 3718 3719func (s *StartClusterRequest) MarshalJSON() ([]byte, error) { 3720 type NoMethod StartClusterRequest 3721 raw := NoMethod(*s) 3722 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3723} 3724 3725// Status: The Status type defines a logical error model that is 3726// suitable for different programming environments, including REST APIs 3727// and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 3728// Status message contains three pieces of data: error code, error 3729// message, and error details.You can find out more about this error 3730// model and how to work with it in the API Design Guide 3731// (https://cloud.google.com/apis/design/errors). 3732type Status struct { 3733 // Code: The status code, which should be an enum value of 3734 // google.rpc.Code. 3735 Code int64 `json:"code,omitempty"` 3736 3737 // Details: A list of messages that carry the error details. There is a 3738 // common set of message types for APIs to use. 3739 Details []googleapi.RawMessage `json:"details,omitempty"` 3740 3741 // Message: A developer-facing error message, which should be in 3742 // English. Any user-facing error message should be localized and sent 3743 // in the google.rpc.Status.details field, or localized by the client. 3744 Message string `json:"message,omitempty"` 3745 3746 // ForceSendFields is a list of field names (e.g. "Code") to 3747 // unconditionally include in API requests. By default, fields with 3748 // empty values are omitted from API requests. However, any non-pointer, 3749 // non-interface field appearing in ForceSendFields will be sent to the 3750 // server regardless of whether the field is empty or not. This may be 3751 // used to include empty fields in Patch requests. 3752 ForceSendFields []string `json:"-"` 3753 3754 // NullFields is a list of field names (e.g. "Code") to include in API 3755 // requests with the JSON null value. By default, fields with empty 3756 // values are omitted from API requests. However, any field with an 3757 // empty value appearing in NullFields will be sent to the server as 3758 // null. It is an error if a field in this list has a non-empty value. 3759 // This may be used to include null fields in Patch requests. 3760 NullFields []string `json:"-"` 3761} 3762 3763func (s *Status) MarshalJSON() ([]byte, error) { 3764 type NoMethod Status 3765 raw := NoMethod(*s) 3766 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3767} 3768 3769// StopClusterRequest: A request to stop a cluster. 3770type StopClusterRequest struct { 3771 // ClusterUuid: Optional. Specifying the cluster_uuid means the RPC will 3772 // fail (with error NOT_FOUND) if a cluster with the specified UUID does 3773 // not exist. 3774 ClusterUuid string `json:"clusterUuid,omitempty"` 3775 3776 // RequestId: Optional. A unique id used to identify the request. If the 3777 // server receives two StopClusterRequest 3778 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#google.cloud.dataproc.v1beta2.StopClusterRequest)s 3779 // with the same id, then the second request will be ignored and the 3780 // first google.longrunning.Operation created and stored in the backend 3781 // is returned.Recommendation: Set this value to a UUID 3782 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id 3783 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 3784 // and hyphens (-). The maximum length is 40 characters. 3785 RequestId string `json:"requestId,omitempty"` 3786 3787 // ForceSendFields is a list of field names (e.g. "ClusterUuid") to 3788 // unconditionally include in API requests. By default, fields with 3789 // empty values are omitted from API requests. However, any non-pointer, 3790 // non-interface field appearing in ForceSendFields will be sent to the 3791 // server regardless of whether the field is empty or not. This may be 3792 // used to include empty fields in Patch requests. 3793 ForceSendFields []string `json:"-"` 3794 3795 // NullFields is a list of field names (e.g. "ClusterUuid") to include 3796 // in API requests with the JSON null value. By default, fields with 3797 // empty values are omitted from API requests. However, any field with 3798 // an empty value appearing in NullFields will be sent to the server as 3799 // null. It is an error if a field in this list has a non-empty value. 3800 // This may be used to include null fields in Patch requests. 3801 NullFields []string `json:"-"` 3802} 3803 3804func (s *StopClusterRequest) MarshalJSON() ([]byte, error) { 3805 type NoMethod StopClusterRequest 3806 raw := NoMethod(*s) 3807 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3808} 3809 3810// SubmitJobRequest: A request to submit a job. 3811type SubmitJobRequest struct { 3812 // Job: Required. The job resource. 3813 Job *Job `json:"job,omitempty"` 3814 3815 // RequestId: Optional. A unique id used to identify the request. If the 3816 // server receives two SubmitJobRequest 3817 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#google.cloud.dataproc.v1.SubmitJobRequest)s 3818 // with the same id, then the second request will be ignored and the 3819 // first Job created and stored in the backend is returned.It is 3820 // recommended to always set this value to a UUID 3821 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id 3822 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 3823 // and hyphens (-). The maximum length is 40 characters. 3824 RequestId string `json:"requestId,omitempty"` 3825 3826 // ForceSendFields is a list of field names (e.g. "Job") to 3827 // unconditionally include in API requests. By default, fields with 3828 // empty values are omitted from API requests. However, any non-pointer, 3829 // non-interface field appearing in ForceSendFields will be sent to the 3830 // server regardless of whether the field is empty or not. This may be 3831 // used to include empty fields in Patch requests. 3832 ForceSendFields []string `json:"-"` 3833 3834 // NullFields is a list of field names (e.g. "Job") to include in API 3835 // requests with the JSON null value. By default, fields with empty 3836 // values are omitted from API requests. However, any field with an 3837 // empty value appearing in NullFields will be sent to the server as 3838 // null. It is an error if a field in this list has a non-empty value. 3839 // This may be used to include null fields in Patch requests. 3840 NullFields []string `json:"-"` 3841} 3842 3843func (s *SubmitJobRequest) MarshalJSON() ([]byte, error) { 3844 type NoMethod SubmitJobRequest 3845 raw := NoMethod(*s) 3846 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3847} 3848 3849// TemplateParameter: A configurable parameter that replaces one or more 3850// fields in the template. Parameterizable fields: - Labels - File uris 3851// - Job properties - Job arguments - Script variables - Main class (in 3852// HadoopJob and SparkJob) - Zone (in ClusterSelector) 3853type TemplateParameter struct { 3854 // Description: Optional. Brief description of the parameter. Must not 3855 // exceed 1024 characters. 3856 Description string `json:"description,omitempty"` 3857 3858 // Fields: Required. Paths to all fields that the parameter replaces. A 3859 // field is allowed to appear in at most one parameter's list of field 3860 // paths.A field path is similar in syntax to a 3861 // google.protobuf.FieldMask. For example, a field path that references 3862 // the zone field of a workflow template's cluster selector would be 3863 // specified as placement.clusterSelector.zone.Also, field paths can 3864 // reference fields using the following syntax: Values in maps can be 3865 // referenced by key: labels'key' 3866 // placement.clusterSelector.clusterLabels'key' 3867 // placement.managedCluster.labels'key' 3868 // placement.clusterSelector.clusterLabels'key' 3869 // jobs'step-id'.labels'key' Jobs in the jobs list can be referenced by 3870 // step-id: jobs'step-id'.hadoopJob.mainJarFileUri 3871 // jobs'step-id'.hiveJob.queryFileUri 3872 // jobs'step-id'.pySparkJob.mainPythonFileUri 3873 // jobs'step-id'.hadoopJob.jarFileUris0 3874 // jobs'step-id'.hadoopJob.archiveUris0 3875 // jobs'step-id'.hadoopJob.fileUris0 3876 // jobs'step-id'.pySparkJob.pythonFileUris0 Items in repeated fields can 3877 // be referenced by a zero-based index: jobs'step-id'.sparkJob.args0 3878 // Other examples: jobs'step-id'.hadoopJob.properties'key' 3879 // jobs'step-id'.hadoopJob.args0 3880 // jobs'step-id'.hiveJob.scriptVariables'key' 3881 // jobs'step-id'.hadoopJob.mainJarFileUri 3882 // placement.clusterSelector.zoneIt may not be possible to parameterize 3883 // maps and repeated fields in their entirety since only individual map 3884 // values and individual items in repeated fields can be referenced. For 3885 // example, the following field paths are invalid: 3886 // placement.clusterSelector.clusterLabels jobs'step-id'.sparkJob.args 3887 Fields []string `json:"fields,omitempty"` 3888 3889 // Name: Required. Parameter name. The parameter name is used as the 3890 // key, and paired with the parameter value, which are passed to the 3891 // template when the template is instantiated. The name must contain 3892 // only capital letters (A-Z), numbers (0-9), and underscores (_), and 3893 // must not start with a number. The maximum length is 40 characters. 3894 Name string `json:"name,omitempty"` 3895 3896 // Validation: Optional. Validation rules to be applied to this 3897 // parameter's value. 3898 Validation *ParameterValidation `json:"validation,omitempty"` 3899 3900 // ForceSendFields is a list of field names (e.g. "Description") to 3901 // unconditionally include in API requests. By default, fields with 3902 // empty values are omitted from API requests. However, any non-pointer, 3903 // non-interface field appearing in ForceSendFields will be sent to the 3904 // server regardless of whether the field is empty or not. This may be 3905 // used to include empty fields in Patch requests. 3906 ForceSendFields []string `json:"-"` 3907 3908 // NullFields is a list of field names (e.g. "Description") to include 3909 // in API requests with the JSON null value. By default, fields with 3910 // empty values are omitted from API requests. However, any field with 3911 // an empty value appearing in NullFields will be sent to the server as 3912 // null. It is an error if a field in this list has a non-empty value. 3913 // This may be used to include null fields in Patch requests. 3914 NullFields []string `json:"-"` 3915} 3916 3917func (s *TemplateParameter) MarshalJSON() ([]byte, error) { 3918 type NoMethod TemplateParameter 3919 raw := NoMethod(*s) 3920 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3921} 3922 3923// TestIamPermissionsRequest: Request message for TestIamPermissions 3924// method. 3925type TestIamPermissionsRequest struct { 3926 // Permissions: The set of permissions to check for the resource. 3927 // Permissions with wildcards (such as '*' or 'storage.*') are not 3928 // allowed. For more information see IAM Overview 3929 // (https://cloud.google.com/iam/docs/overview#permissions). 3930 Permissions []string `json:"permissions,omitempty"` 3931 3932 // ForceSendFields is a list of field names (e.g. "Permissions") to 3933 // unconditionally include in API requests. By default, fields with 3934 // empty values are omitted from API requests. However, any non-pointer, 3935 // non-interface field appearing in ForceSendFields will be sent to the 3936 // server regardless of whether the field is empty or not. This may be 3937 // used to include empty fields in Patch requests. 3938 ForceSendFields []string `json:"-"` 3939 3940 // NullFields is a list of field names (e.g. "Permissions") to include 3941 // in API requests with the JSON null value. By default, fields with 3942 // empty values are omitted from API requests. However, any field with 3943 // an empty value appearing in NullFields will be sent to the server as 3944 // null. It is an error if a field in this list has a non-empty value. 3945 // This may be used to include null fields in Patch requests. 3946 NullFields []string `json:"-"` 3947} 3948 3949func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 3950 type NoMethod TestIamPermissionsRequest 3951 raw := NoMethod(*s) 3952 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3953} 3954 3955// TestIamPermissionsResponse: Response message for TestIamPermissions 3956// method. 3957type TestIamPermissionsResponse struct { 3958 // Permissions: A subset of TestPermissionsRequest.permissions that the 3959 // caller is allowed. 3960 Permissions []string `json:"permissions,omitempty"` 3961 3962 // ServerResponse contains the HTTP response code and headers from the 3963 // server. 3964 googleapi.ServerResponse `json:"-"` 3965 3966 // ForceSendFields is a list of field names (e.g. "Permissions") to 3967 // unconditionally include in API requests. By default, fields with 3968 // empty values are omitted from API requests. However, any non-pointer, 3969 // non-interface field appearing in ForceSendFields will be sent to the 3970 // server regardless of whether the field is empty or not. This may be 3971 // used to include empty fields in Patch requests. 3972 ForceSendFields []string `json:"-"` 3973 3974 // NullFields is a list of field names (e.g. "Permissions") to include 3975 // in API requests with the JSON null value. By default, fields with 3976 // empty values are omitted from API requests. However, any field with 3977 // an empty value appearing in NullFields will be sent to the server as 3978 // null. It is an error if a field in this list has a non-empty value. 3979 // This may be used to include null fields in Patch requests. 3980 NullFields []string `json:"-"` 3981} 3982 3983func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 3984 type NoMethod TestIamPermissionsResponse 3985 raw := NoMethod(*s) 3986 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3987} 3988 3989// ValueValidation: Validation based on a list of allowed values. 3990type ValueValidation struct { 3991 // Values: Required. List of allowed values for the parameter. 3992 Values []string `json:"values,omitempty"` 3993 3994 // ForceSendFields is a list of field names (e.g. "Values") to 3995 // unconditionally include in API requests. By default, fields with 3996 // empty values are omitted from API requests. However, any non-pointer, 3997 // non-interface field appearing in ForceSendFields will be sent to the 3998 // server regardless of whether the field is empty or not. This may be 3999 // used to include empty fields in Patch requests. 4000 ForceSendFields []string `json:"-"` 4001 4002 // NullFields is a list of field names (e.g. "Values") to include in API 4003 // requests with the JSON null value. By default, fields with empty 4004 // values are omitted from API requests. However, any field with an 4005 // empty value appearing in NullFields will be sent to the server as 4006 // null. It is an error if a field in this list has a non-empty value. 4007 // This may be used to include null fields in Patch requests. 4008 NullFields []string `json:"-"` 4009} 4010 4011func (s *ValueValidation) MarshalJSON() ([]byte, error) { 4012 type NoMethod ValueValidation 4013 raw := NoMethod(*s) 4014 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4015} 4016 4017// WorkflowGraph: The workflow graph. 4018type WorkflowGraph struct { 4019 // Nodes: Output only. The workflow nodes. 4020 Nodes []*WorkflowNode `json:"nodes,omitempty"` 4021 4022 // ForceSendFields is a list of field names (e.g. "Nodes") to 4023 // unconditionally include in API requests. By default, fields with 4024 // empty values are omitted from API requests. However, any non-pointer, 4025 // non-interface field appearing in ForceSendFields will be sent to the 4026 // server regardless of whether the field is empty or not. This may be 4027 // used to include empty fields in Patch requests. 4028 ForceSendFields []string `json:"-"` 4029 4030 // NullFields is a list of field names (e.g. "Nodes") to include in API 4031 // requests with the JSON null value. By default, fields with empty 4032 // values are omitted from API requests. However, any field with an 4033 // empty value appearing in NullFields will be sent to the server as 4034 // null. It is an error if a field in this list has a non-empty value. 4035 // This may be used to include null fields in Patch requests. 4036 NullFields []string `json:"-"` 4037} 4038 4039func (s *WorkflowGraph) MarshalJSON() ([]byte, error) { 4040 type NoMethod WorkflowGraph 4041 raw := NoMethod(*s) 4042 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4043} 4044 4045// WorkflowMetadata: A Dataproc workflow template resource. 4046type WorkflowMetadata struct { 4047 // ClusterName: Output only. The name of the target cluster. 4048 ClusterName string `json:"clusterName,omitempty"` 4049 4050 // ClusterUuid: Output only. The UUID of target cluster. 4051 ClusterUuid string `json:"clusterUuid,omitempty"` 4052 4053 // CreateCluster: Output only. The create cluster operation metadata. 4054 CreateCluster *ClusterOperation `json:"createCluster,omitempty"` 4055 4056 // DagEndTime: Output only. DAG end time, which is only set for 4057 // workflows with dag_timeout when the DAG ends. 4058 DagEndTime string `json:"dagEndTime,omitempty"` 4059 4060 // DagStartTime: Output only. DAG start time, which is only set for 4061 // workflows with dag_timeout when the DAG begins. 4062 DagStartTime string `json:"dagStartTime,omitempty"` 4063 4064 // DagTimeout: Output only. The timeout duration for the DAG of jobs, 4065 // expressed in seconds (see JSON representation of duration 4066 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 4067 DagTimeout string `json:"dagTimeout,omitempty"` 4068 4069 // DeleteCluster: Output only. The delete cluster operation metadata. 4070 DeleteCluster *ClusterOperation `json:"deleteCluster,omitempty"` 4071 4072 // EndTime: Output only. Workflow end time. 4073 EndTime string `json:"endTime,omitempty"` 4074 4075 // Graph: Output only. The workflow graph. 4076 Graph *WorkflowGraph `json:"graph,omitempty"` 4077 4078 // Parameters: Map from parameter names to values that were used for 4079 // those parameters. 4080 Parameters map[string]string `json:"parameters,omitempty"` 4081 4082 // StartTime: Output only. Workflow start time. 4083 StartTime string `json:"startTime,omitempty"` 4084 4085 // State: Output only. The workflow state. 4086 // 4087 // Possible values: 4088 // "UNKNOWN" - Unused. 4089 // "PENDING" - The operation has been created. 4090 // "RUNNING" - The operation is running. 4091 // "DONE" - The operation is done; either cancelled or completed. 4092 State string `json:"state,omitempty"` 4093 4094 // Template: Output only. The resource name of the workflow template as 4095 // described in https://cloud.google.com/apis/design/resource_names. For 4096 // projects.regions.workflowTemplates, the resource name of the template 4097 // has the following format: 4098 // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} 4099 // For projects.locations.workflowTemplates, the resource name of the 4100 // template has the following format: 4101 // projects/{project_id}/locations/{location}/workflowTemplates/{template 4102 // _id} 4103 Template string `json:"template,omitempty"` 4104 4105 // Version: Output only. The version of template at the time of workflow 4106 // instantiation. 4107 Version int64 `json:"version,omitempty"` 4108 4109 // ForceSendFields is a list of field names (e.g. "ClusterName") to 4110 // unconditionally include in API requests. By default, fields with 4111 // empty values are omitted from API requests. However, any non-pointer, 4112 // non-interface field appearing in ForceSendFields will be sent to the 4113 // server regardless of whether the field is empty or not. This may be 4114 // used to include empty fields in Patch requests. 4115 ForceSendFields []string `json:"-"` 4116 4117 // NullFields is a list of field names (e.g. "ClusterName") to include 4118 // in API requests with the JSON null value. By default, fields with 4119 // empty values are omitted from API requests. However, any field with 4120 // an empty value appearing in NullFields will be sent to the server as 4121 // null. It is an error if a field in this list has a non-empty value. 4122 // This may be used to include null fields in Patch requests. 4123 NullFields []string `json:"-"` 4124} 4125 4126func (s *WorkflowMetadata) MarshalJSON() ([]byte, error) { 4127 type NoMethod WorkflowMetadata 4128 raw := NoMethod(*s) 4129 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4130} 4131 4132// WorkflowNode: The workflow node. 4133type WorkflowNode struct { 4134 // Error: Output only. The error detail. 4135 Error string `json:"error,omitempty"` 4136 4137 // JobId: Output only. The job id; populated after the node enters 4138 // RUNNING state. 4139 JobId string `json:"jobId,omitempty"` 4140 4141 // PrerequisiteStepIds: Output only. Node's prerequisite nodes. 4142 PrerequisiteStepIds []string `json:"prerequisiteStepIds,omitempty"` 4143 4144 // State: Output only. The node state. 4145 // 4146 // Possible values: 4147 // "NODE_STATUS_UNSPECIFIED" - State is unspecified. 4148 // "BLOCKED" - The node is awaiting prerequisite node to finish. 4149 // "RUNNABLE" - The node is runnable but not running. 4150 // "RUNNING" - The node is running. 4151 // "COMPLETED" - The node completed successfully. 4152 // "FAILED" - The node failed. A node can be marked FAILED because its 4153 // ancestor or peer failed. 4154 State string `json:"state,omitempty"` 4155 4156 // StepId: Output only. The name of the node. 4157 StepId string `json:"stepId,omitempty"` 4158 4159 // ForceSendFields is a list of field names (e.g. "Error") to 4160 // unconditionally include in API requests. By default, fields with 4161 // empty values are omitted from API requests. However, any non-pointer, 4162 // non-interface field appearing in ForceSendFields will be sent to the 4163 // server regardless of whether the field is empty or not. This may be 4164 // used to include empty fields in Patch requests. 4165 ForceSendFields []string `json:"-"` 4166 4167 // NullFields is a list of field names (e.g. "Error") to include in API 4168 // requests with the JSON null value. By default, fields with empty 4169 // values are omitted from API requests. However, any field with an 4170 // empty value appearing in NullFields will be sent to the server as 4171 // null. It is an error if a field in this list has a non-empty value. 4172 // This may be used to include null fields in Patch requests. 4173 NullFields []string `json:"-"` 4174} 4175 4176func (s *WorkflowNode) MarshalJSON() ([]byte, error) { 4177 type NoMethod WorkflowNode 4178 raw := NoMethod(*s) 4179 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4180} 4181 4182// WorkflowTemplate: A Dataproc workflow template resource. 4183type WorkflowTemplate struct { 4184 // CreateTime: Output only. The time template was created. 4185 CreateTime string `json:"createTime,omitempty"` 4186 4187 // DagTimeout: Optional. Timeout duration for the DAG of jobs, expressed 4188 // in seconds (see JSON representation of duration 4189 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 4190 // The timeout duration must be from 10 minutes ("600s") to 24 hours 4191 // ("86400s"). The timer begins when the first job is submitted. If the 4192 // workflow is running at the end of the timeout period, any remaining 4193 // jobs are cancelled, the workflow is ended, and if the workflow was 4194 // running on a managed cluster, the cluster is deleted. 4195 DagTimeout string `json:"dagTimeout,omitempty"` 4196 4197 // Id: Required. The template id.The id must contain only letters (a-z, 4198 // A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin 4199 // or end with underscore or hyphen. Must consist of between 3 and 50 4200 // characters.. 4201 Id string `json:"id,omitempty"` 4202 4203 // Jobs: Required. The Directed Acyclic Graph of Jobs to submit. 4204 Jobs []*OrderedJob `json:"jobs,omitempty"` 4205 4206 // Labels: Optional. The labels to associate with this template. These 4207 // labels will be propagated to all jobs and clusters created by the 4208 // workflow instance.Label keys must contain 1 to 63 characters, and 4209 // must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).Label 4210 // values may be empty, but, if present, must contain 1 to 63 4211 // characters, and must conform to RFC 1035 4212 // (https://www.ietf.org/rfc/rfc1035.txt).No more than 32 labels can be 4213 // associated with a template. 4214 Labels map[string]string `json:"labels,omitempty"` 4215 4216 // Name: Output only. The resource name of the workflow template, as 4217 // described in https://cloud.google.com/apis/design/resource_names. For 4218 // projects.regions.workflowTemplates, the resource name of the template 4219 // has the following format: 4220 // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} 4221 // For projects.locations.workflowTemplates, the resource name of the 4222 // template has the following format: 4223 // projects/{project_id}/locations/{location}/workflowTemplates/{template 4224 // _id} 4225 Name string `json:"name,omitempty"` 4226 4227 // Parameters: Optional. Template parameters whose values are 4228 // substituted into the template. Values for parameters must be provided 4229 // when the template is instantiated. 4230 Parameters []*TemplateParameter `json:"parameters,omitempty"` 4231 4232 // Placement: Required. WorkflowTemplate scheduling information. 4233 Placement *WorkflowTemplatePlacement `json:"placement,omitempty"` 4234 4235 // UpdateTime: Output only. The time template was last updated. 4236 UpdateTime string `json:"updateTime,omitempty"` 4237 4238 // Version: Optional. Used to perform a consistent 4239 // read-modify-write.This field should be left blank for a 4240 // CreateWorkflowTemplate request. It is required for an 4241 // UpdateWorkflowTemplate request, and must match the current server 4242 // version. A typical update template flow would fetch the current 4243 // template with a GetWorkflowTemplate request, which will return the 4244 // current template with the version field filled in with the current 4245 // server version. The user updates other fields in the template, then 4246 // returns it as part of the UpdateWorkflowTemplate request. 4247 Version int64 `json:"version,omitempty"` 4248 4249 // ServerResponse contains the HTTP response code and headers from the 4250 // server. 4251 googleapi.ServerResponse `json:"-"` 4252 4253 // ForceSendFields is a list of field names (e.g. "CreateTime") to 4254 // unconditionally include in API requests. By default, fields with 4255 // empty values are omitted from API requests. However, any non-pointer, 4256 // non-interface field appearing in ForceSendFields will be sent to the 4257 // server regardless of whether the field is empty or not. This may be 4258 // used to include empty fields in Patch requests. 4259 ForceSendFields []string `json:"-"` 4260 4261 // NullFields is a list of field names (e.g. "CreateTime") to include in 4262 // API requests with the JSON null value. By default, fields with empty 4263 // values are omitted from API requests. However, any field with an 4264 // empty value appearing in NullFields will be sent to the server as 4265 // null. It is an error if a field in this list has a non-empty value. 4266 // This may be used to include null fields in Patch requests. 4267 NullFields []string `json:"-"` 4268} 4269 4270func (s *WorkflowTemplate) MarshalJSON() ([]byte, error) { 4271 type NoMethod WorkflowTemplate 4272 raw := NoMethod(*s) 4273 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4274} 4275 4276// WorkflowTemplatePlacement: Specifies workflow execution target.Either 4277// managed_cluster or cluster_selector is required. 4278type WorkflowTemplatePlacement struct { 4279 // ClusterSelector: Optional. A selector that chooses target cluster for 4280 // jobs based on metadata.The selector is evaluated at the time each job 4281 // is submitted. 4282 ClusterSelector *ClusterSelector `json:"clusterSelector,omitempty"` 4283 4284 // ManagedCluster: Optional. A cluster that is managed by the workflow. 4285 ManagedCluster *ManagedCluster `json:"managedCluster,omitempty"` 4286 4287 // ForceSendFields is a list of field names (e.g. "ClusterSelector") to 4288 // unconditionally include in API requests. By default, fields with 4289 // empty values are omitted from API requests. However, any non-pointer, 4290 // non-interface field appearing in ForceSendFields will be sent to the 4291 // server regardless of whether the field is empty or not. This may be 4292 // used to include empty fields in Patch requests. 4293 ForceSendFields []string `json:"-"` 4294 4295 // NullFields is a list of field names (e.g. "ClusterSelector") to 4296 // include in API requests with the JSON null value. By default, fields 4297 // with empty values are omitted from API requests. However, any field 4298 // with an empty value appearing in NullFields will be sent to the 4299 // server as null. It is an error if a field in this list has a 4300 // non-empty value. This may be used to include null fields in Patch 4301 // requests. 4302 NullFields []string `json:"-"` 4303} 4304 4305func (s *WorkflowTemplatePlacement) MarshalJSON() ([]byte, error) { 4306 type NoMethod WorkflowTemplatePlacement 4307 raw := NoMethod(*s) 4308 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4309} 4310 4311// YarnApplication: A YARN application created by a job. Application 4312// information is a subset of 4313// org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto.Beta 4314// Feature: This report is available for testing purposes only. It may 4315// be changed before final release. 4316type YarnApplication struct { 4317 // Name: Output only. The application name. 4318 Name string `json:"name,omitempty"` 4319 4320 // Progress: Output only. The numerical progress of the application, 4321 // from 1 to 100. 4322 Progress float64 `json:"progress,omitempty"` 4323 4324 // State: Output only. The application state. 4325 // 4326 // Possible values: 4327 // "STATE_UNSPECIFIED" - Status is unspecified. 4328 // "NEW" - Status is NEW. 4329 // "NEW_SAVING" - Status is NEW_SAVING. 4330 // "SUBMITTED" - Status is SUBMITTED. 4331 // "ACCEPTED" - Status is ACCEPTED. 4332 // "RUNNING" - Status is RUNNING. 4333 // "FINISHED" - Status is FINISHED. 4334 // "FAILED" - Status is FAILED. 4335 // "KILLED" - Status is KILLED. 4336 State string `json:"state,omitempty"` 4337 4338 // TrackingUrl: Output only. The HTTP URL of the ApplicationMaster, 4339 // HistoryServer, or TimelineServer that provides application-specific 4340 // information. The URL uses the internal hostname, and requires a proxy 4341 // server for resolution and, possibly, access. 4342 TrackingUrl string `json:"trackingUrl,omitempty"` 4343 4344 // ForceSendFields is a list of field names (e.g. "Name") to 4345 // unconditionally include in API requests. By default, fields with 4346 // empty values are omitted from API requests. However, any non-pointer, 4347 // non-interface field appearing in ForceSendFields will be sent to the 4348 // server regardless of whether the field is empty or not. This may be 4349 // used to include empty fields in Patch requests. 4350 ForceSendFields []string `json:"-"` 4351 4352 // NullFields is a list of field names (e.g. "Name") to include in API 4353 // requests with the JSON null value. By default, fields with empty 4354 // values are omitted from API requests. However, any field with an 4355 // empty value appearing in NullFields will be sent to the server as 4356 // null. It is an error if a field in this list has a non-empty value. 4357 // This may be used to include null fields in Patch requests. 4358 NullFields []string `json:"-"` 4359} 4360 4361func (s *YarnApplication) MarshalJSON() ([]byte, error) { 4362 type NoMethod YarnApplication 4363 raw := NoMethod(*s) 4364 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4365} 4366 4367func (s *YarnApplication) UnmarshalJSON(data []byte) error { 4368 type NoMethod YarnApplication 4369 var s1 struct { 4370 Progress gensupport.JSONFloat64 `json:"progress"` 4371 *NoMethod 4372 } 4373 s1.NoMethod = (*NoMethod)(s) 4374 if err := json.Unmarshal(data, &s1); err != nil { 4375 return err 4376 } 4377 s.Progress = float64(s1.Progress) 4378 return nil 4379} 4380 4381// method id "dataproc.projects.locations.autoscalingPolicies.create": 4382 4383type ProjectsLocationsAutoscalingPoliciesCreateCall struct { 4384 s *Service 4385 parent string 4386 autoscalingpolicy *AutoscalingPolicy 4387 urlParams_ gensupport.URLParams 4388 ctx_ context.Context 4389 header_ http.Header 4390} 4391 4392// Create: Creates new autoscaling policy. 4393// 4394// - parent: The "resource name" of the region or location, as described 4395// in https://cloud.google.com/apis/design/resource_names. For 4396// projects.regions.autoscalingPolicies.create, the resource name has 4397// the following format: projects/{project_id}/regions/{region} For 4398// projects.locations.autoscalingPolicies.create, the resource name 4399// has the following format: 4400// projects/{project_id}/locations/{location}. 4401func (r *ProjectsLocationsAutoscalingPoliciesService) Create(parent string, autoscalingpolicy *AutoscalingPolicy) *ProjectsLocationsAutoscalingPoliciesCreateCall { 4402 c := &ProjectsLocationsAutoscalingPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4403 c.parent = parent 4404 c.autoscalingpolicy = autoscalingpolicy 4405 return c 4406} 4407 4408// Fields allows partial responses to be retrieved. See 4409// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4410// for more information. 4411func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesCreateCall { 4412 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4413 return c 4414} 4415 4416// Context sets the context to be used in this call's Do method. Any 4417// pending HTTP request will be aborted if the provided context is 4418// canceled. 4419func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesCreateCall { 4420 c.ctx_ = ctx 4421 return c 4422} 4423 4424// Header returns an http.Header that can be modified by the caller to 4425// add HTTP headers to the request. 4426func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Header() http.Header { 4427 if c.header_ == nil { 4428 c.header_ = make(http.Header) 4429 } 4430 return c.header_ 4431} 4432 4433func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { 4434 reqHeaders := make(http.Header) 4435 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 4436 for k, v := range c.header_ { 4437 reqHeaders[k] = v 4438 } 4439 reqHeaders.Set("User-Agent", c.s.userAgent()) 4440 var body io.Reader = nil 4441 body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) 4442 if err != nil { 4443 return nil, err 4444 } 4445 reqHeaders.Set("Content-Type", "application/json") 4446 c.urlParams_.Set("alt", alt) 4447 c.urlParams_.Set("prettyPrint", "false") 4448 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/autoscalingPolicies") 4449 urls += "?" + c.urlParams_.Encode() 4450 req, err := http.NewRequest("POST", urls, body) 4451 if err != nil { 4452 return nil, err 4453 } 4454 req.Header = reqHeaders 4455 googleapi.Expand(req.URL, map[string]string{ 4456 "parent": c.parent, 4457 }) 4458 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4459} 4460 4461// Do executes the "dataproc.projects.locations.autoscalingPolicies.create" call. 4462// Exactly one of *AutoscalingPolicy or error will be non-nil. Any 4463// non-2xx status code is an error. Response headers are in either 4464// *AutoscalingPolicy.ServerResponse.Header or (if a response was 4465// returned at all) in error.(*googleapi.Error).Header. Use 4466// googleapi.IsNotModified to check whether the returned error was 4467// because http.StatusNotModified was returned. 4468func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 4469 gensupport.SetOptions(c.urlParams_, opts...) 4470 res, err := c.doRequest("json") 4471 if res != nil && res.StatusCode == http.StatusNotModified { 4472 if res.Body != nil { 4473 res.Body.Close() 4474 } 4475 return nil, &googleapi.Error{ 4476 Code: res.StatusCode, 4477 Header: res.Header, 4478 } 4479 } 4480 if err != nil { 4481 return nil, err 4482 } 4483 defer googleapi.CloseBody(res) 4484 if err := googleapi.CheckResponse(res); err != nil { 4485 return nil, err 4486 } 4487 ret := &AutoscalingPolicy{ 4488 ServerResponse: googleapi.ServerResponse{ 4489 Header: res.Header, 4490 HTTPStatusCode: res.StatusCode, 4491 }, 4492 } 4493 target := &ret 4494 if err := gensupport.DecodeResponse(target, res); err != nil { 4495 return nil, err 4496 } 4497 return ret, nil 4498 // { 4499 // "description": "Creates new autoscaling policy.", 4500 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies", 4501 // "httpMethod": "POST", 4502 // "id": "dataproc.projects.locations.autoscalingPolicies.create", 4503 // "parameterOrder": [ 4504 // "parent" 4505 // ], 4506 // "parameters": { 4507 // "parent": { 4508 // "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 has the following format: projects/{project_id}/regions/{region} For projects.locations.autoscalingPolicies.create, the resource name has the following format: projects/{project_id}/locations/{location}", 4509 // "location": "path", 4510 // "pattern": "^projects/[^/]+/locations/[^/]+$", 4511 // "required": true, 4512 // "type": "string" 4513 // } 4514 // }, 4515 // "path": "v1beta2/{+parent}/autoscalingPolicies", 4516 // "request": { 4517 // "$ref": "AutoscalingPolicy" 4518 // }, 4519 // "response": { 4520 // "$ref": "AutoscalingPolicy" 4521 // }, 4522 // "scopes": [ 4523 // "https://www.googleapis.com/auth/cloud-platform" 4524 // ] 4525 // } 4526 4527} 4528 4529// method id "dataproc.projects.locations.autoscalingPolicies.delete": 4530 4531type ProjectsLocationsAutoscalingPoliciesDeleteCall struct { 4532 s *Service 4533 name string 4534 urlParams_ gensupport.URLParams 4535 ctx_ context.Context 4536 header_ http.Header 4537} 4538 4539// Delete: Deletes an autoscaling policy. It is an error to delete an 4540// autoscaling policy that is in use by one or more clusters. 4541// 4542// - name: The "resource name" of the autoscaling policy, as described 4543// in https://cloud.google.com/apis/design/resource_names. For 4544// projects.regions.autoscalingPolicies.delete, the resource name of 4545// the policy has the following format: 4546// projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 4547// d} For projects.locations.autoscalingPolicies.delete, the resource 4548// name of the policy has the following format: 4549// projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 4550// cy_id}. 4551func (r *ProjectsLocationsAutoscalingPoliciesService) Delete(name string) *ProjectsLocationsAutoscalingPoliciesDeleteCall { 4552 c := &ProjectsLocationsAutoscalingPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4553 c.name = name 4554 return c 4555} 4556 4557// Fields allows partial responses to be retrieved. See 4558// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4559// for more information. 4560func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesDeleteCall { 4561 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4562 return c 4563} 4564 4565// Context sets the context to be used in this call's Do method. Any 4566// pending HTTP request will be aborted if the provided context is 4567// canceled. 4568func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesDeleteCall { 4569 c.ctx_ = ctx 4570 return c 4571} 4572 4573// Header returns an http.Header that can be modified by the caller to 4574// add HTTP headers to the request. 4575func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Header() http.Header { 4576 if c.header_ == nil { 4577 c.header_ = make(http.Header) 4578 } 4579 return c.header_ 4580} 4581 4582func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { 4583 reqHeaders := make(http.Header) 4584 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 4585 for k, v := range c.header_ { 4586 reqHeaders[k] = v 4587 } 4588 reqHeaders.Set("User-Agent", c.s.userAgent()) 4589 var body io.Reader = nil 4590 c.urlParams_.Set("alt", alt) 4591 c.urlParams_.Set("prettyPrint", "false") 4592 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 4593 urls += "?" + c.urlParams_.Encode() 4594 req, err := http.NewRequest("DELETE", urls, body) 4595 if err != nil { 4596 return nil, err 4597 } 4598 req.Header = reqHeaders 4599 googleapi.Expand(req.URL, map[string]string{ 4600 "name": c.name, 4601 }) 4602 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4603} 4604 4605// Do executes the "dataproc.projects.locations.autoscalingPolicies.delete" call. 4606// Exactly one of *Empty or error will be non-nil. Any non-2xx status 4607// code is an error. Response headers are in either 4608// *Empty.ServerResponse.Header or (if a response was returned at all) 4609// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4610// check whether the returned error was because http.StatusNotModified 4611// was returned. 4612func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 4613 gensupport.SetOptions(c.urlParams_, opts...) 4614 res, err := c.doRequest("json") 4615 if res != nil && res.StatusCode == http.StatusNotModified { 4616 if res.Body != nil { 4617 res.Body.Close() 4618 } 4619 return nil, &googleapi.Error{ 4620 Code: res.StatusCode, 4621 Header: res.Header, 4622 } 4623 } 4624 if err != nil { 4625 return nil, err 4626 } 4627 defer googleapi.CloseBody(res) 4628 if err := googleapi.CheckResponse(res); err != nil { 4629 return nil, err 4630 } 4631 ret := &Empty{ 4632 ServerResponse: googleapi.ServerResponse{ 4633 Header: res.Header, 4634 HTTPStatusCode: res.StatusCode, 4635 }, 4636 } 4637 target := &ret 4638 if err := gensupport.DecodeResponse(target, res); err != nil { 4639 return nil, err 4640 } 4641 return ret, nil 4642 // { 4643 // "description": "Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.", 4644 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}", 4645 // "httpMethod": "DELETE", 4646 // "id": "dataproc.projects.locations.autoscalingPolicies.delete", 4647 // "parameterOrder": [ 4648 // "name" 4649 // ], 4650 // "parameters": { 4651 // "name": { 4652 // "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}", 4653 // "location": "path", 4654 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 4655 // "required": true, 4656 // "type": "string" 4657 // } 4658 // }, 4659 // "path": "v1beta2/{+name}", 4660 // "response": { 4661 // "$ref": "Empty" 4662 // }, 4663 // "scopes": [ 4664 // "https://www.googleapis.com/auth/cloud-platform" 4665 // ] 4666 // } 4667 4668} 4669 4670// method id "dataproc.projects.locations.autoscalingPolicies.get": 4671 4672type ProjectsLocationsAutoscalingPoliciesGetCall struct { 4673 s *Service 4674 name string 4675 urlParams_ gensupport.URLParams 4676 ifNoneMatch_ string 4677 ctx_ context.Context 4678 header_ http.Header 4679} 4680 4681// Get: Retrieves autoscaling policy. 4682// 4683// - name: The "resource name" of the autoscaling policy, as described 4684// in https://cloud.google.com/apis/design/resource_names. For 4685// projects.regions.autoscalingPolicies.get, the resource name of the 4686// policy has the following format: 4687// projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 4688// d} For projects.locations.autoscalingPolicies.get, the resource 4689// name of the policy has the following format: 4690// projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 4691// cy_id}. 4692func (r *ProjectsLocationsAutoscalingPoliciesService) Get(name string) *ProjectsLocationsAutoscalingPoliciesGetCall { 4693 c := &ProjectsLocationsAutoscalingPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4694 c.name = name 4695 return c 4696} 4697 4698// Fields allows partial responses to be retrieved. See 4699// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4700// for more information. 4701func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesGetCall { 4702 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4703 return c 4704} 4705 4706// IfNoneMatch sets the optional parameter which makes the operation 4707// fail if the object's ETag matches the given value. This is useful for 4708// getting updates only after the object has changed since the last 4709// request. Use googleapi.IsNotModified to check whether the response 4710// error from Do is the result of In-None-Match. 4711func (c *ProjectsLocationsAutoscalingPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAutoscalingPoliciesGetCall { 4712 c.ifNoneMatch_ = entityTag 4713 return c 4714} 4715 4716// Context sets the context to be used in this call's Do method. Any 4717// pending HTTP request will be aborted if the provided context is 4718// canceled. 4719func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesGetCall { 4720 c.ctx_ = ctx 4721 return c 4722} 4723 4724// Header returns an http.Header that can be modified by the caller to 4725// add HTTP headers to the request. 4726func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Header() http.Header { 4727 if c.header_ == nil { 4728 c.header_ = make(http.Header) 4729 } 4730 return c.header_ 4731} 4732 4733func (c *ProjectsLocationsAutoscalingPoliciesGetCall) doRequest(alt string) (*http.Response, error) { 4734 reqHeaders := make(http.Header) 4735 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 4736 for k, v := range c.header_ { 4737 reqHeaders[k] = v 4738 } 4739 reqHeaders.Set("User-Agent", c.s.userAgent()) 4740 if c.ifNoneMatch_ != "" { 4741 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4742 } 4743 var body io.Reader = nil 4744 c.urlParams_.Set("alt", alt) 4745 c.urlParams_.Set("prettyPrint", "false") 4746 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 4747 urls += "?" + c.urlParams_.Encode() 4748 req, err := http.NewRequest("GET", urls, body) 4749 if err != nil { 4750 return nil, err 4751 } 4752 req.Header = reqHeaders 4753 googleapi.Expand(req.URL, map[string]string{ 4754 "name": c.name, 4755 }) 4756 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4757} 4758 4759// Do executes the "dataproc.projects.locations.autoscalingPolicies.get" call. 4760// Exactly one of *AutoscalingPolicy or error will be non-nil. Any 4761// non-2xx status code is an error. Response headers are in either 4762// *AutoscalingPolicy.ServerResponse.Header or (if a response was 4763// returned at all) in error.(*googleapi.Error).Header. Use 4764// googleapi.IsNotModified to check whether the returned error was 4765// because http.StatusNotModified was returned. 4766func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 4767 gensupport.SetOptions(c.urlParams_, opts...) 4768 res, err := c.doRequest("json") 4769 if res != nil && res.StatusCode == http.StatusNotModified { 4770 if res.Body != nil { 4771 res.Body.Close() 4772 } 4773 return nil, &googleapi.Error{ 4774 Code: res.StatusCode, 4775 Header: res.Header, 4776 } 4777 } 4778 if err != nil { 4779 return nil, err 4780 } 4781 defer googleapi.CloseBody(res) 4782 if err := googleapi.CheckResponse(res); err != nil { 4783 return nil, err 4784 } 4785 ret := &AutoscalingPolicy{ 4786 ServerResponse: googleapi.ServerResponse{ 4787 Header: res.Header, 4788 HTTPStatusCode: res.StatusCode, 4789 }, 4790 } 4791 target := &ret 4792 if err := gensupport.DecodeResponse(target, res); err != nil { 4793 return nil, err 4794 } 4795 return ret, nil 4796 // { 4797 // "description": "Retrieves autoscaling policy.", 4798 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}", 4799 // "httpMethod": "GET", 4800 // "id": "dataproc.projects.locations.autoscalingPolicies.get", 4801 // "parameterOrder": [ 4802 // "name" 4803 // ], 4804 // "parameters": { 4805 // "name": { 4806 // "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}", 4807 // "location": "path", 4808 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 4809 // "required": true, 4810 // "type": "string" 4811 // } 4812 // }, 4813 // "path": "v1beta2/{+name}", 4814 // "response": { 4815 // "$ref": "AutoscalingPolicy" 4816 // }, 4817 // "scopes": [ 4818 // "https://www.googleapis.com/auth/cloud-platform" 4819 // ] 4820 // } 4821 4822} 4823 4824// method id "dataproc.projects.locations.autoscalingPolicies.getIamPolicy": 4825 4826type ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall struct { 4827 s *Service 4828 resource string 4829 urlParams_ gensupport.URLParams 4830 ifNoneMatch_ string 4831 ctx_ context.Context 4832 header_ http.Header 4833} 4834 4835// GetIamPolicy: Gets the access control policy for a resource. Returns 4836// an empty policy if the resource exists and does not have a policy 4837// set. 4838// 4839// - resource: REQUIRED: The resource for which the policy is being 4840// requested. See the operation documentation for the appropriate 4841// value for this field. 4842func (r *ProjectsLocationsAutoscalingPoliciesService) GetIamPolicy(resource string) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall { 4843 c := &ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4844 c.resource = resource 4845 return c 4846} 4847 4848// OptionsRequestedPolicyVersion sets the optional parameter 4849// "options.requestedPolicyVersion": The policy format version to be 4850// returned.Valid values are 0, 1, and 3. Requests specifying an invalid 4851// value will be rejected.Requests for policies with any conditional 4852// bindings must specify version 3. Policies without any conditional 4853// bindings may specify any valid value or leave the field unset.To 4854// learn which resources support conditions in their IAM policies, see 4855// the IAM documentation 4856// (https://cloud.google.com/iam/help/conditions/resource-policies). 4857func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall { 4858 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 4859 return c 4860} 4861 4862// Fields allows partial responses to be retrieved. See 4863// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4864// for more information. 4865func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall { 4866 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4867 return c 4868} 4869 4870// IfNoneMatch sets the optional parameter which makes the operation 4871// fail if the object's ETag matches the given value. This is useful for 4872// getting updates only after the object has changed since the last 4873// request. Use googleapi.IsNotModified to check whether the response 4874// error from Do is the result of In-None-Match. 4875func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall { 4876 c.ifNoneMatch_ = entityTag 4877 return c 4878} 4879 4880// Context sets the context to be used in this call's Do method. Any 4881// pending HTTP request will be aborted if the provided context is 4882// canceled. 4883func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall { 4884 c.ctx_ = ctx 4885 return c 4886} 4887 4888// Header returns an http.Header that can be modified by the caller to 4889// add HTTP headers to the request. 4890func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Header() http.Header { 4891 if c.header_ == nil { 4892 c.header_ = make(http.Header) 4893 } 4894 return c.header_ 4895} 4896 4897func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 4898 reqHeaders := make(http.Header) 4899 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 4900 for k, v := range c.header_ { 4901 reqHeaders[k] = v 4902 } 4903 reqHeaders.Set("User-Agent", c.s.userAgent()) 4904 if c.ifNoneMatch_ != "" { 4905 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4906 } 4907 var body io.Reader = nil 4908 c.urlParams_.Set("alt", alt) 4909 c.urlParams_.Set("prettyPrint", "false") 4910 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 4911 urls += "?" + c.urlParams_.Encode() 4912 req, err := http.NewRequest("GET", urls, body) 4913 if err != nil { 4914 return nil, err 4915 } 4916 req.Header = reqHeaders 4917 googleapi.Expand(req.URL, map[string]string{ 4918 "resource": c.resource, 4919 }) 4920 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4921} 4922 4923// Do executes the "dataproc.projects.locations.autoscalingPolicies.getIamPolicy" call. 4924// Exactly one of *Policy or error will be non-nil. Any non-2xx status 4925// code is an error. Response headers are in either 4926// *Policy.ServerResponse.Header or (if a response was returned at all) 4927// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4928// check whether the returned error was because http.StatusNotModified 4929// was returned. 4930func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 4931 gensupport.SetOptions(c.urlParams_, opts...) 4932 res, err := c.doRequest("json") 4933 if res != nil && res.StatusCode == http.StatusNotModified { 4934 if res.Body != nil { 4935 res.Body.Close() 4936 } 4937 return nil, &googleapi.Error{ 4938 Code: res.StatusCode, 4939 Header: res.Header, 4940 } 4941 } 4942 if err != nil { 4943 return nil, err 4944 } 4945 defer googleapi.CloseBody(res) 4946 if err := googleapi.CheckResponse(res); err != nil { 4947 return nil, err 4948 } 4949 ret := &Policy{ 4950 ServerResponse: googleapi.ServerResponse{ 4951 Header: res.Header, 4952 HTTPStatusCode: res.StatusCode, 4953 }, 4954 } 4955 target := &ret 4956 if err := gensupport.DecodeResponse(target, res); err != nil { 4957 return nil, err 4958 } 4959 return ret, nil 4960 // { 4961 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 4962 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}:getIamPolicy", 4963 // "httpMethod": "GET", 4964 // "id": "dataproc.projects.locations.autoscalingPolicies.getIamPolicy", 4965 // "parameterOrder": [ 4966 // "resource" 4967 // ], 4968 // "parameters": { 4969 // "options.requestedPolicyVersion": { 4970 // "description": "Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset.To learn which resources support conditions in their IAM policies, see the IAM documentation (https://cloud.google.com/iam/help/conditions/resource-policies).", 4971 // "format": "int32", 4972 // "location": "query", 4973 // "type": "integer" 4974 // }, 4975 // "resource": { 4976 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 4977 // "location": "path", 4978 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 4979 // "required": true, 4980 // "type": "string" 4981 // } 4982 // }, 4983 // "path": "v1beta2/{+resource}:getIamPolicy", 4984 // "response": { 4985 // "$ref": "Policy" 4986 // }, 4987 // "scopes": [ 4988 // "https://www.googleapis.com/auth/cloud-platform" 4989 // ] 4990 // } 4991 4992} 4993 4994// method id "dataproc.projects.locations.autoscalingPolicies.list": 4995 4996type ProjectsLocationsAutoscalingPoliciesListCall struct { 4997 s *Service 4998 parent string 4999 urlParams_ gensupport.URLParams 5000 ifNoneMatch_ string 5001 ctx_ context.Context 5002 header_ http.Header 5003} 5004 5005// List: Lists autoscaling policies in the project. 5006// 5007// - parent: The "resource name" of the region or location, as described 5008// in https://cloud.google.com/apis/design/resource_names. For 5009// projects.regions.autoscalingPolicies.list, the resource name of the 5010// region has the following format: 5011// projects/{project_id}/regions/{region} For 5012// projects.locations.autoscalingPolicies.list, the resource name of 5013// the location has the following format: 5014// projects/{project_id}/locations/{location}. 5015func (r *ProjectsLocationsAutoscalingPoliciesService) List(parent string) *ProjectsLocationsAutoscalingPoliciesListCall { 5016 c := &ProjectsLocationsAutoscalingPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5017 c.parent = parent 5018 return c 5019} 5020 5021// PageSize sets the optional parameter "pageSize": The maximum number 5022// of results to return in each response. Must be less than or equal to 5023// 1000. Defaults to 100. 5024func (c *ProjectsLocationsAutoscalingPoliciesListCall) PageSize(pageSize int64) *ProjectsLocationsAutoscalingPoliciesListCall { 5025 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5026 return c 5027} 5028 5029// PageToken sets the optional parameter "pageToken": The page token, 5030// returned by a previous call, to request the next page of results. 5031func (c *ProjectsLocationsAutoscalingPoliciesListCall) PageToken(pageToken string) *ProjectsLocationsAutoscalingPoliciesListCall { 5032 c.urlParams_.Set("pageToken", pageToken) 5033 return c 5034} 5035 5036// Fields allows partial responses to be retrieved. See 5037// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5038// for more information. 5039func (c *ProjectsLocationsAutoscalingPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesListCall { 5040 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5041 return c 5042} 5043 5044// IfNoneMatch sets the optional parameter which makes the operation 5045// fail if the object's ETag matches the given value. This is useful for 5046// getting updates only after the object has changed since the last 5047// request. Use googleapi.IsNotModified to check whether the response 5048// error from Do is the result of In-None-Match. 5049func (c *ProjectsLocationsAutoscalingPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsAutoscalingPoliciesListCall { 5050 c.ifNoneMatch_ = entityTag 5051 return c 5052} 5053 5054// Context sets the context to be used in this call's Do method. Any 5055// pending HTTP request will be aborted if the provided context is 5056// canceled. 5057func (c *ProjectsLocationsAutoscalingPoliciesListCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesListCall { 5058 c.ctx_ = ctx 5059 return c 5060} 5061 5062// Header returns an http.Header that can be modified by the caller to 5063// add HTTP headers to the request. 5064func (c *ProjectsLocationsAutoscalingPoliciesListCall) Header() http.Header { 5065 if c.header_ == nil { 5066 c.header_ = make(http.Header) 5067 } 5068 return c.header_ 5069} 5070 5071func (c *ProjectsLocationsAutoscalingPoliciesListCall) doRequest(alt string) (*http.Response, error) { 5072 reqHeaders := make(http.Header) 5073 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 5074 for k, v := range c.header_ { 5075 reqHeaders[k] = v 5076 } 5077 reqHeaders.Set("User-Agent", c.s.userAgent()) 5078 if c.ifNoneMatch_ != "" { 5079 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5080 } 5081 var body io.Reader = nil 5082 c.urlParams_.Set("alt", alt) 5083 c.urlParams_.Set("prettyPrint", "false") 5084 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/autoscalingPolicies") 5085 urls += "?" + c.urlParams_.Encode() 5086 req, err := http.NewRequest("GET", urls, body) 5087 if err != nil { 5088 return nil, err 5089 } 5090 req.Header = reqHeaders 5091 googleapi.Expand(req.URL, map[string]string{ 5092 "parent": c.parent, 5093 }) 5094 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5095} 5096 5097// Do executes the "dataproc.projects.locations.autoscalingPolicies.list" call. 5098// Exactly one of *ListAutoscalingPoliciesResponse or error will be 5099// non-nil. Any non-2xx status code is an error. Response headers are in 5100// either *ListAutoscalingPoliciesResponse.ServerResponse.Header or (if 5101// a response was returned at all) in error.(*googleapi.Error).Header. 5102// Use googleapi.IsNotModified to check whether the returned error was 5103// because http.StatusNotModified was returned. 5104func (c *ProjectsLocationsAutoscalingPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListAutoscalingPoliciesResponse, error) { 5105 gensupport.SetOptions(c.urlParams_, opts...) 5106 res, err := c.doRequest("json") 5107 if res != nil && res.StatusCode == http.StatusNotModified { 5108 if res.Body != nil { 5109 res.Body.Close() 5110 } 5111 return nil, &googleapi.Error{ 5112 Code: res.StatusCode, 5113 Header: res.Header, 5114 } 5115 } 5116 if err != nil { 5117 return nil, err 5118 } 5119 defer googleapi.CloseBody(res) 5120 if err := googleapi.CheckResponse(res); err != nil { 5121 return nil, err 5122 } 5123 ret := &ListAutoscalingPoliciesResponse{ 5124 ServerResponse: googleapi.ServerResponse{ 5125 Header: res.Header, 5126 HTTPStatusCode: res.StatusCode, 5127 }, 5128 } 5129 target := &ret 5130 if err := gensupport.DecodeResponse(target, res); err != nil { 5131 return nil, err 5132 } 5133 return ret, nil 5134 // { 5135 // "description": "Lists autoscaling policies in the project.", 5136 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies", 5137 // "httpMethod": "GET", 5138 // "id": "dataproc.projects.locations.autoscalingPolicies.list", 5139 // "parameterOrder": [ 5140 // "parent" 5141 // ], 5142 // "parameters": { 5143 // "pageSize": { 5144 // "description": "Optional. The maximum number of results to return in each response. Must be less than or equal to 1000. Defaults to 100.", 5145 // "format": "int32", 5146 // "location": "query", 5147 // "type": "integer" 5148 // }, 5149 // "pageToken": { 5150 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 5151 // "location": "query", 5152 // "type": "string" 5153 // }, 5154 // "parent": { 5155 // "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}", 5156 // "location": "path", 5157 // "pattern": "^projects/[^/]+/locations/[^/]+$", 5158 // "required": true, 5159 // "type": "string" 5160 // } 5161 // }, 5162 // "path": "v1beta2/{+parent}/autoscalingPolicies", 5163 // "response": { 5164 // "$ref": "ListAutoscalingPoliciesResponse" 5165 // }, 5166 // "scopes": [ 5167 // "https://www.googleapis.com/auth/cloud-platform" 5168 // ] 5169 // } 5170 5171} 5172 5173// Pages invokes f for each page of results. 5174// A non-nil error returned from f will halt the iteration. 5175// The provided context supersedes any context provided to the Context method. 5176func (c *ProjectsLocationsAutoscalingPoliciesListCall) Pages(ctx context.Context, f func(*ListAutoscalingPoliciesResponse) error) error { 5177 c.ctx_ = ctx 5178 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5179 for { 5180 x, err := c.Do() 5181 if err != nil { 5182 return err 5183 } 5184 if err := f(x); err != nil { 5185 return err 5186 } 5187 if x.NextPageToken == "" { 5188 return nil 5189 } 5190 c.PageToken(x.NextPageToken) 5191 } 5192} 5193 5194// method id "dataproc.projects.locations.autoscalingPolicies.setIamPolicy": 5195 5196type ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall struct { 5197 s *Service 5198 resource string 5199 setiampolicyrequest *SetIamPolicyRequest 5200 urlParams_ gensupport.URLParams 5201 ctx_ context.Context 5202 header_ http.Header 5203} 5204 5205// SetIamPolicy: Sets the access control policy on the specified 5206// resource. Replaces any existing policy.Can return NOT_FOUND, 5207// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 5208// 5209// - resource: REQUIRED: The resource for which the policy is being 5210// specified. See the operation documentation for the appropriate 5211// value for this field. 5212func (r *ProjectsLocationsAutoscalingPoliciesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall { 5213 c := &ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5214 c.resource = resource 5215 c.setiampolicyrequest = setiampolicyrequest 5216 return c 5217} 5218 5219// Fields allows partial responses to be retrieved. See 5220// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5221// for more information. 5222func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall { 5223 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5224 return c 5225} 5226 5227// Context sets the context to be used in this call's Do method. Any 5228// pending HTTP request will be aborted if the provided context is 5229// canceled. 5230func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall { 5231 c.ctx_ = ctx 5232 return c 5233} 5234 5235// Header returns an http.Header that can be modified by the caller to 5236// add HTTP headers to the request. 5237func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Header() http.Header { 5238 if c.header_ == nil { 5239 c.header_ = make(http.Header) 5240 } 5241 return c.header_ 5242} 5243 5244func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 5245 reqHeaders := make(http.Header) 5246 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 5247 for k, v := range c.header_ { 5248 reqHeaders[k] = v 5249 } 5250 reqHeaders.Set("User-Agent", c.s.userAgent()) 5251 var body io.Reader = nil 5252 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 5253 if err != nil { 5254 return nil, err 5255 } 5256 reqHeaders.Set("Content-Type", "application/json") 5257 c.urlParams_.Set("alt", alt) 5258 c.urlParams_.Set("prettyPrint", "false") 5259 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 5260 urls += "?" + c.urlParams_.Encode() 5261 req, err := http.NewRequest("POST", urls, body) 5262 if err != nil { 5263 return nil, err 5264 } 5265 req.Header = reqHeaders 5266 googleapi.Expand(req.URL, map[string]string{ 5267 "resource": c.resource, 5268 }) 5269 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5270} 5271 5272// Do executes the "dataproc.projects.locations.autoscalingPolicies.setIamPolicy" call. 5273// Exactly one of *Policy or error will be non-nil. Any non-2xx status 5274// code is an error. Response headers are in either 5275// *Policy.ServerResponse.Header or (if a response was returned at all) 5276// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5277// check whether the returned error was because http.StatusNotModified 5278// was returned. 5279func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 5280 gensupport.SetOptions(c.urlParams_, opts...) 5281 res, err := c.doRequest("json") 5282 if res != nil && res.StatusCode == http.StatusNotModified { 5283 if res.Body != nil { 5284 res.Body.Close() 5285 } 5286 return nil, &googleapi.Error{ 5287 Code: res.StatusCode, 5288 Header: res.Header, 5289 } 5290 } 5291 if err != nil { 5292 return nil, err 5293 } 5294 defer googleapi.CloseBody(res) 5295 if err := googleapi.CheckResponse(res); err != nil { 5296 return nil, err 5297 } 5298 ret := &Policy{ 5299 ServerResponse: googleapi.ServerResponse{ 5300 Header: res.Header, 5301 HTTPStatusCode: res.StatusCode, 5302 }, 5303 } 5304 target := &ret 5305 if err := gensupport.DecodeResponse(target, res); err != nil { 5306 return nil, err 5307 } 5308 return ret, nil 5309 // { 5310 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 5311 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}:setIamPolicy", 5312 // "httpMethod": "POST", 5313 // "id": "dataproc.projects.locations.autoscalingPolicies.setIamPolicy", 5314 // "parameterOrder": [ 5315 // "resource" 5316 // ], 5317 // "parameters": { 5318 // "resource": { 5319 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 5320 // "location": "path", 5321 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 5322 // "required": true, 5323 // "type": "string" 5324 // } 5325 // }, 5326 // "path": "v1beta2/{+resource}:setIamPolicy", 5327 // "request": { 5328 // "$ref": "SetIamPolicyRequest" 5329 // }, 5330 // "response": { 5331 // "$ref": "Policy" 5332 // }, 5333 // "scopes": [ 5334 // "https://www.googleapis.com/auth/cloud-platform" 5335 // ] 5336 // } 5337 5338} 5339 5340// method id "dataproc.projects.locations.autoscalingPolicies.testIamPermissions": 5341 5342type ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall struct { 5343 s *Service 5344 resource string 5345 testiampermissionsrequest *TestIamPermissionsRequest 5346 urlParams_ gensupport.URLParams 5347 ctx_ context.Context 5348 header_ http.Header 5349} 5350 5351// TestIamPermissions: Returns permissions that a caller has on the 5352// specified resource. If the resource does not exist, this will return 5353// an empty set of permissions, not a NOT_FOUND error.Note: This 5354// operation is designed to be used for building permission-aware UIs 5355// and command-line tools, not for authorization checking. This 5356// operation may "fail open" without warning. 5357// 5358// - resource: REQUIRED: The resource for which the policy detail is 5359// being requested. See the operation documentation for the 5360// appropriate value for this field. 5361func (r *ProjectsLocationsAutoscalingPoliciesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall { 5362 c := &ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5363 c.resource = resource 5364 c.testiampermissionsrequest = testiampermissionsrequest 5365 return c 5366} 5367 5368// Fields allows partial responses to be retrieved. See 5369// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5370// for more information. 5371func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall { 5372 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5373 return c 5374} 5375 5376// Context sets the context to be used in this call's Do method. Any 5377// pending HTTP request will be aborted if the provided context is 5378// canceled. 5379func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall { 5380 c.ctx_ = ctx 5381 return c 5382} 5383 5384// Header returns an http.Header that can be modified by the caller to 5385// add HTTP headers to the request. 5386func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Header() http.Header { 5387 if c.header_ == nil { 5388 c.header_ = make(http.Header) 5389 } 5390 return c.header_ 5391} 5392 5393func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 5394 reqHeaders := make(http.Header) 5395 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 5396 for k, v := range c.header_ { 5397 reqHeaders[k] = v 5398 } 5399 reqHeaders.Set("User-Agent", c.s.userAgent()) 5400 var body io.Reader = nil 5401 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 5402 if err != nil { 5403 return nil, err 5404 } 5405 reqHeaders.Set("Content-Type", "application/json") 5406 c.urlParams_.Set("alt", alt) 5407 c.urlParams_.Set("prettyPrint", "false") 5408 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 5409 urls += "?" + c.urlParams_.Encode() 5410 req, err := http.NewRequest("POST", urls, body) 5411 if err != nil { 5412 return nil, err 5413 } 5414 req.Header = reqHeaders 5415 googleapi.Expand(req.URL, map[string]string{ 5416 "resource": c.resource, 5417 }) 5418 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5419} 5420 5421// Do executes the "dataproc.projects.locations.autoscalingPolicies.testIamPermissions" call. 5422// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 5423// Any non-2xx status code is an error. Response headers are in either 5424// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 5425// was returned at all) in error.(*googleapi.Error).Header. Use 5426// googleapi.IsNotModified to check whether the returned error was 5427// because http.StatusNotModified was returned. 5428func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 5429 gensupport.SetOptions(c.urlParams_, opts...) 5430 res, err := c.doRequest("json") 5431 if res != nil && res.StatusCode == http.StatusNotModified { 5432 if res.Body != nil { 5433 res.Body.Close() 5434 } 5435 return nil, &googleapi.Error{ 5436 Code: res.StatusCode, 5437 Header: res.Header, 5438 } 5439 } 5440 if err != nil { 5441 return nil, err 5442 } 5443 defer googleapi.CloseBody(res) 5444 if err := googleapi.CheckResponse(res); err != nil { 5445 return nil, err 5446 } 5447 ret := &TestIamPermissionsResponse{ 5448 ServerResponse: googleapi.ServerResponse{ 5449 Header: res.Header, 5450 HTTPStatusCode: res.StatusCode, 5451 }, 5452 } 5453 target := &ret 5454 if err := gensupport.DecodeResponse(target, res); err != nil { 5455 return nil, err 5456 } 5457 return ret, nil 5458 // { 5459 // "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.", 5460 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}:testIamPermissions", 5461 // "httpMethod": "POST", 5462 // "id": "dataproc.projects.locations.autoscalingPolicies.testIamPermissions", 5463 // "parameterOrder": [ 5464 // "resource" 5465 // ], 5466 // "parameters": { 5467 // "resource": { 5468 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 5469 // "location": "path", 5470 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 5471 // "required": true, 5472 // "type": "string" 5473 // } 5474 // }, 5475 // "path": "v1beta2/{+resource}:testIamPermissions", 5476 // "request": { 5477 // "$ref": "TestIamPermissionsRequest" 5478 // }, 5479 // "response": { 5480 // "$ref": "TestIamPermissionsResponse" 5481 // }, 5482 // "scopes": [ 5483 // "https://www.googleapis.com/auth/cloud-platform" 5484 // ] 5485 // } 5486 5487} 5488 5489// method id "dataproc.projects.locations.autoscalingPolicies.update": 5490 5491type ProjectsLocationsAutoscalingPoliciesUpdateCall struct { 5492 s *Service 5493 name string 5494 autoscalingpolicy *AutoscalingPolicy 5495 urlParams_ gensupport.URLParams 5496 ctx_ context.Context 5497 header_ http.Header 5498} 5499 5500// Update: Updates (replaces) autoscaling policy.Disabled check for 5501// update_mask, because all updates will be full replacements. 5502// 5503// - name: Output only. The "resource name" of the autoscaling policy, 5504// as described in 5505// https://cloud.google.com/apis/design/resource_names. For 5506// projects.regions.autoscalingPolicies, the resource name of the 5507// policy has the following format: 5508// projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 5509// d} For projects.locations.autoscalingPolicies, the resource name of 5510// the policy has the following format: 5511// projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 5512// cy_id}. 5513func (r *ProjectsLocationsAutoscalingPoliciesService) Update(name string, autoscalingpolicy *AutoscalingPolicy) *ProjectsLocationsAutoscalingPoliciesUpdateCall { 5514 c := &ProjectsLocationsAutoscalingPoliciesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5515 c.name = name 5516 c.autoscalingpolicy = autoscalingpolicy 5517 return c 5518} 5519 5520// Fields allows partial responses to be retrieved. See 5521// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5522// for more information. 5523func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesUpdateCall { 5524 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5525 return c 5526} 5527 5528// Context sets the context to be used in this call's Do method. Any 5529// pending HTTP request will be aborted if the provided context is 5530// canceled. 5531func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesUpdateCall { 5532 c.ctx_ = ctx 5533 return c 5534} 5535 5536// Header returns an http.Header that can be modified by the caller to 5537// add HTTP headers to the request. 5538func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Header() http.Header { 5539 if c.header_ == nil { 5540 c.header_ = make(http.Header) 5541 } 5542 return c.header_ 5543} 5544 5545func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { 5546 reqHeaders := make(http.Header) 5547 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 5548 for k, v := range c.header_ { 5549 reqHeaders[k] = v 5550 } 5551 reqHeaders.Set("User-Agent", c.s.userAgent()) 5552 var body io.Reader = nil 5553 body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) 5554 if err != nil { 5555 return nil, err 5556 } 5557 reqHeaders.Set("Content-Type", "application/json") 5558 c.urlParams_.Set("alt", alt) 5559 c.urlParams_.Set("prettyPrint", "false") 5560 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 5561 urls += "?" + c.urlParams_.Encode() 5562 req, err := http.NewRequest("PUT", urls, body) 5563 if err != nil { 5564 return nil, err 5565 } 5566 req.Header = reqHeaders 5567 googleapi.Expand(req.URL, map[string]string{ 5568 "name": c.name, 5569 }) 5570 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5571} 5572 5573// Do executes the "dataproc.projects.locations.autoscalingPolicies.update" call. 5574// Exactly one of *AutoscalingPolicy or error will be non-nil. Any 5575// non-2xx status code is an error. Response headers are in either 5576// *AutoscalingPolicy.ServerResponse.Header or (if a response was 5577// returned at all) in error.(*googleapi.Error).Header. Use 5578// googleapi.IsNotModified to check whether the returned error was 5579// because http.StatusNotModified was returned. 5580func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 5581 gensupport.SetOptions(c.urlParams_, opts...) 5582 res, err := c.doRequest("json") 5583 if res != nil && res.StatusCode == http.StatusNotModified { 5584 if res.Body != nil { 5585 res.Body.Close() 5586 } 5587 return nil, &googleapi.Error{ 5588 Code: res.StatusCode, 5589 Header: res.Header, 5590 } 5591 } 5592 if err != nil { 5593 return nil, err 5594 } 5595 defer googleapi.CloseBody(res) 5596 if err := googleapi.CheckResponse(res); err != nil { 5597 return nil, err 5598 } 5599 ret := &AutoscalingPolicy{ 5600 ServerResponse: googleapi.ServerResponse{ 5601 Header: res.Header, 5602 HTTPStatusCode: res.StatusCode, 5603 }, 5604 } 5605 target := &ret 5606 if err := gensupport.DecodeResponse(target, res); err != nil { 5607 return nil, err 5608 } 5609 return ret, nil 5610 // { 5611 // "description": "Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements.", 5612 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}", 5613 // "httpMethod": "PUT", 5614 // "id": "dataproc.projects.locations.autoscalingPolicies.update", 5615 // "parameterOrder": [ 5616 // "name" 5617 // ], 5618 // "parameters": { 5619 // "name": { 5620 // "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}", 5621 // "location": "path", 5622 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 5623 // "required": true, 5624 // "type": "string" 5625 // } 5626 // }, 5627 // "path": "v1beta2/{+name}", 5628 // "request": { 5629 // "$ref": "AutoscalingPolicy" 5630 // }, 5631 // "response": { 5632 // "$ref": "AutoscalingPolicy" 5633 // }, 5634 // "scopes": [ 5635 // "https://www.googleapis.com/auth/cloud-platform" 5636 // ] 5637 // } 5638 5639} 5640 5641// method id "dataproc.projects.locations.workflowTemplates.create": 5642 5643type ProjectsLocationsWorkflowTemplatesCreateCall struct { 5644 s *Service 5645 parent string 5646 workflowtemplate *WorkflowTemplate 5647 urlParams_ gensupport.URLParams 5648 ctx_ context.Context 5649 header_ http.Header 5650} 5651 5652// Create: Creates new workflow template. 5653// 5654// - parent: The resource name of the region or location, as described 5655// in https://cloud.google.com/apis/design/resource_names. For 5656// projects.regions.workflowTemplates,create, the resource name of the 5657// region has the following format: 5658// projects/{project_id}/regions/{region} For 5659// projects.locations.workflowTemplates.create, the resource name of 5660// the location has the following format: 5661// projects/{project_id}/locations/{location}. 5662func (r *ProjectsLocationsWorkflowTemplatesService) Create(parent string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesCreateCall { 5663 c := &ProjectsLocationsWorkflowTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5664 c.parent = parent 5665 c.workflowtemplate = workflowtemplate 5666 return c 5667} 5668 5669// Fields allows partial responses to be retrieved. See 5670// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5671// for more information. 5672func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesCreateCall { 5673 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5674 return c 5675} 5676 5677// Context sets the context to be used in this call's Do method. Any 5678// pending HTTP request will be aborted if the provided context is 5679// canceled. 5680func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesCreateCall { 5681 c.ctx_ = ctx 5682 return c 5683} 5684 5685// Header returns an http.Header that can be modified by the caller to 5686// add HTTP headers to the request. 5687func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Header() http.Header { 5688 if c.header_ == nil { 5689 c.header_ = make(http.Header) 5690 } 5691 return c.header_ 5692} 5693 5694func (c *ProjectsLocationsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { 5695 reqHeaders := make(http.Header) 5696 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 5697 for k, v := range c.header_ { 5698 reqHeaders[k] = v 5699 } 5700 reqHeaders.Set("User-Agent", c.s.userAgent()) 5701 var body io.Reader = nil 5702 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 5703 if err != nil { 5704 return nil, err 5705 } 5706 reqHeaders.Set("Content-Type", "application/json") 5707 c.urlParams_.Set("alt", alt) 5708 c.urlParams_.Set("prettyPrint", "false") 5709 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates") 5710 urls += "?" + c.urlParams_.Encode() 5711 req, err := http.NewRequest("POST", urls, body) 5712 if err != nil { 5713 return nil, err 5714 } 5715 req.Header = reqHeaders 5716 googleapi.Expand(req.URL, map[string]string{ 5717 "parent": c.parent, 5718 }) 5719 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5720} 5721 5722// Do executes the "dataproc.projects.locations.workflowTemplates.create" call. 5723// Exactly one of *WorkflowTemplate or error will be non-nil. Any 5724// non-2xx status code is an error. Response headers are in either 5725// *WorkflowTemplate.ServerResponse.Header or (if a response was 5726// returned at all) in error.(*googleapi.Error).Header. Use 5727// googleapi.IsNotModified to check whether the returned error was 5728// because http.StatusNotModified was returned. 5729func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 5730 gensupport.SetOptions(c.urlParams_, opts...) 5731 res, err := c.doRequest("json") 5732 if res != nil && res.StatusCode == http.StatusNotModified { 5733 if res.Body != nil { 5734 res.Body.Close() 5735 } 5736 return nil, &googleapi.Error{ 5737 Code: res.StatusCode, 5738 Header: res.Header, 5739 } 5740 } 5741 if err != nil { 5742 return nil, err 5743 } 5744 defer googleapi.CloseBody(res) 5745 if err := googleapi.CheckResponse(res); err != nil { 5746 return nil, err 5747 } 5748 ret := &WorkflowTemplate{ 5749 ServerResponse: googleapi.ServerResponse{ 5750 Header: res.Header, 5751 HTTPStatusCode: res.StatusCode, 5752 }, 5753 } 5754 target := &ret 5755 if err := gensupport.DecodeResponse(target, res); err != nil { 5756 return nil, err 5757 } 5758 return ret, nil 5759 // { 5760 // "description": "Creates new workflow template.", 5761 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates", 5762 // "httpMethod": "POST", 5763 // "id": "dataproc.projects.locations.workflowTemplates.create", 5764 // "parameterOrder": [ 5765 // "parent" 5766 // ], 5767 // "parameters": { 5768 // "parent": { 5769 // "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}", 5770 // "location": "path", 5771 // "pattern": "^projects/[^/]+/locations/[^/]+$", 5772 // "required": true, 5773 // "type": "string" 5774 // } 5775 // }, 5776 // "path": "v1beta2/{+parent}/workflowTemplates", 5777 // "request": { 5778 // "$ref": "WorkflowTemplate" 5779 // }, 5780 // "response": { 5781 // "$ref": "WorkflowTemplate" 5782 // }, 5783 // "scopes": [ 5784 // "https://www.googleapis.com/auth/cloud-platform" 5785 // ] 5786 // } 5787 5788} 5789 5790// method id "dataproc.projects.locations.workflowTemplates.delete": 5791 5792type ProjectsLocationsWorkflowTemplatesDeleteCall struct { 5793 s *Service 5794 name string 5795 urlParams_ gensupport.URLParams 5796 ctx_ context.Context 5797 header_ http.Header 5798} 5799 5800// Delete: Deletes a workflow template. It does not cancel in-progress 5801// workflows. 5802// 5803// - name: The resource name of the workflow template, as described in 5804// https://cloud.google.com/apis/design/resource_names. For 5805// projects.regions.workflowTemplates.delete, the resource name of the 5806// template has the following format: 5807// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 5808// d} For projects.locations.workflowTemplates.instantiate, the 5809// resource name of the template has the following format: 5810// projects/{project_id}/locations/{location}/workflowTemplates/{templa 5811// te_id}. 5812func (r *ProjectsLocationsWorkflowTemplatesService) Delete(name string) *ProjectsLocationsWorkflowTemplatesDeleteCall { 5813 c := &ProjectsLocationsWorkflowTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5814 c.name = name 5815 return c 5816} 5817 5818// Version sets the optional parameter "version": The version of 5819// workflow template to delete. If specified, will only delete the 5820// template if the current server version matches specified version. 5821func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Version(version int64) *ProjectsLocationsWorkflowTemplatesDeleteCall { 5822 c.urlParams_.Set("version", fmt.Sprint(version)) 5823 return c 5824} 5825 5826// Fields allows partial responses to be retrieved. See 5827// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5828// for more information. 5829func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesDeleteCall { 5830 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5831 return c 5832} 5833 5834// Context sets the context to be used in this call's Do method. Any 5835// pending HTTP request will be aborted if the provided context is 5836// canceled. 5837func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesDeleteCall { 5838 c.ctx_ = ctx 5839 return c 5840} 5841 5842// Header returns an http.Header that can be modified by the caller to 5843// add HTTP headers to the request. 5844func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Header() http.Header { 5845 if c.header_ == nil { 5846 c.header_ = make(http.Header) 5847 } 5848 return c.header_ 5849} 5850 5851func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { 5852 reqHeaders := make(http.Header) 5853 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 5854 for k, v := range c.header_ { 5855 reqHeaders[k] = v 5856 } 5857 reqHeaders.Set("User-Agent", c.s.userAgent()) 5858 var body io.Reader = nil 5859 c.urlParams_.Set("alt", alt) 5860 c.urlParams_.Set("prettyPrint", "false") 5861 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 5862 urls += "?" + c.urlParams_.Encode() 5863 req, err := http.NewRequest("DELETE", urls, body) 5864 if err != nil { 5865 return nil, err 5866 } 5867 req.Header = reqHeaders 5868 googleapi.Expand(req.URL, map[string]string{ 5869 "name": c.name, 5870 }) 5871 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5872} 5873 5874// Do executes the "dataproc.projects.locations.workflowTemplates.delete" call. 5875// Exactly one of *Empty or error will be non-nil. Any non-2xx status 5876// code is an error. Response headers are in either 5877// *Empty.ServerResponse.Header or (if a response was returned at all) 5878// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5879// check whether the returned error was because http.StatusNotModified 5880// was returned. 5881func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 5882 gensupport.SetOptions(c.urlParams_, opts...) 5883 res, err := c.doRequest("json") 5884 if res != nil && res.StatusCode == http.StatusNotModified { 5885 if res.Body != nil { 5886 res.Body.Close() 5887 } 5888 return nil, &googleapi.Error{ 5889 Code: res.StatusCode, 5890 Header: res.Header, 5891 } 5892 } 5893 if err != nil { 5894 return nil, err 5895 } 5896 defer googleapi.CloseBody(res) 5897 if err := googleapi.CheckResponse(res); err != nil { 5898 return nil, err 5899 } 5900 ret := &Empty{ 5901 ServerResponse: googleapi.ServerResponse{ 5902 Header: res.Header, 5903 HTTPStatusCode: res.StatusCode, 5904 }, 5905 } 5906 target := &ret 5907 if err := gensupport.DecodeResponse(target, res); err != nil { 5908 return nil, err 5909 } 5910 return ret, nil 5911 // { 5912 // "description": "Deletes a workflow template. It does not cancel in-progress workflows.", 5913 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}", 5914 // "httpMethod": "DELETE", 5915 // "id": "dataproc.projects.locations.workflowTemplates.delete", 5916 // "parameterOrder": [ 5917 // "name" 5918 // ], 5919 // "parameters": { 5920 // "name": { 5921 // "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}", 5922 // "location": "path", 5923 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 5924 // "required": true, 5925 // "type": "string" 5926 // }, 5927 // "version": { 5928 // "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.", 5929 // "format": "int32", 5930 // "location": "query", 5931 // "type": "integer" 5932 // } 5933 // }, 5934 // "path": "v1beta2/{+name}", 5935 // "response": { 5936 // "$ref": "Empty" 5937 // }, 5938 // "scopes": [ 5939 // "https://www.googleapis.com/auth/cloud-platform" 5940 // ] 5941 // } 5942 5943} 5944 5945// method id "dataproc.projects.locations.workflowTemplates.get": 5946 5947type ProjectsLocationsWorkflowTemplatesGetCall struct { 5948 s *Service 5949 name string 5950 urlParams_ gensupport.URLParams 5951 ifNoneMatch_ string 5952 ctx_ context.Context 5953 header_ http.Header 5954} 5955 5956// Get: Retrieves the latest workflow template.Can retrieve previously 5957// instantiated template by specifying optional version parameter. 5958// 5959// - name: The resource name of the workflow template, as described in 5960// https://cloud.google.com/apis/design/resource_names. For 5961// projects.regions.workflowTemplates.get, the resource name of the 5962// template has the following format: 5963// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 5964// d} For projects.locations.workflowTemplates.get, the resource name 5965// of the template has the following format: 5966// projects/{project_id}/locations/{location}/workflowTemplates/{templa 5967// te_id}. 5968func (r *ProjectsLocationsWorkflowTemplatesService) Get(name string) *ProjectsLocationsWorkflowTemplatesGetCall { 5969 c := &ProjectsLocationsWorkflowTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5970 c.name = name 5971 return c 5972} 5973 5974// Version sets the optional parameter "version": The version of 5975// workflow template to retrieve. Only previously instantiated versions 5976// can be retrieved.If unspecified, retrieves the current version. 5977func (c *ProjectsLocationsWorkflowTemplatesGetCall) Version(version int64) *ProjectsLocationsWorkflowTemplatesGetCall { 5978 c.urlParams_.Set("version", fmt.Sprint(version)) 5979 return c 5980} 5981 5982// Fields allows partial responses to be retrieved. See 5983// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5984// for more information. 5985func (c *ProjectsLocationsWorkflowTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesGetCall { 5986 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5987 return c 5988} 5989 5990// IfNoneMatch sets the optional parameter which makes the operation 5991// fail if the object's ETag matches the given value. This is useful for 5992// getting updates only after the object has changed since the last 5993// request. Use googleapi.IsNotModified to check whether the response 5994// error from Do is the result of In-None-Match. 5995func (c *ProjectsLocationsWorkflowTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesGetCall { 5996 c.ifNoneMatch_ = entityTag 5997 return c 5998} 5999 6000// Context sets the context to be used in this call's Do method. Any 6001// pending HTTP request will be aborted if the provided context is 6002// canceled. 6003func (c *ProjectsLocationsWorkflowTemplatesGetCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesGetCall { 6004 c.ctx_ = ctx 6005 return c 6006} 6007 6008// Header returns an http.Header that can be modified by the caller to 6009// add HTTP headers to the request. 6010func (c *ProjectsLocationsWorkflowTemplatesGetCall) Header() http.Header { 6011 if c.header_ == nil { 6012 c.header_ = make(http.Header) 6013 } 6014 return c.header_ 6015} 6016 6017func (c *ProjectsLocationsWorkflowTemplatesGetCall) doRequest(alt string) (*http.Response, error) { 6018 reqHeaders := make(http.Header) 6019 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 6020 for k, v := range c.header_ { 6021 reqHeaders[k] = v 6022 } 6023 reqHeaders.Set("User-Agent", c.s.userAgent()) 6024 if c.ifNoneMatch_ != "" { 6025 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6026 } 6027 var body io.Reader = nil 6028 c.urlParams_.Set("alt", alt) 6029 c.urlParams_.Set("prettyPrint", "false") 6030 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 6031 urls += "?" + c.urlParams_.Encode() 6032 req, err := http.NewRequest("GET", urls, body) 6033 if err != nil { 6034 return nil, err 6035 } 6036 req.Header = reqHeaders 6037 googleapi.Expand(req.URL, map[string]string{ 6038 "name": c.name, 6039 }) 6040 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6041} 6042 6043// Do executes the "dataproc.projects.locations.workflowTemplates.get" call. 6044// Exactly one of *WorkflowTemplate or error will be non-nil. Any 6045// non-2xx status code is an error. Response headers are in either 6046// *WorkflowTemplate.ServerResponse.Header or (if a response was 6047// returned at all) in error.(*googleapi.Error).Header. Use 6048// googleapi.IsNotModified to check whether the returned error was 6049// because http.StatusNotModified was returned. 6050func (c *ProjectsLocationsWorkflowTemplatesGetCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 6051 gensupport.SetOptions(c.urlParams_, opts...) 6052 res, err := c.doRequest("json") 6053 if res != nil && res.StatusCode == http.StatusNotModified { 6054 if res.Body != nil { 6055 res.Body.Close() 6056 } 6057 return nil, &googleapi.Error{ 6058 Code: res.StatusCode, 6059 Header: res.Header, 6060 } 6061 } 6062 if err != nil { 6063 return nil, err 6064 } 6065 defer googleapi.CloseBody(res) 6066 if err := googleapi.CheckResponse(res); err != nil { 6067 return nil, err 6068 } 6069 ret := &WorkflowTemplate{ 6070 ServerResponse: googleapi.ServerResponse{ 6071 Header: res.Header, 6072 HTTPStatusCode: res.StatusCode, 6073 }, 6074 } 6075 target := &ret 6076 if err := gensupport.DecodeResponse(target, res); err != nil { 6077 return nil, err 6078 } 6079 return ret, nil 6080 // { 6081 // "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.", 6082 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}", 6083 // "httpMethod": "GET", 6084 // "id": "dataproc.projects.locations.workflowTemplates.get", 6085 // "parameterOrder": [ 6086 // "name" 6087 // ], 6088 // "parameters": { 6089 // "name": { 6090 // "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}", 6091 // "location": "path", 6092 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 6093 // "required": true, 6094 // "type": "string" 6095 // }, 6096 // "version": { 6097 // "description": "Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.If unspecified, retrieves the current version.", 6098 // "format": "int32", 6099 // "location": "query", 6100 // "type": "integer" 6101 // } 6102 // }, 6103 // "path": "v1beta2/{+name}", 6104 // "response": { 6105 // "$ref": "WorkflowTemplate" 6106 // }, 6107 // "scopes": [ 6108 // "https://www.googleapis.com/auth/cloud-platform" 6109 // ] 6110 // } 6111 6112} 6113 6114// method id "dataproc.projects.locations.workflowTemplates.getIamPolicy": 6115 6116type ProjectsLocationsWorkflowTemplatesGetIamPolicyCall struct { 6117 s *Service 6118 resource string 6119 urlParams_ gensupport.URLParams 6120 ifNoneMatch_ string 6121 ctx_ context.Context 6122 header_ http.Header 6123} 6124 6125// GetIamPolicy: Gets the access control policy for a resource. Returns 6126// an empty policy if the resource exists and does not have a policy 6127// set. 6128// 6129// - resource: REQUIRED: The resource for which the policy is being 6130// requested. See the operation documentation for the appropriate 6131// value for this field. 6132func (r *ProjectsLocationsWorkflowTemplatesService) GetIamPolicy(resource string) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall { 6133 c := &ProjectsLocationsWorkflowTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6134 c.resource = resource 6135 return c 6136} 6137 6138// OptionsRequestedPolicyVersion sets the optional parameter 6139// "options.requestedPolicyVersion": The policy format version to be 6140// returned.Valid values are 0, 1, and 3. Requests specifying an invalid 6141// value will be rejected.Requests for policies with any conditional 6142// bindings must specify version 3. Policies without any conditional 6143// bindings may specify any valid value or leave the field unset.To 6144// learn which resources support conditions in their IAM policies, see 6145// the IAM documentation 6146// (https://cloud.google.com/iam/help/conditions/resource-policies). 6147func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall { 6148 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 6149 return c 6150} 6151 6152// Fields allows partial responses to be retrieved. See 6153// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6154// for more information. 6155func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall { 6156 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6157 return c 6158} 6159 6160// IfNoneMatch sets the optional parameter which makes the operation 6161// fail if the object's ETag matches the given value. This is useful for 6162// getting updates only after the object has changed since the last 6163// request. Use googleapi.IsNotModified to check whether the response 6164// error from Do is the result of In-None-Match. 6165func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall { 6166 c.ifNoneMatch_ = entityTag 6167 return c 6168} 6169 6170// Context sets the context to be used in this call's Do method. Any 6171// pending HTTP request will be aborted if the provided context is 6172// canceled. 6173func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall { 6174 c.ctx_ = ctx 6175 return c 6176} 6177 6178// Header returns an http.Header that can be modified by the caller to 6179// add HTTP headers to the request. 6180func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Header() http.Header { 6181 if c.header_ == nil { 6182 c.header_ = make(http.Header) 6183 } 6184 return c.header_ 6185} 6186 6187func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 6188 reqHeaders := make(http.Header) 6189 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 6190 for k, v := range c.header_ { 6191 reqHeaders[k] = v 6192 } 6193 reqHeaders.Set("User-Agent", c.s.userAgent()) 6194 if c.ifNoneMatch_ != "" { 6195 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6196 } 6197 var body io.Reader = nil 6198 c.urlParams_.Set("alt", alt) 6199 c.urlParams_.Set("prettyPrint", "false") 6200 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 6201 urls += "?" + c.urlParams_.Encode() 6202 req, err := http.NewRequest("GET", urls, body) 6203 if err != nil { 6204 return nil, err 6205 } 6206 req.Header = reqHeaders 6207 googleapi.Expand(req.URL, map[string]string{ 6208 "resource": c.resource, 6209 }) 6210 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6211} 6212 6213// Do executes the "dataproc.projects.locations.workflowTemplates.getIamPolicy" call. 6214// Exactly one of *Policy or error will be non-nil. Any non-2xx status 6215// code is an error. Response headers are in either 6216// *Policy.ServerResponse.Header or (if a response was returned at all) 6217// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6218// check whether the returned error was because http.StatusNotModified 6219// was returned. 6220func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 6221 gensupport.SetOptions(c.urlParams_, opts...) 6222 res, err := c.doRequest("json") 6223 if res != nil && res.StatusCode == http.StatusNotModified { 6224 if res.Body != nil { 6225 res.Body.Close() 6226 } 6227 return nil, &googleapi.Error{ 6228 Code: res.StatusCode, 6229 Header: res.Header, 6230 } 6231 } 6232 if err != nil { 6233 return nil, err 6234 } 6235 defer googleapi.CloseBody(res) 6236 if err := googleapi.CheckResponse(res); err != nil { 6237 return nil, err 6238 } 6239 ret := &Policy{ 6240 ServerResponse: googleapi.ServerResponse{ 6241 Header: res.Header, 6242 HTTPStatusCode: res.StatusCode, 6243 }, 6244 } 6245 target := &ret 6246 if err := gensupport.DecodeResponse(target, res); err != nil { 6247 return nil, err 6248 } 6249 return ret, nil 6250 // { 6251 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 6252 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:getIamPolicy", 6253 // "httpMethod": "GET", 6254 // "id": "dataproc.projects.locations.workflowTemplates.getIamPolicy", 6255 // "parameterOrder": [ 6256 // "resource" 6257 // ], 6258 // "parameters": { 6259 // "options.requestedPolicyVersion": { 6260 // "description": "Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset.To learn which resources support conditions in their IAM policies, see the IAM documentation (https://cloud.google.com/iam/help/conditions/resource-policies).", 6261 // "format": "int32", 6262 // "location": "query", 6263 // "type": "integer" 6264 // }, 6265 // "resource": { 6266 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 6267 // "location": "path", 6268 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 6269 // "required": true, 6270 // "type": "string" 6271 // } 6272 // }, 6273 // "path": "v1beta2/{+resource}:getIamPolicy", 6274 // "response": { 6275 // "$ref": "Policy" 6276 // }, 6277 // "scopes": [ 6278 // "https://www.googleapis.com/auth/cloud-platform" 6279 // ] 6280 // } 6281 6282} 6283 6284// method id "dataproc.projects.locations.workflowTemplates.instantiate": 6285 6286type ProjectsLocationsWorkflowTemplatesInstantiateCall struct { 6287 s *Service 6288 name string 6289 instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest 6290 urlParams_ gensupport.URLParams 6291 ctx_ context.Context 6292 header_ http.Header 6293} 6294 6295// Instantiate: Instantiates a template and begins execution.The 6296// returned Operation can be used to track execution of workflow by 6297// polling operations.get. The Operation will complete when entire 6298// workflow is finished.The running workflow can be aborted via 6299// operations.cancel. This will cause any inflight jobs to be cancelled 6300// and workflow-owned clusters to be deleted.The Operation.metadata will 6301// be WorkflowMetadata 6302// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). 6303// Also see Using WorkflowMetadata 6304// (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On 6305// successful completion, Operation.response will be Empty. 6306// 6307// - name: The resource name of the workflow template, as described in 6308// https://cloud.google.com/apis/design/resource_names. For 6309// projects.regions.workflowTemplates.instantiate, the resource name 6310// of the template has the following format: 6311// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 6312// d} For projects.locations.workflowTemplates.instantiate, the 6313// resource name of the template has the following format: 6314// projects/{project_id}/locations/{location}/workflowTemplates/{templa 6315// te_id}. 6316func (r *ProjectsLocationsWorkflowTemplatesService) Instantiate(name string, instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest) *ProjectsLocationsWorkflowTemplatesInstantiateCall { 6317 c := &ProjectsLocationsWorkflowTemplatesInstantiateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6318 c.name = name 6319 c.instantiateworkflowtemplaterequest = instantiateworkflowtemplaterequest 6320 return c 6321} 6322 6323// Fields allows partial responses to be retrieved. See 6324// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6325// for more information. 6326func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesInstantiateCall { 6327 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6328 return c 6329} 6330 6331// Context sets the context to be used in this call's Do method. Any 6332// pending HTTP request will be aborted if the provided context is 6333// canceled. 6334func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesInstantiateCall { 6335 c.ctx_ = ctx 6336 return c 6337} 6338 6339// Header returns an http.Header that can be modified by the caller to 6340// add HTTP headers to the request. 6341func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Header() http.Header { 6342 if c.header_ == nil { 6343 c.header_ = make(http.Header) 6344 } 6345 return c.header_ 6346} 6347 6348func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) { 6349 reqHeaders := make(http.Header) 6350 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 6351 for k, v := range c.header_ { 6352 reqHeaders[k] = v 6353 } 6354 reqHeaders.Set("User-Agent", c.s.userAgent()) 6355 var body io.Reader = nil 6356 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest) 6357 if err != nil { 6358 return nil, err 6359 } 6360 reqHeaders.Set("Content-Type", "application/json") 6361 c.urlParams_.Set("alt", alt) 6362 c.urlParams_.Set("prettyPrint", "false") 6363 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:instantiate") 6364 urls += "?" + c.urlParams_.Encode() 6365 req, err := http.NewRequest("POST", urls, body) 6366 if err != nil { 6367 return nil, err 6368 } 6369 req.Header = reqHeaders 6370 googleapi.Expand(req.URL, map[string]string{ 6371 "name": c.name, 6372 }) 6373 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6374} 6375 6376// Do executes the "dataproc.projects.locations.workflowTemplates.instantiate" call. 6377// Exactly one of *Operation or error will be non-nil. Any non-2xx 6378// status code is an error. Response headers are in either 6379// *Operation.ServerResponse.Header or (if a response was returned at 6380// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6381// to check whether the returned error was because 6382// http.StatusNotModified was returned. 6383func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6384 gensupport.SetOptions(c.urlParams_, opts...) 6385 res, err := c.doRequest("json") 6386 if res != nil && res.StatusCode == http.StatusNotModified { 6387 if res.Body != nil { 6388 res.Body.Close() 6389 } 6390 return nil, &googleapi.Error{ 6391 Code: res.StatusCode, 6392 Header: res.Header, 6393 } 6394 } 6395 if err != nil { 6396 return nil, err 6397 } 6398 defer googleapi.CloseBody(res) 6399 if err := googleapi.CheckResponse(res); err != nil { 6400 return nil, err 6401 } 6402 ret := &Operation{ 6403 ServerResponse: googleapi.ServerResponse{ 6404 Header: res.Header, 6405 HTTPStatusCode: res.StatusCode, 6406 }, 6407 } 6408 target := &ret 6409 if err := gensupport.DecodeResponse(target, res); err != nil { 6410 return nil, err 6411 } 6412 return ret, nil 6413 // { 6414 // "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.v1beta2#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty.", 6415 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:instantiate", 6416 // "httpMethod": "POST", 6417 // "id": "dataproc.projects.locations.workflowTemplates.instantiate", 6418 // "parameterOrder": [ 6419 // "name" 6420 // ], 6421 // "parameters": { 6422 // "name": { 6423 // "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}", 6424 // "location": "path", 6425 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 6426 // "required": true, 6427 // "type": "string" 6428 // } 6429 // }, 6430 // "path": "v1beta2/{+name}:instantiate", 6431 // "request": { 6432 // "$ref": "InstantiateWorkflowTemplateRequest" 6433 // }, 6434 // "response": { 6435 // "$ref": "Operation" 6436 // }, 6437 // "scopes": [ 6438 // "https://www.googleapis.com/auth/cloud-platform" 6439 // ] 6440 // } 6441 6442} 6443 6444// method id "dataproc.projects.locations.workflowTemplates.instantiateInline": 6445 6446type ProjectsLocationsWorkflowTemplatesInstantiateInlineCall struct { 6447 s *Service 6448 parent string 6449 workflowtemplate *WorkflowTemplate 6450 urlParams_ gensupport.URLParams 6451 ctx_ context.Context 6452 header_ http.Header 6453} 6454 6455// InstantiateInline: Instantiates a template and begins execution.This 6456// method is equivalent to executing the sequence 6457// CreateWorkflowTemplate, InstantiateWorkflowTemplate, 6458// DeleteWorkflowTemplate.The returned Operation can be used to track 6459// execution of workflow by polling operations.get. The Operation will 6460// complete when entire workflow is finished.The running workflow can be 6461// aborted via operations.cancel. This will cause any inflight jobs to 6462// be cancelled and workflow-owned clusters to be deleted.The 6463// Operation.metadata will be WorkflowMetadata 6464// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). 6465// Also see Using WorkflowMetadata 6466// (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On 6467// successful completion, Operation.response will be Empty. 6468// 6469// - parent: The resource name of the region or location, as described 6470// in https://cloud.google.com/apis/design/resource_names. For 6471// projects.regions.workflowTemplates,instantiateinline, the resource 6472// name of the region has the following format: 6473// projects/{project_id}/regions/{region} For 6474// projects.locations.workflowTemplates.instantiateinline, the 6475// resource name of the location has the following format: 6476// projects/{project_id}/locations/{location}. 6477func (r *ProjectsLocationsWorkflowTemplatesService) InstantiateInline(parent string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6478 c := &ProjectsLocationsWorkflowTemplatesInstantiateInlineCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6479 c.parent = parent 6480 c.workflowtemplate = workflowtemplate 6481 return c 6482} 6483 6484// InstanceId sets the optional parameter "instanceId": Deprecated. 6485// Please use request_id field instead. 6486func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) InstanceId(instanceId string) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6487 c.urlParams_.Set("instanceId", instanceId) 6488 return c 6489} 6490 6491// RequestId sets the optional parameter "requestId": A tag that 6492// prevents multiple concurrent workflow instances with the same tag 6493// from running. This mitigates risk of concurrent instances started due 6494// to retries.It is recommended to always set this value to a UUID 6495// (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag 6496// must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 6497// and hyphens (-). The maximum length is 40 characters. 6498func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) RequestId(requestId string) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6499 c.urlParams_.Set("requestId", requestId) 6500 return c 6501} 6502 6503// Fields allows partial responses to be retrieved. See 6504// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6505// for more information. 6506func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6507 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6508 return c 6509} 6510 6511// Context sets the context to be used in this call's Do method. Any 6512// pending HTTP request will be aborted if the provided context is 6513// canceled. 6514func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6515 c.ctx_ = ctx 6516 return c 6517} 6518 6519// Header returns an http.Header that can be modified by the caller to 6520// add HTTP headers to the request. 6521func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Header() http.Header { 6522 if c.header_ == nil { 6523 c.header_ = make(http.Header) 6524 } 6525 return c.header_ 6526} 6527 6528func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) { 6529 reqHeaders := make(http.Header) 6530 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 6531 for k, v := range c.header_ { 6532 reqHeaders[k] = v 6533 } 6534 reqHeaders.Set("User-Agent", c.s.userAgent()) 6535 var body io.Reader = nil 6536 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 6537 if err != nil { 6538 return nil, err 6539 } 6540 reqHeaders.Set("Content-Type", "application/json") 6541 c.urlParams_.Set("alt", alt) 6542 c.urlParams_.Set("prettyPrint", "false") 6543 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates:instantiateInline") 6544 urls += "?" + c.urlParams_.Encode() 6545 req, err := http.NewRequest("POST", urls, body) 6546 if err != nil { 6547 return nil, err 6548 } 6549 req.Header = reqHeaders 6550 googleapi.Expand(req.URL, map[string]string{ 6551 "parent": c.parent, 6552 }) 6553 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6554} 6555 6556// Do executes the "dataproc.projects.locations.workflowTemplates.instantiateInline" call. 6557// Exactly one of *Operation or error will be non-nil. Any non-2xx 6558// status code is an error. Response headers are in either 6559// *Operation.ServerResponse.Header or (if a response was returned at 6560// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6561// to check whether the returned error was because 6562// http.StatusNotModified was returned. 6563func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6564 gensupport.SetOptions(c.urlParams_, opts...) 6565 res, err := c.doRequest("json") 6566 if res != nil && res.StatusCode == http.StatusNotModified { 6567 if res.Body != nil { 6568 res.Body.Close() 6569 } 6570 return nil, &googleapi.Error{ 6571 Code: res.StatusCode, 6572 Header: res.Header, 6573 } 6574 } 6575 if err != nil { 6576 return nil, err 6577 } 6578 defer googleapi.CloseBody(res) 6579 if err := googleapi.CheckResponse(res); err != nil { 6580 return nil, err 6581 } 6582 ret := &Operation{ 6583 ServerResponse: googleapi.ServerResponse{ 6584 Header: res.Header, 6585 HTTPStatusCode: res.StatusCode, 6586 }, 6587 } 6588 target := &ret 6589 if err := gensupport.DecodeResponse(target, res); err != nil { 6590 return nil, err 6591 } 6592 return ret, nil 6593 // { 6594 // "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.", 6595 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates:instantiateInline", 6596 // "httpMethod": "POST", 6597 // "id": "dataproc.projects.locations.workflowTemplates.instantiateInline", 6598 // "parameterOrder": [ 6599 // "parent" 6600 // ], 6601 // "parameters": { 6602 // "instanceId": { 6603 // "description": "Deprecated. Please use request_id field instead.", 6604 // "location": "query", 6605 // "type": "string" 6606 // }, 6607 // "parent": { 6608 // "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}", 6609 // "location": "path", 6610 // "pattern": "^projects/[^/]+/locations/[^/]+$", 6611 // "required": true, 6612 // "type": "string" 6613 // }, 6614 // "requestId": { 6615 // "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.", 6616 // "location": "query", 6617 // "type": "string" 6618 // } 6619 // }, 6620 // "path": "v1beta2/{+parent}/workflowTemplates:instantiateInline", 6621 // "request": { 6622 // "$ref": "WorkflowTemplate" 6623 // }, 6624 // "response": { 6625 // "$ref": "Operation" 6626 // }, 6627 // "scopes": [ 6628 // "https://www.googleapis.com/auth/cloud-platform" 6629 // ] 6630 // } 6631 6632} 6633 6634// method id "dataproc.projects.locations.workflowTemplates.list": 6635 6636type ProjectsLocationsWorkflowTemplatesListCall struct { 6637 s *Service 6638 parent string 6639 urlParams_ gensupport.URLParams 6640 ifNoneMatch_ string 6641 ctx_ context.Context 6642 header_ http.Header 6643} 6644 6645// List: Lists workflows that match the specified filter in the request. 6646// 6647// - parent: The resource name of the region or location, as described 6648// in https://cloud.google.com/apis/design/resource_names. For 6649// projects.regions.workflowTemplates,list, the resource name of the 6650// region has the following format: 6651// projects/{project_id}/regions/{region} For 6652// projects.locations.workflowTemplates.list, the resource name of the 6653// location has the following format: 6654// projects/{project_id}/locations/{location}. 6655func (r *ProjectsLocationsWorkflowTemplatesService) List(parent string) *ProjectsLocationsWorkflowTemplatesListCall { 6656 c := &ProjectsLocationsWorkflowTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6657 c.parent = parent 6658 return c 6659} 6660 6661// PageSize sets the optional parameter "pageSize": The maximum number 6662// of results to return in each response. 6663func (c *ProjectsLocationsWorkflowTemplatesListCall) PageSize(pageSize int64) *ProjectsLocationsWorkflowTemplatesListCall { 6664 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6665 return c 6666} 6667 6668// PageToken sets the optional parameter "pageToken": The page token, 6669// returned by a previous call, to request the next page of results. 6670func (c *ProjectsLocationsWorkflowTemplatesListCall) PageToken(pageToken string) *ProjectsLocationsWorkflowTemplatesListCall { 6671 c.urlParams_.Set("pageToken", pageToken) 6672 return c 6673} 6674 6675// Fields allows partial responses to be retrieved. See 6676// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6677// for more information. 6678func (c *ProjectsLocationsWorkflowTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesListCall { 6679 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6680 return c 6681} 6682 6683// IfNoneMatch sets the optional parameter which makes the operation 6684// fail if the object's ETag matches the given value. This is useful for 6685// getting updates only after the object has changed since the last 6686// request. Use googleapi.IsNotModified to check whether the response 6687// error from Do is the result of In-None-Match. 6688func (c *ProjectsLocationsWorkflowTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesListCall { 6689 c.ifNoneMatch_ = entityTag 6690 return c 6691} 6692 6693// Context sets the context to be used in this call's Do method. Any 6694// pending HTTP request will be aborted if the provided context is 6695// canceled. 6696func (c *ProjectsLocationsWorkflowTemplatesListCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesListCall { 6697 c.ctx_ = ctx 6698 return c 6699} 6700 6701// Header returns an http.Header that can be modified by the caller to 6702// add HTTP headers to the request. 6703func (c *ProjectsLocationsWorkflowTemplatesListCall) Header() http.Header { 6704 if c.header_ == nil { 6705 c.header_ = make(http.Header) 6706 } 6707 return c.header_ 6708} 6709 6710func (c *ProjectsLocationsWorkflowTemplatesListCall) doRequest(alt string) (*http.Response, error) { 6711 reqHeaders := make(http.Header) 6712 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 6713 for k, v := range c.header_ { 6714 reqHeaders[k] = v 6715 } 6716 reqHeaders.Set("User-Agent", c.s.userAgent()) 6717 if c.ifNoneMatch_ != "" { 6718 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6719 } 6720 var body io.Reader = nil 6721 c.urlParams_.Set("alt", alt) 6722 c.urlParams_.Set("prettyPrint", "false") 6723 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates") 6724 urls += "?" + c.urlParams_.Encode() 6725 req, err := http.NewRequest("GET", urls, body) 6726 if err != nil { 6727 return nil, err 6728 } 6729 req.Header = reqHeaders 6730 googleapi.Expand(req.URL, map[string]string{ 6731 "parent": c.parent, 6732 }) 6733 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6734} 6735 6736// Do executes the "dataproc.projects.locations.workflowTemplates.list" call. 6737// Exactly one of *ListWorkflowTemplatesResponse or error will be 6738// non-nil. Any non-2xx status code is an error. Response headers are in 6739// either *ListWorkflowTemplatesResponse.ServerResponse.Header or (if a 6740// response was returned at all) in error.(*googleapi.Error).Header. Use 6741// googleapi.IsNotModified to check whether the returned error was 6742// because http.StatusNotModified was returned. 6743func (c *ProjectsLocationsWorkflowTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowTemplatesResponse, error) { 6744 gensupport.SetOptions(c.urlParams_, opts...) 6745 res, err := c.doRequest("json") 6746 if res != nil && res.StatusCode == http.StatusNotModified { 6747 if res.Body != nil { 6748 res.Body.Close() 6749 } 6750 return nil, &googleapi.Error{ 6751 Code: res.StatusCode, 6752 Header: res.Header, 6753 } 6754 } 6755 if err != nil { 6756 return nil, err 6757 } 6758 defer googleapi.CloseBody(res) 6759 if err := googleapi.CheckResponse(res); err != nil { 6760 return nil, err 6761 } 6762 ret := &ListWorkflowTemplatesResponse{ 6763 ServerResponse: googleapi.ServerResponse{ 6764 Header: res.Header, 6765 HTTPStatusCode: res.StatusCode, 6766 }, 6767 } 6768 target := &ret 6769 if err := gensupport.DecodeResponse(target, res); err != nil { 6770 return nil, err 6771 } 6772 return ret, nil 6773 // { 6774 // "description": "Lists workflows that match the specified filter in the request.", 6775 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates", 6776 // "httpMethod": "GET", 6777 // "id": "dataproc.projects.locations.workflowTemplates.list", 6778 // "parameterOrder": [ 6779 // "parent" 6780 // ], 6781 // "parameters": { 6782 // "pageSize": { 6783 // "description": "Optional. The maximum number of results to return in each response.", 6784 // "format": "int32", 6785 // "location": "query", 6786 // "type": "integer" 6787 // }, 6788 // "pageToken": { 6789 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 6790 // "location": "query", 6791 // "type": "string" 6792 // }, 6793 // "parent": { 6794 // "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}", 6795 // "location": "path", 6796 // "pattern": "^projects/[^/]+/locations/[^/]+$", 6797 // "required": true, 6798 // "type": "string" 6799 // } 6800 // }, 6801 // "path": "v1beta2/{+parent}/workflowTemplates", 6802 // "response": { 6803 // "$ref": "ListWorkflowTemplatesResponse" 6804 // }, 6805 // "scopes": [ 6806 // "https://www.googleapis.com/auth/cloud-platform" 6807 // ] 6808 // } 6809 6810} 6811 6812// Pages invokes f for each page of results. 6813// A non-nil error returned from f will halt the iteration. 6814// The provided context supersedes any context provided to the Context method. 6815func (c *ProjectsLocationsWorkflowTemplatesListCall) Pages(ctx context.Context, f func(*ListWorkflowTemplatesResponse) error) error { 6816 c.ctx_ = ctx 6817 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6818 for { 6819 x, err := c.Do() 6820 if err != nil { 6821 return err 6822 } 6823 if err := f(x); err != nil { 6824 return err 6825 } 6826 if x.NextPageToken == "" { 6827 return nil 6828 } 6829 c.PageToken(x.NextPageToken) 6830 } 6831} 6832 6833// method id "dataproc.projects.locations.workflowTemplates.setIamPolicy": 6834 6835type ProjectsLocationsWorkflowTemplatesSetIamPolicyCall struct { 6836 s *Service 6837 resource string 6838 setiampolicyrequest *SetIamPolicyRequest 6839 urlParams_ gensupport.URLParams 6840 ctx_ context.Context 6841 header_ http.Header 6842} 6843 6844// SetIamPolicy: Sets the access control policy on the specified 6845// resource. Replaces any existing policy.Can return NOT_FOUND, 6846// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 6847// 6848// - resource: REQUIRED: The resource for which the policy is being 6849// specified. See the operation documentation for the appropriate 6850// value for this field. 6851func (r *ProjectsLocationsWorkflowTemplatesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall { 6852 c := &ProjectsLocationsWorkflowTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6853 c.resource = resource 6854 c.setiampolicyrequest = setiampolicyrequest 6855 return c 6856} 6857 6858// Fields allows partial responses to be retrieved. See 6859// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6860// for more information. 6861func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall { 6862 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6863 return c 6864} 6865 6866// Context sets the context to be used in this call's Do method. Any 6867// pending HTTP request will be aborted if the provided context is 6868// canceled. 6869func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall { 6870 c.ctx_ = ctx 6871 return c 6872} 6873 6874// Header returns an http.Header that can be modified by the caller to 6875// add HTTP headers to the request. 6876func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Header() http.Header { 6877 if c.header_ == nil { 6878 c.header_ = make(http.Header) 6879 } 6880 return c.header_ 6881} 6882 6883func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 6884 reqHeaders := make(http.Header) 6885 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 6886 for k, v := range c.header_ { 6887 reqHeaders[k] = v 6888 } 6889 reqHeaders.Set("User-Agent", c.s.userAgent()) 6890 var body io.Reader = nil 6891 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 6892 if err != nil { 6893 return nil, err 6894 } 6895 reqHeaders.Set("Content-Type", "application/json") 6896 c.urlParams_.Set("alt", alt) 6897 c.urlParams_.Set("prettyPrint", "false") 6898 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 6899 urls += "?" + c.urlParams_.Encode() 6900 req, err := http.NewRequest("POST", urls, body) 6901 if err != nil { 6902 return nil, err 6903 } 6904 req.Header = reqHeaders 6905 googleapi.Expand(req.URL, map[string]string{ 6906 "resource": c.resource, 6907 }) 6908 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6909} 6910 6911// Do executes the "dataproc.projects.locations.workflowTemplates.setIamPolicy" call. 6912// Exactly one of *Policy or error will be non-nil. Any non-2xx status 6913// code is an error. Response headers are in either 6914// *Policy.ServerResponse.Header or (if a response was returned at all) 6915// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6916// check whether the returned error was because http.StatusNotModified 6917// was returned. 6918func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 6919 gensupport.SetOptions(c.urlParams_, opts...) 6920 res, err := c.doRequest("json") 6921 if res != nil && res.StatusCode == http.StatusNotModified { 6922 if res.Body != nil { 6923 res.Body.Close() 6924 } 6925 return nil, &googleapi.Error{ 6926 Code: res.StatusCode, 6927 Header: res.Header, 6928 } 6929 } 6930 if err != nil { 6931 return nil, err 6932 } 6933 defer googleapi.CloseBody(res) 6934 if err := googleapi.CheckResponse(res); err != nil { 6935 return nil, err 6936 } 6937 ret := &Policy{ 6938 ServerResponse: googleapi.ServerResponse{ 6939 Header: res.Header, 6940 HTTPStatusCode: res.StatusCode, 6941 }, 6942 } 6943 target := &ret 6944 if err := gensupport.DecodeResponse(target, res); err != nil { 6945 return nil, err 6946 } 6947 return ret, nil 6948 // { 6949 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 6950 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:setIamPolicy", 6951 // "httpMethod": "POST", 6952 // "id": "dataproc.projects.locations.workflowTemplates.setIamPolicy", 6953 // "parameterOrder": [ 6954 // "resource" 6955 // ], 6956 // "parameters": { 6957 // "resource": { 6958 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 6959 // "location": "path", 6960 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 6961 // "required": true, 6962 // "type": "string" 6963 // } 6964 // }, 6965 // "path": "v1beta2/{+resource}:setIamPolicy", 6966 // "request": { 6967 // "$ref": "SetIamPolicyRequest" 6968 // }, 6969 // "response": { 6970 // "$ref": "Policy" 6971 // }, 6972 // "scopes": [ 6973 // "https://www.googleapis.com/auth/cloud-platform" 6974 // ] 6975 // } 6976 6977} 6978 6979// method id "dataproc.projects.locations.workflowTemplates.testIamPermissions": 6980 6981type ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall struct { 6982 s *Service 6983 resource string 6984 testiampermissionsrequest *TestIamPermissionsRequest 6985 urlParams_ gensupport.URLParams 6986 ctx_ context.Context 6987 header_ http.Header 6988} 6989 6990// TestIamPermissions: Returns permissions that a caller has on the 6991// specified resource. If the resource does not exist, this will return 6992// an empty set of permissions, not a NOT_FOUND error.Note: This 6993// operation is designed to be used for building permission-aware UIs 6994// and command-line tools, not for authorization checking. This 6995// operation may "fail open" without warning. 6996// 6997// - resource: REQUIRED: The resource for which the policy detail is 6998// being requested. See the operation documentation for the 6999// appropriate value for this field. 7000func (r *ProjectsLocationsWorkflowTemplatesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall { 7001 c := &ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7002 c.resource = resource 7003 c.testiampermissionsrequest = testiampermissionsrequest 7004 return c 7005} 7006 7007// Fields allows partial responses to be retrieved. See 7008// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7009// for more information. 7010func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall { 7011 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7012 return c 7013} 7014 7015// Context sets the context to be used in this call's Do method. Any 7016// pending HTTP request will be aborted if the provided context is 7017// canceled. 7018func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall { 7019 c.ctx_ = ctx 7020 return c 7021} 7022 7023// Header returns an http.Header that can be modified by the caller to 7024// add HTTP headers to the request. 7025func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Header() http.Header { 7026 if c.header_ == nil { 7027 c.header_ = make(http.Header) 7028 } 7029 return c.header_ 7030} 7031 7032func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 7033 reqHeaders := make(http.Header) 7034 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 7035 for k, v := range c.header_ { 7036 reqHeaders[k] = v 7037 } 7038 reqHeaders.Set("User-Agent", c.s.userAgent()) 7039 var body io.Reader = nil 7040 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 7041 if err != nil { 7042 return nil, err 7043 } 7044 reqHeaders.Set("Content-Type", "application/json") 7045 c.urlParams_.Set("alt", alt) 7046 c.urlParams_.Set("prettyPrint", "false") 7047 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 7048 urls += "?" + c.urlParams_.Encode() 7049 req, err := http.NewRequest("POST", urls, body) 7050 if err != nil { 7051 return nil, err 7052 } 7053 req.Header = reqHeaders 7054 googleapi.Expand(req.URL, map[string]string{ 7055 "resource": c.resource, 7056 }) 7057 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7058} 7059 7060// Do executes the "dataproc.projects.locations.workflowTemplates.testIamPermissions" call. 7061// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 7062// Any non-2xx status code is an error. Response headers are in either 7063// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 7064// was returned at all) in error.(*googleapi.Error).Header. Use 7065// googleapi.IsNotModified to check whether the returned error was 7066// because http.StatusNotModified was returned. 7067func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 7068 gensupport.SetOptions(c.urlParams_, opts...) 7069 res, err := c.doRequest("json") 7070 if res != nil && res.StatusCode == http.StatusNotModified { 7071 if res.Body != nil { 7072 res.Body.Close() 7073 } 7074 return nil, &googleapi.Error{ 7075 Code: res.StatusCode, 7076 Header: res.Header, 7077 } 7078 } 7079 if err != nil { 7080 return nil, err 7081 } 7082 defer googleapi.CloseBody(res) 7083 if err := googleapi.CheckResponse(res); err != nil { 7084 return nil, err 7085 } 7086 ret := &TestIamPermissionsResponse{ 7087 ServerResponse: googleapi.ServerResponse{ 7088 Header: res.Header, 7089 HTTPStatusCode: res.StatusCode, 7090 }, 7091 } 7092 target := &ret 7093 if err := gensupport.DecodeResponse(target, res); err != nil { 7094 return nil, err 7095 } 7096 return ret, nil 7097 // { 7098 // "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.", 7099 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:testIamPermissions", 7100 // "httpMethod": "POST", 7101 // "id": "dataproc.projects.locations.workflowTemplates.testIamPermissions", 7102 // "parameterOrder": [ 7103 // "resource" 7104 // ], 7105 // "parameters": { 7106 // "resource": { 7107 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 7108 // "location": "path", 7109 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 7110 // "required": true, 7111 // "type": "string" 7112 // } 7113 // }, 7114 // "path": "v1beta2/{+resource}:testIamPermissions", 7115 // "request": { 7116 // "$ref": "TestIamPermissionsRequest" 7117 // }, 7118 // "response": { 7119 // "$ref": "TestIamPermissionsResponse" 7120 // }, 7121 // "scopes": [ 7122 // "https://www.googleapis.com/auth/cloud-platform" 7123 // ] 7124 // } 7125 7126} 7127 7128// method id "dataproc.projects.locations.workflowTemplates.update": 7129 7130type ProjectsLocationsWorkflowTemplatesUpdateCall struct { 7131 s *Service 7132 name string 7133 workflowtemplate *WorkflowTemplate 7134 urlParams_ gensupport.URLParams 7135 ctx_ context.Context 7136 header_ http.Header 7137} 7138 7139// Update: Updates (replaces) workflow template. The updated template 7140// must contain version that matches the current server version. 7141// 7142// - name: Output only. The resource name of the workflow template, as 7143// described in https://cloud.google.com/apis/design/resource_names. 7144// For projects.regions.workflowTemplates, the resource name of the 7145// template has the following format: 7146// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 7147// d} For projects.locations.workflowTemplates, the resource name of 7148// the template has the following format: 7149// projects/{project_id}/locations/{location}/workflowTemplates/{templa 7150// te_id}. 7151func (r *ProjectsLocationsWorkflowTemplatesService) Update(name string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesUpdateCall { 7152 c := &ProjectsLocationsWorkflowTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7153 c.name = name 7154 c.workflowtemplate = workflowtemplate 7155 return c 7156} 7157 7158// Fields allows partial responses to be retrieved. See 7159// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7160// for more information. 7161func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesUpdateCall { 7162 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7163 return c 7164} 7165 7166// Context sets the context to be used in this call's Do method. Any 7167// pending HTTP request will be aborted if the provided context is 7168// canceled. 7169func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesUpdateCall { 7170 c.ctx_ = ctx 7171 return c 7172} 7173 7174// Header returns an http.Header that can be modified by the caller to 7175// add HTTP headers to the request. 7176func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Header() http.Header { 7177 if c.header_ == nil { 7178 c.header_ = make(http.Header) 7179 } 7180 return c.header_ 7181} 7182 7183func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) { 7184 reqHeaders := make(http.Header) 7185 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 7186 for k, v := range c.header_ { 7187 reqHeaders[k] = v 7188 } 7189 reqHeaders.Set("User-Agent", c.s.userAgent()) 7190 var body io.Reader = nil 7191 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 7192 if err != nil { 7193 return nil, err 7194 } 7195 reqHeaders.Set("Content-Type", "application/json") 7196 c.urlParams_.Set("alt", alt) 7197 c.urlParams_.Set("prettyPrint", "false") 7198 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 7199 urls += "?" + c.urlParams_.Encode() 7200 req, err := http.NewRequest("PUT", urls, body) 7201 if err != nil { 7202 return nil, err 7203 } 7204 req.Header = reqHeaders 7205 googleapi.Expand(req.URL, map[string]string{ 7206 "name": c.name, 7207 }) 7208 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7209} 7210 7211// Do executes the "dataproc.projects.locations.workflowTemplates.update" call. 7212// Exactly one of *WorkflowTemplate or error will be non-nil. Any 7213// non-2xx status code is an error. Response headers are in either 7214// *WorkflowTemplate.ServerResponse.Header or (if a response was 7215// returned at all) in error.(*googleapi.Error).Header. Use 7216// googleapi.IsNotModified to check whether the returned error was 7217// because http.StatusNotModified was returned. 7218func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 7219 gensupport.SetOptions(c.urlParams_, opts...) 7220 res, err := c.doRequest("json") 7221 if res != nil && res.StatusCode == http.StatusNotModified { 7222 if res.Body != nil { 7223 res.Body.Close() 7224 } 7225 return nil, &googleapi.Error{ 7226 Code: res.StatusCode, 7227 Header: res.Header, 7228 } 7229 } 7230 if err != nil { 7231 return nil, err 7232 } 7233 defer googleapi.CloseBody(res) 7234 if err := googleapi.CheckResponse(res); err != nil { 7235 return nil, err 7236 } 7237 ret := &WorkflowTemplate{ 7238 ServerResponse: googleapi.ServerResponse{ 7239 Header: res.Header, 7240 HTTPStatusCode: res.StatusCode, 7241 }, 7242 } 7243 target := &ret 7244 if err := gensupport.DecodeResponse(target, res); err != nil { 7245 return nil, err 7246 } 7247 return ret, nil 7248 // { 7249 // "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version.", 7250 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}", 7251 // "httpMethod": "PUT", 7252 // "id": "dataproc.projects.locations.workflowTemplates.update", 7253 // "parameterOrder": [ 7254 // "name" 7255 // ], 7256 // "parameters": { 7257 // "name": { 7258 // "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}", 7259 // "location": "path", 7260 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 7261 // "required": true, 7262 // "type": "string" 7263 // } 7264 // }, 7265 // "path": "v1beta2/{+name}", 7266 // "request": { 7267 // "$ref": "WorkflowTemplate" 7268 // }, 7269 // "response": { 7270 // "$ref": "WorkflowTemplate" 7271 // }, 7272 // "scopes": [ 7273 // "https://www.googleapis.com/auth/cloud-platform" 7274 // ] 7275 // } 7276 7277} 7278 7279// method id "dataproc.projects.regions.autoscalingPolicies.create": 7280 7281type ProjectsRegionsAutoscalingPoliciesCreateCall struct { 7282 s *Service 7283 parent string 7284 autoscalingpolicy *AutoscalingPolicy 7285 urlParams_ gensupport.URLParams 7286 ctx_ context.Context 7287 header_ http.Header 7288} 7289 7290// Create: Creates new autoscaling policy. 7291// 7292// - parent: The "resource name" of the region or location, as described 7293// in https://cloud.google.com/apis/design/resource_names. For 7294// projects.regions.autoscalingPolicies.create, the resource name has 7295// the following format: projects/{project_id}/regions/{region} For 7296// projects.locations.autoscalingPolicies.create, the resource name 7297// has the following format: 7298// projects/{project_id}/locations/{location}. 7299func (r *ProjectsRegionsAutoscalingPoliciesService) Create(parent string, autoscalingpolicy *AutoscalingPolicy) *ProjectsRegionsAutoscalingPoliciesCreateCall { 7300 c := &ProjectsRegionsAutoscalingPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7301 c.parent = parent 7302 c.autoscalingpolicy = autoscalingpolicy 7303 return c 7304} 7305 7306// Fields allows partial responses to be retrieved. See 7307// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7308// for more information. 7309func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesCreateCall { 7310 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7311 return c 7312} 7313 7314// Context sets the context to be used in this call's Do method. Any 7315// pending HTTP request will be aborted if the provided context is 7316// canceled. 7317func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesCreateCall { 7318 c.ctx_ = ctx 7319 return c 7320} 7321 7322// Header returns an http.Header that can be modified by the caller to 7323// add HTTP headers to the request. 7324func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Header() http.Header { 7325 if c.header_ == nil { 7326 c.header_ = make(http.Header) 7327 } 7328 return c.header_ 7329} 7330 7331func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { 7332 reqHeaders := make(http.Header) 7333 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 7334 for k, v := range c.header_ { 7335 reqHeaders[k] = v 7336 } 7337 reqHeaders.Set("User-Agent", c.s.userAgent()) 7338 var body io.Reader = nil 7339 body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) 7340 if err != nil { 7341 return nil, err 7342 } 7343 reqHeaders.Set("Content-Type", "application/json") 7344 c.urlParams_.Set("alt", alt) 7345 c.urlParams_.Set("prettyPrint", "false") 7346 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/autoscalingPolicies") 7347 urls += "?" + c.urlParams_.Encode() 7348 req, err := http.NewRequest("POST", urls, body) 7349 if err != nil { 7350 return nil, err 7351 } 7352 req.Header = reqHeaders 7353 googleapi.Expand(req.URL, map[string]string{ 7354 "parent": c.parent, 7355 }) 7356 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7357} 7358 7359// Do executes the "dataproc.projects.regions.autoscalingPolicies.create" call. 7360// Exactly one of *AutoscalingPolicy or error will be non-nil. Any 7361// non-2xx status code is an error. Response headers are in either 7362// *AutoscalingPolicy.ServerResponse.Header or (if a response was 7363// returned at all) in error.(*googleapi.Error).Header. Use 7364// googleapi.IsNotModified to check whether the returned error was 7365// because http.StatusNotModified was returned. 7366func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 7367 gensupport.SetOptions(c.urlParams_, opts...) 7368 res, err := c.doRequest("json") 7369 if res != nil && res.StatusCode == http.StatusNotModified { 7370 if res.Body != nil { 7371 res.Body.Close() 7372 } 7373 return nil, &googleapi.Error{ 7374 Code: res.StatusCode, 7375 Header: res.Header, 7376 } 7377 } 7378 if err != nil { 7379 return nil, err 7380 } 7381 defer googleapi.CloseBody(res) 7382 if err := googleapi.CheckResponse(res); err != nil { 7383 return nil, err 7384 } 7385 ret := &AutoscalingPolicy{ 7386 ServerResponse: googleapi.ServerResponse{ 7387 Header: res.Header, 7388 HTTPStatusCode: res.StatusCode, 7389 }, 7390 } 7391 target := &ret 7392 if err := gensupport.DecodeResponse(target, res); err != nil { 7393 return nil, err 7394 } 7395 return ret, nil 7396 // { 7397 // "description": "Creates new autoscaling policy.", 7398 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies", 7399 // "httpMethod": "POST", 7400 // "id": "dataproc.projects.regions.autoscalingPolicies.create", 7401 // "parameterOrder": [ 7402 // "parent" 7403 // ], 7404 // "parameters": { 7405 // "parent": { 7406 // "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 has the following format: projects/{project_id}/regions/{region} For projects.locations.autoscalingPolicies.create, the resource name has the following format: projects/{project_id}/locations/{location}", 7407 // "location": "path", 7408 // "pattern": "^projects/[^/]+/regions/[^/]+$", 7409 // "required": true, 7410 // "type": "string" 7411 // } 7412 // }, 7413 // "path": "v1beta2/{+parent}/autoscalingPolicies", 7414 // "request": { 7415 // "$ref": "AutoscalingPolicy" 7416 // }, 7417 // "response": { 7418 // "$ref": "AutoscalingPolicy" 7419 // }, 7420 // "scopes": [ 7421 // "https://www.googleapis.com/auth/cloud-platform" 7422 // ] 7423 // } 7424 7425} 7426 7427// method id "dataproc.projects.regions.autoscalingPolicies.delete": 7428 7429type ProjectsRegionsAutoscalingPoliciesDeleteCall struct { 7430 s *Service 7431 name string 7432 urlParams_ gensupport.URLParams 7433 ctx_ context.Context 7434 header_ http.Header 7435} 7436 7437// Delete: Deletes an autoscaling policy. It is an error to delete an 7438// autoscaling policy that is in use by one or more clusters. 7439// 7440// - name: The "resource name" of the autoscaling policy, as described 7441// in https://cloud.google.com/apis/design/resource_names. For 7442// projects.regions.autoscalingPolicies.delete, the resource name of 7443// the policy has the following format: 7444// projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 7445// d} For projects.locations.autoscalingPolicies.delete, the resource 7446// name of the policy has the following format: 7447// projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 7448// cy_id}. 7449func (r *ProjectsRegionsAutoscalingPoliciesService) Delete(name string) *ProjectsRegionsAutoscalingPoliciesDeleteCall { 7450 c := &ProjectsRegionsAutoscalingPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7451 c.name = name 7452 return c 7453} 7454 7455// Fields allows partial responses to be retrieved. See 7456// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7457// for more information. 7458func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesDeleteCall { 7459 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7460 return c 7461} 7462 7463// Context sets the context to be used in this call's Do method. Any 7464// pending HTTP request will be aborted if the provided context is 7465// canceled. 7466func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesDeleteCall { 7467 c.ctx_ = ctx 7468 return c 7469} 7470 7471// Header returns an http.Header that can be modified by the caller to 7472// add HTTP headers to the request. 7473func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Header() http.Header { 7474 if c.header_ == nil { 7475 c.header_ = make(http.Header) 7476 } 7477 return c.header_ 7478} 7479 7480func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { 7481 reqHeaders := make(http.Header) 7482 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 7483 for k, v := range c.header_ { 7484 reqHeaders[k] = v 7485 } 7486 reqHeaders.Set("User-Agent", c.s.userAgent()) 7487 var body io.Reader = nil 7488 c.urlParams_.Set("alt", alt) 7489 c.urlParams_.Set("prettyPrint", "false") 7490 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 7491 urls += "?" + c.urlParams_.Encode() 7492 req, err := http.NewRequest("DELETE", urls, body) 7493 if err != nil { 7494 return nil, err 7495 } 7496 req.Header = reqHeaders 7497 googleapi.Expand(req.URL, map[string]string{ 7498 "name": c.name, 7499 }) 7500 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7501} 7502 7503// Do executes the "dataproc.projects.regions.autoscalingPolicies.delete" call. 7504// Exactly one of *Empty or error will be non-nil. Any non-2xx status 7505// code is an error. Response headers are in either 7506// *Empty.ServerResponse.Header or (if a response was returned at all) 7507// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7508// check whether the returned error was because http.StatusNotModified 7509// was returned. 7510func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 7511 gensupport.SetOptions(c.urlParams_, opts...) 7512 res, err := c.doRequest("json") 7513 if res != nil && res.StatusCode == http.StatusNotModified { 7514 if res.Body != nil { 7515 res.Body.Close() 7516 } 7517 return nil, &googleapi.Error{ 7518 Code: res.StatusCode, 7519 Header: res.Header, 7520 } 7521 } 7522 if err != nil { 7523 return nil, err 7524 } 7525 defer googleapi.CloseBody(res) 7526 if err := googleapi.CheckResponse(res); err != nil { 7527 return nil, err 7528 } 7529 ret := &Empty{ 7530 ServerResponse: googleapi.ServerResponse{ 7531 Header: res.Header, 7532 HTTPStatusCode: res.StatusCode, 7533 }, 7534 } 7535 target := &ret 7536 if err := gensupport.DecodeResponse(target, res); err != nil { 7537 return nil, err 7538 } 7539 return ret, nil 7540 // { 7541 // "description": "Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.", 7542 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}", 7543 // "httpMethod": "DELETE", 7544 // "id": "dataproc.projects.regions.autoscalingPolicies.delete", 7545 // "parameterOrder": [ 7546 // "name" 7547 // ], 7548 // "parameters": { 7549 // "name": { 7550 // "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}", 7551 // "location": "path", 7552 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 7553 // "required": true, 7554 // "type": "string" 7555 // } 7556 // }, 7557 // "path": "v1beta2/{+name}", 7558 // "response": { 7559 // "$ref": "Empty" 7560 // }, 7561 // "scopes": [ 7562 // "https://www.googleapis.com/auth/cloud-platform" 7563 // ] 7564 // } 7565 7566} 7567 7568// method id "dataproc.projects.regions.autoscalingPolicies.get": 7569 7570type ProjectsRegionsAutoscalingPoliciesGetCall struct { 7571 s *Service 7572 name string 7573 urlParams_ gensupport.URLParams 7574 ifNoneMatch_ string 7575 ctx_ context.Context 7576 header_ http.Header 7577} 7578 7579// Get: Retrieves autoscaling policy. 7580// 7581// - name: The "resource name" of the autoscaling policy, as described 7582// in https://cloud.google.com/apis/design/resource_names. For 7583// projects.regions.autoscalingPolicies.get, the resource name of the 7584// policy has the following format: 7585// projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 7586// d} For projects.locations.autoscalingPolicies.get, the resource 7587// name of the policy has the following format: 7588// projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 7589// cy_id}. 7590func (r *ProjectsRegionsAutoscalingPoliciesService) Get(name string) *ProjectsRegionsAutoscalingPoliciesGetCall { 7591 c := &ProjectsRegionsAutoscalingPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7592 c.name = name 7593 return c 7594} 7595 7596// Fields allows partial responses to be retrieved. See 7597// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7598// for more information. 7599func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesGetCall { 7600 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7601 return c 7602} 7603 7604// IfNoneMatch sets the optional parameter which makes the operation 7605// fail if the object's ETag matches the given value. This is useful for 7606// getting updates only after the object has changed since the last 7607// request. Use googleapi.IsNotModified to check whether the response 7608// error from Do is the result of In-None-Match. 7609func (c *ProjectsRegionsAutoscalingPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsAutoscalingPoliciesGetCall { 7610 c.ifNoneMatch_ = entityTag 7611 return c 7612} 7613 7614// Context sets the context to be used in this call's Do method. Any 7615// pending HTTP request will be aborted if the provided context is 7616// canceled. 7617func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesGetCall { 7618 c.ctx_ = ctx 7619 return c 7620} 7621 7622// Header returns an http.Header that can be modified by the caller to 7623// add HTTP headers to the request. 7624func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Header() http.Header { 7625 if c.header_ == nil { 7626 c.header_ = make(http.Header) 7627 } 7628 return c.header_ 7629} 7630 7631func (c *ProjectsRegionsAutoscalingPoliciesGetCall) doRequest(alt string) (*http.Response, error) { 7632 reqHeaders := make(http.Header) 7633 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 7634 for k, v := range c.header_ { 7635 reqHeaders[k] = v 7636 } 7637 reqHeaders.Set("User-Agent", c.s.userAgent()) 7638 if c.ifNoneMatch_ != "" { 7639 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7640 } 7641 var body io.Reader = nil 7642 c.urlParams_.Set("alt", alt) 7643 c.urlParams_.Set("prettyPrint", "false") 7644 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 7645 urls += "?" + c.urlParams_.Encode() 7646 req, err := http.NewRequest("GET", urls, body) 7647 if err != nil { 7648 return nil, err 7649 } 7650 req.Header = reqHeaders 7651 googleapi.Expand(req.URL, map[string]string{ 7652 "name": c.name, 7653 }) 7654 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7655} 7656 7657// Do executes the "dataproc.projects.regions.autoscalingPolicies.get" call. 7658// Exactly one of *AutoscalingPolicy or error will be non-nil. Any 7659// non-2xx status code is an error. Response headers are in either 7660// *AutoscalingPolicy.ServerResponse.Header or (if a response was 7661// returned at all) in error.(*googleapi.Error).Header. Use 7662// googleapi.IsNotModified to check whether the returned error was 7663// because http.StatusNotModified was returned. 7664func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 7665 gensupport.SetOptions(c.urlParams_, opts...) 7666 res, err := c.doRequest("json") 7667 if res != nil && res.StatusCode == http.StatusNotModified { 7668 if res.Body != nil { 7669 res.Body.Close() 7670 } 7671 return nil, &googleapi.Error{ 7672 Code: res.StatusCode, 7673 Header: res.Header, 7674 } 7675 } 7676 if err != nil { 7677 return nil, err 7678 } 7679 defer googleapi.CloseBody(res) 7680 if err := googleapi.CheckResponse(res); err != nil { 7681 return nil, err 7682 } 7683 ret := &AutoscalingPolicy{ 7684 ServerResponse: googleapi.ServerResponse{ 7685 Header: res.Header, 7686 HTTPStatusCode: res.StatusCode, 7687 }, 7688 } 7689 target := &ret 7690 if err := gensupport.DecodeResponse(target, res); err != nil { 7691 return nil, err 7692 } 7693 return ret, nil 7694 // { 7695 // "description": "Retrieves autoscaling policy.", 7696 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}", 7697 // "httpMethod": "GET", 7698 // "id": "dataproc.projects.regions.autoscalingPolicies.get", 7699 // "parameterOrder": [ 7700 // "name" 7701 // ], 7702 // "parameters": { 7703 // "name": { 7704 // "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}", 7705 // "location": "path", 7706 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 7707 // "required": true, 7708 // "type": "string" 7709 // } 7710 // }, 7711 // "path": "v1beta2/{+name}", 7712 // "response": { 7713 // "$ref": "AutoscalingPolicy" 7714 // }, 7715 // "scopes": [ 7716 // "https://www.googleapis.com/auth/cloud-platform" 7717 // ] 7718 // } 7719 7720} 7721 7722// method id "dataproc.projects.regions.autoscalingPolicies.getIamPolicy": 7723 7724type ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall struct { 7725 s *Service 7726 resource string 7727 urlParams_ gensupport.URLParams 7728 ifNoneMatch_ string 7729 ctx_ context.Context 7730 header_ http.Header 7731} 7732 7733// GetIamPolicy: Gets the access control policy for a resource. Returns 7734// an empty policy if the resource exists and does not have a policy 7735// set. 7736// 7737// - resource: REQUIRED: The resource for which the policy is being 7738// requested. See the operation documentation for the appropriate 7739// value for this field. 7740func (r *ProjectsRegionsAutoscalingPoliciesService) GetIamPolicy(resource string) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall { 7741 c := &ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7742 c.resource = resource 7743 return c 7744} 7745 7746// OptionsRequestedPolicyVersion sets the optional parameter 7747// "options.requestedPolicyVersion": The policy format version to be 7748// returned.Valid values are 0, 1, and 3. Requests specifying an invalid 7749// value will be rejected.Requests for policies with any conditional 7750// bindings must specify version 3. Policies without any conditional 7751// bindings may specify any valid value or leave the field unset.To 7752// learn which resources support conditions in their IAM policies, see 7753// the IAM documentation 7754// (https://cloud.google.com/iam/help/conditions/resource-policies). 7755func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall { 7756 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 7757 return c 7758} 7759 7760// Fields allows partial responses to be retrieved. See 7761// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7762// for more information. 7763func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall { 7764 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7765 return c 7766} 7767 7768// IfNoneMatch sets the optional parameter which makes the operation 7769// fail if the object's ETag matches the given value. This is useful for 7770// getting updates only after the object has changed since the last 7771// request. Use googleapi.IsNotModified to check whether the response 7772// error from Do is the result of In-None-Match. 7773func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall { 7774 c.ifNoneMatch_ = entityTag 7775 return c 7776} 7777 7778// Context sets the context to be used in this call's Do method. Any 7779// pending HTTP request will be aborted if the provided context is 7780// canceled. 7781func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall { 7782 c.ctx_ = ctx 7783 return c 7784} 7785 7786// Header returns an http.Header that can be modified by the caller to 7787// add HTTP headers to the request. 7788func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Header() http.Header { 7789 if c.header_ == nil { 7790 c.header_ = make(http.Header) 7791 } 7792 return c.header_ 7793} 7794 7795func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 7796 reqHeaders := make(http.Header) 7797 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 7798 for k, v := range c.header_ { 7799 reqHeaders[k] = v 7800 } 7801 reqHeaders.Set("User-Agent", c.s.userAgent()) 7802 if c.ifNoneMatch_ != "" { 7803 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7804 } 7805 var body io.Reader = nil 7806 c.urlParams_.Set("alt", alt) 7807 c.urlParams_.Set("prettyPrint", "false") 7808 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 7809 urls += "?" + c.urlParams_.Encode() 7810 req, err := http.NewRequest("GET", urls, body) 7811 if err != nil { 7812 return nil, err 7813 } 7814 req.Header = reqHeaders 7815 googleapi.Expand(req.URL, map[string]string{ 7816 "resource": c.resource, 7817 }) 7818 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7819} 7820 7821// Do executes the "dataproc.projects.regions.autoscalingPolicies.getIamPolicy" call. 7822// Exactly one of *Policy or error will be non-nil. Any non-2xx status 7823// code is an error. Response headers are in either 7824// *Policy.ServerResponse.Header or (if a response was returned at all) 7825// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7826// check whether the returned error was because http.StatusNotModified 7827// was returned. 7828func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 7829 gensupport.SetOptions(c.urlParams_, opts...) 7830 res, err := c.doRequest("json") 7831 if res != nil && res.StatusCode == http.StatusNotModified { 7832 if res.Body != nil { 7833 res.Body.Close() 7834 } 7835 return nil, &googleapi.Error{ 7836 Code: res.StatusCode, 7837 Header: res.Header, 7838 } 7839 } 7840 if err != nil { 7841 return nil, err 7842 } 7843 defer googleapi.CloseBody(res) 7844 if err := googleapi.CheckResponse(res); err != nil { 7845 return nil, err 7846 } 7847 ret := &Policy{ 7848 ServerResponse: googleapi.ServerResponse{ 7849 Header: res.Header, 7850 HTTPStatusCode: res.StatusCode, 7851 }, 7852 } 7853 target := &ret 7854 if err := gensupport.DecodeResponse(target, res); err != nil { 7855 return nil, err 7856 } 7857 return ret, nil 7858 // { 7859 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 7860 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}:getIamPolicy", 7861 // "httpMethod": "GET", 7862 // "id": "dataproc.projects.regions.autoscalingPolicies.getIamPolicy", 7863 // "parameterOrder": [ 7864 // "resource" 7865 // ], 7866 // "parameters": { 7867 // "options.requestedPolicyVersion": { 7868 // "description": "Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset.To learn which resources support conditions in their IAM policies, see the IAM documentation (https://cloud.google.com/iam/help/conditions/resource-policies).", 7869 // "format": "int32", 7870 // "location": "query", 7871 // "type": "integer" 7872 // }, 7873 // "resource": { 7874 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 7875 // "location": "path", 7876 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 7877 // "required": true, 7878 // "type": "string" 7879 // } 7880 // }, 7881 // "path": "v1beta2/{+resource}:getIamPolicy", 7882 // "response": { 7883 // "$ref": "Policy" 7884 // }, 7885 // "scopes": [ 7886 // "https://www.googleapis.com/auth/cloud-platform" 7887 // ] 7888 // } 7889 7890} 7891 7892// method id "dataproc.projects.regions.autoscalingPolicies.list": 7893 7894type ProjectsRegionsAutoscalingPoliciesListCall struct { 7895 s *Service 7896 parent string 7897 urlParams_ gensupport.URLParams 7898 ifNoneMatch_ string 7899 ctx_ context.Context 7900 header_ http.Header 7901} 7902 7903// List: Lists autoscaling policies in the project. 7904// 7905// - parent: The "resource name" of the region or location, as described 7906// in https://cloud.google.com/apis/design/resource_names. For 7907// projects.regions.autoscalingPolicies.list, the resource name of the 7908// region has the following format: 7909// projects/{project_id}/regions/{region} For 7910// projects.locations.autoscalingPolicies.list, the resource name of 7911// the location has the following format: 7912// projects/{project_id}/locations/{location}. 7913func (r *ProjectsRegionsAutoscalingPoliciesService) List(parent string) *ProjectsRegionsAutoscalingPoliciesListCall { 7914 c := &ProjectsRegionsAutoscalingPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7915 c.parent = parent 7916 return c 7917} 7918 7919// PageSize sets the optional parameter "pageSize": The maximum number 7920// of results to return in each response. Must be less than or equal to 7921// 1000. Defaults to 100. 7922func (c *ProjectsRegionsAutoscalingPoliciesListCall) PageSize(pageSize int64) *ProjectsRegionsAutoscalingPoliciesListCall { 7923 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7924 return c 7925} 7926 7927// PageToken sets the optional parameter "pageToken": The page token, 7928// returned by a previous call, to request the next page of results. 7929func (c *ProjectsRegionsAutoscalingPoliciesListCall) PageToken(pageToken string) *ProjectsRegionsAutoscalingPoliciesListCall { 7930 c.urlParams_.Set("pageToken", pageToken) 7931 return c 7932} 7933 7934// Fields allows partial responses to be retrieved. See 7935// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7936// for more information. 7937func (c *ProjectsRegionsAutoscalingPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesListCall { 7938 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7939 return c 7940} 7941 7942// IfNoneMatch sets the optional parameter which makes the operation 7943// fail if the object's ETag matches the given value. This is useful for 7944// getting updates only after the object has changed since the last 7945// request. Use googleapi.IsNotModified to check whether the response 7946// error from Do is the result of In-None-Match. 7947func (c *ProjectsRegionsAutoscalingPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsRegionsAutoscalingPoliciesListCall { 7948 c.ifNoneMatch_ = entityTag 7949 return c 7950} 7951 7952// Context sets the context to be used in this call's Do method. Any 7953// pending HTTP request will be aborted if the provided context is 7954// canceled. 7955func (c *ProjectsRegionsAutoscalingPoliciesListCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesListCall { 7956 c.ctx_ = ctx 7957 return c 7958} 7959 7960// Header returns an http.Header that can be modified by the caller to 7961// add HTTP headers to the request. 7962func (c *ProjectsRegionsAutoscalingPoliciesListCall) Header() http.Header { 7963 if c.header_ == nil { 7964 c.header_ = make(http.Header) 7965 } 7966 return c.header_ 7967} 7968 7969func (c *ProjectsRegionsAutoscalingPoliciesListCall) doRequest(alt string) (*http.Response, error) { 7970 reqHeaders := make(http.Header) 7971 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 7972 for k, v := range c.header_ { 7973 reqHeaders[k] = v 7974 } 7975 reqHeaders.Set("User-Agent", c.s.userAgent()) 7976 if c.ifNoneMatch_ != "" { 7977 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7978 } 7979 var body io.Reader = nil 7980 c.urlParams_.Set("alt", alt) 7981 c.urlParams_.Set("prettyPrint", "false") 7982 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/autoscalingPolicies") 7983 urls += "?" + c.urlParams_.Encode() 7984 req, err := http.NewRequest("GET", urls, body) 7985 if err != nil { 7986 return nil, err 7987 } 7988 req.Header = reqHeaders 7989 googleapi.Expand(req.URL, map[string]string{ 7990 "parent": c.parent, 7991 }) 7992 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7993} 7994 7995// Do executes the "dataproc.projects.regions.autoscalingPolicies.list" call. 7996// Exactly one of *ListAutoscalingPoliciesResponse or error will be 7997// non-nil. Any non-2xx status code is an error. Response headers are in 7998// either *ListAutoscalingPoliciesResponse.ServerResponse.Header or (if 7999// a response was returned at all) in error.(*googleapi.Error).Header. 8000// Use googleapi.IsNotModified to check whether the returned error was 8001// because http.StatusNotModified was returned. 8002func (c *ProjectsRegionsAutoscalingPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListAutoscalingPoliciesResponse, error) { 8003 gensupport.SetOptions(c.urlParams_, opts...) 8004 res, err := c.doRequest("json") 8005 if res != nil && res.StatusCode == http.StatusNotModified { 8006 if res.Body != nil { 8007 res.Body.Close() 8008 } 8009 return nil, &googleapi.Error{ 8010 Code: res.StatusCode, 8011 Header: res.Header, 8012 } 8013 } 8014 if err != nil { 8015 return nil, err 8016 } 8017 defer googleapi.CloseBody(res) 8018 if err := googleapi.CheckResponse(res); err != nil { 8019 return nil, err 8020 } 8021 ret := &ListAutoscalingPoliciesResponse{ 8022 ServerResponse: googleapi.ServerResponse{ 8023 Header: res.Header, 8024 HTTPStatusCode: res.StatusCode, 8025 }, 8026 } 8027 target := &ret 8028 if err := gensupport.DecodeResponse(target, res); err != nil { 8029 return nil, err 8030 } 8031 return ret, nil 8032 // { 8033 // "description": "Lists autoscaling policies in the project.", 8034 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies", 8035 // "httpMethod": "GET", 8036 // "id": "dataproc.projects.regions.autoscalingPolicies.list", 8037 // "parameterOrder": [ 8038 // "parent" 8039 // ], 8040 // "parameters": { 8041 // "pageSize": { 8042 // "description": "Optional. The maximum number of results to return in each response. Must be less than or equal to 1000. Defaults to 100.", 8043 // "format": "int32", 8044 // "location": "query", 8045 // "type": "integer" 8046 // }, 8047 // "pageToken": { 8048 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 8049 // "location": "query", 8050 // "type": "string" 8051 // }, 8052 // "parent": { 8053 // "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}", 8054 // "location": "path", 8055 // "pattern": "^projects/[^/]+/regions/[^/]+$", 8056 // "required": true, 8057 // "type": "string" 8058 // } 8059 // }, 8060 // "path": "v1beta2/{+parent}/autoscalingPolicies", 8061 // "response": { 8062 // "$ref": "ListAutoscalingPoliciesResponse" 8063 // }, 8064 // "scopes": [ 8065 // "https://www.googleapis.com/auth/cloud-platform" 8066 // ] 8067 // } 8068 8069} 8070 8071// Pages invokes f for each page of results. 8072// A non-nil error returned from f will halt the iteration. 8073// The provided context supersedes any context provided to the Context method. 8074func (c *ProjectsRegionsAutoscalingPoliciesListCall) Pages(ctx context.Context, f func(*ListAutoscalingPoliciesResponse) error) error { 8075 c.ctx_ = ctx 8076 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8077 for { 8078 x, err := c.Do() 8079 if err != nil { 8080 return err 8081 } 8082 if err := f(x); err != nil { 8083 return err 8084 } 8085 if x.NextPageToken == "" { 8086 return nil 8087 } 8088 c.PageToken(x.NextPageToken) 8089 } 8090} 8091 8092// method id "dataproc.projects.regions.autoscalingPolicies.setIamPolicy": 8093 8094type ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall struct { 8095 s *Service 8096 resource string 8097 setiampolicyrequest *SetIamPolicyRequest 8098 urlParams_ gensupport.URLParams 8099 ctx_ context.Context 8100 header_ http.Header 8101} 8102 8103// SetIamPolicy: Sets the access control policy on the specified 8104// resource. Replaces any existing policy.Can return NOT_FOUND, 8105// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 8106// 8107// - resource: REQUIRED: The resource for which the policy is being 8108// specified. See the operation documentation for the appropriate 8109// value for this field. 8110func (r *ProjectsRegionsAutoscalingPoliciesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall { 8111 c := &ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8112 c.resource = resource 8113 c.setiampolicyrequest = setiampolicyrequest 8114 return c 8115} 8116 8117// Fields allows partial responses to be retrieved. See 8118// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8119// for more information. 8120func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall { 8121 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8122 return c 8123} 8124 8125// Context sets the context to be used in this call's Do method. Any 8126// pending HTTP request will be aborted if the provided context is 8127// canceled. 8128func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall { 8129 c.ctx_ = ctx 8130 return c 8131} 8132 8133// Header returns an http.Header that can be modified by the caller to 8134// add HTTP headers to the request. 8135func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Header() http.Header { 8136 if c.header_ == nil { 8137 c.header_ = make(http.Header) 8138 } 8139 return c.header_ 8140} 8141 8142func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 8143 reqHeaders := make(http.Header) 8144 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 8145 for k, v := range c.header_ { 8146 reqHeaders[k] = v 8147 } 8148 reqHeaders.Set("User-Agent", c.s.userAgent()) 8149 var body io.Reader = nil 8150 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 8151 if err != nil { 8152 return nil, err 8153 } 8154 reqHeaders.Set("Content-Type", "application/json") 8155 c.urlParams_.Set("alt", alt) 8156 c.urlParams_.Set("prettyPrint", "false") 8157 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 8158 urls += "?" + c.urlParams_.Encode() 8159 req, err := http.NewRequest("POST", urls, body) 8160 if err != nil { 8161 return nil, err 8162 } 8163 req.Header = reqHeaders 8164 googleapi.Expand(req.URL, map[string]string{ 8165 "resource": c.resource, 8166 }) 8167 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8168} 8169 8170// Do executes the "dataproc.projects.regions.autoscalingPolicies.setIamPolicy" call. 8171// Exactly one of *Policy or error will be non-nil. Any non-2xx status 8172// code is an error. Response headers are in either 8173// *Policy.ServerResponse.Header or (if a response was returned at all) 8174// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8175// check whether the returned error was because http.StatusNotModified 8176// was returned. 8177func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 8178 gensupport.SetOptions(c.urlParams_, opts...) 8179 res, err := c.doRequest("json") 8180 if res != nil && res.StatusCode == http.StatusNotModified { 8181 if res.Body != nil { 8182 res.Body.Close() 8183 } 8184 return nil, &googleapi.Error{ 8185 Code: res.StatusCode, 8186 Header: res.Header, 8187 } 8188 } 8189 if err != nil { 8190 return nil, err 8191 } 8192 defer googleapi.CloseBody(res) 8193 if err := googleapi.CheckResponse(res); err != nil { 8194 return nil, err 8195 } 8196 ret := &Policy{ 8197 ServerResponse: googleapi.ServerResponse{ 8198 Header: res.Header, 8199 HTTPStatusCode: res.StatusCode, 8200 }, 8201 } 8202 target := &ret 8203 if err := gensupport.DecodeResponse(target, res); err != nil { 8204 return nil, err 8205 } 8206 return ret, nil 8207 // { 8208 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 8209 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}:setIamPolicy", 8210 // "httpMethod": "POST", 8211 // "id": "dataproc.projects.regions.autoscalingPolicies.setIamPolicy", 8212 // "parameterOrder": [ 8213 // "resource" 8214 // ], 8215 // "parameters": { 8216 // "resource": { 8217 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 8218 // "location": "path", 8219 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 8220 // "required": true, 8221 // "type": "string" 8222 // } 8223 // }, 8224 // "path": "v1beta2/{+resource}:setIamPolicy", 8225 // "request": { 8226 // "$ref": "SetIamPolicyRequest" 8227 // }, 8228 // "response": { 8229 // "$ref": "Policy" 8230 // }, 8231 // "scopes": [ 8232 // "https://www.googleapis.com/auth/cloud-platform" 8233 // ] 8234 // } 8235 8236} 8237 8238// method id "dataproc.projects.regions.autoscalingPolicies.testIamPermissions": 8239 8240type ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall struct { 8241 s *Service 8242 resource string 8243 testiampermissionsrequest *TestIamPermissionsRequest 8244 urlParams_ gensupport.URLParams 8245 ctx_ context.Context 8246 header_ http.Header 8247} 8248 8249// TestIamPermissions: Returns permissions that a caller has on the 8250// specified resource. If the resource does not exist, this will return 8251// an empty set of permissions, not a NOT_FOUND error.Note: This 8252// operation is designed to be used for building permission-aware UIs 8253// and command-line tools, not for authorization checking. This 8254// operation may "fail open" without warning. 8255// 8256// - resource: REQUIRED: The resource for which the policy detail is 8257// being requested. See the operation documentation for the 8258// appropriate value for this field. 8259func (r *ProjectsRegionsAutoscalingPoliciesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall { 8260 c := &ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8261 c.resource = resource 8262 c.testiampermissionsrequest = testiampermissionsrequest 8263 return c 8264} 8265 8266// Fields allows partial responses to be retrieved. See 8267// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8268// for more information. 8269func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall { 8270 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8271 return c 8272} 8273 8274// Context sets the context to be used in this call's Do method. Any 8275// pending HTTP request will be aborted if the provided context is 8276// canceled. 8277func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall { 8278 c.ctx_ = ctx 8279 return c 8280} 8281 8282// Header returns an http.Header that can be modified by the caller to 8283// add HTTP headers to the request. 8284func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Header() http.Header { 8285 if c.header_ == nil { 8286 c.header_ = make(http.Header) 8287 } 8288 return c.header_ 8289} 8290 8291func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 8292 reqHeaders := make(http.Header) 8293 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 8294 for k, v := range c.header_ { 8295 reqHeaders[k] = v 8296 } 8297 reqHeaders.Set("User-Agent", c.s.userAgent()) 8298 var body io.Reader = nil 8299 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 8300 if err != nil { 8301 return nil, err 8302 } 8303 reqHeaders.Set("Content-Type", "application/json") 8304 c.urlParams_.Set("alt", alt) 8305 c.urlParams_.Set("prettyPrint", "false") 8306 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 8307 urls += "?" + c.urlParams_.Encode() 8308 req, err := http.NewRequest("POST", urls, body) 8309 if err != nil { 8310 return nil, err 8311 } 8312 req.Header = reqHeaders 8313 googleapi.Expand(req.URL, map[string]string{ 8314 "resource": c.resource, 8315 }) 8316 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8317} 8318 8319// Do executes the "dataproc.projects.regions.autoscalingPolicies.testIamPermissions" call. 8320// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 8321// Any non-2xx status code is an error. Response headers are in either 8322// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 8323// was returned at all) in error.(*googleapi.Error).Header. Use 8324// googleapi.IsNotModified to check whether the returned error was 8325// because http.StatusNotModified was returned. 8326func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 8327 gensupport.SetOptions(c.urlParams_, opts...) 8328 res, err := c.doRequest("json") 8329 if res != nil && res.StatusCode == http.StatusNotModified { 8330 if res.Body != nil { 8331 res.Body.Close() 8332 } 8333 return nil, &googleapi.Error{ 8334 Code: res.StatusCode, 8335 Header: res.Header, 8336 } 8337 } 8338 if err != nil { 8339 return nil, err 8340 } 8341 defer googleapi.CloseBody(res) 8342 if err := googleapi.CheckResponse(res); err != nil { 8343 return nil, err 8344 } 8345 ret := &TestIamPermissionsResponse{ 8346 ServerResponse: googleapi.ServerResponse{ 8347 Header: res.Header, 8348 HTTPStatusCode: res.StatusCode, 8349 }, 8350 } 8351 target := &ret 8352 if err := gensupport.DecodeResponse(target, res); err != nil { 8353 return nil, err 8354 } 8355 return ret, nil 8356 // { 8357 // "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.", 8358 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}:testIamPermissions", 8359 // "httpMethod": "POST", 8360 // "id": "dataproc.projects.regions.autoscalingPolicies.testIamPermissions", 8361 // "parameterOrder": [ 8362 // "resource" 8363 // ], 8364 // "parameters": { 8365 // "resource": { 8366 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 8367 // "location": "path", 8368 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 8369 // "required": true, 8370 // "type": "string" 8371 // } 8372 // }, 8373 // "path": "v1beta2/{+resource}:testIamPermissions", 8374 // "request": { 8375 // "$ref": "TestIamPermissionsRequest" 8376 // }, 8377 // "response": { 8378 // "$ref": "TestIamPermissionsResponse" 8379 // }, 8380 // "scopes": [ 8381 // "https://www.googleapis.com/auth/cloud-platform" 8382 // ] 8383 // } 8384 8385} 8386 8387// method id "dataproc.projects.regions.autoscalingPolicies.update": 8388 8389type ProjectsRegionsAutoscalingPoliciesUpdateCall struct { 8390 s *Service 8391 name string 8392 autoscalingpolicy *AutoscalingPolicy 8393 urlParams_ gensupport.URLParams 8394 ctx_ context.Context 8395 header_ http.Header 8396} 8397 8398// Update: Updates (replaces) autoscaling policy.Disabled check for 8399// update_mask, because all updates will be full replacements. 8400// 8401// - name: Output only. The "resource name" of the autoscaling policy, 8402// as described in 8403// https://cloud.google.com/apis/design/resource_names. For 8404// projects.regions.autoscalingPolicies, the resource name of the 8405// policy has the following format: 8406// projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 8407// d} For projects.locations.autoscalingPolicies, the resource name of 8408// the policy has the following format: 8409// projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 8410// cy_id}. 8411func (r *ProjectsRegionsAutoscalingPoliciesService) Update(name string, autoscalingpolicy *AutoscalingPolicy) *ProjectsRegionsAutoscalingPoliciesUpdateCall { 8412 c := &ProjectsRegionsAutoscalingPoliciesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8413 c.name = name 8414 c.autoscalingpolicy = autoscalingpolicy 8415 return c 8416} 8417 8418// Fields allows partial responses to be retrieved. See 8419// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8420// for more information. 8421func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesUpdateCall { 8422 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8423 return c 8424} 8425 8426// Context sets the context to be used in this call's Do method. Any 8427// pending HTTP request will be aborted if the provided context is 8428// canceled. 8429func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesUpdateCall { 8430 c.ctx_ = ctx 8431 return c 8432} 8433 8434// Header returns an http.Header that can be modified by the caller to 8435// add HTTP headers to the request. 8436func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Header() http.Header { 8437 if c.header_ == nil { 8438 c.header_ = make(http.Header) 8439 } 8440 return c.header_ 8441} 8442 8443func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { 8444 reqHeaders := make(http.Header) 8445 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 8446 for k, v := range c.header_ { 8447 reqHeaders[k] = v 8448 } 8449 reqHeaders.Set("User-Agent", c.s.userAgent()) 8450 var body io.Reader = nil 8451 body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) 8452 if err != nil { 8453 return nil, err 8454 } 8455 reqHeaders.Set("Content-Type", "application/json") 8456 c.urlParams_.Set("alt", alt) 8457 c.urlParams_.Set("prettyPrint", "false") 8458 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 8459 urls += "?" + c.urlParams_.Encode() 8460 req, err := http.NewRequest("PUT", urls, body) 8461 if err != nil { 8462 return nil, err 8463 } 8464 req.Header = reqHeaders 8465 googleapi.Expand(req.URL, map[string]string{ 8466 "name": c.name, 8467 }) 8468 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8469} 8470 8471// Do executes the "dataproc.projects.regions.autoscalingPolicies.update" call. 8472// Exactly one of *AutoscalingPolicy or error will be non-nil. Any 8473// non-2xx status code is an error. Response headers are in either 8474// *AutoscalingPolicy.ServerResponse.Header or (if a response was 8475// returned at all) in error.(*googleapi.Error).Header. Use 8476// googleapi.IsNotModified to check whether the returned error was 8477// because http.StatusNotModified was returned. 8478func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 8479 gensupport.SetOptions(c.urlParams_, opts...) 8480 res, err := c.doRequest("json") 8481 if res != nil && res.StatusCode == http.StatusNotModified { 8482 if res.Body != nil { 8483 res.Body.Close() 8484 } 8485 return nil, &googleapi.Error{ 8486 Code: res.StatusCode, 8487 Header: res.Header, 8488 } 8489 } 8490 if err != nil { 8491 return nil, err 8492 } 8493 defer googleapi.CloseBody(res) 8494 if err := googleapi.CheckResponse(res); err != nil { 8495 return nil, err 8496 } 8497 ret := &AutoscalingPolicy{ 8498 ServerResponse: googleapi.ServerResponse{ 8499 Header: res.Header, 8500 HTTPStatusCode: res.StatusCode, 8501 }, 8502 } 8503 target := &ret 8504 if err := gensupport.DecodeResponse(target, res); err != nil { 8505 return nil, err 8506 } 8507 return ret, nil 8508 // { 8509 // "description": "Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements.", 8510 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}", 8511 // "httpMethod": "PUT", 8512 // "id": "dataproc.projects.regions.autoscalingPolicies.update", 8513 // "parameterOrder": [ 8514 // "name" 8515 // ], 8516 // "parameters": { 8517 // "name": { 8518 // "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}", 8519 // "location": "path", 8520 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 8521 // "required": true, 8522 // "type": "string" 8523 // } 8524 // }, 8525 // "path": "v1beta2/{+name}", 8526 // "request": { 8527 // "$ref": "AutoscalingPolicy" 8528 // }, 8529 // "response": { 8530 // "$ref": "AutoscalingPolicy" 8531 // }, 8532 // "scopes": [ 8533 // "https://www.googleapis.com/auth/cloud-platform" 8534 // ] 8535 // } 8536 8537} 8538 8539// method id "dataproc.projects.regions.clusters.create": 8540 8541type ProjectsRegionsClustersCreateCall struct { 8542 s *Service 8543 projectId string 8544 region string 8545 cluster *Cluster 8546 urlParams_ gensupport.URLParams 8547 ctx_ context.Context 8548 header_ http.Header 8549} 8550 8551// Create: Creates a cluster in a project. The returned 8552// Operation.metadata will be ClusterOperationMetadata 8553// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). 8554// 8555// - projectId: The ID of the Google Cloud Platform project that the 8556// cluster belongs to. 8557// - region: The Dataproc region in which to handle the request. 8558func (r *ProjectsRegionsClustersService) Create(projectId string, region string, cluster *Cluster) *ProjectsRegionsClustersCreateCall { 8559 c := &ProjectsRegionsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8560 c.projectId = projectId 8561 c.region = region 8562 c.cluster = cluster 8563 return c 8564} 8565 8566// RequestId sets the optional parameter "requestId": A unique id used 8567// to identify the request. If the server receives two 8568// CreateClusterRequest 8569// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#google.cloud.dataproc.v1beta2.CreateClusterRequest)s 8570// with the same id, then the second request will be ignored and the 8571// first google.longrunning.Operation created and stored in the backend 8572// is returned.It is recommended to always set this value to a UUID 8573// (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id 8574// must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 8575// and hyphens (-). The maximum length is 40 characters. 8576func (c *ProjectsRegionsClustersCreateCall) RequestId(requestId string) *ProjectsRegionsClustersCreateCall { 8577 c.urlParams_.Set("requestId", requestId) 8578 return c 8579} 8580 8581// Fields allows partial responses to be retrieved. See 8582// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8583// for more information. 8584func (c *ProjectsRegionsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersCreateCall { 8585 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8586 return c 8587} 8588 8589// Context sets the context to be used in this call's Do method. Any 8590// pending HTTP request will be aborted if the provided context is 8591// canceled. 8592func (c *ProjectsRegionsClustersCreateCall) Context(ctx context.Context) *ProjectsRegionsClustersCreateCall { 8593 c.ctx_ = ctx 8594 return c 8595} 8596 8597// Header returns an http.Header that can be modified by the caller to 8598// add HTTP headers to the request. 8599func (c *ProjectsRegionsClustersCreateCall) Header() http.Header { 8600 if c.header_ == nil { 8601 c.header_ = make(http.Header) 8602 } 8603 return c.header_ 8604} 8605 8606func (c *ProjectsRegionsClustersCreateCall) doRequest(alt string) (*http.Response, error) { 8607 reqHeaders := make(http.Header) 8608 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 8609 for k, v := range c.header_ { 8610 reqHeaders[k] = v 8611 } 8612 reqHeaders.Set("User-Agent", c.s.userAgent()) 8613 var body io.Reader = nil 8614 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) 8615 if err != nil { 8616 return nil, err 8617 } 8618 reqHeaders.Set("Content-Type", "application/json") 8619 c.urlParams_.Set("alt", alt) 8620 c.urlParams_.Set("prettyPrint", "false") 8621 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters") 8622 urls += "?" + c.urlParams_.Encode() 8623 req, err := http.NewRequest("POST", urls, body) 8624 if err != nil { 8625 return nil, err 8626 } 8627 req.Header = reqHeaders 8628 googleapi.Expand(req.URL, map[string]string{ 8629 "projectId": c.projectId, 8630 "region": c.region, 8631 }) 8632 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8633} 8634 8635// Do executes the "dataproc.projects.regions.clusters.create" call. 8636// Exactly one of *Operation or error will be non-nil. Any non-2xx 8637// status code is an error. Response headers are in either 8638// *Operation.ServerResponse.Header or (if a response was returned at 8639// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8640// to check whether the returned error was because 8641// http.StatusNotModified was returned. 8642func (c *ProjectsRegionsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8643 gensupport.SetOptions(c.urlParams_, opts...) 8644 res, err := c.doRequest("json") 8645 if res != nil && res.StatusCode == http.StatusNotModified { 8646 if res.Body != nil { 8647 res.Body.Close() 8648 } 8649 return nil, &googleapi.Error{ 8650 Code: res.StatusCode, 8651 Header: res.Header, 8652 } 8653 } 8654 if err != nil { 8655 return nil, err 8656 } 8657 defer googleapi.CloseBody(res) 8658 if err := googleapi.CheckResponse(res); err != nil { 8659 return nil, err 8660 } 8661 ret := &Operation{ 8662 ServerResponse: googleapi.ServerResponse{ 8663 Header: res.Header, 8664 HTTPStatusCode: res.StatusCode, 8665 }, 8666 } 8667 target := &ret 8668 if err := gensupport.DecodeResponse(target, res); err != nil { 8669 return nil, err 8670 } 8671 return ret, nil 8672 // { 8673 // "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.v1beta2#clusteroperationmetadata).", 8674 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters", 8675 // "httpMethod": "POST", 8676 // "id": "dataproc.projects.regions.clusters.create", 8677 // "parameterOrder": [ 8678 // "projectId", 8679 // "region" 8680 // ], 8681 // "parameters": { 8682 // "projectId": { 8683 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 8684 // "location": "path", 8685 // "required": true, 8686 // "type": "string" 8687 // }, 8688 // "region": { 8689 // "description": "Required. The Dataproc region in which to handle the request.", 8690 // "location": "path", 8691 // "required": true, 8692 // "type": "string" 8693 // }, 8694 // "requestId": { 8695 // "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.v1beta2#google.cloud.dataproc.v1beta2.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.", 8696 // "location": "query", 8697 // "type": "string" 8698 // } 8699 // }, 8700 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters", 8701 // "request": { 8702 // "$ref": "Cluster" 8703 // }, 8704 // "response": { 8705 // "$ref": "Operation" 8706 // }, 8707 // "scopes": [ 8708 // "https://www.googleapis.com/auth/cloud-platform" 8709 // ] 8710 // } 8711 8712} 8713 8714// method id "dataproc.projects.regions.clusters.delete": 8715 8716type ProjectsRegionsClustersDeleteCall struct { 8717 s *Service 8718 projectId string 8719 region string 8720 clusterName string 8721 urlParams_ gensupport.URLParams 8722 ctx_ context.Context 8723 header_ http.Header 8724} 8725 8726// Delete: Deletes a cluster in a project. The returned 8727// Operation.metadata will be ClusterOperationMetadata 8728// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). 8729// 8730// - clusterName: The cluster name. 8731// - projectId: The ID of the Google Cloud Platform project that the 8732// cluster belongs to. 8733// - region: The Dataproc region in which to handle the request. 8734func (r *ProjectsRegionsClustersService) Delete(projectId string, region string, clusterName string) *ProjectsRegionsClustersDeleteCall { 8735 c := &ProjectsRegionsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8736 c.projectId = projectId 8737 c.region = region 8738 c.clusterName = clusterName 8739 return c 8740} 8741 8742// ClusterUuid sets the optional parameter "clusterUuid": Specifying the 8743// cluster_uuid means the RPC should fail (with error NOT_FOUND) if 8744// cluster with specified UUID does not exist. 8745func (c *ProjectsRegionsClustersDeleteCall) ClusterUuid(clusterUuid string) *ProjectsRegionsClustersDeleteCall { 8746 c.urlParams_.Set("clusterUuid", clusterUuid) 8747 return c 8748} 8749 8750// RequestId sets the optional parameter "requestId": A unique id used 8751// to identify the request. If the server receives two 8752// DeleteClusterRequest 8753// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#google.cloud.dataproc.v1beta2.DeleteClusterRequest)s 8754// with the same id, then the second request will be ignored and the 8755// first google.longrunning.Operation created and stored in the backend 8756// is returned.It is recommended to always set this value to a UUID 8757// (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id 8758// must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 8759// and hyphens (-). The maximum length is 40 characters. 8760func (c *ProjectsRegionsClustersDeleteCall) RequestId(requestId string) *ProjectsRegionsClustersDeleteCall { 8761 c.urlParams_.Set("requestId", requestId) 8762 return c 8763} 8764 8765// Fields allows partial responses to be retrieved. See 8766// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8767// for more information. 8768func (c *ProjectsRegionsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersDeleteCall { 8769 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8770 return c 8771} 8772 8773// Context sets the context to be used in this call's Do method. Any 8774// pending HTTP request will be aborted if the provided context is 8775// canceled. 8776func (c *ProjectsRegionsClustersDeleteCall) Context(ctx context.Context) *ProjectsRegionsClustersDeleteCall { 8777 c.ctx_ = ctx 8778 return c 8779} 8780 8781// Header returns an http.Header that can be modified by the caller to 8782// add HTTP headers to the request. 8783func (c *ProjectsRegionsClustersDeleteCall) Header() http.Header { 8784 if c.header_ == nil { 8785 c.header_ = make(http.Header) 8786 } 8787 return c.header_ 8788} 8789 8790func (c *ProjectsRegionsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { 8791 reqHeaders := make(http.Header) 8792 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 8793 for k, v := range c.header_ { 8794 reqHeaders[k] = v 8795 } 8796 reqHeaders.Set("User-Agent", c.s.userAgent()) 8797 var body io.Reader = nil 8798 c.urlParams_.Set("alt", alt) 8799 c.urlParams_.Set("prettyPrint", "false") 8800 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}") 8801 urls += "?" + c.urlParams_.Encode() 8802 req, err := http.NewRequest("DELETE", urls, body) 8803 if err != nil { 8804 return nil, err 8805 } 8806 req.Header = reqHeaders 8807 googleapi.Expand(req.URL, map[string]string{ 8808 "projectId": c.projectId, 8809 "region": c.region, 8810 "clusterName": c.clusterName, 8811 }) 8812 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8813} 8814 8815// Do executes the "dataproc.projects.regions.clusters.delete" call. 8816// Exactly one of *Operation or error will be non-nil. Any non-2xx 8817// status code is an error. Response headers are in either 8818// *Operation.ServerResponse.Header or (if a response was returned at 8819// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8820// to check whether the returned error was because 8821// http.StatusNotModified was returned. 8822func (c *ProjectsRegionsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8823 gensupport.SetOptions(c.urlParams_, opts...) 8824 res, err := c.doRequest("json") 8825 if res != nil && res.StatusCode == http.StatusNotModified { 8826 if res.Body != nil { 8827 res.Body.Close() 8828 } 8829 return nil, &googleapi.Error{ 8830 Code: res.StatusCode, 8831 Header: res.Header, 8832 } 8833 } 8834 if err != nil { 8835 return nil, err 8836 } 8837 defer googleapi.CloseBody(res) 8838 if err := googleapi.CheckResponse(res); err != nil { 8839 return nil, err 8840 } 8841 ret := &Operation{ 8842 ServerResponse: googleapi.ServerResponse{ 8843 Header: res.Header, 8844 HTTPStatusCode: res.StatusCode, 8845 }, 8846 } 8847 target := &ret 8848 if err := gensupport.DecodeResponse(target, res); err != nil { 8849 return nil, err 8850 } 8851 return ret, nil 8852 // { 8853 // "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.v1beta2#clusteroperationmetadata).", 8854 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", 8855 // "httpMethod": "DELETE", 8856 // "id": "dataproc.projects.regions.clusters.delete", 8857 // "parameterOrder": [ 8858 // "projectId", 8859 // "region", 8860 // "clusterName" 8861 // ], 8862 // "parameters": { 8863 // "clusterName": { 8864 // "description": "Required. The cluster name.", 8865 // "location": "path", 8866 // "required": true, 8867 // "type": "string" 8868 // }, 8869 // "clusterUuid": { 8870 // "description": "Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist.", 8871 // "location": "query", 8872 // "type": "string" 8873 // }, 8874 // "projectId": { 8875 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 8876 // "location": "path", 8877 // "required": true, 8878 // "type": "string" 8879 // }, 8880 // "region": { 8881 // "description": "Required. The Dataproc region in which to handle the request.", 8882 // "location": "path", 8883 // "required": true, 8884 // "type": "string" 8885 // }, 8886 // "requestId": { 8887 // "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.v1beta2#google.cloud.dataproc.v1beta2.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.", 8888 // "location": "query", 8889 // "type": "string" 8890 // } 8891 // }, 8892 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", 8893 // "response": { 8894 // "$ref": "Operation" 8895 // }, 8896 // "scopes": [ 8897 // "https://www.googleapis.com/auth/cloud-platform" 8898 // ] 8899 // } 8900 8901} 8902 8903// method id "dataproc.projects.regions.clusters.diagnose": 8904 8905type ProjectsRegionsClustersDiagnoseCall struct { 8906 s *Service 8907 projectId string 8908 region string 8909 clusterName string 8910 diagnoseclusterrequest *DiagnoseClusterRequest 8911 urlParams_ gensupport.URLParams 8912 ctx_ context.Context 8913 header_ http.Header 8914} 8915 8916// Diagnose: Gets cluster diagnostic information. The returned 8917// Operation.metadata will be ClusterOperationMetadata 8918// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). 8919// After the operation completes, Operation.response contains Empty. 8920// 8921// - clusterName: The cluster name. 8922// - projectId: The ID of the Google Cloud Platform project that the 8923// cluster belongs to. 8924// - region: The Dataproc region in which to handle the request. 8925func (r *ProjectsRegionsClustersService) Diagnose(projectId string, region string, clusterName string, diagnoseclusterrequest *DiagnoseClusterRequest) *ProjectsRegionsClustersDiagnoseCall { 8926 c := &ProjectsRegionsClustersDiagnoseCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8927 c.projectId = projectId 8928 c.region = region 8929 c.clusterName = clusterName 8930 c.diagnoseclusterrequest = diagnoseclusterrequest 8931 return c 8932} 8933 8934// Fields allows partial responses to be retrieved. See 8935// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8936// for more information. 8937func (c *ProjectsRegionsClustersDiagnoseCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersDiagnoseCall { 8938 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8939 return c 8940} 8941 8942// Context sets the context to be used in this call's Do method. Any 8943// pending HTTP request will be aborted if the provided context is 8944// canceled. 8945func (c *ProjectsRegionsClustersDiagnoseCall) Context(ctx context.Context) *ProjectsRegionsClustersDiagnoseCall { 8946 c.ctx_ = ctx 8947 return c 8948} 8949 8950// Header returns an http.Header that can be modified by the caller to 8951// add HTTP headers to the request. 8952func (c *ProjectsRegionsClustersDiagnoseCall) Header() http.Header { 8953 if c.header_ == nil { 8954 c.header_ = make(http.Header) 8955 } 8956 return c.header_ 8957} 8958 8959func (c *ProjectsRegionsClustersDiagnoseCall) doRequest(alt string) (*http.Response, error) { 8960 reqHeaders := make(http.Header) 8961 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 8962 for k, v := range c.header_ { 8963 reqHeaders[k] = v 8964 } 8965 reqHeaders.Set("User-Agent", c.s.userAgent()) 8966 var body io.Reader = nil 8967 body, err := googleapi.WithoutDataWrapper.JSONReader(c.diagnoseclusterrequest) 8968 if err != nil { 8969 return nil, err 8970 } 8971 reqHeaders.Set("Content-Type", "application/json") 8972 c.urlParams_.Set("alt", alt) 8973 c.urlParams_.Set("prettyPrint", "false") 8974 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose") 8975 urls += "?" + c.urlParams_.Encode() 8976 req, err := http.NewRequest("POST", urls, body) 8977 if err != nil { 8978 return nil, err 8979 } 8980 req.Header = reqHeaders 8981 googleapi.Expand(req.URL, map[string]string{ 8982 "projectId": c.projectId, 8983 "region": c.region, 8984 "clusterName": c.clusterName, 8985 }) 8986 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8987} 8988 8989// Do executes the "dataproc.projects.regions.clusters.diagnose" call. 8990// Exactly one of *Operation or error will be non-nil. Any non-2xx 8991// status code is an error. Response headers are in either 8992// *Operation.ServerResponse.Header or (if a response was returned at 8993// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8994// to check whether the returned error was because 8995// http.StatusNotModified was returned. 8996func (c *ProjectsRegionsClustersDiagnoseCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8997 gensupport.SetOptions(c.urlParams_, opts...) 8998 res, err := c.doRequest("json") 8999 if res != nil && res.StatusCode == http.StatusNotModified { 9000 if res.Body != nil { 9001 res.Body.Close() 9002 } 9003 return nil, &googleapi.Error{ 9004 Code: res.StatusCode, 9005 Header: res.Header, 9006 } 9007 } 9008 if err != nil { 9009 return nil, err 9010 } 9011 defer googleapi.CloseBody(res) 9012 if err := googleapi.CheckResponse(res); err != nil { 9013 return nil, err 9014 } 9015 ret := &Operation{ 9016 ServerResponse: googleapi.ServerResponse{ 9017 Header: res.Header, 9018 HTTPStatusCode: res.StatusCode, 9019 }, 9020 } 9021 target := &ret 9022 if err := gensupport.DecodeResponse(target, res); err != nil { 9023 return nil, err 9024 } 9025 return ret, nil 9026 // { 9027 // "description": "Gets cluster diagnostic information. The returned Operation.metadata will be ClusterOperationMetadata (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). After the operation completes, Operation.response contains Empty.", 9028 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", 9029 // "httpMethod": "POST", 9030 // "id": "dataproc.projects.regions.clusters.diagnose", 9031 // "parameterOrder": [ 9032 // "projectId", 9033 // "region", 9034 // "clusterName" 9035 // ], 9036 // "parameters": { 9037 // "clusterName": { 9038 // "description": "Required. The cluster name.", 9039 // "location": "path", 9040 // "required": true, 9041 // "type": "string" 9042 // }, 9043 // "projectId": { 9044 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 9045 // "location": "path", 9046 // "required": true, 9047 // "type": "string" 9048 // }, 9049 // "region": { 9050 // "description": "Required. The Dataproc region in which to handle the request.", 9051 // "location": "path", 9052 // "required": true, 9053 // "type": "string" 9054 // } 9055 // }, 9056 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", 9057 // "request": { 9058 // "$ref": "DiagnoseClusterRequest" 9059 // }, 9060 // "response": { 9061 // "$ref": "Operation" 9062 // }, 9063 // "scopes": [ 9064 // "https://www.googleapis.com/auth/cloud-platform" 9065 // ] 9066 // } 9067 9068} 9069 9070// method id "dataproc.projects.regions.clusters.get": 9071 9072type ProjectsRegionsClustersGetCall struct { 9073 s *Service 9074 projectId string 9075 region string 9076 clusterName string 9077 urlParams_ gensupport.URLParams 9078 ifNoneMatch_ string 9079 ctx_ context.Context 9080 header_ http.Header 9081} 9082 9083// Get: Gets the resource representation for a cluster in a project. 9084// 9085// - clusterName: The cluster name. 9086// - projectId: The ID of the Google Cloud Platform project that the 9087// cluster belongs to. 9088// - region: The Dataproc region in which to handle the request. 9089func (r *ProjectsRegionsClustersService) Get(projectId string, region string, clusterName string) *ProjectsRegionsClustersGetCall { 9090 c := &ProjectsRegionsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9091 c.projectId = projectId 9092 c.region = region 9093 c.clusterName = clusterName 9094 return c 9095} 9096 9097// Fields allows partial responses to be retrieved. See 9098// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9099// for more information. 9100func (c *ProjectsRegionsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersGetCall { 9101 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9102 return c 9103} 9104 9105// IfNoneMatch sets the optional parameter which makes the operation 9106// fail if the object's ETag matches the given value. This is useful for 9107// getting updates only after the object has changed since the last 9108// request. Use googleapi.IsNotModified to check whether the response 9109// error from Do is the result of In-None-Match. 9110func (c *ProjectsRegionsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersGetCall { 9111 c.ifNoneMatch_ = entityTag 9112 return c 9113} 9114 9115// Context sets the context to be used in this call's Do method. Any 9116// pending HTTP request will be aborted if the provided context is 9117// canceled. 9118func (c *ProjectsRegionsClustersGetCall) Context(ctx context.Context) *ProjectsRegionsClustersGetCall { 9119 c.ctx_ = ctx 9120 return c 9121} 9122 9123// Header returns an http.Header that can be modified by the caller to 9124// add HTTP headers to the request. 9125func (c *ProjectsRegionsClustersGetCall) Header() http.Header { 9126 if c.header_ == nil { 9127 c.header_ = make(http.Header) 9128 } 9129 return c.header_ 9130} 9131 9132func (c *ProjectsRegionsClustersGetCall) doRequest(alt string) (*http.Response, error) { 9133 reqHeaders := make(http.Header) 9134 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 9135 for k, v := range c.header_ { 9136 reqHeaders[k] = v 9137 } 9138 reqHeaders.Set("User-Agent", c.s.userAgent()) 9139 if c.ifNoneMatch_ != "" { 9140 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9141 } 9142 var body io.Reader = nil 9143 c.urlParams_.Set("alt", alt) 9144 c.urlParams_.Set("prettyPrint", "false") 9145 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}") 9146 urls += "?" + c.urlParams_.Encode() 9147 req, err := http.NewRequest("GET", urls, body) 9148 if err != nil { 9149 return nil, err 9150 } 9151 req.Header = reqHeaders 9152 googleapi.Expand(req.URL, map[string]string{ 9153 "projectId": c.projectId, 9154 "region": c.region, 9155 "clusterName": c.clusterName, 9156 }) 9157 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9158} 9159 9160// Do executes the "dataproc.projects.regions.clusters.get" call. 9161// Exactly one of *Cluster or error will be non-nil. Any non-2xx status 9162// code is an error. Response headers are in either 9163// *Cluster.ServerResponse.Header or (if a response was returned at all) 9164// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9165// check whether the returned error was because http.StatusNotModified 9166// was returned. 9167func (c *ProjectsRegionsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) { 9168 gensupport.SetOptions(c.urlParams_, opts...) 9169 res, err := c.doRequest("json") 9170 if res != nil && res.StatusCode == http.StatusNotModified { 9171 if res.Body != nil { 9172 res.Body.Close() 9173 } 9174 return nil, &googleapi.Error{ 9175 Code: res.StatusCode, 9176 Header: res.Header, 9177 } 9178 } 9179 if err != nil { 9180 return nil, err 9181 } 9182 defer googleapi.CloseBody(res) 9183 if err := googleapi.CheckResponse(res); err != nil { 9184 return nil, err 9185 } 9186 ret := &Cluster{ 9187 ServerResponse: googleapi.ServerResponse{ 9188 Header: res.Header, 9189 HTTPStatusCode: res.StatusCode, 9190 }, 9191 } 9192 target := &ret 9193 if err := gensupport.DecodeResponse(target, res); err != nil { 9194 return nil, err 9195 } 9196 return ret, nil 9197 // { 9198 // "description": "Gets the resource representation for a cluster in a project.", 9199 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", 9200 // "httpMethod": "GET", 9201 // "id": "dataproc.projects.regions.clusters.get", 9202 // "parameterOrder": [ 9203 // "projectId", 9204 // "region", 9205 // "clusterName" 9206 // ], 9207 // "parameters": { 9208 // "clusterName": { 9209 // "description": "Required. The cluster name.", 9210 // "location": "path", 9211 // "required": true, 9212 // "type": "string" 9213 // }, 9214 // "projectId": { 9215 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 9216 // "location": "path", 9217 // "required": true, 9218 // "type": "string" 9219 // }, 9220 // "region": { 9221 // "description": "Required. The Dataproc region in which to handle the request.", 9222 // "location": "path", 9223 // "required": true, 9224 // "type": "string" 9225 // } 9226 // }, 9227 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", 9228 // "response": { 9229 // "$ref": "Cluster" 9230 // }, 9231 // "scopes": [ 9232 // "https://www.googleapis.com/auth/cloud-platform" 9233 // ] 9234 // } 9235 9236} 9237 9238// method id "dataproc.projects.regions.clusters.getIamPolicy": 9239 9240type ProjectsRegionsClustersGetIamPolicyCall struct { 9241 s *Service 9242 resource string 9243 urlParams_ gensupport.URLParams 9244 ifNoneMatch_ string 9245 ctx_ context.Context 9246 header_ http.Header 9247} 9248 9249// GetIamPolicy: Gets the access control policy for a resource. Returns 9250// an empty policy if the resource exists and does not have a policy 9251// set. 9252// 9253// - resource: REQUIRED: The resource for which the policy is being 9254// requested. See the operation documentation for the appropriate 9255// value for this field. 9256func (r *ProjectsRegionsClustersService) GetIamPolicy(resource string) *ProjectsRegionsClustersGetIamPolicyCall { 9257 c := &ProjectsRegionsClustersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9258 c.resource = resource 9259 return c 9260} 9261 9262// OptionsRequestedPolicyVersion sets the optional parameter 9263// "options.requestedPolicyVersion": The policy format version to be 9264// returned.Valid values are 0, 1, and 3. Requests specifying an invalid 9265// value will be rejected.Requests for policies with any conditional 9266// bindings must specify version 3. Policies without any conditional 9267// bindings may specify any valid value or leave the field unset.To 9268// learn which resources support conditions in their IAM policies, see 9269// the IAM documentation 9270// (https://cloud.google.com/iam/help/conditions/resource-policies). 9271func (c *ProjectsRegionsClustersGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsRegionsClustersGetIamPolicyCall { 9272 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 9273 return c 9274} 9275 9276// Fields allows partial responses to be retrieved. See 9277// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9278// for more information. 9279func (c *ProjectsRegionsClustersGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersGetIamPolicyCall { 9280 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9281 return c 9282} 9283 9284// IfNoneMatch sets the optional parameter which makes the operation 9285// fail if the object's ETag matches the given value. This is useful for 9286// getting updates only after the object has changed since the last 9287// request. Use googleapi.IsNotModified to check whether the response 9288// error from Do is the result of In-None-Match. 9289func (c *ProjectsRegionsClustersGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersGetIamPolicyCall { 9290 c.ifNoneMatch_ = entityTag 9291 return c 9292} 9293 9294// Context sets the context to be used in this call's Do method. Any 9295// pending HTTP request will be aborted if the provided context is 9296// canceled. 9297func (c *ProjectsRegionsClustersGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsClustersGetIamPolicyCall { 9298 c.ctx_ = ctx 9299 return c 9300} 9301 9302// Header returns an http.Header that can be modified by the caller to 9303// add HTTP headers to the request. 9304func (c *ProjectsRegionsClustersGetIamPolicyCall) Header() http.Header { 9305 if c.header_ == nil { 9306 c.header_ = make(http.Header) 9307 } 9308 return c.header_ 9309} 9310 9311func (c *ProjectsRegionsClustersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 9312 reqHeaders := make(http.Header) 9313 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 9314 for k, v := range c.header_ { 9315 reqHeaders[k] = v 9316 } 9317 reqHeaders.Set("User-Agent", c.s.userAgent()) 9318 if c.ifNoneMatch_ != "" { 9319 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9320 } 9321 var body io.Reader = nil 9322 c.urlParams_.Set("alt", alt) 9323 c.urlParams_.Set("prettyPrint", "false") 9324 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 9325 urls += "?" + c.urlParams_.Encode() 9326 req, err := http.NewRequest("GET", urls, body) 9327 if err != nil { 9328 return nil, err 9329 } 9330 req.Header = reqHeaders 9331 googleapi.Expand(req.URL, map[string]string{ 9332 "resource": c.resource, 9333 }) 9334 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9335} 9336 9337// Do executes the "dataproc.projects.regions.clusters.getIamPolicy" call. 9338// Exactly one of *Policy or error will be non-nil. Any non-2xx status 9339// code is an error. Response headers are in either 9340// *Policy.ServerResponse.Header or (if a response was returned at all) 9341// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9342// check whether the returned error was because http.StatusNotModified 9343// was returned. 9344func (c *ProjectsRegionsClustersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 9345 gensupport.SetOptions(c.urlParams_, opts...) 9346 res, err := c.doRequest("json") 9347 if res != nil && res.StatusCode == http.StatusNotModified { 9348 if res.Body != nil { 9349 res.Body.Close() 9350 } 9351 return nil, &googleapi.Error{ 9352 Code: res.StatusCode, 9353 Header: res.Header, 9354 } 9355 } 9356 if err != nil { 9357 return nil, err 9358 } 9359 defer googleapi.CloseBody(res) 9360 if err := googleapi.CheckResponse(res); err != nil { 9361 return nil, err 9362 } 9363 ret := &Policy{ 9364 ServerResponse: googleapi.ServerResponse{ 9365 Header: res.Header, 9366 HTTPStatusCode: res.StatusCode, 9367 }, 9368 } 9369 target := &ret 9370 if err := gensupport.DecodeResponse(target, res); err != nil { 9371 return nil, err 9372 } 9373 return ret, nil 9374 // { 9375 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 9376 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:getIamPolicy", 9377 // "httpMethod": "GET", 9378 // "id": "dataproc.projects.regions.clusters.getIamPolicy", 9379 // "parameterOrder": [ 9380 // "resource" 9381 // ], 9382 // "parameters": { 9383 // "options.requestedPolicyVersion": { 9384 // "description": "Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset.To learn which resources support conditions in their IAM policies, see the IAM documentation (https://cloud.google.com/iam/help/conditions/resource-policies).", 9385 // "format": "int32", 9386 // "location": "query", 9387 // "type": "integer" 9388 // }, 9389 // "resource": { 9390 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 9391 // "location": "path", 9392 // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$", 9393 // "required": true, 9394 // "type": "string" 9395 // } 9396 // }, 9397 // "path": "v1beta2/{+resource}:getIamPolicy", 9398 // "response": { 9399 // "$ref": "Policy" 9400 // }, 9401 // "scopes": [ 9402 // "https://www.googleapis.com/auth/cloud-platform" 9403 // ] 9404 // } 9405 9406} 9407 9408// method id "dataproc.projects.regions.clusters.injectCredentials": 9409 9410type ProjectsRegionsClustersInjectCredentialsCall struct { 9411 s *Service 9412 project string 9413 region string 9414 cluster string 9415 injectcredentialsrequest *InjectCredentialsRequest 9416 urlParams_ gensupport.URLParams 9417 ctx_ context.Context 9418 header_ http.Header 9419} 9420 9421// InjectCredentials: Inject encrypted credentials into all of the VMs 9422// in a cluster.The target cluster must be a personal auth cluster 9423// assigned to the user who is issuing the RPC. 9424// 9425// - cluster: The cluster, in the form clusters/. 9426// - project: The ID of the Google Cloud Platform project the cluster 9427// belongs to, of the form projects/. 9428// - region: The region containing the cluster, of the form regions/. 9429func (r *ProjectsRegionsClustersService) InjectCredentials(project string, region string, cluster string, injectcredentialsrequest *InjectCredentialsRequest) *ProjectsRegionsClustersInjectCredentialsCall { 9430 c := &ProjectsRegionsClustersInjectCredentialsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9431 c.project = project 9432 c.region = region 9433 c.cluster = cluster 9434 c.injectcredentialsrequest = injectcredentialsrequest 9435 return c 9436} 9437 9438// Fields allows partial responses to be retrieved. See 9439// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9440// for more information. 9441func (c *ProjectsRegionsClustersInjectCredentialsCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersInjectCredentialsCall { 9442 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9443 return c 9444} 9445 9446// Context sets the context to be used in this call's Do method. Any 9447// pending HTTP request will be aborted if the provided context is 9448// canceled. 9449func (c *ProjectsRegionsClustersInjectCredentialsCall) Context(ctx context.Context) *ProjectsRegionsClustersInjectCredentialsCall { 9450 c.ctx_ = ctx 9451 return c 9452} 9453 9454// Header returns an http.Header that can be modified by the caller to 9455// add HTTP headers to the request. 9456func (c *ProjectsRegionsClustersInjectCredentialsCall) Header() http.Header { 9457 if c.header_ == nil { 9458 c.header_ = make(http.Header) 9459 } 9460 return c.header_ 9461} 9462 9463func (c *ProjectsRegionsClustersInjectCredentialsCall) doRequest(alt string) (*http.Response, error) { 9464 reqHeaders := make(http.Header) 9465 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 9466 for k, v := range c.header_ { 9467 reqHeaders[k] = v 9468 } 9469 reqHeaders.Set("User-Agent", c.s.userAgent()) 9470 var body io.Reader = nil 9471 body, err := googleapi.WithoutDataWrapper.JSONReader(c.injectcredentialsrequest) 9472 if err != nil { 9473 return nil, err 9474 } 9475 reqHeaders.Set("Content-Type", "application/json") 9476 c.urlParams_.Set("alt", alt) 9477 c.urlParams_.Set("prettyPrint", "false") 9478 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+project}/{+region}/{+cluster}:injectCredentials") 9479 urls += "?" + c.urlParams_.Encode() 9480 req, err := http.NewRequest("POST", urls, body) 9481 if err != nil { 9482 return nil, err 9483 } 9484 req.Header = reqHeaders 9485 googleapi.Expand(req.URL, map[string]string{ 9486 "project": c.project, 9487 "region": c.region, 9488 "cluster": c.cluster, 9489 }) 9490 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9491} 9492 9493// Do executes the "dataproc.projects.regions.clusters.injectCredentials" call. 9494// Exactly one of *Operation or error will be non-nil. Any non-2xx 9495// status code is an error. Response headers are in either 9496// *Operation.ServerResponse.Header or (if a response was returned at 9497// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9498// to check whether the returned error was because 9499// http.StatusNotModified was returned. 9500func (c *ProjectsRegionsClustersInjectCredentialsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9501 gensupport.SetOptions(c.urlParams_, opts...) 9502 res, err := c.doRequest("json") 9503 if res != nil && res.StatusCode == http.StatusNotModified { 9504 if res.Body != nil { 9505 res.Body.Close() 9506 } 9507 return nil, &googleapi.Error{ 9508 Code: res.StatusCode, 9509 Header: res.Header, 9510 } 9511 } 9512 if err != nil { 9513 return nil, err 9514 } 9515 defer googleapi.CloseBody(res) 9516 if err := googleapi.CheckResponse(res); err != nil { 9517 return nil, err 9518 } 9519 ret := &Operation{ 9520 ServerResponse: googleapi.ServerResponse{ 9521 Header: res.Header, 9522 HTTPStatusCode: res.StatusCode, 9523 }, 9524 } 9525 target := &ret 9526 if err := gensupport.DecodeResponse(target, res); err != nil { 9527 return nil, err 9528 } 9529 return ret, nil 9530 // { 9531 // "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.", 9532 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:injectCredentials", 9533 // "httpMethod": "POST", 9534 // "id": "dataproc.projects.regions.clusters.injectCredentials", 9535 // "parameterOrder": [ 9536 // "project", 9537 // "region", 9538 // "cluster" 9539 // ], 9540 // "parameters": { 9541 // "cluster": { 9542 // "description": "Required. The cluster, in the form clusters/.", 9543 // "location": "path", 9544 // "pattern": "^clusters/[^/]+$", 9545 // "required": true, 9546 // "type": "string" 9547 // }, 9548 // "project": { 9549 // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to, of the form projects/.", 9550 // "location": "path", 9551 // "pattern": "^projects/[^/]+$", 9552 // "required": true, 9553 // "type": "string" 9554 // }, 9555 // "region": { 9556 // "description": "Required. The region containing the cluster, of the form regions/.", 9557 // "location": "path", 9558 // "pattern": "^regions/[^/]+$", 9559 // "required": true, 9560 // "type": "string" 9561 // } 9562 // }, 9563 // "path": "v1beta2/{+project}/{+region}/{+cluster}:injectCredentials", 9564 // "request": { 9565 // "$ref": "InjectCredentialsRequest" 9566 // }, 9567 // "response": { 9568 // "$ref": "Operation" 9569 // }, 9570 // "scopes": [ 9571 // "https://www.googleapis.com/auth/cloud-platform" 9572 // ] 9573 // } 9574 9575} 9576 9577// method id "dataproc.projects.regions.clusters.list": 9578 9579type ProjectsRegionsClustersListCall struct { 9580 s *Service 9581 projectId string 9582 region string 9583 urlParams_ gensupport.URLParams 9584 ifNoneMatch_ string 9585 ctx_ context.Context 9586 header_ http.Header 9587} 9588 9589// List: Lists all regions/{region}/clusters in a project 9590// alphabetically. 9591// 9592// - projectId: The ID of the Google Cloud Platform project that the 9593// cluster belongs to. 9594// - region: The Dataproc region in which to handle the request. 9595func (r *ProjectsRegionsClustersService) List(projectId string, region string) *ProjectsRegionsClustersListCall { 9596 c := &ProjectsRegionsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9597 c.projectId = projectId 9598 c.region = region 9599 return c 9600} 9601 9602// Filter sets the optional parameter "filter": A filter constraining 9603// the clusters to list. Filters are case-sensitive and have the 9604// following syntax:field = value AND field = value ...where field is 9605// one of status.state, clusterName, or labels.[KEY], and [KEY] is a 9606// label key. value can be * to match all values. status.state can be 9607// one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, 9608// DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and 9609// RUNNING states. INACTIVE contains the DELETING and ERROR states. 9610// clusterName is the name of the cluster provided at creation time. 9611// Only the logical AND operator is supported; space-separated items are 9612// treated as having an implicit AND operator.Example 9613// filter:status.state = ACTIVE AND clusterName = mycluster AND 9614// labels.env = staging AND labels.starred = * 9615func (c *ProjectsRegionsClustersListCall) Filter(filter string) *ProjectsRegionsClustersListCall { 9616 c.urlParams_.Set("filter", filter) 9617 return c 9618} 9619 9620// PageSize sets the optional parameter "pageSize": The standard List 9621// page size. 9622func (c *ProjectsRegionsClustersListCall) PageSize(pageSize int64) *ProjectsRegionsClustersListCall { 9623 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9624 return c 9625} 9626 9627// PageToken sets the optional parameter "pageToken": The standard List 9628// page token. 9629func (c *ProjectsRegionsClustersListCall) PageToken(pageToken string) *ProjectsRegionsClustersListCall { 9630 c.urlParams_.Set("pageToken", pageToken) 9631 return c 9632} 9633 9634// Fields allows partial responses to be retrieved. See 9635// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9636// for more information. 9637func (c *ProjectsRegionsClustersListCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersListCall { 9638 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9639 return c 9640} 9641 9642// IfNoneMatch sets the optional parameter which makes the operation 9643// fail if the object's ETag matches the given value. This is useful for 9644// getting updates only after the object has changed since the last 9645// request. Use googleapi.IsNotModified to check whether the response 9646// error from Do is the result of In-None-Match. 9647func (c *ProjectsRegionsClustersListCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersListCall { 9648 c.ifNoneMatch_ = entityTag 9649 return c 9650} 9651 9652// Context sets the context to be used in this call's Do method. Any 9653// pending HTTP request will be aborted if the provided context is 9654// canceled. 9655func (c *ProjectsRegionsClustersListCall) Context(ctx context.Context) *ProjectsRegionsClustersListCall { 9656 c.ctx_ = ctx 9657 return c 9658} 9659 9660// Header returns an http.Header that can be modified by the caller to 9661// add HTTP headers to the request. 9662func (c *ProjectsRegionsClustersListCall) Header() http.Header { 9663 if c.header_ == nil { 9664 c.header_ = make(http.Header) 9665 } 9666 return c.header_ 9667} 9668 9669func (c *ProjectsRegionsClustersListCall) doRequest(alt string) (*http.Response, error) { 9670 reqHeaders := make(http.Header) 9671 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 9672 for k, v := range c.header_ { 9673 reqHeaders[k] = v 9674 } 9675 reqHeaders.Set("User-Agent", c.s.userAgent()) 9676 if c.ifNoneMatch_ != "" { 9677 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9678 } 9679 var body io.Reader = nil 9680 c.urlParams_.Set("alt", alt) 9681 c.urlParams_.Set("prettyPrint", "false") 9682 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters") 9683 urls += "?" + c.urlParams_.Encode() 9684 req, err := http.NewRequest("GET", urls, body) 9685 if err != nil { 9686 return nil, err 9687 } 9688 req.Header = reqHeaders 9689 googleapi.Expand(req.URL, map[string]string{ 9690 "projectId": c.projectId, 9691 "region": c.region, 9692 }) 9693 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9694} 9695 9696// Do executes the "dataproc.projects.regions.clusters.list" call. 9697// Exactly one of *ListClustersResponse or error will be non-nil. Any 9698// non-2xx status code is an error. Response headers are in either 9699// *ListClustersResponse.ServerResponse.Header or (if a response was 9700// returned at all) in error.(*googleapi.Error).Header. Use 9701// googleapi.IsNotModified to check whether the returned error was 9702// because http.StatusNotModified was returned. 9703func (c *ProjectsRegionsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) { 9704 gensupport.SetOptions(c.urlParams_, opts...) 9705 res, err := c.doRequest("json") 9706 if res != nil && res.StatusCode == http.StatusNotModified { 9707 if res.Body != nil { 9708 res.Body.Close() 9709 } 9710 return nil, &googleapi.Error{ 9711 Code: res.StatusCode, 9712 Header: res.Header, 9713 } 9714 } 9715 if err != nil { 9716 return nil, err 9717 } 9718 defer googleapi.CloseBody(res) 9719 if err := googleapi.CheckResponse(res); err != nil { 9720 return nil, err 9721 } 9722 ret := &ListClustersResponse{ 9723 ServerResponse: googleapi.ServerResponse{ 9724 Header: res.Header, 9725 HTTPStatusCode: res.StatusCode, 9726 }, 9727 } 9728 target := &ret 9729 if err := gensupport.DecodeResponse(target, res); err != nil { 9730 return nil, err 9731 } 9732 return ret, nil 9733 // { 9734 // "description": "Lists all regions/{region}/clusters in a project alphabetically.", 9735 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters", 9736 // "httpMethod": "GET", 9737 // "id": "dataproc.projects.regions.clusters.list", 9738 // "parameterOrder": [ 9739 // "projectId", 9740 // "region" 9741 // ], 9742 // "parameters": { 9743 // "filter": { 9744 // "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 = *", 9745 // "location": "query", 9746 // "type": "string" 9747 // }, 9748 // "pageSize": { 9749 // "description": "Optional. The standard List page size.", 9750 // "format": "int32", 9751 // "location": "query", 9752 // "type": "integer" 9753 // }, 9754 // "pageToken": { 9755 // "description": "Optional. The standard List page token.", 9756 // "location": "query", 9757 // "type": "string" 9758 // }, 9759 // "projectId": { 9760 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 9761 // "location": "path", 9762 // "required": true, 9763 // "type": "string" 9764 // }, 9765 // "region": { 9766 // "description": "Required. The Dataproc region in which to handle the request.", 9767 // "location": "path", 9768 // "required": true, 9769 // "type": "string" 9770 // } 9771 // }, 9772 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters", 9773 // "response": { 9774 // "$ref": "ListClustersResponse" 9775 // }, 9776 // "scopes": [ 9777 // "https://www.googleapis.com/auth/cloud-platform" 9778 // ] 9779 // } 9780 9781} 9782 9783// Pages invokes f for each page of results. 9784// A non-nil error returned from f will halt the iteration. 9785// The provided context supersedes any context provided to the Context method. 9786func (c *ProjectsRegionsClustersListCall) Pages(ctx context.Context, f func(*ListClustersResponse) error) error { 9787 c.ctx_ = ctx 9788 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9789 for { 9790 x, err := c.Do() 9791 if err != nil { 9792 return err 9793 } 9794 if err := f(x); err != nil { 9795 return err 9796 } 9797 if x.NextPageToken == "" { 9798 return nil 9799 } 9800 c.PageToken(x.NextPageToken) 9801 } 9802} 9803 9804// method id "dataproc.projects.regions.clusters.patch": 9805 9806type ProjectsRegionsClustersPatchCall struct { 9807 s *Service 9808 projectId string 9809 region string 9810 clusterName string 9811 cluster *Cluster 9812 urlParams_ gensupport.URLParams 9813 ctx_ context.Context 9814 header_ http.Header 9815} 9816 9817// Patch: Updates a cluster in a project. The returned 9818// Operation.metadata will be ClusterOperationMetadata 9819// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). 9820// 9821// - clusterName: The cluster name. 9822// - projectId: The ID of the Google Cloud Platform project the cluster 9823// belongs to. 9824// - region: The Dataproc region in which to handle the request. 9825func (r *ProjectsRegionsClustersService) Patch(projectId string, region string, clusterName string, cluster *Cluster) *ProjectsRegionsClustersPatchCall { 9826 c := &ProjectsRegionsClustersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9827 c.projectId = projectId 9828 c.region = region 9829 c.clusterName = clusterName 9830 c.cluster = cluster 9831 return c 9832} 9833 9834// GracefulDecommissionTimeout sets the optional parameter 9835// "gracefulDecommissionTimeout": Timeout for graceful YARN 9836// decomissioning. Graceful decommissioning allows removing nodes from 9837// the cluster without interrupting jobs in progress. Timeout specifies 9838// how long to wait for jobs in progress to finish before forcefully 9839// removing nodes (and potentially interrupting jobs). Default timeout 9840// is 0 (for forceful decommission), and the maximum allowed timeout is 9841// 1 day (see JSON representation of Duration 9842// (https://developers.google.com/protocol-buffers/docs/proto3#json)).Only 9843// supported on Dataproc image versions 1.2 and higher. 9844func (c *ProjectsRegionsClustersPatchCall) GracefulDecommissionTimeout(gracefulDecommissionTimeout string) *ProjectsRegionsClustersPatchCall { 9845 c.urlParams_.Set("gracefulDecommissionTimeout", gracefulDecommissionTimeout) 9846 return c 9847} 9848 9849// RequestId sets the optional parameter "requestId": A unique id used 9850// to identify the request. If the server receives two 9851// UpdateClusterRequest 9852// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#google.cloud.dataproc.v1beta2.UpdateClusterRequest)s 9853// with the same id, then the second request will be ignored and the 9854// first google.longrunning.Operation created and stored in the backend 9855// is returned.It is recommended to always set this value to a UUID 9856// (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id 9857// must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 9858// and hyphens (-). The maximum length is 40 characters. 9859func (c *ProjectsRegionsClustersPatchCall) RequestId(requestId string) *ProjectsRegionsClustersPatchCall { 9860 c.urlParams_.Set("requestId", requestId) 9861 return c 9862} 9863 9864// UpdateMask sets the optional parameter "updateMask": Required. 9865// Specifies the path, relative to Cluster, of the field to update. For 9866// example, to change the number of workers in a cluster to 5, the 9867// update_mask parameter would be specified as 9868// config.worker_config.num_instances, and the PATCH request body would 9869// specify the new value, as follows: { "config":{ "workerConfig":{ 9870// "numInstances":"5" } } } Similarly, to change the number of 9871// preemptible workers in a cluster to 5, the update_mask parameter 9872// would be config.secondary_worker_config.num_instances, and the PATCH 9873// request body would be set as follows: { "config":{ 9874// "secondaryWorkerConfig":{ "numInstances":"5" } } } *Note:* currently 9875// only the following fields can be updated: *Mask* *Purpose* labels 9876// Updates labels config.worker_config.num_instances Resize primary 9877// worker group config.secondary_worker_config.num_instances Resize 9878// secondary worker group config.lifecycle_config.auto_delete_ttl Reset 9879// MAX TTL duration config.lifecycle_config.auto_delete_time Update MAX 9880// TTL deletion timestamp config.lifecycle_config.idle_delete_ttl Update 9881// Idle TTL duration config.autoscaling_config.policy_uri Use, stop 9882// using, or change autoscaling policies 9883func (c *ProjectsRegionsClustersPatchCall) UpdateMask(updateMask string) *ProjectsRegionsClustersPatchCall { 9884 c.urlParams_.Set("updateMask", updateMask) 9885 return c 9886} 9887 9888// Fields allows partial responses to be retrieved. See 9889// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9890// for more information. 9891func (c *ProjectsRegionsClustersPatchCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersPatchCall { 9892 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9893 return c 9894} 9895 9896// Context sets the context to be used in this call's Do method. Any 9897// pending HTTP request will be aborted if the provided context is 9898// canceled. 9899func (c *ProjectsRegionsClustersPatchCall) Context(ctx context.Context) *ProjectsRegionsClustersPatchCall { 9900 c.ctx_ = ctx 9901 return c 9902} 9903 9904// Header returns an http.Header that can be modified by the caller to 9905// add HTTP headers to the request. 9906func (c *ProjectsRegionsClustersPatchCall) Header() http.Header { 9907 if c.header_ == nil { 9908 c.header_ = make(http.Header) 9909 } 9910 return c.header_ 9911} 9912 9913func (c *ProjectsRegionsClustersPatchCall) doRequest(alt string) (*http.Response, error) { 9914 reqHeaders := make(http.Header) 9915 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 9916 for k, v := range c.header_ { 9917 reqHeaders[k] = v 9918 } 9919 reqHeaders.Set("User-Agent", c.s.userAgent()) 9920 var body io.Reader = nil 9921 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) 9922 if err != nil { 9923 return nil, err 9924 } 9925 reqHeaders.Set("Content-Type", "application/json") 9926 c.urlParams_.Set("alt", alt) 9927 c.urlParams_.Set("prettyPrint", "false") 9928 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}") 9929 urls += "?" + c.urlParams_.Encode() 9930 req, err := http.NewRequest("PATCH", urls, body) 9931 if err != nil { 9932 return nil, err 9933 } 9934 req.Header = reqHeaders 9935 googleapi.Expand(req.URL, map[string]string{ 9936 "projectId": c.projectId, 9937 "region": c.region, 9938 "clusterName": c.clusterName, 9939 }) 9940 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9941} 9942 9943// Do executes the "dataproc.projects.regions.clusters.patch" call. 9944// Exactly one of *Operation or error will be non-nil. Any non-2xx 9945// status code is an error. Response headers are in either 9946// *Operation.ServerResponse.Header or (if a response was returned at 9947// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9948// to check whether the returned error was because 9949// http.StatusNotModified was returned. 9950func (c *ProjectsRegionsClustersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9951 gensupport.SetOptions(c.urlParams_, opts...) 9952 res, err := c.doRequest("json") 9953 if res != nil && res.StatusCode == http.StatusNotModified { 9954 if res.Body != nil { 9955 res.Body.Close() 9956 } 9957 return nil, &googleapi.Error{ 9958 Code: res.StatusCode, 9959 Header: res.Header, 9960 } 9961 } 9962 if err != nil { 9963 return nil, err 9964 } 9965 defer googleapi.CloseBody(res) 9966 if err := googleapi.CheckResponse(res); err != nil { 9967 return nil, err 9968 } 9969 ret := &Operation{ 9970 ServerResponse: googleapi.ServerResponse{ 9971 Header: res.Header, 9972 HTTPStatusCode: res.StatusCode, 9973 }, 9974 } 9975 target := &ret 9976 if err := gensupport.DecodeResponse(target, res); err != nil { 9977 return nil, err 9978 } 9979 return ret, nil 9980 // { 9981 // "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.v1beta2#clusteroperationmetadata).", 9982 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", 9983 // "httpMethod": "PATCH", 9984 // "id": "dataproc.projects.regions.clusters.patch", 9985 // "parameterOrder": [ 9986 // "projectId", 9987 // "region", 9988 // "clusterName" 9989 // ], 9990 // "parameters": { 9991 // "clusterName": { 9992 // "description": "Required. The cluster name.", 9993 // "location": "path", 9994 // "required": true, 9995 // "type": "string" 9996 // }, 9997 // "gracefulDecommissionTimeout": { 9998 // "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.", 9999 // "format": "google-duration", 10000 // "location": "query", 10001 // "type": "string" 10002 // }, 10003 // "projectId": { 10004 // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", 10005 // "location": "path", 10006 // "required": true, 10007 // "type": "string" 10008 // }, 10009 // "region": { 10010 // "description": "Required. The Dataproc region in which to handle the request.", 10011 // "location": "path", 10012 // "required": true, 10013 // "type": "string" 10014 // }, 10015 // "requestId": { 10016 // "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.v1beta2#google.cloud.dataproc.v1beta2.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.", 10017 // "location": "query", 10018 // "type": "string" 10019 // }, 10020 // "updateMask": { 10021 // "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 Updates labels config.worker_config.num_instances Resize primary worker group config.secondary_worker_config.num_instances Resize secondary worker group config.lifecycle_config.auto_delete_ttl Reset MAX TTL duration config.lifecycle_config.auto_delete_time Update MAX TTL deletion timestamp config.lifecycle_config.idle_delete_ttl Update Idle TTL duration config.autoscaling_config.policy_uri Use, stop using, or change autoscaling policies ", 10022 // "format": "google-fieldmask", 10023 // "location": "query", 10024 // "type": "string" 10025 // } 10026 // }, 10027 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", 10028 // "request": { 10029 // "$ref": "Cluster" 10030 // }, 10031 // "response": { 10032 // "$ref": "Operation" 10033 // }, 10034 // "scopes": [ 10035 // "https://www.googleapis.com/auth/cloud-platform" 10036 // ] 10037 // } 10038 10039} 10040 10041// method id "dataproc.projects.regions.clusters.setIamPolicy": 10042 10043type ProjectsRegionsClustersSetIamPolicyCall struct { 10044 s *Service 10045 resource string 10046 setiampolicyrequest *SetIamPolicyRequest 10047 urlParams_ gensupport.URLParams 10048 ctx_ context.Context 10049 header_ http.Header 10050} 10051 10052// SetIamPolicy: Sets the access control policy on the specified 10053// resource. Replaces any existing policy.Can return NOT_FOUND, 10054// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 10055// 10056// - resource: REQUIRED: The resource for which the policy is being 10057// specified. See the operation documentation for the appropriate 10058// value for this field. 10059func (r *ProjectsRegionsClustersService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsClustersSetIamPolicyCall { 10060 c := &ProjectsRegionsClustersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10061 c.resource = resource 10062 c.setiampolicyrequest = setiampolicyrequest 10063 return c 10064} 10065 10066// Fields allows partial responses to be retrieved. See 10067// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10068// for more information. 10069func (c *ProjectsRegionsClustersSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersSetIamPolicyCall { 10070 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10071 return c 10072} 10073 10074// Context sets the context to be used in this call's Do method. Any 10075// pending HTTP request will be aborted if the provided context is 10076// canceled. 10077func (c *ProjectsRegionsClustersSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsClustersSetIamPolicyCall { 10078 c.ctx_ = ctx 10079 return c 10080} 10081 10082// Header returns an http.Header that can be modified by the caller to 10083// add HTTP headers to the request. 10084func (c *ProjectsRegionsClustersSetIamPolicyCall) Header() http.Header { 10085 if c.header_ == nil { 10086 c.header_ = make(http.Header) 10087 } 10088 return c.header_ 10089} 10090 10091func (c *ProjectsRegionsClustersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 10092 reqHeaders := make(http.Header) 10093 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 10094 for k, v := range c.header_ { 10095 reqHeaders[k] = v 10096 } 10097 reqHeaders.Set("User-Agent", c.s.userAgent()) 10098 var body io.Reader = nil 10099 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 10100 if err != nil { 10101 return nil, err 10102 } 10103 reqHeaders.Set("Content-Type", "application/json") 10104 c.urlParams_.Set("alt", alt) 10105 c.urlParams_.Set("prettyPrint", "false") 10106 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 10107 urls += "?" + c.urlParams_.Encode() 10108 req, err := http.NewRequest("POST", urls, body) 10109 if err != nil { 10110 return nil, err 10111 } 10112 req.Header = reqHeaders 10113 googleapi.Expand(req.URL, map[string]string{ 10114 "resource": c.resource, 10115 }) 10116 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10117} 10118 10119// Do executes the "dataproc.projects.regions.clusters.setIamPolicy" call. 10120// Exactly one of *Policy or error will be non-nil. Any non-2xx status 10121// code is an error. Response headers are in either 10122// *Policy.ServerResponse.Header or (if a response was returned at all) 10123// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10124// check whether the returned error was because http.StatusNotModified 10125// was returned. 10126func (c *ProjectsRegionsClustersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 10127 gensupport.SetOptions(c.urlParams_, opts...) 10128 res, err := c.doRequest("json") 10129 if res != nil && res.StatusCode == http.StatusNotModified { 10130 if res.Body != nil { 10131 res.Body.Close() 10132 } 10133 return nil, &googleapi.Error{ 10134 Code: res.StatusCode, 10135 Header: res.Header, 10136 } 10137 } 10138 if err != nil { 10139 return nil, err 10140 } 10141 defer googleapi.CloseBody(res) 10142 if err := googleapi.CheckResponse(res); err != nil { 10143 return nil, err 10144 } 10145 ret := &Policy{ 10146 ServerResponse: googleapi.ServerResponse{ 10147 Header: res.Header, 10148 HTTPStatusCode: res.StatusCode, 10149 }, 10150 } 10151 target := &ret 10152 if err := gensupport.DecodeResponse(target, res); err != nil { 10153 return nil, err 10154 } 10155 return ret, nil 10156 // { 10157 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 10158 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:setIamPolicy", 10159 // "httpMethod": "POST", 10160 // "id": "dataproc.projects.regions.clusters.setIamPolicy", 10161 // "parameterOrder": [ 10162 // "resource" 10163 // ], 10164 // "parameters": { 10165 // "resource": { 10166 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 10167 // "location": "path", 10168 // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$", 10169 // "required": true, 10170 // "type": "string" 10171 // } 10172 // }, 10173 // "path": "v1beta2/{+resource}:setIamPolicy", 10174 // "request": { 10175 // "$ref": "SetIamPolicyRequest" 10176 // }, 10177 // "response": { 10178 // "$ref": "Policy" 10179 // }, 10180 // "scopes": [ 10181 // "https://www.googleapis.com/auth/cloud-platform" 10182 // ] 10183 // } 10184 10185} 10186 10187// method id "dataproc.projects.regions.clusters.start": 10188 10189type ProjectsRegionsClustersStartCall struct { 10190 s *Service 10191 projectId string 10192 region string 10193 clusterName string 10194 startclusterrequest *StartClusterRequest 10195 urlParams_ gensupport.URLParams 10196 ctx_ context.Context 10197 header_ http.Header 10198} 10199 10200// Start: Starts a cluster in a project. 10201// 10202// - clusterName: The cluster name. 10203// - projectId: The ID of the Google Cloud Platform project the cluster 10204// belongs to. 10205// - region: The Dataproc region in which to handle the request. 10206func (r *ProjectsRegionsClustersService) Start(projectId string, region string, clusterName string, startclusterrequest *StartClusterRequest) *ProjectsRegionsClustersStartCall { 10207 c := &ProjectsRegionsClustersStartCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10208 c.projectId = projectId 10209 c.region = region 10210 c.clusterName = clusterName 10211 c.startclusterrequest = startclusterrequest 10212 return c 10213} 10214 10215// Fields allows partial responses to be retrieved. See 10216// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10217// for more information. 10218func (c *ProjectsRegionsClustersStartCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersStartCall { 10219 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10220 return c 10221} 10222 10223// Context sets the context to be used in this call's Do method. Any 10224// pending HTTP request will be aborted if the provided context is 10225// canceled. 10226func (c *ProjectsRegionsClustersStartCall) Context(ctx context.Context) *ProjectsRegionsClustersStartCall { 10227 c.ctx_ = ctx 10228 return c 10229} 10230 10231// Header returns an http.Header that can be modified by the caller to 10232// add HTTP headers to the request. 10233func (c *ProjectsRegionsClustersStartCall) Header() http.Header { 10234 if c.header_ == nil { 10235 c.header_ = make(http.Header) 10236 } 10237 return c.header_ 10238} 10239 10240func (c *ProjectsRegionsClustersStartCall) doRequest(alt string) (*http.Response, error) { 10241 reqHeaders := make(http.Header) 10242 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 10243 for k, v := range c.header_ { 10244 reqHeaders[k] = v 10245 } 10246 reqHeaders.Set("User-Agent", c.s.userAgent()) 10247 var body io.Reader = nil 10248 body, err := googleapi.WithoutDataWrapper.JSONReader(c.startclusterrequest) 10249 if err != nil { 10250 return nil, err 10251 } 10252 reqHeaders.Set("Content-Type", "application/json") 10253 c.urlParams_.Set("alt", alt) 10254 c.urlParams_.Set("prettyPrint", "false") 10255 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:start") 10256 urls += "?" + c.urlParams_.Encode() 10257 req, err := http.NewRequest("POST", urls, body) 10258 if err != nil { 10259 return nil, err 10260 } 10261 req.Header = reqHeaders 10262 googleapi.Expand(req.URL, map[string]string{ 10263 "projectId": c.projectId, 10264 "region": c.region, 10265 "clusterName": c.clusterName, 10266 }) 10267 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10268} 10269 10270// Do executes the "dataproc.projects.regions.clusters.start" call. 10271// Exactly one of *Operation or error will be non-nil. Any non-2xx 10272// status code is an error. Response headers are in either 10273// *Operation.ServerResponse.Header or (if a response was returned at 10274// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10275// to check whether the returned error was because 10276// http.StatusNotModified was returned. 10277func (c *ProjectsRegionsClustersStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10278 gensupport.SetOptions(c.urlParams_, opts...) 10279 res, err := c.doRequest("json") 10280 if res != nil && res.StatusCode == http.StatusNotModified { 10281 if res.Body != nil { 10282 res.Body.Close() 10283 } 10284 return nil, &googleapi.Error{ 10285 Code: res.StatusCode, 10286 Header: res.Header, 10287 } 10288 } 10289 if err != nil { 10290 return nil, err 10291 } 10292 defer googleapi.CloseBody(res) 10293 if err := googleapi.CheckResponse(res); err != nil { 10294 return nil, err 10295 } 10296 ret := &Operation{ 10297 ServerResponse: googleapi.ServerResponse{ 10298 Header: res.Header, 10299 HTTPStatusCode: res.StatusCode, 10300 }, 10301 } 10302 target := &ret 10303 if err := gensupport.DecodeResponse(target, res); err != nil { 10304 return nil, err 10305 } 10306 return ret, nil 10307 // { 10308 // "description": "Starts a cluster in a project.", 10309 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:start", 10310 // "httpMethod": "POST", 10311 // "id": "dataproc.projects.regions.clusters.start", 10312 // "parameterOrder": [ 10313 // "projectId", 10314 // "region", 10315 // "clusterName" 10316 // ], 10317 // "parameters": { 10318 // "clusterName": { 10319 // "description": "Required. The cluster name.", 10320 // "location": "path", 10321 // "required": true, 10322 // "type": "string" 10323 // }, 10324 // "projectId": { 10325 // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", 10326 // "location": "path", 10327 // "required": true, 10328 // "type": "string" 10329 // }, 10330 // "region": { 10331 // "description": "Required. The Dataproc region in which to handle the request.", 10332 // "location": "path", 10333 // "required": true, 10334 // "type": "string" 10335 // } 10336 // }, 10337 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:start", 10338 // "request": { 10339 // "$ref": "StartClusterRequest" 10340 // }, 10341 // "response": { 10342 // "$ref": "Operation" 10343 // }, 10344 // "scopes": [ 10345 // "https://www.googleapis.com/auth/cloud-platform" 10346 // ] 10347 // } 10348 10349} 10350 10351// method id "dataproc.projects.regions.clusters.stop": 10352 10353type ProjectsRegionsClustersStopCall struct { 10354 s *Service 10355 projectId string 10356 region string 10357 clusterName string 10358 stopclusterrequest *StopClusterRequest 10359 urlParams_ gensupport.URLParams 10360 ctx_ context.Context 10361 header_ http.Header 10362} 10363 10364// Stop: Stops a cluster in a project. 10365// 10366// - clusterName: The cluster name. 10367// - projectId: The ID of the Google Cloud Platform project the cluster 10368// belongs to. 10369// - region: The Dataproc region in which to handle the request. 10370func (r *ProjectsRegionsClustersService) Stop(projectId string, region string, clusterName string, stopclusterrequest *StopClusterRequest) *ProjectsRegionsClustersStopCall { 10371 c := &ProjectsRegionsClustersStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10372 c.projectId = projectId 10373 c.region = region 10374 c.clusterName = clusterName 10375 c.stopclusterrequest = stopclusterrequest 10376 return c 10377} 10378 10379// Fields allows partial responses to be retrieved. See 10380// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10381// for more information. 10382func (c *ProjectsRegionsClustersStopCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersStopCall { 10383 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10384 return c 10385} 10386 10387// Context sets the context to be used in this call's Do method. Any 10388// pending HTTP request will be aborted if the provided context is 10389// canceled. 10390func (c *ProjectsRegionsClustersStopCall) Context(ctx context.Context) *ProjectsRegionsClustersStopCall { 10391 c.ctx_ = ctx 10392 return c 10393} 10394 10395// Header returns an http.Header that can be modified by the caller to 10396// add HTTP headers to the request. 10397func (c *ProjectsRegionsClustersStopCall) Header() http.Header { 10398 if c.header_ == nil { 10399 c.header_ = make(http.Header) 10400 } 10401 return c.header_ 10402} 10403 10404func (c *ProjectsRegionsClustersStopCall) doRequest(alt string) (*http.Response, error) { 10405 reqHeaders := make(http.Header) 10406 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 10407 for k, v := range c.header_ { 10408 reqHeaders[k] = v 10409 } 10410 reqHeaders.Set("User-Agent", c.s.userAgent()) 10411 var body io.Reader = nil 10412 body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopclusterrequest) 10413 if err != nil { 10414 return nil, err 10415 } 10416 reqHeaders.Set("Content-Type", "application/json") 10417 c.urlParams_.Set("alt", alt) 10418 c.urlParams_.Set("prettyPrint", "false") 10419 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:stop") 10420 urls += "?" + c.urlParams_.Encode() 10421 req, err := http.NewRequest("POST", urls, body) 10422 if err != nil { 10423 return nil, err 10424 } 10425 req.Header = reqHeaders 10426 googleapi.Expand(req.URL, map[string]string{ 10427 "projectId": c.projectId, 10428 "region": c.region, 10429 "clusterName": c.clusterName, 10430 }) 10431 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10432} 10433 10434// Do executes the "dataproc.projects.regions.clusters.stop" call. 10435// Exactly one of *Operation or error will be non-nil. Any non-2xx 10436// status code is an error. Response headers are in either 10437// *Operation.ServerResponse.Header or (if a response was returned at 10438// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10439// to check whether the returned error was because 10440// http.StatusNotModified was returned. 10441func (c *ProjectsRegionsClustersStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10442 gensupport.SetOptions(c.urlParams_, opts...) 10443 res, err := c.doRequest("json") 10444 if res != nil && res.StatusCode == http.StatusNotModified { 10445 if res.Body != nil { 10446 res.Body.Close() 10447 } 10448 return nil, &googleapi.Error{ 10449 Code: res.StatusCode, 10450 Header: res.Header, 10451 } 10452 } 10453 if err != nil { 10454 return nil, err 10455 } 10456 defer googleapi.CloseBody(res) 10457 if err := googleapi.CheckResponse(res); err != nil { 10458 return nil, err 10459 } 10460 ret := &Operation{ 10461 ServerResponse: googleapi.ServerResponse{ 10462 Header: res.Header, 10463 HTTPStatusCode: res.StatusCode, 10464 }, 10465 } 10466 target := &ret 10467 if err := gensupport.DecodeResponse(target, res); err != nil { 10468 return nil, err 10469 } 10470 return ret, nil 10471 // { 10472 // "description": "Stops a cluster in a project.", 10473 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:stop", 10474 // "httpMethod": "POST", 10475 // "id": "dataproc.projects.regions.clusters.stop", 10476 // "parameterOrder": [ 10477 // "projectId", 10478 // "region", 10479 // "clusterName" 10480 // ], 10481 // "parameters": { 10482 // "clusterName": { 10483 // "description": "Required. The cluster name.", 10484 // "location": "path", 10485 // "required": true, 10486 // "type": "string" 10487 // }, 10488 // "projectId": { 10489 // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", 10490 // "location": "path", 10491 // "required": true, 10492 // "type": "string" 10493 // }, 10494 // "region": { 10495 // "description": "Required. The Dataproc region in which to handle the request.", 10496 // "location": "path", 10497 // "required": true, 10498 // "type": "string" 10499 // } 10500 // }, 10501 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:stop", 10502 // "request": { 10503 // "$ref": "StopClusterRequest" 10504 // }, 10505 // "response": { 10506 // "$ref": "Operation" 10507 // }, 10508 // "scopes": [ 10509 // "https://www.googleapis.com/auth/cloud-platform" 10510 // ] 10511 // } 10512 10513} 10514 10515// method id "dataproc.projects.regions.clusters.testIamPermissions": 10516 10517type ProjectsRegionsClustersTestIamPermissionsCall struct { 10518 s *Service 10519 resource string 10520 testiampermissionsrequest *TestIamPermissionsRequest 10521 urlParams_ gensupport.URLParams 10522 ctx_ context.Context 10523 header_ http.Header 10524} 10525 10526// TestIamPermissions: Returns permissions that a caller has on the 10527// specified resource. If the resource does not exist, this will return 10528// an empty set of permissions, not a NOT_FOUND error.Note: This 10529// operation is designed to be used for building permission-aware UIs 10530// and command-line tools, not for authorization checking. This 10531// operation may "fail open" without warning. 10532// 10533// - resource: REQUIRED: The resource for which the policy detail is 10534// being requested. See the operation documentation for the 10535// appropriate value for this field. 10536func (r *ProjectsRegionsClustersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsClustersTestIamPermissionsCall { 10537 c := &ProjectsRegionsClustersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10538 c.resource = resource 10539 c.testiampermissionsrequest = testiampermissionsrequest 10540 return c 10541} 10542 10543// Fields allows partial responses to be retrieved. See 10544// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10545// for more information. 10546func (c *ProjectsRegionsClustersTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersTestIamPermissionsCall { 10547 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10548 return c 10549} 10550 10551// Context sets the context to be used in this call's Do method. Any 10552// pending HTTP request will be aborted if the provided context is 10553// canceled. 10554func (c *ProjectsRegionsClustersTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsClustersTestIamPermissionsCall { 10555 c.ctx_ = ctx 10556 return c 10557} 10558 10559// Header returns an http.Header that can be modified by the caller to 10560// add HTTP headers to the request. 10561func (c *ProjectsRegionsClustersTestIamPermissionsCall) Header() http.Header { 10562 if c.header_ == nil { 10563 c.header_ = make(http.Header) 10564 } 10565 return c.header_ 10566} 10567 10568func (c *ProjectsRegionsClustersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 10569 reqHeaders := make(http.Header) 10570 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 10571 for k, v := range c.header_ { 10572 reqHeaders[k] = v 10573 } 10574 reqHeaders.Set("User-Agent", c.s.userAgent()) 10575 var body io.Reader = nil 10576 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 10577 if err != nil { 10578 return nil, err 10579 } 10580 reqHeaders.Set("Content-Type", "application/json") 10581 c.urlParams_.Set("alt", alt) 10582 c.urlParams_.Set("prettyPrint", "false") 10583 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 10584 urls += "?" + c.urlParams_.Encode() 10585 req, err := http.NewRequest("POST", urls, body) 10586 if err != nil { 10587 return nil, err 10588 } 10589 req.Header = reqHeaders 10590 googleapi.Expand(req.URL, map[string]string{ 10591 "resource": c.resource, 10592 }) 10593 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10594} 10595 10596// Do executes the "dataproc.projects.regions.clusters.testIamPermissions" call. 10597// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 10598// Any non-2xx status code is an error. Response headers are in either 10599// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 10600// was returned at all) in error.(*googleapi.Error).Header. Use 10601// googleapi.IsNotModified to check whether the returned error was 10602// because http.StatusNotModified was returned. 10603func (c *ProjectsRegionsClustersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 10604 gensupport.SetOptions(c.urlParams_, opts...) 10605 res, err := c.doRequest("json") 10606 if res != nil && res.StatusCode == http.StatusNotModified { 10607 if res.Body != nil { 10608 res.Body.Close() 10609 } 10610 return nil, &googleapi.Error{ 10611 Code: res.StatusCode, 10612 Header: res.Header, 10613 } 10614 } 10615 if err != nil { 10616 return nil, err 10617 } 10618 defer googleapi.CloseBody(res) 10619 if err := googleapi.CheckResponse(res); err != nil { 10620 return nil, err 10621 } 10622 ret := &TestIamPermissionsResponse{ 10623 ServerResponse: googleapi.ServerResponse{ 10624 Header: res.Header, 10625 HTTPStatusCode: res.StatusCode, 10626 }, 10627 } 10628 target := &ret 10629 if err := gensupport.DecodeResponse(target, res); err != nil { 10630 return nil, err 10631 } 10632 return ret, nil 10633 // { 10634 // "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.", 10635 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:testIamPermissions", 10636 // "httpMethod": "POST", 10637 // "id": "dataproc.projects.regions.clusters.testIamPermissions", 10638 // "parameterOrder": [ 10639 // "resource" 10640 // ], 10641 // "parameters": { 10642 // "resource": { 10643 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 10644 // "location": "path", 10645 // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$", 10646 // "required": true, 10647 // "type": "string" 10648 // } 10649 // }, 10650 // "path": "v1beta2/{+resource}:testIamPermissions", 10651 // "request": { 10652 // "$ref": "TestIamPermissionsRequest" 10653 // }, 10654 // "response": { 10655 // "$ref": "TestIamPermissionsResponse" 10656 // }, 10657 // "scopes": [ 10658 // "https://www.googleapis.com/auth/cloud-platform" 10659 // ] 10660 // } 10661 10662} 10663 10664// method id "dataproc.projects.regions.jobs.cancel": 10665 10666type ProjectsRegionsJobsCancelCall struct { 10667 s *Service 10668 projectId string 10669 region string 10670 jobId string 10671 canceljobrequest *CancelJobRequest 10672 urlParams_ gensupport.URLParams 10673 ctx_ context.Context 10674 header_ http.Header 10675} 10676 10677// Cancel: Starts a job cancellation request. To access the job resource 10678// after cancellation, call regions/{region}/jobs.list 10679// (https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/list) 10680// or regions/{region}/jobs.get 10681// (https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/get). 10682// 10683// - jobId: The job ID. 10684// - projectId: The ID of the Google Cloud Platform project that the job 10685// belongs to. 10686// - region: The Dataproc region in which to handle the request. 10687func (r *ProjectsRegionsJobsService) Cancel(projectId string, region string, jobId string, canceljobrequest *CancelJobRequest) *ProjectsRegionsJobsCancelCall { 10688 c := &ProjectsRegionsJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10689 c.projectId = projectId 10690 c.region = region 10691 c.jobId = jobId 10692 c.canceljobrequest = canceljobrequest 10693 return c 10694} 10695 10696// Fields allows partial responses to be retrieved. See 10697// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10698// for more information. 10699func (c *ProjectsRegionsJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsCancelCall { 10700 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10701 return c 10702} 10703 10704// Context sets the context to be used in this call's Do method. Any 10705// pending HTTP request will be aborted if the provided context is 10706// canceled. 10707func (c *ProjectsRegionsJobsCancelCall) Context(ctx context.Context) *ProjectsRegionsJobsCancelCall { 10708 c.ctx_ = ctx 10709 return c 10710} 10711 10712// Header returns an http.Header that can be modified by the caller to 10713// add HTTP headers to the request. 10714func (c *ProjectsRegionsJobsCancelCall) Header() http.Header { 10715 if c.header_ == nil { 10716 c.header_ = make(http.Header) 10717 } 10718 return c.header_ 10719} 10720 10721func (c *ProjectsRegionsJobsCancelCall) doRequest(alt string) (*http.Response, error) { 10722 reqHeaders := make(http.Header) 10723 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 10724 for k, v := range c.header_ { 10725 reqHeaders[k] = v 10726 } 10727 reqHeaders.Set("User-Agent", c.s.userAgent()) 10728 var body io.Reader = nil 10729 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceljobrequest) 10730 if err != nil { 10731 return nil, err 10732 } 10733 reqHeaders.Set("Content-Type", "application/json") 10734 c.urlParams_.Set("alt", alt) 10735 c.urlParams_.Set("prettyPrint", "false") 10736 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel") 10737 urls += "?" + c.urlParams_.Encode() 10738 req, err := http.NewRequest("POST", urls, body) 10739 if err != nil { 10740 return nil, err 10741 } 10742 req.Header = reqHeaders 10743 googleapi.Expand(req.URL, map[string]string{ 10744 "projectId": c.projectId, 10745 "region": c.region, 10746 "jobId": c.jobId, 10747 }) 10748 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10749} 10750 10751// Do executes the "dataproc.projects.regions.jobs.cancel" call. 10752// Exactly one of *Job or error will be non-nil. Any non-2xx status code 10753// is an error. Response headers are in either 10754// *Job.ServerResponse.Header or (if a response was returned at all) in 10755// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10756// whether the returned error was because http.StatusNotModified was 10757// returned. 10758func (c *ProjectsRegionsJobsCancelCall) Do(opts ...googleapi.CallOption) (*Job, error) { 10759 gensupport.SetOptions(c.urlParams_, opts...) 10760 res, err := c.doRequest("json") 10761 if res != nil && res.StatusCode == http.StatusNotModified { 10762 if res.Body != nil { 10763 res.Body.Close() 10764 } 10765 return nil, &googleapi.Error{ 10766 Code: res.StatusCode, 10767 Header: res.Header, 10768 } 10769 } 10770 if err != nil { 10771 return nil, err 10772 } 10773 defer googleapi.CloseBody(res) 10774 if err := googleapi.CheckResponse(res); err != nil { 10775 return nil, err 10776 } 10777 ret := &Job{ 10778 ServerResponse: googleapi.ServerResponse{ 10779 Header: res.Header, 10780 HTTPStatusCode: res.StatusCode, 10781 }, 10782 } 10783 target := &ret 10784 if err := gensupport.DecodeResponse(target, res); err != nil { 10785 return nil, err 10786 } 10787 return ret, nil 10788 // { 10789 // "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/v1beta2/projects.regions.jobs/list) or regions/{region}/jobs.get (https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/get).", 10790 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", 10791 // "httpMethod": "POST", 10792 // "id": "dataproc.projects.regions.jobs.cancel", 10793 // "parameterOrder": [ 10794 // "projectId", 10795 // "region", 10796 // "jobId" 10797 // ], 10798 // "parameters": { 10799 // "jobId": { 10800 // "description": "Required. The job ID.", 10801 // "location": "path", 10802 // "required": true, 10803 // "type": "string" 10804 // }, 10805 // "projectId": { 10806 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 10807 // "location": "path", 10808 // "required": true, 10809 // "type": "string" 10810 // }, 10811 // "region": { 10812 // "description": "Required. The Dataproc region in which to handle the request.", 10813 // "location": "path", 10814 // "required": true, 10815 // "type": "string" 10816 // } 10817 // }, 10818 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", 10819 // "request": { 10820 // "$ref": "CancelJobRequest" 10821 // }, 10822 // "response": { 10823 // "$ref": "Job" 10824 // }, 10825 // "scopes": [ 10826 // "https://www.googleapis.com/auth/cloud-platform" 10827 // ] 10828 // } 10829 10830} 10831 10832// method id "dataproc.projects.regions.jobs.delete": 10833 10834type ProjectsRegionsJobsDeleteCall struct { 10835 s *Service 10836 projectId string 10837 region string 10838 jobId string 10839 urlParams_ gensupport.URLParams 10840 ctx_ context.Context 10841 header_ http.Header 10842} 10843 10844// Delete: Deletes the job from the project. If the job is active, the 10845// delete fails, and the response returns FAILED_PRECONDITION. 10846// 10847// - jobId: The job ID. 10848// - projectId: The ID of the Google Cloud Platform project that the job 10849// belongs to. 10850// - region: The Dataproc region in which to handle the request. 10851func (r *ProjectsRegionsJobsService) Delete(projectId string, region string, jobId string) *ProjectsRegionsJobsDeleteCall { 10852 c := &ProjectsRegionsJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10853 c.projectId = projectId 10854 c.region = region 10855 c.jobId = jobId 10856 return c 10857} 10858 10859// Fields allows partial responses to be retrieved. See 10860// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10861// for more information. 10862func (c *ProjectsRegionsJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsDeleteCall { 10863 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10864 return c 10865} 10866 10867// Context sets the context to be used in this call's Do method. Any 10868// pending HTTP request will be aborted if the provided context is 10869// canceled. 10870func (c *ProjectsRegionsJobsDeleteCall) Context(ctx context.Context) *ProjectsRegionsJobsDeleteCall { 10871 c.ctx_ = ctx 10872 return c 10873} 10874 10875// Header returns an http.Header that can be modified by the caller to 10876// add HTTP headers to the request. 10877func (c *ProjectsRegionsJobsDeleteCall) Header() http.Header { 10878 if c.header_ == nil { 10879 c.header_ = make(http.Header) 10880 } 10881 return c.header_ 10882} 10883 10884func (c *ProjectsRegionsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { 10885 reqHeaders := make(http.Header) 10886 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 10887 for k, v := range c.header_ { 10888 reqHeaders[k] = v 10889 } 10890 reqHeaders.Set("User-Agent", c.s.userAgent()) 10891 var body io.Reader = nil 10892 c.urlParams_.Set("alt", alt) 10893 c.urlParams_.Set("prettyPrint", "false") 10894 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}") 10895 urls += "?" + c.urlParams_.Encode() 10896 req, err := http.NewRequest("DELETE", urls, body) 10897 if err != nil { 10898 return nil, err 10899 } 10900 req.Header = reqHeaders 10901 googleapi.Expand(req.URL, map[string]string{ 10902 "projectId": c.projectId, 10903 "region": c.region, 10904 "jobId": c.jobId, 10905 }) 10906 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10907} 10908 10909// Do executes the "dataproc.projects.regions.jobs.delete" call. 10910// Exactly one of *Empty or error will be non-nil. Any non-2xx status 10911// code is an error. Response headers are in either 10912// *Empty.ServerResponse.Header or (if a response was returned at all) 10913// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10914// check whether the returned error was because http.StatusNotModified 10915// was returned. 10916func (c *ProjectsRegionsJobsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 10917 gensupport.SetOptions(c.urlParams_, opts...) 10918 res, err := c.doRequest("json") 10919 if res != nil && res.StatusCode == http.StatusNotModified { 10920 if res.Body != nil { 10921 res.Body.Close() 10922 } 10923 return nil, &googleapi.Error{ 10924 Code: res.StatusCode, 10925 Header: res.Header, 10926 } 10927 } 10928 if err != nil { 10929 return nil, err 10930 } 10931 defer googleapi.CloseBody(res) 10932 if err := googleapi.CheckResponse(res); err != nil { 10933 return nil, err 10934 } 10935 ret := &Empty{ 10936 ServerResponse: googleapi.ServerResponse{ 10937 Header: res.Header, 10938 HTTPStatusCode: res.StatusCode, 10939 }, 10940 } 10941 target := &ret 10942 if err := gensupport.DecodeResponse(target, res); err != nil { 10943 return nil, err 10944 } 10945 return ret, nil 10946 // { 10947 // "description": "Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.", 10948 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", 10949 // "httpMethod": "DELETE", 10950 // "id": "dataproc.projects.regions.jobs.delete", 10951 // "parameterOrder": [ 10952 // "projectId", 10953 // "region", 10954 // "jobId" 10955 // ], 10956 // "parameters": { 10957 // "jobId": { 10958 // "description": "Required. The job ID.", 10959 // "location": "path", 10960 // "required": true, 10961 // "type": "string" 10962 // }, 10963 // "projectId": { 10964 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 10965 // "location": "path", 10966 // "required": true, 10967 // "type": "string" 10968 // }, 10969 // "region": { 10970 // "description": "Required. The Dataproc region in which to handle the request.", 10971 // "location": "path", 10972 // "required": true, 10973 // "type": "string" 10974 // } 10975 // }, 10976 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", 10977 // "response": { 10978 // "$ref": "Empty" 10979 // }, 10980 // "scopes": [ 10981 // "https://www.googleapis.com/auth/cloud-platform" 10982 // ] 10983 // } 10984 10985} 10986 10987// method id "dataproc.projects.regions.jobs.get": 10988 10989type ProjectsRegionsJobsGetCall struct { 10990 s *Service 10991 projectId string 10992 region string 10993 jobId string 10994 urlParams_ gensupport.URLParams 10995 ifNoneMatch_ string 10996 ctx_ context.Context 10997 header_ http.Header 10998} 10999 11000// Get: Gets the resource representation for a job in a project. 11001// 11002// - jobId: The job ID. 11003// - projectId: The ID of the Google Cloud Platform project that the job 11004// belongs to. 11005// - region: The Dataproc region in which to handle the request. 11006func (r *ProjectsRegionsJobsService) Get(projectId string, region string, jobId string) *ProjectsRegionsJobsGetCall { 11007 c := &ProjectsRegionsJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11008 c.projectId = projectId 11009 c.region = region 11010 c.jobId = jobId 11011 return c 11012} 11013 11014// Fields allows partial responses to be retrieved. See 11015// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11016// for more information. 11017func (c *ProjectsRegionsJobsGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsGetCall { 11018 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11019 return c 11020} 11021 11022// IfNoneMatch sets the optional parameter which makes the operation 11023// fail if the object's ETag matches the given value. This is useful for 11024// getting updates only after the object has changed since the last 11025// request. Use googleapi.IsNotModified to check whether the response 11026// error from Do is the result of In-None-Match. 11027func (c *ProjectsRegionsJobsGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsGetCall { 11028 c.ifNoneMatch_ = entityTag 11029 return c 11030} 11031 11032// Context sets the context to be used in this call's Do method. Any 11033// pending HTTP request will be aborted if the provided context is 11034// canceled. 11035func (c *ProjectsRegionsJobsGetCall) Context(ctx context.Context) *ProjectsRegionsJobsGetCall { 11036 c.ctx_ = ctx 11037 return c 11038} 11039 11040// Header returns an http.Header that can be modified by the caller to 11041// add HTTP headers to the request. 11042func (c *ProjectsRegionsJobsGetCall) Header() http.Header { 11043 if c.header_ == nil { 11044 c.header_ = make(http.Header) 11045 } 11046 return c.header_ 11047} 11048 11049func (c *ProjectsRegionsJobsGetCall) doRequest(alt string) (*http.Response, error) { 11050 reqHeaders := make(http.Header) 11051 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 11052 for k, v := range c.header_ { 11053 reqHeaders[k] = v 11054 } 11055 reqHeaders.Set("User-Agent", c.s.userAgent()) 11056 if c.ifNoneMatch_ != "" { 11057 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11058 } 11059 var body io.Reader = nil 11060 c.urlParams_.Set("alt", alt) 11061 c.urlParams_.Set("prettyPrint", "false") 11062 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}") 11063 urls += "?" + c.urlParams_.Encode() 11064 req, err := http.NewRequest("GET", urls, body) 11065 if err != nil { 11066 return nil, err 11067 } 11068 req.Header = reqHeaders 11069 googleapi.Expand(req.URL, map[string]string{ 11070 "projectId": c.projectId, 11071 "region": c.region, 11072 "jobId": c.jobId, 11073 }) 11074 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11075} 11076 11077// Do executes the "dataproc.projects.regions.jobs.get" call. 11078// Exactly one of *Job or error will be non-nil. Any non-2xx status code 11079// is an error. Response headers are in either 11080// *Job.ServerResponse.Header or (if a response was returned at all) in 11081// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11082// whether the returned error was because http.StatusNotModified was 11083// returned. 11084func (c *ProjectsRegionsJobsGetCall) Do(opts ...googleapi.CallOption) (*Job, error) { 11085 gensupport.SetOptions(c.urlParams_, opts...) 11086 res, err := c.doRequest("json") 11087 if res != nil && res.StatusCode == http.StatusNotModified { 11088 if res.Body != nil { 11089 res.Body.Close() 11090 } 11091 return nil, &googleapi.Error{ 11092 Code: res.StatusCode, 11093 Header: res.Header, 11094 } 11095 } 11096 if err != nil { 11097 return nil, err 11098 } 11099 defer googleapi.CloseBody(res) 11100 if err := googleapi.CheckResponse(res); err != nil { 11101 return nil, err 11102 } 11103 ret := &Job{ 11104 ServerResponse: googleapi.ServerResponse{ 11105 Header: res.Header, 11106 HTTPStatusCode: res.StatusCode, 11107 }, 11108 } 11109 target := &ret 11110 if err := gensupport.DecodeResponse(target, res); err != nil { 11111 return nil, err 11112 } 11113 return ret, nil 11114 // { 11115 // "description": "Gets the resource representation for a job in a project.", 11116 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", 11117 // "httpMethod": "GET", 11118 // "id": "dataproc.projects.regions.jobs.get", 11119 // "parameterOrder": [ 11120 // "projectId", 11121 // "region", 11122 // "jobId" 11123 // ], 11124 // "parameters": { 11125 // "jobId": { 11126 // "description": "Required. The job ID.", 11127 // "location": "path", 11128 // "required": true, 11129 // "type": "string" 11130 // }, 11131 // "projectId": { 11132 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 11133 // "location": "path", 11134 // "required": true, 11135 // "type": "string" 11136 // }, 11137 // "region": { 11138 // "description": "Required. The Dataproc region in which to handle the request.", 11139 // "location": "path", 11140 // "required": true, 11141 // "type": "string" 11142 // } 11143 // }, 11144 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", 11145 // "response": { 11146 // "$ref": "Job" 11147 // }, 11148 // "scopes": [ 11149 // "https://www.googleapis.com/auth/cloud-platform" 11150 // ] 11151 // } 11152 11153} 11154 11155// method id "dataproc.projects.regions.jobs.getIamPolicy": 11156 11157type ProjectsRegionsJobsGetIamPolicyCall struct { 11158 s *Service 11159 resource string 11160 urlParams_ gensupport.URLParams 11161 ifNoneMatch_ string 11162 ctx_ context.Context 11163 header_ http.Header 11164} 11165 11166// GetIamPolicy: Gets the access control policy for a resource. Returns 11167// an empty policy if the resource exists and does not have a policy 11168// set. 11169// 11170// - resource: REQUIRED: The resource for which the policy is being 11171// requested. See the operation documentation for the appropriate 11172// value for this field. 11173func (r *ProjectsRegionsJobsService) GetIamPolicy(resource string) *ProjectsRegionsJobsGetIamPolicyCall { 11174 c := &ProjectsRegionsJobsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11175 c.resource = resource 11176 return c 11177} 11178 11179// OptionsRequestedPolicyVersion sets the optional parameter 11180// "options.requestedPolicyVersion": The policy format version to be 11181// returned.Valid values are 0, 1, and 3. Requests specifying an invalid 11182// value will be rejected.Requests for policies with any conditional 11183// bindings must specify version 3. Policies without any conditional 11184// bindings may specify any valid value or leave the field unset.To 11185// learn which resources support conditions in their IAM policies, see 11186// the IAM documentation 11187// (https://cloud.google.com/iam/help/conditions/resource-policies). 11188func (c *ProjectsRegionsJobsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsRegionsJobsGetIamPolicyCall { 11189 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 11190 return c 11191} 11192 11193// Fields allows partial responses to be retrieved. See 11194// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11195// for more information. 11196func (c *ProjectsRegionsJobsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsGetIamPolicyCall { 11197 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11198 return c 11199} 11200 11201// IfNoneMatch sets the optional parameter which makes the operation 11202// fail if the object's ETag matches the given value. This is useful for 11203// getting updates only after the object has changed since the last 11204// request. Use googleapi.IsNotModified to check whether the response 11205// error from Do is the result of In-None-Match. 11206func (c *ProjectsRegionsJobsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsGetIamPolicyCall { 11207 c.ifNoneMatch_ = entityTag 11208 return c 11209} 11210 11211// Context sets the context to be used in this call's Do method. Any 11212// pending HTTP request will be aborted if the provided context is 11213// canceled. 11214func (c *ProjectsRegionsJobsGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsJobsGetIamPolicyCall { 11215 c.ctx_ = ctx 11216 return c 11217} 11218 11219// Header returns an http.Header that can be modified by the caller to 11220// add HTTP headers to the request. 11221func (c *ProjectsRegionsJobsGetIamPolicyCall) Header() http.Header { 11222 if c.header_ == nil { 11223 c.header_ = make(http.Header) 11224 } 11225 return c.header_ 11226} 11227 11228func (c *ProjectsRegionsJobsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 11229 reqHeaders := make(http.Header) 11230 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 11231 for k, v := range c.header_ { 11232 reqHeaders[k] = v 11233 } 11234 reqHeaders.Set("User-Agent", c.s.userAgent()) 11235 if c.ifNoneMatch_ != "" { 11236 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11237 } 11238 var body io.Reader = nil 11239 c.urlParams_.Set("alt", alt) 11240 c.urlParams_.Set("prettyPrint", "false") 11241 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 11242 urls += "?" + c.urlParams_.Encode() 11243 req, err := http.NewRequest("GET", urls, body) 11244 if err != nil { 11245 return nil, err 11246 } 11247 req.Header = reqHeaders 11248 googleapi.Expand(req.URL, map[string]string{ 11249 "resource": c.resource, 11250 }) 11251 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11252} 11253 11254// Do executes the "dataproc.projects.regions.jobs.getIamPolicy" call. 11255// Exactly one of *Policy or error will be non-nil. Any non-2xx status 11256// code is an error. Response headers are in either 11257// *Policy.ServerResponse.Header or (if a response was returned at all) 11258// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11259// check whether the returned error was because http.StatusNotModified 11260// was returned. 11261func (c *ProjectsRegionsJobsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 11262 gensupport.SetOptions(c.urlParams_, opts...) 11263 res, err := c.doRequest("json") 11264 if res != nil && res.StatusCode == http.StatusNotModified { 11265 if res.Body != nil { 11266 res.Body.Close() 11267 } 11268 return nil, &googleapi.Error{ 11269 Code: res.StatusCode, 11270 Header: res.Header, 11271 } 11272 } 11273 if err != nil { 11274 return nil, err 11275 } 11276 defer googleapi.CloseBody(res) 11277 if err := googleapi.CheckResponse(res); err != nil { 11278 return nil, err 11279 } 11280 ret := &Policy{ 11281 ServerResponse: googleapi.ServerResponse{ 11282 Header: res.Header, 11283 HTTPStatusCode: res.StatusCode, 11284 }, 11285 } 11286 target := &ret 11287 if err := gensupport.DecodeResponse(target, res); err != nil { 11288 return nil, err 11289 } 11290 return ret, nil 11291 // { 11292 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 11293 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:getIamPolicy", 11294 // "httpMethod": "GET", 11295 // "id": "dataproc.projects.regions.jobs.getIamPolicy", 11296 // "parameterOrder": [ 11297 // "resource" 11298 // ], 11299 // "parameters": { 11300 // "options.requestedPolicyVersion": { 11301 // "description": "Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset.To learn which resources support conditions in their IAM policies, see the IAM documentation (https://cloud.google.com/iam/help/conditions/resource-policies).", 11302 // "format": "int32", 11303 // "location": "query", 11304 // "type": "integer" 11305 // }, 11306 // "resource": { 11307 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 11308 // "location": "path", 11309 // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$", 11310 // "required": true, 11311 // "type": "string" 11312 // } 11313 // }, 11314 // "path": "v1beta2/{+resource}:getIamPolicy", 11315 // "response": { 11316 // "$ref": "Policy" 11317 // }, 11318 // "scopes": [ 11319 // "https://www.googleapis.com/auth/cloud-platform" 11320 // ] 11321 // } 11322 11323} 11324 11325// method id "dataproc.projects.regions.jobs.list": 11326 11327type ProjectsRegionsJobsListCall struct { 11328 s *Service 11329 projectId string 11330 region string 11331 urlParams_ gensupport.URLParams 11332 ifNoneMatch_ string 11333 ctx_ context.Context 11334 header_ http.Header 11335} 11336 11337// List: Lists regions/{region}/jobs in a project. 11338// 11339// - projectId: The ID of the Google Cloud Platform project that the job 11340// belongs to. 11341// - region: The Dataproc region in which to handle the request. 11342func (r *ProjectsRegionsJobsService) List(projectId string, region string) *ProjectsRegionsJobsListCall { 11343 c := &ProjectsRegionsJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11344 c.projectId = projectId 11345 c.region = region 11346 return c 11347} 11348 11349// ClusterName sets the optional parameter "clusterName": If set, the 11350// returned jobs list includes only jobs that were submitted to the 11351// named cluster. 11352func (c *ProjectsRegionsJobsListCall) ClusterName(clusterName string) *ProjectsRegionsJobsListCall { 11353 c.urlParams_.Set("clusterName", clusterName) 11354 return c 11355} 11356 11357// Filter sets the optional parameter "filter": A filter constraining 11358// the jobs to list. Filters are case-sensitive and have the following 11359// syntax:field = value AND field = value ...where field is status.state 11360// or labels.[KEY], and [KEY] is a label key. value can be * to match 11361// all values. status.state can be either ACTIVE or NON_ACTIVE. Only the 11362// logical AND operator is supported; space-separated items are treated 11363// as having an implicit AND operator.Example filter:status.state = 11364// ACTIVE AND labels.env = staging AND labels.starred = * 11365func (c *ProjectsRegionsJobsListCall) Filter(filter string) *ProjectsRegionsJobsListCall { 11366 c.urlParams_.Set("filter", filter) 11367 return c 11368} 11369 11370// JobStateMatcher sets the optional parameter "jobStateMatcher": 11371// Specifies enumerated categories of jobs to list. (default = match ALL 11372// jobs).If filter is provided, jobStateMatcher will be ignored. 11373// 11374// Possible values: 11375// "ALL" - Match all jobs, regardless of state. 11376// "ACTIVE" - Only match jobs in non-terminal states: PENDING, 11377// RUNNING, or CANCEL_PENDING. 11378// "NON_ACTIVE" - Only match jobs in terminal states: CANCELLED, DONE, 11379// or ERROR. 11380func (c *ProjectsRegionsJobsListCall) JobStateMatcher(jobStateMatcher string) *ProjectsRegionsJobsListCall { 11381 c.urlParams_.Set("jobStateMatcher", jobStateMatcher) 11382 return c 11383} 11384 11385// PageSize sets the optional parameter "pageSize": The number of 11386// results to return in each response. 11387func (c *ProjectsRegionsJobsListCall) PageSize(pageSize int64) *ProjectsRegionsJobsListCall { 11388 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 11389 return c 11390} 11391 11392// PageToken sets the optional parameter "pageToken": The page token, 11393// returned by a previous call, to request the next page of results. 11394func (c *ProjectsRegionsJobsListCall) PageToken(pageToken string) *ProjectsRegionsJobsListCall { 11395 c.urlParams_.Set("pageToken", pageToken) 11396 return c 11397} 11398 11399// Fields allows partial responses to be retrieved. See 11400// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11401// for more information. 11402func (c *ProjectsRegionsJobsListCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsListCall { 11403 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11404 return c 11405} 11406 11407// IfNoneMatch sets the optional parameter which makes the operation 11408// fail if the object's ETag matches the given value. This is useful for 11409// getting updates only after the object has changed since the last 11410// request. Use googleapi.IsNotModified to check whether the response 11411// error from Do is the result of In-None-Match. 11412func (c *ProjectsRegionsJobsListCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsListCall { 11413 c.ifNoneMatch_ = entityTag 11414 return c 11415} 11416 11417// Context sets the context to be used in this call's Do method. Any 11418// pending HTTP request will be aborted if the provided context is 11419// canceled. 11420func (c *ProjectsRegionsJobsListCall) Context(ctx context.Context) *ProjectsRegionsJobsListCall { 11421 c.ctx_ = ctx 11422 return c 11423} 11424 11425// Header returns an http.Header that can be modified by the caller to 11426// add HTTP headers to the request. 11427func (c *ProjectsRegionsJobsListCall) Header() http.Header { 11428 if c.header_ == nil { 11429 c.header_ = make(http.Header) 11430 } 11431 return c.header_ 11432} 11433 11434func (c *ProjectsRegionsJobsListCall) doRequest(alt string) (*http.Response, error) { 11435 reqHeaders := make(http.Header) 11436 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 11437 for k, v := range c.header_ { 11438 reqHeaders[k] = v 11439 } 11440 reqHeaders.Set("User-Agent", c.s.userAgent()) 11441 if c.ifNoneMatch_ != "" { 11442 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11443 } 11444 var body io.Reader = nil 11445 c.urlParams_.Set("alt", alt) 11446 c.urlParams_.Set("prettyPrint", "false") 11447 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs") 11448 urls += "?" + c.urlParams_.Encode() 11449 req, err := http.NewRequest("GET", urls, body) 11450 if err != nil { 11451 return nil, err 11452 } 11453 req.Header = reqHeaders 11454 googleapi.Expand(req.URL, map[string]string{ 11455 "projectId": c.projectId, 11456 "region": c.region, 11457 }) 11458 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11459} 11460 11461// Do executes the "dataproc.projects.regions.jobs.list" call. 11462// Exactly one of *ListJobsResponse or error will be non-nil. Any 11463// non-2xx status code is an error. Response headers are in either 11464// *ListJobsResponse.ServerResponse.Header or (if a response was 11465// returned at all) in error.(*googleapi.Error).Header. Use 11466// googleapi.IsNotModified to check whether the returned error was 11467// because http.StatusNotModified was returned. 11468func (c *ProjectsRegionsJobsListCall) Do(opts ...googleapi.CallOption) (*ListJobsResponse, error) { 11469 gensupport.SetOptions(c.urlParams_, opts...) 11470 res, err := c.doRequest("json") 11471 if res != nil && res.StatusCode == http.StatusNotModified { 11472 if res.Body != nil { 11473 res.Body.Close() 11474 } 11475 return nil, &googleapi.Error{ 11476 Code: res.StatusCode, 11477 Header: res.Header, 11478 } 11479 } 11480 if err != nil { 11481 return nil, err 11482 } 11483 defer googleapi.CloseBody(res) 11484 if err := googleapi.CheckResponse(res); err != nil { 11485 return nil, err 11486 } 11487 ret := &ListJobsResponse{ 11488 ServerResponse: googleapi.ServerResponse{ 11489 Header: res.Header, 11490 HTTPStatusCode: res.StatusCode, 11491 }, 11492 } 11493 target := &ret 11494 if err := gensupport.DecodeResponse(target, res); err != nil { 11495 return nil, err 11496 } 11497 return ret, nil 11498 // { 11499 // "description": "Lists regions/{region}/jobs in a project.", 11500 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs", 11501 // "httpMethod": "GET", 11502 // "id": "dataproc.projects.regions.jobs.list", 11503 // "parameterOrder": [ 11504 // "projectId", 11505 // "region" 11506 // ], 11507 // "parameters": { 11508 // "clusterName": { 11509 // "description": "Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster.", 11510 // "location": "query", 11511 // "type": "string" 11512 // }, 11513 // "filter": { 11514 // "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 = *", 11515 // "location": "query", 11516 // "type": "string" 11517 // }, 11518 // "jobStateMatcher": { 11519 // "description": "Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored.", 11520 // "enum": [ 11521 // "ALL", 11522 // "ACTIVE", 11523 // "NON_ACTIVE" 11524 // ], 11525 // "enumDescriptions": [ 11526 // "Match all jobs, regardless of state.", 11527 // "Only match jobs in non-terminal states: PENDING, RUNNING, or CANCEL_PENDING.", 11528 // "Only match jobs in terminal states: CANCELLED, DONE, or ERROR." 11529 // ], 11530 // "location": "query", 11531 // "type": "string" 11532 // }, 11533 // "pageSize": { 11534 // "description": "Optional. The number of results to return in each response.", 11535 // "format": "int32", 11536 // "location": "query", 11537 // "type": "integer" 11538 // }, 11539 // "pageToken": { 11540 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 11541 // "location": "query", 11542 // "type": "string" 11543 // }, 11544 // "projectId": { 11545 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 11546 // "location": "path", 11547 // "required": true, 11548 // "type": "string" 11549 // }, 11550 // "region": { 11551 // "description": "Required. The Dataproc region in which to handle the request.", 11552 // "location": "path", 11553 // "required": true, 11554 // "type": "string" 11555 // } 11556 // }, 11557 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs", 11558 // "response": { 11559 // "$ref": "ListJobsResponse" 11560 // }, 11561 // "scopes": [ 11562 // "https://www.googleapis.com/auth/cloud-platform" 11563 // ] 11564 // } 11565 11566} 11567 11568// Pages invokes f for each page of results. 11569// A non-nil error returned from f will halt the iteration. 11570// The provided context supersedes any context provided to the Context method. 11571func (c *ProjectsRegionsJobsListCall) Pages(ctx context.Context, f func(*ListJobsResponse) error) error { 11572 c.ctx_ = ctx 11573 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 11574 for { 11575 x, err := c.Do() 11576 if err != nil { 11577 return err 11578 } 11579 if err := f(x); err != nil { 11580 return err 11581 } 11582 if x.NextPageToken == "" { 11583 return nil 11584 } 11585 c.PageToken(x.NextPageToken) 11586 } 11587} 11588 11589// method id "dataproc.projects.regions.jobs.patch": 11590 11591type ProjectsRegionsJobsPatchCall struct { 11592 s *Service 11593 projectId string 11594 region string 11595 jobId string 11596 job *Job 11597 urlParams_ gensupport.URLParams 11598 ctx_ context.Context 11599 header_ http.Header 11600} 11601 11602// Patch: Updates a job in a project. 11603// 11604// - jobId: The job ID. 11605// - projectId: The ID of the Google Cloud Platform project that the job 11606// belongs to. 11607// - region: The Dataproc region in which to handle the request. 11608func (r *ProjectsRegionsJobsService) Patch(projectId string, region string, jobId string, job *Job) *ProjectsRegionsJobsPatchCall { 11609 c := &ProjectsRegionsJobsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11610 c.projectId = projectId 11611 c.region = region 11612 c.jobId = jobId 11613 c.job = job 11614 return c 11615} 11616 11617// UpdateMask sets the optional parameter "updateMask": Required. 11618// Specifies the path, relative to Job, of the field to update. For 11619// example, to update the labels of a Job the update_mask parameter 11620// would be specified as labels, and the PATCH request body would 11621// specify the new value. *Note:* Currently, labels is the only field 11622// that can be updated. 11623func (c *ProjectsRegionsJobsPatchCall) UpdateMask(updateMask string) *ProjectsRegionsJobsPatchCall { 11624 c.urlParams_.Set("updateMask", updateMask) 11625 return c 11626} 11627 11628// Fields allows partial responses to be retrieved. See 11629// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11630// for more information. 11631func (c *ProjectsRegionsJobsPatchCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsPatchCall { 11632 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11633 return c 11634} 11635 11636// Context sets the context to be used in this call's Do method. Any 11637// pending HTTP request will be aborted if the provided context is 11638// canceled. 11639func (c *ProjectsRegionsJobsPatchCall) Context(ctx context.Context) *ProjectsRegionsJobsPatchCall { 11640 c.ctx_ = ctx 11641 return c 11642} 11643 11644// Header returns an http.Header that can be modified by the caller to 11645// add HTTP headers to the request. 11646func (c *ProjectsRegionsJobsPatchCall) Header() http.Header { 11647 if c.header_ == nil { 11648 c.header_ = make(http.Header) 11649 } 11650 return c.header_ 11651} 11652 11653func (c *ProjectsRegionsJobsPatchCall) doRequest(alt string) (*http.Response, error) { 11654 reqHeaders := make(http.Header) 11655 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 11656 for k, v := range c.header_ { 11657 reqHeaders[k] = v 11658 } 11659 reqHeaders.Set("User-Agent", c.s.userAgent()) 11660 var body io.Reader = nil 11661 body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) 11662 if err != nil { 11663 return nil, err 11664 } 11665 reqHeaders.Set("Content-Type", "application/json") 11666 c.urlParams_.Set("alt", alt) 11667 c.urlParams_.Set("prettyPrint", "false") 11668 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}") 11669 urls += "?" + c.urlParams_.Encode() 11670 req, err := http.NewRequest("PATCH", urls, body) 11671 if err != nil { 11672 return nil, err 11673 } 11674 req.Header = reqHeaders 11675 googleapi.Expand(req.URL, map[string]string{ 11676 "projectId": c.projectId, 11677 "region": c.region, 11678 "jobId": c.jobId, 11679 }) 11680 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11681} 11682 11683// Do executes the "dataproc.projects.regions.jobs.patch" call. 11684// Exactly one of *Job or error will be non-nil. Any non-2xx status code 11685// is an error. Response headers are in either 11686// *Job.ServerResponse.Header or (if a response was returned at all) in 11687// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11688// whether the returned error was because http.StatusNotModified was 11689// returned. 11690func (c *ProjectsRegionsJobsPatchCall) Do(opts ...googleapi.CallOption) (*Job, error) { 11691 gensupport.SetOptions(c.urlParams_, opts...) 11692 res, err := c.doRequest("json") 11693 if res != nil && res.StatusCode == http.StatusNotModified { 11694 if res.Body != nil { 11695 res.Body.Close() 11696 } 11697 return nil, &googleapi.Error{ 11698 Code: res.StatusCode, 11699 Header: res.Header, 11700 } 11701 } 11702 if err != nil { 11703 return nil, err 11704 } 11705 defer googleapi.CloseBody(res) 11706 if err := googleapi.CheckResponse(res); err != nil { 11707 return nil, err 11708 } 11709 ret := &Job{ 11710 ServerResponse: googleapi.ServerResponse{ 11711 Header: res.Header, 11712 HTTPStatusCode: res.StatusCode, 11713 }, 11714 } 11715 target := &ret 11716 if err := gensupport.DecodeResponse(target, res); err != nil { 11717 return nil, err 11718 } 11719 return ret, nil 11720 // { 11721 // "description": "Updates a job in a project.", 11722 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", 11723 // "httpMethod": "PATCH", 11724 // "id": "dataproc.projects.regions.jobs.patch", 11725 // "parameterOrder": [ 11726 // "projectId", 11727 // "region", 11728 // "jobId" 11729 // ], 11730 // "parameters": { 11731 // "jobId": { 11732 // "description": "Required. The job ID.", 11733 // "location": "path", 11734 // "required": true, 11735 // "type": "string" 11736 // }, 11737 // "projectId": { 11738 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 11739 // "location": "path", 11740 // "required": true, 11741 // "type": "string" 11742 // }, 11743 // "region": { 11744 // "description": "Required. The Dataproc region in which to handle the request.", 11745 // "location": "path", 11746 // "required": true, 11747 // "type": "string" 11748 // }, 11749 // "updateMask": { 11750 // "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.", 11751 // "format": "google-fieldmask", 11752 // "location": "query", 11753 // "type": "string" 11754 // } 11755 // }, 11756 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", 11757 // "request": { 11758 // "$ref": "Job" 11759 // }, 11760 // "response": { 11761 // "$ref": "Job" 11762 // }, 11763 // "scopes": [ 11764 // "https://www.googleapis.com/auth/cloud-platform" 11765 // ] 11766 // } 11767 11768} 11769 11770// method id "dataproc.projects.regions.jobs.setIamPolicy": 11771 11772type ProjectsRegionsJobsSetIamPolicyCall struct { 11773 s *Service 11774 resource string 11775 setiampolicyrequest *SetIamPolicyRequest 11776 urlParams_ gensupport.URLParams 11777 ctx_ context.Context 11778 header_ http.Header 11779} 11780 11781// SetIamPolicy: Sets the access control policy on the specified 11782// resource. Replaces any existing policy.Can return NOT_FOUND, 11783// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 11784// 11785// - resource: REQUIRED: The resource for which the policy is being 11786// specified. See the operation documentation for the appropriate 11787// value for this field. 11788func (r *ProjectsRegionsJobsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsJobsSetIamPolicyCall { 11789 c := &ProjectsRegionsJobsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11790 c.resource = resource 11791 c.setiampolicyrequest = setiampolicyrequest 11792 return c 11793} 11794 11795// Fields allows partial responses to be retrieved. See 11796// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11797// for more information. 11798func (c *ProjectsRegionsJobsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSetIamPolicyCall { 11799 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11800 return c 11801} 11802 11803// Context sets the context to be used in this call's Do method. Any 11804// pending HTTP request will be aborted if the provided context is 11805// canceled. 11806func (c *ProjectsRegionsJobsSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsJobsSetIamPolicyCall { 11807 c.ctx_ = ctx 11808 return c 11809} 11810 11811// Header returns an http.Header that can be modified by the caller to 11812// add HTTP headers to the request. 11813func (c *ProjectsRegionsJobsSetIamPolicyCall) Header() http.Header { 11814 if c.header_ == nil { 11815 c.header_ = make(http.Header) 11816 } 11817 return c.header_ 11818} 11819 11820func (c *ProjectsRegionsJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 11821 reqHeaders := make(http.Header) 11822 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 11823 for k, v := range c.header_ { 11824 reqHeaders[k] = v 11825 } 11826 reqHeaders.Set("User-Agent", c.s.userAgent()) 11827 var body io.Reader = nil 11828 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 11829 if err != nil { 11830 return nil, err 11831 } 11832 reqHeaders.Set("Content-Type", "application/json") 11833 c.urlParams_.Set("alt", alt) 11834 c.urlParams_.Set("prettyPrint", "false") 11835 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 11836 urls += "?" + c.urlParams_.Encode() 11837 req, err := http.NewRequest("POST", urls, body) 11838 if err != nil { 11839 return nil, err 11840 } 11841 req.Header = reqHeaders 11842 googleapi.Expand(req.URL, map[string]string{ 11843 "resource": c.resource, 11844 }) 11845 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11846} 11847 11848// Do executes the "dataproc.projects.regions.jobs.setIamPolicy" call. 11849// Exactly one of *Policy or error will be non-nil. Any non-2xx status 11850// code is an error. Response headers are in either 11851// *Policy.ServerResponse.Header or (if a response was returned at all) 11852// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11853// check whether the returned error was because http.StatusNotModified 11854// was returned. 11855func (c *ProjectsRegionsJobsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 11856 gensupport.SetOptions(c.urlParams_, opts...) 11857 res, err := c.doRequest("json") 11858 if res != nil && res.StatusCode == http.StatusNotModified { 11859 if res.Body != nil { 11860 res.Body.Close() 11861 } 11862 return nil, &googleapi.Error{ 11863 Code: res.StatusCode, 11864 Header: res.Header, 11865 } 11866 } 11867 if err != nil { 11868 return nil, err 11869 } 11870 defer googleapi.CloseBody(res) 11871 if err := googleapi.CheckResponse(res); err != nil { 11872 return nil, err 11873 } 11874 ret := &Policy{ 11875 ServerResponse: googleapi.ServerResponse{ 11876 Header: res.Header, 11877 HTTPStatusCode: res.StatusCode, 11878 }, 11879 } 11880 target := &ret 11881 if err := gensupport.DecodeResponse(target, res); err != nil { 11882 return nil, err 11883 } 11884 return ret, nil 11885 // { 11886 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 11887 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:setIamPolicy", 11888 // "httpMethod": "POST", 11889 // "id": "dataproc.projects.regions.jobs.setIamPolicy", 11890 // "parameterOrder": [ 11891 // "resource" 11892 // ], 11893 // "parameters": { 11894 // "resource": { 11895 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 11896 // "location": "path", 11897 // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$", 11898 // "required": true, 11899 // "type": "string" 11900 // } 11901 // }, 11902 // "path": "v1beta2/{+resource}:setIamPolicy", 11903 // "request": { 11904 // "$ref": "SetIamPolicyRequest" 11905 // }, 11906 // "response": { 11907 // "$ref": "Policy" 11908 // }, 11909 // "scopes": [ 11910 // "https://www.googleapis.com/auth/cloud-platform" 11911 // ] 11912 // } 11913 11914} 11915 11916// method id "dataproc.projects.regions.jobs.submit": 11917 11918type ProjectsRegionsJobsSubmitCall struct { 11919 s *Service 11920 projectId string 11921 region string 11922 submitjobrequest *SubmitJobRequest 11923 urlParams_ gensupport.URLParams 11924 ctx_ context.Context 11925 header_ http.Header 11926} 11927 11928// Submit: Submits a job to a cluster. 11929// 11930// - projectId: The ID of the Google Cloud Platform project that the job 11931// belongs to. 11932// - region: The Dataproc region in which to handle the request. 11933func (r *ProjectsRegionsJobsService) Submit(projectId string, region string, submitjobrequest *SubmitJobRequest) *ProjectsRegionsJobsSubmitCall { 11934 c := &ProjectsRegionsJobsSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11935 c.projectId = projectId 11936 c.region = region 11937 c.submitjobrequest = submitjobrequest 11938 return c 11939} 11940 11941// Fields allows partial responses to be retrieved. See 11942// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11943// for more information. 11944func (c *ProjectsRegionsJobsSubmitCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSubmitCall { 11945 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11946 return c 11947} 11948 11949// Context sets the context to be used in this call's Do method. Any 11950// pending HTTP request will be aborted if the provided context is 11951// canceled. 11952func (c *ProjectsRegionsJobsSubmitCall) Context(ctx context.Context) *ProjectsRegionsJobsSubmitCall { 11953 c.ctx_ = ctx 11954 return c 11955} 11956 11957// Header returns an http.Header that can be modified by the caller to 11958// add HTTP headers to the request. 11959func (c *ProjectsRegionsJobsSubmitCall) Header() http.Header { 11960 if c.header_ == nil { 11961 c.header_ = make(http.Header) 11962 } 11963 return c.header_ 11964} 11965 11966func (c *ProjectsRegionsJobsSubmitCall) doRequest(alt string) (*http.Response, error) { 11967 reqHeaders := make(http.Header) 11968 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 11969 for k, v := range c.header_ { 11970 reqHeaders[k] = v 11971 } 11972 reqHeaders.Set("User-Agent", c.s.userAgent()) 11973 var body io.Reader = nil 11974 body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitjobrequest) 11975 if err != nil { 11976 return nil, err 11977 } 11978 reqHeaders.Set("Content-Type", "application/json") 11979 c.urlParams_.Set("alt", alt) 11980 c.urlParams_.Set("prettyPrint", "false") 11981 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs:submit") 11982 urls += "?" + c.urlParams_.Encode() 11983 req, err := http.NewRequest("POST", urls, body) 11984 if err != nil { 11985 return nil, err 11986 } 11987 req.Header = reqHeaders 11988 googleapi.Expand(req.URL, map[string]string{ 11989 "projectId": c.projectId, 11990 "region": c.region, 11991 }) 11992 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11993} 11994 11995// Do executes the "dataproc.projects.regions.jobs.submit" call. 11996// Exactly one of *Job or error will be non-nil. Any non-2xx status code 11997// is an error. Response headers are in either 11998// *Job.ServerResponse.Header or (if a response was returned at all) in 11999// error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 12000// whether the returned error was because http.StatusNotModified was 12001// returned. 12002func (c *ProjectsRegionsJobsSubmitCall) Do(opts ...googleapi.CallOption) (*Job, error) { 12003 gensupport.SetOptions(c.urlParams_, opts...) 12004 res, err := c.doRequest("json") 12005 if res != nil && res.StatusCode == http.StatusNotModified { 12006 if res.Body != nil { 12007 res.Body.Close() 12008 } 12009 return nil, &googleapi.Error{ 12010 Code: res.StatusCode, 12011 Header: res.Header, 12012 } 12013 } 12014 if err != nil { 12015 return nil, err 12016 } 12017 defer googleapi.CloseBody(res) 12018 if err := googleapi.CheckResponse(res); err != nil { 12019 return nil, err 12020 } 12021 ret := &Job{ 12022 ServerResponse: googleapi.ServerResponse{ 12023 Header: res.Header, 12024 HTTPStatusCode: res.StatusCode, 12025 }, 12026 } 12027 target := &ret 12028 if err := gensupport.DecodeResponse(target, res); err != nil { 12029 return nil, err 12030 } 12031 return ret, nil 12032 // { 12033 // "description": "Submits a job to a cluster.", 12034 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs:submit", 12035 // "httpMethod": "POST", 12036 // "id": "dataproc.projects.regions.jobs.submit", 12037 // "parameterOrder": [ 12038 // "projectId", 12039 // "region" 12040 // ], 12041 // "parameters": { 12042 // "projectId": { 12043 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 12044 // "location": "path", 12045 // "required": true, 12046 // "type": "string" 12047 // }, 12048 // "region": { 12049 // "description": "Required. The Dataproc region in which to handle the request.", 12050 // "location": "path", 12051 // "required": true, 12052 // "type": "string" 12053 // } 12054 // }, 12055 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs:submit", 12056 // "request": { 12057 // "$ref": "SubmitJobRequest" 12058 // }, 12059 // "response": { 12060 // "$ref": "Job" 12061 // }, 12062 // "scopes": [ 12063 // "https://www.googleapis.com/auth/cloud-platform" 12064 // ] 12065 // } 12066 12067} 12068 12069// method id "dataproc.projects.regions.jobs.submitAsOperation": 12070 12071type ProjectsRegionsJobsSubmitAsOperationCall struct { 12072 s *Service 12073 projectId string 12074 region string 12075 submitjobrequest *SubmitJobRequest 12076 urlParams_ gensupport.URLParams 12077 ctx_ context.Context 12078 header_ http.Header 12079} 12080 12081// SubmitAsOperation: Submits job to a cluster. 12082// 12083// - projectId: The ID of the Google Cloud Platform project that the job 12084// belongs to. 12085// - region: The Dataproc region in which to handle the request. 12086func (r *ProjectsRegionsJobsService) SubmitAsOperation(projectId string, region string, submitjobrequest *SubmitJobRequest) *ProjectsRegionsJobsSubmitAsOperationCall { 12087 c := &ProjectsRegionsJobsSubmitAsOperationCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12088 c.projectId = projectId 12089 c.region = region 12090 c.submitjobrequest = submitjobrequest 12091 return c 12092} 12093 12094// Fields allows partial responses to be retrieved. See 12095// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12096// for more information. 12097func (c *ProjectsRegionsJobsSubmitAsOperationCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSubmitAsOperationCall { 12098 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12099 return c 12100} 12101 12102// Context sets the context to be used in this call's Do method. Any 12103// pending HTTP request will be aborted if the provided context is 12104// canceled. 12105func (c *ProjectsRegionsJobsSubmitAsOperationCall) Context(ctx context.Context) *ProjectsRegionsJobsSubmitAsOperationCall { 12106 c.ctx_ = ctx 12107 return c 12108} 12109 12110// Header returns an http.Header that can be modified by the caller to 12111// add HTTP headers to the request. 12112func (c *ProjectsRegionsJobsSubmitAsOperationCall) Header() http.Header { 12113 if c.header_ == nil { 12114 c.header_ = make(http.Header) 12115 } 12116 return c.header_ 12117} 12118 12119func (c *ProjectsRegionsJobsSubmitAsOperationCall) doRequest(alt string) (*http.Response, error) { 12120 reqHeaders := make(http.Header) 12121 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 12122 for k, v := range c.header_ { 12123 reqHeaders[k] = v 12124 } 12125 reqHeaders.Set("User-Agent", c.s.userAgent()) 12126 var body io.Reader = nil 12127 body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitjobrequest) 12128 if err != nil { 12129 return nil, err 12130 } 12131 reqHeaders.Set("Content-Type", "application/json") 12132 c.urlParams_.Set("alt", alt) 12133 c.urlParams_.Set("prettyPrint", "false") 12134 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs:submitAsOperation") 12135 urls += "?" + c.urlParams_.Encode() 12136 req, err := http.NewRequest("POST", urls, body) 12137 if err != nil { 12138 return nil, err 12139 } 12140 req.Header = reqHeaders 12141 googleapi.Expand(req.URL, map[string]string{ 12142 "projectId": c.projectId, 12143 "region": c.region, 12144 }) 12145 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12146} 12147 12148// Do executes the "dataproc.projects.regions.jobs.submitAsOperation" call. 12149// Exactly one of *Operation or error will be non-nil. Any non-2xx 12150// status code is an error. Response headers are in either 12151// *Operation.ServerResponse.Header or (if a response was returned at 12152// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12153// to check whether the returned error was because 12154// http.StatusNotModified was returned. 12155func (c *ProjectsRegionsJobsSubmitAsOperationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 12156 gensupport.SetOptions(c.urlParams_, opts...) 12157 res, err := c.doRequest("json") 12158 if res != nil && res.StatusCode == http.StatusNotModified { 12159 if res.Body != nil { 12160 res.Body.Close() 12161 } 12162 return nil, &googleapi.Error{ 12163 Code: res.StatusCode, 12164 Header: res.Header, 12165 } 12166 } 12167 if err != nil { 12168 return nil, err 12169 } 12170 defer googleapi.CloseBody(res) 12171 if err := googleapi.CheckResponse(res); err != nil { 12172 return nil, err 12173 } 12174 ret := &Operation{ 12175 ServerResponse: googleapi.ServerResponse{ 12176 Header: res.Header, 12177 HTTPStatusCode: res.StatusCode, 12178 }, 12179 } 12180 target := &ret 12181 if err := gensupport.DecodeResponse(target, res); err != nil { 12182 return nil, err 12183 } 12184 return ret, nil 12185 // { 12186 // "description": "Submits job to a cluster.", 12187 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs:submitAsOperation", 12188 // "httpMethod": "POST", 12189 // "id": "dataproc.projects.regions.jobs.submitAsOperation", 12190 // "parameterOrder": [ 12191 // "projectId", 12192 // "region" 12193 // ], 12194 // "parameters": { 12195 // "projectId": { 12196 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 12197 // "location": "path", 12198 // "required": true, 12199 // "type": "string" 12200 // }, 12201 // "region": { 12202 // "description": "Required. The Dataproc region in which to handle the request.", 12203 // "location": "path", 12204 // "required": true, 12205 // "type": "string" 12206 // } 12207 // }, 12208 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs:submitAsOperation", 12209 // "request": { 12210 // "$ref": "SubmitJobRequest" 12211 // }, 12212 // "response": { 12213 // "$ref": "Operation" 12214 // }, 12215 // "scopes": [ 12216 // "https://www.googleapis.com/auth/cloud-platform" 12217 // ] 12218 // } 12219 12220} 12221 12222// method id "dataproc.projects.regions.jobs.testIamPermissions": 12223 12224type ProjectsRegionsJobsTestIamPermissionsCall struct { 12225 s *Service 12226 resource string 12227 testiampermissionsrequest *TestIamPermissionsRequest 12228 urlParams_ gensupport.URLParams 12229 ctx_ context.Context 12230 header_ http.Header 12231} 12232 12233// TestIamPermissions: Returns permissions that a caller has on the 12234// specified resource. If the resource does not exist, this will return 12235// an empty set of permissions, not a NOT_FOUND error.Note: This 12236// operation is designed to be used for building permission-aware UIs 12237// and command-line tools, not for authorization checking. This 12238// operation may "fail open" without warning. 12239// 12240// - resource: REQUIRED: The resource for which the policy detail is 12241// being requested. See the operation documentation for the 12242// appropriate value for this field. 12243func (r *ProjectsRegionsJobsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsJobsTestIamPermissionsCall { 12244 c := &ProjectsRegionsJobsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12245 c.resource = resource 12246 c.testiampermissionsrequest = testiampermissionsrequest 12247 return c 12248} 12249 12250// Fields allows partial responses to be retrieved. See 12251// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12252// for more information. 12253func (c *ProjectsRegionsJobsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsTestIamPermissionsCall { 12254 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12255 return c 12256} 12257 12258// Context sets the context to be used in this call's Do method. Any 12259// pending HTTP request will be aborted if the provided context is 12260// canceled. 12261func (c *ProjectsRegionsJobsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsJobsTestIamPermissionsCall { 12262 c.ctx_ = ctx 12263 return c 12264} 12265 12266// Header returns an http.Header that can be modified by the caller to 12267// add HTTP headers to the request. 12268func (c *ProjectsRegionsJobsTestIamPermissionsCall) Header() http.Header { 12269 if c.header_ == nil { 12270 c.header_ = make(http.Header) 12271 } 12272 return c.header_ 12273} 12274 12275func (c *ProjectsRegionsJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 12276 reqHeaders := make(http.Header) 12277 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 12278 for k, v := range c.header_ { 12279 reqHeaders[k] = v 12280 } 12281 reqHeaders.Set("User-Agent", c.s.userAgent()) 12282 var body io.Reader = nil 12283 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 12284 if err != nil { 12285 return nil, err 12286 } 12287 reqHeaders.Set("Content-Type", "application/json") 12288 c.urlParams_.Set("alt", alt) 12289 c.urlParams_.Set("prettyPrint", "false") 12290 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 12291 urls += "?" + c.urlParams_.Encode() 12292 req, err := http.NewRequest("POST", urls, body) 12293 if err != nil { 12294 return nil, err 12295 } 12296 req.Header = reqHeaders 12297 googleapi.Expand(req.URL, map[string]string{ 12298 "resource": c.resource, 12299 }) 12300 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12301} 12302 12303// Do executes the "dataproc.projects.regions.jobs.testIamPermissions" call. 12304// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 12305// Any non-2xx status code is an error. Response headers are in either 12306// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 12307// was returned at all) in error.(*googleapi.Error).Header. Use 12308// googleapi.IsNotModified to check whether the returned error was 12309// because http.StatusNotModified was returned. 12310func (c *ProjectsRegionsJobsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 12311 gensupport.SetOptions(c.urlParams_, opts...) 12312 res, err := c.doRequest("json") 12313 if res != nil && res.StatusCode == http.StatusNotModified { 12314 if res.Body != nil { 12315 res.Body.Close() 12316 } 12317 return nil, &googleapi.Error{ 12318 Code: res.StatusCode, 12319 Header: res.Header, 12320 } 12321 } 12322 if err != nil { 12323 return nil, err 12324 } 12325 defer googleapi.CloseBody(res) 12326 if err := googleapi.CheckResponse(res); err != nil { 12327 return nil, err 12328 } 12329 ret := &TestIamPermissionsResponse{ 12330 ServerResponse: googleapi.ServerResponse{ 12331 Header: res.Header, 12332 HTTPStatusCode: res.StatusCode, 12333 }, 12334 } 12335 target := &ret 12336 if err := gensupport.DecodeResponse(target, res); err != nil { 12337 return nil, err 12338 } 12339 return ret, nil 12340 // { 12341 // "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.", 12342 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:testIamPermissions", 12343 // "httpMethod": "POST", 12344 // "id": "dataproc.projects.regions.jobs.testIamPermissions", 12345 // "parameterOrder": [ 12346 // "resource" 12347 // ], 12348 // "parameters": { 12349 // "resource": { 12350 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 12351 // "location": "path", 12352 // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$", 12353 // "required": true, 12354 // "type": "string" 12355 // } 12356 // }, 12357 // "path": "v1beta2/{+resource}:testIamPermissions", 12358 // "request": { 12359 // "$ref": "TestIamPermissionsRequest" 12360 // }, 12361 // "response": { 12362 // "$ref": "TestIamPermissionsResponse" 12363 // }, 12364 // "scopes": [ 12365 // "https://www.googleapis.com/auth/cloud-platform" 12366 // ] 12367 // } 12368 12369} 12370 12371// method id "dataproc.projects.regions.operations.cancel": 12372 12373type ProjectsRegionsOperationsCancelCall struct { 12374 s *Service 12375 name string 12376 urlParams_ gensupport.URLParams 12377 ctx_ context.Context 12378 header_ http.Header 12379} 12380 12381// Cancel: Starts asynchronous cancellation on a long-running operation. 12382// The server makes a best effort to cancel the operation, but success 12383// is not guaranteed. If the server doesn't support this method, it 12384// returns google.rpc.Code.UNIMPLEMENTED. Clients can use 12385// Operations.GetOperation or other methods to check whether the 12386// cancellation succeeded or whether the operation completed despite 12387// cancellation. On successful cancellation, the operation is not 12388// deleted; instead, it becomes an operation with an Operation.error 12389// value with a google.rpc.Status.code of 1, corresponding to 12390// Code.CANCELLED. 12391// 12392// - name: The name of the operation resource to be cancelled. 12393func (r *ProjectsRegionsOperationsService) Cancel(name string) *ProjectsRegionsOperationsCancelCall { 12394 c := &ProjectsRegionsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12395 c.name = name 12396 return c 12397} 12398 12399// Fields allows partial responses to be retrieved. See 12400// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12401// for more information. 12402func (c *ProjectsRegionsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsCancelCall { 12403 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12404 return c 12405} 12406 12407// Context sets the context to be used in this call's Do method. Any 12408// pending HTTP request will be aborted if the provided context is 12409// canceled. 12410func (c *ProjectsRegionsOperationsCancelCall) Context(ctx context.Context) *ProjectsRegionsOperationsCancelCall { 12411 c.ctx_ = ctx 12412 return c 12413} 12414 12415// Header returns an http.Header that can be modified by the caller to 12416// add HTTP headers to the request. 12417func (c *ProjectsRegionsOperationsCancelCall) Header() http.Header { 12418 if c.header_ == nil { 12419 c.header_ = make(http.Header) 12420 } 12421 return c.header_ 12422} 12423 12424func (c *ProjectsRegionsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 12425 reqHeaders := make(http.Header) 12426 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 12427 for k, v := range c.header_ { 12428 reqHeaders[k] = v 12429 } 12430 reqHeaders.Set("User-Agent", c.s.userAgent()) 12431 var body io.Reader = nil 12432 c.urlParams_.Set("alt", alt) 12433 c.urlParams_.Set("prettyPrint", "false") 12434 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:cancel") 12435 urls += "?" + c.urlParams_.Encode() 12436 req, err := http.NewRequest("POST", urls, body) 12437 if err != nil { 12438 return nil, err 12439 } 12440 req.Header = reqHeaders 12441 googleapi.Expand(req.URL, map[string]string{ 12442 "name": c.name, 12443 }) 12444 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12445} 12446 12447// Do executes the "dataproc.projects.regions.operations.cancel" call. 12448// Exactly one of *Empty or error will be non-nil. Any non-2xx status 12449// code is an error. Response headers are in either 12450// *Empty.ServerResponse.Header or (if a response was returned at all) 12451// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12452// check whether the returned error was because http.StatusNotModified 12453// was returned. 12454func (c *ProjectsRegionsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 12455 gensupport.SetOptions(c.urlParams_, opts...) 12456 res, err := c.doRequest("json") 12457 if res != nil && res.StatusCode == http.StatusNotModified { 12458 if res.Body != nil { 12459 res.Body.Close() 12460 } 12461 return nil, &googleapi.Error{ 12462 Code: res.StatusCode, 12463 Header: res.Header, 12464 } 12465 } 12466 if err != nil { 12467 return nil, err 12468 } 12469 defer googleapi.CloseBody(res) 12470 if err := googleapi.CheckResponse(res); err != nil { 12471 return nil, err 12472 } 12473 ret := &Empty{ 12474 ServerResponse: googleapi.ServerResponse{ 12475 Header: res.Header, 12476 HTTPStatusCode: res.StatusCode, 12477 }, 12478 } 12479 target := &ret 12480 if err := gensupport.DecodeResponse(target, res); err != nil { 12481 return nil, err 12482 } 12483 return ret, nil 12484 // { 12485 // "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.", 12486 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:cancel", 12487 // "httpMethod": "POST", 12488 // "id": "dataproc.projects.regions.operations.cancel", 12489 // "parameterOrder": [ 12490 // "name" 12491 // ], 12492 // "parameters": { 12493 // "name": { 12494 // "description": "The name of the operation resource to be cancelled.", 12495 // "location": "path", 12496 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 12497 // "required": true, 12498 // "type": "string" 12499 // } 12500 // }, 12501 // "path": "v1beta2/{+name}:cancel", 12502 // "response": { 12503 // "$ref": "Empty" 12504 // }, 12505 // "scopes": [ 12506 // "https://www.googleapis.com/auth/cloud-platform" 12507 // ] 12508 // } 12509 12510} 12511 12512// method id "dataproc.projects.regions.operations.delete": 12513 12514type ProjectsRegionsOperationsDeleteCall struct { 12515 s *Service 12516 name string 12517 urlParams_ gensupport.URLParams 12518 ctx_ context.Context 12519 header_ http.Header 12520} 12521 12522// Delete: Deletes a long-running operation. This method indicates that 12523// the client is no longer interested in the operation result. It does 12524// not cancel the operation. If the server doesn't support this method, 12525// it returns google.rpc.Code.UNIMPLEMENTED. 12526// 12527// - name: The name of the operation resource to be deleted. 12528func (r *ProjectsRegionsOperationsService) Delete(name string) *ProjectsRegionsOperationsDeleteCall { 12529 c := &ProjectsRegionsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12530 c.name = name 12531 return c 12532} 12533 12534// Fields allows partial responses to be retrieved. See 12535// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12536// for more information. 12537func (c *ProjectsRegionsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsDeleteCall { 12538 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12539 return c 12540} 12541 12542// Context sets the context to be used in this call's Do method. Any 12543// pending HTTP request will be aborted if the provided context is 12544// canceled. 12545func (c *ProjectsRegionsOperationsDeleteCall) Context(ctx context.Context) *ProjectsRegionsOperationsDeleteCall { 12546 c.ctx_ = ctx 12547 return c 12548} 12549 12550// Header returns an http.Header that can be modified by the caller to 12551// add HTTP headers to the request. 12552func (c *ProjectsRegionsOperationsDeleteCall) Header() http.Header { 12553 if c.header_ == nil { 12554 c.header_ = make(http.Header) 12555 } 12556 return c.header_ 12557} 12558 12559func (c *ProjectsRegionsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 12560 reqHeaders := make(http.Header) 12561 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 12562 for k, v := range c.header_ { 12563 reqHeaders[k] = v 12564 } 12565 reqHeaders.Set("User-Agent", c.s.userAgent()) 12566 var body io.Reader = nil 12567 c.urlParams_.Set("alt", alt) 12568 c.urlParams_.Set("prettyPrint", "false") 12569 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 12570 urls += "?" + c.urlParams_.Encode() 12571 req, err := http.NewRequest("DELETE", urls, body) 12572 if err != nil { 12573 return nil, err 12574 } 12575 req.Header = reqHeaders 12576 googleapi.Expand(req.URL, map[string]string{ 12577 "name": c.name, 12578 }) 12579 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12580} 12581 12582// Do executes the "dataproc.projects.regions.operations.delete" call. 12583// Exactly one of *Empty or error will be non-nil. Any non-2xx status 12584// code is an error. Response headers are in either 12585// *Empty.ServerResponse.Header or (if a response was returned at all) 12586// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12587// check whether the returned error was because http.StatusNotModified 12588// was returned. 12589func (c *ProjectsRegionsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 12590 gensupport.SetOptions(c.urlParams_, opts...) 12591 res, err := c.doRequest("json") 12592 if res != nil && res.StatusCode == http.StatusNotModified { 12593 if res.Body != nil { 12594 res.Body.Close() 12595 } 12596 return nil, &googleapi.Error{ 12597 Code: res.StatusCode, 12598 Header: res.Header, 12599 } 12600 } 12601 if err != nil { 12602 return nil, err 12603 } 12604 defer googleapi.CloseBody(res) 12605 if err := googleapi.CheckResponse(res); err != nil { 12606 return nil, err 12607 } 12608 ret := &Empty{ 12609 ServerResponse: googleapi.ServerResponse{ 12610 Header: res.Header, 12611 HTTPStatusCode: res.StatusCode, 12612 }, 12613 } 12614 target := &ret 12615 if err := gensupport.DecodeResponse(target, res); err != nil { 12616 return nil, err 12617 } 12618 return ret, nil 12619 // { 12620 // "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.", 12621 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}", 12622 // "httpMethod": "DELETE", 12623 // "id": "dataproc.projects.regions.operations.delete", 12624 // "parameterOrder": [ 12625 // "name" 12626 // ], 12627 // "parameters": { 12628 // "name": { 12629 // "description": "The name of the operation resource to be deleted.", 12630 // "location": "path", 12631 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 12632 // "required": true, 12633 // "type": "string" 12634 // } 12635 // }, 12636 // "path": "v1beta2/{+name}", 12637 // "response": { 12638 // "$ref": "Empty" 12639 // }, 12640 // "scopes": [ 12641 // "https://www.googleapis.com/auth/cloud-platform" 12642 // ] 12643 // } 12644 12645} 12646 12647// method id "dataproc.projects.regions.operations.get": 12648 12649type ProjectsRegionsOperationsGetCall struct { 12650 s *Service 12651 name string 12652 urlParams_ gensupport.URLParams 12653 ifNoneMatch_ string 12654 ctx_ context.Context 12655 header_ http.Header 12656} 12657 12658// Get: Gets the latest state of a long-running operation. Clients can 12659// use this method to poll the operation result at intervals as 12660// recommended by the API service. 12661// 12662// - name: The name of the operation resource. 12663func (r *ProjectsRegionsOperationsService) Get(name string) *ProjectsRegionsOperationsGetCall { 12664 c := &ProjectsRegionsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12665 c.name = name 12666 return c 12667} 12668 12669// Fields allows partial responses to be retrieved. See 12670// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12671// for more information. 12672func (c *ProjectsRegionsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsGetCall { 12673 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12674 return c 12675} 12676 12677// IfNoneMatch sets the optional parameter which makes the operation 12678// fail if the object's ETag matches the given value. This is useful for 12679// getting updates only after the object has changed since the last 12680// request. Use googleapi.IsNotModified to check whether the response 12681// error from Do is the result of In-None-Match. 12682func (c *ProjectsRegionsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsGetCall { 12683 c.ifNoneMatch_ = entityTag 12684 return c 12685} 12686 12687// Context sets the context to be used in this call's Do method. Any 12688// pending HTTP request will be aborted if the provided context is 12689// canceled. 12690func (c *ProjectsRegionsOperationsGetCall) Context(ctx context.Context) *ProjectsRegionsOperationsGetCall { 12691 c.ctx_ = ctx 12692 return c 12693} 12694 12695// Header returns an http.Header that can be modified by the caller to 12696// add HTTP headers to the request. 12697func (c *ProjectsRegionsOperationsGetCall) Header() http.Header { 12698 if c.header_ == nil { 12699 c.header_ = make(http.Header) 12700 } 12701 return c.header_ 12702} 12703 12704func (c *ProjectsRegionsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 12705 reqHeaders := make(http.Header) 12706 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 12707 for k, v := range c.header_ { 12708 reqHeaders[k] = v 12709 } 12710 reqHeaders.Set("User-Agent", c.s.userAgent()) 12711 if c.ifNoneMatch_ != "" { 12712 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12713 } 12714 var body io.Reader = nil 12715 c.urlParams_.Set("alt", alt) 12716 c.urlParams_.Set("prettyPrint", "false") 12717 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 12718 urls += "?" + c.urlParams_.Encode() 12719 req, err := http.NewRequest("GET", urls, body) 12720 if err != nil { 12721 return nil, err 12722 } 12723 req.Header = reqHeaders 12724 googleapi.Expand(req.URL, map[string]string{ 12725 "name": c.name, 12726 }) 12727 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12728} 12729 12730// Do executes the "dataproc.projects.regions.operations.get" call. 12731// Exactly one of *Operation or error will be non-nil. Any non-2xx 12732// status code is an error. Response headers are in either 12733// *Operation.ServerResponse.Header or (if a response was returned at 12734// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12735// to check whether the returned error was because 12736// http.StatusNotModified was returned. 12737func (c *ProjectsRegionsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 12738 gensupport.SetOptions(c.urlParams_, opts...) 12739 res, err := c.doRequest("json") 12740 if res != nil && res.StatusCode == http.StatusNotModified { 12741 if res.Body != nil { 12742 res.Body.Close() 12743 } 12744 return nil, &googleapi.Error{ 12745 Code: res.StatusCode, 12746 Header: res.Header, 12747 } 12748 } 12749 if err != nil { 12750 return nil, err 12751 } 12752 defer googleapi.CloseBody(res) 12753 if err := googleapi.CheckResponse(res); err != nil { 12754 return nil, err 12755 } 12756 ret := &Operation{ 12757 ServerResponse: googleapi.ServerResponse{ 12758 Header: res.Header, 12759 HTTPStatusCode: res.StatusCode, 12760 }, 12761 } 12762 target := &ret 12763 if err := gensupport.DecodeResponse(target, res); err != nil { 12764 return nil, err 12765 } 12766 return ret, nil 12767 // { 12768 // "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.", 12769 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}", 12770 // "httpMethod": "GET", 12771 // "id": "dataproc.projects.regions.operations.get", 12772 // "parameterOrder": [ 12773 // "name" 12774 // ], 12775 // "parameters": { 12776 // "name": { 12777 // "description": "The name of the operation resource.", 12778 // "location": "path", 12779 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 12780 // "required": true, 12781 // "type": "string" 12782 // } 12783 // }, 12784 // "path": "v1beta2/{+name}", 12785 // "response": { 12786 // "$ref": "Operation" 12787 // }, 12788 // "scopes": [ 12789 // "https://www.googleapis.com/auth/cloud-platform" 12790 // ] 12791 // } 12792 12793} 12794 12795// method id "dataproc.projects.regions.operations.getIamPolicy": 12796 12797type ProjectsRegionsOperationsGetIamPolicyCall struct { 12798 s *Service 12799 resource string 12800 urlParams_ gensupport.URLParams 12801 ifNoneMatch_ string 12802 ctx_ context.Context 12803 header_ http.Header 12804} 12805 12806// GetIamPolicy: Gets the access control policy for a resource. Returns 12807// an empty policy if the resource exists and does not have a policy 12808// set. 12809// 12810// - resource: REQUIRED: The resource for which the policy is being 12811// requested. See the operation documentation for the appropriate 12812// value for this field. 12813func (r *ProjectsRegionsOperationsService) GetIamPolicy(resource string) *ProjectsRegionsOperationsGetIamPolicyCall { 12814 c := &ProjectsRegionsOperationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12815 c.resource = resource 12816 return c 12817} 12818 12819// OptionsRequestedPolicyVersion sets the optional parameter 12820// "options.requestedPolicyVersion": The policy format version to be 12821// returned.Valid values are 0, 1, and 3. Requests specifying an invalid 12822// value will be rejected.Requests for policies with any conditional 12823// bindings must specify version 3. Policies without any conditional 12824// bindings may specify any valid value or leave the field unset.To 12825// learn which resources support conditions in their IAM policies, see 12826// the IAM documentation 12827// (https://cloud.google.com/iam/help/conditions/resource-policies). 12828func (c *ProjectsRegionsOperationsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsRegionsOperationsGetIamPolicyCall { 12829 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 12830 return c 12831} 12832 12833// Fields allows partial responses to be retrieved. See 12834// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12835// for more information. 12836func (c *ProjectsRegionsOperationsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsGetIamPolicyCall { 12837 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12838 return c 12839} 12840 12841// IfNoneMatch sets the optional parameter which makes the operation 12842// fail if the object's ETag matches the given value. This is useful for 12843// getting updates only after the object has changed since the last 12844// request. Use googleapi.IsNotModified to check whether the response 12845// error from Do is the result of In-None-Match. 12846func (c *ProjectsRegionsOperationsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsGetIamPolicyCall { 12847 c.ifNoneMatch_ = entityTag 12848 return c 12849} 12850 12851// Context sets the context to be used in this call's Do method. Any 12852// pending HTTP request will be aborted if the provided context is 12853// canceled. 12854func (c *ProjectsRegionsOperationsGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsOperationsGetIamPolicyCall { 12855 c.ctx_ = ctx 12856 return c 12857} 12858 12859// Header returns an http.Header that can be modified by the caller to 12860// add HTTP headers to the request. 12861func (c *ProjectsRegionsOperationsGetIamPolicyCall) Header() http.Header { 12862 if c.header_ == nil { 12863 c.header_ = make(http.Header) 12864 } 12865 return c.header_ 12866} 12867 12868func (c *ProjectsRegionsOperationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 12869 reqHeaders := make(http.Header) 12870 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 12871 for k, v := range c.header_ { 12872 reqHeaders[k] = v 12873 } 12874 reqHeaders.Set("User-Agent", c.s.userAgent()) 12875 if c.ifNoneMatch_ != "" { 12876 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12877 } 12878 var body io.Reader = nil 12879 c.urlParams_.Set("alt", alt) 12880 c.urlParams_.Set("prettyPrint", "false") 12881 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 12882 urls += "?" + c.urlParams_.Encode() 12883 req, err := http.NewRequest("GET", urls, body) 12884 if err != nil { 12885 return nil, err 12886 } 12887 req.Header = reqHeaders 12888 googleapi.Expand(req.URL, map[string]string{ 12889 "resource": c.resource, 12890 }) 12891 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12892} 12893 12894// Do executes the "dataproc.projects.regions.operations.getIamPolicy" call. 12895// Exactly one of *Policy or error will be non-nil. Any non-2xx status 12896// code is an error. Response headers are in either 12897// *Policy.ServerResponse.Header or (if a response was returned at all) 12898// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12899// check whether the returned error was because http.StatusNotModified 12900// was returned. 12901func (c *ProjectsRegionsOperationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 12902 gensupport.SetOptions(c.urlParams_, opts...) 12903 res, err := c.doRequest("json") 12904 if res != nil && res.StatusCode == http.StatusNotModified { 12905 if res.Body != nil { 12906 res.Body.Close() 12907 } 12908 return nil, &googleapi.Error{ 12909 Code: res.StatusCode, 12910 Header: res.Header, 12911 } 12912 } 12913 if err != nil { 12914 return nil, err 12915 } 12916 defer googleapi.CloseBody(res) 12917 if err := googleapi.CheckResponse(res); err != nil { 12918 return nil, err 12919 } 12920 ret := &Policy{ 12921 ServerResponse: googleapi.ServerResponse{ 12922 Header: res.Header, 12923 HTTPStatusCode: res.StatusCode, 12924 }, 12925 } 12926 target := &ret 12927 if err := gensupport.DecodeResponse(target, res); err != nil { 12928 return nil, err 12929 } 12930 return ret, nil 12931 // { 12932 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 12933 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:getIamPolicy", 12934 // "httpMethod": "GET", 12935 // "id": "dataproc.projects.regions.operations.getIamPolicy", 12936 // "parameterOrder": [ 12937 // "resource" 12938 // ], 12939 // "parameters": { 12940 // "options.requestedPolicyVersion": { 12941 // "description": "Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset.To learn which resources support conditions in their IAM policies, see the IAM documentation (https://cloud.google.com/iam/help/conditions/resource-policies).", 12942 // "format": "int32", 12943 // "location": "query", 12944 // "type": "integer" 12945 // }, 12946 // "resource": { 12947 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 12948 // "location": "path", 12949 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 12950 // "required": true, 12951 // "type": "string" 12952 // } 12953 // }, 12954 // "path": "v1beta2/{+resource}:getIamPolicy", 12955 // "response": { 12956 // "$ref": "Policy" 12957 // }, 12958 // "scopes": [ 12959 // "https://www.googleapis.com/auth/cloud-platform" 12960 // ] 12961 // } 12962 12963} 12964 12965// method id "dataproc.projects.regions.operations.list": 12966 12967type ProjectsRegionsOperationsListCall struct { 12968 s *Service 12969 name string 12970 urlParams_ gensupport.URLParams 12971 ifNoneMatch_ string 12972 ctx_ context.Context 12973 header_ http.Header 12974} 12975 12976// List: Lists operations that match the specified filter in the 12977// request. If the server doesn't support this method, it returns 12978// UNIMPLEMENTED.NOTE: the name binding allows API services to override 12979// the binding to use different resource name schemes, such as 12980// users/*/operations. To override the binding, API services can add a 12981// binding such as "/v1/{name=users/*}/operations" to their service 12982// configuration. For backwards compatibility, the default name includes 12983// the operations collection id, however overriding users must ensure 12984// the name binding is the parent resource, without the operations 12985// collection id. 12986// 12987// - name: The name of the operation's parent resource. 12988func (r *ProjectsRegionsOperationsService) List(name string) *ProjectsRegionsOperationsListCall { 12989 c := &ProjectsRegionsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12990 c.name = name 12991 return c 12992} 12993 12994// Filter sets the optional parameter "filter": The standard list 12995// filter. 12996func (c *ProjectsRegionsOperationsListCall) Filter(filter string) *ProjectsRegionsOperationsListCall { 12997 c.urlParams_.Set("filter", filter) 12998 return c 12999} 13000 13001// PageSize sets the optional parameter "pageSize": The standard list 13002// page size. 13003func (c *ProjectsRegionsOperationsListCall) PageSize(pageSize int64) *ProjectsRegionsOperationsListCall { 13004 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 13005 return c 13006} 13007 13008// PageToken sets the optional parameter "pageToken": The standard list 13009// page token. 13010func (c *ProjectsRegionsOperationsListCall) PageToken(pageToken string) *ProjectsRegionsOperationsListCall { 13011 c.urlParams_.Set("pageToken", pageToken) 13012 return c 13013} 13014 13015// Fields allows partial responses to be retrieved. See 13016// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13017// for more information. 13018func (c *ProjectsRegionsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsListCall { 13019 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13020 return c 13021} 13022 13023// IfNoneMatch sets the optional parameter which makes the operation 13024// fail if the object's ETag matches the given value. This is useful for 13025// getting updates only after the object has changed since the last 13026// request. Use googleapi.IsNotModified to check whether the response 13027// error from Do is the result of In-None-Match. 13028func (c *ProjectsRegionsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsListCall { 13029 c.ifNoneMatch_ = entityTag 13030 return c 13031} 13032 13033// Context sets the context to be used in this call's Do method. Any 13034// pending HTTP request will be aborted if the provided context is 13035// canceled. 13036func (c *ProjectsRegionsOperationsListCall) Context(ctx context.Context) *ProjectsRegionsOperationsListCall { 13037 c.ctx_ = ctx 13038 return c 13039} 13040 13041// Header returns an http.Header that can be modified by the caller to 13042// add HTTP headers to the request. 13043func (c *ProjectsRegionsOperationsListCall) Header() http.Header { 13044 if c.header_ == nil { 13045 c.header_ = make(http.Header) 13046 } 13047 return c.header_ 13048} 13049 13050func (c *ProjectsRegionsOperationsListCall) doRequest(alt string) (*http.Response, error) { 13051 reqHeaders := make(http.Header) 13052 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 13053 for k, v := range c.header_ { 13054 reqHeaders[k] = v 13055 } 13056 reqHeaders.Set("User-Agent", c.s.userAgent()) 13057 if c.ifNoneMatch_ != "" { 13058 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13059 } 13060 var body io.Reader = nil 13061 c.urlParams_.Set("alt", alt) 13062 c.urlParams_.Set("prettyPrint", "false") 13063 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 13064 urls += "?" + c.urlParams_.Encode() 13065 req, err := http.NewRequest("GET", urls, body) 13066 if err != nil { 13067 return nil, err 13068 } 13069 req.Header = reqHeaders 13070 googleapi.Expand(req.URL, map[string]string{ 13071 "name": c.name, 13072 }) 13073 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13074} 13075 13076// Do executes the "dataproc.projects.regions.operations.list" call. 13077// Exactly one of *ListOperationsResponse or error will be non-nil. Any 13078// non-2xx status code is an error. Response headers are in either 13079// *ListOperationsResponse.ServerResponse.Header or (if a response was 13080// returned at all) in error.(*googleapi.Error).Header. Use 13081// googleapi.IsNotModified to check whether the returned error was 13082// because http.StatusNotModified was returned. 13083func (c *ProjectsRegionsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 13084 gensupport.SetOptions(c.urlParams_, opts...) 13085 res, err := c.doRequest("json") 13086 if res != nil && res.StatusCode == http.StatusNotModified { 13087 if res.Body != nil { 13088 res.Body.Close() 13089 } 13090 return nil, &googleapi.Error{ 13091 Code: res.StatusCode, 13092 Header: res.Header, 13093 } 13094 } 13095 if err != nil { 13096 return nil, err 13097 } 13098 defer googleapi.CloseBody(res) 13099 if err := googleapi.CheckResponse(res); err != nil { 13100 return nil, err 13101 } 13102 ret := &ListOperationsResponse{ 13103 ServerResponse: googleapi.ServerResponse{ 13104 Header: res.Header, 13105 HTTPStatusCode: res.StatusCode, 13106 }, 13107 } 13108 target := &ret 13109 if err := gensupport.DecodeResponse(target, res); err != nil { 13110 return nil, err 13111 } 13112 return ret, nil 13113 // { 13114 // "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.", 13115 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations", 13116 // "httpMethod": "GET", 13117 // "id": "dataproc.projects.regions.operations.list", 13118 // "parameterOrder": [ 13119 // "name" 13120 // ], 13121 // "parameters": { 13122 // "filter": { 13123 // "description": "The standard list filter.", 13124 // "location": "query", 13125 // "type": "string" 13126 // }, 13127 // "name": { 13128 // "description": "The name of the operation's parent resource.", 13129 // "location": "path", 13130 // "pattern": "^projects/[^/]+/regions/[^/]+/operations$", 13131 // "required": true, 13132 // "type": "string" 13133 // }, 13134 // "pageSize": { 13135 // "description": "The standard list page size.", 13136 // "format": "int32", 13137 // "location": "query", 13138 // "type": "integer" 13139 // }, 13140 // "pageToken": { 13141 // "description": "The standard list page token.", 13142 // "location": "query", 13143 // "type": "string" 13144 // } 13145 // }, 13146 // "path": "v1beta2/{+name}", 13147 // "response": { 13148 // "$ref": "ListOperationsResponse" 13149 // }, 13150 // "scopes": [ 13151 // "https://www.googleapis.com/auth/cloud-platform" 13152 // ] 13153 // } 13154 13155} 13156 13157// Pages invokes f for each page of results. 13158// A non-nil error returned from f will halt the iteration. 13159// The provided context supersedes any context provided to the Context method. 13160func (c *ProjectsRegionsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 13161 c.ctx_ = ctx 13162 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 13163 for { 13164 x, err := c.Do() 13165 if err != nil { 13166 return err 13167 } 13168 if err := f(x); err != nil { 13169 return err 13170 } 13171 if x.NextPageToken == "" { 13172 return nil 13173 } 13174 c.PageToken(x.NextPageToken) 13175 } 13176} 13177 13178// method id "dataproc.projects.regions.operations.setIamPolicy": 13179 13180type ProjectsRegionsOperationsSetIamPolicyCall struct { 13181 s *Service 13182 resource string 13183 setiampolicyrequest *SetIamPolicyRequest 13184 urlParams_ gensupport.URLParams 13185 ctx_ context.Context 13186 header_ http.Header 13187} 13188 13189// SetIamPolicy: Sets the access control policy on the specified 13190// resource. Replaces any existing policy.Can return NOT_FOUND, 13191// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 13192// 13193// - resource: REQUIRED: The resource for which the policy is being 13194// specified. See the operation documentation for the appropriate 13195// value for this field. 13196func (r *ProjectsRegionsOperationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsOperationsSetIamPolicyCall { 13197 c := &ProjectsRegionsOperationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13198 c.resource = resource 13199 c.setiampolicyrequest = setiampolicyrequest 13200 return c 13201} 13202 13203// Fields allows partial responses to be retrieved. See 13204// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13205// for more information. 13206func (c *ProjectsRegionsOperationsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsSetIamPolicyCall { 13207 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13208 return c 13209} 13210 13211// Context sets the context to be used in this call's Do method. Any 13212// pending HTTP request will be aborted if the provided context is 13213// canceled. 13214func (c *ProjectsRegionsOperationsSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsOperationsSetIamPolicyCall { 13215 c.ctx_ = ctx 13216 return c 13217} 13218 13219// Header returns an http.Header that can be modified by the caller to 13220// add HTTP headers to the request. 13221func (c *ProjectsRegionsOperationsSetIamPolicyCall) Header() http.Header { 13222 if c.header_ == nil { 13223 c.header_ = make(http.Header) 13224 } 13225 return c.header_ 13226} 13227 13228func (c *ProjectsRegionsOperationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 13229 reqHeaders := make(http.Header) 13230 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 13231 for k, v := range c.header_ { 13232 reqHeaders[k] = v 13233 } 13234 reqHeaders.Set("User-Agent", c.s.userAgent()) 13235 var body io.Reader = nil 13236 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 13237 if err != nil { 13238 return nil, err 13239 } 13240 reqHeaders.Set("Content-Type", "application/json") 13241 c.urlParams_.Set("alt", alt) 13242 c.urlParams_.Set("prettyPrint", "false") 13243 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 13244 urls += "?" + c.urlParams_.Encode() 13245 req, err := http.NewRequest("POST", urls, body) 13246 if err != nil { 13247 return nil, err 13248 } 13249 req.Header = reqHeaders 13250 googleapi.Expand(req.URL, map[string]string{ 13251 "resource": c.resource, 13252 }) 13253 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13254} 13255 13256// Do executes the "dataproc.projects.regions.operations.setIamPolicy" call. 13257// Exactly one of *Policy or error will be non-nil. Any non-2xx status 13258// code is an error. Response headers are in either 13259// *Policy.ServerResponse.Header or (if a response was returned at all) 13260// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13261// check whether the returned error was because http.StatusNotModified 13262// was returned. 13263func (c *ProjectsRegionsOperationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 13264 gensupport.SetOptions(c.urlParams_, opts...) 13265 res, err := c.doRequest("json") 13266 if res != nil && res.StatusCode == http.StatusNotModified { 13267 if res.Body != nil { 13268 res.Body.Close() 13269 } 13270 return nil, &googleapi.Error{ 13271 Code: res.StatusCode, 13272 Header: res.Header, 13273 } 13274 } 13275 if err != nil { 13276 return nil, err 13277 } 13278 defer googleapi.CloseBody(res) 13279 if err := googleapi.CheckResponse(res); err != nil { 13280 return nil, err 13281 } 13282 ret := &Policy{ 13283 ServerResponse: googleapi.ServerResponse{ 13284 Header: res.Header, 13285 HTTPStatusCode: res.StatusCode, 13286 }, 13287 } 13288 target := &ret 13289 if err := gensupport.DecodeResponse(target, res); err != nil { 13290 return nil, err 13291 } 13292 return ret, nil 13293 // { 13294 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 13295 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:setIamPolicy", 13296 // "httpMethod": "POST", 13297 // "id": "dataproc.projects.regions.operations.setIamPolicy", 13298 // "parameterOrder": [ 13299 // "resource" 13300 // ], 13301 // "parameters": { 13302 // "resource": { 13303 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 13304 // "location": "path", 13305 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 13306 // "required": true, 13307 // "type": "string" 13308 // } 13309 // }, 13310 // "path": "v1beta2/{+resource}:setIamPolicy", 13311 // "request": { 13312 // "$ref": "SetIamPolicyRequest" 13313 // }, 13314 // "response": { 13315 // "$ref": "Policy" 13316 // }, 13317 // "scopes": [ 13318 // "https://www.googleapis.com/auth/cloud-platform" 13319 // ] 13320 // } 13321 13322} 13323 13324// method id "dataproc.projects.regions.operations.testIamPermissions": 13325 13326type ProjectsRegionsOperationsTestIamPermissionsCall struct { 13327 s *Service 13328 resource string 13329 testiampermissionsrequest *TestIamPermissionsRequest 13330 urlParams_ gensupport.URLParams 13331 ctx_ context.Context 13332 header_ http.Header 13333} 13334 13335// TestIamPermissions: Returns permissions that a caller has on the 13336// specified resource. If the resource does not exist, this will return 13337// an empty set of permissions, not a NOT_FOUND error.Note: This 13338// operation is designed to be used for building permission-aware UIs 13339// and command-line tools, not for authorization checking. This 13340// operation may "fail open" without warning. 13341// 13342// - resource: REQUIRED: The resource for which the policy detail is 13343// being requested. See the operation documentation for the 13344// appropriate value for this field. 13345func (r *ProjectsRegionsOperationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsOperationsTestIamPermissionsCall { 13346 c := &ProjectsRegionsOperationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13347 c.resource = resource 13348 c.testiampermissionsrequest = testiampermissionsrequest 13349 return c 13350} 13351 13352// Fields allows partial responses to be retrieved. See 13353// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13354// for more information. 13355func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsTestIamPermissionsCall { 13356 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13357 return c 13358} 13359 13360// Context sets the context to be used in this call's Do method. Any 13361// pending HTTP request will be aborted if the provided context is 13362// canceled. 13363func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsOperationsTestIamPermissionsCall { 13364 c.ctx_ = ctx 13365 return c 13366} 13367 13368// Header returns an http.Header that can be modified by the caller to 13369// add HTTP headers to the request. 13370func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Header() http.Header { 13371 if c.header_ == nil { 13372 c.header_ = make(http.Header) 13373 } 13374 return c.header_ 13375} 13376 13377func (c *ProjectsRegionsOperationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 13378 reqHeaders := make(http.Header) 13379 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 13380 for k, v := range c.header_ { 13381 reqHeaders[k] = v 13382 } 13383 reqHeaders.Set("User-Agent", c.s.userAgent()) 13384 var body io.Reader = nil 13385 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 13386 if err != nil { 13387 return nil, err 13388 } 13389 reqHeaders.Set("Content-Type", "application/json") 13390 c.urlParams_.Set("alt", alt) 13391 c.urlParams_.Set("prettyPrint", "false") 13392 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 13393 urls += "?" + c.urlParams_.Encode() 13394 req, err := http.NewRequest("POST", urls, body) 13395 if err != nil { 13396 return nil, err 13397 } 13398 req.Header = reqHeaders 13399 googleapi.Expand(req.URL, map[string]string{ 13400 "resource": c.resource, 13401 }) 13402 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13403} 13404 13405// Do executes the "dataproc.projects.regions.operations.testIamPermissions" call. 13406// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 13407// Any non-2xx status code is an error. Response headers are in either 13408// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 13409// was returned at all) in error.(*googleapi.Error).Header. Use 13410// googleapi.IsNotModified to check whether the returned error was 13411// because http.StatusNotModified was returned. 13412func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 13413 gensupport.SetOptions(c.urlParams_, opts...) 13414 res, err := c.doRequest("json") 13415 if res != nil && res.StatusCode == http.StatusNotModified { 13416 if res.Body != nil { 13417 res.Body.Close() 13418 } 13419 return nil, &googleapi.Error{ 13420 Code: res.StatusCode, 13421 Header: res.Header, 13422 } 13423 } 13424 if err != nil { 13425 return nil, err 13426 } 13427 defer googleapi.CloseBody(res) 13428 if err := googleapi.CheckResponse(res); err != nil { 13429 return nil, err 13430 } 13431 ret := &TestIamPermissionsResponse{ 13432 ServerResponse: googleapi.ServerResponse{ 13433 Header: res.Header, 13434 HTTPStatusCode: res.StatusCode, 13435 }, 13436 } 13437 target := &ret 13438 if err := gensupport.DecodeResponse(target, res); err != nil { 13439 return nil, err 13440 } 13441 return ret, nil 13442 // { 13443 // "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.", 13444 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:testIamPermissions", 13445 // "httpMethod": "POST", 13446 // "id": "dataproc.projects.regions.operations.testIamPermissions", 13447 // "parameterOrder": [ 13448 // "resource" 13449 // ], 13450 // "parameters": { 13451 // "resource": { 13452 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 13453 // "location": "path", 13454 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 13455 // "required": true, 13456 // "type": "string" 13457 // } 13458 // }, 13459 // "path": "v1beta2/{+resource}:testIamPermissions", 13460 // "request": { 13461 // "$ref": "TestIamPermissionsRequest" 13462 // }, 13463 // "response": { 13464 // "$ref": "TestIamPermissionsResponse" 13465 // }, 13466 // "scopes": [ 13467 // "https://www.googleapis.com/auth/cloud-platform" 13468 // ] 13469 // } 13470 13471} 13472 13473// method id "dataproc.projects.regions.workflowTemplates.create": 13474 13475type ProjectsRegionsWorkflowTemplatesCreateCall struct { 13476 s *Service 13477 parent string 13478 workflowtemplate *WorkflowTemplate 13479 urlParams_ gensupport.URLParams 13480 ctx_ context.Context 13481 header_ http.Header 13482} 13483 13484// Create: Creates new workflow template. 13485// 13486// - parent: The resource name of the region or location, as described 13487// in https://cloud.google.com/apis/design/resource_names. For 13488// projects.regions.workflowTemplates,create, the resource name of the 13489// region has the following format: 13490// projects/{project_id}/regions/{region} For 13491// projects.locations.workflowTemplates.create, the resource name of 13492// the location has the following format: 13493// projects/{project_id}/locations/{location}. 13494func (r *ProjectsRegionsWorkflowTemplatesService) Create(parent string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesCreateCall { 13495 c := &ProjectsRegionsWorkflowTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13496 c.parent = parent 13497 c.workflowtemplate = workflowtemplate 13498 return c 13499} 13500 13501// Fields allows partial responses to be retrieved. See 13502// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13503// for more information. 13504func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesCreateCall { 13505 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13506 return c 13507} 13508 13509// Context sets the context to be used in this call's Do method. Any 13510// pending HTTP request will be aborted if the provided context is 13511// canceled. 13512func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesCreateCall { 13513 c.ctx_ = ctx 13514 return c 13515} 13516 13517// Header returns an http.Header that can be modified by the caller to 13518// add HTTP headers to the request. 13519func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Header() http.Header { 13520 if c.header_ == nil { 13521 c.header_ = make(http.Header) 13522 } 13523 return c.header_ 13524} 13525 13526func (c *ProjectsRegionsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { 13527 reqHeaders := make(http.Header) 13528 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 13529 for k, v := range c.header_ { 13530 reqHeaders[k] = v 13531 } 13532 reqHeaders.Set("User-Agent", c.s.userAgent()) 13533 var body io.Reader = nil 13534 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 13535 if err != nil { 13536 return nil, err 13537 } 13538 reqHeaders.Set("Content-Type", "application/json") 13539 c.urlParams_.Set("alt", alt) 13540 c.urlParams_.Set("prettyPrint", "false") 13541 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates") 13542 urls += "?" + c.urlParams_.Encode() 13543 req, err := http.NewRequest("POST", urls, body) 13544 if err != nil { 13545 return nil, err 13546 } 13547 req.Header = reqHeaders 13548 googleapi.Expand(req.URL, map[string]string{ 13549 "parent": c.parent, 13550 }) 13551 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13552} 13553 13554// Do executes the "dataproc.projects.regions.workflowTemplates.create" call. 13555// Exactly one of *WorkflowTemplate or error will be non-nil. Any 13556// non-2xx status code is an error. Response headers are in either 13557// *WorkflowTemplate.ServerResponse.Header or (if a response was 13558// returned at all) in error.(*googleapi.Error).Header. Use 13559// googleapi.IsNotModified to check whether the returned error was 13560// because http.StatusNotModified was returned. 13561func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 13562 gensupport.SetOptions(c.urlParams_, opts...) 13563 res, err := c.doRequest("json") 13564 if res != nil && res.StatusCode == http.StatusNotModified { 13565 if res.Body != nil { 13566 res.Body.Close() 13567 } 13568 return nil, &googleapi.Error{ 13569 Code: res.StatusCode, 13570 Header: res.Header, 13571 } 13572 } 13573 if err != nil { 13574 return nil, err 13575 } 13576 defer googleapi.CloseBody(res) 13577 if err := googleapi.CheckResponse(res); err != nil { 13578 return nil, err 13579 } 13580 ret := &WorkflowTemplate{ 13581 ServerResponse: googleapi.ServerResponse{ 13582 Header: res.Header, 13583 HTTPStatusCode: res.StatusCode, 13584 }, 13585 } 13586 target := &ret 13587 if err := gensupport.DecodeResponse(target, res); err != nil { 13588 return nil, err 13589 } 13590 return ret, nil 13591 // { 13592 // "description": "Creates new workflow template.", 13593 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates", 13594 // "httpMethod": "POST", 13595 // "id": "dataproc.projects.regions.workflowTemplates.create", 13596 // "parameterOrder": [ 13597 // "parent" 13598 // ], 13599 // "parameters": { 13600 // "parent": { 13601 // "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}", 13602 // "location": "path", 13603 // "pattern": "^projects/[^/]+/regions/[^/]+$", 13604 // "required": true, 13605 // "type": "string" 13606 // } 13607 // }, 13608 // "path": "v1beta2/{+parent}/workflowTemplates", 13609 // "request": { 13610 // "$ref": "WorkflowTemplate" 13611 // }, 13612 // "response": { 13613 // "$ref": "WorkflowTemplate" 13614 // }, 13615 // "scopes": [ 13616 // "https://www.googleapis.com/auth/cloud-platform" 13617 // ] 13618 // } 13619 13620} 13621 13622// method id "dataproc.projects.regions.workflowTemplates.delete": 13623 13624type ProjectsRegionsWorkflowTemplatesDeleteCall struct { 13625 s *Service 13626 name string 13627 urlParams_ gensupport.URLParams 13628 ctx_ context.Context 13629 header_ http.Header 13630} 13631 13632// Delete: Deletes a workflow template. It does not cancel in-progress 13633// workflows. 13634// 13635// - name: The resource name of the workflow template, as described in 13636// https://cloud.google.com/apis/design/resource_names. For 13637// projects.regions.workflowTemplates.delete, the resource name of the 13638// template has the following format: 13639// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 13640// d} For projects.locations.workflowTemplates.instantiate, the 13641// resource name of the template has the following format: 13642// projects/{project_id}/locations/{location}/workflowTemplates/{templa 13643// te_id}. 13644func (r *ProjectsRegionsWorkflowTemplatesService) Delete(name string) *ProjectsRegionsWorkflowTemplatesDeleteCall { 13645 c := &ProjectsRegionsWorkflowTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13646 c.name = name 13647 return c 13648} 13649 13650// Version sets the optional parameter "version": The version of 13651// workflow template to delete. If specified, will only delete the 13652// template if the current server version matches specified version. 13653func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Version(version int64) *ProjectsRegionsWorkflowTemplatesDeleteCall { 13654 c.urlParams_.Set("version", fmt.Sprint(version)) 13655 return c 13656} 13657 13658// Fields allows partial responses to be retrieved. See 13659// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13660// for more information. 13661func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesDeleteCall { 13662 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13663 return c 13664} 13665 13666// Context sets the context to be used in this call's Do method. Any 13667// pending HTTP request will be aborted if the provided context is 13668// canceled. 13669func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesDeleteCall { 13670 c.ctx_ = ctx 13671 return c 13672} 13673 13674// Header returns an http.Header that can be modified by the caller to 13675// add HTTP headers to the request. 13676func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Header() http.Header { 13677 if c.header_ == nil { 13678 c.header_ = make(http.Header) 13679 } 13680 return c.header_ 13681} 13682 13683func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { 13684 reqHeaders := make(http.Header) 13685 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 13686 for k, v := range c.header_ { 13687 reqHeaders[k] = v 13688 } 13689 reqHeaders.Set("User-Agent", c.s.userAgent()) 13690 var body io.Reader = nil 13691 c.urlParams_.Set("alt", alt) 13692 c.urlParams_.Set("prettyPrint", "false") 13693 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 13694 urls += "?" + c.urlParams_.Encode() 13695 req, err := http.NewRequest("DELETE", urls, body) 13696 if err != nil { 13697 return nil, err 13698 } 13699 req.Header = reqHeaders 13700 googleapi.Expand(req.URL, map[string]string{ 13701 "name": c.name, 13702 }) 13703 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13704} 13705 13706// Do executes the "dataproc.projects.regions.workflowTemplates.delete" call. 13707// Exactly one of *Empty or error will be non-nil. Any non-2xx status 13708// code is an error. Response headers are in either 13709// *Empty.ServerResponse.Header or (if a response was returned at all) 13710// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13711// check whether the returned error was because http.StatusNotModified 13712// was returned. 13713func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 13714 gensupport.SetOptions(c.urlParams_, opts...) 13715 res, err := c.doRequest("json") 13716 if res != nil && res.StatusCode == http.StatusNotModified { 13717 if res.Body != nil { 13718 res.Body.Close() 13719 } 13720 return nil, &googleapi.Error{ 13721 Code: res.StatusCode, 13722 Header: res.Header, 13723 } 13724 } 13725 if err != nil { 13726 return nil, err 13727 } 13728 defer googleapi.CloseBody(res) 13729 if err := googleapi.CheckResponse(res); err != nil { 13730 return nil, err 13731 } 13732 ret := &Empty{ 13733 ServerResponse: googleapi.ServerResponse{ 13734 Header: res.Header, 13735 HTTPStatusCode: res.StatusCode, 13736 }, 13737 } 13738 target := &ret 13739 if err := gensupport.DecodeResponse(target, res); err != nil { 13740 return nil, err 13741 } 13742 return ret, nil 13743 // { 13744 // "description": "Deletes a workflow template. It does not cancel in-progress workflows.", 13745 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}", 13746 // "httpMethod": "DELETE", 13747 // "id": "dataproc.projects.regions.workflowTemplates.delete", 13748 // "parameterOrder": [ 13749 // "name" 13750 // ], 13751 // "parameters": { 13752 // "name": { 13753 // "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}", 13754 // "location": "path", 13755 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 13756 // "required": true, 13757 // "type": "string" 13758 // }, 13759 // "version": { 13760 // "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.", 13761 // "format": "int32", 13762 // "location": "query", 13763 // "type": "integer" 13764 // } 13765 // }, 13766 // "path": "v1beta2/{+name}", 13767 // "response": { 13768 // "$ref": "Empty" 13769 // }, 13770 // "scopes": [ 13771 // "https://www.googleapis.com/auth/cloud-platform" 13772 // ] 13773 // } 13774 13775} 13776 13777// method id "dataproc.projects.regions.workflowTemplates.get": 13778 13779type ProjectsRegionsWorkflowTemplatesGetCall struct { 13780 s *Service 13781 name string 13782 urlParams_ gensupport.URLParams 13783 ifNoneMatch_ string 13784 ctx_ context.Context 13785 header_ http.Header 13786} 13787 13788// Get: Retrieves the latest workflow template.Can retrieve previously 13789// instantiated template by specifying optional version parameter. 13790// 13791// - name: The resource name of the workflow template, as described in 13792// https://cloud.google.com/apis/design/resource_names. For 13793// projects.regions.workflowTemplates.get, the resource name of the 13794// template has the following format: 13795// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 13796// d} For projects.locations.workflowTemplates.get, the resource name 13797// of the template has the following format: 13798// projects/{project_id}/locations/{location}/workflowTemplates/{templa 13799// te_id}. 13800func (r *ProjectsRegionsWorkflowTemplatesService) Get(name string) *ProjectsRegionsWorkflowTemplatesGetCall { 13801 c := &ProjectsRegionsWorkflowTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13802 c.name = name 13803 return c 13804} 13805 13806// Version sets the optional parameter "version": The version of 13807// workflow template to retrieve. Only previously instantiated versions 13808// can be retrieved.If unspecified, retrieves the current version. 13809func (c *ProjectsRegionsWorkflowTemplatesGetCall) Version(version int64) *ProjectsRegionsWorkflowTemplatesGetCall { 13810 c.urlParams_.Set("version", fmt.Sprint(version)) 13811 return c 13812} 13813 13814// Fields allows partial responses to be retrieved. See 13815// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13816// for more information. 13817func (c *ProjectsRegionsWorkflowTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesGetCall { 13818 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13819 return c 13820} 13821 13822// IfNoneMatch sets the optional parameter which makes the operation 13823// fail if the object's ETag matches the given value. This is useful for 13824// getting updates only after the object has changed since the last 13825// request. Use googleapi.IsNotModified to check whether the response 13826// error from Do is the result of In-None-Match. 13827func (c *ProjectsRegionsWorkflowTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesGetCall { 13828 c.ifNoneMatch_ = entityTag 13829 return c 13830} 13831 13832// Context sets the context to be used in this call's Do method. Any 13833// pending HTTP request will be aborted if the provided context is 13834// canceled. 13835func (c *ProjectsRegionsWorkflowTemplatesGetCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesGetCall { 13836 c.ctx_ = ctx 13837 return c 13838} 13839 13840// Header returns an http.Header that can be modified by the caller to 13841// add HTTP headers to the request. 13842func (c *ProjectsRegionsWorkflowTemplatesGetCall) Header() http.Header { 13843 if c.header_ == nil { 13844 c.header_ = make(http.Header) 13845 } 13846 return c.header_ 13847} 13848 13849func (c *ProjectsRegionsWorkflowTemplatesGetCall) doRequest(alt string) (*http.Response, error) { 13850 reqHeaders := make(http.Header) 13851 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 13852 for k, v := range c.header_ { 13853 reqHeaders[k] = v 13854 } 13855 reqHeaders.Set("User-Agent", c.s.userAgent()) 13856 if c.ifNoneMatch_ != "" { 13857 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13858 } 13859 var body io.Reader = nil 13860 c.urlParams_.Set("alt", alt) 13861 c.urlParams_.Set("prettyPrint", "false") 13862 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 13863 urls += "?" + c.urlParams_.Encode() 13864 req, err := http.NewRequest("GET", urls, body) 13865 if err != nil { 13866 return nil, err 13867 } 13868 req.Header = reqHeaders 13869 googleapi.Expand(req.URL, map[string]string{ 13870 "name": c.name, 13871 }) 13872 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13873} 13874 13875// Do executes the "dataproc.projects.regions.workflowTemplates.get" call. 13876// Exactly one of *WorkflowTemplate or error will be non-nil. Any 13877// non-2xx status code is an error. Response headers are in either 13878// *WorkflowTemplate.ServerResponse.Header or (if a response was 13879// returned at all) in error.(*googleapi.Error).Header. Use 13880// googleapi.IsNotModified to check whether the returned error was 13881// because http.StatusNotModified was returned. 13882func (c *ProjectsRegionsWorkflowTemplatesGetCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 13883 gensupport.SetOptions(c.urlParams_, opts...) 13884 res, err := c.doRequest("json") 13885 if res != nil && res.StatusCode == http.StatusNotModified { 13886 if res.Body != nil { 13887 res.Body.Close() 13888 } 13889 return nil, &googleapi.Error{ 13890 Code: res.StatusCode, 13891 Header: res.Header, 13892 } 13893 } 13894 if err != nil { 13895 return nil, err 13896 } 13897 defer googleapi.CloseBody(res) 13898 if err := googleapi.CheckResponse(res); err != nil { 13899 return nil, err 13900 } 13901 ret := &WorkflowTemplate{ 13902 ServerResponse: googleapi.ServerResponse{ 13903 Header: res.Header, 13904 HTTPStatusCode: res.StatusCode, 13905 }, 13906 } 13907 target := &ret 13908 if err := gensupport.DecodeResponse(target, res); err != nil { 13909 return nil, err 13910 } 13911 return ret, nil 13912 // { 13913 // "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.", 13914 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}", 13915 // "httpMethod": "GET", 13916 // "id": "dataproc.projects.regions.workflowTemplates.get", 13917 // "parameterOrder": [ 13918 // "name" 13919 // ], 13920 // "parameters": { 13921 // "name": { 13922 // "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}", 13923 // "location": "path", 13924 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 13925 // "required": true, 13926 // "type": "string" 13927 // }, 13928 // "version": { 13929 // "description": "Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.If unspecified, retrieves the current version.", 13930 // "format": "int32", 13931 // "location": "query", 13932 // "type": "integer" 13933 // } 13934 // }, 13935 // "path": "v1beta2/{+name}", 13936 // "response": { 13937 // "$ref": "WorkflowTemplate" 13938 // }, 13939 // "scopes": [ 13940 // "https://www.googleapis.com/auth/cloud-platform" 13941 // ] 13942 // } 13943 13944} 13945 13946// method id "dataproc.projects.regions.workflowTemplates.getIamPolicy": 13947 13948type ProjectsRegionsWorkflowTemplatesGetIamPolicyCall struct { 13949 s *Service 13950 resource string 13951 urlParams_ gensupport.URLParams 13952 ifNoneMatch_ string 13953 ctx_ context.Context 13954 header_ http.Header 13955} 13956 13957// GetIamPolicy: Gets the access control policy for a resource. Returns 13958// an empty policy if the resource exists and does not have a policy 13959// set. 13960// 13961// - resource: REQUIRED: The resource for which the policy is being 13962// requested. See the operation documentation for the appropriate 13963// value for this field. 13964func (r *ProjectsRegionsWorkflowTemplatesService) GetIamPolicy(resource string) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall { 13965 c := &ProjectsRegionsWorkflowTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13966 c.resource = resource 13967 return c 13968} 13969 13970// OptionsRequestedPolicyVersion sets the optional parameter 13971// "options.requestedPolicyVersion": The policy format version to be 13972// returned.Valid values are 0, 1, and 3. Requests specifying an invalid 13973// value will be rejected.Requests for policies with any conditional 13974// bindings must specify version 3. Policies without any conditional 13975// bindings may specify any valid value or leave the field unset.To 13976// learn which resources support conditions in their IAM policies, see 13977// the IAM documentation 13978// (https://cloud.google.com/iam/help/conditions/resource-policies). 13979func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall { 13980 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 13981 return c 13982} 13983 13984// Fields allows partial responses to be retrieved. See 13985// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13986// for more information. 13987func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall { 13988 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13989 return c 13990} 13991 13992// IfNoneMatch sets the optional parameter which makes the operation 13993// fail if the object's ETag matches the given value. This is useful for 13994// getting updates only after the object has changed since the last 13995// request. Use googleapi.IsNotModified to check whether the response 13996// error from Do is the result of In-None-Match. 13997func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall { 13998 c.ifNoneMatch_ = entityTag 13999 return c 14000} 14001 14002// Context sets the context to be used in this call's Do method. Any 14003// pending HTTP request will be aborted if the provided context is 14004// canceled. 14005func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall { 14006 c.ctx_ = ctx 14007 return c 14008} 14009 14010// Header returns an http.Header that can be modified by the caller to 14011// add HTTP headers to the request. 14012func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Header() http.Header { 14013 if c.header_ == nil { 14014 c.header_ = make(http.Header) 14015 } 14016 return c.header_ 14017} 14018 14019func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 14020 reqHeaders := make(http.Header) 14021 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 14022 for k, v := range c.header_ { 14023 reqHeaders[k] = v 14024 } 14025 reqHeaders.Set("User-Agent", c.s.userAgent()) 14026 if c.ifNoneMatch_ != "" { 14027 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14028 } 14029 var body io.Reader = nil 14030 c.urlParams_.Set("alt", alt) 14031 c.urlParams_.Set("prettyPrint", "false") 14032 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 14033 urls += "?" + c.urlParams_.Encode() 14034 req, err := http.NewRequest("GET", urls, body) 14035 if err != nil { 14036 return nil, err 14037 } 14038 req.Header = reqHeaders 14039 googleapi.Expand(req.URL, map[string]string{ 14040 "resource": c.resource, 14041 }) 14042 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14043} 14044 14045// Do executes the "dataproc.projects.regions.workflowTemplates.getIamPolicy" call. 14046// Exactly one of *Policy or error will be non-nil. Any non-2xx status 14047// code is an error. Response headers are in either 14048// *Policy.ServerResponse.Header or (if a response was returned at all) 14049// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14050// check whether the returned error was because http.StatusNotModified 14051// was returned. 14052func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 14053 gensupport.SetOptions(c.urlParams_, opts...) 14054 res, err := c.doRequest("json") 14055 if res != nil && res.StatusCode == http.StatusNotModified { 14056 if res.Body != nil { 14057 res.Body.Close() 14058 } 14059 return nil, &googleapi.Error{ 14060 Code: res.StatusCode, 14061 Header: res.Header, 14062 } 14063 } 14064 if err != nil { 14065 return nil, err 14066 } 14067 defer googleapi.CloseBody(res) 14068 if err := googleapi.CheckResponse(res); err != nil { 14069 return nil, err 14070 } 14071 ret := &Policy{ 14072 ServerResponse: googleapi.ServerResponse{ 14073 Header: res.Header, 14074 HTTPStatusCode: res.StatusCode, 14075 }, 14076 } 14077 target := &ret 14078 if err := gensupport.DecodeResponse(target, res); err != nil { 14079 return nil, err 14080 } 14081 return ret, nil 14082 // { 14083 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 14084 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:getIamPolicy", 14085 // "httpMethod": "GET", 14086 // "id": "dataproc.projects.regions.workflowTemplates.getIamPolicy", 14087 // "parameterOrder": [ 14088 // "resource" 14089 // ], 14090 // "parameters": { 14091 // "options.requestedPolicyVersion": { 14092 // "description": "Optional. The policy format version to be returned.Valid values are 0, 1, and 3. Requests specifying an invalid value will be rejected.Requests for policies with any conditional bindings must specify version 3. Policies without any conditional bindings may specify any valid value or leave the field unset.To learn which resources support conditions in their IAM policies, see the IAM documentation (https://cloud.google.com/iam/help/conditions/resource-policies).", 14093 // "format": "int32", 14094 // "location": "query", 14095 // "type": "integer" 14096 // }, 14097 // "resource": { 14098 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 14099 // "location": "path", 14100 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 14101 // "required": true, 14102 // "type": "string" 14103 // } 14104 // }, 14105 // "path": "v1beta2/{+resource}:getIamPolicy", 14106 // "response": { 14107 // "$ref": "Policy" 14108 // }, 14109 // "scopes": [ 14110 // "https://www.googleapis.com/auth/cloud-platform" 14111 // ] 14112 // } 14113 14114} 14115 14116// method id "dataproc.projects.regions.workflowTemplates.instantiate": 14117 14118type ProjectsRegionsWorkflowTemplatesInstantiateCall struct { 14119 s *Service 14120 name string 14121 instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest 14122 urlParams_ gensupport.URLParams 14123 ctx_ context.Context 14124 header_ http.Header 14125} 14126 14127// Instantiate: Instantiates a template and begins execution.The 14128// returned Operation can be used to track execution of workflow by 14129// polling operations.get. The Operation will complete when entire 14130// workflow is finished.The running workflow can be aborted via 14131// operations.cancel. This will cause any inflight jobs to be cancelled 14132// and workflow-owned clusters to be deleted.The Operation.metadata will 14133// be WorkflowMetadata 14134// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). 14135// Also see Using WorkflowMetadata 14136// (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On 14137// successful completion, Operation.response will be Empty. 14138// 14139// - name: The resource name of the workflow template, as described in 14140// https://cloud.google.com/apis/design/resource_names. For 14141// projects.regions.workflowTemplates.instantiate, the resource name 14142// of the template has the following format: 14143// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 14144// d} For projects.locations.workflowTemplates.instantiate, the 14145// resource name of the template has the following format: 14146// projects/{project_id}/locations/{location}/workflowTemplates/{templa 14147// te_id}. 14148func (r *ProjectsRegionsWorkflowTemplatesService) Instantiate(name string, instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest) *ProjectsRegionsWorkflowTemplatesInstantiateCall { 14149 c := &ProjectsRegionsWorkflowTemplatesInstantiateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14150 c.name = name 14151 c.instantiateworkflowtemplaterequest = instantiateworkflowtemplaterequest 14152 return c 14153} 14154 14155// Fields allows partial responses to be retrieved. See 14156// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14157// for more information. 14158func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesInstantiateCall { 14159 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14160 return c 14161} 14162 14163// Context sets the context to be used in this call's Do method. Any 14164// pending HTTP request will be aborted if the provided context is 14165// canceled. 14166func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesInstantiateCall { 14167 c.ctx_ = ctx 14168 return c 14169} 14170 14171// Header returns an http.Header that can be modified by the caller to 14172// add HTTP headers to the request. 14173func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Header() http.Header { 14174 if c.header_ == nil { 14175 c.header_ = make(http.Header) 14176 } 14177 return c.header_ 14178} 14179 14180func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) { 14181 reqHeaders := make(http.Header) 14182 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 14183 for k, v := range c.header_ { 14184 reqHeaders[k] = v 14185 } 14186 reqHeaders.Set("User-Agent", c.s.userAgent()) 14187 var body io.Reader = nil 14188 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest) 14189 if err != nil { 14190 return nil, err 14191 } 14192 reqHeaders.Set("Content-Type", "application/json") 14193 c.urlParams_.Set("alt", alt) 14194 c.urlParams_.Set("prettyPrint", "false") 14195 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:instantiate") 14196 urls += "?" + c.urlParams_.Encode() 14197 req, err := http.NewRequest("POST", urls, body) 14198 if err != nil { 14199 return nil, err 14200 } 14201 req.Header = reqHeaders 14202 googleapi.Expand(req.URL, map[string]string{ 14203 "name": c.name, 14204 }) 14205 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14206} 14207 14208// Do executes the "dataproc.projects.regions.workflowTemplates.instantiate" call. 14209// Exactly one of *Operation or error will be non-nil. Any non-2xx 14210// status code is an error. Response headers are in either 14211// *Operation.ServerResponse.Header or (if a response was returned at 14212// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14213// to check whether the returned error was because 14214// http.StatusNotModified was returned. 14215func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 14216 gensupport.SetOptions(c.urlParams_, opts...) 14217 res, err := c.doRequest("json") 14218 if res != nil && res.StatusCode == http.StatusNotModified { 14219 if res.Body != nil { 14220 res.Body.Close() 14221 } 14222 return nil, &googleapi.Error{ 14223 Code: res.StatusCode, 14224 Header: res.Header, 14225 } 14226 } 14227 if err != nil { 14228 return nil, err 14229 } 14230 defer googleapi.CloseBody(res) 14231 if err := googleapi.CheckResponse(res); err != nil { 14232 return nil, err 14233 } 14234 ret := &Operation{ 14235 ServerResponse: googleapi.ServerResponse{ 14236 Header: res.Header, 14237 HTTPStatusCode: res.StatusCode, 14238 }, 14239 } 14240 target := &ret 14241 if err := gensupport.DecodeResponse(target, res); err != nil { 14242 return nil, err 14243 } 14244 return ret, nil 14245 // { 14246 // "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.v1beta2#workflowmetadata). Also see Using WorkflowMetadata (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On successful completion, Operation.response will be Empty.", 14247 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:instantiate", 14248 // "httpMethod": "POST", 14249 // "id": "dataproc.projects.regions.workflowTemplates.instantiate", 14250 // "parameterOrder": [ 14251 // "name" 14252 // ], 14253 // "parameters": { 14254 // "name": { 14255 // "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}", 14256 // "location": "path", 14257 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 14258 // "required": true, 14259 // "type": "string" 14260 // } 14261 // }, 14262 // "path": "v1beta2/{+name}:instantiate", 14263 // "request": { 14264 // "$ref": "InstantiateWorkflowTemplateRequest" 14265 // }, 14266 // "response": { 14267 // "$ref": "Operation" 14268 // }, 14269 // "scopes": [ 14270 // "https://www.googleapis.com/auth/cloud-platform" 14271 // ] 14272 // } 14273 14274} 14275 14276// method id "dataproc.projects.regions.workflowTemplates.instantiateInline": 14277 14278type ProjectsRegionsWorkflowTemplatesInstantiateInlineCall struct { 14279 s *Service 14280 parent string 14281 workflowtemplate *WorkflowTemplate 14282 urlParams_ gensupport.URLParams 14283 ctx_ context.Context 14284 header_ http.Header 14285} 14286 14287// InstantiateInline: Instantiates a template and begins execution.This 14288// method is equivalent to executing the sequence 14289// CreateWorkflowTemplate, InstantiateWorkflowTemplate, 14290// DeleteWorkflowTemplate.The returned Operation can be used to track 14291// execution of workflow by polling operations.get. The Operation will 14292// complete when entire workflow is finished.The running workflow can be 14293// aborted via operations.cancel. This will cause any inflight jobs to 14294// be cancelled and workflow-owned clusters to be deleted.The 14295// Operation.metadata will be WorkflowMetadata 14296// (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). 14297// Also see Using WorkflowMetadata 14298// (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On 14299// successful completion, Operation.response will be Empty. 14300// 14301// - parent: The resource name of the region or location, as described 14302// in https://cloud.google.com/apis/design/resource_names. For 14303// projects.regions.workflowTemplates,instantiateinline, the resource 14304// name of the region has the following format: 14305// projects/{project_id}/regions/{region} For 14306// projects.locations.workflowTemplates.instantiateinline, the 14307// resource name of the location has the following format: 14308// projects/{project_id}/locations/{location}. 14309func (r *ProjectsRegionsWorkflowTemplatesService) InstantiateInline(parent string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14310 c := &ProjectsRegionsWorkflowTemplatesInstantiateInlineCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14311 c.parent = parent 14312 c.workflowtemplate = workflowtemplate 14313 return c 14314} 14315 14316// InstanceId sets the optional parameter "instanceId": Deprecated. 14317// Please use request_id field instead. 14318func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) InstanceId(instanceId string) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14319 c.urlParams_.Set("instanceId", instanceId) 14320 return c 14321} 14322 14323// RequestId sets the optional parameter "requestId": A tag that 14324// prevents multiple concurrent workflow instances with the same tag 14325// from running. This mitigates risk of concurrent instances started due 14326// to retries.It is recommended to always set this value to a UUID 14327// (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag 14328// must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 14329// and hyphens (-). The maximum length is 40 characters. 14330func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) RequestId(requestId string) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14331 c.urlParams_.Set("requestId", requestId) 14332 return c 14333} 14334 14335// Fields allows partial responses to be retrieved. See 14336// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14337// for more information. 14338func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14339 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14340 return c 14341} 14342 14343// Context sets the context to be used in this call's Do method. Any 14344// pending HTTP request will be aborted if the provided context is 14345// canceled. 14346func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14347 c.ctx_ = ctx 14348 return c 14349} 14350 14351// Header returns an http.Header that can be modified by the caller to 14352// add HTTP headers to the request. 14353func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Header() http.Header { 14354 if c.header_ == nil { 14355 c.header_ = make(http.Header) 14356 } 14357 return c.header_ 14358} 14359 14360func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) { 14361 reqHeaders := make(http.Header) 14362 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 14363 for k, v := range c.header_ { 14364 reqHeaders[k] = v 14365 } 14366 reqHeaders.Set("User-Agent", c.s.userAgent()) 14367 var body io.Reader = nil 14368 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 14369 if err != nil { 14370 return nil, err 14371 } 14372 reqHeaders.Set("Content-Type", "application/json") 14373 c.urlParams_.Set("alt", alt) 14374 c.urlParams_.Set("prettyPrint", "false") 14375 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates:instantiateInline") 14376 urls += "?" + c.urlParams_.Encode() 14377 req, err := http.NewRequest("POST", urls, body) 14378 if err != nil { 14379 return nil, err 14380 } 14381 req.Header = reqHeaders 14382 googleapi.Expand(req.URL, map[string]string{ 14383 "parent": c.parent, 14384 }) 14385 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14386} 14387 14388// Do executes the "dataproc.projects.regions.workflowTemplates.instantiateInline" call. 14389// Exactly one of *Operation or error will be non-nil. Any non-2xx 14390// status code is an error. Response headers are in either 14391// *Operation.ServerResponse.Header or (if a response was returned at 14392// all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14393// to check whether the returned error was because 14394// http.StatusNotModified was returned. 14395func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 14396 gensupport.SetOptions(c.urlParams_, opts...) 14397 res, err := c.doRequest("json") 14398 if res != nil && res.StatusCode == http.StatusNotModified { 14399 if res.Body != nil { 14400 res.Body.Close() 14401 } 14402 return nil, &googleapi.Error{ 14403 Code: res.StatusCode, 14404 Header: res.Header, 14405 } 14406 } 14407 if err != nil { 14408 return nil, err 14409 } 14410 defer googleapi.CloseBody(res) 14411 if err := googleapi.CheckResponse(res); err != nil { 14412 return nil, err 14413 } 14414 ret := &Operation{ 14415 ServerResponse: googleapi.ServerResponse{ 14416 Header: res.Header, 14417 HTTPStatusCode: res.StatusCode, 14418 }, 14419 } 14420 target := &ret 14421 if err := gensupport.DecodeResponse(target, res); err != nil { 14422 return nil, err 14423 } 14424 return ret, nil 14425 // { 14426 // "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.", 14427 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates:instantiateInline", 14428 // "httpMethod": "POST", 14429 // "id": "dataproc.projects.regions.workflowTemplates.instantiateInline", 14430 // "parameterOrder": [ 14431 // "parent" 14432 // ], 14433 // "parameters": { 14434 // "instanceId": { 14435 // "description": "Deprecated. Please use request_id field instead.", 14436 // "location": "query", 14437 // "type": "string" 14438 // }, 14439 // "parent": { 14440 // "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}", 14441 // "location": "path", 14442 // "pattern": "^projects/[^/]+/regions/[^/]+$", 14443 // "required": true, 14444 // "type": "string" 14445 // }, 14446 // "requestId": { 14447 // "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.", 14448 // "location": "query", 14449 // "type": "string" 14450 // } 14451 // }, 14452 // "path": "v1beta2/{+parent}/workflowTemplates:instantiateInline", 14453 // "request": { 14454 // "$ref": "WorkflowTemplate" 14455 // }, 14456 // "response": { 14457 // "$ref": "Operation" 14458 // }, 14459 // "scopes": [ 14460 // "https://www.googleapis.com/auth/cloud-platform" 14461 // ] 14462 // } 14463 14464} 14465 14466// method id "dataproc.projects.regions.workflowTemplates.list": 14467 14468type ProjectsRegionsWorkflowTemplatesListCall struct { 14469 s *Service 14470 parent string 14471 urlParams_ gensupport.URLParams 14472 ifNoneMatch_ string 14473 ctx_ context.Context 14474 header_ http.Header 14475} 14476 14477// List: Lists workflows that match the specified filter in the request. 14478// 14479// - parent: The resource name of the region or location, as described 14480// in https://cloud.google.com/apis/design/resource_names. For 14481// projects.regions.workflowTemplates,list, the resource name of the 14482// region has the following format: 14483// projects/{project_id}/regions/{region} For 14484// projects.locations.workflowTemplates.list, the resource name of the 14485// location has the following format: 14486// projects/{project_id}/locations/{location}. 14487func (r *ProjectsRegionsWorkflowTemplatesService) List(parent string) *ProjectsRegionsWorkflowTemplatesListCall { 14488 c := &ProjectsRegionsWorkflowTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14489 c.parent = parent 14490 return c 14491} 14492 14493// PageSize sets the optional parameter "pageSize": The maximum number 14494// of results to return in each response. 14495func (c *ProjectsRegionsWorkflowTemplatesListCall) PageSize(pageSize int64) *ProjectsRegionsWorkflowTemplatesListCall { 14496 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 14497 return c 14498} 14499 14500// PageToken sets the optional parameter "pageToken": The page token, 14501// returned by a previous call, to request the next page of results. 14502func (c *ProjectsRegionsWorkflowTemplatesListCall) PageToken(pageToken string) *ProjectsRegionsWorkflowTemplatesListCall { 14503 c.urlParams_.Set("pageToken", pageToken) 14504 return c 14505} 14506 14507// Fields allows partial responses to be retrieved. See 14508// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14509// for more information. 14510func (c *ProjectsRegionsWorkflowTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesListCall { 14511 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14512 return c 14513} 14514 14515// IfNoneMatch sets the optional parameter which makes the operation 14516// fail if the object's ETag matches the given value. This is useful for 14517// getting updates only after the object has changed since the last 14518// request. Use googleapi.IsNotModified to check whether the response 14519// error from Do is the result of In-None-Match. 14520func (c *ProjectsRegionsWorkflowTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesListCall { 14521 c.ifNoneMatch_ = entityTag 14522 return c 14523} 14524 14525// Context sets the context to be used in this call's Do method. Any 14526// pending HTTP request will be aborted if the provided context is 14527// canceled. 14528func (c *ProjectsRegionsWorkflowTemplatesListCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesListCall { 14529 c.ctx_ = ctx 14530 return c 14531} 14532 14533// Header returns an http.Header that can be modified by the caller to 14534// add HTTP headers to the request. 14535func (c *ProjectsRegionsWorkflowTemplatesListCall) Header() http.Header { 14536 if c.header_ == nil { 14537 c.header_ = make(http.Header) 14538 } 14539 return c.header_ 14540} 14541 14542func (c *ProjectsRegionsWorkflowTemplatesListCall) doRequest(alt string) (*http.Response, error) { 14543 reqHeaders := make(http.Header) 14544 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 14545 for k, v := range c.header_ { 14546 reqHeaders[k] = v 14547 } 14548 reqHeaders.Set("User-Agent", c.s.userAgent()) 14549 if c.ifNoneMatch_ != "" { 14550 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14551 } 14552 var body io.Reader = nil 14553 c.urlParams_.Set("alt", alt) 14554 c.urlParams_.Set("prettyPrint", "false") 14555 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates") 14556 urls += "?" + c.urlParams_.Encode() 14557 req, err := http.NewRequest("GET", urls, body) 14558 if err != nil { 14559 return nil, err 14560 } 14561 req.Header = reqHeaders 14562 googleapi.Expand(req.URL, map[string]string{ 14563 "parent": c.parent, 14564 }) 14565 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14566} 14567 14568// Do executes the "dataproc.projects.regions.workflowTemplates.list" call. 14569// Exactly one of *ListWorkflowTemplatesResponse or error will be 14570// non-nil. Any non-2xx status code is an error. Response headers are in 14571// either *ListWorkflowTemplatesResponse.ServerResponse.Header or (if a 14572// response was returned at all) in error.(*googleapi.Error).Header. Use 14573// googleapi.IsNotModified to check whether the returned error was 14574// because http.StatusNotModified was returned. 14575func (c *ProjectsRegionsWorkflowTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowTemplatesResponse, error) { 14576 gensupport.SetOptions(c.urlParams_, opts...) 14577 res, err := c.doRequest("json") 14578 if res != nil && res.StatusCode == http.StatusNotModified { 14579 if res.Body != nil { 14580 res.Body.Close() 14581 } 14582 return nil, &googleapi.Error{ 14583 Code: res.StatusCode, 14584 Header: res.Header, 14585 } 14586 } 14587 if err != nil { 14588 return nil, err 14589 } 14590 defer googleapi.CloseBody(res) 14591 if err := googleapi.CheckResponse(res); err != nil { 14592 return nil, err 14593 } 14594 ret := &ListWorkflowTemplatesResponse{ 14595 ServerResponse: googleapi.ServerResponse{ 14596 Header: res.Header, 14597 HTTPStatusCode: res.StatusCode, 14598 }, 14599 } 14600 target := &ret 14601 if err := gensupport.DecodeResponse(target, res); err != nil { 14602 return nil, err 14603 } 14604 return ret, nil 14605 // { 14606 // "description": "Lists workflows that match the specified filter in the request.", 14607 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates", 14608 // "httpMethod": "GET", 14609 // "id": "dataproc.projects.regions.workflowTemplates.list", 14610 // "parameterOrder": [ 14611 // "parent" 14612 // ], 14613 // "parameters": { 14614 // "pageSize": { 14615 // "description": "Optional. The maximum number of results to return in each response.", 14616 // "format": "int32", 14617 // "location": "query", 14618 // "type": "integer" 14619 // }, 14620 // "pageToken": { 14621 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 14622 // "location": "query", 14623 // "type": "string" 14624 // }, 14625 // "parent": { 14626 // "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}", 14627 // "location": "path", 14628 // "pattern": "^projects/[^/]+/regions/[^/]+$", 14629 // "required": true, 14630 // "type": "string" 14631 // } 14632 // }, 14633 // "path": "v1beta2/{+parent}/workflowTemplates", 14634 // "response": { 14635 // "$ref": "ListWorkflowTemplatesResponse" 14636 // }, 14637 // "scopes": [ 14638 // "https://www.googleapis.com/auth/cloud-platform" 14639 // ] 14640 // } 14641 14642} 14643 14644// Pages invokes f for each page of results. 14645// A non-nil error returned from f will halt the iteration. 14646// The provided context supersedes any context provided to the Context method. 14647func (c *ProjectsRegionsWorkflowTemplatesListCall) Pages(ctx context.Context, f func(*ListWorkflowTemplatesResponse) error) error { 14648 c.ctx_ = ctx 14649 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 14650 for { 14651 x, err := c.Do() 14652 if err != nil { 14653 return err 14654 } 14655 if err := f(x); err != nil { 14656 return err 14657 } 14658 if x.NextPageToken == "" { 14659 return nil 14660 } 14661 c.PageToken(x.NextPageToken) 14662 } 14663} 14664 14665// method id "dataproc.projects.regions.workflowTemplates.setIamPolicy": 14666 14667type ProjectsRegionsWorkflowTemplatesSetIamPolicyCall struct { 14668 s *Service 14669 resource string 14670 setiampolicyrequest *SetIamPolicyRequest 14671 urlParams_ gensupport.URLParams 14672 ctx_ context.Context 14673 header_ http.Header 14674} 14675 14676// SetIamPolicy: Sets the access control policy on the specified 14677// resource. Replaces any existing policy.Can return NOT_FOUND, 14678// INVALID_ARGUMENT, and PERMISSION_DENIED errors. 14679// 14680// - resource: REQUIRED: The resource for which the policy is being 14681// specified. See the operation documentation for the appropriate 14682// value for this field. 14683func (r *ProjectsRegionsWorkflowTemplatesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall { 14684 c := &ProjectsRegionsWorkflowTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14685 c.resource = resource 14686 c.setiampolicyrequest = setiampolicyrequest 14687 return c 14688} 14689 14690// Fields allows partial responses to be retrieved. See 14691// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14692// for more information. 14693func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall { 14694 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14695 return c 14696} 14697 14698// Context sets the context to be used in this call's Do method. Any 14699// pending HTTP request will be aborted if the provided context is 14700// canceled. 14701func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall { 14702 c.ctx_ = ctx 14703 return c 14704} 14705 14706// Header returns an http.Header that can be modified by the caller to 14707// add HTTP headers to the request. 14708func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Header() http.Header { 14709 if c.header_ == nil { 14710 c.header_ = make(http.Header) 14711 } 14712 return c.header_ 14713} 14714 14715func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 14716 reqHeaders := make(http.Header) 14717 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 14718 for k, v := range c.header_ { 14719 reqHeaders[k] = v 14720 } 14721 reqHeaders.Set("User-Agent", c.s.userAgent()) 14722 var body io.Reader = nil 14723 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 14724 if err != nil { 14725 return nil, err 14726 } 14727 reqHeaders.Set("Content-Type", "application/json") 14728 c.urlParams_.Set("alt", alt) 14729 c.urlParams_.Set("prettyPrint", "false") 14730 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 14731 urls += "?" + c.urlParams_.Encode() 14732 req, err := http.NewRequest("POST", urls, body) 14733 if err != nil { 14734 return nil, err 14735 } 14736 req.Header = reqHeaders 14737 googleapi.Expand(req.URL, map[string]string{ 14738 "resource": c.resource, 14739 }) 14740 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14741} 14742 14743// Do executes the "dataproc.projects.regions.workflowTemplates.setIamPolicy" call. 14744// Exactly one of *Policy or error will be non-nil. Any non-2xx status 14745// code is an error. Response headers are in either 14746// *Policy.ServerResponse.Header or (if a response was returned at all) 14747// in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14748// check whether the returned error was because http.StatusNotModified 14749// was returned. 14750func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 14751 gensupport.SetOptions(c.urlParams_, opts...) 14752 res, err := c.doRequest("json") 14753 if res != nil && res.StatusCode == http.StatusNotModified { 14754 if res.Body != nil { 14755 res.Body.Close() 14756 } 14757 return nil, &googleapi.Error{ 14758 Code: res.StatusCode, 14759 Header: res.Header, 14760 } 14761 } 14762 if err != nil { 14763 return nil, err 14764 } 14765 defer googleapi.CloseBody(res) 14766 if err := googleapi.CheckResponse(res); err != nil { 14767 return nil, err 14768 } 14769 ret := &Policy{ 14770 ServerResponse: googleapi.ServerResponse{ 14771 Header: res.Header, 14772 HTTPStatusCode: res.StatusCode, 14773 }, 14774 } 14775 target := &ret 14776 if err := gensupport.DecodeResponse(target, res); err != nil { 14777 return nil, err 14778 } 14779 return ret, nil 14780 // { 14781 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 14782 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:setIamPolicy", 14783 // "httpMethod": "POST", 14784 // "id": "dataproc.projects.regions.workflowTemplates.setIamPolicy", 14785 // "parameterOrder": [ 14786 // "resource" 14787 // ], 14788 // "parameters": { 14789 // "resource": { 14790 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 14791 // "location": "path", 14792 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 14793 // "required": true, 14794 // "type": "string" 14795 // } 14796 // }, 14797 // "path": "v1beta2/{+resource}:setIamPolicy", 14798 // "request": { 14799 // "$ref": "SetIamPolicyRequest" 14800 // }, 14801 // "response": { 14802 // "$ref": "Policy" 14803 // }, 14804 // "scopes": [ 14805 // "https://www.googleapis.com/auth/cloud-platform" 14806 // ] 14807 // } 14808 14809} 14810 14811// method id "dataproc.projects.regions.workflowTemplates.testIamPermissions": 14812 14813type ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall struct { 14814 s *Service 14815 resource string 14816 testiampermissionsrequest *TestIamPermissionsRequest 14817 urlParams_ gensupport.URLParams 14818 ctx_ context.Context 14819 header_ http.Header 14820} 14821 14822// TestIamPermissions: Returns permissions that a caller has on the 14823// specified resource. If the resource does not exist, this will return 14824// an empty set of permissions, not a NOT_FOUND error.Note: This 14825// operation is designed to be used for building permission-aware UIs 14826// and command-line tools, not for authorization checking. This 14827// operation may "fail open" without warning. 14828// 14829// - resource: REQUIRED: The resource for which the policy detail is 14830// being requested. See the operation documentation for the 14831// appropriate value for this field. 14832func (r *ProjectsRegionsWorkflowTemplatesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall { 14833 c := &ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14834 c.resource = resource 14835 c.testiampermissionsrequest = testiampermissionsrequest 14836 return c 14837} 14838 14839// Fields allows partial responses to be retrieved. See 14840// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14841// for more information. 14842func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall { 14843 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14844 return c 14845} 14846 14847// Context sets the context to be used in this call's Do method. Any 14848// pending HTTP request will be aborted if the provided context is 14849// canceled. 14850func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall { 14851 c.ctx_ = ctx 14852 return c 14853} 14854 14855// Header returns an http.Header that can be modified by the caller to 14856// add HTTP headers to the request. 14857func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Header() http.Header { 14858 if c.header_ == nil { 14859 c.header_ = make(http.Header) 14860 } 14861 return c.header_ 14862} 14863 14864func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 14865 reqHeaders := make(http.Header) 14866 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 14867 for k, v := range c.header_ { 14868 reqHeaders[k] = v 14869 } 14870 reqHeaders.Set("User-Agent", c.s.userAgent()) 14871 var body io.Reader = nil 14872 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 14873 if err != nil { 14874 return nil, err 14875 } 14876 reqHeaders.Set("Content-Type", "application/json") 14877 c.urlParams_.Set("alt", alt) 14878 c.urlParams_.Set("prettyPrint", "false") 14879 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 14880 urls += "?" + c.urlParams_.Encode() 14881 req, err := http.NewRequest("POST", urls, body) 14882 if err != nil { 14883 return nil, err 14884 } 14885 req.Header = reqHeaders 14886 googleapi.Expand(req.URL, map[string]string{ 14887 "resource": c.resource, 14888 }) 14889 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14890} 14891 14892// Do executes the "dataproc.projects.regions.workflowTemplates.testIamPermissions" call. 14893// Exactly one of *TestIamPermissionsResponse or error will be non-nil. 14894// Any non-2xx status code is an error. Response headers are in either 14895// *TestIamPermissionsResponse.ServerResponse.Header or (if a response 14896// was returned at all) in error.(*googleapi.Error).Header. Use 14897// googleapi.IsNotModified to check whether the returned error was 14898// because http.StatusNotModified was returned. 14899func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 14900 gensupport.SetOptions(c.urlParams_, opts...) 14901 res, err := c.doRequest("json") 14902 if res != nil && res.StatusCode == http.StatusNotModified { 14903 if res.Body != nil { 14904 res.Body.Close() 14905 } 14906 return nil, &googleapi.Error{ 14907 Code: res.StatusCode, 14908 Header: res.Header, 14909 } 14910 } 14911 if err != nil { 14912 return nil, err 14913 } 14914 defer googleapi.CloseBody(res) 14915 if err := googleapi.CheckResponse(res); err != nil { 14916 return nil, err 14917 } 14918 ret := &TestIamPermissionsResponse{ 14919 ServerResponse: googleapi.ServerResponse{ 14920 Header: res.Header, 14921 HTTPStatusCode: res.StatusCode, 14922 }, 14923 } 14924 target := &ret 14925 if err := gensupport.DecodeResponse(target, res); err != nil { 14926 return nil, err 14927 } 14928 return ret, nil 14929 // { 14930 // "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.", 14931 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:testIamPermissions", 14932 // "httpMethod": "POST", 14933 // "id": "dataproc.projects.regions.workflowTemplates.testIamPermissions", 14934 // "parameterOrder": [ 14935 // "resource" 14936 // ], 14937 // "parameters": { 14938 // "resource": { 14939 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 14940 // "location": "path", 14941 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 14942 // "required": true, 14943 // "type": "string" 14944 // } 14945 // }, 14946 // "path": "v1beta2/{+resource}:testIamPermissions", 14947 // "request": { 14948 // "$ref": "TestIamPermissionsRequest" 14949 // }, 14950 // "response": { 14951 // "$ref": "TestIamPermissionsResponse" 14952 // }, 14953 // "scopes": [ 14954 // "https://www.googleapis.com/auth/cloud-platform" 14955 // ] 14956 // } 14957 14958} 14959 14960// method id "dataproc.projects.regions.workflowTemplates.update": 14961 14962type ProjectsRegionsWorkflowTemplatesUpdateCall struct { 14963 s *Service 14964 name string 14965 workflowtemplate *WorkflowTemplate 14966 urlParams_ gensupport.URLParams 14967 ctx_ context.Context 14968 header_ http.Header 14969} 14970 14971// Update: Updates (replaces) workflow template. The updated template 14972// must contain version that matches the current server version. 14973// 14974// - name: Output only. The resource name of the workflow template, as 14975// described in https://cloud.google.com/apis/design/resource_names. 14976// For projects.regions.workflowTemplates, the resource name of the 14977// template has the following format: 14978// projects/{project_id}/regions/{region}/workflowTemplates/{template_i 14979// d} For projects.locations.workflowTemplates, the resource name of 14980// the template has the following format: 14981// projects/{project_id}/locations/{location}/workflowTemplates/{templa 14982// te_id}. 14983func (r *ProjectsRegionsWorkflowTemplatesService) Update(name string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesUpdateCall { 14984 c := &ProjectsRegionsWorkflowTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14985 c.name = name 14986 c.workflowtemplate = workflowtemplate 14987 return c 14988} 14989 14990// Fields allows partial responses to be retrieved. See 14991// https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14992// for more information. 14993func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesUpdateCall { 14994 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14995 return c 14996} 14997 14998// Context sets the context to be used in this call's Do method. Any 14999// pending HTTP request will be aborted if the provided context is 15000// canceled. 15001func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesUpdateCall { 15002 c.ctx_ = ctx 15003 return c 15004} 15005 15006// Header returns an http.Header that can be modified by the caller to 15007// add HTTP headers to the request. 15008func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Header() http.Header { 15009 if c.header_ == nil { 15010 c.header_ = make(http.Header) 15011 } 15012 return c.header_ 15013} 15014 15015func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) { 15016 reqHeaders := make(http.Header) 15017 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210502") 15018 for k, v := range c.header_ { 15019 reqHeaders[k] = v 15020 } 15021 reqHeaders.Set("User-Agent", c.s.userAgent()) 15022 var body io.Reader = nil 15023 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 15024 if err != nil { 15025 return nil, err 15026 } 15027 reqHeaders.Set("Content-Type", "application/json") 15028 c.urlParams_.Set("alt", alt) 15029 c.urlParams_.Set("prettyPrint", "false") 15030 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 15031 urls += "?" + c.urlParams_.Encode() 15032 req, err := http.NewRequest("PUT", urls, body) 15033 if err != nil { 15034 return nil, err 15035 } 15036 req.Header = reqHeaders 15037 googleapi.Expand(req.URL, map[string]string{ 15038 "name": c.name, 15039 }) 15040 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15041} 15042 15043// Do executes the "dataproc.projects.regions.workflowTemplates.update" call. 15044// Exactly one of *WorkflowTemplate or error will be non-nil. Any 15045// non-2xx status code is an error. Response headers are in either 15046// *WorkflowTemplate.ServerResponse.Header or (if a response was 15047// returned at all) in error.(*googleapi.Error).Header. Use 15048// googleapi.IsNotModified to check whether the returned error was 15049// because http.StatusNotModified was returned. 15050func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 15051 gensupport.SetOptions(c.urlParams_, opts...) 15052 res, err := c.doRequest("json") 15053 if res != nil && res.StatusCode == http.StatusNotModified { 15054 if res.Body != nil { 15055 res.Body.Close() 15056 } 15057 return nil, &googleapi.Error{ 15058 Code: res.StatusCode, 15059 Header: res.Header, 15060 } 15061 } 15062 if err != nil { 15063 return nil, err 15064 } 15065 defer googleapi.CloseBody(res) 15066 if err := googleapi.CheckResponse(res); err != nil { 15067 return nil, err 15068 } 15069 ret := &WorkflowTemplate{ 15070 ServerResponse: googleapi.ServerResponse{ 15071 Header: res.Header, 15072 HTTPStatusCode: res.StatusCode, 15073 }, 15074 } 15075 target := &ret 15076 if err := gensupport.DecodeResponse(target, res); err != nil { 15077 return nil, err 15078 } 15079 return ret, nil 15080 // { 15081 // "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version.", 15082 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}", 15083 // "httpMethod": "PUT", 15084 // "id": "dataproc.projects.regions.workflowTemplates.update", 15085 // "parameterOrder": [ 15086 // "name" 15087 // ], 15088 // "parameters": { 15089 // "name": { 15090 // "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}", 15091 // "location": "path", 15092 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 15093 // "required": true, 15094 // "type": "string" 15095 // } 15096 // }, 15097 // "path": "v1beta2/{+name}", 15098 // "request": { 15099 // "$ref": "WorkflowTemplate" 15100 // }, 15101 // "response": { 15102 // "$ref": "WorkflowTemplate" 15103 // }, 15104 // "scopes": [ 15105 // "https://www.googleapis.com/auth/cloud-platform" 15106 // ] 15107 // } 15108 15109} 15110