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. 40 package dataproc // import "google.golang.org/api/dataproc/v1beta2" 41 42 import ( 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. 63 var _ = bytes.NewBuffer 64 var _ = strconv.Itoa 65 var _ = fmt.Sprintf 66 var _ = json.NewDecoder 67 var _ = io.Copy 68 var _ = url.Parse 69 var _ = gensupport.MarshalJSON 70 var _ = googleapi.Version 71 var _ = errors.New 72 var _ = strings.Replace 73 var _ = context.Canceled 74 var _ = internaloption.WithDefaultEndpoint 75 76 const apiId = "dataproc:v1beta2" 77 const apiName = "dataproc" 78 const apiVersion = "v1beta2" 79 const basePath = "https://dataproc.googleapis.com/" 80 const mtlsBasePath = "https://dataproc.mtls.googleapis.com/" 81 82 // OAuth2 scopes used by this API. 83 const ( 84 // See, edit, configure, and delete your Google Cloud data and see the 85 // email address for your Google Account. 86 CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform" 87 ) 88 89 // NewService creates a new Service. 90 func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) { 91 scopesOption := option.WithScopes( 92 "https://www.googleapis.com/auth/cloud-platform", 93 ) 94 // NOTE: prepend, so we don't override user-specified scopes. 95 opts = append([]option.ClientOption{scopesOption}, opts...) 96 opts = append(opts, internaloption.WithDefaultEndpoint(basePath)) 97 opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath)) 98 client, endpoint, err := htransport.NewClient(ctx, opts...) 99 if err != nil { 100 return nil, err 101 } 102 s, err := New(client) 103 if err != nil { 104 return nil, err 105 } 106 if endpoint != "" { 107 s.BasePath = endpoint 108 } 109 return s, nil 110 } 111 112 // New creates a new Service. It uses the provided http.Client for requests. 113 // 114 // Deprecated: please use NewService instead. 115 // To provide a custom HTTP client, use option.WithHTTPClient. 116 // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead. 117 func New(client *http.Client) (*Service, error) { 118 if client == nil { 119 return nil, errors.New("client is nil") 120 } 121 s := &Service{client: client, BasePath: basePath} 122 s.Projects = NewProjectsService(s) 123 return s, nil 124 } 125 126 type Service struct { 127 client *http.Client 128 BasePath string // API endpoint base URL 129 UserAgent string // optional additional User-Agent fragment 130 131 Projects *ProjectsService 132 } 133 134 func (s *Service) userAgent() string { 135 if s.UserAgent == "" { 136 return googleapi.UserAgent 137 } 138 return googleapi.UserAgent + " " + s.UserAgent 139 } 140 141 func NewProjectsService(s *Service) *ProjectsService { 142 rs := &ProjectsService{s: s} 143 rs.Locations = NewProjectsLocationsService(s) 144 rs.Regions = NewProjectsRegionsService(s) 145 return rs 146 } 147 148 type ProjectsService struct { 149 s *Service 150 151 Locations *ProjectsLocationsService 152 153 Regions *ProjectsRegionsService 154 } 155 156 func NewProjectsLocationsService(s *Service) *ProjectsLocationsService { 157 rs := &ProjectsLocationsService{s: s} 158 rs.AutoscalingPolicies = NewProjectsLocationsAutoscalingPoliciesService(s) 159 rs.WorkflowTemplates = NewProjectsLocationsWorkflowTemplatesService(s) 160 return rs 161 } 162 163 type ProjectsLocationsService struct { 164 s *Service 165 166 AutoscalingPolicies *ProjectsLocationsAutoscalingPoliciesService 167 168 WorkflowTemplates *ProjectsLocationsWorkflowTemplatesService 169 } 170 171 func NewProjectsLocationsAutoscalingPoliciesService(s *Service) *ProjectsLocationsAutoscalingPoliciesService { 172 rs := &ProjectsLocationsAutoscalingPoliciesService{s: s} 173 return rs 174 } 175 176 type ProjectsLocationsAutoscalingPoliciesService struct { 177 s *Service 178 } 179 180 func NewProjectsLocationsWorkflowTemplatesService(s *Service) *ProjectsLocationsWorkflowTemplatesService { 181 rs := &ProjectsLocationsWorkflowTemplatesService{s: s} 182 return rs 183 } 184 185 type ProjectsLocationsWorkflowTemplatesService struct { 186 s *Service 187 } 188 189 func NewProjectsRegionsService(s *Service) *ProjectsRegionsService { 190 rs := &ProjectsRegionsService{s: s} 191 rs.AutoscalingPolicies = NewProjectsRegionsAutoscalingPoliciesService(s) 192 rs.Clusters = NewProjectsRegionsClustersService(s) 193 rs.Jobs = NewProjectsRegionsJobsService(s) 194 rs.Operations = NewProjectsRegionsOperationsService(s) 195 rs.WorkflowTemplates = NewProjectsRegionsWorkflowTemplatesService(s) 196 return rs 197 } 198 199 type ProjectsRegionsService struct { 200 s *Service 201 202 AutoscalingPolicies *ProjectsRegionsAutoscalingPoliciesService 203 204 Clusters *ProjectsRegionsClustersService 205 206 Jobs *ProjectsRegionsJobsService 207 208 Operations *ProjectsRegionsOperationsService 209 210 WorkflowTemplates *ProjectsRegionsWorkflowTemplatesService 211 } 212 213 func NewProjectsRegionsAutoscalingPoliciesService(s *Service) *ProjectsRegionsAutoscalingPoliciesService { 214 rs := &ProjectsRegionsAutoscalingPoliciesService{s: s} 215 return rs 216 } 217 218 type ProjectsRegionsAutoscalingPoliciesService struct { 219 s *Service 220 } 221 222 func NewProjectsRegionsClustersService(s *Service) *ProjectsRegionsClustersService { 223 rs := &ProjectsRegionsClustersService{s: s} 224 return rs 225 } 226 227 type ProjectsRegionsClustersService struct { 228 s *Service 229 } 230 231 func NewProjectsRegionsJobsService(s *Service) *ProjectsRegionsJobsService { 232 rs := &ProjectsRegionsJobsService{s: s} 233 return rs 234 } 235 236 type ProjectsRegionsJobsService struct { 237 s *Service 238 } 239 240 func NewProjectsRegionsOperationsService(s *Service) *ProjectsRegionsOperationsService { 241 rs := &ProjectsRegionsOperationsService{s: s} 242 return rs 243 } 244 245 type ProjectsRegionsOperationsService struct { 246 s *Service 247 } 248 249 func NewProjectsRegionsWorkflowTemplatesService(s *Service) *ProjectsRegionsWorkflowTemplatesService { 250 rs := &ProjectsRegionsWorkflowTemplatesService{s: s} 251 return rs 252 } 253 254 type ProjectsRegionsWorkflowTemplatesService struct { 255 s *Service 256 } 257 258 // AcceleratorConfig: Specifies the type and number of accelerator cards 259 // attached to the instances of an instance group (see GPUs on Compute 260 // Engine (https://cloud.google.com/compute/docs/gpus/)). 261 type AcceleratorConfig struct { 262 // AcceleratorCount: The number of the accelerator cards of this type 263 // exposed to this instance. 264 AcceleratorCount int64 `json:"acceleratorCount,omitempty"` 265 266 // AcceleratorTypeUri: Full URL, partial URI, or short name of the 267 // accelerator type resource to expose to this instance. See Compute 268 // Engine AcceleratorTypes 269 // (https://cloud.google.com/compute/docs/reference/beta/acceleratorTypes)Examples 270 // * 271 // https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 272 // * 273 // projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k 274 // 80 * nvidia-tesla-k80Auto Zone Exception: If you are using the 275 // Dataproc Auto Zone Placement 276 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) 277 // feature, you must use the short name of the accelerator type 278 // resource, for example, nvidia-tesla-k80. 279 AcceleratorTypeUri string `json:"acceleratorTypeUri,omitempty"` 280 281 // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to 282 // unconditionally include in API requests. By default, fields with 283 // empty or default values are omitted from API requests. However, any 284 // non-pointer, non-interface field appearing in ForceSendFields will be 285 // sent to the server regardless of whether the field is empty or not. 286 // This may be used to include empty fields in Patch requests. 287 ForceSendFields []string `json:"-"` 288 289 // NullFields is a list of field names (e.g. "AcceleratorCount") to 290 // include in API requests with the JSON null value. By default, fields 291 // with empty values are omitted from API requests. However, any field 292 // with an empty value appearing in NullFields will be sent to the 293 // server as null. It is an error if a field in this list has a 294 // non-empty value. This may be used to include null fields in Patch 295 // requests. 296 NullFields []string `json:"-"` 297 } 298 299 func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) { 300 type NoMethod AcceleratorConfig 301 raw := NoMethod(*s) 302 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 303 } 304 305 // AutoscalingConfig: Autoscaling Policy config associated with the 306 // cluster. 307 type AutoscalingConfig struct { 308 // PolicyUri: Optional. The autoscaling policy used by the cluster.Only 309 // resource names including projectid and location (region) are valid. 310 // Examples: 311 // https://www.googleapis.com/compute/v1/projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id] 312 // projects/[project_id]/locations/[dataproc_region]/autoscalingPolicies/ 313 // [policy_id]Note that the policy must be in the same project and 314 // Dataproc region. 315 PolicyUri string `json:"policyUri,omitempty"` 316 317 // ForceSendFields is a list of field names (e.g. "PolicyUri") to 318 // unconditionally include in API requests. By default, fields with 319 // empty or default values are omitted from API requests. However, any 320 // non-pointer, non-interface field appearing in ForceSendFields will be 321 // sent to the server regardless of whether the field is empty or not. 322 // This may be used to include empty fields in Patch requests. 323 ForceSendFields []string `json:"-"` 324 325 // NullFields is a list of field names (e.g. "PolicyUri") to include in 326 // API requests with the JSON null value. By default, fields with empty 327 // values are omitted from API requests. However, any field with an 328 // empty value appearing in NullFields will be sent to the server as 329 // null. It is an error if a field in this list has a non-empty value. 330 // This may be used to include null fields in Patch requests. 331 NullFields []string `json:"-"` 332 } 333 334 func (s *AutoscalingConfig) MarshalJSON() ([]byte, error) { 335 type NoMethod AutoscalingConfig 336 raw := NoMethod(*s) 337 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 338 } 339 340 // AutoscalingPolicy: Describes an autoscaling policy for Dataproc 341 // cluster autoscaler. 342 type AutoscalingPolicy struct { 343 BasicAlgorithm *BasicAutoscalingAlgorithm `json:"basicAlgorithm,omitempty"` 344 345 // Id: Required. The policy id.The id must contain only letters (a-z, 346 // A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin 347 // or end with underscore or hyphen. Must consist of between 3 and 50 348 // characters. 349 Id string `json:"id,omitempty"` 350 351 // Name: Output only. The "resource name" of the autoscaling policy, as 352 // described in https://cloud.google.com/apis/design/resource_names. For 353 // projects.regions.autoscalingPolicies, the resource name of the policy 354 // has the following format: 355 // projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id} 356 // For projects.locations.autoscalingPolicies, the resource name of the 357 // policy has the following format: 358 // projects/{project_id}/locations/{location}/autoscalingPolicies/{policy 359 // _id} 360 Name string `json:"name,omitempty"` 361 362 // SecondaryWorkerConfig: Optional. Describes how the autoscaler will 363 // operate for secondary workers. 364 SecondaryWorkerConfig *InstanceGroupAutoscalingPolicyConfig `json:"secondaryWorkerConfig,omitempty"` 365 366 // WorkerConfig: Required. Describes how the autoscaler will operate for 367 // primary workers. 368 WorkerConfig *InstanceGroupAutoscalingPolicyConfig `json:"workerConfig,omitempty"` 369 370 // ServerResponse contains the HTTP response code and headers from the 371 // server. 372 googleapi.ServerResponse `json:"-"` 373 374 // ForceSendFields is a list of field names (e.g. "BasicAlgorithm") to 375 // unconditionally include in API requests. By default, fields with 376 // empty or default values are omitted from API requests. However, any 377 // non-pointer, non-interface field appearing in ForceSendFields will be 378 // sent to the server regardless of whether the field is empty or not. 379 // This may be used to include empty fields in Patch requests. 380 ForceSendFields []string `json:"-"` 381 382 // NullFields is a list of field names (e.g. "BasicAlgorithm") to 383 // include in API requests with the JSON null value. By default, fields 384 // with empty values are omitted from API requests. However, any field 385 // with an empty value appearing in NullFields will be sent to the 386 // server as null. It is an error if a field in this list has a 387 // non-empty value. This may be used to include null fields in Patch 388 // requests. 389 NullFields []string `json:"-"` 390 } 391 392 func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) { 393 type NoMethod AutoscalingPolicy 394 raw := NoMethod(*s) 395 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 396 } 397 398 // BasicAutoscalingAlgorithm: Basic algorithm for autoscaling. 399 type BasicAutoscalingAlgorithm struct { 400 // CooldownPeriod: Optional. Duration between scaling events. A scaling 401 // period starts after the update operation from the previous event has 402 // completed.Bounds: 2m, 1d. Default: 2m. 403 CooldownPeriod string `json:"cooldownPeriod,omitempty"` 404 405 // YarnConfig: Optional. YARN autoscaling configuration. 406 YarnConfig *BasicYarnAutoscalingConfig `json:"yarnConfig,omitempty"` 407 408 // ForceSendFields is a list of field names (e.g. "CooldownPeriod") to 409 // unconditionally include in API requests. By default, fields with 410 // empty or default values are omitted from API requests. However, any 411 // non-pointer, non-interface field appearing in ForceSendFields will be 412 // sent to the server regardless of whether the field is empty or not. 413 // This may be used to include empty fields in Patch requests. 414 ForceSendFields []string `json:"-"` 415 416 // NullFields is a list of field names (e.g. "CooldownPeriod") to 417 // include in API requests with the JSON null value. By default, fields 418 // with empty values are omitted from API requests. However, any field 419 // with an empty value appearing in NullFields will be sent to the 420 // server as null. It is an error if a field in this list has a 421 // non-empty value. This may be used to include null fields in Patch 422 // requests. 423 NullFields []string `json:"-"` 424 } 425 426 func (s *BasicAutoscalingAlgorithm) MarshalJSON() ([]byte, error) { 427 type NoMethod BasicAutoscalingAlgorithm 428 raw := NoMethod(*s) 429 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 430 } 431 432 // BasicYarnAutoscalingConfig: Basic autoscaling configurations for 433 // YARN. 434 type BasicYarnAutoscalingConfig struct { 435 // GracefulDecommissionTimeout: Required. Timeout for YARN graceful 436 // decommissioning of Node Managers. Specifies the duration to wait for 437 // jobs to complete before forcefully removing workers (and potentially 438 // interrupting jobs). Only applicable to downscaling operations.Bounds: 439 // 0s, 1d. 440 GracefulDecommissionTimeout string `json:"gracefulDecommissionTimeout,omitempty"` 441 442 // ScaleDownFactor: Required. Fraction of average YARN pending memory in 443 // the last cooldown period for which to remove workers. A scale-down 444 // factor of 1 will result in scaling down so that there is no available 445 // memory remaining after the update (more aggressive scaling). A 446 // scale-down factor of 0 disables removing workers, which can be 447 // beneficial for autoscaling a single job. See How autoscaling works 448 // for more information.Bounds: 0.0, 1.0. 449 ScaleDownFactor float64 `json:"scaleDownFactor,omitempty"` 450 451 // ScaleDownMinWorkerFraction: Optional. Minimum scale-down threshold as 452 // a fraction of total cluster size before scaling occurs. For example, 453 // in a 20-worker cluster, a threshold of 0.1 means the autoscaler must 454 // recommend at least a 2 worker scale-down for the cluster to scale. A 455 // threshold of 0 means the autoscaler will scale down on any 456 // recommended change.Bounds: 0.0, 1.0. Default: 0.0. 457 ScaleDownMinWorkerFraction float64 `json:"scaleDownMinWorkerFraction,omitempty"` 458 459 // ScaleUpFactor: Required. Fraction of average YARN pending memory in 460 // the last cooldown period for which to add workers. A scale-up factor 461 // of 1.0 will result in scaling up so that there is no pending memory 462 // remaining after the update (more aggressive scaling). A scale-up 463 // factor closer to 0 will result in a smaller magnitude of scaling up 464 // (less aggressive scaling). See How autoscaling works for more 465 // information.Bounds: 0.0, 1.0. 466 ScaleUpFactor float64 `json:"scaleUpFactor,omitempty"` 467 468 // ScaleUpMinWorkerFraction: Optional. Minimum scale-up threshold as a 469 // fraction of total cluster size before scaling occurs. For example, in 470 // a 20-worker cluster, a threshold of 0.1 means the autoscaler must 471 // recommend at least a 2-worker scale-up for the cluster to scale. A 472 // threshold of 0 means the autoscaler will scale up on any recommended 473 // change.Bounds: 0.0, 1.0. Default: 0.0. 474 ScaleUpMinWorkerFraction float64 `json:"scaleUpMinWorkerFraction,omitempty"` 475 476 // ForceSendFields is a list of field names (e.g. 477 // "GracefulDecommissionTimeout") to unconditionally include in API 478 // requests. By default, fields with empty or default values are omitted 479 // from API requests. However, any non-pointer, non-interface field 480 // appearing in ForceSendFields will be sent to the server regardless of 481 // whether the field is empty or not. This may be used to include empty 482 // fields in Patch requests. 483 ForceSendFields []string `json:"-"` 484 485 // NullFields is a list of field names (e.g. 486 // "GracefulDecommissionTimeout") to include in API requests with the 487 // JSON null value. By default, fields with empty values are omitted 488 // from API requests. However, any field with an empty value appearing 489 // in NullFields will be sent to the server as null. It is an error if a 490 // field in this list has a non-empty value. This may be used to include 491 // null fields in Patch requests. 492 NullFields []string `json:"-"` 493 } 494 495 func (s *BasicYarnAutoscalingConfig) MarshalJSON() ([]byte, error) { 496 type NoMethod BasicYarnAutoscalingConfig 497 raw := NoMethod(*s) 498 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 499 } 500 501 func (s *BasicYarnAutoscalingConfig) UnmarshalJSON(data []byte) error { 502 type NoMethod BasicYarnAutoscalingConfig 503 var s1 struct { 504 ScaleDownFactor gensupport.JSONFloat64 `json:"scaleDownFactor"` 505 ScaleDownMinWorkerFraction gensupport.JSONFloat64 `json:"scaleDownMinWorkerFraction"` 506 ScaleUpFactor gensupport.JSONFloat64 `json:"scaleUpFactor"` 507 ScaleUpMinWorkerFraction gensupport.JSONFloat64 `json:"scaleUpMinWorkerFraction"` 508 *NoMethod 509 } 510 s1.NoMethod = (*NoMethod)(s) 511 if err := json.Unmarshal(data, &s1); err != nil { 512 return err 513 } 514 s.ScaleDownFactor = float64(s1.ScaleDownFactor) 515 s.ScaleDownMinWorkerFraction = float64(s1.ScaleDownMinWorkerFraction) 516 s.ScaleUpFactor = float64(s1.ScaleUpFactor) 517 s.ScaleUpMinWorkerFraction = float64(s1.ScaleUpMinWorkerFraction) 518 return nil 519 } 520 521 // Binding: Associates members with a role. 522 type Binding struct { 523 // Condition: The condition that is associated with this binding.If the 524 // condition evaluates to true, then this binding applies to the current 525 // request.If the condition evaluates to false, then this binding does 526 // not apply to the current request. However, a different role binding 527 // might grant the same role to one or more of the members in this 528 // binding.To learn which resources support conditions in their IAM 529 // policies, see the IAM documentation 530 // (https://cloud.google.com/iam/help/conditions/resource-policies). 531 Condition *Expr `json:"condition,omitempty"` 532 533 // Members: Specifies the identities requesting access for a Cloud 534 // Platform resource. members can have the following values: allUsers: A 535 // special identifier that represents anyone who is on the internet; 536 // with or without a Google account. allAuthenticatedUsers: A special 537 // identifier that represents anyone who is authenticated with a Google 538 // account or a service account. user:{emailid}: An email address that 539 // represents a specific Google account. For example, alice@example.com 540 // . serviceAccount:{emailid}: An email address that represents a 541 // service account. For example, 542 // my-other-app@appspot.gserviceaccount.com. group:{emailid}: An email 543 // address that represents a Google group. For example, 544 // admins@example.com. deleted:user:{emailid}?uid={uniqueid}: An email 545 // address (plus unique identifier) representing a user that has been 546 // recently deleted. For example, 547 // alice@example.com?uid=123456789012345678901. If the user is 548 // recovered, this value reverts to user:{emailid} and the recovered 549 // user retains the role in the binding. 550 // deleted:serviceAccount:{emailid}?uid={uniqueid}: An email address 551 // (plus unique identifier) representing a service account that has been 552 // recently deleted. For example, 553 // my-other-app@appspot.gserviceaccount.com?uid=123456789012345678901. 554 // If the service account is undeleted, this value reverts to 555 // serviceAccount:{emailid} and the undeleted service account retains 556 // the role in the binding. deleted:group:{emailid}?uid={uniqueid}: An 557 // email address (plus unique identifier) representing a Google group 558 // that has been recently deleted. For example, 559 // admins@example.com?uid=123456789012345678901. If the group is 560 // recovered, this value reverts to group:{emailid} and the recovered 561 // group retains the role in the binding. domain:{domain}: The G Suite 562 // domain (primary) that represents all the users of that domain. For 563 // example, google.com or example.com. 564 Members []string `json:"members,omitempty"` 565 566 // Role: Role that is assigned to members. For example, roles/viewer, 567 // roles/editor, or roles/owner. 568 Role string `json:"role,omitempty"` 569 570 // ForceSendFields is a list of field names (e.g. "Condition") to 571 // unconditionally include in API requests. By default, fields with 572 // empty or default values are omitted from API requests. However, any 573 // non-pointer, non-interface field appearing in ForceSendFields will be 574 // sent to the server regardless of whether the field is empty or not. 575 // This may be used to include empty fields in Patch requests. 576 ForceSendFields []string `json:"-"` 577 578 // NullFields is a list of field names (e.g. "Condition") to include in 579 // API requests with the JSON null value. By default, fields with empty 580 // values are omitted from API requests. However, any field with an 581 // empty value appearing in NullFields will be sent to the server as 582 // null. It is an error if a field in this list has a non-empty value. 583 // This may be used to include null fields in Patch requests. 584 NullFields []string `json:"-"` 585 } 586 587 func (s *Binding) MarshalJSON() ([]byte, error) { 588 type NoMethod Binding 589 raw := NoMethod(*s) 590 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 591 } 592 593 // CancelJobRequest: A request to cancel a job. 594 type CancelJobRequest struct { 595 } 596 597 // Cluster: Describes the identifying information, config, and status of 598 // a cluster of Compute Engine instances. 599 type Cluster struct { 600 // ClusterName: Required. The cluster name. Cluster names within a 601 // project must be unique. Names of deleted clusters can be reused. 602 ClusterName string `json:"clusterName,omitempty"` 603 604 // ClusterUuid: Output only. A cluster UUID (Unique Universal 605 // Identifier). Dataproc generates this value when it creates the 606 // cluster. 607 ClusterUuid string `json:"clusterUuid,omitempty"` 608 609 // Config: Required. The cluster config. Note that Dataproc may set 610 // default values, and values may change when clusters are updated. 611 Config *ClusterConfig `json:"config,omitempty"` 612 613 // Labels: Optional. The labels to associate with this cluster. Label 614 // keys must contain 1 to 63 characters, and must conform to RFC 1035 615 // (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, 616 // but, if present, must contain 1 to 63 characters, and must conform to 617 // RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 618 // labels can be associated with a cluster. 619 Labels map[string]string `json:"labels,omitempty"` 620 621 // Metrics: Output only. Contains cluster daemon metrics such as HDFS 622 // and YARN stats.Beta Feature: This report is available for testing 623 // purposes only. It may be changed before final release. 624 Metrics *ClusterMetrics `json:"metrics,omitempty"` 625 626 // ProjectId: Required. The Google Cloud Platform project ID that the 627 // cluster belongs to. 628 ProjectId string `json:"projectId,omitempty"` 629 630 // Status: Output only. Cluster status. 631 Status *ClusterStatus `json:"status,omitempty"` 632 633 // StatusHistory: Output only. The previous cluster status. 634 StatusHistory []*ClusterStatus `json:"statusHistory,omitempty"` 635 636 // ServerResponse contains the HTTP response code and headers from the 637 // server. 638 googleapi.ServerResponse `json:"-"` 639 640 // ForceSendFields is a list of field names (e.g. "ClusterName") to 641 // unconditionally include in API requests. By default, fields with 642 // empty or default values are omitted from API requests. However, any 643 // non-pointer, non-interface field appearing in ForceSendFields will be 644 // sent to the server regardless of whether the field is empty or not. 645 // This may be used to include empty fields in Patch requests. 646 ForceSendFields []string `json:"-"` 647 648 // NullFields is a list of field names (e.g. "ClusterName") to include 649 // in API requests with the JSON null value. By default, fields with 650 // empty values are omitted from API requests. However, any field with 651 // an empty value appearing in NullFields will be sent to the server as 652 // null. It is an error if a field in this list has a non-empty value. 653 // This may be used to include null fields in Patch requests. 654 NullFields []string `json:"-"` 655 } 656 657 func (s *Cluster) MarshalJSON() ([]byte, error) { 658 type NoMethod Cluster 659 raw := NoMethod(*s) 660 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 661 } 662 663 // ClusterConfig: The cluster config. 664 type ClusterConfig struct { 665 // AutoscalingConfig: Optional. Autoscaling config for the policy 666 // associated with the cluster. Cluster does not autoscale if this field 667 // is unset. 668 AutoscalingConfig *AutoscalingConfig `json:"autoscalingConfig,omitempty"` 669 670 // ConfigBucket: Optional. A Cloud Storage bucket used to stage job 671 // dependencies, config files, and job driver console output. If you do 672 // not specify a staging bucket, Cloud Dataproc will determine a Cloud 673 // Storage location (US, ASIA, or EU) for your cluster's staging bucket 674 // according to the Compute Engine zone where your cluster is deployed, 675 // and then create and manage this project-level, per-location bucket 676 // (see Dataproc staging bucket 677 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)). 678 // This field requires a Cloud Storage bucket name, not a URI to a Cloud 679 // Storage bucket. 680 ConfigBucket string `json:"configBucket,omitempty"` 681 682 // EncryptionConfig: Optional. Encryption settings for the cluster. 683 EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"` 684 685 // EndpointConfig: Optional. Port/endpoint configuration for this 686 // cluster 687 EndpointConfig *EndpointConfig `json:"endpointConfig,omitempty"` 688 689 // GceClusterConfig: Optional. The shared Compute Engine config settings 690 // for all instances in a cluster. 691 GceClusterConfig *GceClusterConfig `json:"gceClusterConfig,omitempty"` 692 693 // GkeClusterConfig: Optional. The Kubernetes Engine config for Dataproc 694 // clusters deployed to Kubernetes. Setting this is considered mutually 695 // exclusive with Compute Engine-based options such as 696 // gce_cluster_config, master_config, worker_config, 697 // secondary_worker_config, and autoscaling_config. 698 GkeClusterConfig *GkeClusterConfig `json:"gkeClusterConfig,omitempty"` 699 700 // InitializationActions: Optional. Commands to execute on each node 701 // after config is completed. By default, executables are run on master 702 // and all worker nodes. You can test a node's role metadata to run an 703 // executable on a master or worker node, as shown below using curl (you 704 // can also use wget): ROLE=$(curl -H Metadata-Flavor:Google 705 // http://metadata/computeMetadata/v1beta2/instance/attributes/dataproc-role) 706 // if [[ "${ROLE}" == 'Master' ]]; then ... master specific actions ... 707 // else ... worker specific actions ... fi 708 InitializationActions []*NodeInitializationAction `json:"initializationActions,omitempty"` 709 710 // LifecycleConfig: Optional. The config setting for auto delete cluster 711 // schedule. 712 LifecycleConfig *LifecycleConfig `json:"lifecycleConfig,omitempty"` 713 714 // MasterConfig: Optional. The Compute Engine config settings for the 715 // master instance in a cluster. 716 MasterConfig *InstanceGroupConfig `json:"masterConfig,omitempty"` 717 718 // MetastoreConfig: Optional. Metastore configuration. 719 MetastoreConfig *MetastoreConfig `json:"metastoreConfig,omitempty"` 720 721 // SecondaryWorkerConfig: Optional. The Compute Engine config settings 722 // for additional worker instances in a cluster. 723 SecondaryWorkerConfig *InstanceGroupConfig `json:"secondaryWorkerConfig,omitempty"` 724 725 // SecurityConfig: Optional. Security related configuration. 726 SecurityConfig *SecurityConfig `json:"securityConfig,omitempty"` 727 728 // SoftwareConfig: Optional. The config settings for software inside the 729 // cluster. 730 SoftwareConfig *SoftwareConfig `json:"softwareConfig,omitempty"` 731 732 // TempBucket: Optional. A Cloud Storage bucket used to store ephemeral 733 // cluster and jobs data, such as Spark and MapReduce history files. If 734 // you do not specify a temp bucket, Dataproc will determine a Cloud 735 // Storage location (US, ASIA, or EU) for your cluster's temp bucket 736 // according to the Compute Engine zone where your cluster is deployed, 737 // and then create and manage this project-level, per-location bucket. 738 // The default bucket has a TTL of 90 days, but you can use any TTL (or 739 // none) if you specify a bucket. This field requires a Cloud Storage 740 // bucket name, not a URI to a Cloud Storage bucket. 741 TempBucket string `json:"tempBucket,omitempty"` 742 743 // WorkerConfig: Optional. The Compute Engine config settings for worker 744 // instances in a cluster. 745 WorkerConfig *InstanceGroupConfig `json:"workerConfig,omitempty"` 746 747 // ForceSendFields is a list of field names (e.g. "AutoscalingConfig") 748 // to unconditionally include in API requests. By default, fields with 749 // empty or default values are omitted from API requests. However, any 750 // non-pointer, non-interface field appearing in ForceSendFields will be 751 // sent to the server regardless of whether the field is empty or not. 752 // This may be used to include empty fields in Patch requests. 753 ForceSendFields []string `json:"-"` 754 755 // NullFields is a list of field names (e.g. "AutoscalingConfig") to 756 // include in API requests with the JSON null value. By default, fields 757 // with empty values are omitted from API requests. However, any field 758 // with an empty value appearing in NullFields will be sent to the 759 // server as null. It is an error if a field in this list has a 760 // non-empty value. This may be used to include null fields in Patch 761 // requests. 762 NullFields []string `json:"-"` 763 } 764 765 func (s *ClusterConfig) MarshalJSON() ([]byte, error) { 766 type NoMethod ClusterConfig 767 raw := NoMethod(*s) 768 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 769 } 770 771 // ClusterMetrics: Contains cluster daemon metrics, such as HDFS and 772 // YARN stats.Beta Feature: This report is available for testing 773 // purposes only. It may be changed before final release. 774 type ClusterMetrics struct { 775 // HdfsMetrics: The HDFS metrics. 776 HdfsMetrics map[string]string `json:"hdfsMetrics,omitempty"` 777 778 // YarnMetrics: The YARN metrics. 779 YarnMetrics map[string]string `json:"yarnMetrics,omitempty"` 780 781 // ForceSendFields is a list of field names (e.g. "HdfsMetrics") to 782 // unconditionally include in API requests. By default, fields with 783 // empty or default values are omitted from API requests. However, any 784 // non-pointer, non-interface field appearing in ForceSendFields will be 785 // sent to the server regardless of whether the field is empty or not. 786 // This may be used to include empty fields in Patch requests. 787 ForceSendFields []string `json:"-"` 788 789 // NullFields is a list of field names (e.g. "HdfsMetrics") to include 790 // in API requests with the JSON null value. By default, fields with 791 // empty values are omitted from API requests. However, any field with 792 // an empty value appearing in NullFields will be sent to the server as 793 // null. It is an error if a field in this list has a non-empty value. 794 // This may be used to include null fields in Patch requests. 795 NullFields []string `json:"-"` 796 } 797 798 func (s *ClusterMetrics) MarshalJSON() ([]byte, error) { 799 type NoMethod ClusterMetrics 800 raw := NoMethod(*s) 801 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 802 } 803 804 // ClusterOperation: The cluster operation triggered by a workflow. 805 type ClusterOperation struct { 806 // Done: Output only. Indicates the operation is done. 807 Done bool `json:"done,omitempty"` 808 809 // Error: Output only. Error, if operation failed. 810 Error string `json:"error,omitempty"` 811 812 // OperationId: Output only. The id of the cluster operation. 813 OperationId string `json:"operationId,omitempty"` 814 815 // ForceSendFields is a list of field names (e.g. "Done") to 816 // unconditionally include in API requests. By default, fields with 817 // empty or default values are omitted from API requests. However, any 818 // non-pointer, non-interface field appearing in ForceSendFields will be 819 // sent to the server regardless of whether the field is empty or not. 820 // This may be used to include empty fields in Patch requests. 821 ForceSendFields []string `json:"-"` 822 823 // NullFields is a list of field names (e.g. "Done") to include in API 824 // requests with the JSON null value. By default, fields with empty 825 // values are omitted from API requests. However, any field with an 826 // empty value appearing in NullFields will be sent to the server as 827 // null. It is an error if a field in this list has a non-empty value. 828 // This may be used to include null fields in Patch requests. 829 NullFields []string `json:"-"` 830 } 831 832 func (s *ClusterOperation) MarshalJSON() ([]byte, error) { 833 type NoMethod ClusterOperation 834 raw := NoMethod(*s) 835 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 836 } 837 838 // ClusterOperationMetadata: Metadata describing the operation. 839 type ClusterOperationMetadata struct { 840 // ClusterName: Output only. Name of the cluster for the operation. 841 ClusterName string `json:"clusterName,omitempty"` 842 843 // ClusterUuid: Output only. Cluster UUID for the operation. 844 ClusterUuid string `json:"clusterUuid,omitempty"` 845 846 // Description: Output only. Short description of operation. 847 Description string `json:"description,omitempty"` 848 849 // Labels: Output only. Labels associated with the operation 850 Labels map[string]string `json:"labels,omitempty"` 851 852 // OperationType: Output only. The operation type. 853 OperationType string `json:"operationType,omitempty"` 854 855 // Status: Output only. Current operation status. 856 Status *ClusterOperationStatus `json:"status,omitempty"` 857 858 // StatusHistory: Output only. The previous operation status. 859 StatusHistory []*ClusterOperationStatus `json:"statusHistory,omitempty"` 860 861 // Warnings: Output only. Errors encountered during operation execution. 862 Warnings []string `json:"warnings,omitempty"` 863 864 // ForceSendFields is a list of field names (e.g. "ClusterName") to 865 // unconditionally include in API requests. By default, fields with 866 // empty or default values are omitted from API requests. However, any 867 // non-pointer, non-interface field appearing in ForceSendFields will be 868 // sent to the server regardless of whether the field is empty or not. 869 // This may be used to include empty fields in Patch requests. 870 ForceSendFields []string `json:"-"` 871 872 // NullFields is a list of field names (e.g. "ClusterName") to include 873 // in API requests with the JSON null value. By default, fields with 874 // empty values are omitted from API requests. However, any field with 875 // an empty value appearing in NullFields will be sent to the server as 876 // null. It is an error if a field in this list has a non-empty value. 877 // This may be used to include null fields in Patch requests. 878 NullFields []string `json:"-"` 879 } 880 881 func (s *ClusterOperationMetadata) MarshalJSON() ([]byte, error) { 882 type NoMethod ClusterOperationMetadata 883 raw := NoMethod(*s) 884 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 885 } 886 887 // ClusterOperationStatus: The status of the operation. 888 type ClusterOperationStatus struct { 889 // Details: Output only. A message containing any operation metadata 890 // details. 891 Details string `json:"details,omitempty"` 892 893 // InnerState: Output only. A message containing the detailed operation 894 // state. 895 InnerState string `json:"innerState,omitempty"` 896 897 // State: Output only. A message containing the operation state. 898 // 899 // Possible values: 900 // "UNKNOWN" - Unused. 901 // "PENDING" - The operation has been created. 902 // "RUNNING" - The operation is running. 903 // "DONE" - The operation is done; either cancelled or completed. 904 State string `json:"state,omitempty"` 905 906 // StateStartTime: Output only. The time this state was entered. 907 StateStartTime string `json:"stateStartTime,omitempty"` 908 909 // ForceSendFields is a list of field names (e.g. "Details") to 910 // unconditionally include in API requests. By default, fields with 911 // empty or default values are omitted from API requests. However, any 912 // non-pointer, non-interface field appearing in ForceSendFields will be 913 // sent to the server regardless of whether the field is empty or not. 914 // This may be used to include empty fields in Patch requests. 915 ForceSendFields []string `json:"-"` 916 917 // NullFields is a list of field names (e.g. "Details") to include in 918 // API requests with the JSON null value. By default, fields with empty 919 // values are omitted from API requests. However, any field with an 920 // empty value appearing in NullFields will be sent to the server as 921 // null. It is an error if a field in this list has a non-empty value. 922 // This may be used to include null fields in Patch requests. 923 NullFields []string `json:"-"` 924 } 925 926 func (s *ClusterOperationStatus) MarshalJSON() ([]byte, error) { 927 type NoMethod ClusterOperationStatus 928 raw := NoMethod(*s) 929 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 930 } 931 932 // ClusterSelector: A selector that chooses target cluster for jobs 933 // based on metadata. 934 type ClusterSelector struct { 935 // ClusterLabels: Required. The cluster labels. Cluster must have all 936 // labels to match. 937 ClusterLabels map[string]string `json:"clusterLabels,omitempty"` 938 939 // Zone: Optional. The zone where workflow process executes. This 940 // parameter does not affect the selection of the cluster.If 941 // unspecified, the zone of the first cluster matching the selector is 942 // used. 943 Zone string `json:"zone,omitempty"` 944 945 // ForceSendFields is a list of field names (e.g. "ClusterLabels") to 946 // unconditionally include in API requests. By default, fields with 947 // empty or default values are omitted from API requests. However, any 948 // non-pointer, non-interface field appearing in ForceSendFields will be 949 // sent to the server regardless of whether the field is empty or not. 950 // This may be used to include empty fields in Patch requests. 951 ForceSendFields []string `json:"-"` 952 953 // NullFields is a list of field names (e.g. "ClusterLabels") to include 954 // in API requests with the JSON null value. By default, fields with 955 // empty values are omitted from API requests. However, any field with 956 // an empty value appearing in NullFields will be sent to the server as 957 // null. It is an error if a field in this list has a non-empty value. 958 // This may be used to include null fields in Patch requests. 959 NullFields []string `json:"-"` 960 } 961 962 func (s *ClusterSelector) MarshalJSON() ([]byte, error) { 963 type NoMethod ClusterSelector 964 raw := NoMethod(*s) 965 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 966 } 967 968 // ClusterStatus: The status of a cluster and its instances. 969 type ClusterStatus struct { 970 // Detail: Output only. Optional details of cluster's state. 971 Detail string `json:"detail,omitempty"` 972 973 // State: Output only. The cluster's state. 974 // 975 // Possible values: 976 // "UNKNOWN" - The cluster state is unknown. 977 // "CREATING" - The cluster is being created and set up. It is not 978 // ready for use. 979 // "RUNNING" - The cluster is currently running and healthy. It is 980 // ready for use. 981 // "ERROR" - The cluster encountered an error. It is not ready for 982 // use. 983 // "ERROR_DUE_TO_UPDATE" - The cluster has encountered an error while 984 // being updated. Jobs can be submitted to the cluster, but the cluster 985 // cannot be updated. 986 // "DELETING" - The cluster is being deleted. It cannot be used. 987 // "UPDATING" - The cluster is being updated. It continues to accept 988 // and process jobs. 989 // "STOPPING" - The cluster is being stopped. It cannot be used. 990 // "STOPPED" - The cluster is currently stopped. It is not ready for 991 // use. 992 // "STARTING" - The cluster is being started. It is not ready for use. 993 State string `json:"state,omitempty"` 994 995 // StateStartTime: Output only. Time when this state was entered (see 996 // JSON representation of Timestamp 997 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 998 StateStartTime string `json:"stateStartTime,omitempty"` 999 1000 // Substate: Output only. Additional state information that includes 1001 // status reported by the agent. 1002 // 1003 // Possible values: 1004 // "UNSPECIFIED" - The cluster substate is unknown. 1005 // "UNHEALTHY" - The cluster is known to be in an unhealthy state (for 1006 // example, critical daemons are not running or HDFS capacity is 1007 // exhausted).Applies to RUNNING state. 1008 // "STALE_STATUS" - The agent-reported status is out of date (may 1009 // occur if Dataproc loses communication with Agent).Applies to RUNNING 1010 // state. 1011 Substate string `json:"substate,omitempty"` 1012 1013 // ForceSendFields is a list of field names (e.g. "Detail") to 1014 // unconditionally include in API requests. By default, fields with 1015 // empty or default values are omitted from API requests. However, any 1016 // non-pointer, non-interface field appearing in ForceSendFields will be 1017 // sent to the server regardless of whether the field is empty or not. 1018 // This may be used to include empty fields in Patch requests. 1019 ForceSendFields []string `json:"-"` 1020 1021 // NullFields is a list of field names (e.g. "Detail") to include in API 1022 // requests with the JSON null value. By default, fields with empty 1023 // values are omitted from API requests. However, any field with an 1024 // empty value appearing in NullFields will be sent to the server as 1025 // null. It is an error if a field in this list has a non-empty value. 1026 // This may be used to include null fields in Patch requests. 1027 NullFields []string `json:"-"` 1028 } 1029 1030 func (s *ClusterStatus) MarshalJSON() ([]byte, error) { 1031 type NoMethod ClusterStatus 1032 raw := NoMethod(*s) 1033 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1034 } 1035 1036 // DiagnoseClusterRequest: A request to collect cluster diagnostic 1037 // information. 1038 type DiagnoseClusterRequest struct { 1039 } 1040 1041 // DiagnoseClusterResults: The location of diagnostic output. 1042 type DiagnoseClusterResults struct { 1043 // OutputUri: Output only. The Cloud Storage URI of the diagnostic 1044 // output. The output report is a plain text file with a summary of 1045 // collected diagnostics. 1046 OutputUri string `json:"outputUri,omitempty"` 1047 1048 // ForceSendFields is a list of field names (e.g. "OutputUri") to 1049 // unconditionally include in API requests. By default, fields with 1050 // empty or default values are omitted from API requests. However, any 1051 // non-pointer, non-interface field appearing in ForceSendFields will be 1052 // sent to the server regardless of whether the field is empty or not. 1053 // This may be used to include empty fields in Patch requests. 1054 ForceSendFields []string `json:"-"` 1055 1056 // NullFields is a list of field names (e.g. "OutputUri") to include in 1057 // API requests with the JSON null value. By default, fields with empty 1058 // values are omitted from API requests. However, any field with an 1059 // empty value appearing in NullFields will be sent to the server as 1060 // null. It is an error if a field in this list has a non-empty value. 1061 // This may be used to include null fields in Patch requests. 1062 NullFields []string `json:"-"` 1063 } 1064 1065 func (s *DiagnoseClusterResults) MarshalJSON() ([]byte, error) { 1066 type NoMethod DiagnoseClusterResults 1067 raw := NoMethod(*s) 1068 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1069 } 1070 1071 // DiskConfig: Specifies the config of disk options for a group of VM 1072 // instances. 1073 type DiskConfig struct { 1074 // BootDiskSizeGb: Optional. Size in GB of the boot disk (default is 1075 // 500GB). 1076 BootDiskSizeGb int64 `json:"bootDiskSizeGb,omitempty"` 1077 1078 // BootDiskType: Optional. Type of the boot disk (default is 1079 // "pd-standard"). Valid values: "pd-balanced" (Persistent Disk Balanced 1080 // Solid State Drive), "pd-ssd" (Persistent Disk Solid State Drive), or 1081 // "pd-standard" (Persistent Disk Hard Disk Drive). See Disk types 1082 // (https://cloud.google.com/compute/docs/disks#disk-types). 1083 BootDiskType string `json:"bootDiskType,omitempty"` 1084 1085 // NumLocalSsds: Number of attached SSDs, from 0 to 4 (default is 0). If 1086 // SSDs are not attached, the boot disk is used to store runtime logs 1087 // and HDFS (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) 1088 // data. If one or more SSDs are attached, this runtime bulk data is 1089 // spread across them, and the boot disk contains only basic config and 1090 // installed binaries. 1091 NumLocalSsds int64 `json:"numLocalSsds,omitempty"` 1092 1093 // ForceSendFields is a list of field names (e.g. "BootDiskSizeGb") to 1094 // unconditionally include in API requests. By default, fields with 1095 // empty or default values are omitted from API requests. However, any 1096 // non-pointer, non-interface field appearing in ForceSendFields will be 1097 // sent to the server regardless of whether the field is empty or not. 1098 // This may be used to include empty fields in Patch requests. 1099 ForceSendFields []string `json:"-"` 1100 1101 // NullFields is a list of field names (e.g. "BootDiskSizeGb") to 1102 // include in API requests with the JSON null value. By default, fields 1103 // with empty values are omitted from API requests. However, any field 1104 // with an empty value appearing in NullFields will be sent to the 1105 // server as null. It is an error if a field in this list has a 1106 // non-empty value. This may be used to include null fields in Patch 1107 // requests. 1108 NullFields []string `json:"-"` 1109 } 1110 1111 func (s *DiskConfig) MarshalJSON() ([]byte, error) { 1112 type NoMethod DiskConfig 1113 raw := NoMethod(*s) 1114 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1115 } 1116 1117 // Empty: A generic empty message that you can re-use to avoid defining 1118 // duplicated empty messages in your APIs. A typical example is to use 1119 // it as the request or the response type of an API method. For 1120 // instance: service Foo { rpc Bar(google.protobuf.Empty) returns 1121 // (google.protobuf.Empty); } The JSON representation for Empty is empty 1122 // JSON object {}. 1123 type Empty struct { 1124 // ServerResponse contains the HTTP response code and headers from the 1125 // server. 1126 googleapi.ServerResponse `json:"-"` 1127 } 1128 1129 // EncryptionConfig: Encryption settings for the cluster. 1130 type EncryptionConfig struct { 1131 // GcePdKmsKeyName: Optional. The Cloud KMS key name to use for PD disk 1132 // encryption for all instances in the cluster. 1133 GcePdKmsKeyName string `json:"gcePdKmsKeyName,omitempty"` 1134 1135 // ForceSendFields is a list of field names (e.g. "GcePdKmsKeyName") to 1136 // unconditionally include in API requests. By default, fields with 1137 // empty or default values are omitted from API requests. However, any 1138 // non-pointer, non-interface field appearing in ForceSendFields will be 1139 // sent to the server regardless of whether the field is empty or not. 1140 // This may be used to include empty fields in Patch requests. 1141 ForceSendFields []string `json:"-"` 1142 1143 // NullFields is a list of field names (e.g. "GcePdKmsKeyName") to 1144 // include in API requests with the JSON null value. By default, fields 1145 // with empty values are omitted from API requests. However, any field 1146 // with an empty value appearing in NullFields will be sent to the 1147 // server as null. It is an error if a field in this list has a 1148 // non-empty value. This may be used to include null fields in Patch 1149 // requests. 1150 NullFields []string `json:"-"` 1151 } 1152 1153 func (s *EncryptionConfig) MarshalJSON() ([]byte, error) { 1154 type NoMethod EncryptionConfig 1155 raw := NoMethod(*s) 1156 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1157 } 1158 1159 // EndpointConfig: Endpoint config for this cluster 1160 type EndpointConfig struct { 1161 // EnableHttpPortAccess: Optional. If true, enable http access to 1162 // specific ports on the cluster from external sources. Defaults to 1163 // false. 1164 EnableHttpPortAccess bool `json:"enableHttpPortAccess,omitempty"` 1165 1166 // HttpPorts: Output only. The map of port descriptions to URLs. Will 1167 // only be populated if enable_http_port_access is true. 1168 HttpPorts map[string]string `json:"httpPorts,omitempty"` 1169 1170 // ForceSendFields is a list of field names (e.g. 1171 // "EnableHttpPortAccess") to unconditionally include in API requests. 1172 // By default, fields with empty or default values are omitted from API 1173 // requests. However, any non-pointer, non-interface field appearing in 1174 // ForceSendFields will be sent to the server regardless of whether the 1175 // field is empty or not. This may be used to include empty fields in 1176 // Patch requests. 1177 ForceSendFields []string `json:"-"` 1178 1179 // NullFields is a list of field names (e.g. "EnableHttpPortAccess") to 1180 // include in API requests with the JSON null value. By default, fields 1181 // with empty values are omitted from API requests. However, any field 1182 // with an empty value appearing in NullFields will be sent to the 1183 // server as null. It is an error if a field in this list has a 1184 // non-empty value. This may be used to include null fields in Patch 1185 // requests. 1186 NullFields []string `json:"-"` 1187 } 1188 1189 func (s *EndpointConfig) MarshalJSON() ([]byte, error) { 1190 type NoMethod EndpointConfig 1191 raw := NoMethod(*s) 1192 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1193 } 1194 1195 // Expr: Represents a textual expression in the Common Expression 1196 // Language (CEL) syntax. CEL is a C-like expression language. The 1197 // syntax and semantics of CEL are documented at 1198 // https://github.com/google/cel-spec.Example (Comparison): title: 1199 // "Summary size limit" description: "Determines if a summary is less 1200 // than 100 chars" expression: "document.summary.size() < 100" Example 1201 // (Equality): title: "Requestor is owner" description: "Determines if 1202 // requestor is the document owner" expression: "document.owner == 1203 // request.auth.claims.email" Example (Logic): title: "Public documents" 1204 // description: "Determine whether the document should be publicly 1205 // visible" expression: "document.type != 'private' && document.type != 1206 // 'internal'" Example (Data Manipulation): title: "Notification string" 1207 // description: "Create a notification string with a timestamp." 1208 // expression: "'New message received at ' + 1209 // string(document.create_time)" The exact variables and functions that 1210 // may be referenced within an expression are determined by the service 1211 // that evaluates it. See the service documentation for additional 1212 // information. 1213 type Expr struct { 1214 // Description: Optional. Description of the expression. This is a 1215 // longer text which describes the expression, e.g. when hovered over it 1216 // in a UI. 1217 Description string `json:"description,omitempty"` 1218 1219 // Expression: Textual representation of an expression in Common 1220 // Expression Language syntax. 1221 Expression string `json:"expression,omitempty"` 1222 1223 // Location: Optional. String indicating the location of the expression 1224 // for error reporting, e.g. a file name and a position in the file. 1225 Location string `json:"location,omitempty"` 1226 1227 // Title: Optional. Title for the expression, i.e. a short string 1228 // describing its purpose. This can be used e.g. in UIs which allow to 1229 // enter the expression. 1230 Title string `json:"title,omitempty"` 1231 1232 // ForceSendFields is a list of field names (e.g. "Description") to 1233 // unconditionally include in API requests. By default, fields with 1234 // empty or default values are omitted from API requests. However, any 1235 // non-pointer, non-interface field appearing in ForceSendFields will be 1236 // sent to the server regardless of whether the field is empty or not. 1237 // This may be used to include empty fields in Patch requests. 1238 ForceSendFields []string `json:"-"` 1239 1240 // NullFields is a list of field names (e.g. "Description") to include 1241 // in API requests with the JSON null value. By default, fields with 1242 // empty values are omitted from API requests. However, any field with 1243 // an empty value appearing in NullFields will be sent to the server as 1244 // null. It is an error if a field in this list has a non-empty value. 1245 // This may be used to include null fields in Patch requests. 1246 NullFields []string `json:"-"` 1247 } 1248 1249 func (s *Expr) MarshalJSON() ([]byte, error) { 1250 type NoMethod Expr 1251 raw := NoMethod(*s) 1252 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1253 } 1254 1255 // GceClusterConfig: Common config settings for resources of Compute 1256 // Engine cluster instances, applicable to all instances in the cluster. 1257 type GceClusterConfig struct { 1258 // InternalIpOnly: Optional. If true, all instances in the cluster will 1259 // only have internal IP addresses. By default, clusters are not 1260 // restricted to internal IP addresses, and will have ephemeral external 1261 // IP addresses assigned to each instance. This internal_ip_only 1262 // restriction can only be enabled for subnetwork enabled networks, and 1263 // all off-cluster dependencies must be configured to be accessible 1264 // without external IP addresses. 1265 InternalIpOnly bool `json:"internalIpOnly,omitempty"` 1266 1267 // Metadata: The Compute Engine metadata entries to add to all instances 1268 // (see Project and instance metadata 1269 // (https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)). 1270 Metadata map[string]string `json:"metadata,omitempty"` 1271 1272 // NetworkUri: Optional. The Compute Engine network to be used for 1273 // machine communications. Cannot be specified with subnetwork_uri. If 1274 // neither network_uri nor subnetwork_uri is specified, the "default" 1275 // network of the project is used, if it exists. Cannot be a "Custom 1276 // Subnet Network" (see Using Subnetworks 1277 // (https://cloud.google.com/compute/docs/subnetworks) for more 1278 // information).A full URL, partial URI, or short name are valid. 1279 // Examples: 1280 // https://www.googleapis.com/compute/v1/projects/[project_id]/regions/global/default 1281 // projects/[project_id]/regions/global/default default 1282 NetworkUri string `json:"networkUri,omitempty"` 1283 1284 // NodeGroupAffinity: Optional. Node Group Affinity for sole-tenant 1285 // clusters. 1286 NodeGroupAffinity *NodeGroupAffinity `json:"nodeGroupAffinity,omitempty"` 1287 1288 // PrivateIpv6GoogleAccess: Optional. The type of IPv6 access for a 1289 // cluster. 1290 // 1291 // Possible values: 1292 // "PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED" - If unspecified, Compute 1293 // Engine default behavior will apply, which is the same as 1294 // INHERIT_FROM_SUBNETWORK. 1295 // "INHERIT_FROM_SUBNETWORK" - Private access to and from Google 1296 // Services configuration inherited from the subnetwork configuration. 1297 // This is the default Compute Engine behavior. 1298 // "OUTBOUND" - Enables outbound private IPv6 access to Google 1299 // Services from the Dataproc cluster. 1300 // "BIDIRECTIONAL" - Enables bidirectional private IPv6 access between 1301 // Google Services and the Dataproc cluster. 1302 PrivateIpv6GoogleAccess string `json:"privateIpv6GoogleAccess,omitempty"` 1303 1304 // ReservationAffinity: Optional. Reservation Affinity for consuming 1305 // Zonal reservation. 1306 ReservationAffinity *ReservationAffinity `json:"reservationAffinity,omitempty"` 1307 1308 // ServiceAccount: Optional. The Dataproc service account 1309 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/service-accounts#service_accounts_in_dataproc) 1310 // (also see VM Data Plane identity 1311 // (https://cloud.google.com/dataproc/docs/concepts/iam/dataproc-principals#vm_service_account_data_plane_identity)) 1312 // used by Dataproc cluster VM instances to access Google Cloud Platform 1313 // services.If not specified, the Compute Engine default service account 1314 // (https://cloud.google.com/compute/docs/access/service-accounts#default_service_account) 1315 // is used. 1316 ServiceAccount string `json:"serviceAccount,omitempty"` 1317 1318 // ServiceAccountScopes: Optional. The URIs of service account scopes to 1319 // be included in Compute Engine instances. The following base set of 1320 // scopes is always included: 1321 // https://www.googleapis.com/auth/cloud.useraccounts.readonly 1322 // https://www.googleapis.com/auth/devstorage.read_write 1323 // https://www.googleapis.com/auth/logging.writeIf no scopes are 1324 // specified, the following defaults are also provided: 1325 // https://www.googleapis.com/auth/bigquery 1326 // https://www.googleapis.com/auth/bigtable.admin.table 1327 // https://www.googleapis.com/auth/bigtable.data 1328 // https://www.googleapis.com/auth/devstorage.full_control 1329 ServiceAccountScopes []string `json:"serviceAccountScopes,omitempty"` 1330 1331 // ShieldedInstanceConfig: Optional. Shielded Instance Config for 1332 // clusters using Compute Engine Shielded VMs 1333 // (https://cloud.google.com/security/shielded-cloud/shielded-vm). 1334 ShieldedInstanceConfig *ShieldedInstanceConfig `json:"shieldedInstanceConfig,omitempty"` 1335 1336 // SubnetworkUri: Optional. The Compute Engine subnetwork to be used for 1337 // machine communications. Cannot be specified with network_uri.A full 1338 // URL, partial URI, or short name are valid. Examples: 1339 // https://www.googleapis.com/compute/v1/projects/[project_id]/regions/us-east1/subnetworks/sub0 1340 // projects/[project_id]/regions/us-east1/subnetworks/sub0 sub0 1341 SubnetworkUri string `json:"subnetworkUri,omitempty"` 1342 1343 // Tags: The Compute Engine tags to add to all instances (see Tagging 1344 // instances 1345 // (https://cloud.google.com/compute/docs/label-or-tag-resources#tags)). 1346 Tags []string `json:"tags,omitempty"` 1347 1348 // ZoneUri: Optional. The zone where the Compute Engine cluster will be 1349 // located. On a create request, it is required in the "global" region. 1350 // If omitted in a non-global Dataproc region, the service will pick a 1351 // zone in the corresponding Compute Engine region. On a get request, 1352 // zone will always be present.A full URL, partial URI, or short name 1353 // are valid. Examples: 1354 // https://www.googleapis.com/compute/v1/projects/[project_id]/zones/[zone] 1355 // projects/[project_id]/zones/[zone] us-central1-f 1356 ZoneUri string `json:"zoneUri,omitempty"` 1357 1358 // ForceSendFields is a list of field names (e.g. "InternalIpOnly") to 1359 // unconditionally include in API requests. By default, fields with 1360 // empty or default values are omitted from API requests. However, any 1361 // non-pointer, non-interface field appearing in ForceSendFields will be 1362 // sent to the server regardless of whether the field is empty or not. 1363 // This may be used to include empty fields in Patch requests. 1364 ForceSendFields []string `json:"-"` 1365 1366 // NullFields is a list of field names (e.g. "InternalIpOnly") to 1367 // include in API requests with the JSON null value. By default, fields 1368 // with empty values are omitted from API requests. However, any field 1369 // with an empty value appearing in NullFields will be sent to the 1370 // server as null. It is an error if a field in this list has a 1371 // non-empty value. This may be used to include null fields in Patch 1372 // requests. 1373 NullFields []string `json:"-"` 1374 } 1375 1376 func (s *GceClusterConfig) MarshalJSON() ([]byte, error) { 1377 type NoMethod GceClusterConfig 1378 raw := NoMethod(*s) 1379 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1380 } 1381 1382 // GetIamPolicyRequest: Request message for GetIamPolicy method. 1383 type GetIamPolicyRequest struct { 1384 // Options: OPTIONAL: A GetPolicyOptions object for specifying options 1385 // to GetIamPolicy. 1386 Options *GetPolicyOptions `json:"options,omitempty"` 1387 1388 // ForceSendFields is a list of field names (e.g. "Options") to 1389 // unconditionally include in API requests. By default, fields with 1390 // empty or default values are omitted from API requests. However, any 1391 // non-pointer, non-interface field appearing in ForceSendFields will be 1392 // sent to the server regardless of whether the field is empty or not. 1393 // This may be used to include empty fields in Patch requests. 1394 ForceSendFields []string `json:"-"` 1395 1396 // NullFields is a list of field names (e.g. "Options") to include in 1397 // API requests with the JSON null value. By default, fields with empty 1398 // values are omitted from API requests. However, any field with an 1399 // empty value appearing in NullFields will be sent to the server as 1400 // null. It is an error if a field in this list has a non-empty value. 1401 // This may be used to include null fields in Patch requests. 1402 NullFields []string `json:"-"` 1403 } 1404 1405 func (s *GetIamPolicyRequest) MarshalJSON() ([]byte, error) { 1406 type NoMethod GetIamPolicyRequest 1407 raw := NoMethod(*s) 1408 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1409 } 1410 1411 // GetPolicyOptions: Encapsulates settings provided to GetIamPolicy. 1412 type GetPolicyOptions struct { 1413 // RequestedPolicyVersion: Optional. The policy format version to be 1414 // returned.Valid values are 0, 1, and 3. Requests specifying an invalid 1415 // value will be rejected.Requests for policies with any conditional 1416 // bindings must specify version 3. Policies without any conditional 1417 // bindings may specify any valid value or leave the field unset.To 1418 // learn which resources support conditions in their IAM policies, see 1419 // the IAM documentation 1420 // (https://cloud.google.com/iam/help/conditions/resource-policies). 1421 RequestedPolicyVersion int64 `json:"requestedPolicyVersion,omitempty"` 1422 1423 // ForceSendFields is a list of field names (e.g. 1424 // "RequestedPolicyVersion") to unconditionally include in API requests. 1425 // By default, fields with empty or default values are omitted from API 1426 // requests. However, any non-pointer, non-interface field appearing in 1427 // ForceSendFields will be sent to the server regardless of whether the 1428 // field is empty or not. This may be used to include empty fields in 1429 // Patch requests. 1430 ForceSendFields []string `json:"-"` 1431 1432 // NullFields is a list of field names (e.g. "RequestedPolicyVersion") 1433 // to include in API requests with the JSON null value. By default, 1434 // fields with empty values are omitted from API requests. However, any 1435 // field with an empty value appearing in NullFields will be sent to the 1436 // server as null. It is an error if a field in this list has a 1437 // non-empty value. This may be used to include null fields in Patch 1438 // requests. 1439 NullFields []string `json:"-"` 1440 } 1441 1442 func (s *GetPolicyOptions) MarshalJSON() ([]byte, error) { 1443 type NoMethod GetPolicyOptions 1444 raw := NoMethod(*s) 1445 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1446 } 1447 1448 // GkeClusterConfig: The GKE config for this cluster. 1449 type GkeClusterConfig struct { 1450 // NamespacedGkeDeploymentTarget: Optional. A target for the deployment. 1451 NamespacedGkeDeploymentTarget *NamespacedGkeDeploymentTarget `json:"namespacedGkeDeploymentTarget,omitempty"` 1452 1453 // ForceSendFields is a list of field names (e.g. 1454 // "NamespacedGkeDeploymentTarget") to unconditionally include in API 1455 // requests. By default, fields with empty or default values are omitted 1456 // from API requests. However, any non-pointer, non-interface field 1457 // appearing in ForceSendFields will be sent to the server regardless of 1458 // whether the field is empty or not. This may be used to include empty 1459 // fields in Patch requests. 1460 ForceSendFields []string `json:"-"` 1461 1462 // NullFields is a list of field names (e.g. 1463 // "NamespacedGkeDeploymentTarget") to include in API requests with the 1464 // JSON null value. By default, fields with empty values are omitted 1465 // from API requests. However, any field with an empty value appearing 1466 // in NullFields will be sent to the server as null. It is an error if a 1467 // field in this list has a non-empty value. This may be used to include 1468 // null fields in Patch requests. 1469 NullFields []string `json:"-"` 1470 } 1471 1472 func (s *GkeClusterConfig) MarshalJSON() ([]byte, error) { 1473 type NoMethod GkeClusterConfig 1474 raw := NoMethod(*s) 1475 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1476 } 1477 1478 // HadoopJob: A Dataproc job for running Apache Hadoop MapReduce 1479 // (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop-mapreduce-client-core/MapReduceTutorial.html) 1480 // jobs on Apache Hadoop YARN 1481 // (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YARN.html). 1482 type HadoopJob struct { 1483 // ArchiveUris: Optional. HCFS URIs of archives to be extracted in the 1484 // working directory of Hadoop drivers and tasks. Supported file types: 1485 // .jar, .tar, .tar.gz, .tgz, or .zip. 1486 ArchiveUris []string `json:"archiveUris,omitempty"` 1487 1488 // Args: Optional. The arguments to pass to the driver. Do not include 1489 // arguments, such as -libjars or -Dfoo=bar, that can be set as job 1490 // properties, since a collision may occur that causes an incorrect job 1491 // submission. 1492 Args []string `json:"args,omitempty"` 1493 1494 // FileUris: Optional. HCFS (Hadoop Compatible Filesystem) URIs of files 1495 // to be copied to the working directory of Hadoop drivers and 1496 // distributed tasks. Useful for naively parallel tasks. 1497 FileUris []string `json:"fileUris,omitempty"` 1498 1499 // JarFileUris: Optional. Jar file URIs to add to the CLASSPATHs of the 1500 // Hadoop driver and tasks. 1501 JarFileUris []string `json:"jarFileUris,omitempty"` 1502 1503 // LoggingConfig: Optional. The runtime log config for job execution. 1504 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 1505 1506 // MainClass: The name of the driver's main class. The jar file 1507 // containing the class must be in the default CLASSPATH or specified in 1508 // jar_file_uris. 1509 MainClass string `json:"mainClass,omitempty"` 1510 1511 // MainJarFileUri: The HCFS URI of the jar file containing the main 1512 // class. Examples: 1513 // 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar' 1514 // 'hdfs:/tmp/test-samples/custom-wordcount.jar' 1515 // 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar' 1516 MainJarFileUri string `json:"mainJarFileUri,omitempty"` 1517 1518 // Properties: Optional. A mapping of property names to values, used to 1519 // configure Hadoop. Properties that conflict with values set by the 1520 // Dataproc API may be overwritten. Can include properties set in 1521 // /etc/hadoop/conf/*-site and classes in user code. 1522 Properties map[string]string `json:"properties,omitempty"` 1523 1524 // ForceSendFields is a list of field names (e.g. "ArchiveUris") to 1525 // unconditionally include in API requests. By default, fields with 1526 // empty or default values are omitted from API requests. However, any 1527 // non-pointer, non-interface field appearing in ForceSendFields will be 1528 // sent to the server regardless of whether the field is empty or not. 1529 // This may be used to include empty fields in Patch requests. 1530 ForceSendFields []string `json:"-"` 1531 1532 // NullFields is a list of field names (e.g. "ArchiveUris") to include 1533 // in API requests with the JSON null value. By default, fields with 1534 // empty values are omitted from API requests. However, any field with 1535 // an empty value appearing in NullFields will be sent to the server as 1536 // null. It is an error if a field in this list has a non-empty value. 1537 // This may be used to include null fields in Patch requests. 1538 NullFields []string `json:"-"` 1539 } 1540 1541 func (s *HadoopJob) MarshalJSON() ([]byte, error) { 1542 type NoMethod HadoopJob 1543 raw := NoMethod(*s) 1544 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1545 } 1546 1547 // HiveJob: A Dataproc job for running Apache Hive 1548 // (https://hive.apache.org/) queries on YARN. 1549 type HiveJob struct { 1550 // ContinueOnFailure: Optional. Whether to continue executing queries if 1551 // a query fails. The default value is false. Setting to true can be 1552 // useful when executing independent parallel queries. 1553 ContinueOnFailure bool `json:"continueOnFailure,omitempty"` 1554 1555 // JarFileUris: Optional. HCFS URIs of jar files to add to the CLASSPATH 1556 // of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive 1557 // SerDes and UDFs. 1558 JarFileUris []string `json:"jarFileUris,omitempty"` 1559 1560 // Properties: Optional. A mapping of property names and values, used to 1561 // configure Hive. Properties that conflict with values set by the 1562 // Dataproc API may be overwritten. Can include properties set in 1563 // /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and 1564 // classes in user code. 1565 Properties map[string]string `json:"properties,omitempty"` 1566 1567 // QueryFileUri: The HCFS URI of the script that contains Hive queries. 1568 QueryFileUri string `json:"queryFileUri,omitempty"` 1569 1570 // QueryList: A list of queries. 1571 QueryList *QueryList `json:"queryList,omitempty"` 1572 1573 // ScriptVariables: Optional. Mapping of query variable names to values 1574 // (equivalent to the Hive command: SET name="value";). 1575 ScriptVariables map[string]string `json:"scriptVariables,omitempty"` 1576 1577 // ForceSendFields is a list of field names (e.g. "ContinueOnFailure") 1578 // to unconditionally include in API requests. By default, fields with 1579 // empty or default values are omitted from API requests. However, any 1580 // non-pointer, non-interface field appearing in ForceSendFields will be 1581 // sent to the server regardless of whether the field is empty or not. 1582 // This may be used to include empty fields in Patch requests. 1583 ForceSendFields []string `json:"-"` 1584 1585 // NullFields is a list of field names (e.g. "ContinueOnFailure") to 1586 // include in API requests with the JSON null value. By default, fields 1587 // with empty values are omitted from API requests. However, any field 1588 // with an empty value appearing in NullFields will be sent to the 1589 // server as null. It is an error if a field in this list has a 1590 // non-empty value. This may be used to include null fields in Patch 1591 // requests. 1592 NullFields []string `json:"-"` 1593 } 1594 1595 func (s *HiveJob) MarshalJSON() ([]byte, error) { 1596 type NoMethod HiveJob 1597 raw := NoMethod(*s) 1598 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1599 } 1600 1601 // InjectCredentialsRequest: A request to inject credentials into a 1602 // cluster. 1603 type InjectCredentialsRequest struct { 1604 // ClusterUuid: Required. The cluster UUID. 1605 ClusterUuid string `json:"clusterUuid,omitempty"` 1606 1607 // CredentialsCiphertext: Required. The encrypted credentials being 1608 // injected in to the cluster.The client is responsible for encrypting 1609 // the credentials in a way that is supported by the cluster.A wrapped 1610 // value is used here so that the actual contents of the encrypted 1611 // credentials are not written to audit logs. 1612 CredentialsCiphertext string `json:"credentialsCiphertext,omitempty"` 1613 1614 // ForceSendFields is a list of field names (e.g. "ClusterUuid") to 1615 // unconditionally include in API requests. By default, fields with 1616 // empty or default values are omitted from API requests. However, any 1617 // non-pointer, non-interface field appearing in ForceSendFields will be 1618 // sent to the server regardless of whether the field is empty or not. 1619 // This may be used to include empty fields in Patch requests. 1620 ForceSendFields []string `json:"-"` 1621 1622 // NullFields is a list of field names (e.g. "ClusterUuid") to include 1623 // in API requests with the JSON null value. By default, fields with 1624 // empty values are omitted from API requests. However, any field with 1625 // an empty value appearing in NullFields will be sent to the server as 1626 // null. It is an error if a field in this list has a non-empty value. 1627 // This may be used to include null fields in Patch requests. 1628 NullFields []string `json:"-"` 1629 } 1630 1631 func (s *InjectCredentialsRequest) MarshalJSON() ([]byte, error) { 1632 type NoMethod InjectCredentialsRequest 1633 raw := NoMethod(*s) 1634 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1635 } 1636 1637 // InstanceGroupAutoscalingPolicyConfig: Configuration for the size 1638 // bounds of an instance group, including its proportional size to other 1639 // groups. 1640 type InstanceGroupAutoscalingPolicyConfig struct { 1641 // MaxInstances: Optional. Maximum number of instances for this group. 1642 // Required for primary workers. Note that by default, clusters will not 1643 // use secondary workers. Required for secondary workers if the minimum 1644 // secondary instances is set.Primary workers - Bounds: [min_instances, 1645 // ). Required. Secondary workers - Bounds: [min_instances, ). Default: 1646 // 0. 1647 MaxInstances int64 `json:"maxInstances,omitempty"` 1648 1649 // MinInstances: Optional. Minimum number of instances for this 1650 // group.Primary workers - Bounds: 2, max_instances. Default: 2. 1651 // Secondary workers - Bounds: 0, max_instances. Default: 0. 1652 MinInstances int64 `json:"minInstances,omitempty"` 1653 1654 // Weight: Optional. Weight for the instance group, which is used to 1655 // determine the fraction of total workers in the cluster from this 1656 // instance group. For example, if primary workers have weight 2, and 1657 // secondary workers have weight 1, the cluster will have approximately 1658 // 2 primary workers for each secondary worker.The cluster may not reach 1659 // the specified balance if constrained by min/max bounds or other 1660 // autoscaling settings. For example, if max_instances for secondary 1661 // workers is 0, then only primary workers will be added. The cluster 1662 // can also be out of balance when created.If weight is not set on any 1663 // instance group, the cluster will default to equal weight for all 1664 // groups: the cluster will attempt to maintain an equal number of 1665 // workers in each group within the configured size bounds for each 1666 // group. If weight is set for one group only, the cluster will default 1667 // to zero weight on the unset group. For example if weight is set only 1668 // on primary workers, the cluster will use primary workers only and no 1669 // secondary workers. 1670 Weight int64 `json:"weight,omitempty"` 1671 1672 // ForceSendFields is a list of field names (e.g. "MaxInstances") to 1673 // unconditionally include in API requests. By default, fields with 1674 // empty or default values are omitted from API requests. However, any 1675 // non-pointer, non-interface field appearing in ForceSendFields will be 1676 // sent to the server regardless of whether the field is empty or not. 1677 // This may be used to include empty fields in Patch requests. 1678 ForceSendFields []string `json:"-"` 1679 1680 // NullFields is a list of field names (e.g. "MaxInstances") to include 1681 // in API requests with the JSON null value. By default, fields with 1682 // empty values are omitted from API requests. However, any field with 1683 // an empty value appearing in NullFields will be sent to the server as 1684 // null. It is an error if a field in this list has a non-empty value. 1685 // This may be used to include null fields in Patch requests. 1686 NullFields []string `json:"-"` 1687 } 1688 1689 func (s *InstanceGroupAutoscalingPolicyConfig) MarshalJSON() ([]byte, error) { 1690 type NoMethod InstanceGroupAutoscalingPolicyConfig 1691 raw := NoMethod(*s) 1692 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1693 } 1694 1695 // InstanceGroupConfig: The config settings for Compute Engine resources 1696 // in an instance group, such as a master or worker group. 1697 type InstanceGroupConfig struct { 1698 // Accelerators: Optional. The Compute Engine accelerator configuration 1699 // for these instances. 1700 Accelerators []*AcceleratorConfig `json:"accelerators,omitempty"` 1701 1702 // DiskConfig: Optional. Disk option config settings. 1703 DiskConfig *DiskConfig `json:"diskConfig,omitempty"` 1704 1705 // ImageUri: Optional. The Compute Engine image resource used for 1706 // cluster instances.The URI can represent an image or image 1707 // family.Image examples: 1708 // https://www.googleapis.com/compute/beta/projects/[project_id]/global/images/[image-id] 1709 // projects/[project_id]/global/images/[image-id] image-idImage family 1710 // examples. Dataproc will use the most recent image from the family: 1711 // https://www.googleapis.com/compute/beta/projects/[project_id]/global/images/family/[custom-image-family-name] 1712 // projects/[project_id]/global/images/family/[custom-image-family-name]I 1713 // f the URI is unspecified, it will be inferred from 1714 // SoftwareConfig.image_version or the system default. 1715 ImageUri string `json:"imageUri,omitempty"` 1716 1717 // InstanceNames: Output only. The list of instance names. Dataproc 1718 // derives the names from cluster_name, num_instances, and the instance 1719 // group. 1720 InstanceNames []string `json:"instanceNames,omitempty"` 1721 1722 // InstanceReferences: Output only. List of references to Compute Engine 1723 // instances. 1724 InstanceReferences []*InstanceReference `json:"instanceReferences,omitempty"` 1725 1726 // IsPreemptible: Output only. Specifies that this instance group 1727 // contains preemptible instances. 1728 IsPreemptible bool `json:"isPreemptible,omitempty"` 1729 1730 // MachineTypeUri: Optional. The Compute Engine machine type used for 1731 // cluster instances.A full URL, partial URI, or short name are valid. 1732 // Examples: 1733 // https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 1734 // projects/[project_id]/zones/us-east1-a/machineTypes/n1-standard-2 1735 // n1-standard-2Auto Zone Exception: If you are using the Dataproc Auto 1736 // Zone Placement 1737 // (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/auto-zone#using_auto_zone_placement) 1738 // feature, you must use the short name of the machine type resource, 1739 // for example, n1-standard-2. 1740 MachineTypeUri string `json:"machineTypeUri,omitempty"` 1741 1742 // ManagedGroupConfig: Output only. The config for Compute Engine 1743 // Instance Group Manager that manages this group. This is only used for 1744 // preemptible instance groups. 1745 ManagedGroupConfig *ManagedGroupConfig `json:"managedGroupConfig,omitempty"` 1746 1747 // MinCpuPlatform: Specifies the minimum cpu platform for the Instance 1748 // Group. See Dataproc -> Minimum CPU Platform 1749 // (https://cloud.google.com/dataproc/docs/concepts/compute/dataproc-min-cpu). 1750 MinCpuPlatform string `json:"minCpuPlatform,omitempty"` 1751 1752 // NumInstances: Optional. The number of VM instances in the instance 1753 // group. For HA cluster master_config groups, must be set to 3. For 1754 // standard cluster master_config groups, must be set to 1. 1755 NumInstances int64 `json:"numInstances,omitempty"` 1756 1757 // Preemptibility: Optional. Specifies the preemptibility of the 1758 // instance group.The default value for master and worker groups is 1759 // NON_PREEMPTIBLE. This default cannot be changed.The default value for 1760 // secondary instances is PREEMPTIBLE. 1761 // 1762 // Possible values: 1763 // "PREEMPTIBILITY_UNSPECIFIED" - Preemptibility is unspecified, the 1764 // system will choose the appropriate setting for each instance group. 1765 // "NON_PREEMPTIBLE" - Instances are non-preemptible.This option is 1766 // allowed for all instance groups and is the only valid value for 1767 // Master and Worker instance groups. 1768 // "PREEMPTIBLE" - Instances are preemptible.This option is allowed 1769 // only for secondary worker groups. 1770 Preemptibility string `json:"preemptibility,omitempty"` 1771 1772 // ForceSendFields is a list of field names (e.g. "Accelerators") to 1773 // unconditionally include in API requests. By default, fields with 1774 // empty or default values are omitted from API requests. However, any 1775 // non-pointer, non-interface field appearing in ForceSendFields will be 1776 // sent to the server regardless of whether the field is empty or not. 1777 // This may be used to include empty fields in Patch requests. 1778 ForceSendFields []string `json:"-"` 1779 1780 // NullFields is a list of field names (e.g. "Accelerators") to include 1781 // in API requests with the JSON null value. By default, fields with 1782 // empty values are omitted from API requests. However, any field with 1783 // an empty value appearing in NullFields will be sent to the server as 1784 // null. It is an error if a field in this list has a non-empty value. 1785 // This may be used to include null fields in Patch requests. 1786 NullFields []string `json:"-"` 1787 } 1788 1789 func (s *InstanceGroupConfig) MarshalJSON() ([]byte, error) { 1790 type NoMethod InstanceGroupConfig 1791 raw := NoMethod(*s) 1792 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1793 } 1794 1795 // InstanceReference: A reference to a Compute Engine instance. 1796 type InstanceReference struct { 1797 // InstanceId: The unique identifier of the Compute Engine instance. 1798 InstanceId string `json:"instanceId,omitempty"` 1799 1800 // InstanceName: The user-friendly name of the Compute Engine instance. 1801 InstanceName string `json:"instanceName,omitempty"` 1802 1803 // PublicKey: The public key used for sharing data with this instance. 1804 PublicKey string `json:"publicKey,omitempty"` 1805 1806 // ForceSendFields is a list of field names (e.g. "InstanceId") to 1807 // unconditionally include in API requests. By default, fields with 1808 // empty or default values are omitted from API requests. However, any 1809 // non-pointer, non-interface field appearing in ForceSendFields will be 1810 // sent to the server regardless of whether the field is empty or not. 1811 // This may be used to include empty fields in Patch requests. 1812 ForceSendFields []string `json:"-"` 1813 1814 // NullFields is a list of field names (e.g. "InstanceId") to include in 1815 // API requests with the JSON null value. By default, fields with empty 1816 // values are omitted from API requests. However, any field with an 1817 // empty value appearing in NullFields will be sent to the server as 1818 // null. It is an error if a field in this list has a non-empty value. 1819 // This may be used to include null fields in Patch requests. 1820 NullFields []string `json:"-"` 1821 } 1822 1823 func (s *InstanceReference) MarshalJSON() ([]byte, error) { 1824 type NoMethod InstanceReference 1825 raw := NoMethod(*s) 1826 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1827 } 1828 1829 // InstantiateWorkflowTemplateRequest: A request to instantiate a 1830 // workflow template. 1831 type InstantiateWorkflowTemplateRequest struct { 1832 // InstanceId: Deprecated. Please use request_id field instead. 1833 InstanceId string `json:"instanceId,omitempty"` 1834 1835 // Parameters: Optional. Map from parameter names to values that should 1836 // be used for those parameters. Values may not exceed 1000 characters. 1837 Parameters map[string]string `json:"parameters,omitempty"` 1838 1839 // RequestId: Optional. A tag that prevents multiple concurrent workflow 1840 // instances with the same tag from running. This mitigates risk of 1841 // concurrent instances started due to retries.It is recommended to 1842 // always set this value to a UUID 1843 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag 1844 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 1845 // and hyphens (-). The maximum length is 40 characters. 1846 RequestId string `json:"requestId,omitempty"` 1847 1848 // Version: Optional. The version of workflow template to instantiate. 1849 // If specified, the workflow will be instantiated only if the current 1850 // version of the workflow template has the supplied version.This option 1851 // cannot be used to instantiate a previous version of workflow 1852 // template. 1853 Version int64 `json:"version,omitempty"` 1854 1855 // ForceSendFields is a list of field names (e.g. "InstanceId") to 1856 // unconditionally include in API requests. By default, fields with 1857 // empty or default values are omitted from API requests. However, any 1858 // non-pointer, non-interface field appearing in ForceSendFields will be 1859 // sent to the server regardless of whether the field is empty or not. 1860 // This may be used to include empty fields in Patch requests. 1861 ForceSendFields []string `json:"-"` 1862 1863 // NullFields is a list of field names (e.g. "InstanceId") to include in 1864 // API requests with the JSON null value. By default, fields with empty 1865 // values are omitted from API requests. However, any field with an 1866 // empty value appearing in NullFields will be sent to the server as 1867 // null. It is an error if a field in this list has a non-empty value. 1868 // This may be used to include null fields in Patch requests. 1869 NullFields []string `json:"-"` 1870 } 1871 1872 func (s *InstantiateWorkflowTemplateRequest) MarshalJSON() ([]byte, error) { 1873 type NoMethod InstantiateWorkflowTemplateRequest 1874 raw := NoMethod(*s) 1875 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1876 } 1877 1878 // Job: A Dataproc job resource. 1879 type Job struct { 1880 // Done: Output only. Indicates whether the job is completed. If the 1881 // value is false, the job is still in progress. If true, the job is 1882 // completed, and status.state field will indicate if it was successful, 1883 // failed, or cancelled. 1884 Done bool `json:"done,omitempty"` 1885 1886 // DriverControlFilesUri: Output only. If present, the location of 1887 // miscellaneous control files which may be used as part of job setup 1888 // and handling. If not present, control files may be placed in the same 1889 // location as driver_output_uri. 1890 DriverControlFilesUri string `json:"driverControlFilesUri,omitempty"` 1891 1892 // DriverOutputResourceUri: Output only. A URI pointing to the location 1893 // of the stdout of the job's driver program. 1894 DriverOutputResourceUri string `json:"driverOutputResourceUri,omitempty"` 1895 1896 // HadoopJob: Optional. Job is a Hadoop job. 1897 HadoopJob *HadoopJob `json:"hadoopJob,omitempty"` 1898 1899 // HiveJob: Optional. Job is a Hive job. 1900 HiveJob *HiveJob `json:"hiveJob,omitempty"` 1901 1902 // JobUuid: Output only. A UUID that uniquely identifies a job within 1903 // the project over time. This is in contrast to a user-settable 1904 // reference.job_id that may be reused over time. 1905 JobUuid string `json:"jobUuid,omitempty"` 1906 1907 // Labels: Optional. The labels to associate with this job. Label keys 1908 // must contain 1 to 63 characters, and must conform to RFC 1035 1909 // (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty, 1910 // but, if present, must contain 1 to 63 characters, and must conform to 1911 // RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32 1912 // labels can be associated with a job. 1913 Labels map[string]string `json:"labels,omitempty"` 1914 1915 // PigJob: Optional. Job is a Pig job. 1916 PigJob *PigJob `json:"pigJob,omitempty"` 1917 1918 // Placement: Required. Job information, including how, when, and where 1919 // to run the job. 1920 Placement *JobPlacement `json:"placement,omitempty"` 1921 1922 // PrestoJob: Optional. Job is a Presto job. 1923 PrestoJob *PrestoJob `json:"prestoJob,omitempty"` 1924 1925 // PysparkJob: Optional. Job is a PySpark job. 1926 PysparkJob *PySparkJob `json:"pysparkJob,omitempty"` 1927 1928 // Reference: Optional. The fully qualified reference to the job, which 1929 // can be used to obtain the equivalent REST path of the job resource. 1930 // If this property is not specified when a job is created, the server 1931 // generates a job_id. 1932 Reference *JobReference `json:"reference,omitempty"` 1933 1934 // Scheduling: Optional. Job scheduling configuration. 1935 Scheduling *JobScheduling `json:"scheduling,omitempty"` 1936 1937 // SparkJob: Optional. Job is a Spark job. 1938 SparkJob *SparkJob `json:"sparkJob,omitempty"` 1939 1940 // SparkRJob: Optional. Job is a SparkR job. 1941 SparkRJob *SparkRJob `json:"sparkRJob,omitempty"` 1942 1943 // SparkSqlJob: Optional. Job is a SparkSql job. 1944 SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"` 1945 1946 // Status: Output only. The job status. Additional application-specific 1947 // status information may be contained in the type_job and 1948 // yarn_applications fields. 1949 Status *JobStatus `json:"status,omitempty"` 1950 1951 // StatusHistory: Output only. The previous job status. 1952 StatusHistory []*JobStatus `json:"statusHistory,omitempty"` 1953 1954 // SubmittedBy: Output only. The email address of the user submitting 1955 // the job. For jobs submitted on the cluster, the address is 1956 // username@hostname. 1957 SubmittedBy string `json:"submittedBy,omitempty"` 1958 1959 // YarnApplications: Output only. The collection of YARN applications 1960 // spun up by this job.Beta Feature: This report is available for 1961 // testing purposes only. It may be changed before final release. 1962 YarnApplications []*YarnApplication `json:"yarnApplications,omitempty"` 1963 1964 // ServerResponse contains the HTTP response code and headers from the 1965 // server. 1966 googleapi.ServerResponse `json:"-"` 1967 1968 // ForceSendFields is a list of field names (e.g. "Done") to 1969 // unconditionally include in API requests. By default, fields with 1970 // empty or default values are omitted from API requests. However, any 1971 // non-pointer, non-interface field appearing in ForceSendFields will be 1972 // sent to the server regardless of whether the field is empty or not. 1973 // This may be used to include empty fields in Patch requests. 1974 ForceSendFields []string `json:"-"` 1975 1976 // NullFields is a list of field names (e.g. "Done") to include in API 1977 // requests with the JSON null value. By default, fields with empty 1978 // values are omitted from API requests. However, any field with an 1979 // empty value appearing in NullFields will be sent to the server as 1980 // null. It is an error if a field in this list has a non-empty value. 1981 // This may be used to include null fields in Patch requests. 1982 NullFields []string `json:"-"` 1983 } 1984 1985 func (s *Job) MarshalJSON() ([]byte, error) { 1986 type NoMethod Job 1987 raw := NoMethod(*s) 1988 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 1989 } 1990 1991 // JobMetadata: Job Operation metadata. 1992 type JobMetadata struct { 1993 // JobId: Output only. The job id. 1994 JobId string `json:"jobId,omitempty"` 1995 1996 // OperationType: Output only. Operation type. 1997 OperationType string `json:"operationType,omitempty"` 1998 1999 // StartTime: Output only. Job submission time. 2000 StartTime string `json:"startTime,omitempty"` 2001 2002 // Status: Output only. Most recent job status. 2003 Status *JobStatus `json:"status,omitempty"` 2004 2005 // ForceSendFields is a list of field names (e.g. "JobId") to 2006 // unconditionally include in API requests. By default, fields with 2007 // empty or default values are omitted from API requests. However, any 2008 // non-pointer, non-interface field appearing in ForceSendFields will be 2009 // sent to the server regardless of whether the field is empty or not. 2010 // This may be used to include empty fields in Patch requests. 2011 ForceSendFields []string `json:"-"` 2012 2013 // NullFields is a list of field names (e.g. "JobId") to include in API 2014 // requests with the JSON null value. By default, fields with empty 2015 // values are omitted from API requests. However, any field with an 2016 // empty value appearing in NullFields will be sent to the server as 2017 // null. It is an error if a field in this list has a non-empty value. 2018 // This may be used to include null fields in Patch requests. 2019 NullFields []string `json:"-"` 2020 } 2021 2022 func (s *JobMetadata) MarshalJSON() ([]byte, error) { 2023 type NoMethod JobMetadata 2024 raw := NoMethod(*s) 2025 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2026 } 2027 2028 // JobPlacement: Dataproc job config. 2029 type JobPlacement struct { 2030 // ClusterLabels: Optional. Cluster labels to identify a cluster where 2031 // the job will be submitted. 2032 ClusterLabels map[string]string `json:"clusterLabels,omitempty"` 2033 2034 // ClusterName: Required. The name of the cluster where the job will be 2035 // submitted. 2036 ClusterName string `json:"clusterName,omitempty"` 2037 2038 // ClusterUuid: Output only. A cluster UUID generated by the Dataproc 2039 // service when the job is submitted. 2040 ClusterUuid string `json:"clusterUuid,omitempty"` 2041 2042 // ForceSendFields is a list of field names (e.g. "ClusterLabels") to 2043 // unconditionally include in API requests. By default, fields with 2044 // empty or default values are omitted from API requests. However, any 2045 // non-pointer, non-interface field appearing in ForceSendFields will be 2046 // sent to the server regardless of whether the field is empty or not. 2047 // This may be used to include empty fields in Patch requests. 2048 ForceSendFields []string `json:"-"` 2049 2050 // NullFields is a list of field names (e.g. "ClusterLabels") to include 2051 // in API requests with the JSON null value. By default, fields with 2052 // empty values are omitted from API requests. However, any field with 2053 // an empty value appearing in NullFields will be sent to the server as 2054 // null. It is an error if a field in this list has a non-empty value. 2055 // This may be used to include null fields in Patch requests. 2056 NullFields []string `json:"-"` 2057 } 2058 2059 func (s *JobPlacement) MarshalJSON() ([]byte, error) { 2060 type NoMethod JobPlacement 2061 raw := NoMethod(*s) 2062 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2063 } 2064 2065 // JobReference: Encapsulates the full scoping used to reference a job. 2066 type JobReference struct { 2067 // JobId: Optional. The job ID, which must be unique within the project. 2068 // The ID must contain only letters (a-z, A-Z), numbers (0-9), 2069 // underscores (_), or hyphens (-). The maximum length is 100 2070 // characters.If not specified by the caller, the job ID will be 2071 // provided by the server. 2072 JobId string `json:"jobId,omitempty"` 2073 2074 // ProjectId: Optional. The ID of the Google Cloud Platform project that 2075 // the job belongs to. If specified, must match the request project ID. 2076 ProjectId string `json:"projectId,omitempty"` 2077 2078 // ForceSendFields is a list of field names (e.g. "JobId") to 2079 // unconditionally include in API requests. By default, fields with 2080 // empty or default values are omitted from API requests. However, any 2081 // non-pointer, non-interface field appearing in ForceSendFields will be 2082 // sent to the server regardless of whether the field is empty or not. 2083 // This may be used to include empty fields in Patch requests. 2084 ForceSendFields []string `json:"-"` 2085 2086 // NullFields is a list of field names (e.g. "JobId") to include in API 2087 // requests with the JSON null value. By default, fields with empty 2088 // values are omitted from API requests. However, any field with an 2089 // empty value appearing in NullFields will be sent to the server as 2090 // null. It is an error if a field in this list has a non-empty value. 2091 // This may be used to include null fields in Patch requests. 2092 NullFields []string `json:"-"` 2093 } 2094 2095 func (s *JobReference) MarshalJSON() ([]byte, error) { 2096 type NoMethod JobReference 2097 raw := NoMethod(*s) 2098 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2099 } 2100 2101 // JobScheduling: Job scheduling options. 2102 type JobScheduling struct { 2103 // MaxFailuresPerHour: Optional. Maximum number of times per hour a 2104 // driver may be restarted as a result of driver terminating with 2105 // non-zero code before job is reported failed.A job may be reported as 2106 // thrashing if driver exits with non-zero code 4 times within 10 minute 2107 // window.Maximum value is 10. 2108 MaxFailuresPerHour int64 `json:"maxFailuresPerHour,omitempty"` 2109 2110 // MaxFailuresTotal: Optional. Maximum number of times in total a driver 2111 // may be restarted as a result of driver exiting with non-zero code 2112 // before job is reported failed. Maximum value is 240. 2113 MaxFailuresTotal int64 `json:"maxFailuresTotal,omitempty"` 2114 2115 // ForceSendFields is a list of field names (e.g. "MaxFailuresPerHour") 2116 // to unconditionally include in API requests. By default, fields with 2117 // empty or default values are omitted from API requests. However, any 2118 // non-pointer, non-interface field appearing in ForceSendFields will be 2119 // sent to the server regardless of whether the field is empty or not. 2120 // This may be used to include empty fields in Patch requests. 2121 ForceSendFields []string `json:"-"` 2122 2123 // NullFields is a list of field names (e.g. "MaxFailuresPerHour") to 2124 // include in API requests with the JSON null value. By default, fields 2125 // with empty values are omitted from API requests. However, any field 2126 // with an empty value appearing in NullFields will be sent to the 2127 // server as null. It is an error if a field in this list has a 2128 // non-empty value. This may be used to include null fields in Patch 2129 // requests. 2130 NullFields []string `json:"-"` 2131 } 2132 2133 func (s *JobScheduling) MarshalJSON() ([]byte, error) { 2134 type NoMethod JobScheduling 2135 raw := NoMethod(*s) 2136 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2137 } 2138 2139 // JobStatus: Dataproc job status. 2140 type JobStatus struct { 2141 // Details: Output only. Optional Job state details, such as an error 2142 // description if the state is ERROR. 2143 Details string `json:"details,omitempty"` 2144 2145 // State: Output only. A state message specifying the overall job state. 2146 // 2147 // Possible values: 2148 // "STATE_UNSPECIFIED" - The job state is unknown. 2149 // "PENDING" - The job is pending; it has been submitted, but is not 2150 // yet running. 2151 // "SETUP_DONE" - Job has been received by the service and completed 2152 // initial setup; it will soon be submitted to the cluster. 2153 // "RUNNING" - The job is running on the cluster. 2154 // "CANCEL_PENDING" - A CancelJob request has been received, but is 2155 // pending. 2156 // "CANCEL_STARTED" - Transient in-flight resources have been 2157 // canceled, and the request to cancel the running job has been issued 2158 // to the cluster. 2159 // "CANCELLED" - The job cancellation was successful. 2160 // "DONE" - The job has completed successfully. 2161 // "ERROR" - The job has completed, but encountered an error. 2162 // "ATTEMPT_FAILURE" - Job attempt has failed. The detail field 2163 // contains failure details for this attempt.Applies to restartable jobs 2164 // only. 2165 State string `json:"state,omitempty"` 2166 2167 // StateStartTime: Output only. The time when this state was entered. 2168 StateStartTime string `json:"stateStartTime,omitempty"` 2169 2170 // Substate: Output only. Additional state information, which includes 2171 // status reported by the agent. 2172 // 2173 // Possible values: 2174 // "UNSPECIFIED" - The job substate is unknown. 2175 // "SUBMITTED" - The Job is submitted to the agent.Applies to RUNNING 2176 // state. 2177 // "QUEUED" - The Job has been received and is awaiting execution (it 2178 // may be waiting for a condition to be met). See the "details" field 2179 // for the reason for the delay.Applies to RUNNING state. 2180 // "STALE_STATUS" - The agent-reported status is out of date, which 2181 // may be caused by a loss of communication between the agent and 2182 // Dataproc. If the agent does not send a timely update, the job will 2183 // fail.Applies to RUNNING state. 2184 Substate string `json:"substate,omitempty"` 2185 2186 // ForceSendFields is a list of field names (e.g. "Details") to 2187 // unconditionally include in API requests. By default, fields with 2188 // empty or default values are omitted from API requests. However, any 2189 // non-pointer, non-interface field appearing in ForceSendFields will be 2190 // sent to the server regardless of whether the field is empty or not. 2191 // This may be used to include empty fields in Patch requests. 2192 ForceSendFields []string `json:"-"` 2193 2194 // NullFields is a list of field names (e.g. "Details") to include in 2195 // API requests with the JSON null value. By default, fields with empty 2196 // values are omitted from API requests. However, any field with an 2197 // empty value appearing in NullFields will be sent to the server as 2198 // null. It is an error if a field in this list has a non-empty value. 2199 // This may be used to include null fields in Patch requests. 2200 NullFields []string `json:"-"` 2201 } 2202 2203 func (s *JobStatus) MarshalJSON() ([]byte, error) { 2204 type NoMethod JobStatus 2205 raw := NoMethod(*s) 2206 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2207 } 2208 2209 // KerberosConfig: Specifies Kerberos related configuration. 2210 type KerberosConfig struct { 2211 // CrossRealmTrustAdminServer: Optional. The admin server (IP or 2212 // hostname) for the remote trusted realm in a cross realm trust 2213 // relationship. 2214 CrossRealmTrustAdminServer string `json:"crossRealmTrustAdminServer,omitempty"` 2215 2216 // CrossRealmTrustKdc: Optional. The KDC (IP or hostname) for the remote 2217 // trusted realm in a cross realm trust relationship. 2218 CrossRealmTrustKdc string `json:"crossRealmTrustKdc,omitempty"` 2219 2220 // CrossRealmTrustRealm: Optional. The remote realm the Dataproc 2221 // on-cluster KDC will trust, should the user enable cross realm trust. 2222 CrossRealmTrustRealm string `json:"crossRealmTrustRealm,omitempty"` 2223 2224 // CrossRealmTrustSharedPasswordUri: Optional. The Cloud Storage URI of 2225 // a KMS encrypted file containing the shared password between the 2226 // on-cluster Kerberos realm and the remote trusted realm, in a cross 2227 // realm trust relationship. 2228 CrossRealmTrustSharedPasswordUri string `json:"crossRealmTrustSharedPasswordUri,omitempty"` 2229 2230 // EnableKerberos: Optional. Flag to indicate whether to Kerberize the 2231 // cluster (default: false). Set this field to true to enable Kerberos 2232 // on a cluster. 2233 EnableKerberos bool `json:"enableKerberos,omitempty"` 2234 2235 // KdcDbKeyUri: Optional. The Cloud Storage URI of a KMS encrypted file 2236 // containing the master key of the KDC database. 2237 KdcDbKeyUri string `json:"kdcDbKeyUri,omitempty"` 2238 2239 // KeyPasswordUri: Optional. The Cloud Storage URI of a KMS encrypted 2240 // file containing the password to the user provided key. For the 2241 // self-signed certificate, this password is generated by Dataproc. 2242 KeyPasswordUri string `json:"keyPasswordUri,omitempty"` 2243 2244 // KeystorePasswordUri: Optional. The Cloud Storage URI of a KMS 2245 // encrypted file containing the password to the user provided keystore. 2246 // For the self-signed certificate, this password is generated by 2247 // Dataproc. 2248 KeystorePasswordUri string `json:"keystorePasswordUri,omitempty"` 2249 2250 // KeystoreUri: Optional. The Cloud Storage URI of the keystore file 2251 // used for SSL encryption. If not provided, Dataproc will provide a 2252 // self-signed certificate. 2253 KeystoreUri string `json:"keystoreUri,omitempty"` 2254 2255 // KmsKeyUri: Optional. The uri of the KMS key used to encrypt various 2256 // sensitive files. 2257 KmsKeyUri string `json:"kmsKeyUri,omitempty"` 2258 2259 // Realm: Optional. The name of the on-cluster Kerberos realm. If not 2260 // specified, the uppercased domain of hostnames will be the realm. 2261 Realm string `json:"realm,omitempty"` 2262 2263 // RootPrincipalPasswordUri: Optional. The Cloud Storage URI of a KMS 2264 // encrypted file containing the root principal password. 2265 RootPrincipalPasswordUri string `json:"rootPrincipalPasswordUri,omitempty"` 2266 2267 // TgtLifetimeHours: Optional. The lifetime of the ticket granting 2268 // ticket, in hours. If not specified, or user specifies 0, then default 2269 // value 10 will be used. 2270 TgtLifetimeHours int64 `json:"tgtLifetimeHours,omitempty"` 2271 2272 // TruststorePasswordUri: Optional. The Cloud Storage URI of a KMS 2273 // encrypted file containing the password to the user provided 2274 // truststore. For the self-signed certificate, this password is 2275 // generated by Dataproc. 2276 TruststorePasswordUri string `json:"truststorePasswordUri,omitempty"` 2277 2278 // TruststoreUri: Optional. The Cloud Storage URI of the truststore file 2279 // used for SSL encryption. If not provided, Dataproc will provide a 2280 // self-signed certificate. 2281 TruststoreUri string `json:"truststoreUri,omitempty"` 2282 2283 // ForceSendFields is a list of field names (e.g. 2284 // "CrossRealmTrustAdminServer") to unconditionally include in API 2285 // requests. By default, fields with empty or default values are omitted 2286 // from API requests. However, any non-pointer, non-interface field 2287 // appearing in ForceSendFields will be sent to the server regardless of 2288 // whether the field is empty or not. This may be used to include empty 2289 // fields in Patch requests. 2290 ForceSendFields []string `json:"-"` 2291 2292 // NullFields is a list of field names (e.g. 2293 // "CrossRealmTrustAdminServer") to include in API requests with the 2294 // JSON null value. By default, fields with empty values are omitted 2295 // from API requests. However, any field with an empty value appearing 2296 // in NullFields will be sent to the server as null. It is an error if a 2297 // field in this list has a non-empty value. This may be used to include 2298 // null fields in Patch requests. 2299 NullFields []string `json:"-"` 2300 } 2301 2302 func (s *KerberosConfig) MarshalJSON() ([]byte, error) { 2303 type NoMethod KerberosConfig 2304 raw := NoMethod(*s) 2305 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2306 } 2307 2308 // LifecycleConfig: Specifies the cluster auto-delete schedule 2309 // configuration. 2310 type LifecycleConfig struct { 2311 // AutoDeleteTime: Optional. The time when cluster will be auto-deleted. 2312 // (see JSON representation of Timestamp 2313 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 2314 AutoDeleteTime string `json:"autoDeleteTime,omitempty"` 2315 2316 // AutoDeleteTtl: Optional. The lifetime duration of cluster. The 2317 // cluster will be auto-deleted at the end of this period. Minimum value 2318 // is 10 minutes; maximum value is 14 days (see JSON representation of 2319 // Duration 2320 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 2321 AutoDeleteTtl string `json:"autoDeleteTtl,omitempty"` 2322 2323 // IdleDeleteTtl: Optional. The duration to keep the cluster alive while 2324 // idling (when no jobs are running). Passing this threshold will cause 2325 // the cluster to be deleted. Minimum value is 5 minutes; maximum value 2326 // is 14 days (see JSON representation of Duration 2327 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 2328 IdleDeleteTtl string `json:"idleDeleteTtl,omitempty"` 2329 2330 // IdleStartTime: Output only. The time when cluster became idle (most 2331 // recent job finished) and became eligible for deletion due to idleness 2332 // (see JSON representation of Timestamp 2333 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 2334 IdleStartTime string `json:"idleStartTime,omitempty"` 2335 2336 // ForceSendFields is a list of field names (e.g. "AutoDeleteTime") to 2337 // unconditionally include in API requests. By default, fields with 2338 // empty or default values are omitted from API requests. However, any 2339 // non-pointer, non-interface field appearing in ForceSendFields will be 2340 // sent to the server regardless of whether the field is empty or not. 2341 // This may be used to include empty fields in Patch requests. 2342 ForceSendFields []string `json:"-"` 2343 2344 // NullFields is a list of field names (e.g. "AutoDeleteTime") to 2345 // include in API requests with the JSON null value. By default, fields 2346 // with empty values are omitted from API requests. However, any field 2347 // with an empty value appearing in NullFields will be sent to the 2348 // server as null. It is an error if a field in this list has a 2349 // non-empty value. This may be used to include null fields in Patch 2350 // requests. 2351 NullFields []string `json:"-"` 2352 } 2353 2354 func (s *LifecycleConfig) MarshalJSON() ([]byte, error) { 2355 type NoMethod LifecycleConfig 2356 raw := NoMethod(*s) 2357 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2358 } 2359 2360 // ListAutoscalingPoliciesResponse: A response to a request to list 2361 // autoscaling policies in a project. 2362 type ListAutoscalingPoliciesResponse struct { 2363 // NextPageToken: Output only. This token is included in the response if 2364 // there are more results to fetch. 2365 NextPageToken string `json:"nextPageToken,omitempty"` 2366 2367 // Policies: Output only. Autoscaling policies list. 2368 Policies []*AutoscalingPolicy `json:"policies,omitempty"` 2369 2370 // ServerResponse contains the HTTP response code and headers from the 2371 // server. 2372 googleapi.ServerResponse `json:"-"` 2373 2374 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2375 // unconditionally include in API requests. By default, fields with 2376 // empty or default values are omitted from API requests. However, any 2377 // non-pointer, non-interface field appearing in ForceSendFields will be 2378 // sent to the server regardless of whether the field is empty or not. 2379 // This may be used to include empty fields in Patch requests. 2380 ForceSendFields []string `json:"-"` 2381 2382 // NullFields is a list of field names (e.g. "NextPageToken") to include 2383 // in API requests with the JSON null value. By default, fields with 2384 // empty values are omitted from API requests. However, any field with 2385 // an empty value appearing in NullFields will be sent to the server as 2386 // null. It is an error if a field in this list has a non-empty value. 2387 // This may be used to include null fields in Patch requests. 2388 NullFields []string `json:"-"` 2389 } 2390 2391 func (s *ListAutoscalingPoliciesResponse) MarshalJSON() ([]byte, error) { 2392 type NoMethod ListAutoscalingPoliciesResponse 2393 raw := NoMethod(*s) 2394 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2395 } 2396 2397 // ListClustersResponse: The list of all clusters in a project. 2398 type ListClustersResponse struct { 2399 // Clusters: Output only. The clusters in the project. 2400 Clusters []*Cluster `json:"clusters,omitempty"` 2401 2402 // NextPageToken: Output only. This token is included in the response if 2403 // there are more results to fetch. To fetch additional results, provide 2404 // this value as the page_token in a subsequent ListClustersRequest. 2405 NextPageToken string `json:"nextPageToken,omitempty"` 2406 2407 // ServerResponse contains the HTTP response code and headers from the 2408 // server. 2409 googleapi.ServerResponse `json:"-"` 2410 2411 // ForceSendFields is a list of field names (e.g. "Clusters") to 2412 // unconditionally include in API requests. By default, fields with 2413 // empty or default values are omitted from API requests. However, any 2414 // non-pointer, non-interface field appearing in ForceSendFields will be 2415 // sent to the server regardless of whether the field is empty or not. 2416 // This may be used to include empty fields in Patch requests. 2417 ForceSendFields []string `json:"-"` 2418 2419 // NullFields is a list of field names (e.g. "Clusters") to include in 2420 // API requests with the JSON null value. By default, fields with empty 2421 // values are omitted from API requests. However, any field with an 2422 // empty value appearing in NullFields will be sent to the server as 2423 // null. It is an error if a field in this list has a non-empty value. 2424 // This may be used to include null fields in Patch requests. 2425 NullFields []string `json:"-"` 2426 } 2427 2428 func (s *ListClustersResponse) MarshalJSON() ([]byte, error) { 2429 type NoMethod ListClustersResponse 2430 raw := NoMethod(*s) 2431 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2432 } 2433 2434 // ListJobsResponse: A list of jobs in a project. 2435 type ListJobsResponse struct { 2436 // Jobs: Output only. Jobs list. 2437 Jobs []*Job `json:"jobs,omitempty"` 2438 2439 // NextPageToken: Optional. This token is included in the response if 2440 // there are more results to fetch. To fetch additional results, provide 2441 // this value as the page_token in a subsequent ListJobsRequest. 2442 NextPageToken string `json:"nextPageToken,omitempty"` 2443 2444 // ServerResponse contains the HTTP response code and headers from the 2445 // server. 2446 googleapi.ServerResponse `json:"-"` 2447 2448 // ForceSendFields is a list of field names (e.g. "Jobs") to 2449 // unconditionally include in API requests. By default, fields with 2450 // empty or default values are omitted from API requests. However, any 2451 // non-pointer, non-interface field appearing in ForceSendFields will be 2452 // sent to the server regardless of whether the field is empty or not. 2453 // This may be used to include empty fields in Patch requests. 2454 ForceSendFields []string `json:"-"` 2455 2456 // NullFields is a list of field names (e.g. "Jobs") to include in API 2457 // requests with the JSON null value. By default, fields with empty 2458 // values are omitted from API requests. However, any field with an 2459 // empty value appearing in NullFields will be sent to the server as 2460 // null. It is an error if a field in this list has a non-empty value. 2461 // This may be used to include null fields in Patch requests. 2462 NullFields []string `json:"-"` 2463 } 2464 2465 func (s *ListJobsResponse) MarshalJSON() ([]byte, error) { 2466 type NoMethod ListJobsResponse 2467 raw := NoMethod(*s) 2468 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2469 } 2470 2471 // ListOperationsResponse: The response message for 2472 // Operations.ListOperations. 2473 type ListOperationsResponse struct { 2474 // NextPageToken: The standard List next-page token. 2475 NextPageToken string `json:"nextPageToken,omitempty"` 2476 2477 // Operations: A list of operations that matches the specified filter in 2478 // the request. 2479 Operations []*Operation `json:"operations,omitempty"` 2480 2481 // ServerResponse contains the HTTP response code and headers from the 2482 // server. 2483 googleapi.ServerResponse `json:"-"` 2484 2485 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2486 // unconditionally include in API requests. By default, fields with 2487 // empty or default values are omitted from API requests. However, any 2488 // non-pointer, non-interface field appearing in ForceSendFields will be 2489 // sent to the server regardless of whether the field is empty or not. 2490 // This may be used to include empty fields in Patch requests. 2491 ForceSendFields []string `json:"-"` 2492 2493 // NullFields is a list of field names (e.g. "NextPageToken") to include 2494 // in API requests with the JSON null value. By default, fields with 2495 // empty values are omitted from API requests. However, any field with 2496 // an empty value appearing in NullFields will be sent to the server as 2497 // null. It is an error if a field in this list has a non-empty value. 2498 // This may be used to include null fields in Patch requests. 2499 NullFields []string `json:"-"` 2500 } 2501 2502 func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) { 2503 type NoMethod ListOperationsResponse 2504 raw := NoMethod(*s) 2505 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2506 } 2507 2508 // ListWorkflowTemplatesResponse: A response to a request to list 2509 // workflow templates in a project. 2510 type ListWorkflowTemplatesResponse struct { 2511 // NextPageToken: Output only. This token is included in the response if 2512 // there are more results to fetch. To fetch additional results, provide 2513 // this value as the page_token in a subsequent 2514 // ListWorkflowTemplatesRequest. 2515 NextPageToken string `json:"nextPageToken,omitempty"` 2516 2517 // Templates: Output only. WorkflowTemplates list. 2518 Templates []*WorkflowTemplate `json:"templates,omitempty"` 2519 2520 // ServerResponse contains the HTTP response code and headers from the 2521 // server. 2522 googleapi.ServerResponse `json:"-"` 2523 2524 // ForceSendFields is a list of field names (e.g. "NextPageToken") to 2525 // unconditionally include in API requests. By default, fields with 2526 // empty or default values are omitted from API requests. However, any 2527 // non-pointer, non-interface field appearing in ForceSendFields will be 2528 // sent to the server regardless of whether the field is empty or not. 2529 // This may be used to include empty fields in Patch requests. 2530 ForceSendFields []string `json:"-"` 2531 2532 // NullFields is a list of field names (e.g. "NextPageToken") to include 2533 // in API requests with the JSON null value. By default, fields with 2534 // empty values are omitted from API requests. However, any field with 2535 // an empty value appearing in NullFields will be sent to the server as 2536 // null. It is an error if a field in this list has a non-empty value. 2537 // This may be used to include null fields in Patch requests. 2538 NullFields []string `json:"-"` 2539 } 2540 2541 func (s *ListWorkflowTemplatesResponse) MarshalJSON() ([]byte, error) { 2542 type NoMethod ListWorkflowTemplatesResponse 2543 raw := NoMethod(*s) 2544 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2545 } 2546 2547 // LoggingConfig: The runtime logging config of the job. 2548 type LoggingConfig struct { 2549 // DriverLogLevels: The per-package log levels for the driver. This may 2550 // include "root" package name to configure rootLogger. Examples: 2551 // 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG' 2552 DriverLogLevels map[string]string `json:"driverLogLevels,omitempty"` 2553 2554 // ForceSendFields is a list of field names (e.g. "DriverLogLevels") to 2555 // unconditionally include in API requests. By default, fields with 2556 // empty or default values are omitted from API requests. However, any 2557 // non-pointer, non-interface field appearing in ForceSendFields will be 2558 // sent to the server regardless of whether the field is empty or not. 2559 // This may be used to include empty fields in Patch requests. 2560 ForceSendFields []string `json:"-"` 2561 2562 // NullFields is a list of field names (e.g. "DriverLogLevels") to 2563 // include in API requests with the JSON null value. By default, fields 2564 // with empty values are omitted from API requests. However, any field 2565 // with an empty value appearing in NullFields will be sent to the 2566 // server as null. It is an error if a field in this list has a 2567 // non-empty value. This may be used to include null fields in Patch 2568 // requests. 2569 NullFields []string `json:"-"` 2570 } 2571 2572 func (s *LoggingConfig) MarshalJSON() ([]byte, error) { 2573 type NoMethod LoggingConfig 2574 raw := NoMethod(*s) 2575 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2576 } 2577 2578 // ManagedCluster: Cluster that is managed by the workflow. 2579 type ManagedCluster struct { 2580 // ClusterName: Required. The cluster name prefix. A unique cluster name 2581 // will be formed by appending a random suffix.The name must contain 2582 // only lower-case letters (a-z), numbers (0-9), and hyphens (-). Must 2583 // begin with a letter. Cannot begin or end with hyphen. Must consist of 2584 // between 2 and 35 characters. 2585 ClusterName string `json:"clusterName,omitempty"` 2586 2587 // Config: Required. The cluster configuration. 2588 Config *ClusterConfig `json:"config,omitempty"` 2589 2590 // Labels: Optional. The labels to associate with this cluster.Label 2591 // keys must be between 1 and 63 characters long, and must conform to 2592 // the following PCRE regular expression: \p{Ll}\p{Lo}{0,62}Label values 2593 // must be between 1 and 63 characters long, and must conform to the 2594 // following PCRE regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more 2595 // than 32 labels can be associated with a given cluster. 2596 Labels map[string]string `json:"labels,omitempty"` 2597 2598 // ForceSendFields is a list of field names (e.g. "ClusterName") to 2599 // unconditionally include in API requests. By default, fields with 2600 // empty or default values are omitted from API requests. However, any 2601 // non-pointer, non-interface field appearing in ForceSendFields will be 2602 // sent to the server regardless of whether the field is empty or not. 2603 // This may be used to include empty fields in Patch requests. 2604 ForceSendFields []string `json:"-"` 2605 2606 // NullFields is a list of field names (e.g. "ClusterName") to include 2607 // in API requests with the JSON null value. By default, fields with 2608 // empty values are omitted from API requests. However, any field with 2609 // an empty value appearing in NullFields will be sent to the server as 2610 // null. It is an error if a field in this list has a non-empty value. 2611 // This may be used to include null fields in Patch requests. 2612 NullFields []string `json:"-"` 2613 } 2614 2615 func (s *ManagedCluster) MarshalJSON() ([]byte, error) { 2616 type NoMethod ManagedCluster 2617 raw := NoMethod(*s) 2618 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2619 } 2620 2621 // ManagedGroupConfig: Specifies the resources used to actively manage 2622 // an instance group. 2623 type ManagedGroupConfig struct { 2624 // InstanceGroupManagerName: Output only. The name of the Instance Group 2625 // Manager for this group. 2626 InstanceGroupManagerName string `json:"instanceGroupManagerName,omitempty"` 2627 2628 // InstanceTemplateName: Output only. The name of the Instance Template 2629 // used for the Managed Instance Group. 2630 InstanceTemplateName string `json:"instanceTemplateName,omitempty"` 2631 2632 // ForceSendFields is a list of field names (e.g. 2633 // "InstanceGroupManagerName") to unconditionally include in API 2634 // requests. By default, fields with empty or default values are omitted 2635 // from API requests. However, any non-pointer, non-interface field 2636 // appearing in ForceSendFields will be sent to the server regardless of 2637 // whether the field is empty or not. This may be used to include empty 2638 // fields in Patch requests. 2639 ForceSendFields []string `json:"-"` 2640 2641 // NullFields is a list of field names (e.g. "InstanceGroupManagerName") 2642 // to include in API requests with the JSON null value. By default, 2643 // fields with empty values are omitted from API requests. However, any 2644 // field with an empty value appearing in NullFields will be sent to the 2645 // server as null. It is an error if a field in this list has a 2646 // non-empty value. This may be used to include null fields in Patch 2647 // requests. 2648 NullFields []string `json:"-"` 2649 } 2650 2651 func (s *ManagedGroupConfig) MarshalJSON() ([]byte, error) { 2652 type NoMethod ManagedGroupConfig 2653 raw := NoMethod(*s) 2654 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2655 } 2656 2657 // MetastoreConfig: Specifies a Metastore configuration. 2658 type MetastoreConfig struct { 2659 // DataprocMetastoreService: Required. Resource name of an existing 2660 // Dataproc Metastore service.Example: 2661 // projects/[project_id]/locations/[dataproc_region]/services/[service-na 2662 // me] 2663 DataprocMetastoreService string `json:"dataprocMetastoreService,omitempty"` 2664 2665 // ForceSendFields is a list of field names (e.g. 2666 // "DataprocMetastoreService") to unconditionally include in API 2667 // requests. By default, fields with empty or default values are omitted 2668 // from API requests. However, any non-pointer, non-interface field 2669 // appearing in ForceSendFields will be sent to the server regardless of 2670 // whether the field is empty or not. This may be used to include empty 2671 // fields in Patch requests. 2672 ForceSendFields []string `json:"-"` 2673 2674 // NullFields is a list of field names (e.g. "DataprocMetastoreService") 2675 // to include in API requests with the JSON null value. By default, 2676 // fields with empty values are omitted from API requests. However, any 2677 // field with an empty value appearing in NullFields will be sent to the 2678 // server as null. It is an error if a field in this list has a 2679 // non-empty value. This may be used to include null fields in Patch 2680 // requests. 2681 NullFields []string `json:"-"` 2682 } 2683 2684 func (s *MetastoreConfig) MarshalJSON() ([]byte, error) { 2685 type NoMethod MetastoreConfig 2686 raw := NoMethod(*s) 2687 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2688 } 2689 2690 // NamespacedGkeDeploymentTarget: A full, namespace-isolated deployment 2691 // target for an existing GKE cluster. 2692 type NamespacedGkeDeploymentTarget struct { 2693 // ClusterNamespace: Optional. A namespace within the GKE cluster to 2694 // deploy into. 2695 ClusterNamespace string `json:"clusterNamespace,omitempty"` 2696 2697 // TargetGkeCluster: Optional. The target GKE cluster to deploy to. 2698 // Format: 2699 // 'projects/{project}/locations/{location}/clusters/{cluster_id}' 2700 TargetGkeCluster string `json:"targetGkeCluster,omitempty"` 2701 2702 // ForceSendFields is a list of field names (e.g. "ClusterNamespace") to 2703 // unconditionally include in API requests. By default, fields with 2704 // empty or default values are omitted from API requests. However, any 2705 // non-pointer, non-interface field appearing in ForceSendFields will be 2706 // sent to the server regardless of whether the field is empty or not. 2707 // This may be used to include empty fields in Patch requests. 2708 ForceSendFields []string `json:"-"` 2709 2710 // NullFields is a list of field names (e.g. "ClusterNamespace") to 2711 // include in API requests with the JSON null value. By default, fields 2712 // with empty values are omitted from API requests. However, any field 2713 // with an empty value appearing in NullFields will be sent to the 2714 // server as null. It is an error if a field in this list has a 2715 // non-empty value. This may be used to include null fields in Patch 2716 // requests. 2717 NullFields []string `json:"-"` 2718 } 2719 2720 func (s *NamespacedGkeDeploymentTarget) MarshalJSON() ([]byte, error) { 2721 type NoMethod NamespacedGkeDeploymentTarget 2722 raw := NoMethod(*s) 2723 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2724 } 2725 2726 // NodeGroupAffinity: Node Group Affinity for clusters using sole-tenant 2727 // node groups. 2728 type NodeGroupAffinity struct { 2729 // NodeGroupUri: Required. The URI of a sole-tenant node group resource 2730 // (https://cloud.google.com/compute/docs/reference/rest/v1/nodeGroups) 2731 // that the cluster will be created on.A full URL, partial URI, or node 2732 // group name are valid. Examples: 2733 // https://www.googleapis.com/compute/v1/projects/[project_id]/zones/us-central1-a/nodeGroups/node-group-1 2734 // projects/[project_id]/zones/us-central1-a/nodeGroups/node-group-1 2735 // node-group-1 2736 NodeGroupUri string `json:"nodeGroupUri,omitempty"` 2737 2738 // ForceSendFields is a list of field names (e.g. "NodeGroupUri") to 2739 // unconditionally include in API requests. By default, fields with 2740 // empty or default values are omitted from API requests. However, any 2741 // non-pointer, non-interface field appearing in ForceSendFields will be 2742 // sent to the server regardless of whether the field is empty or not. 2743 // This may be used to include empty fields in Patch requests. 2744 ForceSendFields []string `json:"-"` 2745 2746 // NullFields is a list of field names (e.g. "NodeGroupUri") to include 2747 // in API requests with the JSON null value. By default, fields with 2748 // empty values are omitted from API requests. However, any field with 2749 // an empty value appearing in NullFields will be sent to the server as 2750 // null. It is an error if a field in this list has a non-empty value. 2751 // This may be used to include null fields in Patch requests. 2752 NullFields []string `json:"-"` 2753 } 2754 2755 func (s *NodeGroupAffinity) MarshalJSON() ([]byte, error) { 2756 type NoMethod NodeGroupAffinity 2757 raw := NoMethod(*s) 2758 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2759 } 2760 2761 // NodeInitializationAction: Specifies an executable to run on a fully 2762 // configured node and a timeout period for executable completion. 2763 type NodeInitializationAction struct { 2764 // ExecutableFile: Required. Cloud Storage URI of executable file. 2765 ExecutableFile string `json:"executableFile,omitempty"` 2766 2767 // ExecutionTimeout: Optional. Amount of time executable has to 2768 // complete. Default is 10 minutes (see JSON representation of Duration 2769 // (https://developers.google.com/protocol-buffers/docs/proto3#json)).Cluster 2770 // creation fails with an explanatory error message (the name of the 2771 // executable that caused the error and the exceeded timeout period) if 2772 // the executable is not completed at end of the timeout period. 2773 ExecutionTimeout string `json:"executionTimeout,omitempty"` 2774 2775 // ForceSendFields is a list of field names (e.g. "ExecutableFile") to 2776 // unconditionally include in API requests. By default, fields with 2777 // empty or default values are omitted from API requests. However, any 2778 // non-pointer, non-interface field appearing in ForceSendFields will be 2779 // sent to the server regardless of whether the field is empty or not. 2780 // This may be used to include empty fields in Patch requests. 2781 ForceSendFields []string `json:"-"` 2782 2783 // NullFields is a list of field names (e.g. "ExecutableFile") to 2784 // include in API requests with the JSON null value. By default, fields 2785 // with empty values are omitted from API requests. However, any field 2786 // with an empty value appearing in NullFields will be sent to the 2787 // server as null. It is an error if a field in this list has a 2788 // non-empty value. This may be used to include null fields in Patch 2789 // requests. 2790 NullFields []string `json:"-"` 2791 } 2792 2793 func (s *NodeInitializationAction) MarshalJSON() ([]byte, error) { 2794 type NoMethod NodeInitializationAction 2795 raw := NoMethod(*s) 2796 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2797 } 2798 2799 // Operation: This resource represents a long-running operation that is 2800 // the result of a network API call. 2801 type Operation struct { 2802 // Done: If the value is false, it means the operation is still in 2803 // progress. If true, the operation is completed, and either error or 2804 // response is available. 2805 Done bool `json:"done,omitempty"` 2806 2807 // Error: The error result of the operation in case of failure or 2808 // cancellation. 2809 Error *Status `json:"error,omitempty"` 2810 2811 // Metadata: Service-specific metadata associated with the operation. It 2812 // typically contains progress information and common metadata such as 2813 // create time. Some services might not provide such metadata. Any 2814 // method that returns a long-running operation should document the 2815 // metadata type, if any. 2816 Metadata googleapi.RawMessage `json:"metadata,omitempty"` 2817 2818 // Name: The server-assigned name, which is only unique within the same 2819 // service that originally returns it. If you use the default HTTP 2820 // mapping, the name should be a resource name ending with 2821 // operations/{unique_id}. 2822 Name string `json:"name,omitempty"` 2823 2824 // Response: The normal response of the operation in case of success. If 2825 // the original method returns no data on success, such as Delete, the 2826 // response is google.protobuf.Empty. If the original method is standard 2827 // Get/Create/Update, the response should be the resource. For other 2828 // methods, the response should have the type XxxResponse, where Xxx is 2829 // the original method name. For example, if the original method name is 2830 // TakeSnapshot(), the inferred response type is TakeSnapshotResponse. 2831 Response googleapi.RawMessage `json:"response,omitempty"` 2832 2833 // ServerResponse contains the HTTP response code and headers from the 2834 // server. 2835 googleapi.ServerResponse `json:"-"` 2836 2837 // ForceSendFields is a list of field names (e.g. "Done") to 2838 // unconditionally include in API requests. By default, fields with 2839 // empty or default values are omitted from API requests. However, any 2840 // non-pointer, non-interface field appearing in ForceSendFields will be 2841 // sent to the server regardless of whether the field is empty or not. 2842 // This may be used to include empty fields in Patch requests. 2843 ForceSendFields []string `json:"-"` 2844 2845 // NullFields is a list of field names (e.g. "Done") to include in API 2846 // requests with the JSON null value. By default, fields with empty 2847 // values are omitted from API requests. However, any field with an 2848 // empty value appearing in NullFields will be sent to the server as 2849 // null. It is an error if a field in this list has a non-empty value. 2850 // This may be used to include null fields in Patch requests. 2851 NullFields []string `json:"-"` 2852 } 2853 2854 func (s *Operation) MarshalJSON() ([]byte, error) { 2855 type NoMethod Operation 2856 raw := NoMethod(*s) 2857 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2858 } 2859 2860 // OrderedJob: A job executed by the workflow. 2861 type OrderedJob struct { 2862 // HadoopJob: Optional. Job is a Hadoop job. 2863 HadoopJob *HadoopJob `json:"hadoopJob,omitempty"` 2864 2865 // HiveJob: Optional. Job is a Hive job. 2866 HiveJob *HiveJob `json:"hiveJob,omitempty"` 2867 2868 // Labels: Optional. The labels to associate with this job.Label keys 2869 // must be between 1 and 63 characters long, and must conform to the 2870 // following regular expression: \p{Ll}\p{Lo}{0,62}Label values must be 2871 // between 1 and 63 characters long, and must conform to the following 2872 // regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels 2873 // can be associated with a given job. 2874 Labels map[string]string `json:"labels,omitempty"` 2875 2876 // PigJob: Optional. Job is a Pig job. 2877 PigJob *PigJob `json:"pigJob,omitempty"` 2878 2879 // PrerequisiteStepIds: Optional. The optional list of prerequisite job 2880 // step_ids. If not specified, the job will start at the beginning of 2881 // workflow. 2882 PrerequisiteStepIds []string `json:"prerequisiteStepIds,omitempty"` 2883 2884 // PrestoJob: Optional. Job is a Presto job. 2885 PrestoJob *PrestoJob `json:"prestoJob,omitempty"` 2886 2887 // PysparkJob: Optional. Job is a PySpark job. 2888 PysparkJob *PySparkJob `json:"pysparkJob,omitempty"` 2889 2890 // Scheduling: Optional. Job scheduling configuration. 2891 Scheduling *JobScheduling `json:"scheduling,omitempty"` 2892 2893 // SparkJob: Optional. Job is a Spark job. 2894 SparkJob *SparkJob `json:"sparkJob,omitempty"` 2895 2896 // SparkRJob: Optional. Job is a SparkR job. 2897 SparkRJob *SparkRJob `json:"sparkRJob,omitempty"` 2898 2899 // SparkSqlJob: Optional. Job is a SparkSql job. 2900 SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"` 2901 2902 // StepId: Required. The step id. The id must be unique among all jobs 2903 // within the template.The step id is used as prefix for job id, as job 2904 // goog-dataproc-workflow-step-id label, and in prerequisiteStepIds 2905 // field from other steps.The id must contain only letters (a-z, A-Z), 2906 // numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end 2907 // with underscore or hyphen. Must consist of between 3 and 50 2908 // characters. 2909 StepId string `json:"stepId,omitempty"` 2910 2911 // ForceSendFields is a list of field names (e.g. "HadoopJob") to 2912 // unconditionally include in API requests. By default, fields with 2913 // empty or default values are omitted from API requests. However, any 2914 // non-pointer, non-interface field appearing in ForceSendFields will be 2915 // sent to the server regardless of whether the field is empty or not. 2916 // This may be used to include empty fields in Patch requests. 2917 ForceSendFields []string `json:"-"` 2918 2919 // NullFields is a list of field names (e.g. "HadoopJob") to include in 2920 // API requests with the JSON null value. By default, fields with empty 2921 // values are omitted from API requests. However, any field with an 2922 // empty value appearing in NullFields will be sent to the server as 2923 // null. It is an error if a field in this list has a non-empty value. 2924 // This may be used to include null fields in Patch requests. 2925 NullFields []string `json:"-"` 2926 } 2927 2928 func (s *OrderedJob) MarshalJSON() ([]byte, error) { 2929 type NoMethod OrderedJob 2930 raw := NoMethod(*s) 2931 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2932 } 2933 2934 // ParameterValidation: Configuration for parameter validation. 2935 type ParameterValidation struct { 2936 // Regex: Validation based on regular expressions. 2937 Regex *RegexValidation `json:"regex,omitempty"` 2938 2939 // Values: Validation based on a list of allowed values. 2940 Values *ValueValidation `json:"values,omitempty"` 2941 2942 // ForceSendFields is a list of field names (e.g. "Regex") to 2943 // unconditionally include in API requests. By default, fields with 2944 // empty or default values are omitted from API requests. However, any 2945 // non-pointer, non-interface field appearing in ForceSendFields will be 2946 // sent to the server regardless of whether the field is empty or not. 2947 // This may be used to include empty fields in Patch requests. 2948 ForceSendFields []string `json:"-"` 2949 2950 // NullFields is a list of field names (e.g. "Regex") to include in API 2951 // requests with the JSON null value. By default, fields with empty 2952 // values are omitted from API requests. However, any field with an 2953 // empty value appearing in NullFields will be sent to the server as 2954 // null. It is an error if a field in this list has a non-empty value. 2955 // This may be used to include null fields in Patch requests. 2956 NullFields []string `json:"-"` 2957 } 2958 2959 func (s *ParameterValidation) MarshalJSON() ([]byte, error) { 2960 type NoMethod ParameterValidation 2961 raw := NoMethod(*s) 2962 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 2963 } 2964 2965 // PigJob: A Dataproc job for running Apache Pig 2966 // (https://pig.apache.org/) queries on YARN. 2967 type PigJob struct { 2968 // ContinueOnFailure: Optional. Whether to continue executing queries if 2969 // a query fails. The default value is false. Setting to true can be 2970 // useful when executing independent parallel queries. 2971 ContinueOnFailure bool `json:"continueOnFailure,omitempty"` 2972 2973 // JarFileUris: Optional. HCFS URIs of jar files to add to the CLASSPATH 2974 // of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig 2975 // UDFs. 2976 JarFileUris []string `json:"jarFileUris,omitempty"` 2977 2978 // LoggingConfig: Optional. The runtime log config for job execution. 2979 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 2980 2981 // Properties: Optional. A mapping of property names to values, used to 2982 // configure Pig. Properties that conflict with values set by the 2983 // Dataproc API may be overwritten. Can include properties set in 2984 // /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and 2985 // classes in user code. 2986 Properties map[string]string `json:"properties,omitempty"` 2987 2988 // QueryFileUri: The HCFS URI of the script that contains the Pig 2989 // queries. 2990 QueryFileUri string `json:"queryFileUri,omitempty"` 2991 2992 // QueryList: A list of queries. 2993 QueryList *QueryList `json:"queryList,omitempty"` 2994 2995 // ScriptVariables: Optional. Mapping of query variable names to values 2996 // (equivalent to the Pig command: name=[value]). 2997 ScriptVariables map[string]string `json:"scriptVariables,omitempty"` 2998 2999 // ForceSendFields is a list of field names (e.g. "ContinueOnFailure") 3000 // to unconditionally include in API requests. By default, fields with 3001 // empty or default values are omitted from API requests. However, any 3002 // non-pointer, non-interface field appearing in ForceSendFields will be 3003 // sent to the server regardless of whether the field is empty or not. 3004 // This may be used to include empty fields in Patch requests. 3005 ForceSendFields []string `json:"-"` 3006 3007 // NullFields is a list of field names (e.g. "ContinueOnFailure") to 3008 // include in API requests with the JSON null value. By default, fields 3009 // with empty values are omitted from API requests. However, any field 3010 // with an empty value appearing in NullFields will be sent to the 3011 // server as null. It is an error if a field in this list has a 3012 // non-empty value. This may be used to include null fields in Patch 3013 // requests. 3014 NullFields []string `json:"-"` 3015 } 3016 3017 func (s *PigJob) MarshalJSON() ([]byte, error) { 3018 type NoMethod PigJob 3019 raw := NoMethod(*s) 3020 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3021 } 3022 3023 // Policy: An Identity and Access Management (IAM) policy, which 3024 // specifies access controls for Google Cloud resources.A Policy is a 3025 // collection of bindings. A binding binds one or more members to a 3026 // single role. Members can be user accounts, service accounts, Google 3027 // groups, and domains (such as G Suite). A role is a named list of 3028 // permissions; each role can be an IAM predefined role or a 3029 // user-created custom role.For some types of Google Cloud resources, a 3030 // binding can also specify a condition, which is a logical expression 3031 // that allows access to a resource only if the expression evaluates to 3032 // true. A condition can add constraints based on attributes of the 3033 // request, the resource, or both. To learn which resources support 3034 // conditions in their IAM policies, see the IAM documentation 3035 // (https://cloud.google.com/iam/help/conditions/resource-policies).JSON 3036 // example: { "bindings": [ { "role": 3037 // "roles/resourcemanager.organizationAdmin", "members": [ 3038 // "user:mike@example.com", "group:admins@example.com", 3039 // "domain:google.com", 3040 // "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { 3041 // "role": "roles/resourcemanager.organizationViewer", "members": [ 3042 // "user:eve@example.com" ], "condition": { "title": "expirable access", 3043 // "description": "Does not grant access after Sep 2020", "expression": 3044 // "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], 3045 // "etag": "BwWWja0YfJA=", "version": 3 } YAML example: bindings: - 3046 // members: - user:mike@example.com - group:admins@example.com - 3047 // domain:google.com - 3048 // serviceAccount:my-project-id@appspot.gserviceaccount.com role: 3049 // roles/resourcemanager.organizationAdmin - members: - 3050 // user:eve@example.com role: roles/resourcemanager.organizationViewer 3051 // condition: title: expirable access description: Does not grant access 3052 // after Sep 2020 expression: request.time < 3053 // timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3 3054 // For a description of IAM and its features, see the IAM documentation 3055 // (https://cloud.google.com/iam/docs/). 3056 type Policy struct { 3057 // Bindings: Associates a list of members to a role. Optionally, may 3058 // specify a condition that determines how and when the bindings are 3059 // applied. Each of the bindings must contain at least one member. 3060 Bindings []*Binding `json:"bindings,omitempty"` 3061 3062 // Etag: etag is used for optimistic concurrency control as a way to 3063 // help prevent simultaneous updates of a policy from overwriting each 3064 // other. It is strongly suggested that systems make use of the etag in 3065 // the read-modify-write cycle to perform policy updates in order to 3066 // avoid race conditions: An etag is returned in the response to 3067 // getIamPolicy, and systems are expected to put that etag in the 3068 // request to setIamPolicy to ensure that their change will be applied 3069 // to the same version of the policy.Important: If you use IAM 3070 // Conditions, you must include the etag field whenever you call 3071 // setIamPolicy. If you omit this field, then IAM allows you to 3072 // overwrite a version 3 policy with a version 1 policy, and all of the 3073 // conditions in the version 3 policy are lost. 3074 Etag string `json:"etag,omitempty"` 3075 3076 // Version: Specifies the format of the policy.Valid values are 0, 1, 3077 // and 3. Requests that specify an invalid value are rejected.Any 3078 // operation that affects conditional role bindings must specify version 3079 // 3. This requirement applies to the following operations: Getting a 3080 // policy that includes a conditional role binding Adding a conditional 3081 // role binding to a policy Changing a conditional role binding in a 3082 // policy Removing any role binding, with or without a condition, from a 3083 // policy that includes conditionsImportant: If you use IAM Conditions, 3084 // you must include the etag field whenever you call setIamPolicy. If 3085 // you omit this field, then IAM allows you to overwrite a version 3 3086 // policy with a version 1 policy, and all of the conditions in the 3087 // version 3 policy are lost.If a policy does not include any 3088 // conditions, operations on that policy may specify any valid version 3089 // or leave the field unset.To learn which resources support conditions 3090 // in their IAM policies, see the IAM documentation 3091 // (https://cloud.google.com/iam/help/conditions/resource-policies). 3092 Version int64 `json:"version,omitempty"` 3093 3094 // ServerResponse contains the HTTP response code and headers from the 3095 // server. 3096 googleapi.ServerResponse `json:"-"` 3097 3098 // ForceSendFields is a list of field names (e.g. "Bindings") to 3099 // unconditionally include in API requests. By default, fields with 3100 // empty or default values are omitted from API requests. However, any 3101 // non-pointer, non-interface field appearing in ForceSendFields will be 3102 // sent to the server regardless of whether the field is empty or not. 3103 // This may be used to include empty fields in Patch requests. 3104 ForceSendFields []string `json:"-"` 3105 3106 // NullFields is a list of field names (e.g. "Bindings") to include in 3107 // API requests with the JSON null value. By default, fields with empty 3108 // values are omitted from API requests. However, any field with an 3109 // empty value appearing in NullFields will be sent to the server as 3110 // null. It is an error if a field in this list has a non-empty value. 3111 // This may be used to include null fields in Patch requests. 3112 NullFields []string `json:"-"` 3113 } 3114 3115 func (s *Policy) MarshalJSON() ([]byte, error) { 3116 type NoMethod Policy 3117 raw := NoMethod(*s) 3118 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3119 } 3120 3121 // PrestoJob: A Dataproc job for running Presto (https://prestosql.io/) 3122 // queries. IMPORTANT: The Dataproc Presto Optional Component 3123 // (https://cloud.google.com/dataproc/docs/concepts/components/presto) 3124 // must be enabled when the cluster is created to submit a Presto job to 3125 // the cluster. 3126 type PrestoJob struct { 3127 // ClientTags: Optional. Presto client tags to attach to this query 3128 ClientTags []string `json:"clientTags,omitempty"` 3129 3130 // ContinueOnFailure: Optional. Whether to continue executing queries if 3131 // a query fails. The default value is false. Setting to true can be 3132 // useful when executing independent parallel queries. 3133 ContinueOnFailure bool `json:"continueOnFailure,omitempty"` 3134 3135 // LoggingConfig: Optional. The runtime log config for job execution. 3136 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3137 3138 // OutputFormat: Optional. The format in which query output will be 3139 // displayed. See the Presto documentation for supported output formats 3140 OutputFormat string `json:"outputFormat,omitempty"` 3141 3142 // Properties: Optional. A mapping of property names to values. Used to 3143 // set Presto session properties 3144 // (https://prestodb.io/docs/current/sql/set-session.html) Equivalent to 3145 // using the --session flag in the Presto CLI 3146 Properties map[string]string `json:"properties,omitempty"` 3147 3148 // QueryFileUri: The HCFS URI of the script that contains SQL queries. 3149 QueryFileUri string `json:"queryFileUri,omitempty"` 3150 3151 // QueryList: A list of queries. 3152 QueryList *QueryList `json:"queryList,omitempty"` 3153 3154 // ForceSendFields is a list of field names (e.g. "ClientTags") to 3155 // unconditionally include in API requests. By default, fields with 3156 // empty or default values are omitted from API requests. However, any 3157 // non-pointer, non-interface field appearing in ForceSendFields will be 3158 // sent to the server regardless of whether the field is empty or not. 3159 // This may be used to include empty fields in Patch requests. 3160 ForceSendFields []string `json:"-"` 3161 3162 // NullFields is a list of field names (e.g. "ClientTags") to include in 3163 // API requests with the JSON null value. By default, fields with empty 3164 // values are omitted from API requests. However, any field with an 3165 // empty value appearing in NullFields will be sent to the server as 3166 // null. It is an error if a field in this list has a non-empty value. 3167 // This may be used to include null fields in Patch requests. 3168 NullFields []string `json:"-"` 3169 } 3170 3171 func (s *PrestoJob) MarshalJSON() ([]byte, error) { 3172 type NoMethod PrestoJob 3173 raw := NoMethod(*s) 3174 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3175 } 3176 3177 // PySparkJob: A Dataproc job for running Apache PySpark 3178 // (https://spark.apache.org/docs/0.9.0/python-programming-guide.html) 3179 // applications on YARN. 3180 type PySparkJob struct { 3181 // ArchiveUris: Optional. HCFS URIs of archives to be extracted into the 3182 // working directory of each executor. Supported file types: .jar, .tar, 3183 // .tar.gz, .tgz, and .zip. 3184 ArchiveUris []string `json:"archiveUris,omitempty"` 3185 3186 // Args: Optional. The arguments to pass to the driver. Do not include 3187 // arguments, such as --conf, that can be set as job properties, since a 3188 // collision may occur that causes an incorrect job submission. 3189 Args []string `json:"args,omitempty"` 3190 3191 // FileUris: Optional. HCFS URIs of files to be placed in the working 3192 // directory of each executor. Useful for naively parallel tasks. 3193 FileUris []string `json:"fileUris,omitempty"` 3194 3195 // JarFileUris: Optional. HCFS URIs of jar files to add to the 3196 // CLASSPATHs of the Python driver and tasks. 3197 JarFileUris []string `json:"jarFileUris,omitempty"` 3198 3199 // LoggingConfig: Optional. The runtime log config for job execution. 3200 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3201 3202 // MainPythonFileUri: Required. The HCFS URI of the main Python file to 3203 // use as the driver. Must be a .py file. 3204 MainPythonFileUri string `json:"mainPythonFileUri,omitempty"` 3205 3206 // Properties: Optional. A mapping of property names to values, used to 3207 // configure PySpark. Properties that conflict with values set by the 3208 // Dataproc API may be overwritten. Can include properties set in 3209 // /etc/spark/conf/spark-defaults.conf and classes in user code. 3210 Properties map[string]string `json:"properties,omitempty"` 3211 3212 // PythonFileUris: Optional. HCFS file URIs of Python files to pass to 3213 // the PySpark framework. Supported file types: .py, .egg, and .zip. 3214 PythonFileUris []string `json:"pythonFileUris,omitempty"` 3215 3216 // ForceSendFields is a list of field names (e.g. "ArchiveUris") to 3217 // unconditionally include in API requests. By default, fields with 3218 // empty or default values are omitted from API requests. However, any 3219 // non-pointer, non-interface field appearing in ForceSendFields will be 3220 // sent to the server regardless of whether the field is empty or not. 3221 // This may be used to include empty fields in Patch requests. 3222 ForceSendFields []string `json:"-"` 3223 3224 // NullFields is a list of field names (e.g. "ArchiveUris") to include 3225 // in API requests with the JSON null value. By default, fields with 3226 // empty values are omitted from API requests. However, any field with 3227 // an empty value appearing in NullFields will be sent to the server as 3228 // null. It is an error if a field in this list has a non-empty value. 3229 // This may be used to include null fields in Patch requests. 3230 NullFields []string `json:"-"` 3231 } 3232 3233 func (s *PySparkJob) MarshalJSON() ([]byte, error) { 3234 type NoMethod PySparkJob 3235 raw := NoMethod(*s) 3236 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3237 } 3238 3239 // QueryList: A list of queries to run on a cluster. 3240 type QueryList struct { 3241 // Queries: Required. The queries to execute. You do not need to end a 3242 // query expression with a semicolon. Multiple queries can be specified 3243 // in one string by separating each with a semicolon. Here is an example 3244 // of a Dataproc API snippet that uses a QueryList to specify a HiveJob: 3245 // "hiveJob": { "queryList": { "queries": [ "query1", "query2", 3246 // "query3;query4", ] } } 3247 Queries []string `json:"queries,omitempty"` 3248 3249 // ForceSendFields is a list of field names (e.g. "Queries") to 3250 // unconditionally include in API requests. By default, fields with 3251 // empty or default values are omitted from API requests. However, any 3252 // non-pointer, non-interface field appearing in ForceSendFields will be 3253 // sent to the server regardless of whether the field is empty or not. 3254 // This may be used to include empty fields in Patch requests. 3255 ForceSendFields []string `json:"-"` 3256 3257 // NullFields is a list of field names (e.g. "Queries") to include in 3258 // API requests with the JSON null value. By default, fields with empty 3259 // values are omitted from API requests. However, any field with an 3260 // empty value appearing in NullFields will be sent to the server as 3261 // null. It is an error if a field in this list has a non-empty value. 3262 // This may be used to include null fields in Patch requests. 3263 NullFields []string `json:"-"` 3264 } 3265 3266 func (s *QueryList) MarshalJSON() ([]byte, error) { 3267 type NoMethod QueryList 3268 raw := NoMethod(*s) 3269 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3270 } 3271 3272 // RegexValidation: Validation based on regular expressions. 3273 type RegexValidation struct { 3274 // Regexes: Required. RE2 regular expressions used to validate the 3275 // parameter's value. The value must match the regex in its entirety 3276 // (substring matches are not sufficient). 3277 Regexes []string `json:"regexes,omitempty"` 3278 3279 // ForceSendFields is a list of field names (e.g. "Regexes") to 3280 // unconditionally include in API requests. By default, fields with 3281 // empty or default values are omitted from API requests. However, any 3282 // non-pointer, non-interface field appearing in ForceSendFields will be 3283 // sent to the server regardless of whether the field is empty or not. 3284 // This may be used to include empty fields in Patch requests. 3285 ForceSendFields []string `json:"-"` 3286 3287 // NullFields is a list of field names (e.g. "Regexes") to include in 3288 // API requests with the JSON null value. By default, fields with empty 3289 // values are omitted from API requests. However, any field with an 3290 // empty value appearing in NullFields will be sent to the server as 3291 // null. It is an error if a field in this list has a non-empty value. 3292 // This may be used to include null fields in Patch requests. 3293 NullFields []string `json:"-"` 3294 } 3295 3296 func (s *RegexValidation) MarshalJSON() ([]byte, error) { 3297 type NoMethod RegexValidation 3298 raw := NoMethod(*s) 3299 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3300 } 3301 3302 // ReservationAffinity: Reservation Affinity for consuming Zonal 3303 // reservation. 3304 type ReservationAffinity struct { 3305 // ConsumeReservationType: Optional. Type of reservation to consume 3306 // 3307 // Possible values: 3308 // "TYPE_UNSPECIFIED" 3309 // "NO_RESERVATION" - Do not consume from any allocated capacity. 3310 // "ANY_RESERVATION" - Consume any reservation available. 3311 // "SPECIFIC_RESERVATION" - Must consume from a specific reservation. 3312 // Must specify key value fields for specifying the reservations. 3313 ConsumeReservationType string `json:"consumeReservationType,omitempty"` 3314 3315 // Key: Optional. Corresponds to the label key of reservation resource. 3316 Key string `json:"key,omitempty"` 3317 3318 // Values: Optional. Corresponds to the label values of reservation 3319 // resource. 3320 Values []string `json:"values,omitempty"` 3321 3322 // ForceSendFields is a list of field names (e.g. 3323 // "ConsumeReservationType") to unconditionally include in API requests. 3324 // By default, fields with empty or default values are omitted from API 3325 // requests. However, any non-pointer, non-interface field appearing in 3326 // ForceSendFields will be sent to the server regardless of whether the 3327 // field is empty or not. This may be used to include empty fields in 3328 // Patch requests. 3329 ForceSendFields []string `json:"-"` 3330 3331 // NullFields is a list of field names (e.g. "ConsumeReservationType") 3332 // to include in API requests with the JSON null value. By default, 3333 // fields with empty values are omitted from API requests. However, any 3334 // field with an empty value appearing in NullFields will be sent to the 3335 // server as null. It is an error if a field in this list has a 3336 // non-empty value. This may be used to include null fields in Patch 3337 // requests. 3338 NullFields []string `json:"-"` 3339 } 3340 3341 func (s *ReservationAffinity) MarshalJSON() ([]byte, error) { 3342 type NoMethod ReservationAffinity 3343 raw := NoMethod(*s) 3344 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3345 } 3346 3347 // SecurityConfig: Security related configuration, including encryption, 3348 // Kerberos, etc. 3349 type SecurityConfig struct { 3350 // KerberosConfig: Optional. Kerberos related configuration. 3351 KerberosConfig *KerberosConfig `json:"kerberosConfig,omitempty"` 3352 3353 // ForceSendFields is a list of field names (e.g. "KerberosConfig") to 3354 // unconditionally include in API requests. By default, fields with 3355 // empty or default values are omitted from API requests. However, any 3356 // non-pointer, non-interface field appearing in ForceSendFields will be 3357 // sent to the server regardless of whether the field is empty or not. 3358 // This may be used to include empty fields in Patch requests. 3359 ForceSendFields []string `json:"-"` 3360 3361 // NullFields is a list of field names (e.g. "KerberosConfig") to 3362 // include in API requests with the JSON null value. By default, fields 3363 // with empty values are omitted from API requests. However, any field 3364 // with an empty value appearing in NullFields will be sent to the 3365 // server as null. It is an error if a field in this list has a 3366 // non-empty value. This may be used to include null fields in Patch 3367 // requests. 3368 NullFields []string `json:"-"` 3369 } 3370 3371 func (s *SecurityConfig) MarshalJSON() ([]byte, error) { 3372 type NoMethod SecurityConfig 3373 raw := NoMethod(*s) 3374 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3375 } 3376 3377 // SetIamPolicyRequest: Request message for SetIamPolicy method. 3378 type SetIamPolicyRequest struct { 3379 // Policy: REQUIRED: The complete policy to be applied to the resource. 3380 // The size of the policy is limited to a few 10s of KB. An empty policy 3381 // is a valid policy but certain Cloud Platform services (such as 3382 // Projects) might reject them. 3383 Policy *Policy `json:"policy,omitempty"` 3384 3385 // ForceSendFields is a list of field names (e.g. "Policy") to 3386 // unconditionally include in API requests. By default, fields with 3387 // empty or default values are omitted from API requests. However, any 3388 // non-pointer, non-interface field appearing in ForceSendFields will be 3389 // sent to the server regardless of whether the field is empty or not. 3390 // This may be used to include empty fields in Patch requests. 3391 ForceSendFields []string `json:"-"` 3392 3393 // NullFields is a list of field names (e.g. "Policy") to include in API 3394 // requests with the JSON null value. By default, fields with empty 3395 // values are omitted from API requests. However, any field with an 3396 // empty value appearing in NullFields will be sent to the server as 3397 // null. It is an error if a field in this list has a non-empty value. 3398 // This may be used to include null fields in Patch requests. 3399 NullFields []string `json:"-"` 3400 } 3401 3402 func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) { 3403 type NoMethod SetIamPolicyRequest 3404 raw := NoMethod(*s) 3405 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3406 } 3407 3408 // ShieldedInstanceConfig: Shielded Instance Config for clusters using 3409 // Compute Engine Shielded VMs 3410 // (https://cloud.google.com/security/shielded-cloud/shielded-vm). 3411 type ShieldedInstanceConfig struct { 3412 // EnableIntegrityMonitoring: Optional. Defines whether instances have 3413 // integrity monitoring enabled. 3414 EnableIntegrityMonitoring bool `json:"enableIntegrityMonitoring,omitempty"` 3415 3416 // EnableSecureBoot: Optional. Defines whether instances have Secure 3417 // Boot enabled. 3418 EnableSecureBoot bool `json:"enableSecureBoot,omitempty"` 3419 3420 // EnableVtpm: Optional. Defines whether instances have the vTPM 3421 // enabled. 3422 EnableVtpm bool `json:"enableVtpm,omitempty"` 3423 3424 // ForceSendFields is a list of field names (e.g. 3425 // "EnableIntegrityMonitoring") to unconditionally include in API 3426 // requests. By default, fields with empty or default values are omitted 3427 // from API requests. However, any non-pointer, non-interface field 3428 // appearing in ForceSendFields will be sent to the server regardless of 3429 // whether the field is empty or not. This may be used to include empty 3430 // fields in Patch requests. 3431 ForceSendFields []string `json:"-"` 3432 3433 // NullFields is a list of field names (e.g. 3434 // "EnableIntegrityMonitoring") to include in API requests with the JSON 3435 // null value. By default, fields with empty values are omitted from API 3436 // requests. However, any field with an empty value appearing in 3437 // NullFields will be sent to the server as null. It is an error if a 3438 // field in this list has a non-empty value. This may be used to include 3439 // null fields in Patch requests. 3440 NullFields []string `json:"-"` 3441 } 3442 3443 func (s *ShieldedInstanceConfig) MarshalJSON() ([]byte, error) { 3444 type NoMethod ShieldedInstanceConfig 3445 raw := NoMethod(*s) 3446 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3447 } 3448 3449 // SoftwareConfig: Specifies the selection and config of software inside 3450 // the cluster. 3451 type SoftwareConfig struct { 3452 // ImageVersion: Optional. The version of software inside the cluster. 3453 // It must be one of the supported Dataproc Versions 3454 // (https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#supported_dataproc_versions), 3455 // such as "1.2" (including a subminor version, such as "1.2.29"), or 3456 // the "preview" version 3457 // (https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#other_versions). 3458 // If unspecified, it defaults to the latest Debian version. 3459 ImageVersion string `json:"imageVersion,omitempty"` 3460 3461 // OptionalComponents: The set of optional components to activate on the 3462 // cluster. 3463 // 3464 // Possible values: 3465 // "COMPONENT_UNSPECIFIED" - Unspecified component. Specifying this 3466 // will cause Cluster creation to fail. 3467 // "ANACONDA" - The Anaconda python distribution. The Anaconda 3468 // component is not supported in the Dataproc 2.0 image. The 2.0 image 3469 // is pre-installed with Miniconda. 3470 // "DOCKER" - Docker 3471 // "DRUID" - The Druid query engine. 3472 // "FLINK" - Flink 3473 // "HBASE" - HBase. 3474 // "HIVE_WEBHCAT" - The Hive Web HCatalog (the REST service for 3475 // accessing HCatalog). 3476 // "JUPYTER" - The Jupyter Notebook. 3477 // "KERBEROS" - The Kerberos security feature. 3478 // "PRESTO" - The Presto query engine. 3479 // "RANGER" - The Ranger service. 3480 // "SOLR" - The Solr service. 3481 // "ZEPPELIN" - The Zeppelin notebook. 3482 // "ZOOKEEPER" - The Zookeeper service. 3483 OptionalComponents []string `json:"optionalComponents,omitempty"` 3484 3485 // Properties: Optional. The properties to set on daemon config 3486 // files.Property keys are specified in prefix:property format, for 3487 // example core:hadoop.tmp.dir. The following are supported prefixes and 3488 // their mappings: capacity-scheduler: capacity-scheduler.xml core: 3489 // core-site.xml distcp: distcp-default.xml hdfs: hdfs-site.xml hive: 3490 // hive-site.xml mapred: mapred-site.xml pig: pig.properties spark: 3491 // spark-defaults.conf yarn: yarn-site.xmlFor more information, see 3492 // Cluster properties 3493 // (https://cloud.google.com/dataproc/docs/concepts/cluster-properties). 3494 Properties map[string]string `json:"properties,omitempty"` 3495 3496 // ForceSendFields is a list of field names (e.g. "ImageVersion") to 3497 // unconditionally include in API requests. By default, fields with 3498 // empty or default values are omitted from API requests. However, any 3499 // non-pointer, non-interface field appearing in ForceSendFields will be 3500 // sent to the server regardless of whether the field is empty or not. 3501 // This may be used to include empty fields in Patch requests. 3502 ForceSendFields []string `json:"-"` 3503 3504 // NullFields is a list of field names (e.g. "ImageVersion") to include 3505 // in API requests with the JSON null value. By default, fields with 3506 // empty values are omitted from API requests. However, any field with 3507 // an empty value appearing in NullFields will be sent to the server as 3508 // null. It is an error if a field in this list has a non-empty value. 3509 // This may be used to include null fields in Patch requests. 3510 NullFields []string `json:"-"` 3511 } 3512 3513 func (s *SoftwareConfig) MarshalJSON() ([]byte, error) { 3514 type NoMethod SoftwareConfig 3515 raw := NoMethod(*s) 3516 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3517 } 3518 3519 // SparkJob: A Dataproc job for running Apache Spark 3520 // (http://spark.apache.org/) applications on YARN. The specification of 3521 // the main method to call to drive the job. Specify either the jar file 3522 // that contains the main class or the main class name. To pass both a 3523 // main jar and a main class in that jar, add the jar to 3524 // CommonJob.jar_file_uris, and then specify the main class name in 3525 // main_class. 3526 type SparkJob struct { 3527 // ArchiveUris: Optional. HCFS URIs of archives to be extracted into the 3528 // working directory of each executor. Supported file types: .jar, .tar, 3529 // .tar.gz, .tgz, and .zip. 3530 ArchiveUris []string `json:"archiveUris,omitempty"` 3531 3532 // Args: Optional. The arguments to pass to the driver. Do not include 3533 // arguments, such as --conf, that can be set as job properties, since a 3534 // collision may occur that causes an incorrect job submission. 3535 Args []string `json:"args,omitempty"` 3536 3537 // FileUris: Optional. HCFS URIs of files to be placed in the working 3538 // directory of each executor. Useful for naively parallel tasks. 3539 FileUris []string `json:"fileUris,omitempty"` 3540 3541 // JarFileUris: Optional. HCFS URIs of jar files to add to the 3542 // CLASSPATHs of the Spark driver and tasks. 3543 JarFileUris []string `json:"jarFileUris,omitempty"` 3544 3545 // LoggingConfig: Optional. The runtime log config for job execution. 3546 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3547 3548 // MainClass: The name of the driver's main class. The jar file that 3549 // contains the class must be in the default CLASSPATH or specified in 3550 // jar_file_uris. 3551 MainClass string `json:"mainClass,omitempty"` 3552 3553 // MainJarFileUri: The HCFS URI of the jar file that contains the main 3554 // class. 3555 MainJarFileUri string `json:"mainJarFileUri,omitempty"` 3556 3557 // Properties: Optional. A mapping of property names to values, used to 3558 // configure Spark. Properties that conflict with values set by the 3559 // Dataproc API may be overwritten. Can include properties set in 3560 // /etc/spark/conf/spark-defaults.conf and classes in user code. 3561 Properties map[string]string `json:"properties,omitempty"` 3562 3563 // ForceSendFields is a list of field names (e.g. "ArchiveUris") to 3564 // unconditionally include in API requests. By default, fields with 3565 // empty or default values are omitted from API requests. However, any 3566 // non-pointer, non-interface field appearing in ForceSendFields will be 3567 // sent to the server regardless of whether the field is empty or not. 3568 // This may be used to include empty fields in Patch requests. 3569 ForceSendFields []string `json:"-"` 3570 3571 // NullFields is a list of field names (e.g. "ArchiveUris") to include 3572 // in API requests with the JSON null value. By default, fields with 3573 // empty values are omitted from API requests. However, any field with 3574 // an empty value appearing in NullFields will be sent to the server as 3575 // null. It is an error if a field in this list has a non-empty value. 3576 // This may be used to include null fields in Patch requests. 3577 NullFields []string `json:"-"` 3578 } 3579 3580 func (s *SparkJob) MarshalJSON() ([]byte, error) { 3581 type NoMethod SparkJob 3582 raw := NoMethod(*s) 3583 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3584 } 3585 3586 // SparkRJob: A Dataproc job for running Apache SparkR 3587 // (https://spark.apache.org/docs/latest/sparkr.html) applications on 3588 // YARN. 3589 type SparkRJob struct { 3590 // ArchiveUris: Optional. HCFS URIs of archives to be extracted into the 3591 // working directory of each executor. Supported file types: .jar, .tar, 3592 // .tar.gz, .tgz, and .zip. 3593 ArchiveUris []string `json:"archiveUris,omitempty"` 3594 3595 // Args: Optional. The arguments to pass to the driver. Do not include 3596 // arguments, such as --conf, that can be set as job properties, since a 3597 // collision may occur that causes an incorrect job submission. 3598 Args []string `json:"args,omitempty"` 3599 3600 // FileUris: Optional. HCFS URIs of files to be placed in the working 3601 // directory of each executor. Useful for naively parallel tasks. 3602 FileUris []string `json:"fileUris,omitempty"` 3603 3604 // LoggingConfig: Optional. The runtime log config for job execution. 3605 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3606 3607 // MainRFileUri: Required. The HCFS URI of the main R file to use as the 3608 // driver. Must be a .R file. 3609 MainRFileUri string `json:"mainRFileUri,omitempty"` 3610 3611 // Properties: Optional. A mapping of property names to values, used to 3612 // configure SparkR. Properties that conflict with values set by the 3613 // Dataproc API may be overwritten. Can include properties set in 3614 // /etc/spark/conf/spark-defaults.conf and classes in user code. 3615 Properties map[string]string `json:"properties,omitempty"` 3616 3617 // ForceSendFields is a list of field names (e.g. "ArchiveUris") to 3618 // unconditionally include in API requests. By default, fields with 3619 // empty or default values are omitted from API requests. However, any 3620 // non-pointer, non-interface field appearing in ForceSendFields will be 3621 // sent to the server regardless of whether the field is empty or not. 3622 // This may be used to include empty fields in Patch requests. 3623 ForceSendFields []string `json:"-"` 3624 3625 // NullFields is a list of field names (e.g. "ArchiveUris") to include 3626 // in API requests with the JSON null value. By default, fields with 3627 // empty values are omitted from API requests. However, any field with 3628 // an empty value appearing in NullFields will be sent to the server as 3629 // null. It is an error if a field in this list has a non-empty value. 3630 // This may be used to include null fields in Patch requests. 3631 NullFields []string `json:"-"` 3632 } 3633 3634 func (s *SparkRJob) MarshalJSON() ([]byte, error) { 3635 type NoMethod SparkRJob 3636 raw := NoMethod(*s) 3637 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3638 } 3639 3640 // SparkSqlJob: A Dataproc job for running Apache Spark SQL 3641 // (http://spark.apache.org/sql/) queries. 3642 type SparkSqlJob struct { 3643 // JarFileUris: Optional. HCFS URIs of jar files to be added to the 3644 // Spark CLASSPATH. 3645 JarFileUris []string `json:"jarFileUris,omitempty"` 3646 3647 // LoggingConfig: Optional. The runtime log config for job execution. 3648 LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"` 3649 3650 // Properties: Optional. A mapping of property names to values, used to 3651 // configure Spark SQL's SparkConf. Properties that conflict with values 3652 // set by the Dataproc API may be overwritten. 3653 Properties map[string]string `json:"properties,omitempty"` 3654 3655 // QueryFileUri: The HCFS URI of the script that contains SQL queries. 3656 QueryFileUri string `json:"queryFileUri,omitempty"` 3657 3658 // QueryList: A list of queries. 3659 QueryList *QueryList `json:"queryList,omitempty"` 3660 3661 // ScriptVariables: Optional. Mapping of query variable names to values 3662 // (equivalent to the Spark SQL command: SET name="value";). 3663 ScriptVariables map[string]string `json:"scriptVariables,omitempty"` 3664 3665 // ForceSendFields is a list of field names (e.g. "JarFileUris") to 3666 // unconditionally include in API requests. By default, fields with 3667 // empty or default values are omitted from API requests. However, any 3668 // non-pointer, non-interface field appearing in ForceSendFields will be 3669 // sent to the server regardless of whether the field is empty or not. 3670 // This may be used to include empty fields in Patch requests. 3671 ForceSendFields []string `json:"-"` 3672 3673 // NullFields is a list of field names (e.g. "JarFileUris") to include 3674 // in API requests with the JSON null value. By default, fields with 3675 // empty values are omitted from API requests. However, any field with 3676 // an empty value appearing in NullFields will be sent to the server as 3677 // null. It is an error if a field in this list has a non-empty value. 3678 // This may be used to include null fields in Patch requests. 3679 NullFields []string `json:"-"` 3680 } 3681 3682 func (s *SparkSqlJob) MarshalJSON() ([]byte, error) { 3683 type NoMethod SparkSqlJob 3684 raw := NoMethod(*s) 3685 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3686 } 3687 3688 // StartClusterRequest: A request to start a cluster. 3689 type StartClusterRequest struct { 3690 // ClusterUuid: Optional. Specifying the cluster_uuid means the RPC will 3691 // fail (with error NOT_FOUND) if a cluster with the specified UUID does 3692 // not exist. 3693 ClusterUuid string `json:"clusterUuid,omitempty"` 3694 3695 // RequestId: Optional. A unique id used to identify the request. If the 3696 // server receives two StartClusterRequest 3697 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#google.cloud.dataproc.v1beta2.StartClusterRequest)s 3698 // with the same id, then the second request will be ignored and the 3699 // first google.longrunning.Operation created and stored in the backend 3700 // is returned.Recommendation: Set this value to a UUID 3701 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id 3702 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 3703 // and hyphens (-). The maximum length is 40 characters. 3704 RequestId string `json:"requestId,omitempty"` 3705 3706 // ForceSendFields is a list of field names (e.g. "ClusterUuid") to 3707 // unconditionally include in API requests. By default, fields with 3708 // empty or default values are omitted from API requests. However, any 3709 // non-pointer, non-interface field appearing in ForceSendFields will be 3710 // sent to the server regardless of whether the field is empty or not. 3711 // This may be used to include empty fields in Patch requests. 3712 ForceSendFields []string `json:"-"` 3713 3714 // NullFields is a list of field names (e.g. "ClusterUuid") to include 3715 // in API requests with the JSON null value. By default, fields with 3716 // empty values are omitted from API requests. However, any field with 3717 // an empty value appearing in NullFields will be sent to the server as 3718 // null. It is an error if a field in this list has a non-empty value. 3719 // This may be used to include null fields in Patch requests. 3720 NullFields []string `json:"-"` 3721 } 3722 3723 func (s *StartClusterRequest) MarshalJSON() ([]byte, error) { 3724 type NoMethod StartClusterRequest 3725 raw := NoMethod(*s) 3726 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3727 } 3728 3729 // Status: The Status type defines a logical error model that is 3730 // suitable for different programming environments, including REST APIs 3731 // and RPC APIs. It is used by gRPC (https://github.com/grpc). Each 3732 // Status message contains three pieces of data: error code, error 3733 // message, and error details.You can find out more about this error 3734 // model and how to work with it in the API Design Guide 3735 // (https://cloud.google.com/apis/design/errors). 3736 type Status struct { 3737 // Code: The status code, which should be an enum value of 3738 // google.rpc.Code. 3739 Code int64 `json:"code,omitempty"` 3740 3741 // Details: A list of messages that carry the error details. There is a 3742 // common set of message types for APIs to use. 3743 Details []googleapi.RawMessage `json:"details,omitempty"` 3744 3745 // Message: A developer-facing error message, which should be in 3746 // English. Any user-facing error message should be localized and sent 3747 // in the google.rpc.Status.details field, or localized by the client. 3748 Message string `json:"message,omitempty"` 3749 3750 // ForceSendFields is a list of field names (e.g. "Code") to 3751 // unconditionally include in API requests. By default, fields with 3752 // empty or default values are omitted from API requests. However, any 3753 // non-pointer, non-interface field appearing in ForceSendFields will be 3754 // sent to the server regardless of whether the field is empty or not. 3755 // This may be used to include empty fields in Patch requests. 3756 ForceSendFields []string `json:"-"` 3757 3758 // NullFields is a list of field names (e.g. "Code") to include in API 3759 // requests with the JSON null value. By default, fields with empty 3760 // values are omitted from API requests. However, any field with an 3761 // empty value appearing in NullFields will be sent to the server as 3762 // null. It is an error if a field in this list has a non-empty value. 3763 // This may be used to include null fields in Patch requests. 3764 NullFields []string `json:"-"` 3765 } 3766 3767 func (s *Status) MarshalJSON() ([]byte, error) { 3768 type NoMethod Status 3769 raw := NoMethod(*s) 3770 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3771 } 3772 3773 // StopClusterRequest: A request to stop a cluster. 3774 type StopClusterRequest struct { 3775 // ClusterUuid: Optional. Specifying the cluster_uuid means the RPC will 3776 // fail (with error NOT_FOUND) if a cluster with the specified UUID does 3777 // not exist. 3778 ClusterUuid string `json:"clusterUuid,omitempty"` 3779 3780 // RequestId: Optional. A unique id used to identify the request. If the 3781 // server receives two StopClusterRequest 3782 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#google.cloud.dataproc.v1beta2.StopClusterRequest)s 3783 // with the same id, then the second request will be ignored and the 3784 // first google.longrunning.Operation created and stored in the backend 3785 // is returned.Recommendation: Set this value to a UUID 3786 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id 3787 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 3788 // and hyphens (-). The maximum length is 40 characters. 3789 RequestId string `json:"requestId,omitempty"` 3790 3791 // ForceSendFields is a list of field names (e.g. "ClusterUuid") to 3792 // unconditionally include in API requests. By default, fields with 3793 // empty or default values are omitted from API requests. However, any 3794 // non-pointer, non-interface field appearing in ForceSendFields will be 3795 // sent to the server regardless of whether the field is empty or not. 3796 // This may be used to include empty fields in Patch requests. 3797 ForceSendFields []string `json:"-"` 3798 3799 // NullFields is a list of field names (e.g. "ClusterUuid") to include 3800 // in API requests with the JSON null value. By default, fields with 3801 // empty values are omitted from API requests. However, any field with 3802 // an empty value appearing in NullFields will be sent to the server as 3803 // null. It is an error if a field in this list has a non-empty value. 3804 // This may be used to include null fields in Patch requests. 3805 NullFields []string `json:"-"` 3806 } 3807 3808 func (s *StopClusterRequest) MarshalJSON() ([]byte, error) { 3809 type NoMethod StopClusterRequest 3810 raw := NoMethod(*s) 3811 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3812 } 3813 3814 // SubmitJobRequest: A request to submit a job. 3815 type SubmitJobRequest struct { 3816 // Job: Required. The job resource. 3817 Job *Job `json:"job,omitempty"` 3818 3819 // RequestId: Optional. A unique id used to identify the request. If the 3820 // server receives two SubmitJobRequest 3821 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#google.cloud.dataproc.v1.SubmitJobRequest)s 3822 // with the same id, then the second request will be ignored and the 3823 // first Job created and stored in the backend is returned.It is 3824 // recommended to always set this value to a UUID 3825 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id 3826 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 3827 // and hyphens (-). The maximum length is 40 characters. 3828 RequestId string `json:"requestId,omitempty"` 3829 3830 // ForceSendFields is a list of field names (e.g. "Job") to 3831 // unconditionally include in API requests. By default, fields with 3832 // empty or default values are omitted from API requests. However, any 3833 // non-pointer, non-interface field appearing in ForceSendFields will be 3834 // sent to the server regardless of whether the field is empty or not. 3835 // This may be used to include empty fields in Patch requests. 3836 ForceSendFields []string `json:"-"` 3837 3838 // NullFields is a list of field names (e.g. "Job") to include in API 3839 // requests with the JSON null value. By default, fields with empty 3840 // values are omitted from API requests. However, any field with an 3841 // empty value appearing in NullFields will be sent to the server as 3842 // null. It is an error if a field in this list has a non-empty value. 3843 // This may be used to include null fields in Patch requests. 3844 NullFields []string `json:"-"` 3845 } 3846 3847 func (s *SubmitJobRequest) MarshalJSON() ([]byte, error) { 3848 type NoMethod SubmitJobRequest 3849 raw := NoMethod(*s) 3850 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3851 } 3852 3853 // TemplateParameter: A configurable parameter that replaces one or more 3854 // fields in the template. Parameterizable fields: - Labels - File uris 3855 // - Job properties - Job arguments - Script variables - Main class (in 3856 // HadoopJob and SparkJob) - Zone (in ClusterSelector) 3857 type TemplateParameter struct { 3858 // Description: Optional. Brief description of the parameter. Must not 3859 // exceed 1024 characters. 3860 Description string `json:"description,omitempty"` 3861 3862 // Fields: Required. Paths to all fields that the parameter replaces. A 3863 // field is allowed to appear in at most one parameter's list of field 3864 // paths.A field path is similar in syntax to a 3865 // google.protobuf.FieldMask. For example, a field path that references 3866 // the zone field of a workflow template's cluster selector would be 3867 // specified as placement.clusterSelector.zone.Also, field paths can 3868 // reference fields using the following syntax: Values in maps can be 3869 // referenced by key: labels'key' 3870 // placement.clusterSelector.clusterLabels'key' 3871 // placement.managedCluster.labels'key' 3872 // placement.clusterSelector.clusterLabels'key' 3873 // jobs'step-id'.labels'key' Jobs in the jobs list can be referenced by 3874 // step-id: jobs'step-id'.hadoopJob.mainJarFileUri 3875 // jobs'step-id'.hiveJob.queryFileUri 3876 // jobs'step-id'.pySparkJob.mainPythonFileUri 3877 // jobs'step-id'.hadoopJob.jarFileUris0 3878 // jobs'step-id'.hadoopJob.archiveUris0 3879 // jobs'step-id'.hadoopJob.fileUris0 3880 // jobs'step-id'.pySparkJob.pythonFileUris0 Items in repeated fields can 3881 // be referenced by a zero-based index: jobs'step-id'.sparkJob.args0 3882 // Other examples: jobs'step-id'.hadoopJob.properties'key' 3883 // jobs'step-id'.hadoopJob.args0 3884 // jobs'step-id'.hiveJob.scriptVariables'key' 3885 // jobs'step-id'.hadoopJob.mainJarFileUri 3886 // placement.clusterSelector.zoneIt may not be possible to parameterize 3887 // maps and repeated fields in their entirety since only individual map 3888 // values and individual items in repeated fields can be referenced. For 3889 // example, the following field paths are invalid: 3890 // placement.clusterSelector.clusterLabels jobs'step-id'.sparkJob.args 3891 Fields []string `json:"fields,omitempty"` 3892 3893 // Name: Required. Parameter name. The parameter name is used as the 3894 // key, and paired with the parameter value, which are passed to the 3895 // template when the template is instantiated. The name must contain 3896 // only capital letters (A-Z), numbers (0-9), and underscores (_), and 3897 // must not start with a number. The maximum length is 40 characters. 3898 Name string `json:"name,omitempty"` 3899 3900 // Validation: Optional. Validation rules to be applied to this 3901 // parameter's value. 3902 Validation *ParameterValidation `json:"validation,omitempty"` 3903 3904 // ForceSendFields is a list of field names (e.g. "Description") to 3905 // unconditionally include in API requests. By default, fields with 3906 // empty or default values are omitted from API requests. However, any 3907 // non-pointer, non-interface field appearing in ForceSendFields will be 3908 // sent to the server regardless of whether the field is empty or not. 3909 // This may be used to include empty fields in Patch requests. 3910 ForceSendFields []string `json:"-"` 3911 3912 // NullFields is a list of field names (e.g. "Description") to include 3913 // in API requests with the JSON null value. By default, fields with 3914 // empty values are omitted from API requests. However, any field with 3915 // an empty value appearing in NullFields will be sent to the server as 3916 // null. It is an error if a field in this list has a non-empty value. 3917 // This may be used to include null fields in Patch requests. 3918 NullFields []string `json:"-"` 3919 } 3920 3921 func (s *TemplateParameter) MarshalJSON() ([]byte, error) { 3922 type NoMethod TemplateParameter 3923 raw := NoMethod(*s) 3924 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3925 } 3926 3927 // TestIamPermissionsRequest: Request message for TestIamPermissions 3928 // method. 3929 type TestIamPermissionsRequest struct { 3930 // Permissions: The set of permissions to check for the resource. 3931 // Permissions with wildcards (such as '*' or 'storage.*') are not 3932 // allowed. For more information see IAM Overview 3933 // (https://cloud.google.com/iam/docs/overview#permissions). 3934 Permissions []string `json:"permissions,omitempty"` 3935 3936 // ForceSendFields is a list of field names (e.g. "Permissions") to 3937 // unconditionally include in API requests. By default, fields with 3938 // empty or default values are omitted from API requests. However, any 3939 // non-pointer, non-interface field appearing in ForceSendFields will be 3940 // sent to the server regardless of whether the field is empty or not. 3941 // This may be used to include empty fields in Patch requests. 3942 ForceSendFields []string `json:"-"` 3943 3944 // NullFields is a list of field names (e.g. "Permissions") to include 3945 // in API requests with the JSON null value. By default, fields with 3946 // empty values are omitted from API requests. However, any field with 3947 // an empty value appearing in NullFields will be sent to the server as 3948 // null. It is an error if a field in this list has a non-empty value. 3949 // This may be used to include null fields in Patch requests. 3950 NullFields []string `json:"-"` 3951 } 3952 3953 func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) { 3954 type NoMethod TestIamPermissionsRequest 3955 raw := NoMethod(*s) 3956 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3957 } 3958 3959 // TestIamPermissionsResponse: Response message for TestIamPermissions 3960 // method. 3961 type TestIamPermissionsResponse struct { 3962 // Permissions: A subset of TestPermissionsRequest.permissions that the 3963 // caller is allowed. 3964 Permissions []string `json:"permissions,omitempty"` 3965 3966 // ServerResponse contains the HTTP response code and headers from the 3967 // server. 3968 googleapi.ServerResponse `json:"-"` 3969 3970 // ForceSendFields is a list of field names (e.g. "Permissions") to 3971 // unconditionally include in API requests. By default, fields with 3972 // empty or default values are omitted from API requests. However, any 3973 // non-pointer, non-interface field appearing in ForceSendFields will be 3974 // sent to the server regardless of whether the field is empty or not. 3975 // This may be used to include empty fields in Patch requests. 3976 ForceSendFields []string `json:"-"` 3977 3978 // NullFields is a list of field names (e.g. "Permissions") to include 3979 // in API requests with the JSON null value. By default, fields with 3980 // empty values are omitted from API requests. However, any field with 3981 // an empty value appearing in NullFields will be sent to the server as 3982 // null. It is an error if a field in this list has a non-empty value. 3983 // This may be used to include null fields in Patch requests. 3984 NullFields []string `json:"-"` 3985 } 3986 3987 func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) { 3988 type NoMethod TestIamPermissionsResponse 3989 raw := NoMethod(*s) 3990 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 3991 } 3992 3993 // ValueValidation: Validation based on a list of allowed values. 3994 type ValueValidation struct { 3995 // Values: Required. List of allowed values for the parameter. 3996 Values []string `json:"values,omitempty"` 3997 3998 // ForceSendFields is a list of field names (e.g. "Values") to 3999 // unconditionally include in API requests. By default, fields with 4000 // empty or default values are omitted from API requests. However, any 4001 // non-pointer, non-interface field appearing in ForceSendFields will be 4002 // sent to the server regardless of whether the field is empty or not. 4003 // This may be used to include empty fields in Patch requests. 4004 ForceSendFields []string `json:"-"` 4005 4006 // NullFields is a list of field names (e.g. "Values") to include in API 4007 // requests with the JSON null value. By default, fields with empty 4008 // values are omitted from API requests. However, any field with an 4009 // empty value appearing in NullFields will be sent to the server as 4010 // null. It is an error if a field in this list has a non-empty value. 4011 // This may be used to include null fields in Patch requests. 4012 NullFields []string `json:"-"` 4013 } 4014 4015 func (s *ValueValidation) MarshalJSON() ([]byte, error) { 4016 type NoMethod ValueValidation 4017 raw := NoMethod(*s) 4018 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4019 } 4020 4021 // WorkflowGraph: The workflow graph. 4022 type WorkflowGraph struct { 4023 // Nodes: Output only. The workflow nodes. 4024 Nodes []*WorkflowNode `json:"nodes,omitempty"` 4025 4026 // ForceSendFields is a list of field names (e.g. "Nodes") to 4027 // unconditionally include in API requests. By default, fields with 4028 // empty or default values are omitted from API requests. However, any 4029 // non-pointer, non-interface field appearing in ForceSendFields will be 4030 // sent to the server regardless of whether the field is empty or not. 4031 // This may be used to include empty fields in Patch requests. 4032 ForceSendFields []string `json:"-"` 4033 4034 // NullFields is a list of field names (e.g. "Nodes") to include in API 4035 // requests with the JSON null value. By default, fields with empty 4036 // values are omitted from API requests. However, any field with an 4037 // empty value appearing in NullFields will be sent to the server as 4038 // null. It is an error if a field in this list has a non-empty value. 4039 // This may be used to include null fields in Patch requests. 4040 NullFields []string `json:"-"` 4041 } 4042 4043 func (s *WorkflowGraph) MarshalJSON() ([]byte, error) { 4044 type NoMethod WorkflowGraph 4045 raw := NoMethod(*s) 4046 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4047 } 4048 4049 // WorkflowMetadata: A Dataproc workflow template resource. 4050 type WorkflowMetadata struct { 4051 // ClusterName: Output only. The name of the target cluster. 4052 ClusterName string `json:"clusterName,omitempty"` 4053 4054 // ClusterUuid: Output only. The UUID of target cluster. 4055 ClusterUuid string `json:"clusterUuid,omitempty"` 4056 4057 // CreateCluster: Output only. The create cluster operation metadata. 4058 CreateCluster *ClusterOperation `json:"createCluster,omitempty"` 4059 4060 // DagEndTime: Output only. DAG end time, which is only set for 4061 // workflows with dag_timeout when the DAG ends. 4062 DagEndTime string `json:"dagEndTime,omitempty"` 4063 4064 // DagStartTime: Output only. DAG start time, which is only set for 4065 // workflows with dag_timeout when the DAG begins. 4066 DagStartTime string `json:"dagStartTime,omitempty"` 4067 4068 // DagTimeout: Output only. The timeout duration for the DAG of jobs, 4069 // expressed in seconds (see JSON representation of duration 4070 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 4071 DagTimeout string `json:"dagTimeout,omitempty"` 4072 4073 // DeleteCluster: Output only. The delete cluster operation metadata. 4074 DeleteCluster *ClusterOperation `json:"deleteCluster,omitempty"` 4075 4076 // EndTime: Output only. Workflow end time. 4077 EndTime string `json:"endTime,omitempty"` 4078 4079 // Graph: Output only. The workflow graph. 4080 Graph *WorkflowGraph `json:"graph,omitempty"` 4081 4082 // Parameters: Map from parameter names to values that were used for 4083 // those parameters. 4084 Parameters map[string]string `json:"parameters,omitempty"` 4085 4086 // StartTime: Output only. Workflow start time. 4087 StartTime string `json:"startTime,omitempty"` 4088 4089 // State: Output only. The workflow state. 4090 // 4091 // Possible values: 4092 // "UNKNOWN" - Unused. 4093 // "PENDING" - The operation has been created. 4094 // "RUNNING" - The operation is running. 4095 // "DONE" - The operation is done; either cancelled or completed. 4096 State string `json:"state,omitempty"` 4097 4098 // Template: Output only. The resource name of the workflow template as 4099 // described in https://cloud.google.com/apis/design/resource_names. For 4100 // projects.regions.workflowTemplates, the resource name of the template 4101 // has the following format: 4102 // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} 4103 // For projects.locations.workflowTemplates, the resource name of the 4104 // template has the following format: 4105 // projects/{project_id}/locations/{location}/workflowTemplates/{template 4106 // _id} 4107 Template string `json:"template,omitempty"` 4108 4109 // Version: Output only. The version of template at the time of workflow 4110 // instantiation. 4111 Version int64 `json:"version,omitempty"` 4112 4113 // ForceSendFields is a list of field names (e.g. "ClusterName") to 4114 // unconditionally include in API requests. By default, fields with 4115 // empty or default values are omitted from API requests. However, any 4116 // non-pointer, non-interface field appearing in ForceSendFields will be 4117 // sent to the server regardless of whether the field is empty or not. 4118 // This may be used to include empty fields in Patch requests. 4119 ForceSendFields []string `json:"-"` 4120 4121 // NullFields is a list of field names (e.g. "ClusterName") to include 4122 // in API requests with the JSON null value. By default, fields with 4123 // empty values are omitted from API requests. However, any field with 4124 // an empty value appearing in NullFields will be sent to the server as 4125 // null. It is an error if a field in this list has a non-empty value. 4126 // This may be used to include null fields in Patch requests. 4127 NullFields []string `json:"-"` 4128 } 4129 4130 func (s *WorkflowMetadata) MarshalJSON() ([]byte, error) { 4131 type NoMethod WorkflowMetadata 4132 raw := NoMethod(*s) 4133 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4134 } 4135 4136 // WorkflowNode: The workflow node. 4137 type WorkflowNode struct { 4138 // Error: Output only. The error detail. 4139 Error string `json:"error,omitempty"` 4140 4141 // JobId: Output only. The job id; populated after the node enters 4142 // RUNNING state. 4143 JobId string `json:"jobId,omitempty"` 4144 4145 // PrerequisiteStepIds: Output only. Node's prerequisite nodes. 4146 PrerequisiteStepIds []string `json:"prerequisiteStepIds,omitempty"` 4147 4148 // State: Output only. The node state. 4149 // 4150 // Possible values: 4151 // "NODE_STATUS_UNSPECIFIED" - State is unspecified. 4152 // "BLOCKED" - The node is awaiting prerequisite node to finish. 4153 // "RUNNABLE" - The node is runnable but not running. 4154 // "RUNNING" - The node is running. 4155 // "COMPLETED" - The node completed successfully. 4156 // "FAILED" - The node failed. A node can be marked FAILED because its 4157 // ancestor or peer failed. 4158 State string `json:"state,omitempty"` 4159 4160 // StepId: Output only. The name of the node. 4161 StepId string `json:"stepId,omitempty"` 4162 4163 // ForceSendFields is a list of field names (e.g. "Error") to 4164 // unconditionally include in API requests. By default, fields with 4165 // empty or default values are omitted from API requests. However, any 4166 // non-pointer, non-interface field appearing in ForceSendFields will be 4167 // sent to the server regardless of whether the field is empty or not. 4168 // This may be used to include empty fields in Patch requests. 4169 ForceSendFields []string `json:"-"` 4170 4171 // NullFields is a list of field names (e.g. "Error") to include in API 4172 // requests with the JSON null value. By default, fields with empty 4173 // values are omitted from API requests. However, any field with an 4174 // empty value appearing in NullFields will be sent to the server as 4175 // null. It is an error if a field in this list has a non-empty value. 4176 // This may be used to include null fields in Patch requests. 4177 NullFields []string `json:"-"` 4178 } 4179 4180 func (s *WorkflowNode) MarshalJSON() ([]byte, error) { 4181 type NoMethod WorkflowNode 4182 raw := NoMethod(*s) 4183 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4184 } 4185 4186 // WorkflowTemplate: A Dataproc workflow template resource. 4187 type WorkflowTemplate struct { 4188 // CreateTime: Output only. The time template was created. 4189 CreateTime string `json:"createTime,omitempty"` 4190 4191 // DagTimeout: Optional. Timeout duration for the DAG of jobs, expressed 4192 // in seconds (see JSON representation of duration 4193 // (https://developers.google.com/protocol-buffers/docs/proto3#json)). 4194 // The timeout duration must be from 10 minutes ("600s") to 24 hours 4195 // ("86400s"). The timer begins when the first job is submitted. If the 4196 // workflow is running at the end of the timeout period, any remaining 4197 // jobs are cancelled, the workflow is ended, and if the workflow was 4198 // running on a managed cluster, the cluster is deleted. 4199 DagTimeout string `json:"dagTimeout,omitempty"` 4200 4201 // Id: Required. The template id.The id must contain only letters (a-z, 4202 // A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin 4203 // or end with underscore or hyphen. Must consist of between 3 and 50 4204 // characters.. 4205 Id string `json:"id,omitempty"` 4206 4207 // Jobs: Required. The Directed Acyclic Graph of Jobs to submit. 4208 Jobs []*OrderedJob `json:"jobs,omitempty"` 4209 4210 // Labels: Optional. The labels to associate with this template. These 4211 // labels will be propagated to all jobs and clusters created by the 4212 // workflow instance.Label keys must contain 1 to 63 characters, and 4213 // must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).Label 4214 // values may be empty, but, if present, must contain 1 to 63 4215 // characters, and must conform to RFC 1035 4216 // (https://www.ietf.org/rfc/rfc1035.txt).No more than 32 labels can be 4217 // associated with a template. 4218 Labels map[string]string `json:"labels,omitempty"` 4219 4220 // Name: Output only. The resource name of the workflow template, as 4221 // described in https://cloud.google.com/apis/design/resource_names. For 4222 // projects.regions.workflowTemplates, the resource name of the template 4223 // has the following format: 4224 // projects/{project_id}/regions/{region}/workflowTemplates/{template_id} 4225 // For projects.locations.workflowTemplates, the resource name of the 4226 // template has the following format: 4227 // projects/{project_id}/locations/{location}/workflowTemplates/{template 4228 // _id} 4229 Name string `json:"name,omitempty"` 4230 4231 // Parameters: Optional. Template parameters whose values are 4232 // substituted into the template. Values for parameters must be provided 4233 // when the template is instantiated. 4234 Parameters []*TemplateParameter `json:"parameters,omitempty"` 4235 4236 // Placement: Required. WorkflowTemplate scheduling information. 4237 Placement *WorkflowTemplatePlacement `json:"placement,omitempty"` 4238 4239 // UpdateTime: Output only. The time template was last updated. 4240 UpdateTime string `json:"updateTime,omitempty"` 4241 4242 // Version: Optional. Used to perform a consistent 4243 // read-modify-write.This field should be left blank for a 4244 // CreateWorkflowTemplate request. It is required for an 4245 // UpdateWorkflowTemplate request, and must match the current server 4246 // version. A typical update template flow would fetch the current 4247 // template with a GetWorkflowTemplate request, which will return the 4248 // current template with the version field filled in with the current 4249 // server version. The user updates other fields in the template, then 4250 // returns it as part of the UpdateWorkflowTemplate request. 4251 Version int64 `json:"version,omitempty"` 4252 4253 // ServerResponse contains the HTTP response code and headers from the 4254 // server. 4255 googleapi.ServerResponse `json:"-"` 4256 4257 // ForceSendFields is a list of field names (e.g. "CreateTime") to 4258 // unconditionally include in API requests. By default, fields with 4259 // empty or default values are omitted from API requests. However, any 4260 // non-pointer, non-interface field appearing in ForceSendFields will be 4261 // sent to the server regardless of whether the field is empty or not. 4262 // This may be used to include empty fields in Patch requests. 4263 ForceSendFields []string `json:"-"` 4264 4265 // NullFields is a list of field names (e.g. "CreateTime") to include in 4266 // API requests with the JSON null value. By default, fields with empty 4267 // values are omitted from API requests. However, any field with an 4268 // empty value appearing in NullFields will be sent to the server as 4269 // null. It is an error if a field in this list has a non-empty value. 4270 // This may be used to include null fields in Patch requests. 4271 NullFields []string `json:"-"` 4272 } 4273 4274 func (s *WorkflowTemplate) MarshalJSON() ([]byte, error) { 4275 type NoMethod WorkflowTemplate 4276 raw := NoMethod(*s) 4277 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4278 } 4279 4280 // WorkflowTemplatePlacement: Specifies workflow execution target.Either 4281 // managed_cluster or cluster_selector is required. 4282 type WorkflowTemplatePlacement struct { 4283 // ClusterSelector: Optional. A selector that chooses target cluster for 4284 // jobs based on metadata.The selector is evaluated at the time each job 4285 // is submitted. 4286 ClusterSelector *ClusterSelector `json:"clusterSelector,omitempty"` 4287 4288 // ManagedCluster: Optional. A cluster that is managed by the workflow. 4289 ManagedCluster *ManagedCluster `json:"managedCluster,omitempty"` 4290 4291 // ForceSendFields is a list of field names (e.g. "ClusterSelector") to 4292 // unconditionally include in API requests. By default, fields with 4293 // empty or default values are omitted from API requests. However, any 4294 // non-pointer, non-interface field appearing in ForceSendFields will be 4295 // sent to the server regardless of whether the field is empty or not. 4296 // This may be used to include empty fields in Patch requests. 4297 ForceSendFields []string `json:"-"` 4298 4299 // NullFields is a list of field names (e.g. "ClusterSelector") to 4300 // include in API requests with the JSON null value. By default, fields 4301 // with empty values are omitted from API requests. However, any field 4302 // with an empty value appearing in NullFields will be sent to the 4303 // server as null. It is an error if a field in this list has a 4304 // non-empty value. This may be used to include null fields in Patch 4305 // requests. 4306 NullFields []string `json:"-"` 4307 } 4308 4309 func (s *WorkflowTemplatePlacement) MarshalJSON() ([]byte, error) { 4310 type NoMethod WorkflowTemplatePlacement 4311 raw := NoMethod(*s) 4312 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4313 } 4314 4315 // YarnApplication: A YARN application created by a job. Application 4316 // information is a subset of 4317 // org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto.Beta 4318 // Feature: This report is available for testing purposes only. It may 4319 // be changed before final release. 4320 type YarnApplication struct { 4321 // Name: Output only. The application name. 4322 Name string `json:"name,omitempty"` 4323 4324 // Progress: Output only. The numerical progress of the application, 4325 // from 1 to 100. 4326 Progress float64 `json:"progress,omitempty"` 4327 4328 // State: Output only. The application state. 4329 // 4330 // Possible values: 4331 // "STATE_UNSPECIFIED" - Status is unspecified. 4332 // "NEW" - Status is NEW. 4333 // "NEW_SAVING" - Status is NEW_SAVING. 4334 // "SUBMITTED" - Status is SUBMITTED. 4335 // "ACCEPTED" - Status is ACCEPTED. 4336 // "RUNNING" - Status is RUNNING. 4337 // "FINISHED" - Status is FINISHED. 4338 // "FAILED" - Status is FAILED. 4339 // "KILLED" - Status is KILLED. 4340 State string `json:"state,omitempty"` 4341 4342 // TrackingUrl: Output only. The HTTP URL of the ApplicationMaster, 4343 // HistoryServer, or TimelineServer that provides application-specific 4344 // information. The URL uses the internal hostname, and requires a proxy 4345 // server for resolution and, possibly, access. 4346 TrackingUrl string `json:"trackingUrl,omitempty"` 4347 4348 // ForceSendFields is a list of field names (e.g. "Name") to 4349 // unconditionally include in API requests. By default, fields with 4350 // empty or default values are omitted from API requests. However, any 4351 // non-pointer, non-interface field appearing in ForceSendFields will be 4352 // sent to the server regardless of whether the field is empty or not. 4353 // This may be used to include empty fields in Patch requests. 4354 ForceSendFields []string `json:"-"` 4355 4356 // NullFields is a list of field names (e.g. "Name") to include in API 4357 // requests with the JSON null value. By default, fields with empty 4358 // values are omitted from API requests. However, any field with an 4359 // empty value appearing in NullFields will be sent to the server as 4360 // null. It is an error if a field in this list has a non-empty value. 4361 // This may be used to include null fields in Patch requests. 4362 NullFields []string `json:"-"` 4363 } 4364 4365 func (s *YarnApplication) MarshalJSON() ([]byte, error) { 4366 type NoMethod YarnApplication 4367 raw := NoMethod(*s) 4368 return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields) 4369 } 4370 4371 func (s *YarnApplication) UnmarshalJSON(data []byte) error { 4372 type NoMethod YarnApplication 4373 var s1 struct { 4374 Progress gensupport.JSONFloat64 `json:"progress"` 4375 *NoMethod 4376 } 4377 s1.NoMethod = (*NoMethod)(s) 4378 if err := json.Unmarshal(data, &s1); err != nil { 4379 return err 4380 } 4381 s.Progress = float64(s1.Progress) 4382 return nil 4383 } 4384 4385 // method id "dataproc.projects.locations.autoscalingPolicies.create": 4386 4387 type ProjectsLocationsAutoscalingPoliciesCreateCall struct { 4388 s *Service 4389 parent string 4390 autoscalingpolicy *AutoscalingPolicy 4391 urlParams_ gensupport.URLParams 4392 ctx_ context.Context 4393 header_ http.Header 4394 } 4395 4396 // Create: Creates new autoscaling policy. 4397 // 4398 // - parent: The "resource name" of the region or location, as described 4399 // in https://cloud.google.com/apis/design/resource_names. For 4400 // projects.regions.autoscalingPolicies.create, the resource name has 4401 // the following format: projects/{project_id}/regions/{region} For 4402 // projects.locations.autoscalingPolicies.create, the resource name 4403 // has the following format: 4404 // projects/{project_id}/locations/{location}. 4405 func (r *ProjectsLocationsAutoscalingPoliciesService) Create(parent string, autoscalingpolicy *AutoscalingPolicy) *ProjectsLocationsAutoscalingPoliciesCreateCall { 4406 c := &ProjectsLocationsAutoscalingPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4407 c.parent = parent 4408 c.autoscalingpolicy = autoscalingpolicy 4409 return c 4410 } 4411 4412 // Fields allows partial responses to be retrieved. See 4413 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4414 // for more information. 4415 func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesCreateCall { 4416 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4417 return c 4418 } 4419 4420 // Context sets the context to be used in this call's Do method. Any 4421 // pending HTTP request will be aborted if the provided context is 4422 // canceled. 4423 func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesCreateCall { 4424 c.ctx_ = ctx 4425 return c 4426 } 4427 4428 // Header returns an http.Header that can be modified by the caller to 4429 // add HTTP headers to the request. 4430 func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Header() http.Header { 4431 if c.header_ == nil { 4432 c.header_ = make(http.Header) 4433 } 4434 return c.header_ 4435 } 4436 4437 func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { 4438 reqHeaders := make(http.Header) 4439 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 4440 for k, v := range c.header_ { 4441 reqHeaders[k] = v 4442 } 4443 reqHeaders.Set("User-Agent", c.s.userAgent()) 4444 var body io.Reader = nil 4445 body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) 4446 if err != nil { 4447 return nil, err 4448 } 4449 reqHeaders.Set("Content-Type", "application/json") 4450 c.urlParams_.Set("alt", alt) 4451 c.urlParams_.Set("prettyPrint", "false") 4452 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/autoscalingPolicies") 4453 urls += "?" + c.urlParams_.Encode() 4454 req, err := http.NewRequest("POST", urls, body) 4455 if err != nil { 4456 return nil, err 4457 } 4458 req.Header = reqHeaders 4459 googleapi.Expand(req.URL, map[string]string{ 4460 "parent": c.parent, 4461 }) 4462 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4463 } 4464 4465 // Do executes the "dataproc.projects.locations.autoscalingPolicies.create" call. 4466 // Exactly one of *AutoscalingPolicy or error will be non-nil. Any 4467 // non-2xx status code is an error. Response headers are in either 4468 // *AutoscalingPolicy.ServerResponse.Header or (if a response was 4469 // returned at all) in error.(*googleapi.Error).Header. Use 4470 // googleapi.IsNotModified to check whether the returned error was 4471 // because http.StatusNotModified was returned. 4472 func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 4473 gensupport.SetOptions(c.urlParams_, opts...) 4474 res, err := c.doRequest("json") 4475 if res != nil && res.StatusCode == http.StatusNotModified { 4476 if res.Body != nil { 4477 res.Body.Close() 4478 } 4479 return nil, &googleapi.Error{ 4480 Code: res.StatusCode, 4481 Header: res.Header, 4482 } 4483 } 4484 if err != nil { 4485 return nil, err 4486 } 4487 defer googleapi.CloseBody(res) 4488 if err := googleapi.CheckResponse(res); err != nil { 4489 return nil, err 4490 } 4491 ret := &AutoscalingPolicy{ 4492 ServerResponse: googleapi.ServerResponse{ 4493 Header: res.Header, 4494 HTTPStatusCode: res.StatusCode, 4495 }, 4496 } 4497 target := &ret 4498 if err := gensupport.DecodeResponse(target, res); err != nil { 4499 return nil, err 4500 } 4501 return ret, nil 4502 // { 4503 // "description": "Creates new autoscaling policy.", 4504 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies", 4505 // "httpMethod": "POST", 4506 // "id": "dataproc.projects.locations.autoscalingPolicies.create", 4507 // "parameterOrder": [ 4508 // "parent" 4509 // ], 4510 // "parameters": { 4511 // "parent": { 4512 // "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}", 4513 // "location": "path", 4514 // "pattern": "^projects/[^/]+/locations/[^/]+$", 4515 // "required": true, 4516 // "type": "string" 4517 // } 4518 // }, 4519 // "path": "v1beta2/{+parent}/autoscalingPolicies", 4520 // "request": { 4521 // "$ref": "AutoscalingPolicy" 4522 // }, 4523 // "response": { 4524 // "$ref": "AutoscalingPolicy" 4525 // }, 4526 // "scopes": [ 4527 // "https://www.googleapis.com/auth/cloud-platform" 4528 // ] 4529 // } 4530 4531 } 4532 4533 // method id "dataproc.projects.locations.autoscalingPolicies.delete": 4534 4535 type ProjectsLocationsAutoscalingPoliciesDeleteCall struct { 4536 s *Service 4537 name string 4538 urlParams_ gensupport.URLParams 4539 ctx_ context.Context 4540 header_ http.Header 4541 } 4542 4543 // Delete: Deletes an autoscaling policy. It is an error to delete an 4544 // autoscaling policy that is in use by one or more clusters. 4545 // 4546 // - name: The "resource name" of the autoscaling policy, as described 4547 // in https://cloud.google.com/apis/design/resource_names. For 4548 // projects.regions.autoscalingPolicies.delete, the resource name of 4549 // the policy has the following format: 4550 // projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 4551 // d} For projects.locations.autoscalingPolicies.delete, the resource 4552 // name of the policy has the following format: 4553 // projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 4554 // cy_id}. 4555 func (r *ProjectsLocationsAutoscalingPoliciesService) Delete(name string) *ProjectsLocationsAutoscalingPoliciesDeleteCall { 4556 c := &ProjectsLocationsAutoscalingPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4557 c.name = name 4558 return c 4559 } 4560 4561 // Fields allows partial responses to be retrieved. See 4562 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4563 // for more information. 4564 func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesDeleteCall { 4565 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4566 return c 4567 } 4568 4569 // Context sets the context to be used in this call's Do method. Any 4570 // pending HTTP request will be aborted if the provided context is 4571 // canceled. 4572 func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesDeleteCall { 4573 c.ctx_ = ctx 4574 return c 4575 } 4576 4577 // Header returns an http.Header that can be modified by the caller to 4578 // add HTTP headers to the request. 4579 func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Header() http.Header { 4580 if c.header_ == nil { 4581 c.header_ = make(http.Header) 4582 } 4583 return c.header_ 4584 } 4585 4586 func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { 4587 reqHeaders := make(http.Header) 4588 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 4589 for k, v := range c.header_ { 4590 reqHeaders[k] = v 4591 } 4592 reqHeaders.Set("User-Agent", c.s.userAgent()) 4593 var body io.Reader = nil 4594 c.urlParams_.Set("alt", alt) 4595 c.urlParams_.Set("prettyPrint", "false") 4596 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 4597 urls += "?" + c.urlParams_.Encode() 4598 req, err := http.NewRequest("DELETE", urls, body) 4599 if err != nil { 4600 return nil, err 4601 } 4602 req.Header = reqHeaders 4603 googleapi.Expand(req.URL, map[string]string{ 4604 "name": c.name, 4605 }) 4606 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4607 } 4608 4609 // Do executes the "dataproc.projects.locations.autoscalingPolicies.delete" call. 4610 // Exactly one of *Empty or error will be non-nil. Any non-2xx status 4611 // code is an error. Response headers are in either 4612 // *Empty.ServerResponse.Header or (if a response was returned at all) 4613 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4614 // check whether the returned error was because http.StatusNotModified 4615 // was returned. 4616 func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 4617 gensupport.SetOptions(c.urlParams_, opts...) 4618 res, err := c.doRequest("json") 4619 if res != nil && res.StatusCode == http.StatusNotModified { 4620 if res.Body != nil { 4621 res.Body.Close() 4622 } 4623 return nil, &googleapi.Error{ 4624 Code: res.StatusCode, 4625 Header: res.Header, 4626 } 4627 } 4628 if err != nil { 4629 return nil, err 4630 } 4631 defer googleapi.CloseBody(res) 4632 if err := googleapi.CheckResponse(res); err != nil { 4633 return nil, err 4634 } 4635 ret := &Empty{ 4636 ServerResponse: googleapi.ServerResponse{ 4637 Header: res.Header, 4638 HTTPStatusCode: res.StatusCode, 4639 }, 4640 } 4641 target := &ret 4642 if err := gensupport.DecodeResponse(target, res); err != nil { 4643 return nil, err 4644 } 4645 return ret, nil 4646 // { 4647 // "description": "Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.", 4648 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}", 4649 // "httpMethod": "DELETE", 4650 // "id": "dataproc.projects.locations.autoscalingPolicies.delete", 4651 // "parameterOrder": [ 4652 // "name" 4653 // ], 4654 // "parameters": { 4655 // "name": { 4656 // "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}", 4657 // "location": "path", 4658 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 4659 // "required": true, 4660 // "type": "string" 4661 // } 4662 // }, 4663 // "path": "v1beta2/{+name}", 4664 // "response": { 4665 // "$ref": "Empty" 4666 // }, 4667 // "scopes": [ 4668 // "https://www.googleapis.com/auth/cloud-platform" 4669 // ] 4670 // } 4671 4672 } 4673 4674 // method id "dataproc.projects.locations.autoscalingPolicies.get": 4675 4676 type ProjectsLocationsAutoscalingPoliciesGetCall struct { 4677 s *Service 4678 name string 4679 urlParams_ gensupport.URLParams 4680 ifNoneMatch_ string 4681 ctx_ context.Context 4682 header_ http.Header 4683 } 4684 4685 // Get: Retrieves autoscaling policy. 4686 // 4687 // - name: The "resource name" of the autoscaling policy, as described 4688 // in https://cloud.google.com/apis/design/resource_names. For 4689 // projects.regions.autoscalingPolicies.get, the resource name of the 4690 // policy has the following format: 4691 // projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 4692 // d} For projects.locations.autoscalingPolicies.get, the resource 4693 // name of the policy has the following format: 4694 // projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 4695 // cy_id}. 4696 func (r *ProjectsLocationsAutoscalingPoliciesService) Get(name string) *ProjectsLocationsAutoscalingPoliciesGetCall { 4697 c := &ProjectsLocationsAutoscalingPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4698 c.name = name 4699 return c 4700 } 4701 4702 // Fields allows partial responses to be retrieved. See 4703 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4704 // for more information. 4705 func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesGetCall { 4706 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4707 return c 4708 } 4709 4710 // IfNoneMatch sets the optional parameter which makes the operation 4711 // fail if the object's ETag matches the given value. This is useful for 4712 // getting updates only after the object has changed since the last 4713 // request. Use googleapi.IsNotModified to check whether the response 4714 // error from Do is the result of In-None-Match. 4715 func (c *ProjectsLocationsAutoscalingPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAutoscalingPoliciesGetCall { 4716 c.ifNoneMatch_ = entityTag 4717 return c 4718 } 4719 4720 // Context sets the context to be used in this call's Do method. Any 4721 // pending HTTP request will be aborted if the provided context is 4722 // canceled. 4723 func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesGetCall { 4724 c.ctx_ = ctx 4725 return c 4726 } 4727 4728 // Header returns an http.Header that can be modified by the caller to 4729 // add HTTP headers to the request. 4730 func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Header() http.Header { 4731 if c.header_ == nil { 4732 c.header_ = make(http.Header) 4733 } 4734 return c.header_ 4735 } 4736 4737 func (c *ProjectsLocationsAutoscalingPoliciesGetCall) doRequest(alt string) (*http.Response, error) { 4738 reqHeaders := make(http.Header) 4739 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 4740 for k, v := range c.header_ { 4741 reqHeaders[k] = v 4742 } 4743 reqHeaders.Set("User-Agent", c.s.userAgent()) 4744 if c.ifNoneMatch_ != "" { 4745 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4746 } 4747 var body io.Reader = nil 4748 c.urlParams_.Set("alt", alt) 4749 c.urlParams_.Set("prettyPrint", "false") 4750 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 4751 urls += "?" + c.urlParams_.Encode() 4752 req, err := http.NewRequest("GET", urls, body) 4753 if err != nil { 4754 return nil, err 4755 } 4756 req.Header = reqHeaders 4757 googleapi.Expand(req.URL, map[string]string{ 4758 "name": c.name, 4759 }) 4760 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4761 } 4762 4763 // Do executes the "dataproc.projects.locations.autoscalingPolicies.get" call. 4764 // Exactly one of *AutoscalingPolicy or error will be non-nil. Any 4765 // non-2xx status code is an error. Response headers are in either 4766 // *AutoscalingPolicy.ServerResponse.Header or (if a response was 4767 // returned at all) in error.(*googleapi.Error).Header. Use 4768 // googleapi.IsNotModified to check whether the returned error was 4769 // because http.StatusNotModified was returned. 4770 func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 4771 gensupport.SetOptions(c.urlParams_, opts...) 4772 res, err := c.doRequest("json") 4773 if res != nil && res.StatusCode == http.StatusNotModified { 4774 if res.Body != nil { 4775 res.Body.Close() 4776 } 4777 return nil, &googleapi.Error{ 4778 Code: res.StatusCode, 4779 Header: res.Header, 4780 } 4781 } 4782 if err != nil { 4783 return nil, err 4784 } 4785 defer googleapi.CloseBody(res) 4786 if err := googleapi.CheckResponse(res); err != nil { 4787 return nil, err 4788 } 4789 ret := &AutoscalingPolicy{ 4790 ServerResponse: googleapi.ServerResponse{ 4791 Header: res.Header, 4792 HTTPStatusCode: res.StatusCode, 4793 }, 4794 } 4795 target := &ret 4796 if err := gensupport.DecodeResponse(target, res); err != nil { 4797 return nil, err 4798 } 4799 return ret, nil 4800 // { 4801 // "description": "Retrieves autoscaling policy.", 4802 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}", 4803 // "httpMethod": "GET", 4804 // "id": "dataproc.projects.locations.autoscalingPolicies.get", 4805 // "parameterOrder": [ 4806 // "name" 4807 // ], 4808 // "parameters": { 4809 // "name": { 4810 // "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}", 4811 // "location": "path", 4812 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 4813 // "required": true, 4814 // "type": "string" 4815 // } 4816 // }, 4817 // "path": "v1beta2/{+name}", 4818 // "response": { 4819 // "$ref": "AutoscalingPolicy" 4820 // }, 4821 // "scopes": [ 4822 // "https://www.googleapis.com/auth/cloud-platform" 4823 // ] 4824 // } 4825 4826 } 4827 4828 // method id "dataproc.projects.locations.autoscalingPolicies.getIamPolicy": 4829 4830 type ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall struct { 4831 s *Service 4832 resource string 4833 urlParams_ gensupport.URLParams 4834 ifNoneMatch_ string 4835 ctx_ context.Context 4836 header_ http.Header 4837 } 4838 4839 // GetIamPolicy: Gets the access control policy for a resource. Returns 4840 // an empty policy if the resource exists and does not have a policy 4841 // set. 4842 // 4843 // - resource: REQUIRED: The resource for which the policy is being 4844 // requested. See the operation documentation for the appropriate 4845 // value for this field. 4846 func (r *ProjectsLocationsAutoscalingPoliciesService) GetIamPolicy(resource string) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall { 4847 c := &ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 4848 c.resource = resource 4849 return c 4850 } 4851 4852 // OptionsRequestedPolicyVersion sets the optional parameter 4853 // "options.requestedPolicyVersion": The policy format version to be 4854 // returned.Valid values are 0, 1, and 3. Requests specifying an invalid 4855 // value will be rejected.Requests for policies with any conditional 4856 // bindings must specify version 3. Policies without any conditional 4857 // bindings may specify any valid value or leave the field unset.To 4858 // learn which resources support conditions in their IAM policies, see 4859 // the IAM documentation 4860 // (https://cloud.google.com/iam/help/conditions/resource-policies). 4861 func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall { 4862 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 4863 return c 4864 } 4865 4866 // Fields allows partial responses to be retrieved. See 4867 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 4868 // for more information. 4869 func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall { 4870 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 4871 return c 4872 } 4873 4874 // IfNoneMatch sets the optional parameter which makes the operation 4875 // fail if the object's ETag matches the given value. This is useful for 4876 // getting updates only after the object has changed since the last 4877 // request. Use googleapi.IsNotModified to check whether the response 4878 // error from Do is the result of In-None-Match. 4879 func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall { 4880 c.ifNoneMatch_ = entityTag 4881 return c 4882 } 4883 4884 // Context sets the context to be used in this call's Do method. Any 4885 // pending HTTP request will be aborted if the provided context is 4886 // canceled. 4887 func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall { 4888 c.ctx_ = ctx 4889 return c 4890 } 4891 4892 // Header returns an http.Header that can be modified by the caller to 4893 // add HTTP headers to the request. 4894 func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Header() http.Header { 4895 if c.header_ == nil { 4896 c.header_ = make(http.Header) 4897 } 4898 return c.header_ 4899 } 4900 4901 func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 4902 reqHeaders := make(http.Header) 4903 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 4904 for k, v := range c.header_ { 4905 reqHeaders[k] = v 4906 } 4907 reqHeaders.Set("User-Agent", c.s.userAgent()) 4908 if c.ifNoneMatch_ != "" { 4909 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 4910 } 4911 var body io.Reader = nil 4912 c.urlParams_.Set("alt", alt) 4913 c.urlParams_.Set("prettyPrint", "false") 4914 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 4915 urls += "?" + c.urlParams_.Encode() 4916 req, err := http.NewRequest("GET", urls, body) 4917 if err != nil { 4918 return nil, err 4919 } 4920 req.Header = reqHeaders 4921 googleapi.Expand(req.URL, map[string]string{ 4922 "resource": c.resource, 4923 }) 4924 return gensupport.SendRequest(c.ctx_, c.s.client, req) 4925 } 4926 4927 // Do executes the "dataproc.projects.locations.autoscalingPolicies.getIamPolicy" call. 4928 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 4929 // code is an error. Response headers are in either 4930 // *Policy.ServerResponse.Header or (if a response was returned at all) 4931 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 4932 // check whether the returned error was because http.StatusNotModified 4933 // was returned. 4934 func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 4935 gensupport.SetOptions(c.urlParams_, opts...) 4936 res, err := c.doRequest("json") 4937 if res != nil && res.StatusCode == http.StatusNotModified { 4938 if res.Body != nil { 4939 res.Body.Close() 4940 } 4941 return nil, &googleapi.Error{ 4942 Code: res.StatusCode, 4943 Header: res.Header, 4944 } 4945 } 4946 if err != nil { 4947 return nil, err 4948 } 4949 defer googleapi.CloseBody(res) 4950 if err := googleapi.CheckResponse(res); err != nil { 4951 return nil, err 4952 } 4953 ret := &Policy{ 4954 ServerResponse: googleapi.ServerResponse{ 4955 Header: res.Header, 4956 HTTPStatusCode: res.StatusCode, 4957 }, 4958 } 4959 target := &ret 4960 if err := gensupport.DecodeResponse(target, res); err != nil { 4961 return nil, err 4962 } 4963 return ret, nil 4964 // { 4965 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 4966 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}:getIamPolicy", 4967 // "httpMethod": "GET", 4968 // "id": "dataproc.projects.locations.autoscalingPolicies.getIamPolicy", 4969 // "parameterOrder": [ 4970 // "resource" 4971 // ], 4972 // "parameters": { 4973 // "options.requestedPolicyVersion": { 4974 // "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).", 4975 // "format": "int32", 4976 // "location": "query", 4977 // "type": "integer" 4978 // }, 4979 // "resource": { 4980 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 4981 // "location": "path", 4982 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 4983 // "required": true, 4984 // "type": "string" 4985 // } 4986 // }, 4987 // "path": "v1beta2/{+resource}:getIamPolicy", 4988 // "response": { 4989 // "$ref": "Policy" 4990 // }, 4991 // "scopes": [ 4992 // "https://www.googleapis.com/auth/cloud-platform" 4993 // ] 4994 // } 4995 4996 } 4997 4998 // method id "dataproc.projects.locations.autoscalingPolicies.list": 4999 5000 type ProjectsLocationsAutoscalingPoliciesListCall struct { 5001 s *Service 5002 parent string 5003 urlParams_ gensupport.URLParams 5004 ifNoneMatch_ string 5005 ctx_ context.Context 5006 header_ http.Header 5007 } 5008 5009 // List: Lists autoscaling policies in the project. 5010 // 5011 // - parent: The "resource name" of the region or location, as described 5012 // in https://cloud.google.com/apis/design/resource_names. For 5013 // projects.regions.autoscalingPolicies.list, the resource name of the 5014 // region has the following format: 5015 // projects/{project_id}/regions/{region} For 5016 // projects.locations.autoscalingPolicies.list, the resource name of 5017 // the location has the following format: 5018 // projects/{project_id}/locations/{location}. 5019 func (r *ProjectsLocationsAutoscalingPoliciesService) List(parent string) *ProjectsLocationsAutoscalingPoliciesListCall { 5020 c := &ProjectsLocationsAutoscalingPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5021 c.parent = parent 5022 return c 5023 } 5024 5025 // PageSize sets the optional parameter "pageSize": The maximum number 5026 // of results to return in each response. Must be less than or equal to 5027 // 1000. Defaults to 100. 5028 func (c *ProjectsLocationsAutoscalingPoliciesListCall) PageSize(pageSize int64) *ProjectsLocationsAutoscalingPoliciesListCall { 5029 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 5030 return c 5031 } 5032 5033 // PageToken sets the optional parameter "pageToken": The page token, 5034 // returned by a previous call, to request the next page of results. 5035 func (c *ProjectsLocationsAutoscalingPoliciesListCall) PageToken(pageToken string) *ProjectsLocationsAutoscalingPoliciesListCall { 5036 c.urlParams_.Set("pageToken", pageToken) 5037 return c 5038 } 5039 5040 // Fields allows partial responses to be retrieved. See 5041 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5042 // for more information. 5043 func (c *ProjectsLocationsAutoscalingPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesListCall { 5044 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5045 return c 5046 } 5047 5048 // IfNoneMatch sets the optional parameter which makes the operation 5049 // fail if the object's ETag matches the given value. This is useful for 5050 // getting updates only after the object has changed since the last 5051 // request. Use googleapi.IsNotModified to check whether the response 5052 // error from Do is the result of In-None-Match. 5053 func (c *ProjectsLocationsAutoscalingPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsAutoscalingPoliciesListCall { 5054 c.ifNoneMatch_ = entityTag 5055 return c 5056 } 5057 5058 // Context sets the context to be used in this call's Do method. Any 5059 // pending HTTP request will be aborted if the provided context is 5060 // canceled. 5061 func (c *ProjectsLocationsAutoscalingPoliciesListCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesListCall { 5062 c.ctx_ = ctx 5063 return c 5064 } 5065 5066 // Header returns an http.Header that can be modified by the caller to 5067 // add HTTP headers to the request. 5068 func (c *ProjectsLocationsAutoscalingPoliciesListCall) Header() http.Header { 5069 if c.header_ == nil { 5070 c.header_ = make(http.Header) 5071 } 5072 return c.header_ 5073 } 5074 5075 func (c *ProjectsLocationsAutoscalingPoliciesListCall) doRequest(alt string) (*http.Response, error) { 5076 reqHeaders := make(http.Header) 5077 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 5078 for k, v := range c.header_ { 5079 reqHeaders[k] = v 5080 } 5081 reqHeaders.Set("User-Agent", c.s.userAgent()) 5082 if c.ifNoneMatch_ != "" { 5083 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 5084 } 5085 var body io.Reader = nil 5086 c.urlParams_.Set("alt", alt) 5087 c.urlParams_.Set("prettyPrint", "false") 5088 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/autoscalingPolicies") 5089 urls += "?" + c.urlParams_.Encode() 5090 req, err := http.NewRequest("GET", urls, body) 5091 if err != nil { 5092 return nil, err 5093 } 5094 req.Header = reqHeaders 5095 googleapi.Expand(req.URL, map[string]string{ 5096 "parent": c.parent, 5097 }) 5098 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5099 } 5100 5101 // Do executes the "dataproc.projects.locations.autoscalingPolicies.list" call. 5102 // Exactly one of *ListAutoscalingPoliciesResponse or error will be 5103 // non-nil. Any non-2xx status code is an error. Response headers are in 5104 // either *ListAutoscalingPoliciesResponse.ServerResponse.Header or (if 5105 // a response was returned at all) in error.(*googleapi.Error).Header. 5106 // Use googleapi.IsNotModified to check whether the returned error was 5107 // because http.StatusNotModified was returned. 5108 func (c *ProjectsLocationsAutoscalingPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListAutoscalingPoliciesResponse, error) { 5109 gensupport.SetOptions(c.urlParams_, opts...) 5110 res, err := c.doRequest("json") 5111 if res != nil && res.StatusCode == http.StatusNotModified { 5112 if res.Body != nil { 5113 res.Body.Close() 5114 } 5115 return nil, &googleapi.Error{ 5116 Code: res.StatusCode, 5117 Header: res.Header, 5118 } 5119 } 5120 if err != nil { 5121 return nil, err 5122 } 5123 defer googleapi.CloseBody(res) 5124 if err := googleapi.CheckResponse(res); err != nil { 5125 return nil, err 5126 } 5127 ret := &ListAutoscalingPoliciesResponse{ 5128 ServerResponse: googleapi.ServerResponse{ 5129 Header: res.Header, 5130 HTTPStatusCode: res.StatusCode, 5131 }, 5132 } 5133 target := &ret 5134 if err := gensupport.DecodeResponse(target, res); err != nil { 5135 return nil, err 5136 } 5137 return ret, nil 5138 // { 5139 // "description": "Lists autoscaling policies in the project.", 5140 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies", 5141 // "httpMethod": "GET", 5142 // "id": "dataproc.projects.locations.autoscalingPolicies.list", 5143 // "parameterOrder": [ 5144 // "parent" 5145 // ], 5146 // "parameters": { 5147 // "pageSize": { 5148 // "description": "Optional. The maximum number of results to return in each response. Must be less than or equal to 1000. Defaults to 100.", 5149 // "format": "int32", 5150 // "location": "query", 5151 // "type": "integer" 5152 // }, 5153 // "pageToken": { 5154 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 5155 // "location": "query", 5156 // "type": "string" 5157 // }, 5158 // "parent": { 5159 // "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}", 5160 // "location": "path", 5161 // "pattern": "^projects/[^/]+/locations/[^/]+$", 5162 // "required": true, 5163 // "type": "string" 5164 // } 5165 // }, 5166 // "path": "v1beta2/{+parent}/autoscalingPolicies", 5167 // "response": { 5168 // "$ref": "ListAutoscalingPoliciesResponse" 5169 // }, 5170 // "scopes": [ 5171 // "https://www.googleapis.com/auth/cloud-platform" 5172 // ] 5173 // } 5174 5175 } 5176 5177 // Pages invokes f for each page of results. 5178 // A non-nil error returned from f will halt the iteration. 5179 // The provided context supersedes any context provided to the Context method. 5180 func (c *ProjectsLocationsAutoscalingPoliciesListCall) Pages(ctx context.Context, f func(*ListAutoscalingPoliciesResponse) error) error { 5181 c.ctx_ = ctx 5182 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 5183 for { 5184 x, err := c.Do() 5185 if err != nil { 5186 return err 5187 } 5188 if err := f(x); err != nil { 5189 return err 5190 } 5191 if x.NextPageToken == "" { 5192 return nil 5193 } 5194 c.PageToken(x.NextPageToken) 5195 } 5196 } 5197 5198 // method id "dataproc.projects.locations.autoscalingPolicies.setIamPolicy": 5199 5200 type ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall struct { 5201 s *Service 5202 resource string 5203 setiampolicyrequest *SetIamPolicyRequest 5204 urlParams_ gensupport.URLParams 5205 ctx_ context.Context 5206 header_ http.Header 5207 } 5208 5209 // SetIamPolicy: Sets the access control policy on the specified 5210 // resource. Replaces any existing policy.Can return NOT_FOUND, 5211 // INVALID_ARGUMENT, and PERMISSION_DENIED errors. 5212 // 5213 // - resource: REQUIRED: The resource for which the policy is being 5214 // specified. See the operation documentation for the appropriate 5215 // value for this field. 5216 func (r *ProjectsLocationsAutoscalingPoliciesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall { 5217 c := &ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5218 c.resource = resource 5219 c.setiampolicyrequest = setiampolicyrequest 5220 return c 5221 } 5222 5223 // Fields allows partial responses to be retrieved. See 5224 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5225 // for more information. 5226 func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall { 5227 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5228 return c 5229 } 5230 5231 // Context sets the context to be used in this call's Do method. Any 5232 // pending HTTP request will be aborted if the provided context is 5233 // canceled. 5234 func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall { 5235 c.ctx_ = ctx 5236 return c 5237 } 5238 5239 // Header returns an http.Header that can be modified by the caller to 5240 // add HTTP headers to the request. 5241 func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Header() http.Header { 5242 if c.header_ == nil { 5243 c.header_ = make(http.Header) 5244 } 5245 return c.header_ 5246 } 5247 5248 func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 5249 reqHeaders := make(http.Header) 5250 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 5251 for k, v := range c.header_ { 5252 reqHeaders[k] = v 5253 } 5254 reqHeaders.Set("User-Agent", c.s.userAgent()) 5255 var body io.Reader = nil 5256 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 5257 if err != nil { 5258 return nil, err 5259 } 5260 reqHeaders.Set("Content-Type", "application/json") 5261 c.urlParams_.Set("alt", alt) 5262 c.urlParams_.Set("prettyPrint", "false") 5263 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 5264 urls += "?" + c.urlParams_.Encode() 5265 req, err := http.NewRequest("POST", urls, body) 5266 if err != nil { 5267 return nil, err 5268 } 5269 req.Header = reqHeaders 5270 googleapi.Expand(req.URL, map[string]string{ 5271 "resource": c.resource, 5272 }) 5273 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5274 } 5275 5276 // Do executes the "dataproc.projects.locations.autoscalingPolicies.setIamPolicy" call. 5277 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 5278 // code is an error. Response headers are in either 5279 // *Policy.ServerResponse.Header or (if a response was returned at all) 5280 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5281 // check whether the returned error was because http.StatusNotModified 5282 // was returned. 5283 func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 5284 gensupport.SetOptions(c.urlParams_, opts...) 5285 res, err := c.doRequest("json") 5286 if res != nil && res.StatusCode == http.StatusNotModified { 5287 if res.Body != nil { 5288 res.Body.Close() 5289 } 5290 return nil, &googleapi.Error{ 5291 Code: res.StatusCode, 5292 Header: res.Header, 5293 } 5294 } 5295 if err != nil { 5296 return nil, err 5297 } 5298 defer googleapi.CloseBody(res) 5299 if err := googleapi.CheckResponse(res); err != nil { 5300 return nil, err 5301 } 5302 ret := &Policy{ 5303 ServerResponse: googleapi.ServerResponse{ 5304 Header: res.Header, 5305 HTTPStatusCode: res.StatusCode, 5306 }, 5307 } 5308 target := &ret 5309 if err := gensupport.DecodeResponse(target, res); err != nil { 5310 return nil, err 5311 } 5312 return ret, nil 5313 // { 5314 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 5315 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}:setIamPolicy", 5316 // "httpMethod": "POST", 5317 // "id": "dataproc.projects.locations.autoscalingPolicies.setIamPolicy", 5318 // "parameterOrder": [ 5319 // "resource" 5320 // ], 5321 // "parameters": { 5322 // "resource": { 5323 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 5324 // "location": "path", 5325 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 5326 // "required": true, 5327 // "type": "string" 5328 // } 5329 // }, 5330 // "path": "v1beta2/{+resource}:setIamPolicy", 5331 // "request": { 5332 // "$ref": "SetIamPolicyRequest" 5333 // }, 5334 // "response": { 5335 // "$ref": "Policy" 5336 // }, 5337 // "scopes": [ 5338 // "https://www.googleapis.com/auth/cloud-platform" 5339 // ] 5340 // } 5341 5342 } 5343 5344 // method id "dataproc.projects.locations.autoscalingPolicies.testIamPermissions": 5345 5346 type ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall struct { 5347 s *Service 5348 resource string 5349 testiampermissionsrequest *TestIamPermissionsRequest 5350 urlParams_ gensupport.URLParams 5351 ctx_ context.Context 5352 header_ http.Header 5353 } 5354 5355 // TestIamPermissions: Returns permissions that a caller has on the 5356 // specified resource. If the resource does not exist, this will return 5357 // an empty set of permissions, not a NOT_FOUND error.Note: This 5358 // operation is designed to be used for building permission-aware UIs 5359 // and command-line tools, not for authorization checking. This 5360 // operation may "fail open" without warning. 5361 // 5362 // - resource: REQUIRED: The resource for which the policy detail is 5363 // being requested. See the operation documentation for the 5364 // appropriate value for this field. 5365 func (r *ProjectsLocationsAutoscalingPoliciesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall { 5366 c := &ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5367 c.resource = resource 5368 c.testiampermissionsrequest = testiampermissionsrequest 5369 return c 5370 } 5371 5372 // Fields allows partial responses to be retrieved. See 5373 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5374 // for more information. 5375 func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall { 5376 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5377 return c 5378 } 5379 5380 // Context sets the context to be used in this call's Do method. Any 5381 // pending HTTP request will be aborted if the provided context is 5382 // canceled. 5383 func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall { 5384 c.ctx_ = ctx 5385 return c 5386 } 5387 5388 // Header returns an http.Header that can be modified by the caller to 5389 // add HTTP headers to the request. 5390 func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Header() http.Header { 5391 if c.header_ == nil { 5392 c.header_ = make(http.Header) 5393 } 5394 return c.header_ 5395 } 5396 5397 func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 5398 reqHeaders := make(http.Header) 5399 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 5400 for k, v := range c.header_ { 5401 reqHeaders[k] = v 5402 } 5403 reqHeaders.Set("User-Agent", c.s.userAgent()) 5404 var body io.Reader = nil 5405 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 5406 if err != nil { 5407 return nil, err 5408 } 5409 reqHeaders.Set("Content-Type", "application/json") 5410 c.urlParams_.Set("alt", alt) 5411 c.urlParams_.Set("prettyPrint", "false") 5412 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 5413 urls += "?" + c.urlParams_.Encode() 5414 req, err := http.NewRequest("POST", urls, body) 5415 if err != nil { 5416 return nil, err 5417 } 5418 req.Header = reqHeaders 5419 googleapi.Expand(req.URL, map[string]string{ 5420 "resource": c.resource, 5421 }) 5422 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5423 } 5424 5425 // Do executes the "dataproc.projects.locations.autoscalingPolicies.testIamPermissions" call. 5426 // Exactly one of *TestIamPermissionsResponse or error will be non-nil. 5427 // Any non-2xx status code is an error. Response headers are in either 5428 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response 5429 // was returned at all) in error.(*googleapi.Error).Header. Use 5430 // googleapi.IsNotModified to check whether the returned error was 5431 // because http.StatusNotModified was returned. 5432 func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 5433 gensupport.SetOptions(c.urlParams_, opts...) 5434 res, err := c.doRequest("json") 5435 if res != nil && res.StatusCode == http.StatusNotModified { 5436 if res.Body != nil { 5437 res.Body.Close() 5438 } 5439 return nil, &googleapi.Error{ 5440 Code: res.StatusCode, 5441 Header: res.Header, 5442 } 5443 } 5444 if err != nil { 5445 return nil, err 5446 } 5447 defer googleapi.CloseBody(res) 5448 if err := googleapi.CheckResponse(res); err != nil { 5449 return nil, err 5450 } 5451 ret := &TestIamPermissionsResponse{ 5452 ServerResponse: googleapi.ServerResponse{ 5453 Header: res.Header, 5454 HTTPStatusCode: res.StatusCode, 5455 }, 5456 } 5457 target := &ret 5458 if err := gensupport.DecodeResponse(target, res); err != nil { 5459 return nil, err 5460 } 5461 return ret, nil 5462 // { 5463 // "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.", 5464 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}:testIamPermissions", 5465 // "httpMethod": "POST", 5466 // "id": "dataproc.projects.locations.autoscalingPolicies.testIamPermissions", 5467 // "parameterOrder": [ 5468 // "resource" 5469 // ], 5470 // "parameters": { 5471 // "resource": { 5472 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 5473 // "location": "path", 5474 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 5475 // "required": true, 5476 // "type": "string" 5477 // } 5478 // }, 5479 // "path": "v1beta2/{+resource}:testIamPermissions", 5480 // "request": { 5481 // "$ref": "TestIamPermissionsRequest" 5482 // }, 5483 // "response": { 5484 // "$ref": "TestIamPermissionsResponse" 5485 // }, 5486 // "scopes": [ 5487 // "https://www.googleapis.com/auth/cloud-platform" 5488 // ] 5489 // } 5490 5491 } 5492 5493 // method id "dataproc.projects.locations.autoscalingPolicies.update": 5494 5495 type ProjectsLocationsAutoscalingPoliciesUpdateCall struct { 5496 s *Service 5497 name string 5498 autoscalingpolicy *AutoscalingPolicy 5499 urlParams_ gensupport.URLParams 5500 ctx_ context.Context 5501 header_ http.Header 5502 } 5503 5504 // Update: Updates (replaces) autoscaling policy.Disabled check for 5505 // update_mask, because all updates will be full replacements. 5506 // 5507 // - name: Output only. The "resource name" of the autoscaling policy, 5508 // as described in 5509 // https://cloud.google.com/apis/design/resource_names. For 5510 // projects.regions.autoscalingPolicies, the resource name of the 5511 // policy has the following format: 5512 // projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 5513 // d} For projects.locations.autoscalingPolicies, the resource name of 5514 // the policy has the following format: 5515 // projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 5516 // cy_id}. 5517 func (r *ProjectsLocationsAutoscalingPoliciesService) Update(name string, autoscalingpolicy *AutoscalingPolicy) *ProjectsLocationsAutoscalingPoliciesUpdateCall { 5518 c := &ProjectsLocationsAutoscalingPoliciesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5519 c.name = name 5520 c.autoscalingpolicy = autoscalingpolicy 5521 return c 5522 } 5523 5524 // Fields allows partial responses to be retrieved. See 5525 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5526 // for more information. 5527 func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesUpdateCall { 5528 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5529 return c 5530 } 5531 5532 // Context sets the context to be used in this call's Do method. Any 5533 // pending HTTP request will be aborted if the provided context is 5534 // canceled. 5535 func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesUpdateCall { 5536 c.ctx_ = ctx 5537 return c 5538 } 5539 5540 // Header returns an http.Header that can be modified by the caller to 5541 // add HTTP headers to the request. 5542 func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Header() http.Header { 5543 if c.header_ == nil { 5544 c.header_ = make(http.Header) 5545 } 5546 return c.header_ 5547 } 5548 5549 func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { 5550 reqHeaders := make(http.Header) 5551 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 5552 for k, v := range c.header_ { 5553 reqHeaders[k] = v 5554 } 5555 reqHeaders.Set("User-Agent", c.s.userAgent()) 5556 var body io.Reader = nil 5557 body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) 5558 if err != nil { 5559 return nil, err 5560 } 5561 reqHeaders.Set("Content-Type", "application/json") 5562 c.urlParams_.Set("alt", alt) 5563 c.urlParams_.Set("prettyPrint", "false") 5564 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 5565 urls += "?" + c.urlParams_.Encode() 5566 req, err := http.NewRequest("PUT", urls, body) 5567 if err != nil { 5568 return nil, err 5569 } 5570 req.Header = reqHeaders 5571 googleapi.Expand(req.URL, map[string]string{ 5572 "name": c.name, 5573 }) 5574 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5575 } 5576 5577 // Do executes the "dataproc.projects.locations.autoscalingPolicies.update" call. 5578 // Exactly one of *AutoscalingPolicy or error will be non-nil. Any 5579 // non-2xx status code is an error. Response headers are in either 5580 // *AutoscalingPolicy.ServerResponse.Header or (if a response was 5581 // returned at all) in error.(*googleapi.Error).Header. Use 5582 // googleapi.IsNotModified to check whether the returned error was 5583 // because http.StatusNotModified was returned. 5584 func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 5585 gensupport.SetOptions(c.urlParams_, opts...) 5586 res, err := c.doRequest("json") 5587 if res != nil && res.StatusCode == http.StatusNotModified { 5588 if res.Body != nil { 5589 res.Body.Close() 5590 } 5591 return nil, &googleapi.Error{ 5592 Code: res.StatusCode, 5593 Header: res.Header, 5594 } 5595 } 5596 if err != nil { 5597 return nil, err 5598 } 5599 defer googleapi.CloseBody(res) 5600 if err := googleapi.CheckResponse(res); err != nil { 5601 return nil, err 5602 } 5603 ret := &AutoscalingPolicy{ 5604 ServerResponse: googleapi.ServerResponse{ 5605 Header: res.Header, 5606 HTTPStatusCode: res.StatusCode, 5607 }, 5608 } 5609 target := &ret 5610 if err := gensupport.DecodeResponse(target, res); err != nil { 5611 return nil, err 5612 } 5613 return ret, nil 5614 // { 5615 // "description": "Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements.", 5616 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}", 5617 // "httpMethod": "PUT", 5618 // "id": "dataproc.projects.locations.autoscalingPolicies.update", 5619 // "parameterOrder": [ 5620 // "name" 5621 // ], 5622 // "parameters": { 5623 // "name": { 5624 // "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}", 5625 // "location": "path", 5626 // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$", 5627 // "required": true, 5628 // "type": "string" 5629 // } 5630 // }, 5631 // "path": "v1beta2/{+name}", 5632 // "request": { 5633 // "$ref": "AutoscalingPolicy" 5634 // }, 5635 // "response": { 5636 // "$ref": "AutoscalingPolicy" 5637 // }, 5638 // "scopes": [ 5639 // "https://www.googleapis.com/auth/cloud-platform" 5640 // ] 5641 // } 5642 5643 } 5644 5645 // method id "dataproc.projects.locations.workflowTemplates.create": 5646 5647 type ProjectsLocationsWorkflowTemplatesCreateCall struct { 5648 s *Service 5649 parent string 5650 workflowtemplate *WorkflowTemplate 5651 urlParams_ gensupport.URLParams 5652 ctx_ context.Context 5653 header_ http.Header 5654 } 5655 5656 // Create: Creates new workflow template. 5657 // 5658 // - parent: The resource name of the region or location, as described 5659 // in https://cloud.google.com/apis/design/resource_names. For 5660 // projects.regions.workflowTemplates,create, the resource name of the 5661 // region has the following format: 5662 // projects/{project_id}/regions/{region} For 5663 // projects.locations.workflowTemplates.create, the resource name of 5664 // the location has the following format: 5665 // projects/{project_id}/locations/{location}. 5666 func (r *ProjectsLocationsWorkflowTemplatesService) Create(parent string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesCreateCall { 5667 c := &ProjectsLocationsWorkflowTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5668 c.parent = parent 5669 c.workflowtemplate = workflowtemplate 5670 return c 5671 } 5672 5673 // Fields allows partial responses to be retrieved. See 5674 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5675 // for more information. 5676 func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesCreateCall { 5677 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5678 return c 5679 } 5680 5681 // Context sets the context to be used in this call's Do method. Any 5682 // pending HTTP request will be aborted if the provided context is 5683 // canceled. 5684 func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesCreateCall { 5685 c.ctx_ = ctx 5686 return c 5687 } 5688 5689 // Header returns an http.Header that can be modified by the caller to 5690 // add HTTP headers to the request. 5691 func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Header() http.Header { 5692 if c.header_ == nil { 5693 c.header_ = make(http.Header) 5694 } 5695 return c.header_ 5696 } 5697 5698 func (c *ProjectsLocationsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { 5699 reqHeaders := make(http.Header) 5700 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 5701 for k, v := range c.header_ { 5702 reqHeaders[k] = v 5703 } 5704 reqHeaders.Set("User-Agent", c.s.userAgent()) 5705 var body io.Reader = nil 5706 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 5707 if err != nil { 5708 return nil, err 5709 } 5710 reqHeaders.Set("Content-Type", "application/json") 5711 c.urlParams_.Set("alt", alt) 5712 c.urlParams_.Set("prettyPrint", "false") 5713 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates") 5714 urls += "?" + c.urlParams_.Encode() 5715 req, err := http.NewRequest("POST", urls, body) 5716 if err != nil { 5717 return nil, err 5718 } 5719 req.Header = reqHeaders 5720 googleapi.Expand(req.URL, map[string]string{ 5721 "parent": c.parent, 5722 }) 5723 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5724 } 5725 5726 // Do executes the "dataproc.projects.locations.workflowTemplates.create" call. 5727 // Exactly one of *WorkflowTemplate or error will be non-nil. Any 5728 // non-2xx status code is an error. Response headers are in either 5729 // *WorkflowTemplate.ServerResponse.Header or (if a response was 5730 // returned at all) in error.(*googleapi.Error).Header. Use 5731 // googleapi.IsNotModified to check whether the returned error was 5732 // because http.StatusNotModified was returned. 5733 func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 5734 gensupport.SetOptions(c.urlParams_, opts...) 5735 res, err := c.doRequest("json") 5736 if res != nil && res.StatusCode == http.StatusNotModified { 5737 if res.Body != nil { 5738 res.Body.Close() 5739 } 5740 return nil, &googleapi.Error{ 5741 Code: res.StatusCode, 5742 Header: res.Header, 5743 } 5744 } 5745 if err != nil { 5746 return nil, err 5747 } 5748 defer googleapi.CloseBody(res) 5749 if err := googleapi.CheckResponse(res); err != nil { 5750 return nil, err 5751 } 5752 ret := &WorkflowTemplate{ 5753 ServerResponse: googleapi.ServerResponse{ 5754 Header: res.Header, 5755 HTTPStatusCode: res.StatusCode, 5756 }, 5757 } 5758 target := &ret 5759 if err := gensupport.DecodeResponse(target, res); err != nil { 5760 return nil, err 5761 } 5762 return ret, nil 5763 // { 5764 // "description": "Creates new workflow template.", 5765 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates", 5766 // "httpMethod": "POST", 5767 // "id": "dataproc.projects.locations.workflowTemplates.create", 5768 // "parameterOrder": [ 5769 // "parent" 5770 // ], 5771 // "parameters": { 5772 // "parent": { 5773 // "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}", 5774 // "location": "path", 5775 // "pattern": "^projects/[^/]+/locations/[^/]+$", 5776 // "required": true, 5777 // "type": "string" 5778 // } 5779 // }, 5780 // "path": "v1beta2/{+parent}/workflowTemplates", 5781 // "request": { 5782 // "$ref": "WorkflowTemplate" 5783 // }, 5784 // "response": { 5785 // "$ref": "WorkflowTemplate" 5786 // }, 5787 // "scopes": [ 5788 // "https://www.googleapis.com/auth/cloud-platform" 5789 // ] 5790 // } 5791 5792 } 5793 5794 // method id "dataproc.projects.locations.workflowTemplates.delete": 5795 5796 type ProjectsLocationsWorkflowTemplatesDeleteCall struct { 5797 s *Service 5798 name string 5799 urlParams_ gensupport.URLParams 5800 ctx_ context.Context 5801 header_ http.Header 5802 } 5803 5804 // Delete: Deletes a workflow template. It does not cancel in-progress 5805 // workflows. 5806 // 5807 // - name: The resource name of the workflow template, as described in 5808 // https://cloud.google.com/apis/design/resource_names. For 5809 // projects.regions.workflowTemplates.delete, the resource name of the 5810 // template has the following format: 5811 // projects/{project_id}/regions/{region}/workflowTemplates/{template_i 5812 // d} For projects.locations.workflowTemplates.instantiate, the 5813 // resource name of the template has the following format: 5814 // projects/{project_id}/locations/{location}/workflowTemplates/{templa 5815 // te_id}. 5816 func (r *ProjectsLocationsWorkflowTemplatesService) Delete(name string) *ProjectsLocationsWorkflowTemplatesDeleteCall { 5817 c := &ProjectsLocationsWorkflowTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5818 c.name = name 5819 return c 5820 } 5821 5822 // Version sets the optional parameter "version": The version of 5823 // workflow template to delete. If specified, will only delete the 5824 // template if the current server version matches specified version. 5825 func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Version(version int64) *ProjectsLocationsWorkflowTemplatesDeleteCall { 5826 c.urlParams_.Set("version", fmt.Sprint(version)) 5827 return c 5828 } 5829 5830 // Fields allows partial responses to be retrieved. See 5831 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5832 // for more information. 5833 func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesDeleteCall { 5834 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5835 return c 5836 } 5837 5838 // Context sets the context to be used in this call's Do method. Any 5839 // pending HTTP request will be aborted if the provided context is 5840 // canceled. 5841 func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesDeleteCall { 5842 c.ctx_ = ctx 5843 return c 5844 } 5845 5846 // Header returns an http.Header that can be modified by the caller to 5847 // add HTTP headers to the request. 5848 func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Header() http.Header { 5849 if c.header_ == nil { 5850 c.header_ = make(http.Header) 5851 } 5852 return c.header_ 5853 } 5854 5855 func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { 5856 reqHeaders := make(http.Header) 5857 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 5858 for k, v := range c.header_ { 5859 reqHeaders[k] = v 5860 } 5861 reqHeaders.Set("User-Agent", c.s.userAgent()) 5862 var body io.Reader = nil 5863 c.urlParams_.Set("alt", alt) 5864 c.urlParams_.Set("prettyPrint", "false") 5865 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 5866 urls += "?" + c.urlParams_.Encode() 5867 req, err := http.NewRequest("DELETE", urls, body) 5868 if err != nil { 5869 return nil, err 5870 } 5871 req.Header = reqHeaders 5872 googleapi.Expand(req.URL, map[string]string{ 5873 "name": c.name, 5874 }) 5875 return gensupport.SendRequest(c.ctx_, c.s.client, req) 5876 } 5877 5878 // Do executes the "dataproc.projects.locations.workflowTemplates.delete" call. 5879 // Exactly one of *Empty or error will be non-nil. Any non-2xx status 5880 // code is an error. Response headers are in either 5881 // *Empty.ServerResponse.Header or (if a response was returned at all) 5882 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 5883 // check whether the returned error was because http.StatusNotModified 5884 // was returned. 5885 func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 5886 gensupport.SetOptions(c.urlParams_, opts...) 5887 res, err := c.doRequest("json") 5888 if res != nil && res.StatusCode == http.StatusNotModified { 5889 if res.Body != nil { 5890 res.Body.Close() 5891 } 5892 return nil, &googleapi.Error{ 5893 Code: res.StatusCode, 5894 Header: res.Header, 5895 } 5896 } 5897 if err != nil { 5898 return nil, err 5899 } 5900 defer googleapi.CloseBody(res) 5901 if err := googleapi.CheckResponse(res); err != nil { 5902 return nil, err 5903 } 5904 ret := &Empty{ 5905 ServerResponse: googleapi.ServerResponse{ 5906 Header: res.Header, 5907 HTTPStatusCode: res.StatusCode, 5908 }, 5909 } 5910 target := &ret 5911 if err := gensupport.DecodeResponse(target, res); err != nil { 5912 return nil, err 5913 } 5914 return ret, nil 5915 // { 5916 // "description": "Deletes a workflow template. It does not cancel in-progress workflows.", 5917 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}", 5918 // "httpMethod": "DELETE", 5919 // "id": "dataproc.projects.locations.workflowTemplates.delete", 5920 // "parameterOrder": [ 5921 // "name" 5922 // ], 5923 // "parameters": { 5924 // "name": { 5925 // "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}", 5926 // "location": "path", 5927 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 5928 // "required": true, 5929 // "type": "string" 5930 // }, 5931 // "version": { 5932 // "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.", 5933 // "format": "int32", 5934 // "location": "query", 5935 // "type": "integer" 5936 // } 5937 // }, 5938 // "path": "v1beta2/{+name}", 5939 // "response": { 5940 // "$ref": "Empty" 5941 // }, 5942 // "scopes": [ 5943 // "https://www.googleapis.com/auth/cloud-platform" 5944 // ] 5945 // } 5946 5947 } 5948 5949 // method id "dataproc.projects.locations.workflowTemplates.get": 5950 5951 type ProjectsLocationsWorkflowTemplatesGetCall struct { 5952 s *Service 5953 name string 5954 urlParams_ gensupport.URLParams 5955 ifNoneMatch_ string 5956 ctx_ context.Context 5957 header_ http.Header 5958 } 5959 5960 // Get: Retrieves the latest workflow template.Can retrieve previously 5961 // instantiated template by specifying optional version parameter. 5962 // 5963 // - name: The resource name of the workflow template, as described in 5964 // https://cloud.google.com/apis/design/resource_names. For 5965 // projects.regions.workflowTemplates.get, the resource name of the 5966 // template has the following format: 5967 // projects/{project_id}/regions/{region}/workflowTemplates/{template_i 5968 // d} For projects.locations.workflowTemplates.get, the resource name 5969 // of the template has the following format: 5970 // projects/{project_id}/locations/{location}/workflowTemplates/{templa 5971 // te_id}. 5972 func (r *ProjectsLocationsWorkflowTemplatesService) Get(name string) *ProjectsLocationsWorkflowTemplatesGetCall { 5973 c := &ProjectsLocationsWorkflowTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 5974 c.name = name 5975 return c 5976 } 5977 5978 // Version sets the optional parameter "version": The version of 5979 // workflow template to retrieve. Only previously instantiated versions 5980 // can be retrieved.If unspecified, retrieves the current version. 5981 func (c *ProjectsLocationsWorkflowTemplatesGetCall) Version(version int64) *ProjectsLocationsWorkflowTemplatesGetCall { 5982 c.urlParams_.Set("version", fmt.Sprint(version)) 5983 return c 5984 } 5985 5986 // Fields allows partial responses to be retrieved. See 5987 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 5988 // for more information. 5989 func (c *ProjectsLocationsWorkflowTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesGetCall { 5990 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 5991 return c 5992 } 5993 5994 // IfNoneMatch sets the optional parameter which makes the operation 5995 // fail if the object's ETag matches the given value. This is useful for 5996 // getting updates only after the object has changed since the last 5997 // request. Use googleapi.IsNotModified to check whether the response 5998 // error from Do is the result of In-None-Match. 5999 func (c *ProjectsLocationsWorkflowTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesGetCall { 6000 c.ifNoneMatch_ = entityTag 6001 return c 6002 } 6003 6004 // Context sets the context to be used in this call's Do method. Any 6005 // pending HTTP request will be aborted if the provided context is 6006 // canceled. 6007 func (c *ProjectsLocationsWorkflowTemplatesGetCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesGetCall { 6008 c.ctx_ = ctx 6009 return c 6010 } 6011 6012 // Header returns an http.Header that can be modified by the caller to 6013 // add HTTP headers to the request. 6014 func (c *ProjectsLocationsWorkflowTemplatesGetCall) Header() http.Header { 6015 if c.header_ == nil { 6016 c.header_ = make(http.Header) 6017 } 6018 return c.header_ 6019 } 6020 6021 func (c *ProjectsLocationsWorkflowTemplatesGetCall) doRequest(alt string) (*http.Response, error) { 6022 reqHeaders := make(http.Header) 6023 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 6024 for k, v := range c.header_ { 6025 reqHeaders[k] = v 6026 } 6027 reqHeaders.Set("User-Agent", c.s.userAgent()) 6028 if c.ifNoneMatch_ != "" { 6029 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6030 } 6031 var body io.Reader = nil 6032 c.urlParams_.Set("alt", alt) 6033 c.urlParams_.Set("prettyPrint", "false") 6034 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 6035 urls += "?" + c.urlParams_.Encode() 6036 req, err := http.NewRequest("GET", urls, body) 6037 if err != nil { 6038 return nil, err 6039 } 6040 req.Header = reqHeaders 6041 googleapi.Expand(req.URL, map[string]string{ 6042 "name": c.name, 6043 }) 6044 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6045 } 6046 6047 // Do executes the "dataproc.projects.locations.workflowTemplates.get" call. 6048 // Exactly one of *WorkflowTemplate or error will be non-nil. Any 6049 // non-2xx status code is an error. Response headers are in either 6050 // *WorkflowTemplate.ServerResponse.Header or (if a response was 6051 // returned at all) in error.(*googleapi.Error).Header. Use 6052 // googleapi.IsNotModified to check whether the returned error was 6053 // because http.StatusNotModified was returned. 6054 func (c *ProjectsLocationsWorkflowTemplatesGetCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 6055 gensupport.SetOptions(c.urlParams_, opts...) 6056 res, err := c.doRequest("json") 6057 if res != nil && res.StatusCode == http.StatusNotModified { 6058 if res.Body != nil { 6059 res.Body.Close() 6060 } 6061 return nil, &googleapi.Error{ 6062 Code: res.StatusCode, 6063 Header: res.Header, 6064 } 6065 } 6066 if err != nil { 6067 return nil, err 6068 } 6069 defer googleapi.CloseBody(res) 6070 if err := googleapi.CheckResponse(res); err != nil { 6071 return nil, err 6072 } 6073 ret := &WorkflowTemplate{ 6074 ServerResponse: googleapi.ServerResponse{ 6075 Header: res.Header, 6076 HTTPStatusCode: res.StatusCode, 6077 }, 6078 } 6079 target := &ret 6080 if err := gensupport.DecodeResponse(target, res); err != nil { 6081 return nil, err 6082 } 6083 return ret, nil 6084 // { 6085 // "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.", 6086 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}", 6087 // "httpMethod": "GET", 6088 // "id": "dataproc.projects.locations.workflowTemplates.get", 6089 // "parameterOrder": [ 6090 // "name" 6091 // ], 6092 // "parameters": { 6093 // "name": { 6094 // "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}", 6095 // "location": "path", 6096 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 6097 // "required": true, 6098 // "type": "string" 6099 // }, 6100 // "version": { 6101 // "description": "Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.If unspecified, retrieves the current version.", 6102 // "format": "int32", 6103 // "location": "query", 6104 // "type": "integer" 6105 // } 6106 // }, 6107 // "path": "v1beta2/{+name}", 6108 // "response": { 6109 // "$ref": "WorkflowTemplate" 6110 // }, 6111 // "scopes": [ 6112 // "https://www.googleapis.com/auth/cloud-platform" 6113 // ] 6114 // } 6115 6116 } 6117 6118 // method id "dataproc.projects.locations.workflowTemplates.getIamPolicy": 6119 6120 type ProjectsLocationsWorkflowTemplatesGetIamPolicyCall struct { 6121 s *Service 6122 resource string 6123 urlParams_ gensupport.URLParams 6124 ifNoneMatch_ string 6125 ctx_ context.Context 6126 header_ http.Header 6127 } 6128 6129 // GetIamPolicy: Gets the access control policy for a resource. Returns 6130 // an empty policy if the resource exists and does not have a policy 6131 // set. 6132 // 6133 // - resource: REQUIRED: The resource for which the policy is being 6134 // requested. See the operation documentation for the appropriate 6135 // value for this field. 6136 func (r *ProjectsLocationsWorkflowTemplatesService) GetIamPolicy(resource string) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall { 6137 c := &ProjectsLocationsWorkflowTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6138 c.resource = resource 6139 return c 6140 } 6141 6142 // OptionsRequestedPolicyVersion sets the optional parameter 6143 // "options.requestedPolicyVersion": The policy format version to be 6144 // returned.Valid values are 0, 1, and 3. Requests specifying an invalid 6145 // value will be rejected.Requests for policies with any conditional 6146 // bindings must specify version 3. Policies without any conditional 6147 // bindings may specify any valid value or leave the field unset.To 6148 // learn which resources support conditions in their IAM policies, see 6149 // the IAM documentation 6150 // (https://cloud.google.com/iam/help/conditions/resource-policies). 6151 func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall { 6152 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 6153 return c 6154 } 6155 6156 // Fields allows partial responses to be retrieved. See 6157 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6158 // for more information. 6159 func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall { 6160 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6161 return c 6162 } 6163 6164 // IfNoneMatch sets the optional parameter which makes the operation 6165 // fail if the object's ETag matches the given value. This is useful for 6166 // getting updates only after the object has changed since the last 6167 // request. Use googleapi.IsNotModified to check whether the response 6168 // error from Do is the result of In-None-Match. 6169 func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall { 6170 c.ifNoneMatch_ = entityTag 6171 return c 6172 } 6173 6174 // Context sets the context to be used in this call's Do method. Any 6175 // pending HTTP request will be aborted if the provided context is 6176 // canceled. 6177 func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall { 6178 c.ctx_ = ctx 6179 return c 6180 } 6181 6182 // Header returns an http.Header that can be modified by the caller to 6183 // add HTTP headers to the request. 6184 func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Header() http.Header { 6185 if c.header_ == nil { 6186 c.header_ = make(http.Header) 6187 } 6188 return c.header_ 6189 } 6190 6191 func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 6192 reqHeaders := make(http.Header) 6193 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 6194 for k, v := range c.header_ { 6195 reqHeaders[k] = v 6196 } 6197 reqHeaders.Set("User-Agent", c.s.userAgent()) 6198 if c.ifNoneMatch_ != "" { 6199 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6200 } 6201 var body io.Reader = nil 6202 c.urlParams_.Set("alt", alt) 6203 c.urlParams_.Set("prettyPrint", "false") 6204 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 6205 urls += "?" + c.urlParams_.Encode() 6206 req, err := http.NewRequest("GET", urls, body) 6207 if err != nil { 6208 return nil, err 6209 } 6210 req.Header = reqHeaders 6211 googleapi.Expand(req.URL, map[string]string{ 6212 "resource": c.resource, 6213 }) 6214 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6215 } 6216 6217 // Do executes the "dataproc.projects.locations.workflowTemplates.getIamPolicy" call. 6218 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 6219 // code is an error. Response headers are in either 6220 // *Policy.ServerResponse.Header or (if a response was returned at all) 6221 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6222 // check whether the returned error was because http.StatusNotModified 6223 // was returned. 6224 func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 6225 gensupport.SetOptions(c.urlParams_, opts...) 6226 res, err := c.doRequest("json") 6227 if res != nil && res.StatusCode == http.StatusNotModified { 6228 if res.Body != nil { 6229 res.Body.Close() 6230 } 6231 return nil, &googleapi.Error{ 6232 Code: res.StatusCode, 6233 Header: res.Header, 6234 } 6235 } 6236 if err != nil { 6237 return nil, err 6238 } 6239 defer googleapi.CloseBody(res) 6240 if err := googleapi.CheckResponse(res); err != nil { 6241 return nil, err 6242 } 6243 ret := &Policy{ 6244 ServerResponse: googleapi.ServerResponse{ 6245 Header: res.Header, 6246 HTTPStatusCode: res.StatusCode, 6247 }, 6248 } 6249 target := &ret 6250 if err := gensupport.DecodeResponse(target, res); err != nil { 6251 return nil, err 6252 } 6253 return ret, nil 6254 // { 6255 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 6256 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:getIamPolicy", 6257 // "httpMethod": "GET", 6258 // "id": "dataproc.projects.locations.workflowTemplates.getIamPolicy", 6259 // "parameterOrder": [ 6260 // "resource" 6261 // ], 6262 // "parameters": { 6263 // "options.requestedPolicyVersion": { 6264 // "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).", 6265 // "format": "int32", 6266 // "location": "query", 6267 // "type": "integer" 6268 // }, 6269 // "resource": { 6270 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 6271 // "location": "path", 6272 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 6273 // "required": true, 6274 // "type": "string" 6275 // } 6276 // }, 6277 // "path": "v1beta2/{+resource}:getIamPolicy", 6278 // "response": { 6279 // "$ref": "Policy" 6280 // }, 6281 // "scopes": [ 6282 // "https://www.googleapis.com/auth/cloud-platform" 6283 // ] 6284 // } 6285 6286 } 6287 6288 // method id "dataproc.projects.locations.workflowTemplates.instantiate": 6289 6290 type ProjectsLocationsWorkflowTemplatesInstantiateCall struct { 6291 s *Service 6292 name string 6293 instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest 6294 urlParams_ gensupport.URLParams 6295 ctx_ context.Context 6296 header_ http.Header 6297 } 6298 6299 // Instantiate: Instantiates a template and begins execution.The 6300 // returned Operation can be used to track execution of workflow by 6301 // polling operations.get. The Operation will complete when entire 6302 // workflow is finished.The running workflow can be aborted via 6303 // operations.cancel. This will cause any inflight jobs to be cancelled 6304 // and workflow-owned clusters to be deleted.The Operation.metadata will 6305 // be WorkflowMetadata 6306 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). 6307 // Also see Using WorkflowMetadata 6308 // (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On 6309 // successful completion, Operation.response will be Empty. 6310 // 6311 // - name: The resource name of the workflow template, as described in 6312 // https://cloud.google.com/apis/design/resource_names. For 6313 // projects.regions.workflowTemplates.instantiate, the resource name 6314 // of the template has the following format: 6315 // projects/{project_id}/regions/{region}/workflowTemplates/{template_i 6316 // d} For projects.locations.workflowTemplates.instantiate, the 6317 // resource name of the template has the following format: 6318 // projects/{project_id}/locations/{location}/workflowTemplates/{templa 6319 // te_id}. 6320 func (r *ProjectsLocationsWorkflowTemplatesService) Instantiate(name string, instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest) *ProjectsLocationsWorkflowTemplatesInstantiateCall { 6321 c := &ProjectsLocationsWorkflowTemplatesInstantiateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6322 c.name = name 6323 c.instantiateworkflowtemplaterequest = instantiateworkflowtemplaterequest 6324 return c 6325 } 6326 6327 // Fields allows partial responses to be retrieved. See 6328 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6329 // for more information. 6330 func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesInstantiateCall { 6331 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6332 return c 6333 } 6334 6335 // Context sets the context to be used in this call's Do method. Any 6336 // pending HTTP request will be aborted if the provided context is 6337 // canceled. 6338 func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesInstantiateCall { 6339 c.ctx_ = ctx 6340 return c 6341 } 6342 6343 // Header returns an http.Header that can be modified by the caller to 6344 // add HTTP headers to the request. 6345 func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Header() http.Header { 6346 if c.header_ == nil { 6347 c.header_ = make(http.Header) 6348 } 6349 return c.header_ 6350 } 6351 6352 func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) { 6353 reqHeaders := make(http.Header) 6354 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 6355 for k, v := range c.header_ { 6356 reqHeaders[k] = v 6357 } 6358 reqHeaders.Set("User-Agent", c.s.userAgent()) 6359 var body io.Reader = nil 6360 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest) 6361 if err != nil { 6362 return nil, err 6363 } 6364 reqHeaders.Set("Content-Type", "application/json") 6365 c.urlParams_.Set("alt", alt) 6366 c.urlParams_.Set("prettyPrint", "false") 6367 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:instantiate") 6368 urls += "?" + c.urlParams_.Encode() 6369 req, err := http.NewRequest("POST", urls, body) 6370 if err != nil { 6371 return nil, err 6372 } 6373 req.Header = reqHeaders 6374 googleapi.Expand(req.URL, map[string]string{ 6375 "name": c.name, 6376 }) 6377 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6378 } 6379 6380 // Do executes the "dataproc.projects.locations.workflowTemplates.instantiate" call. 6381 // Exactly one of *Operation or error will be non-nil. Any non-2xx 6382 // status code is an error. Response headers are in either 6383 // *Operation.ServerResponse.Header or (if a response was returned at 6384 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6385 // to check whether the returned error was because 6386 // http.StatusNotModified was returned. 6387 func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6388 gensupport.SetOptions(c.urlParams_, opts...) 6389 res, err := c.doRequest("json") 6390 if res != nil && res.StatusCode == http.StatusNotModified { 6391 if res.Body != nil { 6392 res.Body.Close() 6393 } 6394 return nil, &googleapi.Error{ 6395 Code: res.StatusCode, 6396 Header: res.Header, 6397 } 6398 } 6399 if err != nil { 6400 return nil, err 6401 } 6402 defer googleapi.CloseBody(res) 6403 if err := googleapi.CheckResponse(res); err != nil { 6404 return nil, err 6405 } 6406 ret := &Operation{ 6407 ServerResponse: googleapi.ServerResponse{ 6408 Header: res.Header, 6409 HTTPStatusCode: res.StatusCode, 6410 }, 6411 } 6412 target := &ret 6413 if err := gensupport.DecodeResponse(target, res); err != nil { 6414 return nil, err 6415 } 6416 return ret, nil 6417 // { 6418 // "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.", 6419 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:instantiate", 6420 // "httpMethod": "POST", 6421 // "id": "dataproc.projects.locations.workflowTemplates.instantiate", 6422 // "parameterOrder": [ 6423 // "name" 6424 // ], 6425 // "parameters": { 6426 // "name": { 6427 // "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}", 6428 // "location": "path", 6429 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 6430 // "required": true, 6431 // "type": "string" 6432 // } 6433 // }, 6434 // "path": "v1beta2/{+name}:instantiate", 6435 // "request": { 6436 // "$ref": "InstantiateWorkflowTemplateRequest" 6437 // }, 6438 // "response": { 6439 // "$ref": "Operation" 6440 // }, 6441 // "scopes": [ 6442 // "https://www.googleapis.com/auth/cloud-platform" 6443 // ] 6444 // } 6445 6446 } 6447 6448 // method id "dataproc.projects.locations.workflowTemplates.instantiateInline": 6449 6450 type ProjectsLocationsWorkflowTemplatesInstantiateInlineCall struct { 6451 s *Service 6452 parent string 6453 workflowtemplate *WorkflowTemplate 6454 urlParams_ gensupport.URLParams 6455 ctx_ context.Context 6456 header_ http.Header 6457 } 6458 6459 // InstantiateInline: Instantiates a template and begins execution.This 6460 // method is equivalent to executing the sequence 6461 // CreateWorkflowTemplate, InstantiateWorkflowTemplate, 6462 // DeleteWorkflowTemplate.The returned Operation can be used to track 6463 // execution of workflow by polling operations.get. The Operation will 6464 // complete when entire workflow is finished.The running workflow can be 6465 // aborted via operations.cancel. This will cause any inflight jobs to 6466 // be cancelled and workflow-owned clusters to be deleted.The 6467 // Operation.metadata will be WorkflowMetadata 6468 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). 6469 // Also see Using WorkflowMetadata 6470 // (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On 6471 // successful completion, Operation.response will be Empty. 6472 // 6473 // - parent: The resource name of the region or location, as described 6474 // in https://cloud.google.com/apis/design/resource_names. For 6475 // projects.regions.workflowTemplates,instantiateinline, the resource 6476 // name of the region has the following format: 6477 // projects/{project_id}/regions/{region} For 6478 // projects.locations.workflowTemplates.instantiateinline, the 6479 // resource name of the location has the following format: 6480 // projects/{project_id}/locations/{location}. 6481 func (r *ProjectsLocationsWorkflowTemplatesService) InstantiateInline(parent string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6482 c := &ProjectsLocationsWorkflowTemplatesInstantiateInlineCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6483 c.parent = parent 6484 c.workflowtemplate = workflowtemplate 6485 return c 6486 } 6487 6488 // InstanceId sets the optional parameter "instanceId": Deprecated. 6489 // Please use request_id field instead. 6490 func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) InstanceId(instanceId string) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6491 c.urlParams_.Set("instanceId", instanceId) 6492 return c 6493 } 6494 6495 // RequestId sets the optional parameter "requestId": A tag that 6496 // prevents multiple concurrent workflow instances with the same tag 6497 // from running. This mitigates risk of concurrent instances started due 6498 // to retries.It is recommended to always set this value to a UUID 6499 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag 6500 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 6501 // and hyphens (-). The maximum length is 40 characters. 6502 func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) RequestId(requestId string) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6503 c.urlParams_.Set("requestId", requestId) 6504 return c 6505 } 6506 6507 // Fields allows partial responses to be retrieved. See 6508 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6509 // for more information. 6510 func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6511 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6512 return c 6513 } 6514 6515 // Context sets the context to be used in this call's Do method. Any 6516 // pending HTTP request will be aborted if the provided context is 6517 // canceled. 6518 func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall { 6519 c.ctx_ = ctx 6520 return c 6521 } 6522 6523 // Header returns an http.Header that can be modified by the caller to 6524 // add HTTP headers to the request. 6525 func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Header() http.Header { 6526 if c.header_ == nil { 6527 c.header_ = make(http.Header) 6528 } 6529 return c.header_ 6530 } 6531 6532 func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) { 6533 reqHeaders := make(http.Header) 6534 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 6535 for k, v := range c.header_ { 6536 reqHeaders[k] = v 6537 } 6538 reqHeaders.Set("User-Agent", c.s.userAgent()) 6539 var body io.Reader = nil 6540 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 6541 if err != nil { 6542 return nil, err 6543 } 6544 reqHeaders.Set("Content-Type", "application/json") 6545 c.urlParams_.Set("alt", alt) 6546 c.urlParams_.Set("prettyPrint", "false") 6547 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates:instantiateInline") 6548 urls += "?" + c.urlParams_.Encode() 6549 req, err := http.NewRequest("POST", urls, body) 6550 if err != nil { 6551 return nil, err 6552 } 6553 req.Header = reqHeaders 6554 googleapi.Expand(req.URL, map[string]string{ 6555 "parent": c.parent, 6556 }) 6557 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6558 } 6559 6560 // Do executes the "dataproc.projects.locations.workflowTemplates.instantiateInline" call. 6561 // Exactly one of *Operation or error will be non-nil. Any non-2xx 6562 // status code is an error. Response headers are in either 6563 // *Operation.ServerResponse.Header or (if a response was returned at 6564 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 6565 // to check whether the returned error was because 6566 // http.StatusNotModified was returned. 6567 func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 6568 gensupport.SetOptions(c.urlParams_, opts...) 6569 res, err := c.doRequest("json") 6570 if res != nil && res.StatusCode == http.StatusNotModified { 6571 if res.Body != nil { 6572 res.Body.Close() 6573 } 6574 return nil, &googleapi.Error{ 6575 Code: res.StatusCode, 6576 Header: res.Header, 6577 } 6578 } 6579 if err != nil { 6580 return nil, err 6581 } 6582 defer googleapi.CloseBody(res) 6583 if err := googleapi.CheckResponse(res); err != nil { 6584 return nil, err 6585 } 6586 ret := &Operation{ 6587 ServerResponse: googleapi.ServerResponse{ 6588 Header: res.Header, 6589 HTTPStatusCode: res.StatusCode, 6590 }, 6591 } 6592 target := &ret 6593 if err := gensupport.DecodeResponse(target, res); err != nil { 6594 return nil, err 6595 } 6596 return ret, nil 6597 // { 6598 // "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.", 6599 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates:instantiateInline", 6600 // "httpMethod": "POST", 6601 // "id": "dataproc.projects.locations.workflowTemplates.instantiateInline", 6602 // "parameterOrder": [ 6603 // "parent" 6604 // ], 6605 // "parameters": { 6606 // "instanceId": { 6607 // "description": "Deprecated. Please use request_id field instead.", 6608 // "location": "query", 6609 // "type": "string" 6610 // }, 6611 // "parent": { 6612 // "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}", 6613 // "location": "path", 6614 // "pattern": "^projects/[^/]+/locations/[^/]+$", 6615 // "required": true, 6616 // "type": "string" 6617 // }, 6618 // "requestId": { 6619 // "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.", 6620 // "location": "query", 6621 // "type": "string" 6622 // } 6623 // }, 6624 // "path": "v1beta2/{+parent}/workflowTemplates:instantiateInline", 6625 // "request": { 6626 // "$ref": "WorkflowTemplate" 6627 // }, 6628 // "response": { 6629 // "$ref": "Operation" 6630 // }, 6631 // "scopes": [ 6632 // "https://www.googleapis.com/auth/cloud-platform" 6633 // ] 6634 // } 6635 6636 } 6637 6638 // method id "dataproc.projects.locations.workflowTemplates.list": 6639 6640 type ProjectsLocationsWorkflowTemplatesListCall struct { 6641 s *Service 6642 parent string 6643 urlParams_ gensupport.URLParams 6644 ifNoneMatch_ string 6645 ctx_ context.Context 6646 header_ http.Header 6647 } 6648 6649 // List: Lists workflows that match the specified filter in the request. 6650 // 6651 // - parent: The resource name of the region or location, as described 6652 // in https://cloud.google.com/apis/design/resource_names. For 6653 // projects.regions.workflowTemplates,list, the resource name of the 6654 // region has the following format: 6655 // projects/{project_id}/regions/{region} For 6656 // projects.locations.workflowTemplates.list, the resource name of the 6657 // location has the following format: 6658 // projects/{project_id}/locations/{location}. 6659 func (r *ProjectsLocationsWorkflowTemplatesService) List(parent string) *ProjectsLocationsWorkflowTemplatesListCall { 6660 c := &ProjectsLocationsWorkflowTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6661 c.parent = parent 6662 return c 6663 } 6664 6665 // PageSize sets the optional parameter "pageSize": The maximum number 6666 // of results to return in each response. 6667 func (c *ProjectsLocationsWorkflowTemplatesListCall) PageSize(pageSize int64) *ProjectsLocationsWorkflowTemplatesListCall { 6668 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 6669 return c 6670 } 6671 6672 // PageToken sets the optional parameter "pageToken": The page token, 6673 // returned by a previous call, to request the next page of results. 6674 func (c *ProjectsLocationsWorkflowTemplatesListCall) PageToken(pageToken string) *ProjectsLocationsWorkflowTemplatesListCall { 6675 c.urlParams_.Set("pageToken", pageToken) 6676 return c 6677 } 6678 6679 // Fields allows partial responses to be retrieved. See 6680 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6681 // for more information. 6682 func (c *ProjectsLocationsWorkflowTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesListCall { 6683 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6684 return c 6685 } 6686 6687 // IfNoneMatch sets the optional parameter which makes the operation 6688 // fail if the object's ETag matches the given value. This is useful for 6689 // getting updates only after the object has changed since the last 6690 // request. Use googleapi.IsNotModified to check whether the response 6691 // error from Do is the result of In-None-Match. 6692 func (c *ProjectsLocationsWorkflowTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesListCall { 6693 c.ifNoneMatch_ = entityTag 6694 return c 6695 } 6696 6697 // Context sets the context to be used in this call's Do method. Any 6698 // pending HTTP request will be aborted if the provided context is 6699 // canceled. 6700 func (c *ProjectsLocationsWorkflowTemplatesListCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesListCall { 6701 c.ctx_ = ctx 6702 return c 6703 } 6704 6705 // Header returns an http.Header that can be modified by the caller to 6706 // add HTTP headers to the request. 6707 func (c *ProjectsLocationsWorkflowTemplatesListCall) Header() http.Header { 6708 if c.header_ == nil { 6709 c.header_ = make(http.Header) 6710 } 6711 return c.header_ 6712 } 6713 6714 func (c *ProjectsLocationsWorkflowTemplatesListCall) doRequest(alt string) (*http.Response, error) { 6715 reqHeaders := make(http.Header) 6716 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 6717 for k, v := range c.header_ { 6718 reqHeaders[k] = v 6719 } 6720 reqHeaders.Set("User-Agent", c.s.userAgent()) 6721 if c.ifNoneMatch_ != "" { 6722 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 6723 } 6724 var body io.Reader = nil 6725 c.urlParams_.Set("alt", alt) 6726 c.urlParams_.Set("prettyPrint", "false") 6727 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates") 6728 urls += "?" + c.urlParams_.Encode() 6729 req, err := http.NewRequest("GET", urls, body) 6730 if err != nil { 6731 return nil, err 6732 } 6733 req.Header = reqHeaders 6734 googleapi.Expand(req.URL, map[string]string{ 6735 "parent": c.parent, 6736 }) 6737 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6738 } 6739 6740 // Do executes the "dataproc.projects.locations.workflowTemplates.list" call. 6741 // Exactly one of *ListWorkflowTemplatesResponse or error will be 6742 // non-nil. Any non-2xx status code is an error. Response headers are in 6743 // either *ListWorkflowTemplatesResponse.ServerResponse.Header or (if a 6744 // response was returned at all) in error.(*googleapi.Error).Header. Use 6745 // googleapi.IsNotModified to check whether the returned error was 6746 // because http.StatusNotModified was returned. 6747 func (c *ProjectsLocationsWorkflowTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowTemplatesResponse, error) { 6748 gensupport.SetOptions(c.urlParams_, opts...) 6749 res, err := c.doRequest("json") 6750 if res != nil && res.StatusCode == http.StatusNotModified { 6751 if res.Body != nil { 6752 res.Body.Close() 6753 } 6754 return nil, &googleapi.Error{ 6755 Code: res.StatusCode, 6756 Header: res.Header, 6757 } 6758 } 6759 if err != nil { 6760 return nil, err 6761 } 6762 defer googleapi.CloseBody(res) 6763 if err := googleapi.CheckResponse(res); err != nil { 6764 return nil, err 6765 } 6766 ret := &ListWorkflowTemplatesResponse{ 6767 ServerResponse: googleapi.ServerResponse{ 6768 Header: res.Header, 6769 HTTPStatusCode: res.StatusCode, 6770 }, 6771 } 6772 target := &ret 6773 if err := gensupport.DecodeResponse(target, res); err != nil { 6774 return nil, err 6775 } 6776 return ret, nil 6777 // { 6778 // "description": "Lists workflows that match the specified filter in the request.", 6779 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates", 6780 // "httpMethod": "GET", 6781 // "id": "dataproc.projects.locations.workflowTemplates.list", 6782 // "parameterOrder": [ 6783 // "parent" 6784 // ], 6785 // "parameters": { 6786 // "pageSize": { 6787 // "description": "Optional. The maximum number of results to return in each response.", 6788 // "format": "int32", 6789 // "location": "query", 6790 // "type": "integer" 6791 // }, 6792 // "pageToken": { 6793 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 6794 // "location": "query", 6795 // "type": "string" 6796 // }, 6797 // "parent": { 6798 // "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}", 6799 // "location": "path", 6800 // "pattern": "^projects/[^/]+/locations/[^/]+$", 6801 // "required": true, 6802 // "type": "string" 6803 // } 6804 // }, 6805 // "path": "v1beta2/{+parent}/workflowTemplates", 6806 // "response": { 6807 // "$ref": "ListWorkflowTemplatesResponse" 6808 // }, 6809 // "scopes": [ 6810 // "https://www.googleapis.com/auth/cloud-platform" 6811 // ] 6812 // } 6813 6814 } 6815 6816 // Pages invokes f for each page of results. 6817 // A non-nil error returned from f will halt the iteration. 6818 // The provided context supersedes any context provided to the Context method. 6819 func (c *ProjectsLocationsWorkflowTemplatesListCall) Pages(ctx context.Context, f func(*ListWorkflowTemplatesResponse) error) error { 6820 c.ctx_ = ctx 6821 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 6822 for { 6823 x, err := c.Do() 6824 if err != nil { 6825 return err 6826 } 6827 if err := f(x); err != nil { 6828 return err 6829 } 6830 if x.NextPageToken == "" { 6831 return nil 6832 } 6833 c.PageToken(x.NextPageToken) 6834 } 6835 } 6836 6837 // method id "dataproc.projects.locations.workflowTemplates.setIamPolicy": 6838 6839 type ProjectsLocationsWorkflowTemplatesSetIamPolicyCall struct { 6840 s *Service 6841 resource string 6842 setiampolicyrequest *SetIamPolicyRequest 6843 urlParams_ gensupport.URLParams 6844 ctx_ context.Context 6845 header_ http.Header 6846 } 6847 6848 // SetIamPolicy: Sets the access control policy on the specified 6849 // resource. Replaces any existing policy.Can return NOT_FOUND, 6850 // INVALID_ARGUMENT, and PERMISSION_DENIED errors. 6851 // 6852 // - resource: REQUIRED: The resource for which the policy is being 6853 // specified. See the operation documentation for the appropriate 6854 // value for this field. 6855 func (r *ProjectsLocationsWorkflowTemplatesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall { 6856 c := &ProjectsLocationsWorkflowTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 6857 c.resource = resource 6858 c.setiampolicyrequest = setiampolicyrequest 6859 return c 6860 } 6861 6862 // Fields allows partial responses to be retrieved. See 6863 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 6864 // for more information. 6865 func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall { 6866 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 6867 return c 6868 } 6869 6870 // Context sets the context to be used in this call's Do method. Any 6871 // pending HTTP request will be aborted if the provided context is 6872 // canceled. 6873 func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall { 6874 c.ctx_ = ctx 6875 return c 6876 } 6877 6878 // Header returns an http.Header that can be modified by the caller to 6879 // add HTTP headers to the request. 6880 func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Header() http.Header { 6881 if c.header_ == nil { 6882 c.header_ = make(http.Header) 6883 } 6884 return c.header_ 6885 } 6886 6887 func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 6888 reqHeaders := make(http.Header) 6889 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 6890 for k, v := range c.header_ { 6891 reqHeaders[k] = v 6892 } 6893 reqHeaders.Set("User-Agent", c.s.userAgent()) 6894 var body io.Reader = nil 6895 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 6896 if err != nil { 6897 return nil, err 6898 } 6899 reqHeaders.Set("Content-Type", "application/json") 6900 c.urlParams_.Set("alt", alt) 6901 c.urlParams_.Set("prettyPrint", "false") 6902 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 6903 urls += "?" + c.urlParams_.Encode() 6904 req, err := http.NewRequest("POST", urls, body) 6905 if err != nil { 6906 return nil, err 6907 } 6908 req.Header = reqHeaders 6909 googleapi.Expand(req.URL, map[string]string{ 6910 "resource": c.resource, 6911 }) 6912 return gensupport.SendRequest(c.ctx_, c.s.client, req) 6913 } 6914 6915 // Do executes the "dataproc.projects.locations.workflowTemplates.setIamPolicy" call. 6916 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 6917 // code is an error. Response headers are in either 6918 // *Policy.ServerResponse.Header or (if a response was returned at all) 6919 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 6920 // check whether the returned error was because http.StatusNotModified 6921 // was returned. 6922 func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 6923 gensupport.SetOptions(c.urlParams_, opts...) 6924 res, err := c.doRequest("json") 6925 if res != nil && res.StatusCode == http.StatusNotModified { 6926 if res.Body != nil { 6927 res.Body.Close() 6928 } 6929 return nil, &googleapi.Error{ 6930 Code: res.StatusCode, 6931 Header: res.Header, 6932 } 6933 } 6934 if err != nil { 6935 return nil, err 6936 } 6937 defer googleapi.CloseBody(res) 6938 if err := googleapi.CheckResponse(res); err != nil { 6939 return nil, err 6940 } 6941 ret := &Policy{ 6942 ServerResponse: googleapi.ServerResponse{ 6943 Header: res.Header, 6944 HTTPStatusCode: res.StatusCode, 6945 }, 6946 } 6947 target := &ret 6948 if err := gensupport.DecodeResponse(target, res); err != nil { 6949 return nil, err 6950 } 6951 return ret, nil 6952 // { 6953 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 6954 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:setIamPolicy", 6955 // "httpMethod": "POST", 6956 // "id": "dataproc.projects.locations.workflowTemplates.setIamPolicy", 6957 // "parameterOrder": [ 6958 // "resource" 6959 // ], 6960 // "parameters": { 6961 // "resource": { 6962 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 6963 // "location": "path", 6964 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 6965 // "required": true, 6966 // "type": "string" 6967 // } 6968 // }, 6969 // "path": "v1beta2/{+resource}:setIamPolicy", 6970 // "request": { 6971 // "$ref": "SetIamPolicyRequest" 6972 // }, 6973 // "response": { 6974 // "$ref": "Policy" 6975 // }, 6976 // "scopes": [ 6977 // "https://www.googleapis.com/auth/cloud-platform" 6978 // ] 6979 // } 6980 6981 } 6982 6983 // method id "dataproc.projects.locations.workflowTemplates.testIamPermissions": 6984 6985 type ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall struct { 6986 s *Service 6987 resource string 6988 testiampermissionsrequest *TestIamPermissionsRequest 6989 urlParams_ gensupport.URLParams 6990 ctx_ context.Context 6991 header_ http.Header 6992 } 6993 6994 // TestIamPermissions: Returns permissions that a caller has on the 6995 // specified resource. If the resource does not exist, this will return 6996 // an empty set of permissions, not a NOT_FOUND error.Note: This 6997 // operation is designed to be used for building permission-aware UIs 6998 // and command-line tools, not for authorization checking. This 6999 // operation may "fail open" without warning. 7000 // 7001 // - resource: REQUIRED: The resource for which the policy detail is 7002 // being requested. See the operation documentation for the 7003 // appropriate value for this field. 7004 func (r *ProjectsLocationsWorkflowTemplatesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall { 7005 c := &ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7006 c.resource = resource 7007 c.testiampermissionsrequest = testiampermissionsrequest 7008 return c 7009 } 7010 7011 // Fields allows partial responses to be retrieved. See 7012 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7013 // for more information. 7014 func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall { 7015 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7016 return c 7017 } 7018 7019 // Context sets the context to be used in this call's Do method. Any 7020 // pending HTTP request will be aborted if the provided context is 7021 // canceled. 7022 func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall { 7023 c.ctx_ = ctx 7024 return c 7025 } 7026 7027 // Header returns an http.Header that can be modified by the caller to 7028 // add HTTP headers to the request. 7029 func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Header() http.Header { 7030 if c.header_ == nil { 7031 c.header_ = make(http.Header) 7032 } 7033 return c.header_ 7034 } 7035 7036 func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 7037 reqHeaders := make(http.Header) 7038 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 7039 for k, v := range c.header_ { 7040 reqHeaders[k] = v 7041 } 7042 reqHeaders.Set("User-Agent", c.s.userAgent()) 7043 var body io.Reader = nil 7044 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 7045 if err != nil { 7046 return nil, err 7047 } 7048 reqHeaders.Set("Content-Type", "application/json") 7049 c.urlParams_.Set("alt", alt) 7050 c.urlParams_.Set("prettyPrint", "false") 7051 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 7052 urls += "?" + c.urlParams_.Encode() 7053 req, err := http.NewRequest("POST", urls, body) 7054 if err != nil { 7055 return nil, err 7056 } 7057 req.Header = reqHeaders 7058 googleapi.Expand(req.URL, map[string]string{ 7059 "resource": c.resource, 7060 }) 7061 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7062 } 7063 7064 // Do executes the "dataproc.projects.locations.workflowTemplates.testIamPermissions" call. 7065 // Exactly one of *TestIamPermissionsResponse or error will be non-nil. 7066 // Any non-2xx status code is an error. Response headers are in either 7067 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response 7068 // was returned at all) in error.(*googleapi.Error).Header. Use 7069 // googleapi.IsNotModified to check whether the returned error was 7070 // because http.StatusNotModified was returned. 7071 func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 7072 gensupport.SetOptions(c.urlParams_, opts...) 7073 res, err := c.doRequest("json") 7074 if res != nil && res.StatusCode == http.StatusNotModified { 7075 if res.Body != nil { 7076 res.Body.Close() 7077 } 7078 return nil, &googleapi.Error{ 7079 Code: res.StatusCode, 7080 Header: res.Header, 7081 } 7082 } 7083 if err != nil { 7084 return nil, err 7085 } 7086 defer googleapi.CloseBody(res) 7087 if err := googleapi.CheckResponse(res); err != nil { 7088 return nil, err 7089 } 7090 ret := &TestIamPermissionsResponse{ 7091 ServerResponse: googleapi.ServerResponse{ 7092 Header: res.Header, 7093 HTTPStatusCode: res.StatusCode, 7094 }, 7095 } 7096 target := &ret 7097 if err := gensupport.DecodeResponse(target, res); err != nil { 7098 return nil, err 7099 } 7100 return ret, nil 7101 // { 7102 // "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.", 7103 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:testIamPermissions", 7104 // "httpMethod": "POST", 7105 // "id": "dataproc.projects.locations.workflowTemplates.testIamPermissions", 7106 // "parameterOrder": [ 7107 // "resource" 7108 // ], 7109 // "parameters": { 7110 // "resource": { 7111 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 7112 // "location": "path", 7113 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 7114 // "required": true, 7115 // "type": "string" 7116 // } 7117 // }, 7118 // "path": "v1beta2/{+resource}:testIamPermissions", 7119 // "request": { 7120 // "$ref": "TestIamPermissionsRequest" 7121 // }, 7122 // "response": { 7123 // "$ref": "TestIamPermissionsResponse" 7124 // }, 7125 // "scopes": [ 7126 // "https://www.googleapis.com/auth/cloud-platform" 7127 // ] 7128 // } 7129 7130 } 7131 7132 // method id "dataproc.projects.locations.workflowTemplates.update": 7133 7134 type ProjectsLocationsWorkflowTemplatesUpdateCall struct { 7135 s *Service 7136 name string 7137 workflowtemplate *WorkflowTemplate 7138 urlParams_ gensupport.URLParams 7139 ctx_ context.Context 7140 header_ http.Header 7141 } 7142 7143 // Update: Updates (replaces) workflow template. The updated template 7144 // must contain version that matches the current server version. 7145 // 7146 // - name: Output only. The resource name of the workflow template, as 7147 // described in https://cloud.google.com/apis/design/resource_names. 7148 // For projects.regions.workflowTemplates, the resource name of the 7149 // template has the following format: 7150 // projects/{project_id}/regions/{region}/workflowTemplates/{template_i 7151 // d} For projects.locations.workflowTemplates, the resource name of 7152 // the template has the following format: 7153 // projects/{project_id}/locations/{location}/workflowTemplates/{templa 7154 // te_id}. 7155 func (r *ProjectsLocationsWorkflowTemplatesService) Update(name string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesUpdateCall { 7156 c := &ProjectsLocationsWorkflowTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7157 c.name = name 7158 c.workflowtemplate = workflowtemplate 7159 return c 7160 } 7161 7162 // Fields allows partial responses to be retrieved. See 7163 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7164 // for more information. 7165 func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesUpdateCall { 7166 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7167 return c 7168 } 7169 7170 // Context sets the context to be used in this call's Do method. Any 7171 // pending HTTP request will be aborted if the provided context is 7172 // canceled. 7173 func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesUpdateCall { 7174 c.ctx_ = ctx 7175 return c 7176 } 7177 7178 // Header returns an http.Header that can be modified by the caller to 7179 // add HTTP headers to the request. 7180 func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Header() http.Header { 7181 if c.header_ == nil { 7182 c.header_ = make(http.Header) 7183 } 7184 return c.header_ 7185 } 7186 7187 func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) { 7188 reqHeaders := make(http.Header) 7189 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 7190 for k, v := range c.header_ { 7191 reqHeaders[k] = v 7192 } 7193 reqHeaders.Set("User-Agent", c.s.userAgent()) 7194 var body io.Reader = nil 7195 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 7196 if err != nil { 7197 return nil, err 7198 } 7199 reqHeaders.Set("Content-Type", "application/json") 7200 c.urlParams_.Set("alt", alt) 7201 c.urlParams_.Set("prettyPrint", "false") 7202 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 7203 urls += "?" + c.urlParams_.Encode() 7204 req, err := http.NewRequest("PUT", urls, body) 7205 if err != nil { 7206 return nil, err 7207 } 7208 req.Header = reqHeaders 7209 googleapi.Expand(req.URL, map[string]string{ 7210 "name": c.name, 7211 }) 7212 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7213 } 7214 7215 // Do executes the "dataproc.projects.locations.workflowTemplates.update" call. 7216 // Exactly one of *WorkflowTemplate or error will be non-nil. Any 7217 // non-2xx status code is an error. Response headers are in either 7218 // *WorkflowTemplate.ServerResponse.Header or (if a response was 7219 // returned at all) in error.(*googleapi.Error).Header. Use 7220 // googleapi.IsNotModified to check whether the returned error was 7221 // because http.StatusNotModified was returned. 7222 func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 7223 gensupport.SetOptions(c.urlParams_, opts...) 7224 res, err := c.doRequest("json") 7225 if res != nil && res.StatusCode == http.StatusNotModified { 7226 if res.Body != nil { 7227 res.Body.Close() 7228 } 7229 return nil, &googleapi.Error{ 7230 Code: res.StatusCode, 7231 Header: res.Header, 7232 } 7233 } 7234 if err != nil { 7235 return nil, err 7236 } 7237 defer googleapi.CloseBody(res) 7238 if err := googleapi.CheckResponse(res); err != nil { 7239 return nil, err 7240 } 7241 ret := &WorkflowTemplate{ 7242 ServerResponse: googleapi.ServerResponse{ 7243 Header: res.Header, 7244 HTTPStatusCode: res.StatusCode, 7245 }, 7246 } 7247 target := &ret 7248 if err := gensupport.DecodeResponse(target, res); err != nil { 7249 return nil, err 7250 } 7251 return ret, nil 7252 // { 7253 // "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version.", 7254 // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}", 7255 // "httpMethod": "PUT", 7256 // "id": "dataproc.projects.locations.workflowTemplates.update", 7257 // "parameterOrder": [ 7258 // "name" 7259 // ], 7260 // "parameters": { 7261 // "name": { 7262 // "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}", 7263 // "location": "path", 7264 // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$", 7265 // "required": true, 7266 // "type": "string" 7267 // } 7268 // }, 7269 // "path": "v1beta2/{+name}", 7270 // "request": { 7271 // "$ref": "WorkflowTemplate" 7272 // }, 7273 // "response": { 7274 // "$ref": "WorkflowTemplate" 7275 // }, 7276 // "scopes": [ 7277 // "https://www.googleapis.com/auth/cloud-platform" 7278 // ] 7279 // } 7280 7281 } 7282 7283 // method id "dataproc.projects.regions.autoscalingPolicies.create": 7284 7285 type ProjectsRegionsAutoscalingPoliciesCreateCall struct { 7286 s *Service 7287 parent string 7288 autoscalingpolicy *AutoscalingPolicy 7289 urlParams_ gensupport.URLParams 7290 ctx_ context.Context 7291 header_ http.Header 7292 } 7293 7294 // Create: Creates new autoscaling policy. 7295 // 7296 // - parent: The "resource name" of the region or location, as described 7297 // in https://cloud.google.com/apis/design/resource_names. For 7298 // projects.regions.autoscalingPolicies.create, the resource name has 7299 // the following format: projects/{project_id}/regions/{region} For 7300 // projects.locations.autoscalingPolicies.create, the resource name 7301 // has the following format: 7302 // projects/{project_id}/locations/{location}. 7303 func (r *ProjectsRegionsAutoscalingPoliciesService) Create(parent string, autoscalingpolicy *AutoscalingPolicy) *ProjectsRegionsAutoscalingPoliciesCreateCall { 7304 c := &ProjectsRegionsAutoscalingPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7305 c.parent = parent 7306 c.autoscalingpolicy = autoscalingpolicy 7307 return c 7308 } 7309 7310 // Fields allows partial responses to be retrieved. See 7311 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7312 // for more information. 7313 func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesCreateCall { 7314 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7315 return c 7316 } 7317 7318 // Context sets the context to be used in this call's Do method. Any 7319 // pending HTTP request will be aborted if the provided context is 7320 // canceled. 7321 func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesCreateCall { 7322 c.ctx_ = ctx 7323 return c 7324 } 7325 7326 // Header returns an http.Header that can be modified by the caller to 7327 // add HTTP headers to the request. 7328 func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Header() http.Header { 7329 if c.header_ == nil { 7330 c.header_ = make(http.Header) 7331 } 7332 return c.header_ 7333 } 7334 7335 func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) doRequest(alt string) (*http.Response, error) { 7336 reqHeaders := make(http.Header) 7337 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 7338 for k, v := range c.header_ { 7339 reqHeaders[k] = v 7340 } 7341 reqHeaders.Set("User-Agent", c.s.userAgent()) 7342 var body io.Reader = nil 7343 body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) 7344 if err != nil { 7345 return nil, err 7346 } 7347 reqHeaders.Set("Content-Type", "application/json") 7348 c.urlParams_.Set("alt", alt) 7349 c.urlParams_.Set("prettyPrint", "false") 7350 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/autoscalingPolicies") 7351 urls += "?" + c.urlParams_.Encode() 7352 req, err := http.NewRequest("POST", urls, body) 7353 if err != nil { 7354 return nil, err 7355 } 7356 req.Header = reqHeaders 7357 googleapi.Expand(req.URL, map[string]string{ 7358 "parent": c.parent, 7359 }) 7360 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7361 } 7362 7363 // Do executes the "dataproc.projects.regions.autoscalingPolicies.create" call. 7364 // Exactly one of *AutoscalingPolicy or error will be non-nil. Any 7365 // non-2xx status code is an error. Response headers are in either 7366 // *AutoscalingPolicy.ServerResponse.Header or (if a response was 7367 // returned at all) in error.(*googleapi.Error).Header. Use 7368 // googleapi.IsNotModified to check whether the returned error was 7369 // because http.StatusNotModified was returned. 7370 func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 7371 gensupport.SetOptions(c.urlParams_, opts...) 7372 res, err := c.doRequest("json") 7373 if res != nil && res.StatusCode == http.StatusNotModified { 7374 if res.Body != nil { 7375 res.Body.Close() 7376 } 7377 return nil, &googleapi.Error{ 7378 Code: res.StatusCode, 7379 Header: res.Header, 7380 } 7381 } 7382 if err != nil { 7383 return nil, err 7384 } 7385 defer googleapi.CloseBody(res) 7386 if err := googleapi.CheckResponse(res); err != nil { 7387 return nil, err 7388 } 7389 ret := &AutoscalingPolicy{ 7390 ServerResponse: googleapi.ServerResponse{ 7391 Header: res.Header, 7392 HTTPStatusCode: res.StatusCode, 7393 }, 7394 } 7395 target := &ret 7396 if err := gensupport.DecodeResponse(target, res); err != nil { 7397 return nil, err 7398 } 7399 return ret, nil 7400 // { 7401 // "description": "Creates new autoscaling policy.", 7402 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies", 7403 // "httpMethod": "POST", 7404 // "id": "dataproc.projects.regions.autoscalingPolicies.create", 7405 // "parameterOrder": [ 7406 // "parent" 7407 // ], 7408 // "parameters": { 7409 // "parent": { 7410 // "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}", 7411 // "location": "path", 7412 // "pattern": "^projects/[^/]+/regions/[^/]+$", 7413 // "required": true, 7414 // "type": "string" 7415 // } 7416 // }, 7417 // "path": "v1beta2/{+parent}/autoscalingPolicies", 7418 // "request": { 7419 // "$ref": "AutoscalingPolicy" 7420 // }, 7421 // "response": { 7422 // "$ref": "AutoscalingPolicy" 7423 // }, 7424 // "scopes": [ 7425 // "https://www.googleapis.com/auth/cloud-platform" 7426 // ] 7427 // } 7428 7429 } 7430 7431 // method id "dataproc.projects.regions.autoscalingPolicies.delete": 7432 7433 type ProjectsRegionsAutoscalingPoliciesDeleteCall struct { 7434 s *Service 7435 name string 7436 urlParams_ gensupport.URLParams 7437 ctx_ context.Context 7438 header_ http.Header 7439 } 7440 7441 // Delete: Deletes an autoscaling policy. It is an error to delete an 7442 // autoscaling policy that is in use by one or more clusters. 7443 // 7444 // - name: The "resource name" of the autoscaling policy, as described 7445 // in https://cloud.google.com/apis/design/resource_names. For 7446 // projects.regions.autoscalingPolicies.delete, the resource name of 7447 // the policy has the following format: 7448 // projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 7449 // d} For projects.locations.autoscalingPolicies.delete, the resource 7450 // name of the policy has the following format: 7451 // projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 7452 // cy_id}. 7453 func (r *ProjectsRegionsAutoscalingPoliciesService) Delete(name string) *ProjectsRegionsAutoscalingPoliciesDeleteCall { 7454 c := &ProjectsRegionsAutoscalingPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7455 c.name = name 7456 return c 7457 } 7458 7459 // Fields allows partial responses to be retrieved. See 7460 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7461 // for more information. 7462 func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesDeleteCall { 7463 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7464 return c 7465 } 7466 7467 // Context sets the context to be used in this call's Do method. Any 7468 // pending HTTP request will be aborted if the provided context is 7469 // canceled. 7470 func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesDeleteCall { 7471 c.ctx_ = ctx 7472 return c 7473 } 7474 7475 // Header returns an http.Header that can be modified by the caller to 7476 // add HTTP headers to the request. 7477 func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Header() http.Header { 7478 if c.header_ == nil { 7479 c.header_ = make(http.Header) 7480 } 7481 return c.header_ 7482 } 7483 7484 func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) { 7485 reqHeaders := make(http.Header) 7486 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 7487 for k, v := range c.header_ { 7488 reqHeaders[k] = v 7489 } 7490 reqHeaders.Set("User-Agent", c.s.userAgent()) 7491 var body io.Reader = nil 7492 c.urlParams_.Set("alt", alt) 7493 c.urlParams_.Set("prettyPrint", "false") 7494 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 7495 urls += "?" + c.urlParams_.Encode() 7496 req, err := http.NewRequest("DELETE", urls, body) 7497 if err != nil { 7498 return nil, err 7499 } 7500 req.Header = reqHeaders 7501 googleapi.Expand(req.URL, map[string]string{ 7502 "name": c.name, 7503 }) 7504 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7505 } 7506 7507 // Do executes the "dataproc.projects.regions.autoscalingPolicies.delete" call. 7508 // Exactly one of *Empty or error will be non-nil. Any non-2xx status 7509 // code is an error. Response headers are in either 7510 // *Empty.ServerResponse.Header or (if a response was returned at all) 7511 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7512 // check whether the returned error was because http.StatusNotModified 7513 // was returned. 7514 func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 7515 gensupport.SetOptions(c.urlParams_, opts...) 7516 res, err := c.doRequest("json") 7517 if res != nil && res.StatusCode == http.StatusNotModified { 7518 if res.Body != nil { 7519 res.Body.Close() 7520 } 7521 return nil, &googleapi.Error{ 7522 Code: res.StatusCode, 7523 Header: res.Header, 7524 } 7525 } 7526 if err != nil { 7527 return nil, err 7528 } 7529 defer googleapi.CloseBody(res) 7530 if err := googleapi.CheckResponse(res); err != nil { 7531 return nil, err 7532 } 7533 ret := &Empty{ 7534 ServerResponse: googleapi.ServerResponse{ 7535 Header: res.Header, 7536 HTTPStatusCode: res.StatusCode, 7537 }, 7538 } 7539 target := &ret 7540 if err := gensupport.DecodeResponse(target, res); err != nil { 7541 return nil, err 7542 } 7543 return ret, nil 7544 // { 7545 // "description": "Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.", 7546 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}", 7547 // "httpMethod": "DELETE", 7548 // "id": "dataproc.projects.regions.autoscalingPolicies.delete", 7549 // "parameterOrder": [ 7550 // "name" 7551 // ], 7552 // "parameters": { 7553 // "name": { 7554 // "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}", 7555 // "location": "path", 7556 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 7557 // "required": true, 7558 // "type": "string" 7559 // } 7560 // }, 7561 // "path": "v1beta2/{+name}", 7562 // "response": { 7563 // "$ref": "Empty" 7564 // }, 7565 // "scopes": [ 7566 // "https://www.googleapis.com/auth/cloud-platform" 7567 // ] 7568 // } 7569 7570 } 7571 7572 // method id "dataproc.projects.regions.autoscalingPolicies.get": 7573 7574 type ProjectsRegionsAutoscalingPoliciesGetCall struct { 7575 s *Service 7576 name string 7577 urlParams_ gensupport.URLParams 7578 ifNoneMatch_ string 7579 ctx_ context.Context 7580 header_ http.Header 7581 } 7582 7583 // Get: Retrieves autoscaling policy. 7584 // 7585 // - name: The "resource name" of the autoscaling policy, as described 7586 // in https://cloud.google.com/apis/design/resource_names. For 7587 // projects.regions.autoscalingPolicies.get, the resource name of the 7588 // policy has the following format: 7589 // projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 7590 // d} For projects.locations.autoscalingPolicies.get, the resource 7591 // name of the policy has the following format: 7592 // projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 7593 // cy_id}. 7594 func (r *ProjectsRegionsAutoscalingPoliciesService) Get(name string) *ProjectsRegionsAutoscalingPoliciesGetCall { 7595 c := &ProjectsRegionsAutoscalingPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7596 c.name = name 7597 return c 7598 } 7599 7600 // Fields allows partial responses to be retrieved. See 7601 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7602 // for more information. 7603 func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesGetCall { 7604 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7605 return c 7606 } 7607 7608 // IfNoneMatch sets the optional parameter which makes the operation 7609 // fail if the object's ETag matches the given value. This is useful for 7610 // getting updates only after the object has changed since the last 7611 // request. Use googleapi.IsNotModified to check whether the response 7612 // error from Do is the result of In-None-Match. 7613 func (c *ProjectsRegionsAutoscalingPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsAutoscalingPoliciesGetCall { 7614 c.ifNoneMatch_ = entityTag 7615 return c 7616 } 7617 7618 // Context sets the context to be used in this call's Do method. Any 7619 // pending HTTP request will be aborted if the provided context is 7620 // canceled. 7621 func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesGetCall { 7622 c.ctx_ = ctx 7623 return c 7624 } 7625 7626 // Header returns an http.Header that can be modified by the caller to 7627 // add HTTP headers to the request. 7628 func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Header() http.Header { 7629 if c.header_ == nil { 7630 c.header_ = make(http.Header) 7631 } 7632 return c.header_ 7633 } 7634 7635 func (c *ProjectsRegionsAutoscalingPoliciesGetCall) doRequest(alt string) (*http.Response, error) { 7636 reqHeaders := make(http.Header) 7637 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 7638 for k, v := range c.header_ { 7639 reqHeaders[k] = v 7640 } 7641 reqHeaders.Set("User-Agent", c.s.userAgent()) 7642 if c.ifNoneMatch_ != "" { 7643 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7644 } 7645 var body io.Reader = nil 7646 c.urlParams_.Set("alt", alt) 7647 c.urlParams_.Set("prettyPrint", "false") 7648 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 7649 urls += "?" + c.urlParams_.Encode() 7650 req, err := http.NewRequest("GET", urls, body) 7651 if err != nil { 7652 return nil, err 7653 } 7654 req.Header = reqHeaders 7655 googleapi.Expand(req.URL, map[string]string{ 7656 "name": c.name, 7657 }) 7658 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7659 } 7660 7661 // Do executes the "dataproc.projects.regions.autoscalingPolicies.get" call. 7662 // Exactly one of *AutoscalingPolicy or error will be non-nil. Any 7663 // non-2xx status code is an error. Response headers are in either 7664 // *AutoscalingPolicy.ServerResponse.Header or (if a response was 7665 // returned at all) in error.(*googleapi.Error).Header. Use 7666 // googleapi.IsNotModified to check whether the returned error was 7667 // because http.StatusNotModified was returned. 7668 func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 7669 gensupport.SetOptions(c.urlParams_, opts...) 7670 res, err := c.doRequest("json") 7671 if res != nil && res.StatusCode == http.StatusNotModified { 7672 if res.Body != nil { 7673 res.Body.Close() 7674 } 7675 return nil, &googleapi.Error{ 7676 Code: res.StatusCode, 7677 Header: res.Header, 7678 } 7679 } 7680 if err != nil { 7681 return nil, err 7682 } 7683 defer googleapi.CloseBody(res) 7684 if err := googleapi.CheckResponse(res); err != nil { 7685 return nil, err 7686 } 7687 ret := &AutoscalingPolicy{ 7688 ServerResponse: googleapi.ServerResponse{ 7689 Header: res.Header, 7690 HTTPStatusCode: res.StatusCode, 7691 }, 7692 } 7693 target := &ret 7694 if err := gensupport.DecodeResponse(target, res); err != nil { 7695 return nil, err 7696 } 7697 return ret, nil 7698 // { 7699 // "description": "Retrieves autoscaling policy.", 7700 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}", 7701 // "httpMethod": "GET", 7702 // "id": "dataproc.projects.regions.autoscalingPolicies.get", 7703 // "parameterOrder": [ 7704 // "name" 7705 // ], 7706 // "parameters": { 7707 // "name": { 7708 // "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}", 7709 // "location": "path", 7710 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 7711 // "required": true, 7712 // "type": "string" 7713 // } 7714 // }, 7715 // "path": "v1beta2/{+name}", 7716 // "response": { 7717 // "$ref": "AutoscalingPolicy" 7718 // }, 7719 // "scopes": [ 7720 // "https://www.googleapis.com/auth/cloud-platform" 7721 // ] 7722 // } 7723 7724 } 7725 7726 // method id "dataproc.projects.regions.autoscalingPolicies.getIamPolicy": 7727 7728 type ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall struct { 7729 s *Service 7730 resource string 7731 urlParams_ gensupport.URLParams 7732 ifNoneMatch_ string 7733 ctx_ context.Context 7734 header_ http.Header 7735 } 7736 7737 // GetIamPolicy: Gets the access control policy for a resource. Returns 7738 // an empty policy if the resource exists and does not have a policy 7739 // set. 7740 // 7741 // - resource: REQUIRED: The resource for which the policy is being 7742 // requested. See the operation documentation for the appropriate 7743 // value for this field. 7744 func (r *ProjectsRegionsAutoscalingPoliciesService) GetIamPolicy(resource string) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall { 7745 c := &ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7746 c.resource = resource 7747 return c 7748 } 7749 7750 // OptionsRequestedPolicyVersion sets the optional parameter 7751 // "options.requestedPolicyVersion": The policy format version to be 7752 // returned.Valid values are 0, 1, and 3. Requests specifying an invalid 7753 // value will be rejected.Requests for policies with any conditional 7754 // bindings must specify version 3. Policies without any conditional 7755 // bindings may specify any valid value or leave the field unset.To 7756 // learn which resources support conditions in their IAM policies, see 7757 // the IAM documentation 7758 // (https://cloud.google.com/iam/help/conditions/resource-policies). 7759 func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall { 7760 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 7761 return c 7762 } 7763 7764 // Fields allows partial responses to be retrieved. See 7765 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7766 // for more information. 7767 func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall { 7768 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7769 return c 7770 } 7771 7772 // IfNoneMatch sets the optional parameter which makes the operation 7773 // fail if the object's ETag matches the given value. This is useful for 7774 // getting updates only after the object has changed since the last 7775 // request. Use googleapi.IsNotModified to check whether the response 7776 // error from Do is the result of In-None-Match. 7777 func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall { 7778 c.ifNoneMatch_ = entityTag 7779 return c 7780 } 7781 7782 // Context sets the context to be used in this call's Do method. Any 7783 // pending HTTP request will be aborted if the provided context is 7784 // canceled. 7785 func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall { 7786 c.ctx_ = ctx 7787 return c 7788 } 7789 7790 // Header returns an http.Header that can be modified by the caller to 7791 // add HTTP headers to the request. 7792 func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Header() http.Header { 7793 if c.header_ == nil { 7794 c.header_ = make(http.Header) 7795 } 7796 return c.header_ 7797 } 7798 7799 func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 7800 reqHeaders := make(http.Header) 7801 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 7802 for k, v := range c.header_ { 7803 reqHeaders[k] = v 7804 } 7805 reqHeaders.Set("User-Agent", c.s.userAgent()) 7806 if c.ifNoneMatch_ != "" { 7807 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7808 } 7809 var body io.Reader = nil 7810 c.urlParams_.Set("alt", alt) 7811 c.urlParams_.Set("prettyPrint", "false") 7812 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 7813 urls += "?" + c.urlParams_.Encode() 7814 req, err := http.NewRequest("GET", urls, body) 7815 if err != nil { 7816 return nil, err 7817 } 7818 req.Header = reqHeaders 7819 googleapi.Expand(req.URL, map[string]string{ 7820 "resource": c.resource, 7821 }) 7822 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7823 } 7824 7825 // Do executes the "dataproc.projects.regions.autoscalingPolicies.getIamPolicy" call. 7826 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 7827 // code is an error. Response headers are in either 7828 // *Policy.ServerResponse.Header or (if a response was returned at all) 7829 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 7830 // check whether the returned error was because http.StatusNotModified 7831 // was returned. 7832 func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 7833 gensupport.SetOptions(c.urlParams_, opts...) 7834 res, err := c.doRequest("json") 7835 if res != nil && res.StatusCode == http.StatusNotModified { 7836 if res.Body != nil { 7837 res.Body.Close() 7838 } 7839 return nil, &googleapi.Error{ 7840 Code: res.StatusCode, 7841 Header: res.Header, 7842 } 7843 } 7844 if err != nil { 7845 return nil, err 7846 } 7847 defer googleapi.CloseBody(res) 7848 if err := googleapi.CheckResponse(res); err != nil { 7849 return nil, err 7850 } 7851 ret := &Policy{ 7852 ServerResponse: googleapi.ServerResponse{ 7853 Header: res.Header, 7854 HTTPStatusCode: res.StatusCode, 7855 }, 7856 } 7857 target := &ret 7858 if err := gensupport.DecodeResponse(target, res); err != nil { 7859 return nil, err 7860 } 7861 return ret, nil 7862 // { 7863 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 7864 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}:getIamPolicy", 7865 // "httpMethod": "GET", 7866 // "id": "dataproc.projects.regions.autoscalingPolicies.getIamPolicy", 7867 // "parameterOrder": [ 7868 // "resource" 7869 // ], 7870 // "parameters": { 7871 // "options.requestedPolicyVersion": { 7872 // "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).", 7873 // "format": "int32", 7874 // "location": "query", 7875 // "type": "integer" 7876 // }, 7877 // "resource": { 7878 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 7879 // "location": "path", 7880 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 7881 // "required": true, 7882 // "type": "string" 7883 // } 7884 // }, 7885 // "path": "v1beta2/{+resource}:getIamPolicy", 7886 // "response": { 7887 // "$ref": "Policy" 7888 // }, 7889 // "scopes": [ 7890 // "https://www.googleapis.com/auth/cloud-platform" 7891 // ] 7892 // } 7893 7894 } 7895 7896 // method id "dataproc.projects.regions.autoscalingPolicies.list": 7897 7898 type ProjectsRegionsAutoscalingPoliciesListCall struct { 7899 s *Service 7900 parent string 7901 urlParams_ gensupport.URLParams 7902 ifNoneMatch_ string 7903 ctx_ context.Context 7904 header_ http.Header 7905 } 7906 7907 // List: Lists autoscaling policies in the project. 7908 // 7909 // - parent: The "resource name" of the region or location, as described 7910 // in https://cloud.google.com/apis/design/resource_names. For 7911 // projects.regions.autoscalingPolicies.list, the resource name of the 7912 // region has the following format: 7913 // projects/{project_id}/regions/{region} For 7914 // projects.locations.autoscalingPolicies.list, the resource name of 7915 // the location has the following format: 7916 // projects/{project_id}/locations/{location}. 7917 func (r *ProjectsRegionsAutoscalingPoliciesService) List(parent string) *ProjectsRegionsAutoscalingPoliciesListCall { 7918 c := &ProjectsRegionsAutoscalingPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 7919 c.parent = parent 7920 return c 7921 } 7922 7923 // PageSize sets the optional parameter "pageSize": The maximum number 7924 // of results to return in each response. Must be less than or equal to 7925 // 1000. Defaults to 100. 7926 func (c *ProjectsRegionsAutoscalingPoliciesListCall) PageSize(pageSize int64) *ProjectsRegionsAutoscalingPoliciesListCall { 7927 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 7928 return c 7929 } 7930 7931 // PageToken sets the optional parameter "pageToken": The page token, 7932 // returned by a previous call, to request the next page of results. 7933 func (c *ProjectsRegionsAutoscalingPoliciesListCall) PageToken(pageToken string) *ProjectsRegionsAutoscalingPoliciesListCall { 7934 c.urlParams_.Set("pageToken", pageToken) 7935 return c 7936 } 7937 7938 // Fields allows partial responses to be retrieved. See 7939 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 7940 // for more information. 7941 func (c *ProjectsRegionsAutoscalingPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesListCall { 7942 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 7943 return c 7944 } 7945 7946 // IfNoneMatch sets the optional parameter which makes the operation 7947 // fail if the object's ETag matches the given value. This is useful for 7948 // getting updates only after the object has changed since the last 7949 // request. Use googleapi.IsNotModified to check whether the response 7950 // error from Do is the result of In-None-Match. 7951 func (c *ProjectsRegionsAutoscalingPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsRegionsAutoscalingPoliciesListCall { 7952 c.ifNoneMatch_ = entityTag 7953 return c 7954 } 7955 7956 // Context sets the context to be used in this call's Do method. Any 7957 // pending HTTP request will be aborted if the provided context is 7958 // canceled. 7959 func (c *ProjectsRegionsAutoscalingPoliciesListCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesListCall { 7960 c.ctx_ = ctx 7961 return c 7962 } 7963 7964 // Header returns an http.Header that can be modified by the caller to 7965 // add HTTP headers to the request. 7966 func (c *ProjectsRegionsAutoscalingPoliciesListCall) Header() http.Header { 7967 if c.header_ == nil { 7968 c.header_ = make(http.Header) 7969 } 7970 return c.header_ 7971 } 7972 7973 func (c *ProjectsRegionsAutoscalingPoliciesListCall) doRequest(alt string) (*http.Response, error) { 7974 reqHeaders := make(http.Header) 7975 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 7976 for k, v := range c.header_ { 7977 reqHeaders[k] = v 7978 } 7979 reqHeaders.Set("User-Agent", c.s.userAgent()) 7980 if c.ifNoneMatch_ != "" { 7981 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 7982 } 7983 var body io.Reader = nil 7984 c.urlParams_.Set("alt", alt) 7985 c.urlParams_.Set("prettyPrint", "false") 7986 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/autoscalingPolicies") 7987 urls += "?" + c.urlParams_.Encode() 7988 req, err := http.NewRequest("GET", urls, body) 7989 if err != nil { 7990 return nil, err 7991 } 7992 req.Header = reqHeaders 7993 googleapi.Expand(req.URL, map[string]string{ 7994 "parent": c.parent, 7995 }) 7996 return gensupport.SendRequest(c.ctx_, c.s.client, req) 7997 } 7998 7999 // Do executes the "dataproc.projects.regions.autoscalingPolicies.list" call. 8000 // Exactly one of *ListAutoscalingPoliciesResponse or error will be 8001 // non-nil. Any non-2xx status code is an error. Response headers are in 8002 // either *ListAutoscalingPoliciesResponse.ServerResponse.Header or (if 8003 // a response was returned at all) in error.(*googleapi.Error).Header. 8004 // Use googleapi.IsNotModified to check whether the returned error was 8005 // because http.StatusNotModified was returned. 8006 func (c *ProjectsRegionsAutoscalingPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListAutoscalingPoliciesResponse, error) { 8007 gensupport.SetOptions(c.urlParams_, opts...) 8008 res, err := c.doRequest("json") 8009 if res != nil && res.StatusCode == http.StatusNotModified { 8010 if res.Body != nil { 8011 res.Body.Close() 8012 } 8013 return nil, &googleapi.Error{ 8014 Code: res.StatusCode, 8015 Header: res.Header, 8016 } 8017 } 8018 if err != nil { 8019 return nil, err 8020 } 8021 defer googleapi.CloseBody(res) 8022 if err := googleapi.CheckResponse(res); err != nil { 8023 return nil, err 8024 } 8025 ret := &ListAutoscalingPoliciesResponse{ 8026 ServerResponse: googleapi.ServerResponse{ 8027 Header: res.Header, 8028 HTTPStatusCode: res.StatusCode, 8029 }, 8030 } 8031 target := &ret 8032 if err := gensupport.DecodeResponse(target, res); err != nil { 8033 return nil, err 8034 } 8035 return ret, nil 8036 // { 8037 // "description": "Lists autoscaling policies in the project.", 8038 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies", 8039 // "httpMethod": "GET", 8040 // "id": "dataproc.projects.regions.autoscalingPolicies.list", 8041 // "parameterOrder": [ 8042 // "parent" 8043 // ], 8044 // "parameters": { 8045 // "pageSize": { 8046 // "description": "Optional. The maximum number of results to return in each response. Must be less than or equal to 1000. Defaults to 100.", 8047 // "format": "int32", 8048 // "location": "query", 8049 // "type": "integer" 8050 // }, 8051 // "pageToken": { 8052 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 8053 // "location": "query", 8054 // "type": "string" 8055 // }, 8056 // "parent": { 8057 // "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}", 8058 // "location": "path", 8059 // "pattern": "^projects/[^/]+/regions/[^/]+$", 8060 // "required": true, 8061 // "type": "string" 8062 // } 8063 // }, 8064 // "path": "v1beta2/{+parent}/autoscalingPolicies", 8065 // "response": { 8066 // "$ref": "ListAutoscalingPoliciesResponse" 8067 // }, 8068 // "scopes": [ 8069 // "https://www.googleapis.com/auth/cloud-platform" 8070 // ] 8071 // } 8072 8073 } 8074 8075 // Pages invokes f for each page of results. 8076 // A non-nil error returned from f will halt the iteration. 8077 // The provided context supersedes any context provided to the Context method. 8078 func (c *ProjectsRegionsAutoscalingPoliciesListCall) Pages(ctx context.Context, f func(*ListAutoscalingPoliciesResponse) error) error { 8079 c.ctx_ = ctx 8080 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 8081 for { 8082 x, err := c.Do() 8083 if err != nil { 8084 return err 8085 } 8086 if err := f(x); err != nil { 8087 return err 8088 } 8089 if x.NextPageToken == "" { 8090 return nil 8091 } 8092 c.PageToken(x.NextPageToken) 8093 } 8094 } 8095 8096 // method id "dataproc.projects.regions.autoscalingPolicies.setIamPolicy": 8097 8098 type ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall struct { 8099 s *Service 8100 resource string 8101 setiampolicyrequest *SetIamPolicyRequest 8102 urlParams_ gensupport.URLParams 8103 ctx_ context.Context 8104 header_ http.Header 8105 } 8106 8107 // SetIamPolicy: Sets the access control policy on the specified 8108 // resource. Replaces any existing policy.Can return NOT_FOUND, 8109 // INVALID_ARGUMENT, and PERMISSION_DENIED errors. 8110 // 8111 // - resource: REQUIRED: The resource for which the policy is being 8112 // specified. See the operation documentation for the appropriate 8113 // value for this field. 8114 func (r *ProjectsRegionsAutoscalingPoliciesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall { 8115 c := &ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8116 c.resource = resource 8117 c.setiampolicyrequest = setiampolicyrequest 8118 return c 8119 } 8120 8121 // Fields allows partial responses to be retrieved. See 8122 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8123 // for more information. 8124 func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall { 8125 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8126 return c 8127 } 8128 8129 // Context sets the context to be used in this call's Do method. Any 8130 // pending HTTP request will be aborted if the provided context is 8131 // canceled. 8132 func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall { 8133 c.ctx_ = ctx 8134 return c 8135 } 8136 8137 // Header returns an http.Header that can be modified by the caller to 8138 // add HTTP headers to the request. 8139 func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Header() http.Header { 8140 if c.header_ == nil { 8141 c.header_ = make(http.Header) 8142 } 8143 return c.header_ 8144 } 8145 8146 func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 8147 reqHeaders := make(http.Header) 8148 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 8149 for k, v := range c.header_ { 8150 reqHeaders[k] = v 8151 } 8152 reqHeaders.Set("User-Agent", c.s.userAgent()) 8153 var body io.Reader = nil 8154 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 8155 if err != nil { 8156 return nil, err 8157 } 8158 reqHeaders.Set("Content-Type", "application/json") 8159 c.urlParams_.Set("alt", alt) 8160 c.urlParams_.Set("prettyPrint", "false") 8161 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 8162 urls += "?" + c.urlParams_.Encode() 8163 req, err := http.NewRequest("POST", urls, body) 8164 if err != nil { 8165 return nil, err 8166 } 8167 req.Header = reqHeaders 8168 googleapi.Expand(req.URL, map[string]string{ 8169 "resource": c.resource, 8170 }) 8171 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8172 } 8173 8174 // Do executes the "dataproc.projects.regions.autoscalingPolicies.setIamPolicy" call. 8175 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 8176 // code is an error. Response headers are in either 8177 // *Policy.ServerResponse.Header or (if a response was returned at all) 8178 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 8179 // check whether the returned error was because http.StatusNotModified 8180 // was returned. 8181 func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 8182 gensupport.SetOptions(c.urlParams_, opts...) 8183 res, err := c.doRequest("json") 8184 if res != nil && res.StatusCode == http.StatusNotModified { 8185 if res.Body != nil { 8186 res.Body.Close() 8187 } 8188 return nil, &googleapi.Error{ 8189 Code: res.StatusCode, 8190 Header: res.Header, 8191 } 8192 } 8193 if err != nil { 8194 return nil, err 8195 } 8196 defer googleapi.CloseBody(res) 8197 if err := googleapi.CheckResponse(res); err != nil { 8198 return nil, err 8199 } 8200 ret := &Policy{ 8201 ServerResponse: googleapi.ServerResponse{ 8202 Header: res.Header, 8203 HTTPStatusCode: res.StatusCode, 8204 }, 8205 } 8206 target := &ret 8207 if err := gensupport.DecodeResponse(target, res); err != nil { 8208 return nil, err 8209 } 8210 return ret, nil 8211 // { 8212 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 8213 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}:setIamPolicy", 8214 // "httpMethod": "POST", 8215 // "id": "dataproc.projects.regions.autoscalingPolicies.setIamPolicy", 8216 // "parameterOrder": [ 8217 // "resource" 8218 // ], 8219 // "parameters": { 8220 // "resource": { 8221 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 8222 // "location": "path", 8223 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 8224 // "required": true, 8225 // "type": "string" 8226 // } 8227 // }, 8228 // "path": "v1beta2/{+resource}:setIamPolicy", 8229 // "request": { 8230 // "$ref": "SetIamPolicyRequest" 8231 // }, 8232 // "response": { 8233 // "$ref": "Policy" 8234 // }, 8235 // "scopes": [ 8236 // "https://www.googleapis.com/auth/cloud-platform" 8237 // ] 8238 // } 8239 8240 } 8241 8242 // method id "dataproc.projects.regions.autoscalingPolicies.testIamPermissions": 8243 8244 type ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall struct { 8245 s *Service 8246 resource string 8247 testiampermissionsrequest *TestIamPermissionsRequest 8248 urlParams_ gensupport.URLParams 8249 ctx_ context.Context 8250 header_ http.Header 8251 } 8252 8253 // TestIamPermissions: Returns permissions that a caller has on the 8254 // specified resource. If the resource does not exist, this will return 8255 // an empty set of permissions, not a NOT_FOUND error.Note: This 8256 // operation is designed to be used for building permission-aware UIs 8257 // and command-line tools, not for authorization checking. This 8258 // operation may "fail open" without warning. 8259 // 8260 // - resource: REQUIRED: The resource for which the policy detail is 8261 // being requested. See the operation documentation for the 8262 // appropriate value for this field. 8263 func (r *ProjectsRegionsAutoscalingPoliciesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall { 8264 c := &ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8265 c.resource = resource 8266 c.testiampermissionsrequest = testiampermissionsrequest 8267 return c 8268 } 8269 8270 // Fields allows partial responses to be retrieved. See 8271 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8272 // for more information. 8273 func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall { 8274 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8275 return c 8276 } 8277 8278 // Context sets the context to be used in this call's Do method. Any 8279 // pending HTTP request will be aborted if the provided context is 8280 // canceled. 8281 func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall { 8282 c.ctx_ = ctx 8283 return c 8284 } 8285 8286 // Header returns an http.Header that can be modified by the caller to 8287 // add HTTP headers to the request. 8288 func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Header() http.Header { 8289 if c.header_ == nil { 8290 c.header_ = make(http.Header) 8291 } 8292 return c.header_ 8293 } 8294 8295 func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 8296 reqHeaders := make(http.Header) 8297 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 8298 for k, v := range c.header_ { 8299 reqHeaders[k] = v 8300 } 8301 reqHeaders.Set("User-Agent", c.s.userAgent()) 8302 var body io.Reader = nil 8303 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 8304 if err != nil { 8305 return nil, err 8306 } 8307 reqHeaders.Set("Content-Type", "application/json") 8308 c.urlParams_.Set("alt", alt) 8309 c.urlParams_.Set("prettyPrint", "false") 8310 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 8311 urls += "?" + c.urlParams_.Encode() 8312 req, err := http.NewRequest("POST", urls, body) 8313 if err != nil { 8314 return nil, err 8315 } 8316 req.Header = reqHeaders 8317 googleapi.Expand(req.URL, map[string]string{ 8318 "resource": c.resource, 8319 }) 8320 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8321 } 8322 8323 // Do executes the "dataproc.projects.regions.autoscalingPolicies.testIamPermissions" call. 8324 // Exactly one of *TestIamPermissionsResponse or error will be non-nil. 8325 // Any non-2xx status code is an error. Response headers are in either 8326 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response 8327 // was returned at all) in error.(*googleapi.Error).Header. Use 8328 // googleapi.IsNotModified to check whether the returned error was 8329 // because http.StatusNotModified was returned. 8330 func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 8331 gensupport.SetOptions(c.urlParams_, opts...) 8332 res, err := c.doRequest("json") 8333 if res != nil && res.StatusCode == http.StatusNotModified { 8334 if res.Body != nil { 8335 res.Body.Close() 8336 } 8337 return nil, &googleapi.Error{ 8338 Code: res.StatusCode, 8339 Header: res.Header, 8340 } 8341 } 8342 if err != nil { 8343 return nil, err 8344 } 8345 defer googleapi.CloseBody(res) 8346 if err := googleapi.CheckResponse(res); err != nil { 8347 return nil, err 8348 } 8349 ret := &TestIamPermissionsResponse{ 8350 ServerResponse: googleapi.ServerResponse{ 8351 Header: res.Header, 8352 HTTPStatusCode: res.StatusCode, 8353 }, 8354 } 8355 target := &ret 8356 if err := gensupport.DecodeResponse(target, res); err != nil { 8357 return nil, err 8358 } 8359 return ret, nil 8360 // { 8361 // "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.", 8362 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}:testIamPermissions", 8363 // "httpMethod": "POST", 8364 // "id": "dataproc.projects.regions.autoscalingPolicies.testIamPermissions", 8365 // "parameterOrder": [ 8366 // "resource" 8367 // ], 8368 // "parameters": { 8369 // "resource": { 8370 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 8371 // "location": "path", 8372 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 8373 // "required": true, 8374 // "type": "string" 8375 // } 8376 // }, 8377 // "path": "v1beta2/{+resource}:testIamPermissions", 8378 // "request": { 8379 // "$ref": "TestIamPermissionsRequest" 8380 // }, 8381 // "response": { 8382 // "$ref": "TestIamPermissionsResponse" 8383 // }, 8384 // "scopes": [ 8385 // "https://www.googleapis.com/auth/cloud-platform" 8386 // ] 8387 // } 8388 8389 } 8390 8391 // method id "dataproc.projects.regions.autoscalingPolicies.update": 8392 8393 type ProjectsRegionsAutoscalingPoliciesUpdateCall struct { 8394 s *Service 8395 name string 8396 autoscalingpolicy *AutoscalingPolicy 8397 urlParams_ gensupport.URLParams 8398 ctx_ context.Context 8399 header_ http.Header 8400 } 8401 8402 // Update: Updates (replaces) autoscaling policy.Disabled check for 8403 // update_mask, because all updates will be full replacements. 8404 // 8405 // - name: Output only. The "resource name" of the autoscaling policy, 8406 // as described in 8407 // https://cloud.google.com/apis/design/resource_names. For 8408 // projects.regions.autoscalingPolicies, the resource name of the 8409 // policy has the following format: 8410 // projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_i 8411 // d} For projects.locations.autoscalingPolicies, the resource name of 8412 // the policy has the following format: 8413 // projects/{project_id}/locations/{location}/autoscalingPolicies/{poli 8414 // cy_id}. 8415 func (r *ProjectsRegionsAutoscalingPoliciesService) Update(name string, autoscalingpolicy *AutoscalingPolicy) *ProjectsRegionsAutoscalingPoliciesUpdateCall { 8416 c := &ProjectsRegionsAutoscalingPoliciesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8417 c.name = name 8418 c.autoscalingpolicy = autoscalingpolicy 8419 return c 8420 } 8421 8422 // Fields allows partial responses to be retrieved. See 8423 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8424 // for more information. 8425 func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesUpdateCall { 8426 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8427 return c 8428 } 8429 8430 // Context sets the context to be used in this call's Do method. Any 8431 // pending HTTP request will be aborted if the provided context is 8432 // canceled. 8433 func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesUpdateCall { 8434 c.ctx_ = ctx 8435 return c 8436 } 8437 8438 // Header returns an http.Header that can be modified by the caller to 8439 // add HTTP headers to the request. 8440 func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Header() http.Header { 8441 if c.header_ == nil { 8442 c.header_ = make(http.Header) 8443 } 8444 return c.header_ 8445 } 8446 8447 func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) doRequest(alt string) (*http.Response, error) { 8448 reqHeaders := make(http.Header) 8449 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 8450 for k, v := range c.header_ { 8451 reqHeaders[k] = v 8452 } 8453 reqHeaders.Set("User-Agent", c.s.userAgent()) 8454 var body io.Reader = nil 8455 body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy) 8456 if err != nil { 8457 return nil, err 8458 } 8459 reqHeaders.Set("Content-Type", "application/json") 8460 c.urlParams_.Set("alt", alt) 8461 c.urlParams_.Set("prettyPrint", "false") 8462 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 8463 urls += "?" + c.urlParams_.Encode() 8464 req, err := http.NewRequest("PUT", urls, body) 8465 if err != nil { 8466 return nil, err 8467 } 8468 req.Header = reqHeaders 8469 googleapi.Expand(req.URL, map[string]string{ 8470 "name": c.name, 8471 }) 8472 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8473 } 8474 8475 // Do executes the "dataproc.projects.regions.autoscalingPolicies.update" call. 8476 // Exactly one of *AutoscalingPolicy or error will be non-nil. Any 8477 // non-2xx status code is an error. Response headers are in either 8478 // *AutoscalingPolicy.ServerResponse.Header or (if a response was 8479 // returned at all) in error.(*googleapi.Error).Header. Use 8480 // googleapi.IsNotModified to check whether the returned error was 8481 // because http.StatusNotModified was returned. 8482 func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) { 8483 gensupport.SetOptions(c.urlParams_, opts...) 8484 res, err := c.doRequest("json") 8485 if res != nil && res.StatusCode == http.StatusNotModified { 8486 if res.Body != nil { 8487 res.Body.Close() 8488 } 8489 return nil, &googleapi.Error{ 8490 Code: res.StatusCode, 8491 Header: res.Header, 8492 } 8493 } 8494 if err != nil { 8495 return nil, err 8496 } 8497 defer googleapi.CloseBody(res) 8498 if err := googleapi.CheckResponse(res); err != nil { 8499 return nil, err 8500 } 8501 ret := &AutoscalingPolicy{ 8502 ServerResponse: googleapi.ServerResponse{ 8503 Header: res.Header, 8504 HTTPStatusCode: res.StatusCode, 8505 }, 8506 } 8507 target := &ret 8508 if err := gensupport.DecodeResponse(target, res); err != nil { 8509 return nil, err 8510 } 8511 return ret, nil 8512 // { 8513 // "description": "Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements.", 8514 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}", 8515 // "httpMethod": "PUT", 8516 // "id": "dataproc.projects.regions.autoscalingPolicies.update", 8517 // "parameterOrder": [ 8518 // "name" 8519 // ], 8520 // "parameters": { 8521 // "name": { 8522 // "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}", 8523 // "location": "path", 8524 // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$", 8525 // "required": true, 8526 // "type": "string" 8527 // } 8528 // }, 8529 // "path": "v1beta2/{+name}", 8530 // "request": { 8531 // "$ref": "AutoscalingPolicy" 8532 // }, 8533 // "response": { 8534 // "$ref": "AutoscalingPolicy" 8535 // }, 8536 // "scopes": [ 8537 // "https://www.googleapis.com/auth/cloud-platform" 8538 // ] 8539 // } 8540 8541 } 8542 8543 // method id "dataproc.projects.regions.clusters.create": 8544 8545 type ProjectsRegionsClustersCreateCall struct { 8546 s *Service 8547 projectId string 8548 region string 8549 cluster *Cluster 8550 urlParams_ gensupport.URLParams 8551 ctx_ context.Context 8552 header_ http.Header 8553 } 8554 8555 // Create: Creates a cluster in a project. The returned 8556 // Operation.metadata will be ClusterOperationMetadata 8557 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). 8558 // 8559 // - projectId: The ID of the Google Cloud Platform project that the 8560 // cluster belongs to. 8561 // - region: The Dataproc region in which to handle the request. 8562 func (r *ProjectsRegionsClustersService) Create(projectId string, region string, cluster *Cluster) *ProjectsRegionsClustersCreateCall { 8563 c := &ProjectsRegionsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8564 c.projectId = projectId 8565 c.region = region 8566 c.cluster = cluster 8567 return c 8568 } 8569 8570 // RequestId sets the optional parameter "requestId": A unique id used 8571 // to identify the request. If the server receives two 8572 // CreateClusterRequest 8573 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#google.cloud.dataproc.v1beta2.CreateClusterRequest)s 8574 // with the same id, then the second request will be ignored and the 8575 // first google.longrunning.Operation created and stored in the backend 8576 // is returned.It is recommended to always set this value to a UUID 8577 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id 8578 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 8579 // and hyphens (-). The maximum length is 40 characters. 8580 func (c *ProjectsRegionsClustersCreateCall) RequestId(requestId string) *ProjectsRegionsClustersCreateCall { 8581 c.urlParams_.Set("requestId", requestId) 8582 return c 8583 } 8584 8585 // Fields allows partial responses to be retrieved. See 8586 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8587 // for more information. 8588 func (c *ProjectsRegionsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersCreateCall { 8589 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8590 return c 8591 } 8592 8593 // Context sets the context to be used in this call's Do method. Any 8594 // pending HTTP request will be aborted if the provided context is 8595 // canceled. 8596 func (c *ProjectsRegionsClustersCreateCall) Context(ctx context.Context) *ProjectsRegionsClustersCreateCall { 8597 c.ctx_ = ctx 8598 return c 8599 } 8600 8601 // Header returns an http.Header that can be modified by the caller to 8602 // add HTTP headers to the request. 8603 func (c *ProjectsRegionsClustersCreateCall) Header() http.Header { 8604 if c.header_ == nil { 8605 c.header_ = make(http.Header) 8606 } 8607 return c.header_ 8608 } 8609 8610 func (c *ProjectsRegionsClustersCreateCall) doRequest(alt string) (*http.Response, error) { 8611 reqHeaders := make(http.Header) 8612 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 8613 for k, v := range c.header_ { 8614 reqHeaders[k] = v 8615 } 8616 reqHeaders.Set("User-Agent", c.s.userAgent()) 8617 var body io.Reader = nil 8618 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) 8619 if err != nil { 8620 return nil, err 8621 } 8622 reqHeaders.Set("Content-Type", "application/json") 8623 c.urlParams_.Set("alt", alt) 8624 c.urlParams_.Set("prettyPrint", "false") 8625 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters") 8626 urls += "?" + c.urlParams_.Encode() 8627 req, err := http.NewRequest("POST", urls, body) 8628 if err != nil { 8629 return nil, err 8630 } 8631 req.Header = reqHeaders 8632 googleapi.Expand(req.URL, map[string]string{ 8633 "projectId": c.projectId, 8634 "region": c.region, 8635 }) 8636 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8637 } 8638 8639 // Do executes the "dataproc.projects.regions.clusters.create" call. 8640 // Exactly one of *Operation or error will be non-nil. Any non-2xx 8641 // status code is an error. Response headers are in either 8642 // *Operation.ServerResponse.Header or (if a response was returned at 8643 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8644 // to check whether the returned error was because 8645 // http.StatusNotModified was returned. 8646 func (c *ProjectsRegionsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8647 gensupport.SetOptions(c.urlParams_, opts...) 8648 res, err := c.doRequest("json") 8649 if res != nil && res.StatusCode == http.StatusNotModified { 8650 if res.Body != nil { 8651 res.Body.Close() 8652 } 8653 return nil, &googleapi.Error{ 8654 Code: res.StatusCode, 8655 Header: res.Header, 8656 } 8657 } 8658 if err != nil { 8659 return nil, err 8660 } 8661 defer googleapi.CloseBody(res) 8662 if err := googleapi.CheckResponse(res); err != nil { 8663 return nil, err 8664 } 8665 ret := &Operation{ 8666 ServerResponse: googleapi.ServerResponse{ 8667 Header: res.Header, 8668 HTTPStatusCode: res.StatusCode, 8669 }, 8670 } 8671 target := &ret 8672 if err := gensupport.DecodeResponse(target, res); err != nil { 8673 return nil, err 8674 } 8675 return ret, nil 8676 // { 8677 // "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).", 8678 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters", 8679 // "httpMethod": "POST", 8680 // "id": "dataproc.projects.regions.clusters.create", 8681 // "parameterOrder": [ 8682 // "projectId", 8683 // "region" 8684 // ], 8685 // "parameters": { 8686 // "projectId": { 8687 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 8688 // "location": "path", 8689 // "required": true, 8690 // "type": "string" 8691 // }, 8692 // "region": { 8693 // "description": "Required. The Dataproc region in which to handle the request.", 8694 // "location": "path", 8695 // "required": true, 8696 // "type": "string" 8697 // }, 8698 // "requestId": { 8699 // "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.", 8700 // "location": "query", 8701 // "type": "string" 8702 // } 8703 // }, 8704 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters", 8705 // "request": { 8706 // "$ref": "Cluster" 8707 // }, 8708 // "response": { 8709 // "$ref": "Operation" 8710 // }, 8711 // "scopes": [ 8712 // "https://www.googleapis.com/auth/cloud-platform" 8713 // ] 8714 // } 8715 8716 } 8717 8718 // method id "dataproc.projects.regions.clusters.delete": 8719 8720 type ProjectsRegionsClustersDeleteCall struct { 8721 s *Service 8722 projectId string 8723 region string 8724 clusterName string 8725 urlParams_ gensupport.URLParams 8726 ctx_ context.Context 8727 header_ http.Header 8728 } 8729 8730 // Delete: Deletes a cluster in a project. The returned 8731 // Operation.metadata will be ClusterOperationMetadata 8732 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). 8733 // 8734 // - clusterName: The cluster name. 8735 // - projectId: The ID of the Google Cloud Platform project that the 8736 // cluster belongs to. 8737 // - region: The Dataproc region in which to handle the request. 8738 func (r *ProjectsRegionsClustersService) Delete(projectId string, region string, clusterName string) *ProjectsRegionsClustersDeleteCall { 8739 c := &ProjectsRegionsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8740 c.projectId = projectId 8741 c.region = region 8742 c.clusterName = clusterName 8743 return c 8744 } 8745 8746 // ClusterUuid sets the optional parameter "clusterUuid": Specifying the 8747 // cluster_uuid means the RPC should fail (with error NOT_FOUND) if 8748 // cluster with specified UUID does not exist. 8749 func (c *ProjectsRegionsClustersDeleteCall) ClusterUuid(clusterUuid string) *ProjectsRegionsClustersDeleteCall { 8750 c.urlParams_.Set("clusterUuid", clusterUuid) 8751 return c 8752 } 8753 8754 // RequestId sets the optional parameter "requestId": A unique id used 8755 // to identify the request. If the server receives two 8756 // DeleteClusterRequest 8757 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#google.cloud.dataproc.v1beta2.DeleteClusterRequest)s 8758 // with the same id, then the second request will be ignored and the 8759 // first google.longrunning.Operation created and stored in the backend 8760 // is returned.It is recommended to always set this value to a UUID 8761 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id 8762 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 8763 // and hyphens (-). The maximum length is 40 characters. 8764 func (c *ProjectsRegionsClustersDeleteCall) RequestId(requestId string) *ProjectsRegionsClustersDeleteCall { 8765 c.urlParams_.Set("requestId", requestId) 8766 return c 8767 } 8768 8769 // Fields allows partial responses to be retrieved. See 8770 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8771 // for more information. 8772 func (c *ProjectsRegionsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersDeleteCall { 8773 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8774 return c 8775 } 8776 8777 // Context sets the context to be used in this call's Do method. Any 8778 // pending HTTP request will be aborted if the provided context is 8779 // canceled. 8780 func (c *ProjectsRegionsClustersDeleteCall) Context(ctx context.Context) *ProjectsRegionsClustersDeleteCall { 8781 c.ctx_ = ctx 8782 return c 8783 } 8784 8785 // Header returns an http.Header that can be modified by the caller to 8786 // add HTTP headers to the request. 8787 func (c *ProjectsRegionsClustersDeleteCall) Header() http.Header { 8788 if c.header_ == nil { 8789 c.header_ = make(http.Header) 8790 } 8791 return c.header_ 8792 } 8793 8794 func (c *ProjectsRegionsClustersDeleteCall) doRequest(alt string) (*http.Response, error) { 8795 reqHeaders := make(http.Header) 8796 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 8797 for k, v := range c.header_ { 8798 reqHeaders[k] = v 8799 } 8800 reqHeaders.Set("User-Agent", c.s.userAgent()) 8801 var body io.Reader = nil 8802 c.urlParams_.Set("alt", alt) 8803 c.urlParams_.Set("prettyPrint", "false") 8804 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}") 8805 urls += "?" + c.urlParams_.Encode() 8806 req, err := http.NewRequest("DELETE", urls, body) 8807 if err != nil { 8808 return nil, err 8809 } 8810 req.Header = reqHeaders 8811 googleapi.Expand(req.URL, map[string]string{ 8812 "projectId": c.projectId, 8813 "region": c.region, 8814 "clusterName": c.clusterName, 8815 }) 8816 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8817 } 8818 8819 // Do executes the "dataproc.projects.regions.clusters.delete" call. 8820 // Exactly one of *Operation or error will be non-nil. Any non-2xx 8821 // status code is an error. Response headers are in either 8822 // *Operation.ServerResponse.Header or (if a response was returned at 8823 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8824 // to check whether the returned error was because 8825 // http.StatusNotModified was returned. 8826 func (c *ProjectsRegionsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 8827 gensupport.SetOptions(c.urlParams_, opts...) 8828 res, err := c.doRequest("json") 8829 if res != nil && res.StatusCode == http.StatusNotModified { 8830 if res.Body != nil { 8831 res.Body.Close() 8832 } 8833 return nil, &googleapi.Error{ 8834 Code: res.StatusCode, 8835 Header: res.Header, 8836 } 8837 } 8838 if err != nil { 8839 return nil, err 8840 } 8841 defer googleapi.CloseBody(res) 8842 if err := googleapi.CheckResponse(res); err != nil { 8843 return nil, err 8844 } 8845 ret := &Operation{ 8846 ServerResponse: googleapi.ServerResponse{ 8847 Header: res.Header, 8848 HTTPStatusCode: res.StatusCode, 8849 }, 8850 } 8851 target := &ret 8852 if err := gensupport.DecodeResponse(target, res); err != nil { 8853 return nil, err 8854 } 8855 return ret, nil 8856 // { 8857 // "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).", 8858 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", 8859 // "httpMethod": "DELETE", 8860 // "id": "dataproc.projects.regions.clusters.delete", 8861 // "parameterOrder": [ 8862 // "projectId", 8863 // "region", 8864 // "clusterName" 8865 // ], 8866 // "parameters": { 8867 // "clusterName": { 8868 // "description": "Required. The cluster name.", 8869 // "location": "path", 8870 // "required": true, 8871 // "type": "string" 8872 // }, 8873 // "clusterUuid": { 8874 // "description": "Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist.", 8875 // "location": "query", 8876 // "type": "string" 8877 // }, 8878 // "projectId": { 8879 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 8880 // "location": "path", 8881 // "required": true, 8882 // "type": "string" 8883 // }, 8884 // "region": { 8885 // "description": "Required. The Dataproc region in which to handle the request.", 8886 // "location": "path", 8887 // "required": true, 8888 // "type": "string" 8889 // }, 8890 // "requestId": { 8891 // "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.", 8892 // "location": "query", 8893 // "type": "string" 8894 // } 8895 // }, 8896 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", 8897 // "response": { 8898 // "$ref": "Operation" 8899 // }, 8900 // "scopes": [ 8901 // "https://www.googleapis.com/auth/cloud-platform" 8902 // ] 8903 // } 8904 8905 } 8906 8907 // method id "dataproc.projects.regions.clusters.diagnose": 8908 8909 type ProjectsRegionsClustersDiagnoseCall struct { 8910 s *Service 8911 projectId string 8912 region string 8913 clusterName string 8914 diagnoseclusterrequest *DiagnoseClusterRequest 8915 urlParams_ gensupport.URLParams 8916 ctx_ context.Context 8917 header_ http.Header 8918 } 8919 8920 // Diagnose: Gets cluster diagnostic information. The returned 8921 // Operation.metadata will be ClusterOperationMetadata 8922 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). 8923 // After the operation completes, Operation.response contains Empty. 8924 // 8925 // - clusterName: The cluster name. 8926 // - projectId: The ID of the Google Cloud Platform project that the 8927 // cluster belongs to. 8928 // - region: The Dataproc region in which to handle the request. 8929 func (r *ProjectsRegionsClustersService) Diagnose(projectId string, region string, clusterName string, diagnoseclusterrequest *DiagnoseClusterRequest) *ProjectsRegionsClustersDiagnoseCall { 8930 c := &ProjectsRegionsClustersDiagnoseCall{s: r.s, urlParams_: make(gensupport.URLParams)} 8931 c.projectId = projectId 8932 c.region = region 8933 c.clusterName = clusterName 8934 c.diagnoseclusterrequest = diagnoseclusterrequest 8935 return c 8936 } 8937 8938 // Fields allows partial responses to be retrieved. See 8939 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 8940 // for more information. 8941 func (c *ProjectsRegionsClustersDiagnoseCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersDiagnoseCall { 8942 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 8943 return c 8944 } 8945 8946 // Context sets the context to be used in this call's Do method. Any 8947 // pending HTTP request will be aborted if the provided context is 8948 // canceled. 8949 func (c *ProjectsRegionsClustersDiagnoseCall) Context(ctx context.Context) *ProjectsRegionsClustersDiagnoseCall { 8950 c.ctx_ = ctx 8951 return c 8952 } 8953 8954 // Header returns an http.Header that can be modified by the caller to 8955 // add HTTP headers to the request. 8956 func (c *ProjectsRegionsClustersDiagnoseCall) Header() http.Header { 8957 if c.header_ == nil { 8958 c.header_ = make(http.Header) 8959 } 8960 return c.header_ 8961 } 8962 8963 func (c *ProjectsRegionsClustersDiagnoseCall) doRequest(alt string) (*http.Response, error) { 8964 reqHeaders := make(http.Header) 8965 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 8966 for k, v := range c.header_ { 8967 reqHeaders[k] = v 8968 } 8969 reqHeaders.Set("User-Agent", c.s.userAgent()) 8970 var body io.Reader = nil 8971 body, err := googleapi.WithoutDataWrapper.JSONReader(c.diagnoseclusterrequest) 8972 if err != nil { 8973 return nil, err 8974 } 8975 reqHeaders.Set("Content-Type", "application/json") 8976 c.urlParams_.Set("alt", alt) 8977 c.urlParams_.Set("prettyPrint", "false") 8978 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose") 8979 urls += "?" + c.urlParams_.Encode() 8980 req, err := http.NewRequest("POST", urls, body) 8981 if err != nil { 8982 return nil, err 8983 } 8984 req.Header = reqHeaders 8985 googleapi.Expand(req.URL, map[string]string{ 8986 "projectId": c.projectId, 8987 "region": c.region, 8988 "clusterName": c.clusterName, 8989 }) 8990 return gensupport.SendRequest(c.ctx_, c.s.client, req) 8991 } 8992 8993 // Do executes the "dataproc.projects.regions.clusters.diagnose" call. 8994 // Exactly one of *Operation or error will be non-nil. Any non-2xx 8995 // status code is an error. Response headers are in either 8996 // *Operation.ServerResponse.Header or (if a response was returned at 8997 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 8998 // to check whether the returned error was because 8999 // http.StatusNotModified was returned. 9000 func (c *ProjectsRegionsClustersDiagnoseCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9001 gensupport.SetOptions(c.urlParams_, opts...) 9002 res, err := c.doRequest("json") 9003 if res != nil && res.StatusCode == http.StatusNotModified { 9004 if res.Body != nil { 9005 res.Body.Close() 9006 } 9007 return nil, &googleapi.Error{ 9008 Code: res.StatusCode, 9009 Header: res.Header, 9010 } 9011 } 9012 if err != nil { 9013 return nil, err 9014 } 9015 defer googleapi.CloseBody(res) 9016 if err := googleapi.CheckResponse(res); err != nil { 9017 return nil, err 9018 } 9019 ret := &Operation{ 9020 ServerResponse: googleapi.ServerResponse{ 9021 Header: res.Header, 9022 HTTPStatusCode: res.StatusCode, 9023 }, 9024 } 9025 target := &ret 9026 if err := gensupport.DecodeResponse(target, res); err != nil { 9027 return nil, err 9028 } 9029 return ret, nil 9030 // { 9031 // "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.", 9032 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", 9033 // "httpMethod": "POST", 9034 // "id": "dataproc.projects.regions.clusters.diagnose", 9035 // "parameterOrder": [ 9036 // "projectId", 9037 // "region", 9038 // "clusterName" 9039 // ], 9040 // "parameters": { 9041 // "clusterName": { 9042 // "description": "Required. The cluster name.", 9043 // "location": "path", 9044 // "required": true, 9045 // "type": "string" 9046 // }, 9047 // "projectId": { 9048 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 9049 // "location": "path", 9050 // "required": true, 9051 // "type": "string" 9052 // }, 9053 // "region": { 9054 // "description": "Required. The Dataproc region in which to handle the request.", 9055 // "location": "path", 9056 // "required": true, 9057 // "type": "string" 9058 // } 9059 // }, 9060 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose", 9061 // "request": { 9062 // "$ref": "DiagnoseClusterRequest" 9063 // }, 9064 // "response": { 9065 // "$ref": "Operation" 9066 // }, 9067 // "scopes": [ 9068 // "https://www.googleapis.com/auth/cloud-platform" 9069 // ] 9070 // } 9071 9072 } 9073 9074 // method id "dataproc.projects.regions.clusters.get": 9075 9076 type ProjectsRegionsClustersGetCall struct { 9077 s *Service 9078 projectId string 9079 region string 9080 clusterName string 9081 urlParams_ gensupport.URLParams 9082 ifNoneMatch_ string 9083 ctx_ context.Context 9084 header_ http.Header 9085 } 9086 9087 // Get: Gets the resource representation for a cluster in a project. 9088 // 9089 // - clusterName: The cluster name. 9090 // - projectId: The ID of the Google Cloud Platform project that the 9091 // cluster belongs to. 9092 // - region: The Dataproc region in which to handle the request. 9093 func (r *ProjectsRegionsClustersService) Get(projectId string, region string, clusterName string) *ProjectsRegionsClustersGetCall { 9094 c := &ProjectsRegionsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9095 c.projectId = projectId 9096 c.region = region 9097 c.clusterName = clusterName 9098 return c 9099 } 9100 9101 // Fields allows partial responses to be retrieved. See 9102 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9103 // for more information. 9104 func (c *ProjectsRegionsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersGetCall { 9105 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9106 return c 9107 } 9108 9109 // IfNoneMatch sets the optional parameter which makes the operation 9110 // fail if the object's ETag matches the given value. This is useful for 9111 // getting updates only after the object has changed since the last 9112 // request. Use googleapi.IsNotModified to check whether the response 9113 // error from Do is the result of In-None-Match. 9114 func (c *ProjectsRegionsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersGetCall { 9115 c.ifNoneMatch_ = entityTag 9116 return c 9117 } 9118 9119 // Context sets the context to be used in this call's Do method. Any 9120 // pending HTTP request will be aborted if the provided context is 9121 // canceled. 9122 func (c *ProjectsRegionsClustersGetCall) Context(ctx context.Context) *ProjectsRegionsClustersGetCall { 9123 c.ctx_ = ctx 9124 return c 9125 } 9126 9127 // Header returns an http.Header that can be modified by the caller to 9128 // add HTTP headers to the request. 9129 func (c *ProjectsRegionsClustersGetCall) Header() http.Header { 9130 if c.header_ == nil { 9131 c.header_ = make(http.Header) 9132 } 9133 return c.header_ 9134 } 9135 9136 func (c *ProjectsRegionsClustersGetCall) doRequest(alt string) (*http.Response, error) { 9137 reqHeaders := make(http.Header) 9138 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 9139 for k, v := range c.header_ { 9140 reqHeaders[k] = v 9141 } 9142 reqHeaders.Set("User-Agent", c.s.userAgent()) 9143 if c.ifNoneMatch_ != "" { 9144 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9145 } 9146 var body io.Reader = nil 9147 c.urlParams_.Set("alt", alt) 9148 c.urlParams_.Set("prettyPrint", "false") 9149 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}") 9150 urls += "?" + c.urlParams_.Encode() 9151 req, err := http.NewRequest("GET", urls, body) 9152 if err != nil { 9153 return nil, err 9154 } 9155 req.Header = reqHeaders 9156 googleapi.Expand(req.URL, map[string]string{ 9157 "projectId": c.projectId, 9158 "region": c.region, 9159 "clusterName": c.clusterName, 9160 }) 9161 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9162 } 9163 9164 // Do executes the "dataproc.projects.regions.clusters.get" call. 9165 // Exactly one of *Cluster or error will be non-nil. Any non-2xx status 9166 // code is an error. Response headers are in either 9167 // *Cluster.ServerResponse.Header or (if a response was returned at all) 9168 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9169 // check whether the returned error was because http.StatusNotModified 9170 // was returned. 9171 func (c *ProjectsRegionsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) { 9172 gensupport.SetOptions(c.urlParams_, opts...) 9173 res, err := c.doRequest("json") 9174 if res != nil && res.StatusCode == http.StatusNotModified { 9175 if res.Body != nil { 9176 res.Body.Close() 9177 } 9178 return nil, &googleapi.Error{ 9179 Code: res.StatusCode, 9180 Header: res.Header, 9181 } 9182 } 9183 if err != nil { 9184 return nil, err 9185 } 9186 defer googleapi.CloseBody(res) 9187 if err := googleapi.CheckResponse(res); err != nil { 9188 return nil, err 9189 } 9190 ret := &Cluster{ 9191 ServerResponse: googleapi.ServerResponse{ 9192 Header: res.Header, 9193 HTTPStatusCode: res.StatusCode, 9194 }, 9195 } 9196 target := &ret 9197 if err := gensupport.DecodeResponse(target, res); err != nil { 9198 return nil, err 9199 } 9200 return ret, nil 9201 // { 9202 // "description": "Gets the resource representation for a cluster in a project.", 9203 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", 9204 // "httpMethod": "GET", 9205 // "id": "dataproc.projects.regions.clusters.get", 9206 // "parameterOrder": [ 9207 // "projectId", 9208 // "region", 9209 // "clusterName" 9210 // ], 9211 // "parameters": { 9212 // "clusterName": { 9213 // "description": "Required. The cluster name.", 9214 // "location": "path", 9215 // "required": true, 9216 // "type": "string" 9217 // }, 9218 // "projectId": { 9219 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 9220 // "location": "path", 9221 // "required": true, 9222 // "type": "string" 9223 // }, 9224 // "region": { 9225 // "description": "Required. The Dataproc region in which to handle the request.", 9226 // "location": "path", 9227 // "required": true, 9228 // "type": "string" 9229 // } 9230 // }, 9231 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", 9232 // "response": { 9233 // "$ref": "Cluster" 9234 // }, 9235 // "scopes": [ 9236 // "https://www.googleapis.com/auth/cloud-platform" 9237 // ] 9238 // } 9239 9240 } 9241 9242 // method id "dataproc.projects.regions.clusters.getIamPolicy": 9243 9244 type ProjectsRegionsClustersGetIamPolicyCall struct { 9245 s *Service 9246 resource string 9247 urlParams_ gensupport.URLParams 9248 ifNoneMatch_ string 9249 ctx_ context.Context 9250 header_ http.Header 9251 } 9252 9253 // GetIamPolicy: Gets the access control policy for a resource. Returns 9254 // an empty policy if the resource exists and does not have a policy 9255 // set. 9256 // 9257 // - resource: REQUIRED: The resource for which the policy is being 9258 // requested. See the operation documentation for the appropriate 9259 // value for this field. 9260 func (r *ProjectsRegionsClustersService) GetIamPolicy(resource string) *ProjectsRegionsClustersGetIamPolicyCall { 9261 c := &ProjectsRegionsClustersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9262 c.resource = resource 9263 return c 9264 } 9265 9266 // OptionsRequestedPolicyVersion sets the optional parameter 9267 // "options.requestedPolicyVersion": The policy format version to be 9268 // returned.Valid values are 0, 1, and 3. Requests specifying an invalid 9269 // value will be rejected.Requests for policies with any conditional 9270 // bindings must specify version 3. Policies without any conditional 9271 // bindings may specify any valid value or leave the field unset.To 9272 // learn which resources support conditions in their IAM policies, see 9273 // the IAM documentation 9274 // (https://cloud.google.com/iam/help/conditions/resource-policies). 9275 func (c *ProjectsRegionsClustersGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsRegionsClustersGetIamPolicyCall { 9276 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 9277 return c 9278 } 9279 9280 // Fields allows partial responses to be retrieved. See 9281 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9282 // for more information. 9283 func (c *ProjectsRegionsClustersGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersGetIamPolicyCall { 9284 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9285 return c 9286 } 9287 9288 // IfNoneMatch sets the optional parameter which makes the operation 9289 // fail if the object's ETag matches the given value. This is useful for 9290 // getting updates only after the object has changed since the last 9291 // request. Use googleapi.IsNotModified to check whether the response 9292 // error from Do is the result of In-None-Match. 9293 func (c *ProjectsRegionsClustersGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersGetIamPolicyCall { 9294 c.ifNoneMatch_ = entityTag 9295 return c 9296 } 9297 9298 // Context sets the context to be used in this call's Do method. Any 9299 // pending HTTP request will be aborted if the provided context is 9300 // canceled. 9301 func (c *ProjectsRegionsClustersGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsClustersGetIamPolicyCall { 9302 c.ctx_ = ctx 9303 return c 9304 } 9305 9306 // Header returns an http.Header that can be modified by the caller to 9307 // add HTTP headers to the request. 9308 func (c *ProjectsRegionsClustersGetIamPolicyCall) Header() http.Header { 9309 if c.header_ == nil { 9310 c.header_ = make(http.Header) 9311 } 9312 return c.header_ 9313 } 9314 9315 func (c *ProjectsRegionsClustersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 9316 reqHeaders := make(http.Header) 9317 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 9318 for k, v := range c.header_ { 9319 reqHeaders[k] = v 9320 } 9321 reqHeaders.Set("User-Agent", c.s.userAgent()) 9322 if c.ifNoneMatch_ != "" { 9323 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9324 } 9325 var body io.Reader = nil 9326 c.urlParams_.Set("alt", alt) 9327 c.urlParams_.Set("prettyPrint", "false") 9328 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 9329 urls += "?" + c.urlParams_.Encode() 9330 req, err := http.NewRequest("GET", urls, body) 9331 if err != nil { 9332 return nil, err 9333 } 9334 req.Header = reqHeaders 9335 googleapi.Expand(req.URL, map[string]string{ 9336 "resource": c.resource, 9337 }) 9338 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9339 } 9340 9341 // Do executes the "dataproc.projects.regions.clusters.getIamPolicy" call. 9342 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 9343 // code is an error. Response headers are in either 9344 // *Policy.ServerResponse.Header or (if a response was returned at all) 9345 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 9346 // check whether the returned error was because http.StatusNotModified 9347 // was returned. 9348 func (c *ProjectsRegionsClustersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 9349 gensupport.SetOptions(c.urlParams_, opts...) 9350 res, err := c.doRequest("json") 9351 if res != nil && res.StatusCode == http.StatusNotModified { 9352 if res.Body != nil { 9353 res.Body.Close() 9354 } 9355 return nil, &googleapi.Error{ 9356 Code: res.StatusCode, 9357 Header: res.Header, 9358 } 9359 } 9360 if err != nil { 9361 return nil, err 9362 } 9363 defer googleapi.CloseBody(res) 9364 if err := googleapi.CheckResponse(res); err != nil { 9365 return nil, err 9366 } 9367 ret := &Policy{ 9368 ServerResponse: googleapi.ServerResponse{ 9369 Header: res.Header, 9370 HTTPStatusCode: res.StatusCode, 9371 }, 9372 } 9373 target := &ret 9374 if err := gensupport.DecodeResponse(target, res); err != nil { 9375 return nil, err 9376 } 9377 return ret, nil 9378 // { 9379 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 9380 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:getIamPolicy", 9381 // "httpMethod": "GET", 9382 // "id": "dataproc.projects.regions.clusters.getIamPolicy", 9383 // "parameterOrder": [ 9384 // "resource" 9385 // ], 9386 // "parameters": { 9387 // "options.requestedPolicyVersion": { 9388 // "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).", 9389 // "format": "int32", 9390 // "location": "query", 9391 // "type": "integer" 9392 // }, 9393 // "resource": { 9394 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 9395 // "location": "path", 9396 // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$", 9397 // "required": true, 9398 // "type": "string" 9399 // } 9400 // }, 9401 // "path": "v1beta2/{+resource}:getIamPolicy", 9402 // "response": { 9403 // "$ref": "Policy" 9404 // }, 9405 // "scopes": [ 9406 // "https://www.googleapis.com/auth/cloud-platform" 9407 // ] 9408 // } 9409 9410 } 9411 9412 // method id "dataproc.projects.regions.clusters.injectCredentials": 9413 9414 type ProjectsRegionsClustersInjectCredentialsCall struct { 9415 s *Service 9416 project string 9417 region string 9418 cluster string 9419 injectcredentialsrequest *InjectCredentialsRequest 9420 urlParams_ gensupport.URLParams 9421 ctx_ context.Context 9422 header_ http.Header 9423 } 9424 9425 // InjectCredentials: Inject encrypted credentials into all of the VMs 9426 // in a cluster.The target cluster must be a personal auth cluster 9427 // assigned to the user who is issuing the RPC. 9428 // 9429 // - cluster: The cluster, in the form clusters/. 9430 // - project: The ID of the Google Cloud Platform project the cluster 9431 // belongs to, of the form projects/. 9432 // - region: The region containing the cluster, of the form regions/. 9433 func (r *ProjectsRegionsClustersService) InjectCredentials(project string, region string, cluster string, injectcredentialsrequest *InjectCredentialsRequest) *ProjectsRegionsClustersInjectCredentialsCall { 9434 c := &ProjectsRegionsClustersInjectCredentialsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9435 c.project = project 9436 c.region = region 9437 c.cluster = cluster 9438 c.injectcredentialsrequest = injectcredentialsrequest 9439 return c 9440 } 9441 9442 // Fields allows partial responses to be retrieved. See 9443 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9444 // for more information. 9445 func (c *ProjectsRegionsClustersInjectCredentialsCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersInjectCredentialsCall { 9446 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9447 return c 9448 } 9449 9450 // Context sets the context to be used in this call's Do method. Any 9451 // pending HTTP request will be aborted if the provided context is 9452 // canceled. 9453 func (c *ProjectsRegionsClustersInjectCredentialsCall) Context(ctx context.Context) *ProjectsRegionsClustersInjectCredentialsCall { 9454 c.ctx_ = ctx 9455 return c 9456 } 9457 9458 // Header returns an http.Header that can be modified by the caller to 9459 // add HTTP headers to the request. 9460 func (c *ProjectsRegionsClustersInjectCredentialsCall) Header() http.Header { 9461 if c.header_ == nil { 9462 c.header_ = make(http.Header) 9463 } 9464 return c.header_ 9465 } 9466 9467 func (c *ProjectsRegionsClustersInjectCredentialsCall) doRequest(alt string) (*http.Response, error) { 9468 reqHeaders := make(http.Header) 9469 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 9470 for k, v := range c.header_ { 9471 reqHeaders[k] = v 9472 } 9473 reqHeaders.Set("User-Agent", c.s.userAgent()) 9474 var body io.Reader = nil 9475 body, err := googleapi.WithoutDataWrapper.JSONReader(c.injectcredentialsrequest) 9476 if err != nil { 9477 return nil, err 9478 } 9479 reqHeaders.Set("Content-Type", "application/json") 9480 c.urlParams_.Set("alt", alt) 9481 c.urlParams_.Set("prettyPrint", "false") 9482 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+project}/{+region}/{+cluster}:injectCredentials") 9483 urls += "?" + c.urlParams_.Encode() 9484 req, err := http.NewRequest("POST", urls, body) 9485 if err != nil { 9486 return nil, err 9487 } 9488 req.Header = reqHeaders 9489 googleapi.Expand(req.URL, map[string]string{ 9490 "project": c.project, 9491 "region": c.region, 9492 "cluster": c.cluster, 9493 }) 9494 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9495 } 9496 9497 // Do executes the "dataproc.projects.regions.clusters.injectCredentials" call. 9498 // Exactly one of *Operation or error will be non-nil. Any non-2xx 9499 // status code is an error. Response headers are in either 9500 // *Operation.ServerResponse.Header or (if a response was returned at 9501 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9502 // to check whether the returned error was because 9503 // http.StatusNotModified was returned. 9504 func (c *ProjectsRegionsClustersInjectCredentialsCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9505 gensupport.SetOptions(c.urlParams_, opts...) 9506 res, err := c.doRequest("json") 9507 if res != nil && res.StatusCode == http.StatusNotModified { 9508 if res.Body != nil { 9509 res.Body.Close() 9510 } 9511 return nil, &googleapi.Error{ 9512 Code: res.StatusCode, 9513 Header: res.Header, 9514 } 9515 } 9516 if err != nil { 9517 return nil, err 9518 } 9519 defer googleapi.CloseBody(res) 9520 if err := googleapi.CheckResponse(res); err != nil { 9521 return nil, err 9522 } 9523 ret := &Operation{ 9524 ServerResponse: googleapi.ServerResponse{ 9525 Header: res.Header, 9526 HTTPStatusCode: res.StatusCode, 9527 }, 9528 } 9529 target := &ret 9530 if err := gensupport.DecodeResponse(target, res); err != nil { 9531 return nil, err 9532 } 9533 return ret, nil 9534 // { 9535 // "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.", 9536 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:injectCredentials", 9537 // "httpMethod": "POST", 9538 // "id": "dataproc.projects.regions.clusters.injectCredentials", 9539 // "parameterOrder": [ 9540 // "project", 9541 // "region", 9542 // "cluster" 9543 // ], 9544 // "parameters": { 9545 // "cluster": { 9546 // "description": "Required. The cluster, in the form clusters/.", 9547 // "location": "path", 9548 // "pattern": "^clusters/[^/]+$", 9549 // "required": true, 9550 // "type": "string" 9551 // }, 9552 // "project": { 9553 // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to, of the form projects/.", 9554 // "location": "path", 9555 // "pattern": "^projects/[^/]+$", 9556 // "required": true, 9557 // "type": "string" 9558 // }, 9559 // "region": { 9560 // "description": "Required. The region containing the cluster, of the form regions/.", 9561 // "location": "path", 9562 // "pattern": "^regions/[^/]+$", 9563 // "required": true, 9564 // "type": "string" 9565 // } 9566 // }, 9567 // "path": "v1beta2/{+project}/{+region}/{+cluster}:injectCredentials", 9568 // "request": { 9569 // "$ref": "InjectCredentialsRequest" 9570 // }, 9571 // "response": { 9572 // "$ref": "Operation" 9573 // }, 9574 // "scopes": [ 9575 // "https://www.googleapis.com/auth/cloud-platform" 9576 // ] 9577 // } 9578 9579 } 9580 9581 // method id "dataproc.projects.regions.clusters.list": 9582 9583 type ProjectsRegionsClustersListCall struct { 9584 s *Service 9585 projectId string 9586 region string 9587 urlParams_ gensupport.URLParams 9588 ifNoneMatch_ string 9589 ctx_ context.Context 9590 header_ http.Header 9591 } 9592 9593 // List: Lists all regions/{region}/clusters in a project 9594 // alphabetically. 9595 // 9596 // - projectId: The ID of the Google Cloud Platform project that the 9597 // cluster belongs to. 9598 // - region: The Dataproc region in which to handle the request. 9599 func (r *ProjectsRegionsClustersService) List(projectId string, region string) *ProjectsRegionsClustersListCall { 9600 c := &ProjectsRegionsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9601 c.projectId = projectId 9602 c.region = region 9603 return c 9604 } 9605 9606 // Filter sets the optional parameter "filter": A filter constraining 9607 // the clusters to list. Filters are case-sensitive and have the 9608 // following syntax:field = value AND field = value ...where field is 9609 // one of status.state, clusterName, or labels.[KEY], and [KEY] is a 9610 // label key. value can be * to match all values. status.state can be 9611 // one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR, 9612 // DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and 9613 // RUNNING states. INACTIVE contains the DELETING and ERROR states. 9614 // clusterName is the name of the cluster provided at creation time. 9615 // Only the logical AND operator is supported; space-separated items are 9616 // treated as having an implicit AND operator.Example 9617 // filter:status.state = ACTIVE AND clusterName = mycluster AND 9618 // labels.env = staging AND labels.starred = * 9619 func (c *ProjectsRegionsClustersListCall) Filter(filter string) *ProjectsRegionsClustersListCall { 9620 c.urlParams_.Set("filter", filter) 9621 return c 9622 } 9623 9624 // PageSize sets the optional parameter "pageSize": The standard List 9625 // page size. 9626 func (c *ProjectsRegionsClustersListCall) PageSize(pageSize int64) *ProjectsRegionsClustersListCall { 9627 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 9628 return c 9629 } 9630 9631 // PageToken sets the optional parameter "pageToken": The standard List 9632 // page token. 9633 func (c *ProjectsRegionsClustersListCall) PageToken(pageToken string) *ProjectsRegionsClustersListCall { 9634 c.urlParams_.Set("pageToken", pageToken) 9635 return c 9636 } 9637 9638 // Fields allows partial responses to be retrieved. See 9639 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9640 // for more information. 9641 func (c *ProjectsRegionsClustersListCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersListCall { 9642 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9643 return c 9644 } 9645 9646 // IfNoneMatch sets the optional parameter which makes the operation 9647 // fail if the object's ETag matches the given value. This is useful for 9648 // getting updates only after the object has changed since the last 9649 // request. Use googleapi.IsNotModified to check whether the response 9650 // error from Do is the result of In-None-Match. 9651 func (c *ProjectsRegionsClustersListCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersListCall { 9652 c.ifNoneMatch_ = entityTag 9653 return c 9654 } 9655 9656 // Context sets the context to be used in this call's Do method. Any 9657 // pending HTTP request will be aborted if the provided context is 9658 // canceled. 9659 func (c *ProjectsRegionsClustersListCall) Context(ctx context.Context) *ProjectsRegionsClustersListCall { 9660 c.ctx_ = ctx 9661 return c 9662 } 9663 9664 // Header returns an http.Header that can be modified by the caller to 9665 // add HTTP headers to the request. 9666 func (c *ProjectsRegionsClustersListCall) Header() http.Header { 9667 if c.header_ == nil { 9668 c.header_ = make(http.Header) 9669 } 9670 return c.header_ 9671 } 9672 9673 func (c *ProjectsRegionsClustersListCall) doRequest(alt string) (*http.Response, error) { 9674 reqHeaders := make(http.Header) 9675 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 9676 for k, v := range c.header_ { 9677 reqHeaders[k] = v 9678 } 9679 reqHeaders.Set("User-Agent", c.s.userAgent()) 9680 if c.ifNoneMatch_ != "" { 9681 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 9682 } 9683 var body io.Reader = nil 9684 c.urlParams_.Set("alt", alt) 9685 c.urlParams_.Set("prettyPrint", "false") 9686 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters") 9687 urls += "?" + c.urlParams_.Encode() 9688 req, err := http.NewRequest("GET", urls, body) 9689 if err != nil { 9690 return nil, err 9691 } 9692 req.Header = reqHeaders 9693 googleapi.Expand(req.URL, map[string]string{ 9694 "projectId": c.projectId, 9695 "region": c.region, 9696 }) 9697 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9698 } 9699 9700 // Do executes the "dataproc.projects.regions.clusters.list" call. 9701 // Exactly one of *ListClustersResponse or error will be non-nil. Any 9702 // non-2xx status code is an error. Response headers are in either 9703 // *ListClustersResponse.ServerResponse.Header or (if a response was 9704 // returned at all) in error.(*googleapi.Error).Header. Use 9705 // googleapi.IsNotModified to check whether the returned error was 9706 // because http.StatusNotModified was returned. 9707 func (c *ProjectsRegionsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) { 9708 gensupport.SetOptions(c.urlParams_, opts...) 9709 res, err := c.doRequest("json") 9710 if res != nil && res.StatusCode == http.StatusNotModified { 9711 if res.Body != nil { 9712 res.Body.Close() 9713 } 9714 return nil, &googleapi.Error{ 9715 Code: res.StatusCode, 9716 Header: res.Header, 9717 } 9718 } 9719 if err != nil { 9720 return nil, err 9721 } 9722 defer googleapi.CloseBody(res) 9723 if err := googleapi.CheckResponse(res); err != nil { 9724 return nil, err 9725 } 9726 ret := &ListClustersResponse{ 9727 ServerResponse: googleapi.ServerResponse{ 9728 Header: res.Header, 9729 HTTPStatusCode: res.StatusCode, 9730 }, 9731 } 9732 target := &ret 9733 if err := gensupport.DecodeResponse(target, res); err != nil { 9734 return nil, err 9735 } 9736 return ret, nil 9737 // { 9738 // "description": "Lists all regions/{region}/clusters in a project alphabetically.", 9739 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters", 9740 // "httpMethod": "GET", 9741 // "id": "dataproc.projects.regions.clusters.list", 9742 // "parameterOrder": [ 9743 // "projectId", 9744 // "region" 9745 // ], 9746 // "parameters": { 9747 // "filter": { 9748 // "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 = *", 9749 // "location": "query", 9750 // "type": "string" 9751 // }, 9752 // "pageSize": { 9753 // "description": "Optional. The standard List page size.", 9754 // "format": "int32", 9755 // "location": "query", 9756 // "type": "integer" 9757 // }, 9758 // "pageToken": { 9759 // "description": "Optional. The standard List page token.", 9760 // "location": "query", 9761 // "type": "string" 9762 // }, 9763 // "projectId": { 9764 // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.", 9765 // "location": "path", 9766 // "required": true, 9767 // "type": "string" 9768 // }, 9769 // "region": { 9770 // "description": "Required. The Dataproc region in which to handle the request.", 9771 // "location": "path", 9772 // "required": true, 9773 // "type": "string" 9774 // } 9775 // }, 9776 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters", 9777 // "response": { 9778 // "$ref": "ListClustersResponse" 9779 // }, 9780 // "scopes": [ 9781 // "https://www.googleapis.com/auth/cloud-platform" 9782 // ] 9783 // } 9784 9785 } 9786 9787 // Pages invokes f for each page of results. 9788 // A non-nil error returned from f will halt the iteration. 9789 // The provided context supersedes any context provided to the Context method. 9790 func (c *ProjectsRegionsClustersListCall) Pages(ctx context.Context, f func(*ListClustersResponse) error) error { 9791 c.ctx_ = ctx 9792 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 9793 for { 9794 x, err := c.Do() 9795 if err != nil { 9796 return err 9797 } 9798 if err := f(x); err != nil { 9799 return err 9800 } 9801 if x.NextPageToken == "" { 9802 return nil 9803 } 9804 c.PageToken(x.NextPageToken) 9805 } 9806 } 9807 9808 // method id "dataproc.projects.regions.clusters.patch": 9809 9810 type ProjectsRegionsClustersPatchCall struct { 9811 s *Service 9812 projectId string 9813 region string 9814 clusterName string 9815 cluster *Cluster 9816 urlParams_ gensupport.URLParams 9817 ctx_ context.Context 9818 header_ http.Header 9819 } 9820 9821 // Patch: Updates a cluster in a project. The returned 9822 // Operation.metadata will be ClusterOperationMetadata 9823 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#clusteroperationmetadata). 9824 // The cluster must be in a RUNNING state or an error is returned. 9825 // 9826 // - clusterName: The cluster name. 9827 // - projectId: The ID of the Google Cloud Platform project the cluster 9828 // belongs to. 9829 // - region: The Dataproc region in which to handle the request. 9830 func (r *ProjectsRegionsClustersService) Patch(projectId string, region string, clusterName string, cluster *Cluster) *ProjectsRegionsClustersPatchCall { 9831 c := &ProjectsRegionsClustersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 9832 c.projectId = projectId 9833 c.region = region 9834 c.clusterName = clusterName 9835 c.cluster = cluster 9836 return c 9837 } 9838 9839 // GracefulDecommissionTimeout sets the optional parameter 9840 // "gracefulDecommissionTimeout": Timeout for graceful YARN 9841 // decomissioning. Graceful decommissioning allows removing nodes from 9842 // the cluster without interrupting jobs in progress. Timeout specifies 9843 // how long to wait for jobs in progress to finish before forcefully 9844 // removing nodes (and potentially interrupting jobs). Default timeout 9845 // is 0 (for forceful decommission), and the maximum allowed timeout is 9846 // 1 day (see JSON representation of Duration 9847 // (https://developers.google.com/protocol-buffers/docs/proto3#json)).Only 9848 // supported on Dataproc image versions 1.2 and higher. 9849 func (c *ProjectsRegionsClustersPatchCall) GracefulDecommissionTimeout(gracefulDecommissionTimeout string) *ProjectsRegionsClustersPatchCall { 9850 c.urlParams_.Set("gracefulDecommissionTimeout", gracefulDecommissionTimeout) 9851 return c 9852 } 9853 9854 // RequestId sets the optional parameter "requestId": A unique id used 9855 // to identify the request. If the server receives two 9856 // UpdateClusterRequest 9857 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#google.cloud.dataproc.v1beta2.UpdateClusterRequest)s 9858 // with the same id, then the second request will be ignored and the 9859 // first google.longrunning.Operation created and stored in the backend 9860 // is returned.It is recommended to always set this value to a UUID 9861 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id 9862 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 9863 // and hyphens (-). The maximum length is 40 characters. 9864 func (c *ProjectsRegionsClustersPatchCall) RequestId(requestId string) *ProjectsRegionsClustersPatchCall { 9865 c.urlParams_.Set("requestId", requestId) 9866 return c 9867 } 9868 9869 // UpdateMask sets the optional parameter "updateMask": Required. 9870 // Specifies the path, relative to Cluster, of the field to update. For 9871 // example, to change the number of workers in a cluster to 5, the 9872 // update_mask parameter would be specified as 9873 // config.worker_config.num_instances, and the PATCH request body would 9874 // specify the new value, as follows: { "config":{ "workerConfig":{ 9875 // "numInstances":"5" } } } Similarly, to change the number of 9876 // preemptible workers in a cluster to 5, the update_mask parameter 9877 // would be config.secondary_worker_config.num_instances, and the PATCH 9878 // request body would be set as follows: { "config":{ 9879 // "secondaryWorkerConfig":{ "numInstances":"5" } } } *Note:* currently 9880 // only the following fields can be updated: *Mask* *Purpose* labels 9881 // Updates labels config.worker_config.num_instances Resize primary 9882 // worker group config.secondary_worker_config.num_instances Resize 9883 // secondary worker group config.lifecycle_config.auto_delete_ttl Reset 9884 // MAX TTL duration config.lifecycle_config.auto_delete_time Update MAX 9885 // TTL deletion timestamp config.lifecycle_config.idle_delete_ttl Update 9886 // Idle TTL duration config.autoscaling_config.policy_uri Use, stop 9887 // using, or change autoscaling policies 9888 func (c *ProjectsRegionsClustersPatchCall) UpdateMask(updateMask string) *ProjectsRegionsClustersPatchCall { 9889 c.urlParams_.Set("updateMask", updateMask) 9890 return c 9891 } 9892 9893 // Fields allows partial responses to be retrieved. See 9894 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 9895 // for more information. 9896 func (c *ProjectsRegionsClustersPatchCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersPatchCall { 9897 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 9898 return c 9899 } 9900 9901 // Context sets the context to be used in this call's Do method. Any 9902 // pending HTTP request will be aborted if the provided context is 9903 // canceled. 9904 func (c *ProjectsRegionsClustersPatchCall) Context(ctx context.Context) *ProjectsRegionsClustersPatchCall { 9905 c.ctx_ = ctx 9906 return c 9907 } 9908 9909 // Header returns an http.Header that can be modified by the caller to 9910 // add HTTP headers to the request. 9911 func (c *ProjectsRegionsClustersPatchCall) Header() http.Header { 9912 if c.header_ == nil { 9913 c.header_ = make(http.Header) 9914 } 9915 return c.header_ 9916 } 9917 9918 func (c *ProjectsRegionsClustersPatchCall) doRequest(alt string) (*http.Response, error) { 9919 reqHeaders := make(http.Header) 9920 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 9921 for k, v := range c.header_ { 9922 reqHeaders[k] = v 9923 } 9924 reqHeaders.Set("User-Agent", c.s.userAgent()) 9925 var body io.Reader = nil 9926 body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster) 9927 if err != nil { 9928 return nil, err 9929 } 9930 reqHeaders.Set("Content-Type", "application/json") 9931 c.urlParams_.Set("alt", alt) 9932 c.urlParams_.Set("prettyPrint", "false") 9933 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}") 9934 urls += "?" + c.urlParams_.Encode() 9935 req, err := http.NewRequest("PATCH", urls, body) 9936 if err != nil { 9937 return nil, err 9938 } 9939 req.Header = reqHeaders 9940 googleapi.Expand(req.URL, map[string]string{ 9941 "projectId": c.projectId, 9942 "region": c.region, 9943 "clusterName": c.clusterName, 9944 }) 9945 return gensupport.SendRequest(c.ctx_, c.s.client, req) 9946 } 9947 9948 // Do executes the "dataproc.projects.regions.clusters.patch" call. 9949 // Exactly one of *Operation or error will be non-nil. Any non-2xx 9950 // status code is an error. Response headers are in either 9951 // *Operation.ServerResponse.Header or (if a response was returned at 9952 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 9953 // to check whether the returned error was because 9954 // http.StatusNotModified was returned. 9955 func (c *ProjectsRegionsClustersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 9956 gensupport.SetOptions(c.urlParams_, opts...) 9957 res, err := c.doRequest("json") 9958 if res != nil && res.StatusCode == http.StatusNotModified { 9959 if res.Body != nil { 9960 res.Body.Close() 9961 } 9962 return nil, &googleapi.Error{ 9963 Code: res.StatusCode, 9964 Header: res.Header, 9965 } 9966 } 9967 if err != nil { 9968 return nil, err 9969 } 9970 defer googleapi.CloseBody(res) 9971 if err := googleapi.CheckResponse(res); err != nil { 9972 return nil, err 9973 } 9974 ret := &Operation{ 9975 ServerResponse: googleapi.ServerResponse{ 9976 Header: res.Header, 9977 HTTPStatusCode: res.StatusCode, 9978 }, 9979 } 9980 target := &ret 9981 if err := gensupport.DecodeResponse(target, res); err != nil { 9982 return nil, err 9983 } 9984 return ret, nil 9985 // { 9986 // "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). The cluster must be in a RUNNING state or an error is returned.", 9987 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", 9988 // "httpMethod": "PATCH", 9989 // "id": "dataproc.projects.regions.clusters.patch", 9990 // "parameterOrder": [ 9991 // "projectId", 9992 // "region", 9993 // "clusterName" 9994 // ], 9995 // "parameters": { 9996 // "clusterName": { 9997 // "description": "Required. The cluster name.", 9998 // "location": "path", 9999 // "required": true, 10000 // "type": "string" 10001 // }, 10002 // "gracefulDecommissionTimeout": { 10003 // "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.", 10004 // "format": "google-duration", 10005 // "location": "query", 10006 // "type": "string" 10007 // }, 10008 // "projectId": { 10009 // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", 10010 // "location": "path", 10011 // "required": true, 10012 // "type": "string" 10013 // }, 10014 // "region": { 10015 // "description": "Required. The Dataproc region in which to handle the request.", 10016 // "location": "path", 10017 // "required": true, 10018 // "type": "string" 10019 // }, 10020 // "requestId": { 10021 // "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.", 10022 // "location": "query", 10023 // "type": "string" 10024 // }, 10025 // "updateMask": { 10026 // "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 ", 10027 // "format": "google-fieldmask", 10028 // "location": "query", 10029 // "type": "string" 10030 // } 10031 // }, 10032 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}", 10033 // "request": { 10034 // "$ref": "Cluster" 10035 // }, 10036 // "response": { 10037 // "$ref": "Operation" 10038 // }, 10039 // "scopes": [ 10040 // "https://www.googleapis.com/auth/cloud-platform" 10041 // ] 10042 // } 10043 10044 } 10045 10046 // method id "dataproc.projects.regions.clusters.setIamPolicy": 10047 10048 type ProjectsRegionsClustersSetIamPolicyCall struct { 10049 s *Service 10050 resource string 10051 setiampolicyrequest *SetIamPolicyRequest 10052 urlParams_ gensupport.URLParams 10053 ctx_ context.Context 10054 header_ http.Header 10055 } 10056 10057 // SetIamPolicy: Sets the access control policy on the specified 10058 // resource. Replaces any existing policy.Can return NOT_FOUND, 10059 // INVALID_ARGUMENT, and PERMISSION_DENIED errors. 10060 // 10061 // - resource: REQUIRED: The resource for which the policy is being 10062 // specified. See the operation documentation for the appropriate 10063 // value for this field. 10064 func (r *ProjectsRegionsClustersService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsClustersSetIamPolicyCall { 10065 c := &ProjectsRegionsClustersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10066 c.resource = resource 10067 c.setiampolicyrequest = setiampolicyrequest 10068 return c 10069 } 10070 10071 // Fields allows partial responses to be retrieved. See 10072 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10073 // for more information. 10074 func (c *ProjectsRegionsClustersSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersSetIamPolicyCall { 10075 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10076 return c 10077 } 10078 10079 // Context sets the context to be used in this call's Do method. Any 10080 // pending HTTP request will be aborted if the provided context is 10081 // canceled. 10082 func (c *ProjectsRegionsClustersSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsClustersSetIamPolicyCall { 10083 c.ctx_ = ctx 10084 return c 10085 } 10086 10087 // Header returns an http.Header that can be modified by the caller to 10088 // add HTTP headers to the request. 10089 func (c *ProjectsRegionsClustersSetIamPolicyCall) Header() http.Header { 10090 if c.header_ == nil { 10091 c.header_ = make(http.Header) 10092 } 10093 return c.header_ 10094 } 10095 10096 func (c *ProjectsRegionsClustersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 10097 reqHeaders := make(http.Header) 10098 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 10099 for k, v := range c.header_ { 10100 reqHeaders[k] = v 10101 } 10102 reqHeaders.Set("User-Agent", c.s.userAgent()) 10103 var body io.Reader = nil 10104 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 10105 if err != nil { 10106 return nil, err 10107 } 10108 reqHeaders.Set("Content-Type", "application/json") 10109 c.urlParams_.Set("alt", alt) 10110 c.urlParams_.Set("prettyPrint", "false") 10111 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 10112 urls += "?" + c.urlParams_.Encode() 10113 req, err := http.NewRequest("POST", urls, body) 10114 if err != nil { 10115 return nil, err 10116 } 10117 req.Header = reqHeaders 10118 googleapi.Expand(req.URL, map[string]string{ 10119 "resource": c.resource, 10120 }) 10121 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10122 } 10123 10124 // Do executes the "dataproc.projects.regions.clusters.setIamPolicy" call. 10125 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 10126 // code is an error. Response headers are in either 10127 // *Policy.ServerResponse.Header or (if a response was returned at all) 10128 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10129 // check whether the returned error was because http.StatusNotModified 10130 // was returned. 10131 func (c *ProjectsRegionsClustersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 10132 gensupport.SetOptions(c.urlParams_, opts...) 10133 res, err := c.doRequest("json") 10134 if res != nil && res.StatusCode == http.StatusNotModified { 10135 if res.Body != nil { 10136 res.Body.Close() 10137 } 10138 return nil, &googleapi.Error{ 10139 Code: res.StatusCode, 10140 Header: res.Header, 10141 } 10142 } 10143 if err != nil { 10144 return nil, err 10145 } 10146 defer googleapi.CloseBody(res) 10147 if err := googleapi.CheckResponse(res); err != nil { 10148 return nil, err 10149 } 10150 ret := &Policy{ 10151 ServerResponse: googleapi.ServerResponse{ 10152 Header: res.Header, 10153 HTTPStatusCode: res.StatusCode, 10154 }, 10155 } 10156 target := &ret 10157 if err := gensupport.DecodeResponse(target, res); err != nil { 10158 return nil, err 10159 } 10160 return ret, nil 10161 // { 10162 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 10163 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:setIamPolicy", 10164 // "httpMethod": "POST", 10165 // "id": "dataproc.projects.regions.clusters.setIamPolicy", 10166 // "parameterOrder": [ 10167 // "resource" 10168 // ], 10169 // "parameters": { 10170 // "resource": { 10171 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 10172 // "location": "path", 10173 // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$", 10174 // "required": true, 10175 // "type": "string" 10176 // } 10177 // }, 10178 // "path": "v1beta2/{+resource}:setIamPolicy", 10179 // "request": { 10180 // "$ref": "SetIamPolicyRequest" 10181 // }, 10182 // "response": { 10183 // "$ref": "Policy" 10184 // }, 10185 // "scopes": [ 10186 // "https://www.googleapis.com/auth/cloud-platform" 10187 // ] 10188 // } 10189 10190 } 10191 10192 // method id "dataproc.projects.regions.clusters.start": 10193 10194 type ProjectsRegionsClustersStartCall struct { 10195 s *Service 10196 projectId string 10197 region string 10198 clusterName string 10199 startclusterrequest *StartClusterRequest 10200 urlParams_ gensupport.URLParams 10201 ctx_ context.Context 10202 header_ http.Header 10203 } 10204 10205 // Start: Starts a cluster in a project. 10206 // 10207 // - clusterName: The cluster name. 10208 // - projectId: The ID of the Google Cloud Platform project the cluster 10209 // belongs to. 10210 // - region: The Dataproc region in which to handle the request. 10211 func (r *ProjectsRegionsClustersService) Start(projectId string, region string, clusterName string, startclusterrequest *StartClusterRequest) *ProjectsRegionsClustersStartCall { 10212 c := &ProjectsRegionsClustersStartCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10213 c.projectId = projectId 10214 c.region = region 10215 c.clusterName = clusterName 10216 c.startclusterrequest = startclusterrequest 10217 return c 10218 } 10219 10220 // Fields allows partial responses to be retrieved. See 10221 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10222 // for more information. 10223 func (c *ProjectsRegionsClustersStartCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersStartCall { 10224 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10225 return c 10226 } 10227 10228 // Context sets the context to be used in this call's Do method. Any 10229 // pending HTTP request will be aborted if the provided context is 10230 // canceled. 10231 func (c *ProjectsRegionsClustersStartCall) Context(ctx context.Context) *ProjectsRegionsClustersStartCall { 10232 c.ctx_ = ctx 10233 return c 10234 } 10235 10236 // Header returns an http.Header that can be modified by the caller to 10237 // add HTTP headers to the request. 10238 func (c *ProjectsRegionsClustersStartCall) Header() http.Header { 10239 if c.header_ == nil { 10240 c.header_ = make(http.Header) 10241 } 10242 return c.header_ 10243 } 10244 10245 func (c *ProjectsRegionsClustersStartCall) doRequest(alt string) (*http.Response, error) { 10246 reqHeaders := make(http.Header) 10247 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 10248 for k, v := range c.header_ { 10249 reqHeaders[k] = v 10250 } 10251 reqHeaders.Set("User-Agent", c.s.userAgent()) 10252 var body io.Reader = nil 10253 body, err := googleapi.WithoutDataWrapper.JSONReader(c.startclusterrequest) 10254 if err != nil { 10255 return nil, err 10256 } 10257 reqHeaders.Set("Content-Type", "application/json") 10258 c.urlParams_.Set("alt", alt) 10259 c.urlParams_.Set("prettyPrint", "false") 10260 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:start") 10261 urls += "?" + c.urlParams_.Encode() 10262 req, err := http.NewRequest("POST", urls, body) 10263 if err != nil { 10264 return nil, err 10265 } 10266 req.Header = reqHeaders 10267 googleapi.Expand(req.URL, map[string]string{ 10268 "projectId": c.projectId, 10269 "region": c.region, 10270 "clusterName": c.clusterName, 10271 }) 10272 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10273 } 10274 10275 // Do executes the "dataproc.projects.regions.clusters.start" call. 10276 // Exactly one of *Operation or error will be non-nil. Any non-2xx 10277 // status code is an error. Response headers are in either 10278 // *Operation.ServerResponse.Header or (if a response was returned at 10279 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10280 // to check whether the returned error was because 10281 // http.StatusNotModified was returned. 10282 func (c *ProjectsRegionsClustersStartCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10283 gensupport.SetOptions(c.urlParams_, opts...) 10284 res, err := c.doRequest("json") 10285 if res != nil && res.StatusCode == http.StatusNotModified { 10286 if res.Body != nil { 10287 res.Body.Close() 10288 } 10289 return nil, &googleapi.Error{ 10290 Code: res.StatusCode, 10291 Header: res.Header, 10292 } 10293 } 10294 if err != nil { 10295 return nil, err 10296 } 10297 defer googleapi.CloseBody(res) 10298 if err := googleapi.CheckResponse(res); err != nil { 10299 return nil, err 10300 } 10301 ret := &Operation{ 10302 ServerResponse: googleapi.ServerResponse{ 10303 Header: res.Header, 10304 HTTPStatusCode: res.StatusCode, 10305 }, 10306 } 10307 target := &ret 10308 if err := gensupport.DecodeResponse(target, res); err != nil { 10309 return nil, err 10310 } 10311 return ret, nil 10312 // { 10313 // "description": "Starts a cluster in a project.", 10314 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:start", 10315 // "httpMethod": "POST", 10316 // "id": "dataproc.projects.regions.clusters.start", 10317 // "parameterOrder": [ 10318 // "projectId", 10319 // "region", 10320 // "clusterName" 10321 // ], 10322 // "parameters": { 10323 // "clusterName": { 10324 // "description": "Required. The cluster name.", 10325 // "location": "path", 10326 // "required": true, 10327 // "type": "string" 10328 // }, 10329 // "projectId": { 10330 // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", 10331 // "location": "path", 10332 // "required": true, 10333 // "type": "string" 10334 // }, 10335 // "region": { 10336 // "description": "Required. The Dataproc region in which to handle the request.", 10337 // "location": "path", 10338 // "required": true, 10339 // "type": "string" 10340 // } 10341 // }, 10342 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:start", 10343 // "request": { 10344 // "$ref": "StartClusterRequest" 10345 // }, 10346 // "response": { 10347 // "$ref": "Operation" 10348 // }, 10349 // "scopes": [ 10350 // "https://www.googleapis.com/auth/cloud-platform" 10351 // ] 10352 // } 10353 10354 } 10355 10356 // method id "dataproc.projects.regions.clusters.stop": 10357 10358 type ProjectsRegionsClustersStopCall struct { 10359 s *Service 10360 projectId string 10361 region string 10362 clusterName string 10363 stopclusterrequest *StopClusterRequest 10364 urlParams_ gensupport.URLParams 10365 ctx_ context.Context 10366 header_ http.Header 10367 } 10368 10369 // Stop: Stops a cluster in a project. 10370 // 10371 // - clusterName: The cluster name. 10372 // - projectId: The ID of the Google Cloud Platform project the cluster 10373 // belongs to. 10374 // - region: The Dataproc region in which to handle the request. 10375 func (r *ProjectsRegionsClustersService) Stop(projectId string, region string, clusterName string, stopclusterrequest *StopClusterRequest) *ProjectsRegionsClustersStopCall { 10376 c := &ProjectsRegionsClustersStopCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10377 c.projectId = projectId 10378 c.region = region 10379 c.clusterName = clusterName 10380 c.stopclusterrequest = stopclusterrequest 10381 return c 10382 } 10383 10384 // Fields allows partial responses to be retrieved. See 10385 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10386 // for more information. 10387 func (c *ProjectsRegionsClustersStopCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersStopCall { 10388 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10389 return c 10390 } 10391 10392 // Context sets the context to be used in this call's Do method. Any 10393 // pending HTTP request will be aborted if the provided context is 10394 // canceled. 10395 func (c *ProjectsRegionsClustersStopCall) Context(ctx context.Context) *ProjectsRegionsClustersStopCall { 10396 c.ctx_ = ctx 10397 return c 10398 } 10399 10400 // Header returns an http.Header that can be modified by the caller to 10401 // add HTTP headers to the request. 10402 func (c *ProjectsRegionsClustersStopCall) Header() http.Header { 10403 if c.header_ == nil { 10404 c.header_ = make(http.Header) 10405 } 10406 return c.header_ 10407 } 10408 10409 func (c *ProjectsRegionsClustersStopCall) doRequest(alt string) (*http.Response, error) { 10410 reqHeaders := make(http.Header) 10411 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 10412 for k, v := range c.header_ { 10413 reqHeaders[k] = v 10414 } 10415 reqHeaders.Set("User-Agent", c.s.userAgent()) 10416 var body io.Reader = nil 10417 body, err := googleapi.WithoutDataWrapper.JSONReader(c.stopclusterrequest) 10418 if err != nil { 10419 return nil, err 10420 } 10421 reqHeaders.Set("Content-Type", "application/json") 10422 c.urlParams_.Set("alt", alt) 10423 c.urlParams_.Set("prettyPrint", "false") 10424 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:stop") 10425 urls += "?" + c.urlParams_.Encode() 10426 req, err := http.NewRequest("POST", urls, body) 10427 if err != nil { 10428 return nil, err 10429 } 10430 req.Header = reqHeaders 10431 googleapi.Expand(req.URL, map[string]string{ 10432 "projectId": c.projectId, 10433 "region": c.region, 10434 "clusterName": c.clusterName, 10435 }) 10436 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10437 } 10438 10439 // Do executes the "dataproc.projects.regions.clusters.stop" call. 10440 // Exactly one of *Operation or error will be non-nil. Any non-2xx 10441 // status code is an error. Response headers are in either 10442 // *Operation.ServerResponse.Header or (if a response was returned at 10443 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 10444 // to check whether the returned error was because 10445 // http.StatusNotModified was returned. 10446 func (c *ProjectsRegionsClustersStopCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 10447 gensupport.SetOptions(c.urlParams_, opts...) 10448 res, err := c.doRequest("json") 10449 if res != nil && res.StatusCode == http.StatusNotModified { 10450 if res.Body != nil { 10451 res.Body.Close() 10452 } 10453 return nil, &googleapi.Error{ 10454 Code: res.StatusCode, 10455 Header: res.Header, 10456 } 10457 } 10458 if err != nil { 10459 return nil, err 10460 } 10461 defer googleapi.CloseBody(res) 10462 if err := googleapi.CheckResponse(res); err != nil { 10463 return nil, err 10464 } 10465 ret := &Operation{ 10466 ServerResponse: googleapi.ServerResponse{ 10467 Header: res.Header, 10468 HTTPStatusCode: res.StatusCode, 10469 }, 10470 } 10471 target := &ret 10472 if err := gensupport.DecodeResponse(target, res); err != nil { 10473 return nil, err 10474 } 10475 return ret, nil 10476 // { 10477 // "description": "Stops a cluster in a project.", 10478 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:stop", 10479 // "httpMethod": "POST", 10480 // "id": "dataproc.projects.regions.clusters.stop", 10481 // "parameterOrder": [ 10482 // "projectId", 10483 // "region", 10484 // "clusterName" 10485 // ], 10486 // "parameters": { 10487 // "clusterName": { 10488 // "description": "Required. The cluster name.", 10489 // "location": "path", 10490 // "required": true, 10491 // "type": "string" 10492 // }, 10493 // "projectId": { 10494 // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.", 10495 // "location": "path", 10496 // "required": true, 10497 // "type": "string" 10498 // }, 10499 // "region": { 10500 // "description": "Required. The Dataproc region in which to handle the request.", 10501 // "location": "path", 10502 // "required": true, 10503 // "type": "string" 10504 // } 10505 // }, 10506 // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:stop", 10507 // "request": { 10508 // "$ref": "StopClusterRequest" 10509 // }, 10510 // "response": { 10511 // "$ref": "Operation" 10512 // }, 10513 // "scopes": [ 10514 // "https://www.googleapis.com/auth/cloud-platform" 10515 // ] 10516 // } 10517 10518 } 10519 10520 // method id "dataproc.projects.regions.clusters.testIamPermissions": 10521 10522 type ProjectsRegionsClustersTestIamPermissionsCall struct { 10523 s *Service 10524 resource string 10525 testiampermissionsrequest *TestIamPermissionsRequest 10526 urlParams_ gensupport.URLParams 10527 ctx_ context.Context 10528 header_ http.Header 10529 } 10530 10531 // TestIamPermissions: Returns permissions that a caller has on the 10532 // specified resource. If the resource does not exist, this will return 10533 // an empty set of permissions, not a NOT_FOUND error.Note: This 10534 // operation is designed to be used for building permission-aware UIs 10535 // and command-line tools, not for authorization checking. This 10536 // operation may "fail open" without warning. 10537 // 10538 // - resource: REQUIRED: The resource for which the policy detail is 10539 // being requested. See the operation documentation for the 10540 // appropriate value for this field. 10541 func (r *ProjectsRegionsClustersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsClustersTestIamPermissionsCall { 10542 c := &ProjectsRegionsClustersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10543 c.resource = resource 10544 c.testiampermissionsrequest = testiampermissionsrequest 10545 return c 10546 } 10547 10548 // Fields allows partial responses to be retrieved. See 10549 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10550 // for more information. 10551 func (c *ProjectsRegionsClustersTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersTestIamPermissionsCall { 10552 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10553 return c 10554 } 10555 10556 // Context sets the context to be used in this call's Do method. Any 10557 // pending HTTP request will be aborted if the provided context is 10558 // canceled. 10559 func (c *ProjectsRegionsClustersTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsClustersTestIamPermissionsCall { 10560 c.ctx_ = ctx 10561 return c 10562 } 10563 10564 // Header returns an http.Header that can be modified by the caller to 10565 // add HTTP headers to the request. 10566 func (c *ProjectsRegionsClustersTestIamPermissionsCall) Header() http.Header { 10567 if c.header_ == nil { 10568 c.header_ = make(http.Header) 10569 } 10570 return c.header_ 10571 } 10572 10573 func (c *ProjectsRegionsClustersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 10574 reqHeaders := make(http.Header) 10575 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 10576 for k, v := range c.header_ { 10577 reqHeaders[k] = v 10578 } 10579 reqHeaders.Set("User-Agent", c.s.userAgent()) 10580 var body io.Reader = nil 10581 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 10582 if err != nil { 10583 return nil, err 10584 } 10585 reqHeaders.Set("Content-Type", "application/json") 10586 c.urlParams_.Set("alt", alt) 10587 c.urlParams_.Set("prettyPrint", "false") 10588 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 10589 urls += "?" + c.urlParams_.Encode() 10590 req, err := http.NewRequest("POST", urls, body) 10591 if err != nil { 10592 return nil, err 10593 } 10594 req.Header = reqHeaders 10595 googleapi.Expand(req.URL, map[string]string{ 10596 "resource": c.resource, 10597 }) 10598 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10599 } 10600 10601 // Do executes the "dataproc.projects.regions.clusters.testIamPermissions" call. 10602 // Exactly one of *TestIamPermissionsResponse or error will be non-nil. 10603 // Any non-2xx status code is an error. Response headers are in either 10604 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response 10605 // was returned at all) in error.(*googleapi.Error).Header. Use 10606 // googleapi.IsNotModified to check whether the returned error was 10607 // because http.StatusNotModified was returned. 10608 func (c *ProjectsRegionsClustersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 10609 gensupport.SetOptions(c.urlParams_, opts...) 10610 res, err := c.doRequest("json") 10611 if res != nil && res.StatusCode == http.StatusNotModified { 10612 if res.Body != nil { 10613 res.Body.Close() 10614 } 10615 return nil, &googleapi.Error{ 10616 Code: res.StatusCode, 10617 Header: res.Header, 10618 } 10619 } 10620 if err != nil { 10621 return nil, err 10622 } 10623 defer googleapi.CloseBody(res) 10624 if err := googleapi.CheckResponse(res); err != nil { 10625 return nil, err 10626 } 10627 ret := &TestIamPermissionsResponse{ 10628 ServerResponse: googleapi.ServerResponse{ 10629 Header: res.Header, 10630 HTTPStatusCode: res.StatusCode, 10631 }, 10632 } 10633 target := &ret 10634 if err := gensupport.DecodeResponse(target, res); err != nil { 10635 return nil, err 10636 } 10637 return ret, nil 10638 // { 10639 // "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.", 10640 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:testIamPermissions", 10641 // "httpMethod": "POST", 10642 // "id": "dataproc.projects.regions.clusters.testIamPermissions", 10643 // "parameterOrder": [ 10644 // "resource" 10645 // ], 10646 // "parameters": { 10647 // "resource": { 10648 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 10649 // "location": "path", 10650 // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$", 10651 // "required": true, 10652 // "type": "string" 10653 // } 10654 // }, 10655 // "path": "v1beta2/{+resource}:testIamPermissions", 10656 // "request": { 10657 // "$ref": "TestIamPermissionsRequest" 10658 // }, 10659 // "response": { 10660 // "$ref": "TestIamPermissionsResponse" 10661 // }, 10662 // "scopes": [ 10663 // "https://www.googleapis.com/auth/cloud-platform" 10664 // ] 10665 // } 10666 10667 } 10668 10669 // method id "dataproc.projects.regions.jobs.cancel": 10670 10671 type ProjectsRegionsJobsCancelCall struct { 10672 s *Service 10673 projectId string 10674 region string 10675 jobId string 10676 canceljobrequest *CancelJobRequest 10677 urlParams_ gensupport.URLParams 10678 ctx_ context.Context 10679 header_ http.Header 10680 } 10681 10682 // Cancel: Starts a job cancellation request. To access the job resource 10683 // after cancellation, call regions/{region}/jobs.list 10684 // (https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/list) 10685 // or regions/{region}/jobs.get 10686 // (https://cloud.google.com/dataproc/docs/reference/rest/v1beta2/projects.regions.jobs/get). 10687 // 10688 // - jobId: The job ID. 10689 // - projectId: The ID of the Google Cloud Platform project that the job 10690 // belongs to. 10691 // - region: The Dataproc region in which to handle the request. 10692 func (r *ProjectsRegionsJobsService) Cancel(projectId string, region string, jobId string, canceljobrequest *CancelJobRequest) *ProjectsRegionsJobsCancelCall { 10693 c := &ProjectsRegionsJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10694 c.projectId = projectId 10695 c.region = region 10696 c.jobId = jobId 10697 c.canceljobrequest = canceljobrequest 10698 return c 10699 } 10700 10701 // Fields allows partial responses to be retrieved. See 10702 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10703 // for more information. 10704 func (c *ProjectsRegionsJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsCancelCall { 10705 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10706 return c 10707 } 10708 10709 // Context sets the context to be used in this call's Do method. Any 10710 // pending HTTP request will be aborted if the provided context is 10711 // canceled. 10712 func (c *ProjectsRegionsJobsCancelCall) Context(ctx context.Context) *ProjectsRegionsJobsCancelCall { 10713 c.ctx_ = ctx 10714 return c 10715 } 10716 10717 // Header returns an http.Header that can be modified by the caller to 10718 // add HTTP headers to the request. 10719 func (c *ProjectsRegionsJobsCancelCall) Header() http.Header { 10720 if c.header_ == nil { 10721 c.header_ = make(http.Header) 10722 } 10723 return c.header_ 10724 } 10725 10726 func (c *ProjectsRegionsJobsCancelCall) doRequest(alt string) (*http.Response, error) { 10727 reqHeaders := make(http.Header) 10728 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 10729 for k, v := range c.header_ { 10730 reqHeaders[k] = v 10731 } 10732 reqHeaders.Set("User-Agent", c.s.userAgent()) 10733 var body io.Reader = nil 10734 body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceljobrequest) 10735 if err != nil { 10736 return nil, err 10737 } 10738 reqHeaders.Set("Content-Type", "application/json") 10739 c.urlParams_.Set("alt", alt) 10740 c.urlParams_.Set("prettyPrint", "false") 10741 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel") 10742 urls += "?" + c.urlParams_.Encode() 10743 req, err := http.NewRequest("POST", urls, body) 10744 if err != nil { 10745 return nil, err 10746 } 10747 req.Header = reqHeaders 10748 googleapi.Expand(req.URL, map[string]string{ 10749 "projectId": c.projectId, 10750 "region": c.region, 10751 "jobId": c.jobId, 10752 }) 10753 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10754 } 10755 10756 // Do executes the "dataproc.projects.regions.jobs.cancel" call. 10757 // Exactly one of *Job or error will be non-nil. Any non-2xx status code 10758 // is an error. Response headers are in either 10759 // *Job.ServerResponse.Header or (if a response was returned at all) in 10760 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 10761 // whether the returned error was because http.StatusNotModified was 10762 // returned. 10763 func (c *ProjectsRegionsJobsCancelCall) Do(opts ...googleapi.CallOption) (*Job, error) { 10764 gensupport.SetOptions(c.urlParams_, opts...) 10765 res, err := c.doRequest("json") 10766 if res != nil && res.StatusCode == http.StatusNotModified { 10767 if res.Body != nil { 10768 res.Body.Close() 10769 } 10770 return nil, &googleapi.Error{ 10771 Code: res.StatusCode, 10772 Header: res.Header, 10773 } 10774 } 10775 if err != nil { 10776 return nil, err 10777 } 10778 defer googleapi.CloseBody(res) 10779 if err := googleapi.CheckResponse(res); err != nil { 10780 return nil, err 10781 } 10782 ret := &Job{ 10783 ServerResponse: googleapi.ServerResponse{ 10784 Header: res.Header, 10785 HTTPStatusCode: res.StatusCode, 10786 }, 10787 } 10788 target := &ret 10789 if err := gensupport.DecodeResponse(target, res); err != nil { 10790 return nil, err 10791 } 10792 return ret, nil 10793 // { 10794 // "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).", 10795 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", 10796 // "httpMethod": "POST", 10797 // "id": "dataproc.projects.regions.jobs.cancel", 10798 // "parameterOrder": [ 10799 // "projectId", 10800 // "region", 10801 // "jobId" 10802 // ], 10803 // "parameters": { 10804 // "jobId": { 10805 // "description": "Required. The job ID.", 10806 // "location": "path", 10807 // "required": true, 10808 // "type": "string" 10809 // }, 10810 // "projectId": { 10811 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 10812 // "location": "path", 10813 // "required": true, 10814 // "type": "string" 10815 // }, 10816 // "region": { 10817 // "description": "Required. The Dataproc region in which to handle the request.", 10818 // "location": "path", 10819 // "required": true, 10820 // "type": "string" 10821 // } 10822 // }, 10823 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel", 10824 // "request": { 10825 // "$ref": "CancelJobRequest" 10826 // }, 10827 // "response": { 10828 // "$ref": "Job" 10829 // }, 10830 // "scopes": [ 10831 // "https://www.googleapis.com/auth/cloud-platform" 10832 // ] 10833 // } 10834 10835 } 10836 10837 // method id "dataproc.projects.regions.jobs.delete": 10838 10839 type ProjectsRegionsJobsDeleteCall struct { 10840 s *Service 10841 projectId string 10842 region string 10843 jobId string 10844 urlParams_ gensupport.URLParams 10845 ctx_ context.Context 10846 header_ http.Header 10847 } 10848 10849 // Delete: Deletes the job from the project. If the job is active, the 10850 // delete fails, and the response returns FAILED_PRECONDITION. 10851 // 10852 // - jobId: The job ID. 10853 // - projectId: The ID of the Google Cloud Platform project that the job 10854 // belongs to. 10855 // - region: The Dataproc region in which to handle the request. 10856 func (r *ProjectsRegionsJobsService) Delete(projectId string, region string, jobId string) *ProjectsRegionsJobsDeleteCall { 10857 c := &ProjectsRegionsJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 10858 c.projectId = projectId 10859 c.region = region 10860 c.jobId = jobId 10861 return c 10862 } 10863 10864 // Fields allows partial responses to be retrieved. See 10865 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 10866 // for more information. 10867 func (c *ProjectsRegionsJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsDeleteCall { 10868 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 10869 return c 10870 } 10871 10872 // Context sets the context to be used in this call's Do method. Any 10873 // pending HTTP request will be aborted if the provided context is 10874 // canceled. 10875 func (c *ProjectsRegionsJobsDeleteCall) Context(ctx context.Context) *ProjectsRegionsJobsDeleteCall { 10876 c.ctx_ = ctx 10877 return c 10878 } 10879 10880 // Header returns an http.Header that can be modified by the caller to 10881 // add HTTP headers to the request. 10882 func (c *ProjectsRegionsJobsDeleteCall) Header() http.Header { 10883 if c.header_ == nil { 10884 c.header_ = make(http.Header) 10885 } 10886 return c.header_ 10887 } 10888 10889 func (c *ProjectsRegionsJobsDeleteCall) doRequest(alt string) (*http.Response, error) { 10890 reqHeaders := make(http.Header) 10891 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 10892 for k, v := range c.header_ { 10893 reqHeaders[k] = v 10894 } 10895 reqHeaders.Set("User-Agent", c.s.userAgent()) 10896 var body io.Reader = nil 10897 c.urlParams_.Set("alt", alt) 10898 c.urlParams_.Set("prettyPrint", "false") 10899 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}") 10900 urls += "?" + c.urlParams_.Encode() 10901 req, err := http.NewRequest("DELETE", urls, body) 10902 if err != nil { 10903 return nil, err 10904 } 10905 req.Header = reqHeaders 10906 googleapi.Expand(req.URL, map[string]string{ 10907 "projectId": c.projectId, 10908 "region": c.region, 10909 "jobId": c.jobId, 10910 }) 10911 return gensupport.SendRequest(c.ctx_, c.s.client, req) 10912 } 10913 10914 // Do executes the "dataproc.projects.regions.jobs.delete" call. 10915 // Exactly one of *Empty or error will be non-nil. Any non-2xx status 10916 // code is an error. Response headers are in either 10917 // *Empty.ServerResponse.Header or (if a response was returned at all) 10918 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 10919 // check whether the returned error was because http.StatusNotModified 10920 // was returned. 10921 func (c *ProjectsRegionsJobsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 10922 gensupport.SetOptions(c.urlParams_, opts...) 10923 res, err := c.doRequest("json") 10924 if res != nil && res.StatusCode == http.StatusNotModified { 10925 if res.Body != nil { 10926 res.Body.Close() 10927 } 10928 return nil, &googleapi.Error{ 10929 Code: res.StatusCode, 10930 Header: res.Header, 10931 } 10932 } 10933 if err != nil { 10934 return nil, err 10935 } 10936 defer googleapi.CloseBody(res) 10937 if err := googleapi.CheckResponse(res); err != nil { 10938 return nil, err 10939 } 10940 ret := &Empty{ 10941 ServerResponse: googleapi.ServerResponse{ 10942 Header: res.Header, 10943 HTTPStatusCode: res.StatusCode, 10944 }, 10945 } 10946 target := &ret 10947 if err := gensupport.DecodeResponse(target, res); err != nil { 10948 return nil, err 10949 } 10950 return ret, nil 10951 // { 10952 // "description": "Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.", 10953 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", 10954 // "httpMethod": "DELETE", 10955 // "id": "dataproc.projects.regions.jobs.delete", 10956 // "parameterOrder": [ 10957 // "projectId", 10958 // "region", 10959 // "jobId" 10960 // ], 10961 // "parameters": { 10962 // "jobId": { 10963 // "description": "Required. The job ID.", 10964 // "location": "path", 10965 // "required": true, 10966 // "type": "string" 10967 // }, 10968 // "projectId": { 10969 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 10970 // "location": "path", 10971 // "required": true, 10972 // "type": "string" 10973 // }, 10974 // "region": { 10975 // "description": "Required. The Dataproc region in which to handle the request.", 10976 // "location": "path", 10977 // "required": true, 10978 // "type": "string" 10979 // } 10980 // }, 10981 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", 10982 // "response": { 10983 // "$ref": "Empty" 10984 // }, 10985 // "scopes": [ 10986 // "https://www.googleapis.com/auth/cloud-platform" 10987 // ] 10988 // } 10989 10990 } 10991 10992 // method id "dataproc.projects.regions.jobs.get": 10993 10994 type ProjectsRegionsJobsGetCall struct { 10995 s *Service 10996 projectId string 10997 region string 10998 jobId string 10999 urlParams_ gensupport.URLParams 11000 ifNoneMatch_ string 11001 ctx_ context.Context 11002 header_ http.Header 11003 } 11004 11005 // Get: Gets the resource representation for a job in a project. 11006 // 11007 // - jobId: The job ID. 11008 // - projectId: The ID of the Google Cloud Platform project that the job 11009 // belongs to. 11010 // - region: The Dataproc region in which to handle the request. 11011 func (r *ProjectsRegionsJobsService) Get(projectId string, region string, jobId string) *ProjectsRegionsJobsGetCall { 11012 c := &ProjectsRegionsJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11013 c.projectId = projectId 11014 c.region = region 11015 c.jobId = jobId 11016 return c 11017 } 11018 11019 // Fields allows partial responses to be retrieved. See 11020 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11021 // for more information. 11022 func (c *ProjectsRegionsJobsGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsGetCall { 11023 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11024 return c 11025 } 11026 11027 // IfNoneMatch sets the optional parameter which makes the operation 11028 // fail if the object's ETag matches the given value. This is useful for 11029 // getting updates only after the object has changed since the last 11030 // request. Use googleapi.IsNotModified to check whether the response 11031 // error from Do is the result of In-None-Match. 11032 func (c *ProjectsRegionsJobsGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsGetCall { 11033 c.ifNoneMatch_ = entityTag 11034 return c 11035 } 11036 11037 // Context sets the context to be used in this call's Do method. Any 11038 // pending HTTP request will be aborted if the provided context is 11039 // canceled. 11040 func (c *ProjectsRegionsJobsGetCall) Context(ctx context.Context) *ProjectsRegionsJobsGetCall { 11041 c.ctx_ = ctx 11042 return c 11043 } 11044 11045 // Header returns an http.Header that can be modified by the caller to 11046 // add HTTP headers to the request. 11047 func (c *ProjectsRegionsJobsGetCall) Header() http.Header { 11048 if c.header_ == nil { 11049 c.header_ = make(http.Header) 11050 } 11051 return c.header_ 11052 } 11053 11054 func (c *ProjectsRegionsJobsGetCall) doRequest(alt string) (*http.Response, error) { 11055 reqHeaders := make(http.Header) 11056 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 11057 for k, v := range c.header_ { 11058 reqHeaders[k] = v 11059 } 11060 reqHeaders.Set("User-Agent", c.s.userAgent()) 11061 if c.ifNoneMatch_ != "" { 11062 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11063 } 11064 var body io.Reader = nil 11065 c.urlParams_.Set("alt", alt) 11066 c.urlParams_.Set("prettyPrint", "false") 11067 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}") 11068 urls += "?" + c.urlParams_.Encode() 11069 req, err := http.NewRequest("GET", urls, body) 11070 if err != nil { 11071 return nil, err 11072 } 11073 req.Header = reqHeaders 11074 googleapi.Expand(req.URL, map[string]string{ 11075 "projectId": c.projectId, 11076 "region": c.region, 11077 "jobId": c.jobId, 11078 }) 11079 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11080 } 11081 11082 // Do executes the "dataproc.projects.regions.jobs.get" call. 11083 // Exactly one of *Job or error will be non-nil. Any non-2xx status code 11084 // is an error. Response headers are in either 11085 // *Job.ServerResponse.Header or (if a response was returned at all) in 11086 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11087 // whether the returned error was because http.StatusNotModified was 11088 // returned. 11089 func (c *ProjectsRegionsJobsGetCall) Do(opts ...googleapi.CallOption) (*Job, error) { 11090 gensupport.SetOptions(c.urlParams_, opts...) 11091 res, err := c.doRequest("json") 11092 if res != nil && res.StatusCode == http.StatusNotModified { 11093 if res.Body != nil { 11094 res.Body.Close() 11095 } 11096 return nil, &googleapi.Error{ 11097 Code: res.StatusCode, 11098 Header: res.Header, 11099 } 11100 } 11101 if err != nil { 11102 return nil, err 11103 } 11104 defer googleapi.CloseBody(res) 11105 if err := googleapi.CheckResponse(res); err != nil { 11106 return nil, err 11107 } 11108 ret := &Job{ 11109 ServerResponse: googleapi.ServerResponse{ 11110 Header: res.Header, 11111 HTTPStatusCode: res.StatusCode, 11112 }, 11113 } 11114 target := &ret 11115 if err := gensupport.DecodeResponse(target, res); err != nil { 11116 return nil, err 11117 } 11118 return ret, nil 11119 // { 11120 // "description": "Gets the resource representation for a job in a project.", 11121 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", 11122 // "httpMethod": "GET", 11123 // "id": "dataproc.projects.regions.jobs.get", 11124 // "parameterOrder": [ 11125 // "projectId", 11126 // "region", 11127 // "jobId" 11128 // ], 11129 // "parameters": { 11130 // "jobId": { 11131 // "description": "Required. The job ID.", 11132 // "location": "path", 11133 // "required": true, 11134 // "type": "string" 11135 // }, 11136 // "projectId": { 11137 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 11138 // "location": "path", 11139 // "required": true, 11140 // "type": "string" 11141 // }, 11142 // "region": { 11143 // "description": "Required. The Dataproc region in which to handle the request.", 11144 // "location": "path", 11145 // "required": true, 11146 // "type": "string" 11147 // } 11148 // }, 11149 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", 11150 // "response": { 11151 // "$ref": "Job" 11152 // }, 11153 // "scopes": [ 11154 // "https://www.googleapis.com/auth/cloud-platform" 11155 // ] 11156 // } 11157 11158 } 11159 11160 // method id "dataproc.projects.regions.jobs.getIamPolicy": 11161 11162 type ProjectsRegionsJobsGetIamPolicyCall struct { 11163 s *Service 11164 resource string 11165 urlParams_ gensupport.URLParams 11166 ifNoneMatch_ string 11167 ctx_ context.Context 11168 header_ http.Header 11169 } 11170 11171 // GetIamPolicy: Gets the access control policy for a resource. Returns 11172 // an empty policy if the resource exists and does not have a policy 11173 // set. 11174 // 11175 // - resource: REQUIRED: The resource for which the policy is being 11176 // requested. See the operation documentation for the appropriate 11177 // value for this field. 11178 func (r *ProjectsRegionsJobsService) GetIamPolicy(resource string) *ProjectsRegionsJobsGetIamPolicyCall { 11179 c := &ProjectsRegionsJobsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11180 c.resource = resource 11181 return c 11182 } 11183 11184 // OptionsRequestedPolicyVersion sets the optional parameter 11185 // "options.requestedPolicyVersion": The policy format version to be 11186 // returned.Valid values are 0, 1, and 3. Requests specifying an invalid 11187 // value will be rejected.Requests for policies with any conditional 11188 // bindings must specify version 3. Policies without any conditional 11189 // bindings may specify any valid value or leave the field unset.To 11190 // learn which resources support conditions in their IAM policies, see 11191 // the IAM documentation 11192 // (https://cloud.google.com/iam/help/conditions/resource-policies). 11193 func (c *ProjectsRegionsJobsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsRegionsJobsGetIamPolicyCall { 11194 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 11195 return c 11196 } 11197 11198 // Fields allows partial responses to be retrieved. See 11199 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11200 // for more information. 11201 func (c *ProjectsRegionsJobsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsGetIamPolicyCall { 11202 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11203 return c 11204 } 11205 11206 // IfNoneMatch sets the optional parameter which makes the operation 11207 // fail if the object's ETag matches the given value. This is useful for 11208 // getting updates only after the object has changed since the last 11209 // request. Use googleapi.IsNotModified to check whether the response 11210 // error from Do is the result of In-None-Match. 11211 func (c *ProjectsRegionsJobsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsGetIamPolicyCall { 11212 c.ifNoneMatch_ = entityTag 11213 return c 11214 } 11215 11216 // Context sets the context to be used in this call's Do method. Any 11217 // pending HTTP request will be aborted if the provided context is 11218 // canceled. 11219 func (c *ProjectsRegionsJobsGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsJobsGetIamPolicyCall { 11220 c.ctx_ = ctx 11221 return c 11222 } 11223 11224 // Header returns an http.Header that can be modified by the caller to 11225 // add HTTP headers to the request. 11226 func (c *ProjectsRegionsJobsGetIamPolicyCall) Header() http.Header { 11227 if c.header_ == nil { 11228 c.header_ = make(http.Header) 11229 } 11230 return c.header_ 11231 } 11232 11233 func (c *ProjectsRegionsJobsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 11234 reqHeaders := make(http.Header) 11235 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 11236 for k, v := range c.header_ { 11237 reqHeaders[k] = v 11238 } 11239 reqHeaders.Set("User-Agent", c.s.userAgent()) 11240 if c.ifNoneMatch_ != "" { 11241 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11242 } 11243 var body io.Reader = nil 11244 c.urlParams_.Set("alt", alt) 11245 c.urlParams_.Set("prettyPrint", "false") 11246 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 11247 urls += "?" + c.urlParams_.Encode() 11248 req, err := http.NewRequest("GET", urls, body) 11249 if err != nil { 11250 return nil, err 11251 } 11252 req.Header = reqHeaders 11253 googleapi.Expand(req.URL, map[string]string{ 11254 "resource": c.resource, 11255 }) 11256 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11257 } 11258 11259 // Do executes the "dataproc.projects.regions.jobs.getIamPolicy" call. 11260 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 11261 // code is an error. Response headers are in either 11262 // *Policy.ServerResponse.Header or (if a response was returned at all) 11263 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11264 // check whether the returned error was because http.StatusNotModified 11265 // was returned. 11266 func (c *ProjectsRegionsJobsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 11267 gensupport.SetOptions(c.urlParams_, opts...) 11268 res, err := c.doRequest("json") 11269 if res != nil && res.StatusCode == http.StatusNotModified { 11270 if res.Body != nil { 11271 res.Body.Close() 11272 } 11273 return nil, &googleapi.Error{ 11274 Code: res.StatusCode, 11275 Header: res.Header, 11276 } 11277 } 11278 if err != nil { 11279 return nil, err 11280 } 11281 defer googleapi.CloseBody(res) 11282 if err := googleapi.CheckResponse(res); err != nil { 11283 return nil, err 11284 } 11285 ret := &Policy{ 11286 ServerResponse: googleapi.ServerResponse{ 11287 Header: res.Header, 11288 HTTPStatusCode: res.StatusCode, 11289 }, 11290 } 11291 target := &ret 11292 if err := gensupport.DecodeResponse(target, res); err != nil { 11293 return nil, err 11294 } 11295 return ret, nil 11296 // { 11297 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 11298 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:getIamPolicy", 11299 // "httpMethod": "GET", 11300 // "id": "dataproc.projects.regions.jobs.getIamPolicy", 11301 // "parameterOrder": [ 11302 // "resource" 11303 // ], 11304 // "parameters": { 11305 // "options.requestedPolicyVersion": { 11306 // "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).", 11307 // "format": "int32", 11308 // "location": "query", 11309 // "type": "integer" 11310 // }, 11311 // "resource": { 11312 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 11313 // "location": "path", 11314 // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$", 11315 // "required": true, 11316 // "type": "string" 11317 // } 11318 // }, 11319 // "path": "v1beta2/{+resource}:getIamPolicy", 11320 // "response": { 11321 // "$ref": "Policy" 11322 // }, 11323 // "scopes": [ 11324 // "https://www.googleapis.com/auth/cloud-platform" 11325 // ] 11326 // } 11327 11328 } 11329 11330 // method id "dataproc.projects.regions.jobs.list": 11331 11332 type ProjectsRegionsJobsListCall struct { 11333 s *Service 11334 projectId string 11335 region string 11336 urlParams_ gensupport.URLParams 11337 ifNoneMatch_ string 11338 ctx_ context.Context 11339 header_ http.Header 11340 } 11341 11342 // List: Lists regions/{region}/jobs in a project. 11343 // 11344 // - projectId: The ID of the Google Cloud Platform project that the job 11345 // belongs to. 11346 // - region: The Dataproc region in which to handle the request. 11347 func (r *ProjectsRegionsJobsService) List(projectId string, region string) *ProjectsRegionsJobsListCall { 11348 c := &ProjectsRegionsJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11349 c.projectId = projectId 11350 c.region = region 11351 return c 11352 } 11353 11354 // ClusterName sets the optional parameter "clusterName": If set, the 11355 // returned jobs list includes only jobs that were submitted to the 11356 // named cluster. 11357 func (c *ProjectsRegionsJobsListCall) ClusterName(clusterName string) *ProjectsRegionsJobsListCall { 11358 c.urlParams_.Set("clusterName", clusterName) 11359 return c 11360 } 11361 11362 // Filter sets the optional parameter "filter": A filter constraining 11363 // the jobs to list. Filters are case-sensitive and have the following 11364 // syntax:field = value AND field = value ...where field is status.state 11365 // or labels.[KEY], and [KEY] is a label key. value can be * to match 11366 // all values. status.state can be either ACTIVE or NON_ACTIVE. Only the 11367 // logical AND operator is supported; space-separated items are treated 11368 // as having an implicit AND operator.Example filter:status.state = 11369 // ACTIVE AND labels.env = staging AND labels.starred = * 11370 func (c *ProjectsRegionsJobsListCall) Filter(filter string) *ProjectsRegionsJobsListCall { 11371 c.urlParams_.Set("filter", filter) 11372 return c 11373 } 11374 11375 // JobStateMatcher sets the optional parameter "jobStateMatcher": 11376 // Specifies enumerated categories of jobs to list. (default = match ALL 11377 // jobs).If filter is provided, jobStateMatcher will be ignored. 11378 // 11379 // Possible values: 11380 // 11381 // "ALL" - Match all jobs, regardless of state. 11382 // "ACTIVE" - Only match jobs in non-terminal states: PENDING, 11383 // 11384 // RUNNING, or CANCEL_PENDING. 11385 // 11386 // "NON_ACTIVE" - Only match jobs in terminal states: CANCELLED, DONE, 11387 // 11388 // or ERROR. 11389 func (c *ProjectsRegionsJobsListCall) JobStateMatcher(jobStateMatcher string) *ProjectsRegionsJobsListCall { 11390 c.urlParams_.Set("jobStateMatcher", jobStateMatcher) 11391 return c 11392 } 11393 11394 // PageSize sets the optional parameter "pageSize": The number of 11395 // results to return in each response. 11396 func (c *ProjectsRegionsJobsListCall) PageSize(pageSize int64) *ProjectsRegionsJobsListCall { 11397 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 11398 return c 11399 } 11400 11401 // PageToken sets the optional parameter "pageToken": The page token, 11402 // returned by a previous call, to request the next page of results. 11403 func (c *ProjectsRegionsJobsListCall) PageToken(pageToken string) *ProjectsRegionsJobsListCall { 11404 c.urlParams_.Set("pageToken", pageToken) 11405 return c 11406 } 11407 11408 // Fields allows partial responses to be retrieved. See 11409 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11410 // for more information. 11411 func (c *ProjectsRegionsJobsListCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsListCall { 11412 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11413 return c 11414 } 11415 11416 // IfNoneMatch sets the optional parameter which makes the operation 11417 // fail if the object's ETag matches the given value. This is useful for 11418 // getting updates only after the object has changed since the last 11419 // request. Use googleapi.IsNotModified to check whether the response 11420 // error from Do is the result of In-None-Match. 11421 func (c *ProjectsRegionsJobsListCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsListCall { 11422 c.ifNoneMatch_ = entityTag 11423 return c 11424 } 11425 11426 // Context sets the context to be used in this call's Do method. Any 11427 // pending HTTP request will be aborted if the provided context is 11428 // canceled. 11429 func (c *ProjectsRegionsJobsListCall) Context(ctx context.Context) *ProjectsRegionsJobsListCall { 11430 c.ctx_ = ctx 11431 return c 11432 } 11433 11434 // Header returns an http.Header that can be modified by the caller to 11435 // add HTTP headers to the request. 11436 func (c *ProjectsRegionsJobsListCall) Header() http.Header { 11437 if c.header_ == nil { 11438 c.header_ = make(http.Header) 11439 } 11440 return c.header_ 11441 } 11442 11443 func (c *ProjectsRegionsJobsListCall) doRequest(alt string) (*http.Response, error) { 11444 reqHeaders := make(http.Header) 11445 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 11446 for k, v := range c.header_ { 11447 reqHeaders[k] = v 11448 } 11449 reqHeaders.Set("User-Agent", c.s.userAgent()) 11450 if c.ifNoneMatch_ != "" { 11451 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 11452 } 11453 var body io.Reader = nil 11454 c.urlParams_.Set("alt", alt) 11455 c.urlParams_.Set("prettyPrint", "false") 11456 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs") 11457 urls += "?" + c.urlParams_.Encode() 11458 req, err := http.NewRequest("GET", urls, body) 11459 if err != nil { 11460 return nil, err 11461 } 11462 req.Header = reqHeaders 11463 googleapi.Expand(req.URL, map[string]string{ 11464 "projectId": c.projectId, 11465 "region": c.region, 11466 }) 11467 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11468 } 11469 11470 // Do executes the "dataproc.projects.regions.jobs.list" call. 11471 // Exactly one of *ListJobsResponse or error will be non-nil. Any 11472 // non-2xx status code is an error. Response headers are in either 11473 // *ListJobsResponse.ServerResponse.Header or (if a response was 11474 // returned at all) in error.(*googleapi.Error).Header. Use 11475 // googleapi.IsNotModified to check whether the returned error was 11476 // because http.StatusNotModified was returned. 11477 func (c *ProjectsRegionsJobsListCall) Do(opts ...googleapi.CallOption) (*ListJobsResponse, error) { 11478 gensupport.SetOptions(c.urlParams_, opts...) 11479 res, err := c.doRequest("json") 11480 if res != nil && res.StatusCode == http.StatusNotModified { 11481 if res.Body != nil { 11482 res.Body.Close() 11483 } 11484 return nil, &googleapi.Error{ 11485 Code: res.StatusCode, 11486 Header: res.Header, 11487 } 11488 } 11489 if err != nil { 11490 return nil, err 11491 } 11492 defer googleapi.CloseBody(res) 11493 if err := googleapi.CheckResponse(res); err != nil { 11494 return nil, err 11495 } 11496 ret := &ListJobsResponse{ 11497 ServerResponse: googleapi.ServerResponse{ 11498 Header: res.Header, 11499 HTTPStatusCode: res.StatusCode, 11500 }, 11501 } 11502 target := &ret 11503 if err := gensupport.DecodeResponse(target, res); err != nil { 11504 return nil, err 11505 } 11506 return ret, nil 11507 // { 11508 // "description": "Lists regions/{region}/jobs in a project.", 11509 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs", 11510 // "httpMethod": "GET", 11511 // "id": "dataproc.projects.regions.jobs.list", 11512 // "parameterOrder": [ 11513 // "projectId", 11514 // "region" 11515 // ], 11516 // "parameters": { 11517 // "clusterName": { 11518 // "description": "Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster.", 11519 // "location": "query", 11520 // "type": "string" 11521 // }, 11522 // "filter": { 11523 // "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 = *", 11524 // "location": "query", 11525 // "type": "string" 11526 // }, 11527 // "jobStateMatcher": { 11528 // "description": "Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored.", 11529 // "enum": [ 11530 // "ALL", 11531 // "ACTIVE", 11532 // "NON_ACTIVE" 11533 // ], 11534 // "enumDescriptions": [ 11535 // "Match all jobs, regardless of state.", 11536 // "Only match jobs in non-terminal states: PENDING, RUNNING, or CANCEL_PENDING.", 11537 // "Only match jobs in terminal states: CANCELLED, DONE, or ERROR." 11538 // ], 11539 // "location": "query", 11540 // "type": "string" 11541 // }, 11542 // "pageSize": { 11543 // "description": "Optional. The number of results to return in each response.", 11544 // "format": "int32", 11545 // "location": "query", 11546 // "type": "integer" 11547 // }, 11548 // "pageToken": { 11549 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 11550 // "location": "query", 11551 // "type": "string" 11552 // }, 11553 // "projectId": { 11554 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 11555 // "location": "path", 11556 // "required": true, 11557 // "type": "string" 11558 // }, 11559 // "region": { 11560 // "description": "Required. The Dataproc region in which to handle the request.", 11561 // "location": "path", 11562 // "required": true, 11563 // "type": "string" 11564 // } 11565 // }, 11566 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs", 11567 // "response": { 11568 // "$ref": "ListJobsResponse" 11569 // }, 11570 // "scopes": [ 11571 // "https://www.googleapis.com/auth/cloud-platform" 11572 // ] 11573 // } 11574 11575 } 11576 11577 // Pages invokes f for each page of results. 11578 // A non-nil error returned from f will halt the iteration. 11579 // The provided context supersedes any context provided to the Context method. 11580 func (c *ProjectsRegionsJobsListCall) Pages(ctx context.Context, f func(*ListJobsResponse) error) error { 11581 c.ctx_ = ctx 11582 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 11583 for { 11584 x, err := c.Do() 11585 if err != nil { 11586 return err 11587 } 11588 if err := f(x); err != nil { 11589 return err 11590 } 11591 if x.NextPageToken == "" { 11592 return nil 11593 } 11594 c.PageToken(x.NextPageToken) 11595 } 11596 } 11597 11598 // method id "dataproc.projects.regions.jobs.patch": 11599 11600 type ProjectsRegionsJobsPatchCall struct { 11601 s *Service 11602 projectId string 11603 region string 11604 jobId string 11605 job *Job 11606 urlParams_ gensupport.URLParams 11607 ctx_ context.Context 11608 header_ http.Header 11609 } 11610 11611 // Patch: Updates a job in a project. 11612 // 11613 // - jobId: The job ID. 11614 // - projectId: The ID of the Google Cloud Platform project that the job 11615 // belongs to. 11616 // - region: The Dataproc region in which to handle the request. 11617 func (r *ProjectsRegionsJobsService) Patch(projectId string, region string, jobId string, job *Job) *ProjectsRegionsJobsPatchCall { 11618 c := &ProjectsRegionsJobsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11619 c.projectId = projectId 11620 c.region = region 11621 c.jobId = jobId 11622 c.job = job 11623 return c 11624 } 11625 11626 // UpdateMask sets the optional parameter "updateMask": Required. 11627 // Specifies the path, relative to Job, of the field to update. For 11628 // example, to update the labels of a Job the update_mask parameter 11629 // would be specified as labels, and the PATCH request body would 11630 // specify the new value. *Note:* Currently, labels is the only field 11631 // that can be updated. 11632 func (c *ProjectsRegionsJobsPatchCall) UpdateMask(updateMask string) *ProjectsRegionsJobsPatchCall { 11633 c.urlParams_.Set("updateMask", updateMask) 11634 return c 11635 } 11636 11637 // Fields allows partial responses to be retrieved. See 11638 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11639 // for more information. 11640 func (c *ProjectsRegionsJobsPatchCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsPatchCall { 11641 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11642 return c 11643 } 11644 11645 // Context sets the context to be used in this call's Do method. Any 11646 // pending HTTP request will be aborted if the provided context is 11647 // canceled. 11648 func (c *ProjectsRegionsJobsPatchCall) Context(ctx context.Context) *ProjectsRegionsJobsPatchCall { 11649 c.ctx_ = ctx 11650 return c 11651 } 11652 11653 // Header returns an http.Header that can be modified by the caller to 11654 // add HTTP headers to the request. 11655 func (c *ProjectsRegionsJobsPatchCall) Header() http.Header { 11656 if c.header_ == nil { 11657 c.header_ = make(http.Header) 11658 } 11659 return c.header_ 11660 } 11661 11662 func (c *ProjectsRegionsJobsPatchCall) doRequest(alt string) (*http.Response, error) { 11663 reqHeaders := make(http.Header) 11664 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 11665 for k, v := range c.header_ { 11666 reqHeaders[k] = v 11667 } 11668 reqHeaders.Set("User-Agent", c.s.userAgent()) 11669 var body io.Reader = nil 11670 body, err := googleapi.WithoutDataWrapper.JSONReader(c.job) 11671 if err != nil { 11672 return nil, err 11673 } 11674 reqHeaders.Set("Content-Type", "application/json") 11675 c.urlParams_.Set("alt", alt) 11676 c.urlParams_.Set("prettyPrint", "false") 11677 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}") 11678 urls += "?" + c.urlParams_.Encode() 11679 req, err := http.NewRequest("PATCH", urls, body) 11680 if err != nil { 11681 return nil, err 11682 } 11683 req.Header = reqHeaders 11684 googleapi.Expand(req.URL, map[string]string{ 11685 "projectId": c.projectId, 11686 "region": c.region, 11687 "jobId": c.jobId, 11688 }) 11689 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11690 } 11691 11692 // Do executes the "dataproc.projects.regions.jobs.patch" call. 11693 // Exactly one of *Job or error will be non-nil. Any non-2xx status code 11694 // is an error. Response headers are in either 11695 // *Job.ServerResponse.Header or (if a response was returned at all) in 11696 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 11697 // whether the returned error was because http.StatusNotModified was 11698 // returned. 11699 func (c *ProjectsRegionsJobsPatchCall) Do(opts ...googleapi.CallOption) (*Job, error) { 11700 gensupport.SetOptions(c.urlParams_, opts...) 11701 res, err := c.doRequest("json") 11702 if res != nil && res.StatusCode == http.StatusNotModified { 11703 if res.Body != nil { 11704 res.Body.Close() 11705 } 11706 return nil, &googleapi.Error{ 11707 Code: res.StatusCode, 11708 Header: res.Header, 11709 } 11710 } 11711 if err != nil { 11712 return nil, err 11713 } 11714 defer googleapi.CloseBody(res) 11715 if err := googleapi.CheckResponse(res); err != nil { 11716 return nil, err 11717 } 11718 ret := &Job{ 11719 ServerResponse: googleapi.ServerResponse{ 11720 Header: res.Header, 11721 HTTPStatusCode: res.StatusCode, 11722 }, 11723 } 11724 target := &ret 11725 if err := gensupport.DecodeResponse(target, res); err != nil { 11726 return nil, err 11727 } 11728 return ret, nil 11729 // { 11730 // "description": "Updates a job in a project.", 11731 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", 11732 // "httpMethod": "PATCH", 11733 // "id": "dataproc.projects.regions.jobs.patch", 11734 // "parameterOrder": [ 11735 // "projectId", 11736 // "region", 11737 // "jobId" 11738 // ], 11739 // "parameters": { 11740 // "jobId": { 11741 // "description": "Required. The job ID.", 11742 // "location": "path", 11743 // "required": true, 11744 // "type": "string" 11745 // }, 11746 // "projectId": { 11747 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 11748 // "location": "path", 11749 // "required": true, 11750 // "type": "string" 11751 // }, 11752 // "region": { 11753 // "description": "Required. The Dataproc region in which to handle the request.", 11754 // "location": "path", 11755 // "required": true, 11756 // "type": "string" 11757 // }, 11758 // "updateMask": { 11759 // "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.", 11760 // "format": "google-fieldmask", 11761 // "location": "query", 11762 // "type": "string" 11763 // } 11764 // }, 11765 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}", 11766 // "request": { 11767 // "$ref": "Job" 11768 // }, 11769 // "response": { 11770 // "$ref": "Job" 11771 // }, 11772 // "scopes": [ 11773 // "https://www.googleapis.com/auth/cloud-platform" 11774 // ] 11775 // } 11776 11777 } 11778 11779 // method id "dataproc.projects.regions.jobs.setIamPolicy": 11780 11781 type ProjectsRegionsJobsSetIamPolicyCall struct { 11782 s *Service 11783 resource string 11784 setiampolicyrequest *SetIamPolicyRequest 11785 urlParams_ gensupport.URLParams 11786 ctx_ context.Context 11787 header_ http.Header 11788 } 11789 11790 // SetIamPolicy: Sets the access control policy on the specified 11791 // resource. Replaces any existing policy.Can return NOT_FOUND, 11792 // INVALID_ARGUMENT, and PERMISSION_DENIED errors. 11793 // 11794 // - resource: REQUIRED: The resource for which the policy is being 11795 // specified. See the operation documentation for the appropriate 11796 // value for this field. 11797 func (r *ProjectsRegionsJobsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsJobsSetIamPolicyCall { 11798 c := &ProjectsRegionsJobsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11799 c.resource = resource 11800 c.setiampolicyrequest = setiampolicyrequest 11801 return c 11802 } 11803 11804 // Fields allows partial responses to be retrieved. See 11805 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11806 // for more information. 11807 func (c *ProjectsRegionsJobsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSetIamPolicyCall { 11808 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11809 return c 11810 } 11811 11812 // Context sets the context to be used in this call's Do method. Any 11813 // pending HTTP request will be aborted if the provided context is 11814 // canceled. 11815 func (c *ProjectsRegionsJobsSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsJobsSetIamPolicyCall { 11816 c.ctx_ = ctx 11817 return c 11818 } 11819 11820 // Header returns an http.Header that can be modified by the caller to 11821 // add HTTP headers to the request. 11822 func (c *ProjectsRegionsJobsSetIamPolicyCall) Header() http.Header { 11823 if c.header_ == nil { 11824 c.header_ = make(http.Header) 11825 } 11826 return c.header_ 11827 } 11828 11829 func (c *ProjectsRegionsJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 11830 reqHeaders := make(http.Header) 11831 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 11832 for k, v := range c.header_ { 11833 reqHeaders[k] = v 11834 } 11835 reqHeaders.Set("User-Agent", c.s.userAgent()) 11836 var body io.Reader = nil 11837 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 11838 if err != nil { 11839 return nil, err 11840 } 11841 reqHeaders.Set("Content-Type", "application/json") 11842 c.urlParams_.Set("alt", alt) 11843 c.urlParams_.Set("prettyPrint", "false") 11844 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 11845 urls += "?" + c.urlParams_.Encode() 11846 req, err := http.NewRequest("POST", urls, body) 11847 if err != nil { 11848 return nil, err 11849 } 11850 req.Header = reqHeaders 11851 googleapi.Expand(req.URL, map[string]string{ 11852 "resource": c.resource, 11853 }) 11854 return gensupport.SendRequest(c.ctx_, c.s.client, req) 11855 } 11856 11857 // Do executes the "dataproc.projects.regions.jobs.setIamPolicy" call. 11858 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 11859 // code is an error. Response headers are in either 11860 // *Policy.ServerResponse.Header or (if a response was returned at all) 11861 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 11862 // check whether the returned error was because http.StatusNotModified 11863 // was returned. 11864 func (c *ProjectsRegionsJobsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 11865 gensupport.SetOptions(c.urlParams_, opts...) 11866 res, err := c.doRequest("json") 11867 if res != nil && res.StatusCode == http.StatusNotModified { 11868 if res.Body != nil { 11869 res.Body.Close() 11870 } 11871 return nil, &googleapi.Error{ 11872 Code: res.StatusCode, 11873 Header: res.Header, 11874 } 11875 } 11876 if err != nil { 11877 return nil, err 11878 } 11879 defer googleapi.CloseBody(res) 11880 if err := googleapi.CheckResponse(res); err != nil { 11881 return nil, err 11882 } 11883 ret := &Policy{ 11884 ServerResponse: googleapi.ServerResponse{ 11885 Header: res.Header, 11886 HTTPStatusCode: res.StatusCode, 11887 }, 11888 } 11889 target := &ret 11890 if err := gensupport.DecodeResponse(target, res); err != nil { 11891 return nil, err 11892 } 11893 return ret, nil 11894 // { 11895 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 11896 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:setIamPolicy", 11897 // "httpMethod": "POST", 11898 // "id": "dataproc.projects.regions.jobs.setIamPolicy", 11899 // "parameterOrder": [ 11900 // "resource" 11901 // ], 11902 // "parameters": { 11903 // "resource": { 11904 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 11905 // "location": "path", 11906 // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$", 11907 // "required": true, 11908 // "type": "string" 11909 // } 11910 // }, 11911 // "path": "v1beta2/{+resource}:setIamPolicy", 11912 // "request": { 11913 // "$ref": "SetIamPolicyRequest" 11914 // }, 11915 // "response": { 11916 // "$ref": "Policy" 11917 // }, 11918 // "scopes": [ 11919 // "https://www.googleapis.com/auth/cloud-platform" 11920 // ] 11921 // } 11922 11923 } 11924 11925 // method id "dataproc.projects.regions.jobs.submit": 11926 11927 type ProjectsRegionsJobsSubmitCall struct { 11928 s *Service 11929 projectId string 11930 region string 11931 submitjobrequest *SubmitJobRequest 11932 urlParams_ gensupport.URLParams 11933 ctx_ context.Context 11934 header_ http.Header 11935 } 11936 11937 // Submit: Submits a job to a cluster. 11938 // 11939 // - projectId: The ID of the Google Cloud Platform project that the job 11940 // belongs to. 11941 // - region: The Dataproc region in which to handle the request. 11942 func (r *ProjectsRegionsJobsService) Submit(projectId string, region string, submitjobrequest *SubmitJobRequest) *ProjectsRegionsJobsSubmitCall { 11943 c := &ProjectsRegionsJobsSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)} 11944 c.projectId = projectId 11945 c.region = region 11946 c.submitjobrequest = submitjobrequest 11947 return c 11948 } 11949 11950 // Fields allows partial responses to be retrieved. See 11951 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 11952 // for more information. 11953 func (c *ProjectsRegionsJobsSubmitCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSubmitCall { 11954 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 11955 return c 11956 } 11957 11958 // Context sets the context to be used in this call's Do method. Any 11959 // pending HTTP request will be aborted if the provided context is 11960 // canceled. 11961 func (c *ProjectsRegionsJobsSubmitCall) Context(ctx context.Context) *ProjectsRegionsJobsSubmitCall { 11962 c.ctx_ = ctx 11963 return c 11964 } 11965 11966 // Header returns an http.Header that can be modified by the caller to 11967 // add HTTP headers to the request. 11968 func (c *ProjectsRegionsJobsSubmitCall) Header() http.Header { 11969 if c.header_ == nil { 11970 c.header_ = make(http.Header) 11971 } 11972 return c.header_ 11973 } 11974 11975 func (c *ProjectsRegionsJobsSubmitCall) doRequest(alt string) (*http.Response, error) { 11976 reqHeaders := make(http.Header) 11977 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 11978 for k, v := range c.header_ { 11979 reqHeaders[k] = v 11980 } 11981 reqHeaders.Set("User-Agent", c.s.userAgent()) 11982 var body io.Reader = nil 11983 body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitjobrequest) 11984 if err != nil { 11985 return nil, err 11986 } 11987 reqHeaders.Set("Content-Type", "application/json") 11988 c.urlParams_.Set("alt", alt) 11989 c.urlParams_.Set("prettyPrint", "false") 11990 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs:submit") 11991 urls += "?" + c.urlParams_.Encode() 11992 req, err := http.NewRequest("POST", urls, body) 11993 if err != nil { 11994 return nil, err 11995 } 11996 req.Header = reqHeaders 11997 googleapi.Expand(req.URL, map[string]string{ 11998 "projectId": c.projectId, 11999 "region": c.region, 12000 }) 12001 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12002 } 12003 12004 // Do executes the "dataproc.projects.regions.jobs.submit" call. 12005 // Exactly one of *Job or error will be non-nil. Any non-2xx status code 12006 // is an error. Response headers are in either 12007 // *Job.ServerResponse.Header or (if a response was returned at all) in 12008 // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check 12009 // whether the returned error was because http.StatusNotModified was 12010 // returned. 12011 func (c *ProjectsRegionsJobsSubmitCall) Do(opts ...googleapi.CallOption) (*Job, error) { 12012 gensupport.SetOptions(c.urlParams_, opts...) 12013 res, err := c.doRequest("json") 12014 if res != nil && res.StatusCode == http.StatusNotModified { 12015 if res.Body != nil { 12016 res.Body.Close() 12017 } 12018 return nil, &googleapi.Error{ 12019 Code: res.StatusCode, 12020 Header: res.Header, 12021 } 12022 } 12023 if err != nil { 12024 return nil, err 12025 } 12026 defer googleapi.CloseBody(res) 12027 if err := googleapi.CheckResponse(res); err != nil { 12028 return nil, err 12029 } 12030 ret := &Job{ 12031 ServerResponse: googleapi.ServerResponse{ 12032 Header: res.Header, 12033 HTTPStatusCode: res.StatusCode, 12034 }, 12035 } 12036 target := &ret 12037 if err := gensupport.DecodeResponse(target, res); err != nil { 12038 return nil, err 12039 } 12040 return ret, nil 12041 // { 12042 // "description": "Submits a job to a cluster.", 12043 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs:submit", 12044 // "httpMethod": "POST", 12045 // "id": "dataproc.projects.regions.jobs.submit", 12046 // "parameterOrder": [ 12047 // "projectId", 12048 // "region" 12049 // ], 12050 // "parameters": { 12051 // "projectId": { 12052 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 12053 // "location": "path", 12054 // "required": true, 12055 // "type": "string" 12056 // }, 12057 // "region": { 12058 // "description": "Required. The Dataproc region in which to handle the request.", 12059 // "location": "path", 12060 // "required": true, 12061 // "type": "string" 12062 // } 12063 // }, 12064 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs:submit", 12065 // "request": { 12066 // "$ref": "SubmitJobRequest" 12067 // }, 12068 // "response": { 12069 // "$ref": "Job" 12070 // }, 12071 // "scopes": [ 12072 // "https://www.googleapis.com/auth/cloud-platform" 12073 // ] 12074 // } 12075 12076 } 12077 12078 // method id "dataproc.projects.regions.jobs.submitAsOperation": 12079 12080 type ProjectsRegionsJobsSubmitAsOperationCall struct { 12081 s *Service 12082 projectId string 12083 region string 12084 submitjobrequest *SubmitJobRequest 12085 urlParams_ gensupport.URLParams 12086 ctx_ context.Context 12087 header_ http.Header 12088 } 12089 12090 // SubmitAsOperation: Submits job to a cluster. 12091 // 12092 // - projectId: The ID of the Google Cloud Platform project that the job 12093 // belongs to. 12094 // - region: The Dataproc region in which to handle the request. 12095 func (r *ProjectsRegionsJobsService) SubmitAsOperation(projectId string, region string, submitjobrequest *SubmitJobRequest) *ProjectsRegionsJobsSubmitAsOperationCall { 12096 c := &ProjectsRegionsJobsSubmitAsOperationCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12097 c.projectId = projectId 12098 c.region = region 12099 c.submitjobrequest = submitjobrequest 12100 return c 12101 } 12102 12103 // Fields allows partial responses to be retrieved. See 12104 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12105 // for more information. 12106 func (c *ProjectsRegionsJobsSubmitAsOperationCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSubmitAsOperationCall { 12107 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12108 return c 12109 } 12110 12111 // Context sets the context to be used in this call's Do method. Any 12112 // pending HTTP request will be aborted if the provided context is 12113 // canceled. 12114 func (c *ProjectsRegionsJobsSubmitAsOperationCall) Context(ctx context.Context) *ProjectsRegionsJobsSubmitAsOperationCall { 12115 c.ctx_ = ctx 12116 return c 12117 } 12118 12119 // Header returns an http.Header that can be modified by the caller to 12120 // add HTTP headers to the request. 12121 func (c *ProjectsRegionsJobsSubmitAsOperationCall) Header() http.Header { 12122 if c.header_ == nil { 12123 c.header_ = make(http.Header) 12124 } 12125 return c.header_ 12126 } 12127 12128 func (c *ProjectsRegionsJobsSubmitAsOperationCall) doRequest(alt string) (*http.Response, error) { 12129 reqHeaders := make(http.Header) 12130 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 12131 for k, v := range c.header_ { 12132 reqHeaders[k] = v 12133 } 12134 reqHeaders.Set("User-Agent", c.s.userAgent()) 12135 var body io.Reader = nil 12136 body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitjobrequest) 12137 if err != nil { 12138 return nil, err 12139 } 12140 reqHeaders.Set("Content-Type", "application/json") 12141 c.urlParams_.Set("alt", alt) 12142 c.urlParams_.Set("prettyPrint", "false") 12143 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs:submitAsOperation") 12144 urls += "?" + c.urlParams_.Encode() 12145 req, err := http.NewRequest("POST", urls, body) 12146 if err != nil { 12147 return nil, err 12148 } 12149 req.Header = reqHeaders 12150 googleapi.Expand(req.URL, map[string]string{ 12151 "projectId": c.projectId, 12152 "region": c.region, 12153 }) 12154 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12155 } 12156 12157 // Do executes the "dataproc.projects.regions.jobs.submitAsOperation" call. 12158 // Exactly one of *Operation or error will be non-nil. Any non-2xx 12159 // status code is an error. Response headers are in either 12160 // *Operation.ServerResponse.Header or (if a response was returned at 12161 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12162 // to check whether the returned error was because 12163 // http.StatusNotModified was returned. 12164 func (c *ProjectsRegionsJobsSubmitAsOperationCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 12165 gensupport.SetOptions(c.urlParams_, opts...) 12166 res, err := c.doRequest("json") 12167 if res != nil && res.StatusCode == http.StatusNotModified { 12168 if res.Body != nil { 12169 res.Body.Close() 12170 } 12171 return nil, &googleapi.Error{ 12172 Code: res.StatusCode, 12173 Header: res.Header, 12174 } 12175 } 12176 if err != nil { 12177 return nil, err 12178 } 12179 defer googleapi.CloseBody(res) 12180 if err := googleapi.CheckResponse(res); err != nil { 12181 return nil, err 12182 } 12183 ret := &Operation{ 12184 ServerResponse: googleapi.ServerResponse{ 12185 Header: res.Header, 12186 HTTPStatusCode: res.StatusCode, 12187 }, 12188 } 12189 target := &ret 12190 if err := gensupport.DecodeResponse(target, res); err != nil { 12191 return nil, err 12192 } 12193 return ret, nil 12194 // { 12195 // "description": "Submits job to a cluster.", 12196 // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs:submitAsOperation", 12197 // "httpMethod": "POST", 12198 // "id": "dataproc.projects.regions.jobs.submitAsOperation", 12199 // "parameterOrder": [ 12200 // "projectId", 12201 // "region" 12202 // ], 12203 // "parameters": { 12204 // "projectId": { 12205 // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.", 12206 // "location": "path", 12207 // "required": true, 12208 // "type": "string" 12209 // }, 12210 // "region": { 12211 // "description": "Required. The Dataproc region in which to handle the request.", 12212 // "location": "path", 12213 // "required": true, 12214 // "type": "string" 12215 // } 12216 // }, 12217 // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs:submitAsOperation", 12218 // "request": { 12219 // "$ref": "SubmitJobRequest" 12220 // }, 12221 // "response": { 12222 // "$ref": "Operation" 12223 // }, 12224 // "scopes": [ 12225 // "https://www.googleapis.com/auth/cloud-platform" 12226 // ] 12227 // } 12228 12229 } 12230 12231 // method id "dataproc.projects.regions.jobs.testIamPermissions": 12232 12233 type ProjectsRegionsJobsTestIamPermissionsCall struct { 12234 s *Service 12235 resource string 12236 testiampermissionsrequest *TestIamPermissionsRequest 12237 urlParams_ gensupport.URLParams 12238 ctx_ context.Context 12239 header_ http.Header 12240 } 12241 12242 // TestIamPermissions: Returns permissions that a caller has on the 12243 // specified resource. If the resource does not exist, this will return 12244 // an empty set of permissions, not a NOT_FOUND error.Note: This 12245 // operation is designed to be used for building permission-aware UIs 12246 // and command-line tools, not for authorization checking. This 12247 // operation may "fail open" without warning. 12248 // 12249 // - resource: REQUIRED: The resource for which the policy detail is 12250 // being requested. See the operation documentation for the 12251 // appropriate value for this field. 12252 func (r *ProjectsRegionsJobsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsJobsTestIamPermissionsCall { 12253 c := &ProjectsRegionsJobsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12254 c.resource = resource 12255 c.testiampermissionsrequest = testiampermissionsrequest 12256 return c 12257 } 12258 12259 // Fields allows partial responses to be retrieved. See 12260 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12261 // for more information. 12262 func (c *ProjectsRegionsJobsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsTestIamPermissionsCall { 12263 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12264 return c 12265 } 12266 12267 // Context sets the context to be used in this call's Do method. Any 12268 // pending HTTP request will be aborted if the provided context is 12269 // canceled. 12270 func (c *ProjectsRegionsJobsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsJobsTestIamPermissionsCall { 12271 c.ctx_ = ctx 12272 return c 12273 } 12274 12275 // Header returns an http.Header that can be modified by the caller to 12276 // add HTTP headers to the request. 12277 func (c *ProjectsRegionsJobsTestIamPermissionsCall) Header() http.Header { 12278 if c.header_ == nil { 12279 c.header_ = make(http.Header) 12280 } 12281 return c.header_ 12282 } 12283 12284 func (c *ProjectsRegionsJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 12285 reqHeaders := make(http.Header) 12286 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 12287 for k, v := range c.header_ { 12288 reqHeaders[k] = v 12289 } 12290 reqHeaders.Set("User-Agent", c.s.userAgent()) 12291 var body io.Reader = nil 12292 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 12293 if err != nil { 12294 return nil, err 12295 } 12296 reqHeaders.Set("Content-Type", "application/json") 12297 c.urlParams_.Set("alt", alt) 12298 c.urlParams_.Set("prettyPrint", "false") 12299 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 12300 urls += "?" + c.urlParams_.Encode() 12301 req, err := http.NewRequest("POST", urls, body) 12302 if err != nil { 12303 return nil, err 12304 } 12305 req.Header = reqHeaders 12306 googleapi.Expand(req.URL, map[string]string{ 12307 "resource": c.resource, 12308 }) 12309 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12310 } 12311 12312 // Do executes the "dataproc.projects.regions.jobs.testIamPermissions" call. 12313 // Exactly one of *TestIamPermissionsResponse or error will be non-nil. 12314 // Any non-2xx status code is an error. Response headers are in either 12315 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response 12316 // was returned at all) in error.(*googleapi.Error).Header. Use 12317 // googleapi.IsNotModified to check whether the returned error was 12318 // because http.StatusNotModified was returned. 12319 func (c *ProjectsRegionsJobsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 12320 gensupport.SetOptions(c.urlParams_, opts...) 12321 res, err := c.doRequest("json") 12322 if res != nil && res.StatusCode == http.StatusNotModified { 12323 if res.Body != nil { 12324 res.Body.Close() 12325 } 12326 return nil, &googleapi.Error{ 12327 Code: res.StatusCode, 12328 Header: res.Header, 12329 } 12330 } 12331 if err != nil { 12332 return nil, err 12333 } 12334 defer googleapi.CloseBody(res) 12335 if err := googleapi.CheckResponse(res); err != nil { 12336 return nil, err 12337 } 12338 ret := &TestIamPermissionsResponse{ 12339 ServerResponse: googleapi.ServerResponse{ 12340 Header: res.Header, 12341 HTTPStatusCode: res.StatusCode, 12342 }, 12343 } 12344 target := &ret 12345 if err := gensupport.DecodeResponse(target, res); err != nil { 12346 return nil, err 12347 } 12348 return ret, nil 12349 // { 12350 // "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.", 12351 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:testIamPermissions", 12352 // "httpMethod": "POST", 12353 // "id": "dataproc.projects.regions.jobs.testIamPermissions", 12354 // "parameterOrder": [ 12355 // "resource" 12356 // ], 12357 // "parameters": { 12358 // "resource": { 12359 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 12360 // "location": "path", 12361 // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$", 12362 // "required": true, 12363 // "type": "string" 12364 // } 12365 // }, 12366 // "path": "v1beta2/{+resource}:testIamPermissions", 12367 // "request": { 12368 // "$ref": "TestIamPermissionsRequest" 12369 // }, 12370 // "response": { 12371 // "$ref": "TestIamPermissionsResponse" 12372 // }, 12373 // "scopes": [ 12374 // "https://www.googleapis.com/auth/cloud-platform" 12375 // ] 12376 // } 12377 12378 } 12379 12380 // method id "dataproc.projects.regions.operations.cancel": 12381 12382 type ProjectsRegionsOperationsCancelCall struct { 12383 s *Service 12384 name string 12385 urlParams_ gensupport.URLParams 12386 ctx_ context.Context 12387 header_ http.Header 12388 } 12389 12390 // Cancel: Starts asynchronous cancellation on a long-running operation. 12391 // The server makes a best effort to cancel the operation, but success 12392 // is not guaranteed. If the server doesn't support this method, it 12393 // returns google.rpc.Code.UNIMPLEMENTED. Clients can use 12394 // Operations.GetOperation or other methods to check whether the 12395 // cancellation succeeded or whether the operation completed despite 12396 // cancellation. On successful cancellation, the operation is not 12397 // deleted; instead, it becomes an operation with an Operation.error 12398 // value with a google.rpc.Status.code of 1, corresponding to 12399 // Code.CANCELLED. 12400 // 12401 // - name: The name of the operation resource to be cancelled. 12402 func (r *ProjectsRegionsOperationsService) Cancel(name string) *ProjectsRegionsOperationsCancelCall { 12403 c := &ProjectsRegionsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12404 c.name = name 12405 return c 12406 } 12407 12408 // Fields allows partial responses to be retrieved. See 12409 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12410 // for more information. 12411 func (c *ProjectsRegionsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsCancelCall { 12412 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12413 return c 12414 } 12415 12416 // Context sets the context to be used in this call's Do method. Any 12417 // pending HTTP request will be aborted if the provided context is 12418 // canceled. 12419 func (c *ProjectsRegionsOperationsCancelCall) Context(ctx context.Context) *ProjectsRegionsOperationsCancelCall { 12420 c.ctx_ = ctx 12421 return c 12422 } 12423 12424 // Header returns an http.Header that can be modified by the caller to 12425 // add HTTP headers to the request. 12426 func (c *ProjectsRegionsOperationsCancelCall) Header() http.Header { 12427 if c.header_ == nil { 12428 c.header_ = make(http.Header) 12429 } 12430 return c.header_ 12431 } 12432 12433 func (c *ProjectsRegionsOperationsCancelCall) doRequest(alt string) (*http.Response, error) { 12434 reqHeaders := make(http.Header) 12435 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 12436 for k, v := range c.header_ { 12437 reqHeaders[k] = v 12438 } 12439 reqHeaders.Set("User-Agent", c.s.userAgent()) 12440 var body io.Reader = nil 12441 c.urlParams_.Set("alt", alt) 12442 c.urlParams_.Set("prettyPrint", "false") 12443 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:cancel") 12444 urls += "?" + c.urlParams_.Encode() 12445 req, err := http.NewRequest("POST", urls, body) 12446 if err != nil { 12447 return nil, err 12448 } 12449 req.Header = reqHeaders 12450 googleapi.Expand(req.URL, map[string]string{ 12451 "name": c.name, 12452 }) 12453 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12454 } 12455 12456 // Do executes the "dataproc.projects.regions.operations.cancel" call. 12457 // Exactly one of *Empty or error will be non-nil. Any non-2xx status 12458 // code is an error. Response headers are in either 12459 // *Empty.ServerResponse.Header or (if a response was returned at all) 12460 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12461 // check whether the returned error was because http.StatusNotModified 12462 // was returned. 12463 func (c *ProjectsRegionsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 12464 gensupport.SetOptions(c.urlParams_, opts...) 12465 res, err := c.doRequest("json") 12466 if res != nil && res.StatusCode == http.StatusNotModified { 12467 if res.Body != nil { 12468 res.Body.Close() 12469 } 12470 return nil, &googleapi.Error{ 12471 Code: res.StatusCode, 12472 Header: res.Header, 12473 } 12474 } 12475 if err != nil { 12476 return nil, err 12477 } 12478 defer googleapi.CloseBody(res) 12479 if err := googleapi.CheckResponse(res); err != nil { 12480 return nil, err 12481 } 12482 ret := &Empty{ 12483 ServerResponse: googleapi.ServerResponse{ 12484 Header: res.Header, 12485 HTTPStatusCode: res.StatusCode, 12486 }, 12487 } 12488 target := &ret 12489 if err := gensupport.DecodeResponse(target, res); err != nil { 12490 return nil, err 12491 } 12492 return ret, nil 12493 // { 12494 // "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.", 12495 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:cancel", 12496 // "httpMethod": "POST", 12497 // "id": "dataproc.projects.regions.operations.cancel", 12498 // "parameterOrder": [ 12499 // "name" 12500 // ], 12501 // "parameters": { 12502 // "name": { 12503 // "description": "The name of the operation resource to be cancelled.", 12504 // "location": "path", 12505 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 12506 // "required": true, 12507 // "type": "string" 12508 // } 12509 // }, 12510 // "path": "v1beta2/{+name}:cancel", 12511 // "response": { 12512 // "$ref": "Empty" 12513 // }, 12514 // "scopes": [ 12515 // "https://www.googleapis.com/auth/cloud-platform" 12516 // ] 12517 // } 12518 12519 } 12520 12521 // method id "dataproc.projects.regions.operations.delete": 12522 12523 type ProjectsRegionsOperationsDeleteCall struct { 12524 s *Service 12525 name string 12526 urlParams_ gensupport.URLParams 12527 ctx_ context.Context 12528 header_ http.Header 12529 } 12530 12531 // Delete: Deletes a long-running operation. This method indicates that 12532 // the client is no longer interested in the operation result. It does 12533 // not cancel the operation. If the server doesn't support this method, 12534 // it returns google.rpc.Code.UNIMPLEMENTED. 12535 // 12536 // - name: The name of the operation resource to be deleted. 12537 func (r *ProjectsRegionsOperationsService) Delete(name string) *ProjectsRegionsOperationsDeleteCall { 12538 c := &ProjectsRegionsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12539 c.name = name 12540 return c 12541 } 12542 12543 // Fields allows partial responses to be retrieved. See 12544 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12545 // for more information. 12546 func (c *ProjectsRegionsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsDeleteCall { 12547 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12548 return c 12549 } 12550 12551 // Context sets the context to be used in this call's Do method. Any 12552 // pending HTTP request will be aborted if the provided context is 12553 // canceled. 12554 func (c *ProjectsRegionsOperationsDeleteCall) Context(ctx context.Context) *ProjectsRegionsOperationsDeleteCall { 12555 c.ctx_ = ctx 12556 return c 12557 } 12558 12559 // Header returns an http.Header that can be modified by the caller to 12560 // add HTTP headers to the request. 12561 func (c *ProjectsRegionsOperationsDeleteCall) Header() http.Header { 12562 if c.header_ == nil { 12563 c.header_ = make(http.Header) 12564 } 12565 return c.header_ 12566 } 12567 12568 func (c *ProjectsRegionsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) { 12569 reqHeaders := make(http.Header) 12570 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 12571 for k, v := range c.header_ { 12572 reqHeaders[k] = v 12573 } 12574 reqHeaders.Set("User-Agent", c.s.userAgent()) 12575 var body io.Reader = nil 12576 c.urlParams_.Set("alt", alt) 12577 c.urlParams_.Set("prettyPrint", "false") 12578 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 12579 urls += "?" + c.urlParams_.Encode() 12580 req, err := http.NewRequest("DELETE", urls, body) 12581 if err != nil { 12582 return nil, err 12583 } 12584 req.Header = reqHeaders 12585 googleapi.Expand(req.URL, map[string]string{ 12586 "name": c.name, 12587 }) 12588 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12589 } 12590 12591 // Do executes the "dataproc.projects.regions.operations.delete" call. 12592 // Exactly one of *Empty or error will be non-nil. Any non-2xx status 12593 // code is an error. Response headers are in either 12594 // *Empty.ServerResponse.Header or (if a response was returned at all) 12595 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12596 // check whether the returned error was because http.StatusNotModified 12597 // was returned. 12598 func (c *ProjectsRegionsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 12599 gensupport.SetOptions(c.urlParams_, opts...) 12600 res, err := c.doRequest("json") 12601 if res != nil && res.StatusCode == http.StatusNotModified { 12602 if res.Body != nil { 12603 res.Body.Close() 12604 } 12605 return nil, &googleapi.Error{ 12606 Code: res.StatusCode, 12607 Header: res.Header, 12608 } 12609 } 12610 if err != nil { 12611 return nil, err 12612 } 12613 defer googleapi.CloseBody(res) 12614 if err := googleapi.CheckResponse(res); err != nil { 12615 return nil, err 12616 } 12617 ret := &Empty{ 12618 ServerResponse: googleapi.ServerResponse{ 12619 Header: res.Header, 12620 HTTPStatusCode: res.StatusCode, 12621 }, 12622 } 12623 target := &ret 12624 if err := gensupport.DecodeResponse(target, res); err != nil { 12625 return nil, err 12626 } 12627 return ret, nil 12628 // { 12629 // "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.", 12630 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}", 12631 // "httpMethod": "DELETE", 12632 // "id": "dataproc.projects.regions.operations.delete", 12633 // "parameterOrder": [ 12634 // "name" 12635 // ], 12636 // "parameters": { 12637 // "name": { 12638 // "description": "The name of the operation resource to be deleted.", 12639 // "location": "path", 12640 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 12641 // "required": true, 12642 // "type": "string" 12643 // } 12644 // }, 12645 // "path": "v1beta2/{+name}", 12646 // "response": { 12647 // "$ref": "Empty" 12648 // }, 12649 // "scopes": [ 12650 // "https://www.googleapis.com/auth/cloud-platform" 12651 // ] 12652 // } 12653 12654 } 12655 12656 // method id "dataproc.projects.regions.operations.get": 12657 12658 type ProjectsRegionsOperationsGetCall struct { 12659 s *Service 12660 name string 12661 urlParams_ gensupport.URLParams 12662 ifNoneMatch_ string 12663 ctx_ context.Context 12664 header_ http.Header 12665 } 12666 12667 // Get: Gets the latest state of a long-running operation. Clients can 12668 // use this method to poll the operation result at intervals as 12669 // recommended by the API service. 12670 // 12671 // - name: The name of the operation resource. 12672 func (r *ProjectsRegionsOperationsService) Get(name string) *ProjectsRegionsOperationsGetCall { 12673 c := &ProjectsRegionsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12674 c.name = name 12675 return c 12676 } 12677 12678 // Fields allows partial responses to be retrieved. See 12679 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12680 // for more information. 12681 func (c *ProjectsRegionsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsGetCall { 12682 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12683 return c 12684 } 12685 12686 // IfNoneMatch sets the optional parameter which makes the operation 12687 // fail if the object's ETag matches the given value. This is useful for 12688 // getting updates only after the object has changed since the last 12689 // request. Use googleapi.IsNotModified to check whether the response 12690 // error from Do is the result of In-None-Match. 12691 func (c *ProjectsRegionsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsGetCall { 12692 c.ifNoneMatch_ = entityTag 12693 return c 12694 } 12695 12696 // Context sets the context to be used in this call's Do method. Any 12697 // pending HTTP request will be aborted if the provided context is 12698 // canceled. 12699 func (c *ProjectsRegionsOperationsGetCall) Context(ctx context.Context) *ProjectsRegionsOperationsGetCall { 12700 c.ctx_ = ctx 12701 return c 12702 } 12703 12704 // Header returns an http.Header that can be modified by the caller to 12705 // add HTTP headers to the request. 12706 func (c *ProjectsRegionsOperationsGetCall) Header() http.Header { 12707 if c.header_ == nil { 12708 c.header_ = make(http.Header) 12709 } 12710 return c.header_ 12711 } 12712 12713 func (c *ProjectsRegionsOperationsGetCall) doRequest(alt string) (*http.Response, error) { 12714 reqHeaders := make(http.Header) 12715 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 12716 for k, v := range c.header_ { 12717 reqHeaders[k] = v 12718 } 12719 reqHeaders.Set("User-Agent", c.s.userAgent()) 12720 if c.ifNoneMatch_ != "" { 12721 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12722 } 12723 var body io.Reader = nil 12724 c.urlParams_.Set("alt", alt) 12725 c.urlParams_.Set("prettyPrint", "false") 12726 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 12727 urls += "?" + c.urlParams_.Encode() 12728 req, err := http.NewRequest("GET", urls, body) 12729 if err != nil { 12730 return nil, err 12731 } 12732 req.Header = reqHeaders 12733 googleapi.Expand(req.URL, map[string]string{ 12734 "name": c.name, 12735 }) 12736 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12737 } 12738 12739 // Do executes the "dataproc.projects.regions.operations.get" call. 12740 // Exactly one of *Operation or error will be non-nil. Any non-2xx 12741 // status code is an error. Response headers are in either 12742 // *Operation.ServerResponse.Header or (if a response was returned at 12743 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 12744 // to check whether the returned error was because 12745 // http.StatusNotModified was returned. 12746 func (c *ProjectsRegionsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 12747 gensupport.SetOptions(c.urlParams_, opts...) 12748 res, err := c.doRequest("json") 12749 if res != nil && res.StatusCode == http.StatusNotModified { 12750 if res.Body != nil { 12751 res.Body.Close() 12752 } 12753 return nil, &googleapi.Error{ 12754 Code: res.StatusCode, 12755 Header: res.Header, 12756 } 12757 } 12758 if err != nil { 12759 return nil, err 12760 } 12761 defer googleapi.CloseBody(res) 12762 if err := googleapi.CheckResponse(res); err != nil { 12763 return nil, err 12764 } 12765 ret := &Operation{ 12766 ServerResponse: googleapi.ServerResponse{ 12767 Header: res.Header, 12768 HTTPStatusCode: res.StatusCode, 12769 }, 12770 } 12771 target := &ret 12772 if err := gensupport.DecodeResponse(target, res); err != nil { 12773 return nil, err 12774 } 12775 return ret, nil 12776 // { 12777 // "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.", 12778 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}", 12779 // "httpMethod": "GET", 12780 // "id": "dataproc.projects.regions.operations.get", 12781 // "parameterOrder": [ 12782 // "name" 12783 // ], 12784 // "parameters": { 12785 // "name": { 12786 // "description": "The name of the operation resource.", 12787 // "location": "path", 12788 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 12789 // "required": true, 12790 // "type": "string" 12791 // } 12792 // }, 12793 // "path": "v1beta2/{+name}", 12794 // "response": { 12795 // "$ref": "Operation" 12796 // }, 12797 // "scopes": [ 12798 // "https://www.googleapis.com/auth/cloud-platform" 12799 // ] 12800 // } 12801 12802 } 12803 12804 // method id "dataproc.projects.regions.operations.getIamPolicy": 12805 12806 type ProjectsRegionsOperationsGetIamPolicyCall struct { 12807 s *Service 12808 resource string 12809 urlParams_ gensupport.URLParams 12810 ifNoneMatch_ string 12811 ctx_ context.Context 12812 header_ http.Header 12813 } 12814 12815 // GetIamPolicy: Gets the access control policy for a resource. Returns 12816 // an empty policy if the resource exists and does not have a policy 12817 // set. 12818 // 12819 // - resource: REQUIRED: The resource for which the policy is being 12820 // requested. See the operation documentation for the appropriate 12821 // value for this field. 12822 func (r *ProjectsRegionsOperationsService) GetIamPolicy(resource string) *ProjectsRegionsOperationsGetIamPolicyCall { 12823 c := &ProjectsRegionsOperationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12824 c.resource = resource 12825 return c 12826 } 12827 12828 // OptionsRequestedPolicyVersion sets the optional parameter 12829 // "options.requestedPolicyVersion": The policy format version to be 12830 // returned.Valid values are 0, 1, and 3. Requests specifying an invalid 12831 // value will be rejected.Requests for policies with any conditional 12832 // bindings must specify version 3. Policies without any conditional 12833 // bindings may specify any valid value or leave the field unset.To 12834 // learn which resources support conditions in their IAM policies, see 12835 // the IAM documentation 12836 // (https://cloud.google.com/iam/help/conditions/resource-policies). 12837 func (c *ProjectsRegionsOperationsGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsRegionsOperationsGetIamPolicyCall { 12838 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 12839 return c 12840 } 12841 12842 // Fields allows partial responses to be retrieved. See 12843 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 12844 // for more information. 12845 func (c *ProjectsRegionsOperationsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsGetIamPolicyCall { 12846 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 12847 return c 12848 } 12849 12850 // IfNoneMatch sets the optional parameter which makes the operation 12851 // fail if the object's ETag matches the given value. This is useful for 12852 // getting updates only after the object has changed since the last 12853 // request. Use googleapi.IsNotModified to check whether the response 12854 // error from Do is the result of In-None-Match. 12855 func (c *ProjectsRegionsOperationsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsGetIamPolicyCall { 12856 c.ifNoneMatch_ = entityTag 12857 return c 12858 } 12859 12860 // Context sets the context to be used in this call's Do method. Any 12861 // pending HTTP request will be aborted if the provided context is 12862 // canceled. 12863 func (c *ProjectsRegionsOperationsGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsOperationsGetIamPolicyCall { 12864 c.ctx_ = ctx 12865 return c 12866 } 12867 12868 // Header returns an http.Header that can be modified by the caller to 12869 // add HTTP headers to the request. 12870 func (c *ProjectsRegionsOperationsGetIamPolicyCall) Header() http.Header { 12871 if c.header_ == nil { 12872 c.header_ = make(http.Header) 12873 } 12874 return c.header_ 12875 } 12876 12877 func (c *ProjectsRegionsOperationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 12878 reqHeaders := make(http.Header) 12879 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 12880 for k, v := range c.header_ { 12881 reqHeaders[k] = v 12882 } 12883 reqHeaders.Set("User-Agent", c.s.userAgent()) 12884 if c.ifNoneMatch_ != "" { 12885 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 12886 } 12887 var body io.Reader = nil 12888 c.urlParams_.Set("alt", alt) 12889 c.urlParams_.Set("prettyPrint", "false") 12890 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 12891 urls += "?" + c.urlParams_.Encode() 12892 req, err := http.NewRequest("GET", urls, body) 12893 if err != nil { 12894 return nil, err 12895 } 12896 req.Header = reqHeaders 12897 googleapi.Expand(req.URL, map[string]string{ 12898 "resource": c.resource, 12899 }) 12900 return gensupport.SendRequest(c.ctx_, c.s.client, req) 12901 } 12902 12903 // Do executes the "dataproc.projects.regions.operations.getIamPolicy" call. 12904 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 12905 // code is an error. Response headers are in either 12906 // *Policy.ServerResponse.Header or (if a response was returned at all) 12907 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 12908 // check whether the returned error was because http.StatusNotModified 12909 // was returned. 12910 func (c *ProjectsRegionsOperationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 12911 gensupport.SetOptions(c.urlParams_, opts...) 12912 res, err := c.doRequest("json") 12913 if res != nil && res.StatusCode == http.StatusNotModified { 12914 if res.Body != nil { 12915 res.Body.Close() 12916 } 12917 return nil, &googleapi.Error{ 12918 Code: res.StatusCode, 12919 Header: res.Header, 12920 } 12921 } 12922 if err != nil { 12923 return nil, err 12924 } 12925 defer googleapi.CloseBody(res) 12926 if err := googleapi.CheckResponse(res); err != nil { 12927 return nil, err 12928 } 12929 ret := &Policy{ 12930 ServerResponse: googleapi.ServerResponse{ 12931 Header: res.Header, 12932 HTTPStatusCode: res.StatusCode, 12933 }, 12934 } 12935 target := &ret 12936 if err := gensupport.DecodeResponse(target, res); err != nil { 12937 return nil, err 12938 } 12939 return ret, nil 12940 // { 12941 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 12942 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:getIamPolicy", 12943 // "httpMethod": "GET", 12944 // "id": "dataproc.projects.regions.operations.getIamPolicy", 12945 // "parameterOrder": [ 12946 // "resource" 12947 // ], 12948 // "parameters": { 12949 // "options.requestedPolicyVersion": { 12950 // "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).", 12951 // "format": "int32", 12952 // "location": "query", 12953 // "type": "integer" 12954 // }, 12955 // "resource": { 12956 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 12957 // "location": "path", 12958 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 12959 // "required": true, 12960 // "type": "string" 12961 // } 12962 // }, 12963 // "path": "v1beta2/{+resource}:getIamPolicy", 12964 // "response": { 12965 // "$ref": "Policy" 12966 // }, 12967 // "scopes": [ 12968 // "https://www.googleapis.com/auth/cloud-platform" 12969 // ] 12970 // } 12971 12972 } 12973 12974 // method id "dataproc.projects.regions.operations.list": 12975 12976 type ProjectsRegionsOperationsListCall struct { 12977 s *Service 12978 name string 12979 urlParams_ gensupport.URLParams 12980 ifNoneMatch_ string 12981 ctx_ context.Context 12982 header_ http.Header 12983 } 12984 12985 // List: Lists operations that match the specified filter in the 12986 // request. If the server doesn't support this method, it returns 12987 // UNIMPLEMENTED.NOTE: the name binding allows API services to override 12988 // the binding to use different resource name schemes, such as 12989 // users/*/operations. To override the binding, API services can add a 12990 // binding such as "/v1/{name=users/*}/operations" to their service 12991 // configuration. For backwards compatibility, the default name includes 12992 // the operations collection id, however overriding users must ensure 12993 // the name binding is the parent resource, without the operations 12994 // collection id. 12995 // 12996 // - name: The name of the operation's parent resource. 12997 func (r *ProjectsRegionsOperationsService) List(name string) *ProjectsRegionsOperationsListCall { 12998 c := &ProjectsRegionsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 12999 c.name = name 13000 return c 13001 } 13002 13003 // Filter sets the optional parameter "filter": The standard list 13004 // filter. 13005 func (c *ProjectsRegionsOperationsListCall) Filter(filter string) *ProjectsRegionsOperationsListCall { 13006 c.urlParams_.Set("filter", filter) 13007 return c 13008 } 13009 13010 // PageSize sets the optional parameter "pageSize": The standard list 13011 // page size. 13012 func (c *ProjectsRegionsOperationsListCall) PageSize(pageSize int64) *ProjectsRegionsOperationsListCall { 13013 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 13014 return c 13015 } 13016 13017 // PageToken sets the optional parameter "pageToken": The standard list 13018 // page token. 13019 func (c *ProjectsRegionsOperationsListCall) PageToken(pageToken string) *ProjectsRegionsOperationsListCall { 13020 c.urlParams_.Set("pageToken", pageToken) 13021 return c 13022 } 13023 13024 // Fields allows partial responses to be retrieved. See 13025 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13026 // for more information. 13027 func (c *ProjectsRegionsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsListCall { 13028 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13029 return c 13030 } 13031 13032 // IfNoneMatch sets the optional parameter which makes the operation 13033 // fail if the object's ETag matches the given value. This is useful for 13034 // getting updates only after the object has changed since the last 13035 // request. Use googleapi.IsNotModified to check whether the response 13036 // error from Do is the result of In-None-Match. 13037 func (c *ProjectsRegionsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsListCall { 13038 c.ifNoneMatch_ = entityTag 13039 return c 13040 } 13041 13042 // Context sets the context to be used in this call's Do method. Any 13043 // pending HTTP request will be aborted if the provided context is 13044 // canceled. 13045 func (c *ProjectsRegionsOperationsListCall) Context(ctx context.Context) *ProjectsRegionsOperationsListCall { 13046 c.ctx_ = ctx 13047 return c 13048 } 13049 13050 // Header returns an http.Header that can be modified by the caller to 13051 // add HTTP headers to the request. 13052 func (c *ProjectsRegionsOperationsListCall) Header() http.Header { 13053 if c.header_ == nil { 13054 c.header_ = make(http.Header) 13055 } 13056 return c.header_ 13057 } 13058 13059 func (c *ProjectsRegionsOperationsListCall) doRequest(alt string) (*http.Response, error) { 13060 reqHeaders := make(http.Header) 13061 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 13062 for k, v := range c.header_ { 13063 reqHeaders[k] = v 13064 } 13065 reqHeaders.Set("User-Agent", c.s.userAgent()) 13066 if c.ifNoneMatch_ != "" { 13067 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13068 } 13069 var body io.Reader = nil 13070 c.urlParams_.Set("alt", alt) 13071 c.urlParams_.Set("prettyPrint", "false") 13072 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 13073 urls += "?" + c.urlParams_.Encode() 13074 req, err := http.NewRequest("GET", urls, body) 13075 if err != nil { 13076 return nil, err 13077 } 13078 req.Header = reqHeaders 13079 googleapi.Expand(req.URL, map[string]string{ 13080 "name": c.name, 13081 }) 13082 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13083 } 13084 13085 // Do executes the "dataproc.projects.regions.operations.list" call. 13086 // Exactly one of *ListOperationsResponse or error will be non-nil. Any 13087 // non-2xx status code is an error. Response headers are in either 13088 // *ListOperationsResponse.ServerResponse.Header or (if a response was 13089 // returned at all) in error.(*googleapi.Error).Header. Use 13090 // googleapi.IsNotModified to check whether the returned error was 13091 // because http.StatusNotModified was returned. 13092 func (c *ProjectsRegionsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) { 13093 gensupport.SetOptions(c.urlParams_, opts...) 13094 res, err := c.doRequest("json") 13095 if res != nil && res.StatusCode == http.StatusNotModified { 13096 if res.Body != nil { 13097 res.Body.Close() 13098 } 13099 return nil, &googleapi.Error{ 13100 Code: res.StatusCode, 13101 Header: res.Header, 13102 } 13103 } 13104 if err != nil { 13105 return nil, err 13106 } 13107 defer googleapi.CloseBody(res) 13108 if err := googleapi.CheckResponse(res); err != nil { 13109 return nil, err 13110 } 13111 ret := &ListOperationsResponse{ 13112 ServerResponse: googleapi.ServerResponse{ 13113 Header: res.Header, 13114 HTTPStatusCode: res.StatusCode, 13115 }, 13116 } 13117 target := &ret 13118 if err := gensupport.DecodeResponse(target, res); err != nil { 13119 return nil, err 13120 } 13121 return ret, nil 13122 // { 13123 // "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.", 13124 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations", 13125 // "httpMethod": "GET", 13126 // "id": "dataproc.projects.regions.operations.list", 13127 // "parameterOrder": [ 13128 // "name" 13129 // ], 13130 // "parameters": { 13131 // "filter": { 13132 // "description": "The standard list filter.", 13133 // "location": "query", 13134 // "type": "string" 13135 // }, 13136 // "name": { 13137 // "description": "The name of the operation's parent resource.", 13138 // "location": "path", 13139 // "pattern": "^projects/[^/]+/regions/[^/]+/operations$", 13140 // "required": true, 13141 // "type": "string" 13142 // }, 13143 // "pageSize": { 13144 // "description": "The standard list page size.", 13145 // "format": "int32", 13146 // "location": "query", 13147 // "type": "integer" 13148 // }, 13149 // "pageToken": { 13150 // "description": "The standard list page token.", 13151 // "location": "query", 13152 // "type": "string" 13153 // } 13154 // }, 13155 // "path": "v1beta2/{+name}", 13156 // "response": { 13157 // "$ref": "ListOperationsResponse" 13158 // }, 13159 // "scopes": [ 13160 // "https://www.googleapis.com/auth/cloud-platform" 13161 // ] 13162 // } 13163 13164 } 13165 13166 // Pages invokes f for each page of results. 13167 // A non-nil error returned from f will halt the iteration. 13168 // The provided context supersedes any context provided to the Context method. 13169 func (c *ProjectsRegionsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error { 13170 c.ctx_ = ctx 13171 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 13172 for { 13173 x, err := c.Do() 13174 if err != nil { 13175 return err 13176 } 13177 if err := f(x); err != nil { 13178 return err 13179 } 13180 if x.NextPageToken == "" { 13181 return nil 13182 } 13183 c.PageToken(x.NextPageToken) 13184 } 13185 } 13186 13187 // method id "dataproc.projects.regions.operations.setIamPolicy": 13188 13189 type ProjectsRegionsOperationsSetIamPolicyCall struct { 13190 s *Service 13191 resource string 13192 setiampolicyrequest *SetIamPolicyRequest 13193 urlParams_ gensupport.URLParams 13194 ctx_ context.Context 13195 header_ http.Header 13196 } 13197 13198 // SetIamPolicy: Sets the access control policy on the specified 13199 // resource. Replaces any existing policy.Can return NOT_FOUND, 13200 // INVALID_ARGUMENT, and PERMISSION_DENIED errors. 13201 // 13202 // - resource: REQUIRED: The resource for which the policy is being 13203 // specified. See the operation documentation for the appropriate 13204 // value for this field. 13205 func (r *ProjectsRegionsOperationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsOperationsSetIamPolicyCall { 13206 c := &ProjectsRegionsOperationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13207 c.resource = resource 13208 c.setiampolicyrequest = setiampolicyrequest 13209 return c 13210 } 13211 13212 // Fields allows partial responses to be retrieved. See 13213 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13214 // for more information. 13215 func (c *ProjectsRegionsOperationsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsSetIamPolicyCall { 13216 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13217 return c 13218 } 13219 13220 // Context sets the context to be used in this call's Do method. Any 13221 // pending HTTP request will be aborted if the provided context is 13222 // canceled. 13223 func (c *ProjectsRegionsOperationsSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsOperationsSetIamPolicyCall { 13224 c.ctx_ = ctx 13225 return c 13226 } 13227 13228 // Header returns an http.Header that can be modified by the caller to 13229 // add HTTP headers to the request. 13230 func (c *ProjectsRegionsOperationsSetIamPolicyCall) Header() http.Header { 13231 if c.header_ == nil { 13232 c.header_ = make(http.Header) 13233 } 13234 return c.header_ 13235 } 13236 13237 func (c *ProjectsRegionsOperationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 13238 reqHeaders := make(http.Header) 13239 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 13240 for k, v := range c.header_ { 13241 reqHeaders[k] = v 13242 } 13243 reqHeaders.Set("User-Agent", c.s.userAgent()) 13244 var body io.Reader = nil 13245 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 13246 if err != nil { 13247 return nil, err 13248 } 13249 reqHeaders.Set("Content-Type", "application/json") 13250 c.urlParams_.Set("alt", alt) 13251 c.urlParams_.Set("prettyPrint", "false") 13252 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 13253 urls += "?" + c.urlParams_.Encode() 13254 req, err := http.NewRequest("POST", urls, body) 13255 if err != nil { 13256 return nil, err 13257 } 13258 req.Header = reqHeaders 13259 googleapi.Expand(req.URL, map[string]string{ 13260 "resource": c.resource, 13261 }) 13262 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13263 } 13264 13265 // Do executes the "dataproc.projects.regions.operations.setIamPolicy" call. 13266 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 13267 // code is an error. Response headers are in either 13268 // *Policy.ServerResponse.Header or (if a response was returned at all) 13269 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13270 // check whether the returned error was because http.StatusNotModified 13271 // was returned. 13272 func (c *ProjectsRegionsOperationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 13273 gensupport.SetOptions(c.urlParams_, opts...) 13274 res, err := c.doRequest("json") 13275 if res != nil && res.StatusCode == http.StatusNotModified { 13276 if res.Body != nil { 13277 res.Body.Close() 13278 } 13279 return nil, &googleapi.Error{ 13280 Code: res.StatusCode, 13281 Header: res.Header, 13282 } 13283 } 13284 if err != nil { 13285 return nil, err 13286 } 13287 defer googleapi.CloseBody(res) 13288 if err := googleapi.CheckResponse(res); err != nil { 13289 return nil, err 13290 } 13291 ret := &Policy{ 13292 ServerResponse: googleapi.ServerResponse{ 13293 Header: res.Header, 13294 HTTPStatusCode: res.StatusCode, 13295 }, 13296 } 13297 target := &ret 13298 if err := gensupport.DecodeResponse(target, res); err != nil { 13299 return nil, err 13300 } 13301 return ret, nil 13302 // { 13303 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 13304 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:setIamPolicy", 13305 // "httpMethod": "POST", 13306 // "id": "dataproc.projects.regions.operations.setIamPolicy", 13307 // "parameterOrder": [ 13308 // "resource" 13309 // ], 13310 // "parameters": { 13311 // "resource": { 13312 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 13313 // "location": "path", 13314 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 13315 // "required": true, 13316 // "type": "string" 13317 // } 13318 // }, 13319 // "path": "v1beta2/{+resource}:setIamPolicy", 13320 // "request": { 13321 // "$ref": "SetIamPolicyRequest" 13322 // }, 13323 // "response": { 13324 // "$ref": "Policy" 13325 // }, 13326 // "scopes": [ 13327 // "https://www.googleapis.com/auth/cloud-platform" 13328 // ] 13329 // } 13330 13331 } 13332 13333 // method id "dataproc.projects.regions.operations.testIamPermissions": 13334 13335 type ProjectsRegionsOperationsTestIamPermissionsCall struct { 13336 s *Service 13337 resource string 13338 testiampermissionsrequest *TestIamPermissionsRequest 13339 urlParams_ gensupport.URLParams 13340 ctx_ context.Context 13341 header_ http.Header 13342 } 13343 13344 // TestIamPermissions: Returns permissions that a caller has on the 13345 // specified resource. If the resource does not exist, this will return 13346 // an empty set of permissions, not a NOT_FOUND error.Note: This 13347 // operation is designed to be used for building permission-aware UIs 13348 // and command-line tools, not for authorization checking. This 13349 // operation may "fail open" without warning. 13350 // 13351 // - resource: REQUIRED: The resource for which the policy detail is 13352 // being requested. See the operation documentation for the 13353 // appropriate value for this field. 13354 func (r *ProjectsRegionsOperationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsOperationsTestIamPermissionsCall { 13355 c := &ProjectsRegionsOperationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13356 c.resource = resource 13357 c.testiampermissionsrequest = testiampermissionsrequest 13358 return c 13359 } 13360 13361 // Fields allows partial responses to be retrieved. See 13362 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13363 // for more information. 13364 func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsTestIamPermissionsCall { 13365 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13366 return c 13367 } 13368 13369 // Context sets the context to be used in this call's Do method. Any 13370 // pending HTTP request will be aborted if the provided context is 13371 // canceled. 13372 func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsOperationsTestIamPermissionsCall { 13373 c.ctx_ = ctx 13374 return c 13375 } 13376 13377 // Header returns an http.Header that can be modified by the caller to 13378 // add HTTP headers to the request. 13379 func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Header() http.Header { 13380 if c.header_ == nil { 13381 c.header_ = make(http.Header) 13382 } 13383 return c.header_ 13384 } 13385 13386 func (c *ProjectsRegionsOperationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 13387 reqHeaders := make(http.Header) 13388 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 13389 for k, v := range c.header_ { 13390 reqHeaders[k] = v 13391 } 13392 reqHeaders.Set("User-Agent", c.s.userAgent()) 13393 var body io.Reader = nil 13394 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 13395 if err != nil { 13396 return nil, err 13397 } 13398 reqHeaders.Set("Content-Type", "application/json") 13399 c.urlParams_.Set("alt", alt) 13400 c.urlParams_.Set("prettyPrint", "false") 13401 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 13402 urls += "?" + c.urlParams_.Encode() 13403 req, err := http.NewRequest("POST", urls, body) 13404 if err != nil { 13405 return nil, err 13406 } 13407 req.Header = reqHeaders 13408 googleapi.Expand(req.URL, map[string]string{ 13409 "resource": c.resource, 13410 }) 13411 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13412 } 13413 13414 // Do executes the "dataproc.projects.regions.operations.testIamPermissions" call. 13415 // Exactly one of *TestIamPermissionsResponse or error will be non-nil. 13416 // Any non-2xx status code is an error. Response headers are in either 13417 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response 13418 // was returned at all) in error.(*googleapi.Error).Header. Use 13419 // googleapi.IsNotModified to check whether the returned error was 13420 // because http.StatusNotModified was returned. 13421 func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 13422 gensupport.SetOptions(c.urlParams_, opts...) 13423 res, err := c.doRequest("json") 13424 if res != nil && res.StatusCode == http.StatusNotModified { 13425 if res.Body != nil { 13426 res.Body.Close() 13427 } 13428 return nil, &googleapi.Error{ 13429 Code: res.StatusCode, 13430 Header: res.Header, 13431 } 13432 } 13433 if err != nil { 13434 return nil, err 13435 } 13436 defer googleapi.CloseBody(res) 13437 if err := googleapi.CheckResponse(res); err != nil { 13438 return nil, err 13439 } 13440 ret := &TestIamPermissionsResponse{ 13441 ServerResponse: googleapi.ServerResponse{ 13442 Header: res.Header, 13443 HTTPStatusCode: res.StatusCode, 13444 }, 13445 } 13446 target := &ret 13447 if err := gensupport.DecodeResponse(target, res); err != nil { 13448 return nil, err 13449 } 13450 return ret, nil 13451 // { 13452 // "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.", 13453 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:testIamPermissions", 13454 // "httpMethod": "POST", 13455 // "id": "dataproc.projects.regions.operations.testIamPermissions", 13456 // "parameterOrder": [ 13457 // "resource" 13458 // ], 13459 // "parameters": { 13460 // "resource": { 13461 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 13462 // "location": "path", 13463 // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$", 13464 // "required": true, 13465 // "type": "string" 13466 // } 13467 // }, 13468 // "path": "v1beta2/{+resource}:testIamPermissions", 13469 // "request": { 13470 // "$ref": "TestIamPermissionsRequest" 13471 // }, 13472 // "response": { 13473 // "$ref": "TestIamPermissionsResponse" 13474 // }, 13475 // "scopes": [ 13476 // "https://www.googleapis.com/auth/cloud-platform" 13477 // ] 13478 // } 13479 13480 } 13481 13482 // method id "dataproc.projects.regions.workflowTemplates.create": 13483 13484 type ProjectsRegionsWorkflowTemplatesCreateCall struct { 13485 s *Service 13486 parent string 13487 workflowtemplate *WorkflowTemplate 13488 urlParams_ gensupport.URLParams 13489 ctx_ context.Context 13490 header_ http.Header 13491 } 13492 13493 // Create: Creates new workflow template. 13494 // 13495 // - parent: The resource name of the region or location, as described 13496 // in https://cloud.google.com/apis/design/resource_names. For 13497 // projects.regions.workflowTemplates,create, the resource name of the 13498 // region has the following format: 13499 // projects/{project_id}/regions/{region} For 13500 // projects.locations.workflowTemplates.create, the resource name of 13501 // the location has the following format: 13502 // projects/{project_id}/locations/{location}. 13503 func (r *ProjectsRegionsWorkflowTemplatesService) Create(parent string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesCreateCall { 13504 c := &ProjectsRegionsWorkflowTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13505 c.parent = parent 13506 c.workflowtemplate = workflowtemplate 13507 return c 13508 } 13509 13510 // Fields allows partial responses to be retrieved. See 13511 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13512 // for more information. 13513 func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesCreateCall { 13514 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13515 return c 13516 } 13517 13518 // Context sets the context to be used in this call's Do method. Any 13519 // pending HTTP request will be aborted if the provided context is 13520 // canceled. 13521 func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesCreateCall { 13522 c.ctx_ = ctx 13523 return c 13524 } 13525 13526 // Header returns an http.Header that can be modified by the caller to 13527 // add HTTP headers to the request. 13528 func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Header() http.Header { 13529 if c.header_ == nil { 13530 c.header_ = make(http.Header) 13531 } 13532 return c.header_ 13533 } 13534 13535 func (c *ProjectsRegionsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) { 13536 reqHeaders := make(http.Header) 13537 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 13538 for k, v := range c.header_ { 13539 reqHeaders[k] = v 13540 } 13541 reqHeaders.Set("User-Agent", c.s.userAgent()) 13542 var body io.Reader = nil 13543 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 13544 if err != nil { 13545 return nil, err 13546 } 13547 reqHeaders.Set("Content-Type", "application/json") 13548 c.urlParams_.Set("alt", alt) 13549 c.urlParams_.Set("prettyPrint", "false") 13550 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates") 13551 urls += "?" + c.urlParams_.Encode() 13552 req, err := http.NewRequest("POST", urls, body) 13553 if err != nil { 13554 return nil, err 13555 } 13556 req.Header = reqHeaders 13557 googleapi.Expand(req.URL, map[string]string{ 13558 "parent": c.parent, 13559 }) 13560 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13561 } 13562 13563 // Do executes the "dataproc.projects.regions.workflowTemplates.create" call. 13564 // Exactly one of *WorkflowTemplate or error will be non-nil. Any 13565 // non-2xx status code is an error. Response headers are in either 13566 // *WorkflowTemplate.ServerResponse.Header or (if a response was 13567 // returned at all) in error.(*googleapi.Error).Header. Use 13568 // googleapi.IsNotModified to check whether the returned error was 13569 // because http.StatusNotModified was returned. 13570 func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 13571 gensupport.SetOptions(c.urlParams_, opts...) 13572 res, err := c.doRequest("json") 13573 if res != nil && res.StatusCode == http.StatusNotModified { 13574 if res.Body != nil { 13575 res.Body.Close() 13576 } 13577 return nil, &googleapi.Error{ 13578 Code: res.StatusCode, 13579 Header: res.Header, 13580 } 13581 } 13582 if err != nil { 13583 return nil, err 13584 } 13585 defer googleapi.CloseBody(res) 13586 if err := googleapi.CheckResponse(res); err != nil { 13587 return nil, err 13588 } 13589 ret := &WorkflowTemplate{ 13590 ServerResponse: googleapi.ServerResponse{ 13591 Header: res.Header, 13592 HTTPStatusCode: res.StatusCode, 13593 }, 13594 } 13595 target := &ret 13596 if err := gensupport.DecodeResponse(target, res); err != nil { 13597 return nil, err 13598 } 13599 return ret, nil 13600 // { 13601 // "description": "Creates new workflow template.", 13602 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates", 13603 // "httpMethod": "POST", 13604 // "id": "dataproc.projects.regions.workflowTemplates.create", 13605 // "parameterOrder": [ 13606 // "parent" 13607 // ], 13608 // "parameters": { 13609 // "parent": { 13610 // "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}", 13611 // "location": "path", 13612 // "pattern": "^projects/[^/]+/regions/[^/]+$", 13613 // "required": true, 13614 // "type": "string" 13615 // } 13616 // }, 13617 // "path": "v1beta2/{+parent}/workflowTemplates", 13618 // "request": { 13619 // "$ref": "WorkflowTemplate" 13620 // }, 13621 // "response": { 13622 // "$ref": "WorkflowTemplate" 13623 // }, 13624 // "scopes": [ 13625 // "https://www.googleapis.com/auth/cloud-platform" 13626 // ] 13627 // } 13628 13629 } 13630 13631 // method id "dataproc.projects.regions.workflowTemplates.delete": 13632 13633 type ProjectsRegionsWorkflowTemplatesDeleteCall struct { 13634 s *Service 13635 name string 13636 urlParams_ gensupport.URLParams 13637 ctx_ context.Context 13638 header_ http.Header 13639 } 13640 13641 // Delete: Deletes a workflow template. It does not cancel in-progress 13642 // workflows. 13643 // 13644 // - name: The resource name of the workflow template, as described in 13645 // https://cloud.google.com/apis/design/resource_names. For 13646 // projects.regions.workflowTemplates.delete, the resource name of the 13647 // template has the following format: 13648 // projects/{project_id}/regions/{region}/workflowTemplates/{template_i 13649 // d} For projects.locations.workflowTemplates.instantiate, the 13650 // resource name of the template has the following format: 13651 // projects/{project_id}/locations/{location}/workflowTemplates/{templa 13652 // te_id}. 13653 func (r *ProjectsRegionsWorkflowTemplatesService) Delete(name string) *ProjectsRegionsWorkflowTemplatesDeleteCall { 13654 c := &ProjectsRegionsWorkflowTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13655 c.name = name 13656 return c 13657 } 13658 13659 // Version sets the optional parameter "version": The version of 13660 // workflow template to delete. If specified, will only delete the 13661 // template if the current server version matches specified version. 13662 func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Version(version int64) *ProjectsRegionsWorkflowTemplatesDeleteCall { 13663 c.urlParams_.Set("version", fmt.Sprint(version)) 13664 return c 13665 } 13666 13667 // Fields allows partial responses to be retrieved. See 13668 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13669 // for more information. 13670 func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesDeleteCall { 13671 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13672 return c 13673 } 13674 13675 // Context sets the context to be used in this call's Do method. Any 13676 // pending HTTP request will be aborted if the provided context is 13677 // canceled. 13678 func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesDeleteCall { 13679 c.ctx_ = ctx 13680 return c 13681 } 13682 13683 // Header returns an http.Header that can be modified by the caller to 13684 // add HTTP headers to the request. 13685 func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Header() http.Header { 13686 if c.header_ == nil { 13687 c.header_ = make(http.Header) 13688 } 13689 return c.header_ 13690 } 13691 13692 func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) { 13693 reqHeaders := make(http.Header) 13694 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 13695 for k, v := range c.header_ { 13696 reqHeaders[k] = v 13697 } 13698 reqHeaders.Set("User-Agent", c.s.userAgent()) 13699 var body io.Reader = nil 13700 c.urlParams_.Set("alt", alt) 13701 c.urlParams_.Set("prettyPrint", "false") 13702 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 13703 urls += "?" + c.urlParams_.Encode() 13704 req, err := http.NewRequest("DELETE", urls, body) 13705 if err != nil { 13706 return nil, err 13707 } 13708 req.Header = reqHeaders 13709 googleapi.Expand(req.URL, map[string]string{ 13710 "name": c.name, 13711 }) 13712 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13713 } 13714 13715 // Do executes the "dataproc.projects.regions.workflowTemplates.delete" call. 13716 // Exactly one of *Empty or error will be non-nil. Any non-2xx status 13717 // code is an error. Response headers are in either 13718 // *Empty.ServerResponse.Header or (if a response was returned at all) 13719 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 13720 // check whether the returned error was because http.StatusNotModified 13721 // was returned. 13722 func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) { 13723 gensupport.SetOptions(c.urlParams_, opts...) 13724 res, err := c.doRequest("json") 13725 if res != nil && res.StatusCode == http.StatusNotModified { 13726 if res.Body != nil { 13727 res.Body.Close() 13728 } 13729 return nil, &googleapi.Error{ 13730 Code: res.StatusCode, 13731 Header: res.Header, 13732 } 13733 } 13734 if err != nil { 13735 return nil, err 13736 } 13737 defer googleapi.CloseBody(res) 13738 if err := googleapi.CheckResponse(res); err != nil { 13739 return nil, err 13740 } 13741 ret := &Empty{ 13742 ServerResponse: googleapi.ServerResponse{ 13743 Header: res.Header, 13744 HTTPStatusCode: res.StatusCode, 13745 }, 13746 } 13747 target := &ret 13748 if err := gensupport.DecodeResponse(target, res); err != nil { 13749 return nil, err 13750 } 13751 return ret, nil 13752 // { 13753 // "description": "Deletes a workflow template. It does not cancel in-progress workflows.", 13754 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}", 13755 // "httpMethod": "DELETE", 13756 // "id": "dataproc.projects.regions.workflowTemplates.delete", 13757 // "parameterOrder": [ 13758 // "name" 13759 // ], 13760 // "parameters": { 13761 // "name": { 13762 // "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}", 13763 // "location": "path", 13764 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 13765 // "required": true, 13766 // "type": "string" 13767 // }, 13768 // "version": { 13769 // "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.", 13770 // "format": "int32", 13771 // "location": "query", 13772 // "type": "integer" 13773 // } 13774 // }, 13775 // "path": "v1beta2/{+name}", 13776 // "response": { 13777 // "$ref": "Empty" 13778 // }, 13779 // "scopes": [ 13780 // "https://www.googleapis.com/auth/cloud-platform" 13781 // ] 13782 // } 13783 13784 } 13785 13786 // method id "dataproc.projects.regions.workflowTemplates.get": 13787 13788 type ProjectsRegionsWorkflowTemplatesGetCall struct { 13789 s *Service 13790 name string 13791 urlParams_ gensupport.URLParams 13792 ifNoneMatch_ string 13793 ctx_ context.Context 13794 header_ http.Header 13795 } 13796 13797 // Get: Retrieves the latest workflow template.Can retrieve previously 13798 // instantiated template by specifying optional version parameter. 13799 // 13800 // - name: The resource name of the workflow template, as described in 13801 // https://cloud.google.com/apis/design/resource_names. For 13802 // projects.regions.workflowTemplates.get, the resource name of the 13803 // template has the following format: 13804 // projects/{project_id}/regions/{region}/workflowTemplates/{template_i 13805 // d} For projects.locations.workflowTemplates.get, the resource name 13806 // of the template has the following format: 13807 // projects/{project_id}/locations/{location}/workflowTemplates/{templa 13808 // te_id}. 13809 func (r *ProjectsRegionsWorkflowTemplatesService) Get(name string) *ProjectsRegionsWorkflowTemplatesGetCall { 13810 c := &ProjectsRegionsWorkflowTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13811 c.name = name 13812 return c 13813 } 13814 13815 // Version sets the optional parameter "version": The version of 13816 // workflow template to retrieve. Only previously instantiated versions 13817 // can be retrieved.If unspecified, retrieves the current version. 13818 func (c *ProjectsRegionsWorkflowTemplatesGetCall) Version(version int64) *ProjectsRegionsWorkflowTemplatesGetCall { 13819 c.urlParams_.Set("version", fmt.Sprint(version)) 13820 return c 13821 } 13822 13823 // Fields allows partial responses to be retrieved. See 13824 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13825 // for more information. 13826 func (c *ProjectsRegionsWorkflowTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesGetCall { 13827 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13828 return c 13829 } 13830 13831 // IfNoneMatch sets the optional parameter which makes the operation 13832 // fail if the object's ETag matches the given value. This is useful for 13833 // getting updates only after the object has changed since the last 13834 // request. Use googleapi.IsNotModified to check whether the response 13835 // error from Do is the result of In-None-Match. 13836 func (c *ProjectsRegionsWorkflowTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesGetCall { 13837 c.ifNoneMatch_ = entityTag 13838 return c 13839 } 13840 13841 // Context sets the context to be used in this call's Do method. Any 13842 // pending HTTP request will be aborted if the provided context is 13843 // canceled. 13844 func (c *ProjectsRegionsWorkflowTemplatesGetCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesGetCall { 13845 c.ctx_ = ctx 13846 return c 13847 } 13848 13849 // Header returns an http.Header that can be modified by the caller to 13850 // add HTTP headers to the request. 13851 func (c *ProjectsRegionsWorkflowTemplatesGetCall) Header() http.Header { 13852 if c.header_ == nil { 13853 c.header_ = make(http.Header) 13854 } 13855 return c.header_ 13856 } 13857 13858 func (c *ProjectsRegionsWorkflowTemplatesGetCall) doRequest(alt string) (*http.Response, error) { 13859 reqHeaders := make(http.Header) 13860 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 13861 for k, v := range c.header_ { 13862 reqHeaders[k] = v 13863 } 13864 reqHeaders.Set("User-Agent", c.s.userAgent()) 13865 if c.ifNoneMatch_ != "" { 13866 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 13867 } 13868 var body io.Reader = nil 13869 c.urlParams_.Set("alt", alt) 13870 c.urlParams_.Set("prettyPrint", "false") 13871 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 13872 urls += "?" + c.urlParams_.Encode() 13873 req, err := http.NewRequest("GET", urls, body) 13874 if err != nil { 13875 return nil, err 13876 } 13877 req.Header = reqHeaders 13878 googleapi.Expand(req.URL, map[string]string{ 13879 "name": c.name, 13880 }) 13881 return gensupport.SendRequest(c.ctx_, c.s.client, req) 13882 } 13883 13884 // Do executes the "dataproc.projects.regions.workflowTemplates.get" call. 13885 // Exactly one of *WorkflowTemplate or error will be non-nil. Any 13886 // non-2xx status code is an error. Response headers are in either 13887 // *WorkflowTemplate.ServerResponse.Header or (if a response was 13888 // returned at all) in error.(*googleapi.Error).Header. Use 13889 // googleapi.IsNotModified to check whether the returned error was 13890 // because http.StatusNotModified was returned. 13891 func (c *ProjectsRegionsWorkflowTemplatesGetCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 13892 gensupport.SetOptions(c.urlParams_, opts...) 13893 res, err := c.doRequest("json") 13894 if res != nil && res.StatusCode == http.StatusNotModified { 13895 if res.Body != nil { 13896 res.Body.Close() 13897 } 13898 return nil, &googleapi.Error{ 13899 Code: res.StatusCode, 13900 Header: res.Header, 13901 } 13902 } 13903 if err != nil { 13904 return nil, err 13905 } 13906 defer googleapi.CloseBody(res) 13907 if err := googleapi.CheckResponse(res); err != nil { 13908 return nil, err 13909 } 13910 ret := &WorkflowTemplate{ 13911 ServerResponse: googleapi.ServerResponse{ 13912 Header: res.Header, 13913 HTTPStatusCode: res.StatusCode, 13914 }, 13915 } 13916 target := &ret 13917 if err := gensupport.DecodeResponse(target, res); err != nil { 13918 return nil, err 13919 } 13920 return ret, nil 13921 // { 13922 // "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.", 13923 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}", 13924 // "httpMethod": "GET", 13925 // "id": "dataproc.projects.regions.workflowTemplates.get", 13926 // "parameterOrder": [ 13927 // "name" 13928 // ], 13929 // "parameters": { 13930 // "name": { 13931 // "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}", 13932 // "location": "path", 13933 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 13934 // "required": true, 13935 // "type": "string" 13936 // }, 13937 // "version": { 13938 // "description": "Optional. The version of workflow template to retrieve. Only previously instantiated versions can be retrieved.If unspecified, retrieves the current version.", 13939 // "format": "int32", 13940 // "location": "query", 13941 // "type": "integer" 13942 // } 13943 // }, 13944 // "path": "v1beta2/{+name}", 13945 // "response": { 13946 // "$ref": "WorkflowTemplate" 13947 // }, 13948 // "scopes": [ 13949 // "https://www.googleapis.com/auth/cloud-platform" 13950 // ] 13951 // } 13952 13953 } 13954 13955 // method id "dataproc.projects.regions.workflowTemplates.getIamPolicy": 13956 13957 type ProjectsRegionsWorkflowTemplatesGetIamPolicyCall struct { 13958 s *Service 13959 resource string 13960 urlParams_ gensupport.URLParams 13961 ifNoneMatch_ string 13962 ctx_ context.Context 13963 header_ http.Header 13964 } 13965 13966 // GetIamPolicy: Gets the access control policy for a resource. Returns 13967 // an empty policy if the resource exists and does not have a policy 13968 // set. 13969 // 13970 // - resource: REQUIRED: The resource for which the policy is being 13971 // requested. See the operation documentation for the appropriate 13972 // value for this field. 13973 func (r *ProjectsRegionsWorkflowTemplatesService) GetIamPolicy(resource string) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall { 13974 c := &ProjectsRegionsWorkflowTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 13975 c.resource = resource 13976 return c 13977 } 13978 13979 // OptionsRequestedPolicyVersion sets the optional parameter 13980 // "options.requestedPolicyVersion": The policy format version to be 13981 // returned.Valid values are 0, 1, and 3. Requests specifying an invalid 13982 // value will be rejected.Requests for policies with any conditional 13983 // bindings must specify version 3. Policies without any conditional 13984 // bindings may specify any valid value or leave the field unset.To 13985 // learn which resources support conditions in their IAM policies, see 13986 // the IAM documentation 13987 // (https://cloud.google.com/iam/help/conditions/resource-policies). 13988 func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) OptionsRequestedPolicyVersion(optionsRequestedPolicyVersion int64) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall { 13989 c.urlParams_.Set("options.requestedPolicyVersion", fmt.Sprint(optionsRequestedPolicyVersion)) 13990 return c 13991 } 13992 13993 // Fields allows partial responses to be retrieved. See 13994 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 13995 // for more information. 13996 func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall { 13997 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 13998 return c 13999 } 14000 14001 // IfNoneMatch sets the optional parameter which makes the operation 14002 // fail if the object's ETag matches the given value. This is useful for 14003 // getting updates only after the object has changed since the last 14004 // request. Use googleapi.IsNotModified to check whether the response 14005 // error from Do is the result of In-None-Match. 14006 func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall { 14007 c.ifNoneMatch_ = entityTag 14008 return c 14009 } 14010 14011 // Context sets the context to be used in this call's Do method. Any 14012 // pending HTTP request will be aborted if the provided context is 14013 // canceled. 14014 func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall { 14015 c.ctx_ = ctx 14016 return c 14017 } 14018 14019 // Header returns an http.Header that can be modified by the caller to 14020 // add HTTP headers to the request. 14021 func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Header() http.Header { 14022 if c.header_ == nil { 14023 c.header_ = make(http.Header) 14024 } 14025 return c.header_ 14026 } 14027 14028 func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 14029 reqHeaders := make(http.Header) 14030 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 14031 for k, v := range c.header_ { 14032 reqHeaders[k] = v 14033 } 14034 reqHeaders.Set("User-Agent", c.s.userAgent()) 14035 if c.ifNoneMatch_ != "" { 14036 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14037 } 14038 var body io.Reader = nil 14039 c.urlParams_.Set("alt", alt) 14040 c.urlParams_.Set("prettyPrint", "false") 14041 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy") 14042 urls += "?" + c.urlParams_.Encode() 14043 req, err := http.NewRequest("GET", urls, body) 14044 if err != nil { 14045 return nil, err 14046 } 14047 req.Header = reqHeaders 14048 googleapi.Expand(req.URL, map[string]string{ 14049 "resource": c.resource, 14050 }) 14051 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14052 } 14053 14054 // Do executes the "dataproc.projects.regions.workflowTemplates.getIamPolicy" call. 14055 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 14056 // code is an error. Response headers are in either 14057 // *Policy.ServerResponse.Header or (if a response was returned at all) 14058 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14059 // check whether the returned error was because http.StatusNotModified 14060 // was returned. 14061 func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 14062 gensupport.SetOptions(c.urlParams_, opts...) 14063 res, err := c.doRequest("json") 14064 if res != nil && res.StatusCode == http.StatusNotModified { 14065 if res.Body != nil { 14066 res.Body.Close() 14067 } 14068 return nil, &googleapi.Error{ 14069 Code: res.StatusCode, 14070 Header: res.Header, 14071 } 14072 } 14073 if err != nil { 14074 return nil, err 14075 } 14076 defer googleapi.CloseBody(res) 14077 if err := googleapi.CheckResponse(res); err != nil { 14078 return nil, err 14079 } 14080 ret := &Policy{ 14081 ServerResponse: googleapi.ServerResponse{ 14082 Header: res.Header, 14083 HTTPStatusCode: res.StatusCode, 14084 }, 14085 } 14086 target := &ret 14087 if err := gensupport.DecodeResponse(target, res); err != nil { 14088 return nil, err 14089 } 14090 return ret, nil 14091 // { 14092 // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.", 14093 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:getIamPolicy", 14094 // "httpMethod": "GET", 14095 // "id": "dataproc.projects.regions.workflowTemplates.getIamPolicy", 14096 // "parameterOrder": [ 14097 // "resource" 14098 // ], 14099 // "parameters": { 14100 // "options.requestedPolicyVersion": { 14101 // "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).", 14102 // "format": "int32", 14103 // "location": "query", 14104 // "type": "integer" 14105 // }, 14106 // "resource": { 14107 // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.", 14108 // "location": "path", 14109 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 14110 // "required": true, 14111 // "type": "string" 14112 // } 14113 // }, 14114 // "path": "v1beta2/{+resource}:getIamPolicy", 14115 // "response": { 14116 // "$ref": "Policy" 14117 // }, 14118 // "scopes": [ 14119 // "https://www.googleapis.com/auth/cloud-platform" 14120 // ] 14121 // } 14122 14123 } 14124 14125 // method id "dataproc.projects.regions.workflowTemplates.instantiate": 14126 14127 type ProjectsRegionsWorkflowTemplatesInstantiateCall struct { 14128 s *Service 14129 name string 14130 instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest 14131 urlParams_ gensupport.URLParams 14132 ctx_ context.Context 14133 header_ http.Header 14134 } 14135 14136 // Instantiate: Instantiates a template and begins execution.The 14137 // returned Operation can be used to track execution of workflow by 14138 // polling operations.get. The Operation will complete when entire 14139 // workflow is finished.The running workflow can be aborted via 14140 // operations.cancel. This will cause any inflight jobs to be cancelled 14141 // and workflow-owned clusters to be deleted.The Operation.metadata will 14142 // be WorkflowMetadata 14143 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1beta2#workflowmetadata). 14144 // Also see Using WorkflowMetadata 14145 // (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On 14146 // successful completion, Operation.response will be Empty. 14147 // 14148 // - name: The resource name of the workflow template, as described in 14149 // https://cloud.google.com/apis/design/resource_names. For 14150 // projects.regions.workflowTemplates.instantiate, the resource name 14151 // of the template has the following format: 14152 // projects/{project_id}/regions/{region}/workflowTemplates/{template_i 14153 // d} For projects.locations.workflowTemplates.instantiate, the 14154 // resource name of the template has the following format: 14155 // projects/{project_id}/locations/{location}/workflowTemplates/{templa 14156 // te_id}. 14157 func (r *ProjectsRegionsWorkflowTemplatesService) Instantiate(name string, instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest) *ProjectsRegionsWorkflowTemplatesInstantiateCall { 14158 c := &ProjectsRegionsWorkflowTemplatesInstantiateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14159 c.name = name 14160 c.instantiateworkflowtemplaterequest = instantiateworkflowtemplaterequest 14161 return c 14162 } 14163 14164 // Fields allows partial responses to be retrieved. See 14165 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14166 // for more information. 14167 func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesInstantiateCall { 14168 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14169 return c 14170 } 14171 14172 // Context sets the context to be used in this call's Do method. Any 14173 // pending HTTP request will be aborted if the provided context is 14174 // canceled. 14175 func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesInstantiateCall { 14176 c.ctx_ = ctx 14177 return c 14178 } 14179 14180 // Header returns an http.Header that can be modified by the caller to 14181 // add HTTP headers to the request. 14182 func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Header() http.Header { 14183 if c.header_ == nil { 14184 c.header_ = make(http.Header) 14185 } 14186 return c.header_ 14187 } 14188 14189 func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) { 14190 reqHeaders := make(http.Header) 14191 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 14192 for k, v := range c.header_ { 14193 reqHeaders[k] = v 14194 } 14195 reqHeaders.Set("User-Agent", c.s.userAgent()) 14196 var body io.Reader = nil 14197 body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest) 14198 if err != nil { 14199 return nil, err 14200 } 14201 reqHeaders.Set("Content-Type", "application/json") 14202 c.urlParams_.Set("alt", alt) 14203 c.urlParams_.Set("prettyPrint", "false") 14204 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:instantiate") 14205 urls += "?" + c.urlParams_.Encode() 14206 req, err := http.NewRequest("POST", urls, body) 14207 if err != nil { 14208 return nil, err 14209 } 14210 req.Header = reqHeaders 14211 googleapi.Expand(req.URL, map[string]string{ 14212 "name": c.name, 14213 }) 14214 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14215 } 14216 14217 // Do executes the "dataproc.projects.regions.workflowTemplates.instantiate" call. 14218 // Exactly one of *Operation or error will be non-nil. Any non-2xx 14219 // status code is an error. Response headers are in either 14220 // *Operation.ServerResponse.Header or (if a response was returned at 14221 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14222 // to check whether the returned error was because 14223 // http.StatusNotModified was returned. 14224 func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 14225 gensupport.SetOptions(c.urlParams_, opts...) 14226 res, err := c.doRequest("json") 14227 if res != nil && res.StatusCode == http.StatusNotModified { 14228 if res.Body != nil { 14229 res.Body.Close() 14230 } 14231 return nil, &googleapi.Error{ 14232 Code: res.StatusCode, 14233 Header: res.Header, 14234 } 14235 } 14236 if err != nil { 14237 return nil, err 14238 } 14239 defer googleapi.CloseBody(res) 14240 if err := googleapi.CheckResponse(res); err != nil { 14241 return nil, err 14242 } 14243 ret := &Operation{ 14244 ServerResponse: googleapi.ServerResponse{ 14245 Header: res.Header, 14246 HTTPStatusCode: res.StatusCode, 14247 }, 14248 } 14249 target := &ret 14250 if err := gensupport.DecodeResponse(target, res); err != nil { 14251 return nil, err 14252 } 14253 return ret, nil 14254 // { 14255 // "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.", 14256 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:instantiate", 14257 // "httpMethod": "POST", 14258 // "id": "dataproc.projects.regions.workflowTemplates.instantiate", 14259 // "parameterOrder": [ 14260 // "name" 14261 // ], 14262 // "parameters": { 14263 // "name": { 14264 // "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}", 14265 // "location": "path", 14266 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 14267 // "required": true, 14268 // "type": "string" 14269 // } 14270 // }, 14271 // "path": "v1beta2/{+name}:instantiate", 14272 // "request": { 14273 // "$ref": "InstantiateWorkflowTemplateRequest" 14274 // }, 14275 // "response": { 14276 // "$ref": "Operation" 14277 // }, 14278 // "scopes": [ 14279 // "https://www.googleapis.com/auth/cloud-platform" 14280 // ] 14281 // } 14282 14283 } 14284 14285 // method id "dataproc.projects.regions.workflowTemplates.instantiateInline": 14286 14287 type ProjectsRegionsWorkflowTemplatesInstantiateInlineCall struct { 14288 s *Service 14289 parent string 14290 workflowtemplate *WorkflowTemplate 14291 urlParams_ gensupport.URLParams 14292 ctx_ context.Context 14293 header_ http.Header 14294 } 14295 14296 // InstantiateInline: Instantiates a template and begins execution.This 14297 // method is equivalent to executing the sequence 14298 // CreateWorkflowTemplate, InstantiateWorkflowTemplate, 14299 // DeleteWorkflowTemplate.The returned Operation can be used to track 14300 // execution of workflow by polling operations.get. The Operation will 14301 // complete when entire workflow is finished.The running workflow can be 14302 // aborted via operations.cancel. This will cause any inflight jobs to 14303 // be cancelled and workflow-owned clusters to be deleted.The 14304 // Operation.metadata will be WorkflowMetadata 14305 // (https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata). 14306 // Also see Using WorkflowMetadata 14307 // (https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).On 14308 // successful completion, Operation.response will be Empty. 14309 // 14310 // - parent: The resource name of the region or location, as described 14311 // in https://cloud.google.com/apis/design/resource_names. For 14312 // projects.regions.workflowTemplates,instantiateinline, the resource 14313 // name of the region has the following format: 14314 // projects/{project_id}/regions/{region} For 14315 // projects.locations.workflowTemplates.instantiateinline, the 14316 // resource name of the location has the following format: 14317 // projects/{project_id}/locations/{location}. 14318 func (r *ProjectsRegionsWorkflowTemplatesService) InstantiateInline(parent string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14319 c := &ProjectsRegionsWorkflowTemplatesInstantiateInlineCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14320 c.parent = parent 14321 c.workflowtemplate = workflowtemplate 14322 return c 14323 } 14324 14325 // InstanceId sets the optional parameter "instanceId": Deprecated. 14326 // Please use request_id field instead. 14327 func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) InstanceId(instanceId string) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14328 c.urlParams_.Set("instanceId", instanceId) 14329 return c 14330 } 14331 14332 // RequestId sets the optional parameter "requestId": A tag that 14333 // prevents multiple concurrent workflow instances with the same tag 14334 // from running. This mitigates risk of concurrent instances started due 14335 // to retries.It is recommended to always set this value to a UUID 14336 // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag 14337 // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_), 14338 // and hyphens (-). The maximum length is 40 characters. 14339 func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) RequestId(requestId string) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14340 c.urlParams_.Set("requestId", requestId) 14341 return c 14342 } 14343 14344 // Fields allows partial responses to be retrieved. See 14345 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14346 // for more information. 14347 func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14348 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14349 return c 14350 } 14351 14352 // Context sets the context to be used in this call's Do method. Any 14353 // pending HTTP request will be aborted if the provided context is 14354 // canceled. 14355 func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall { 14356 c.ctx_ = ctx 14357 return c 14358 } 14359 14360 // Header returns an http.Header that can be modified by the caller to 14361 // add HTTP headers to the request. 14362 func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Header() http.Header { 14363 if c.header_ == nil { 14364 c.header_ = make(http.Header) 14365 } 14366 return c.header_ 14367 } 14368 14369 func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) { 14370 reqHeaders := make(http.Header) 14371 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 14372 for k, v := range c.header_ { 14373 reqHeaders[k] = v 14374 } 14375 reqHeaders.Set("User-Agent", c.s.userAgent()) 14376 var body io.Reader = nil 14377 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 14378 if err != nil { 14379 return nil, err 14380 } 14381 reqHeaders.Set("Content-Type", "application/json") 14382 c.urlParams_.Set("alt", alt) 14383 c.urlParams_.Set("prettyPrint", "false") 14384 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates:instantiateInline") 14385 urls += "?" + c.urlParams_.Encode() 14386 req, err := http.NewRequest("POST", urls, body) 14387 if err != nil { 14388 return nil, err 14389 } 14390 req.Header = reqHeaders 14391 googleapi.Expand(req.URL, map[string]string{ 14392 "parent": c.parent, 14393 }) 14394 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14395 } 14396 14397 // Do executes the "dataproc.projects.regions.workflowTemplates.instantiateInline" call. 14398 // Exactly one of *Operation or error will be non-nil. Any non-2xx 14399 // status code is an error. Response headers are in either 14400 // *Operation.ServerResponse.Header or (if a response was returned at 14401 // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified 14402 // to check whether the returned error was because 14403 // http.StatusNotModified was returned. 14404 func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Do(opts ...googleapi.CallOption) (*Operation, error) { 14405 gensupport.SetOptions(c.urlParams_, opts...) 14406 res, err := c.doRequest("json") 14407 if res != nil && res.StatusCode == http.StatusNotModified { 14408 if res.Body != nil { 14409 res.Body.Close() 14410 } 14411 return nil, &googleapi.Error{ 14412 Code: res.StatusCode, 14413 Header: res.Header, 14414 } 14415 } 14416 if err != nil { 14417 return nil, err 14418 } 14419 defer googleapi.CloseBody(res) 14420 if err := googleapi.CheckResponse(res); err != nil { 14421 return nil, err 14422 } 14423 ret := &Operation{ 14424 ServerResponse: googleapi.ServerResponse{ 14425 Header: res.Header, 14426 HTTPStatusCode: res.StatusCode, 14427 }, 14428 } 14429 target := &ret 14430 if err := gensupport.DecodeResponse(target, res); err != nil { 14431 return nil, err 14432 } 14433 return ret, nil 14434 // { 14435 // "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.", 14436 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates:instantiateInline", 14437 // "httpMethod": "POST", 14438 // "id": "dataproc.projects.regions.workflowTemplates.instantiateInline", 14439 // "parameterOrder": [ 14440 // "parent" 14441 // ], 14442 // "parameters": { 14443 // "instanceId": { 14444 // "description": "Deprecated. Please use request_id field instead.", 14445 // "location": "query", 14446 // "type": "string" 14447 // }, 14448 // "parent": { 14449 // "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}", 14450 // "location": "path", 14451 // "pattern": "^projects/[^/]+/regions/[^/]+$", 14452 // "required": true, 14453 // "type": "string" 14454 // }, 14455 // "requestId": { 14456 // "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.", 14457 // "location": "query", 14458 // "type": "string" 14459 // } 14460 // }, 14461 // "path": "v1beta2/{+parent}/workflowTemplates:instantiateInline", 14462 // "request": { 14463 // "$ref": "WorkflowTemplate" 14464 // }, 14465 // "response": { 14466 // "$ref": "Operation" 14467 // }, 14468 // "scopes": [ 14469 // "https://www.googleapis.com/auth/cloud-platform" 14470 // ] 14471 // } 14472 14473 } 14474 14475 // method id "dataproc.projects.regions.workflowTemplates.list": 14476 14477 type ProjectsRegionsWorkflowTemplatesListCall struct { 14478 s *Service 14479 parent string 14480 urlParams_ gensupport.URLParams 14481 ifNoneMatch_ string 14482 ctx_ context.Context 14483 header_ http.Header 14484 } 14485 14486 // List: Lists workflows that match the specified filter in the request. 14487 // 14488 // - parent: The resource name of the region or location, as described 14489 // in https://cloud.google.com/apis/design/resource_names. For 14490 // projects.regions.workflowTemplates,list, the resource name of the 14491 // region has the following format: 14492 // projects/{project_id}/regions/{region} For 14493 // projects.locations.workflowTemplates.list, the resource name of the 14494 // location has the following format: 14495 // projects/{project_id}/locations/{location}. 14496 func (r *ProjectsRegionsWorkflowTemplatesService) List(parent string) *ProjectsRegionsWorkflowTemplatesListCall { 14497 c := &ProjectsRegionsWorkflowTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14498 c.parent = parent 14499 return c 14500 } 14501 14502 // PageSize sets the optional parameter "pageSize": The maximum number 14503 // of results to return in each response. 14504 func (c *ProjectsRegionsWorkflowTemplatesListCall) PageSize(pageSize int64) *ProjectsRegionsWorkflowTemplatesListCall { 14505 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize)) 14506 return c 14507 } 14508 14509 // PageToken sets the optional parameter "pageToken": The page token, 14510 // returned by a previous call, to request the next page of results. 14511 func (c *ProjectsRegionsWorkflowTemplatesListCall) PageToken(pageToken string) *ProjectsRegionsWorkflowTemplatesListCall { 14512 c.urlParams_.Set("pageToken", pageToken) 14513 return c 14514 } 14515 14516 // Fields allows partial responses to be retrieved. See 14517 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14518 // for more information. 14519 func (c *ProjectsRegionsWorkflowTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesListCall { 14520 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14521 return c 14522 } 14523 14524 // IfNoneMatch sets the optional parameter which makes the operation 14525 // fail if the object's ETag matches the given value. This is useful for 14526 // getting updates only after the object has changed since the last 14527 // request. Use googleapi.IsNotModified to check whether the response 14528 // error from Do is the result of In-None-Match. 14529 func (c *ProjectsRegionsWorkflowTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesListCall { 14530 c.ifNoneMatch_ = entityTag 14531 return c 14532 } 14533 14534 // Context sets the context to be used in this call's Do method. Any 14535 // pending HTTP request will be aborted if the provided context is 14536 // canceled. 14537 func (c *ProjectsRegionsWorkflowTemplatesListCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesListCall { 14538 c.ctx_ = ctx 14539 return c 14540 } 14541 14542 // Header returns an http.Header that can be modified by the caller to 14543 // add HTTP headers to the request. 14544 func (c *ProjectsRegionsWorkflowTemplatesListCall) Header() http.Header { 14545 if c.header_ == nil { 14546 c.header_ = make(http.Header) 14547 } 14548 return c.header_ 14549 } 14550 14551 func (c *ProjectsRegionsWorkflowTemplatesListCall) doRequest(alt string) (*http.Response, error) { 14552 reqHeaders := make(http.Header) 14553 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 14554 for k, v := range c.header_ { 14555 reqHeaders[k] = v 14556 } 14557 reqHeaders.Set("User-Agent", c.s.userAgent()) 14558 if c.ifNoneMatch_ != "" { 14559 reqHeaders.Set("If-None-Match", c.ifNoneMatch_) 14560 } 14561 var body io.Reader = nil 14562 c.urlParams_.Set("alt", alt) 14563 c.urlParams_.Set("prettyPrint", "false") 14564 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates") 14565 urls += "?" + c.urlParams_.Encode() 14566 req, err := http.NewRequest("GET", urls, body) 14567 if err != nil { 14568 return nil, err 14569 } 14570 req.Header = reqHeaders 14571 googleapi.Expand(req.URL, map[string]string{ 14572 "parent": c.parent, 14573 }) 14574 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14575 } 14576 14577 // Do executes the "dataproc.projects.regions.workflowTemplates.list" call. 14578 // Exactly one of *ListWorkflowTemplatesResponse or error will be 14579 // non-nil. Any non-2xx status code is an error. Response headers are in 14580 // either *ListWorkflowTemplatesResponse.ServerResponse.Header or (if a 14581 // response was returned at all) in error.(*googleapi.Error).Header. Use 14582 // googleapi.IsNotModified to check whether the returned error was 14583 // because http.StatusNotModified was returned. 14584 func (c *ProjectsRegionsWorkflowTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowTemplatesResponse, error) { 14585 gensupport.SetOptions(c.urlParams_, opts...) 14586 res, err := c.doRequest("json") 14587 if res != nil && res.StatusCode == http.StatusNotModified { 14588 if res.Body != nil { 14589 res.Body.Close() 14590 } 14591 return nil, &googleapi.Error{ 14592 Code: res.StatusCode, 14593 Header: res.Header, 14594 } 14595 } 14596 if err != nil { 14597 return nil, err 14598 } 14599 defer googleapi.CloseBody(res) 14600 if err := googleapi.CheckResponse(res); err != nil { 14601 return nil, err 14602 } 14603 ret := &ListWorkflowTemplatesResponse{ 14604 ServerResponse: googleapi.ServerResponse{ 14605 Header: res.Header, 14606 HTTPStatusCode: res.StatusCode, 14607 }, 14608 } 14609 target := &ret 14610 if err := gensupport.DecodeResponse(target, res); err != nil { 14611 return nil, err 14612 } 14613 return ret, nil 14614 // { 14615 // "description": "Lists workflows that match the specified filter in the request.", 14616 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates", 14617 // "httpMethod": "GET", 14618 // "id": "dataproc.projects.regions.workflowTemplates.list", 14619 // "parameterOrder": [ 14620 // "parent" 14621 // ], 14622 // "parameters": { 14623 // "pageSize": { 14624 // "description": "Optional. The maximum number of results to return in each response.", 14625 // "format": "int32", 14626 // "location": "query", 14627 // "type": "integer" 14628 // }, 14629 // "pageToken": { 14630 // "description": "Optional. The page token, returned by a previous call, to request the next page of results.", 14631 // "location": "query", 14632 // "type": "string" 14633 // }, 14634 // "parent": { 14635 // "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}", 14636 // "location": "path", 14637 // "pattern": "^projects/[^/]+/regions/[^/]+$", 14638 // "required": true, 14639 // "type": "string" 14640 // } 14641 // }, 14642 // "path": "v1beta2/{+parent}/workflowTemplates", 14643 // "response": { 14644 // "$ref": "ListWorkflowTemplatesResponse" 14645 // }, 14646 // "scopes": [ 14647 // "https://www.googleapis.com/auth/cloud-platform" 14648 // ] 14649 // } 14650 14651 } 14652 14653 // Pages invokes f for each page of results. 14654 // A non-nil error returned from f will halt the iteration. 14655 // The provided context supersedes any context provided to the Context method. 14656 func (c *ProjectsRegionsWorkflowTemplatesListCall) Pages(ctx context.Context, f func(*ListWorkflowTemplatesResponse) error) error { 14657 c.ctx_ = ctx 14658 defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point 14659 for { 14660 x, err := c.Do() 14661 if err != nil { 14662 return err 14663 } 14664 if err := f(x); err != nil { 14665 return err 14666 } 14667 if x.NextPageToken == "" { 14668 return nil 14669 } 14670 c.PageToken(x.NextPageToken) 14671 } 14672 } 14673 14674 // method id "dataproc.projects.regions.workflowTemplates.setIamPolicy": 14675 14676 type ProjectsRegionsWorkflowTemplatesSetIamPolicyCall struct { 14677 s *Service 14678 resource string 14679 setiampolicyrequest *SetIamPolicyRequest 14680 urlParams_ gensupport.URLParams 14681 ctx_ context.Context 14682 header_ http.Header 14683 } 14684 14685 // SetIamPolicy: Sets the access control policy on the specified 14686 // resource. Replaces any existing policy.Can return NOT_FOUND, 14687 // INVALID_ARGUMENT, and PERMISSION_DENIED errors. 14688 // 14689 // - resource: REQUIRED: The resource for which the policy is being 14690 // specified. See the operation documentation for the appropriate 14691 // value for this field. 14692 func (r *ProjectsRegionsWorkflowTemplatesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall { 14693 c := &ProjectsRegionsWorkflowTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14694 c.resource = resource 14695 c.setiampolicyrequest = setiampolicyrequest 14696 return c 14697 } 14698 14699 // Fields allows partial responses to be retrieved. See 14700 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14701 // for more information. 14702 func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall { 14703 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14704 return c 14705 } 14706 14707 // Context sets the context to be used in this call's Do method. Any 14708 // pending HTTP request will be aborted if the provided context is 14709 // canceled. 14710 func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall { 14711 c.ctx_ = ctx 14712 return c 14713 } 14714 14715 // Header returns an http.Header that can be modified by the caller to 14716 // add HTTP headers to the request. 14717 func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Header() http.Header { 14718 if c.header_ == nil { 14719 c.header_ = make(http.Header) 14720 } 14721 return c.header_ 14722 } 14723 14724 func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) { 14725 reqHeaders := make(http.Header) 14726 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 14727 for k, v := range c.header_ { 14728 reqHeaders[k] = v 14729 } 14730 reqHeaders.Set("User-Agent", c.s.userAgent()) 14731 var body io.Reader = nil 14732 body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest) 14733 if err != nil { 14734 return nil, err 14735 } 14736 reqHeaders.Set("Content-Type", "application/json") 14737 c.urlParams_.Set("alt", alt) 14738 c.urlParams_.Set("prettyPrint", "false") 14739 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy") 14740 urls += "?" + c.urlParams_.Encode() 14741 req, err := http.NewRequest("POST", urls, body) 14742 if err != nil { 14743 return nil, err 14744 } 14745 req.Header = reqHeaders 14746 googleapi.Expand(req.URL, map[string]string{ 14747 "resource": c.resource, 14748 }) 14749 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14750 } 14751 14752 // Do executes the "dataproc.projects.regions.workflowTemplates.setIamPolicy" call. 14753 // Exactly one of *Policy or error will be non-nil. Any non-2xx status 14754 // code is an error. Response headers are in either 14755 // *Policy.ServerResponse.Header or (if a response was returned at all) 14756 // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to 14757 // check whether the returned error was because http.StatusNotModified 14758 // was returned. 14759 func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) { 14760 gensupport.SetOptions(c.urlParams_, opts...) 14761 res, err := c.doRequest("json") 14762 if res != nil && res.StatusCode == http.StatusNotModified { 14763 if res.Body != nil { 14764 res.Body.Close() 14765 } 14766 return nil, &googleapi.Error{ 14767 Code: res.StatusCode, 14768 Header: res.Header, 14769 } 14770 } 14771 if err != nil { 14772 return nil, err 14773 } 14774 defer googleapi.CloseBody(res) 14775 if err := googleapi.CheckResponse(res); err != nil { 14776 return nil, err 14777 } 14778 ret := &Policy{ 14779 ServerResponse: googleapi.ServerResponse{ 14780 Header: res.Header, 14781 HTTPStatusCode: res.StatusCode, 14782 }, 14783 } 14784 target := &ret 14785 if err := gensupport.DecodeResponse(target, res); err != nil { 14786 return nil, err 14787 } 14788 return ret, nil 14789 // { 14790 // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.Can return NOT_FOUND, INVALID_ARGUMENT, and PERMISSION_DENIED errors.", 14791 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:setIamPolicy", 14792 // "httpMethod": "POST", 14793 // "id": "dataproc.projects.regions.workflowTemplates.setIamPolicy", 14794 // "parameterOrder": [ 14795 // "resource" 14796 // ], 14797 // "parameters": { 14798 // "resource": { 14799 // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.", 14800 // "location": "path", 14801 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 14802 // "required": true, 14803 // "type": "string" 14804 // } 14805 // }, 14806 // "path": "v1beta2/{+resource}:setIamPolicy", 14807 // "request": { 14808 // "$ref": "SetIamPolicyRequest" 14809 // }, 14810 // "response": { 14811 // "$ref": "Policy" 14812 // }, 14813 // "scopes": [ 14814 // "https://www.googleapis.com/auth/cloud-platform" 14815 // ] 14816 // } 14817 14818 } 14819 14820 // method id "dataproc.projects.regions.workflowTemplates.testIamPermissions": 14821 14822 type ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall struct { 14823 s *Service 14824 resource string 14825 testiampermissionsrequest *TestIamPermissionsRequest 14826 urlParams_ gensupport.URLParams 14827 ctx_ context.Context 14828 header_ http.Header 14829 } 14830 14831 // TestIamPermissions: Returns permissions that a caller has on the 14832 // specified resource. If the resource does not exist, this will return 14833 // an empty set of permissions, not a NOT_FOUND error.Note: This 14834 // operation is designed to be used for building permission-aware UIs 14835 // and command-line tools, not for authorization checking. This 14836 // operation may "fail open" without warning. 14837 // 14838 // - resource: REQUIRED: The resource for which the policy detail is 14839 // being requested. See the operation documentation for the 14840 // appropriate value for this field. 14841 func (r *ProjectsRegionsWorkflowTemplatesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall { 14842 c := &ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14843 c.resource = resource 14844 c.testiampermissionsrequest = testiampermissionsrequest 14845 return c 14846 } 14847 14848 // Fields allows partial responses to be retrieved. See 14849 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 14850 // for more information. 14851 func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall { 14852 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 14853 return c 14854 } 14855 14856 // Context sets the context to be used in this call's Do method. Any 14857 // pending HTTP request will be aborted if the provided context is 14858 // canceled. 14859 func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall { 14860 c.ctx_ = ctx 14861 return c 14862 } 14863 14864 // Header returns an http.Header that can be modified by the caller to 14865 // add HTTP headers to the request. 14866 func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Header() http.Header { 14867 if c.header_ == nil { 14868 c.header_ = make(http.Header) 14869 } 14870 return c.header_ 14871 } 14872 14873 func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) { 14874 reqHeaders := make(http.Header) 14875 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 14876 for k, v := range c.header_ { 14877 reqHeaders[k] = v 14878 } 14879 reqHeaders.Set("User-Agent", c.s.userAgent()) 14880 var body io.Reader = nil 14881 body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest) 14882 if err != nil { 14883 return nil, err 14884 } 14885 reqHeaders.Set("Content-Type", "application/json") 14886 c.urlParams_.Set("alt", alt) 14887 c.urlParams_.Set("prettyPrint", "false") 14888 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions") 14889 urls += "?" + c.urlParams_.Encode() 14890 req, err := http.NewRequest("POST", urls, body) 14891 if err != nil { 14892 return nil, err 14893 } 14894 req.Header = reqHeaders 14895 googleapi.Expand(req.URL, map[string]string{ 14896 "resource": c.resource, 14897 }) 14898 return gensupport.SendRequest(c.ctx_, c.s.client, req) 14899 } 14900 14901 // Do executes the "dataproc.projects.regions.workflowTemplates.testIamPermissions" call. 14902 // Exactly one of *TestIamPermissionsResponse or error will be non-nil. 14903 // Any non-2xx status code is an error. Response headers are in either 14904 // *TestIamPermissionsResponse.ServerResponse.Header or (if a response 14905 // was returned at all) in error.(*googleapi.Error).Header. Use 14906 // googleapi.IsNotModified to check whether the returned error was 14907 // because http.StatusNotModified was returned. 14908 func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) { 14909 gensupport.SetOptions(c.urlParams_, opts...) 14910 res, err := c.doRequest("json") 14911 if res != nil && res.StatusCode == http.StatusNotModified { 14912 if res.Body != nil { 14913 res.Body.Close() 14914 } 14915 return nil, &googleapi.Error{ 14916 Code: res.StatusCode, 14917 Header: res.Header, 14918 } 14919 } 14920 if err != nil { 14921 return nil, err 14922 } 14923 defer googleapi.CloseBody(res) 14924 if err := googleapi.CheckResponse(res); err != nil { 14925 return nil, err 14926 } 14927 ret := &TestIamPermissionsResponse{ 14928 ServerResponse: googleapi.ServerResponse{ 14929 Header: res.Header, 14930 HTTPStatusCode: res.StatusCode, 14931 }, 14932 } 14933 target := &ret 14934 if err := gensupport.DecodeResponse(target, res); err != nil { 14935 return nil, err 14936 } 14937 return ret, nil 14938 // { 14939 // "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.", 14940 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:testIamPermissions", 14941 // "httpMethod": "POST", 14942 // "id": "dataproc.projects.regions.workflowTemplates.testIamPermissions", 14943 // "parameterOrder": [ 14944 // "resource" 14945 // ], 14946 // "parameters": { 14947 // "resource": { 14948 // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.", 14949 // "location": "path", 14950 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 14951 // "required": true, 14952 // "type": "string" 14953 // } 14954 // }, 14955 // "path": "v1beta2/{+resource}:testIamPermissions", 14956 // "request": { 14957 // "$ref": "TestIamPermissionsRequest" 14958 // }, 14959 // "response": { 14960 // "$ref": "TestIamPermissionsResponse" 14961 // }, 14962 // "scopes": [ 14963 // "https://www.googleapis.com/auth/cloud-platform" 14964 // ] 14965 // } 14966 14967 } 14968 14969 // method id "dataproc.projects.regions.workflowTemplates.update": 14970 14971 type ProjectsRegionsWorkflowTemplatesUpdateCall struct { 14972 s *Service 14973 name string 14974 workflowtemplate *WorkflowTemplate 14975 urlParams_ gensupport.URLParams 14976 ctx_ context.Context 14977 header_ http.Header 14978 } 14979 14980 // Update: Updates (replaces) workflow template. The updated template 14981 // must contain version that matches the current server version. 14982 // 14983 // - name: Output only. The resource name of the workflow template, as 14984 // described in https://cloud.google.com/apis/design/resource_names. 14985 // For projects.regions.workflowTemplates, the resource name of the 14986 // template has the following format: 14987 // projects/{project_id}/regions/{region}/workflowTemplates/{template_i 14988 // d} For projects.locations.workflowTemplates, the resource name of 14989 // the template has the following format: 14990 // projects/{project_id}/locations/{location}/workflowTemplates/{templa 14991 // te_id}. 14992 func (r *ProjectsRegionsWorkflowTemplatesService) Update(name string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesUpdateCall { 14993 c := &ProjectsRegionsWorkflowTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)} 14994 c.name = name 14995 c.workflowtemplate = workflowtemplate 14996 return c 14997 } 14998 14999 // Fields allows partial responses to be retrieved. See 15000 // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse 15001 // for more information. 15002 func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesUpdateCall { 15003 c.urlParams_.Set("fields", googleapi.CombineFields(s)) 15004 return c 15005 } 15006 15007 // Context sets the context to be used in this call's Do method. Any 15008 // pending HTTP request will be aborted if the provided context is 15009 // canceled. 15010 func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesUpdateCall { 15011 c.ctx_ = ctx 15012 return c 15013 } 15014 15015 // Header returns an http.Header that can be modified by the caller to 15016 // add HTTP headers to the request. 15017 func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Header() http.Header { 15018 if c.header_ == nil { 15019 c.header_ = make(http.Header) 15020 } 15021 return c.header_ 15022 } 15023 15024 func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) { 15025 reqHeaders := make(http.Header) 15026 reqHeaders.Set("x-goog-api-client", "gl-go/"+gensupport.GoVersion()+" gdcl/20210908") 15027 for k, v := range c.header_ { 15028 reqHeaders[k] = v 15029 } 15030 reqHeaders.Set("User-Agent", c.s.userAgent()) 15031 var body io.Reader = nil 15032 body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate) 15033 if err != nil { 15034 return nil, err 15035 } 15036 reqHeaders.Set("Content-Type", "application/json") 15037 c.urlParams_.Set("alt", alt) 15038 c.urlParams_.Set("prettyPrint", "false") 15039 urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}") 15040 urls += "?" + c.urlParams_.Encode() 15041 req, err := http.NewRequest("PUT", urls, body) 15042 if err != nil { 15043 return nil, err 15044 } 15045 req.Header = reqHeaders 15046 googleapi.Expand(req.URL, map[string]string{ 15047 "name": c.name, 15048 }) 15049 return gensupport.SendRequest(c.ctx_, c.s.client, req) 15050 } 15051 15052 // Do executes the "dataproc.projects.regions.workflowTemplates.update" call. 15053 // Exactly one of *WorkflowTemplate or error will be non-nil. Any 15054 // non-2xx status code is an error. Response headers are in either 15055 // *WorkflowTemplate.ServerResponse.Header or (if a response was 15056 // returned at all) in error.(*googleapi.Error).Header. Use 15057 // googleapi.IsNotModified to check whether the returned error was 15058 // because http.StatusNotModified was returned. 15059 func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) { 15060 gensupport.SetOptions(c.urlParams_, opts...) 15061 res, err := c.doRequest("json") 15062 if res != nil && res.StatusCode == http.StatusNotModified { 15063 if res.Body != nil { 15064 res.Body.Close() 15065 } 15066 return nil, &googleapi.Error{ 15067 Code: res.StatusCode, 15068 Header: res.Header, 15069 } 15070 } 15071 if err != nil { 15072 return nil, err 15073 } 15074 defer googleapi.CloseBody(res) 15075 if err := googleapi.CheckResponse(res); err != nil { 15076 return nil, err 15077 } 15078 ret := &WorkflowTemplate{ 15079 ServerResponse: googleapi.ServerResponse{ 15080 Header: res.Header, 15081 HTTPStatusCode: res.StatusCode, 15082 }, 15083 } 15084 target := &ret 15085 if err := gensupport.DecodeResponse(target, res); err != nil { 15086 return nil, err 15087 } 15088 return ret, nil 15089 // { 15090 // "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version.", 15091 // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}", 15092 // "httpMethod": "PUT", 15093 // "id": "dataproc.projects.regions.workflowTemplates.update", 15094 // "parameterOrder": [ 15095 // "name" 15096 // ], 15097 // "parameters": { 15098 // "name": { 15099 // "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}", 15100 // "location": "path", 15101 // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$", 15102 // "required": true, 15103 // "type": "string" 15104 // } 15105 // }, 15106 // "path": "v1beta2/{+name}", 15107 // "request": { 15108 // "$ref": "WorkflowTemplate" 15109 // }, 15110 // "response": { 15111 // "$ref": "WorkflowTemplate" 15112 // }, 15113 // "scopes": [ 15114 // "https://www.googleapis.com/auth/cloud-platform" 15115 // ] 15116 // } 15117 15118 } 15119