Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 

13300 lignes
499 KiB

  1. // Copyright 2019 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. // Code generated file. DO NOT EDIT.
  5. // Package dataproc provides access to the Cloud Dataproc API.
  6. //
  7. // This package is DEPRECATED. Use package cloud.google.com/go/dataproc/apiv1 instead.
  8. //
  9. // For product documentation, see: https://cloud.google.com/dataproc/
  10. //
  11. // Creating a client
  12. //
  13. // Usage example:
  14. //
  15. // import "google.golang.org/api/dataproc/v1beta2"
  16. // ...
  17. // ctx := context.Background()
  18. // dataprocService, err := dataproc.NewService(ctx)
  19. //
  20. // In this example, Google Application Default Credentials are used for authentication.
  21. //
  22. // For information on how to create and obtain Application Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
  23. //
  24. // Other authentication options
  25. //
  26. // To use an API key for authentication (note: some APIs do not support API keys), use option.WithAPIKey:
  27. //
  28. // dataprocService, err := dataproc.NewService(ctx, option.WithAPIKey("AIza..."))
  29. //
  30. // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth flow), use option.WithTokenSource:
  31. //
  32. // config := &oauth2.Config{...}
  33. // // ...
  34. // token, err := config.Exchange(ctx, ...)
  35. // dataprocService, err := dataproc.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
  36. //
  37. // See https://godoc.org/google.golang.org/api/option/ for details on options.
  38. package dataproc // import "google.golang.org/api/dataproc/v1beta2"
  39. import (
  40. "bytes"
  41. "context"
  42. "encoding/json"
  43. "errors"
  44. "fmt"
  45. "io"
  46. "net/http"
  47. "net/url"
  48. "strconv"
  49. "strings"
  50. gensupport "google.golang.org/api/gensupport"
  51. googleapi "google.golang.org/api/googleapi"
  52. option "google.golang.org/api/option"
  53. htransport "google.golang.org/api/transport/http"
  54. )
  55. // Always reference these packages, just in case the auto-generated code
  56. // below doesn't.
  57. var _ = bytes.NewBuffer
  58. var _ = strconv.Itoa
  59. var _ = fmt.Sprintf
  60. var _ = json.NewDecoder
  61. var _ = io.Copy
  62. var _ = url.Parse
  63. var _ = gensupport.MarshalJSON
  64. var _ = googleapi.Version
  65. var _ = errors.New
  66. var _ = strings.Replace
  67. var _ = context.Canceled
  68. const apiId = "dataproc:v1beta2"
  69. const apiName = "dataproc"
  70. const apiVersion = "v1beta2"
  71. const basePath = "https://dataproc.googleapis.com/"
  72. // OAuth2 scopes used by this API.
  73. const (
  74. // View and manage your data across Google Cloud Platform services
  75. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  76. )
  77. // NewService creates a new Service.
  78. func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
  79. scopesOption := option.WithScopes(
  80. "https://www.googleapis.com/auth/cloud-platform",
  81. )
  82. // NOTE: prepend, so we don't override user-specified scopes.
  83. opts = append([]option.ClientOption{scopesOption}, opts...)
  84. client, endpoint, err := htransport.NewClient(ctx, opts...)
  85. if err != nil {
  86. return nil, err
  87. }
  88. s, err := New(client)
  89. if err != nil {
  90. return nil, err
  91. }
  92. if endpoint != "" {
  93. s.BasePath = endpoint
  94. }
  95. return s, nil
  96. }
  97. // New creates a new Service. It uses the provided http.Client for requests.
  98. //
  99. // Deprecated: please use NewService instead.
  100. // To provide a custom HTTP client, use option.WithHTTPClient.
  101. // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
  102. func New(client *http.Client) (*Service, error) {
  103. if client == nil {
  104. return nil, errors.New("client is nil")
  105. }
  106. s := &Service{client: client, BasePath: basePath}
  107. s.Projects = NewProjectsService(s)
  108. return s, nil
  109. }
  110. type Service struct {
  111. client *http.Client
  112. BasePath string // API endpoint base URL
  113. UserAgent string // optional additional User-Agent fragment
  114. Projects *ProjectsService
  115. }
  116. func (s *Service) userAgent() string {
  117. if s.UserAgent == "" {
  118. return googleapi.UserAgent
  119. }
  120. return googleapi.UserAgent + " " + s.UserAgent
  121. }
  122. func NewProjectsService(s *Service) *ProjectsService {
  123. rs := &ProjectsService{s: s}
  124. rs.Locations = NewProjectsLocationsService(s)
  125. rs.Regions = NewProjectsRegionsService(s)
  126. return rs
  127. }
  128. type ProjectsService struct {
  129. s *Service
  130. Locations *ProjectsLocationsService
  131. Regions *ProjectsRegionsService
  132. }
  133. func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
  134. rs := &ProjectsLocationsService{s: s}
  135. rs.AutoscalingPolicies = NewProjectsLocationsAutoscalingPoliciesService(s)
  136. rs.WorkflowTemplates = NewProjectsLocationsWorkflowTemplatesService(s)
  137. return rs
  138. }
  139. type ProjectsLocationsService struct {
  140. s *Service
  141. AutoscalingPolicies *ProjectsLocationsAutoscalingPoliciesService
  142. WorkflowTemplates *ProjectsLocationsWorkflowTemplatesService
  143. }
  144. func NewProjectsLocationsAutoscalingPoliciesService(s *Service) *ProjectsLocationsAutoscalingPoliciesService {
  145. rs := &ProjectsLocationsAutoscalingPoliciesService{s: s}
  146. return rs
  147. }
  148. type ProjectsLocationsAutoscalingPoliciesService struct {
  149. s *Service
  150. }
  151. func NewProjectsLocationsWorkflowTemplatesService(s *Service) *ProjectsLocationsWorkflowTemplatesService {
  152. rs := &ProjectsLocationsWorkflowTemplatesService{s: s}
  153. return rs
  154. }
  155. type ProjectsLocationsWorkflowTemplatesService struct {
  156. s *Service
  157. }
  158. func NewProjectsRegionsService(s *Service) *ProjectsRegionsService {
  159. rs := &ProjectsRegionsService{s: s}
  160. rs.AutoscalingPolicies = NewProjectsRegionsAutoscalingPoliciesService(s)
  161. rs.Clusters = NewProjectsRegionsClustersService(s)
  162. rs.Jobs = NewProjectsRegionsJobsService(s)
  163. rs.Operations = NewProjectsRegionsOperationsService(s)
  164. rs.WorkflowTemplates = NewProjectsRegionsWorkflowTemplatesService(s)
  165. return rs
  166. }
  167. type ProjectsRegionsService struct {
  168. s *Service
  169. AutoscalingPolicies *ProjectsRegionsAutoscalingPoliciesService
  170. Clusters *ProjectsRegionsClustersService
  171. Jobs *ProjectsRegionsJobsService
  172. Operations *ProjectsRegionsOperationsService
  173. WorkflowTemplates *ProjectsRegionsWorkflowTemplatesService
  174. }
  175. func NewProjectsRegionsAutoscalingPoliciesService(s *Service) *ProjectsRegionsAutoscalingPoliciesService {
  176. rs := &ProjectsRegionsAutoscalingPoliciesService{s: s}
  177. return rs
  178. }
  179. type ProjectsRegionsAutoscalingPoliciesService struct {
  180. s *Service
  181. }
  182. func NewProjectsRegionsClustersService(s *Service) *ProjectsRegionsClustersService {
  183. rs := &ProjectsRegionsClustersService{s: s}
  184. return rs
  185. }
  186. type ProjectsRegionsClustersService struct {
  187. s *Service
  188. }
  189. func NewProjectsRegionsJobsService(s *Service) *ProjectsRegionsJobsService {
  190. rs := &ProjectsRegionsJobsService{s: s}
  191. return rs
  192. }
  193. type ProjectsRegionsJobsService struct {
  194. s *Service
  195. }
  196. func NewProjectsRegionsOperationsService(s *Service) *ProjectsRegionsOperationsService {
  197. rs := &ProjectsRegionsOperationsService{s: s}
  198. return rs
  199. }
  200. type ProjectsRegionsOperationsService struct {
  201. s *Service
  202. }
  203. func NewProjectsRegionsWorkflowTemplatesService(s *Service) *ProjectsRegionsWorkflowTemplatesService {
  204. rs := &ProjectsRegionsWorkflowTemplatesService{s: s}
  205. return rs
  206. }
  207. type ProjectsRegionsWorkflowTemplatesService struct {
  208. s *Service
  209. }
  210. // AcceleratorConfig: Specifies the type and number of accelerator cards
  211. // attached to the instances of an instance group (see GPUs on Compute
  212. // Engine).
  213. type AcceleratorConfig struct {
  214. // AcceleratorCount: The number of the accelerator cards of this type
  215. // exposed to this instance.
  216. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  217. // AcceleratorTypeUri: Full URL, partial URI, or short name of the
  218. // accelerator type resource to expose to this instance. See Compute
  219. // Engine AcceleratorTypesExamples *
  220. // https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * nvidia-tesla-k80Auto Zone Exception: If you are using the Cloud Dataproc Auto Zone Placement feature, you must use the short name of the accelerator type resource, for example,
  221. // nvidia-tesla-k80.
  222. AcceleratorTypeUri string `json:"acceleratorTypeUri,omitempty"`
  223. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  224. // unconditionally include in API requests. By default, fields with
  225. // empty values are omitted from API requests. However, any non-pointer,
  226. // non-interface field appearing in ForceSendFields will be sent to the
  227. // server regardless of whether the field is empty or not. This may be
  228. // used to include empty fields in Patch requests.
  229. ForceSendFields []string `json:"-"`
  230. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  231. // include in API requests with the JSON null value. By default, fields
  232. // with empty values are omitted from API requests. However, any field
  233. // with an empty value appearing in NullFields will be sent to the
  234. // server as null. It is an error if a field in this list has a
  235. // non-empty value. This may be used to include null fields in Patch
  236. // requests.
  237. NullFields []string `json:"-"`
  238. }
  239. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  240. type NoMethod AcceleratorConfig
  241. raw := NoMethod(*s)
  242. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  243. }
  244. // AllocationAffinity: Allocation Affinity for consuming Zonal
  245. // allocation.
  246. type AllocationAffinity struct {
  247. // Possible values:
  248. // "TYPE_UNSPECIFIED"
  249. // "NO_ALLOCATION" - Do not consume from any allocated capacity.
  250. // "ANY_ALLOCATION" - Consume any allocation available.
  251. // "SPECIFIC_ALLOCATION" - Must consume from a specific allocation.
  252. // Must specify key value fields for specifying the allocations.
  253. ConsumeAllocationType string `json:"consumeAllocationType,omitempty"`
  254. // Key: Corresponds to the label key of Allocation resource.
  255. Key string `json:"key,omitempty"`
  256. // Values: Corresponds to the label values of allocation resource.
  257. Values []string `json:"values,omitempty"`
  258. // ForceSendFields is a list of field names (e.g.
  259. // "ConsumeAllocationType") to unconditionally include in API requests.
  260. // By default, fields with empty values are omitted from API requests.
  261. // However, any non-pointer, non-interface field appearing in
  262. // ForceSendFields will be sent to the server regardless of whether the
  263. // field is empty or not. This may be used to include empty fields in
  264. // Patch requests.
  265. ForceSendFields []string `json:"-"`
  266. // NullFields is a list of field names (e.g. "ConsumeAllocationType") to
  267. // include in API requests with the JSON null value. By default, fields
  268. // with empty values are omitted from API requests. However, any field
  269. // with an empty value appearing in NullFields will be sent to the
  270. // server as null. It is an error if a field in this list has a
  271. // non-empty value. This may be used to include null fields in Patch
  272. // requests.
  273. NullFields []string `json:"-"`
  274. }
  275. func (s *AllocationAffinity) MarshalJSON() ([]byte, error) {
  276. type NoMethod AllocationAffinity
  277. raw := NoMethod(*s)
  278. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  279. }
  280. // AutoscalingConfig: Autoscaling Policy config associated with the
  281. // cluster.
  282. type AutoscalingConfig struct {
  283. // PolicyUri: Optional. The autoscaling policy used by the cluster.Only
  284. // resource names including projectid and location (region) are valid.
  285. // Examples:
  286. // https://www.googleapis.com/compute/v1/projects/[project_id]/
  287. // locations/[dataproc_region]/autoscalingPolicies/[policy_id]
  288. // projects/[
  289. // project_id]/locations/[dataproc_region]/autoscalingPolicies/[policy_id
  290. // ]Note that the policy must be in the same project and Cloud Dataproc
  291. // region.
  292. PolicyUri string `json:"policyUri,omitempty"`
  293. // ForceSendFields is a list of field names (e.g. "PolicyUri") to
  294. // unconditionally include in API requests. By default, fields with
  295. // empty values are omitted from API requests. However, any non-pointer,
  296. // non-interface field appearing in ForceSendFields will be sent to the
  297. // server regardless of whether the field is empty or not. This may be
  298. // used to include empty fields in Patch requests.
  299. ForceSendFields []string `json:"-"`
  300. // NullFields is a list of field names (e.g. "PolicyUri") to include in
  301. // API requests with the JSON null value. By default, fields with empty
  302. // values are omitted from API requests. However, any field with an
  303. // empty value appearing in NullFields will be sent to the server as
  304. // null. It is an error if a field in this list has a non-empty value.
  305. // This may be used to include null fields in Patch requests.
  306. NullFields []string `json:"-"`
  307. }
  308. func (s *AutoscalingConfig) MarshalJSON() ([]byte, error) {
  309. type NoMethod AutoscalingConfig
  310. raw := NoMethod(*s)
  311. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  312. }
  313. // AutoscalingPolicy: Describes an autoscaling policy for Dataproc
  314. // cluster autoscaler.
  315. type AutoscalingPolicy struct {
  316. BasicAlgorithm *BasicAutoscalingAlgorithm `json:"basicAlgorithm,omitempty"`
  317. // Id: Required. The policy id.The id must contain only letters (a-z,
  318. // A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin
  319. // or end with underscore or hyphen. Must consist of between 3 and 50
  320. // characters.
  321. Id string `json:"id,omitempty"`
  322. // Name: Output only. The "resource name" of the policy, as described in
  323. // https://cloud.google.com/apis/design/resource_names of the form
  324. // projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}
  325. // .
  326. Name string `json:"name,omitempty"`
  327. // SecondaryWorkerConfig: Optional. Describes how the autoscaler will
  328. // operate for secondary workers.
  329. SecondaryWorkerConfig *InstanceGroupAutoscalingPolicyConfig `json:"secondaryWorkerConfig,omitempty"`
  330. // WorkerConfig: Required. Describes how the autoscaler will operate for
  331. // primary workers.
  332. WorkerConfig *InstanceGroupAutoscalingPolicyConfig `json:"workerConfig,omitempty"`
  333. // ServerResponse contains the HTTP response code and headers from the
  334. // server.
  335. googleapi.ServerResponse `json:"-"`
  336. // ForceSendFields is a list of field names (e.g. "BasicAlgorithm") to
  337. // unconditionally include in API requests. By default, fields with
  338. // empty values are omitted from API requests. However, any non-pointer,
  339. // non-interface field appearing in ForceSendFields will be sent to the
  340. // server regardless of whether the field is empty or not. This may be
  341. // used to include empty fields in Patch requests.
  342. ForceSendFields []string `json:"-"`
  343. // NullFields is a list of field names (e.g. "BasicAlgorithm") to
  344. // include in API requests with the JSON null value. By default, fields
  345. // with empty values are omitted from API requests. However, any field
  346. // with an empty value appearing in NullFields will be sent to the
  347. // server as null. It is an error if a field in this list has a
  348. // non-empty value. This may be used to include null fields in Patch
  349. // requests.
  350. NullFields []string `json:"-"`
  351. }
  352. func (s *AutoscalingPolicy) MarshalJSON() ([]byte, error) {
  353. type NoMethod AutoscalingPolicy
  354. raw := NoMethod(*s)
  355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  356. }
  357. // BasicAutoscalingAlgorithm: Basic algorithm for autoscaling.
  358. type BasicAutoscalingAlgorithm struct {
  359. // CooldownPeriod: Optional. Duration between scaling events. A scaling
  360. // period starts after the update operation from the previous event has
  361. // completed.Bounds: 2m, 1d. Default: 2m.
  362. CooldownPeriod string `json:"cooldownPeriod,omitempty"`
  363. // YarnConfig: Required. YARN autoscaling configuration.
  364. YarnConfig *BasicYarnAutoscalingConfig `json:"yarnConfig,omitempty"`
  365. // ForceSendFields is a list of field names (e.g. "CooldownPeriod") to
  366. // unconditionally include in API requests. By default, fields with
  367. // empty values are omitted from API requests. However, any non-pointer,
  368. // non-interface field appearing in ForceSendFields will be sent to the
  369. // server regardless of whether the field is empty or not. This may be
  370. // used to include empty fields in Patch requests.
  371. ForceSendFields []string `json:"-"`
  372. // NullFields is a list of field names (e.g. "CooldownPeriod") to
  373. // include in API requests with the JSON null value. By default, fields
  374. // with empty values are omitted from API requests. However, any field
  375. // with an empty value appearing in NullFields will be sent to the
  376. // server as null. It is an error if a field in this list has a
  377. // non-empty value. This may be used to include null fields in Patch
  378. // requests.
  379. NullFields []string `json:"-"`
  380. }
  381. func (s *BasicAutoscalingAlgorithm) MarshalJSON() ([]byte, error) {
  382. type NoMethod BasicAutoscalingAlgorithm
  383. raw := NoMethod(*s)
  384. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  385. }
  386. // BasicYarnAutoscalingConfig: Basic autoscaling configurations for
  387. // YARN.
  388. type BasicYarnAutoscalingConfig struct {
  389. // GracefulDecommissionTimeout: Required. Timeout for YARN graceful
  390. // decommissioning of Node Managers. Specifies the duration to wait for
  391. // jobs to complete before forcefully removing workers (and potentially
  392. // interrupting jobs). Only applicable to downscaling operations.Bounds:
  393. // 0s, 1d.
  394. GracefulDecommissionTimeout string `json:"gracefulDecommissionTimeout,omitempty"`
  395. // ScaleDownFactor: Required. Fraction of average pending memory in the
  396. // last cooldown period for which to remove workers. A scale-down factor
  397. // of 1 will result in scaling down so that there is no available memory
  398. // remaining after the update (more aggressive scaling). A scale-down
  399. // factor of 0 disables removing workers, which can be beneficial for
  400. // autoscaling a single job.Bounds: 0.0, 1.0.
  401. ScaleDownFactor float64 `json:"scaleDownFactor,omitempty"`
  402. // ScaleDownMinWorkerFraction: Optional. Minimum scale-down threshold as
  403. // a fraction of total cluster size before scaling occurs. For example,
  404. // in a 20-worker cluster, a threshold of 0.1 means the autoscaler must
  405. // recommend at least a 2 worker scale-down for the cluster to scale. A
  406. // threshold of 0 means the autoscaler will scale down on any
  407. // recommended change.Bounds: 0.0, 1.0. Default: 0.0.
  408. ScaleDownMinWorkerFraction float64 `json:"scaleDownMinWorkerFraction,omitempty"`
  409. // ScaleUpFactor: Required. Fraction of average pending memory in the
  410. // last cooldown period for which to add workers. A scale-up factor of
  411. // 1.0 will result in scaling up so that there is no pending memory
  412. // remaining after the update (more aggressive scaling). A scale-up
  413. // factor closer to 0 will result in a smaller magnitude of scaling up
  414. // (less aggressive scaling).Bounds: 0.0, 1.0.
  415. ScaleUpFactor float64 `json:"scaleUpFactor,omitempty"`
  416. // ScaleUpMinWorkerFraction: Optional. Minimum scale-up threshold as a
  417. // fraction of total cluster size before scaling occurs. For example, in
  418. // a 20-worker cluster, a threshold of 0.1 means the autoscaler must
  419. // recommend at least a 2-worker scale-up for the cluster to scale. A
  420. // threshold of 0 means the autoscaler will scale up on any recommended
  421. // change.Bounds: 0.0, 1.0. Default: 0.0.
  422. ScaleUpMinWorkerFraction float64 `json:"scaleUpMinWorkerFraction,omitempty"`
  423. // ForceSendFields is a list of field names (e.g.
  424. // "GracefulDecommissionTimeout") to unconditionally include in API
  425. // requests. By default, fields with empty values are omitted from API
  426. // requests. However, any non-pointer, non-interface field appearing in
  427. // ForceSendFields will be sent to the server regardless of whether the
  428. // field is empty or not. This may be used to include empty fields in
  429. // Patch requests.
  430. ForceSendFields []string `json:"-"`
  431. // NullFields is a list of field names (e.g.
  432. // "GracefulDecommissionTimeout") to include in API requests with the
  433. // JSON null value. By default, fields with empty values are omitted
  434. // from API requests. However, any field with an empty value appearing
  435. // in NullFields will be sent to the server as null. It is an error if a
  436. // field in this list has a non-empty value. This may be used to include
  437. // null fields in Patch requests.
  438. NullFields []string `json:"-"`
  439. }
  440. func (s *BasicYarnAutoscalingConfig) MarshalJSON() ([]byte, error) {
  441. type NoMethod BasicYarnAutoscalingConfig
  442. raw := NoMethod(*s)
  443. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  444. }
  445. func (s *BasicYarnAutoscalingConfig) UnmarshalJSON(data []byte) error {
  446. type NoMethod BasicYarnAutoscalingConfig
  447. var s1 struct {
  448. ScaleDownFactor gensupport.JSONFloat64 `json:"scaleDownFactor"`
  449. ScaleDownMinWorkerFraction gensupport.JSONFloat64 `json:"scaleDownMinWorkerFraction"`
  450. ScaleUpFactor gensupport.JSONFloat64 `json:"scaleUpFactor"`
  451. ScaleUpMinWorkerFraction gensupport.JSONFloat64 `json:"scaleUpMinWorkerFraction"`
  452. *NoMethod
  453. }
  454. s1.NoMethod = (*NoMethod)(s)
  455. if err := json.Unmarshal(data, &s1); err != nil {
  456. return err
  457. }
  458. s.ScaleDownFactor = float64(s1.ScaleDownFactor)
  459. s.ScaleDownMinWorkerFraction = float64(s1.ScaleDownMinWorkerFraction)
  460. s.ScaleUpFactor = float64(s1.ScaleUpFactor)
  461. s.ScaleUpMinWorkerFraction = float64(s1.ScaleUpMinWorkerFraction)
  462. return nil
  463. }
  464. // Binding: Associates members with a role.
  465. type Binding struct {
  466. // Condition: Unimplemented. The condition that is associated with this
  467. // binding. NOTE: an unsatisfied condition will not allow user access
  468. // via current binding. Different bindings, including their conditions,
  469. // are examined independently.
  470. Condition *Expr `json:"condition,omitempty"`
  471. // Members: Specifies the identities requesting access for a Cloud
  472. // Platform resource. members can have the following values:
  473. // allUsers: A special identifier that represents anyone who is on the
  474. // internet; with or without a Google account.
  475. // allAuthenticatedUsers: A special identifier that represents anyone
  476. // who is authenticated with a Google account or a service
  477. // account.
  478. // user:{emailid}: An email address that represents a specific Google
  479. // account. For example, alice@gmail.com .
  480. // serviceAccount:{emailid}: An email address that represents a service
  481. // account. For example,
  482. // my-other-app@appspot.gserviceaccount.com.
  483. // group:{emailid}: An email address that represents a Google group.
  484. // For example, admins@example.com.
  485. // domain:{domain}: The G Suite domain (primary) that represents all the
  486. // users of that domain. For example, google.com or example.com.
  487. Members []string `json:"members,omitempty"`
  488. // Role: Role that is assigned to members. For example, roles/viewer,
  489. // roles/editor, or roles/owner.
  490. Role string `json:"role,omitempty"`
  491. // ForceSendFields is a list of field names (e.g. "Condition") to
  492. // unconditionally include in API requests. By default, fields with
  493. // empty values are omitted from API requests. However, any non-pointer,
  494. // non-interface field appearing in ForceSendFields will be sent to the
  495. // server regardless of whether the field is empty or not. This may be
  496. // used to include empty fields in Patch requests.
  497. ForceSendFields []string `json:"-"`
  498. // NullFields is a list of field names (e.g. "Condition") to include in
  499. // API requests with the JSON null value. By default, fields with empty
  500. // values are omitted from API requests. However, any field with an
  501. // empty value appearing in NullFields will be sent to the server as
  502. // null. It is an error if a field in this list has a non-empty value.
  503. // This may be used to include null fields in Patch requests.
  504. NullFields []string `json:"-"`
  505. }
  506. func (s *Binding) MarshalJSON() ([]byte, error) {
  507. type NoMethod Binding
  508. raw := NoMethod(*s)
  509. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  510. }
  511. // CancelJobRequest: A request to cancel a job.
  512. type CancelJobRequest struct {
  513. }
  514. // Cluster: Describes the identifying information, config, and status of
  515. // a cluster of Compute Engine instances.
  516. type Cluster struct {
  517. // ClusterName: Required. The cluster name. Cluster names within a
  518. // project must be unique. Names of deleted clusters can be reused.
  519. ClusterName string `json:"clusterName,omitempty"`
  520. // ClusterUuid: Output only. A cluster UUID (Unique Universal
  521. // Identifier). Cloud Dataproc generates this value when it creates the
  522. // cluster.
  523. ClusterUuid string `json:"clusterUuid,omitempty"`
  524. // Config: Required. The cluster config. Note that Cloud Dataproc may
  525. // set default values, and values may change when clusters are updated.
  526. Config *ClusterConfig `json:"config,omitempty"`
  527. // Labels: Optional. The labels to associate with this cluster. Label
  528. // keys must contain 1 to 63 characters, and must conform to RFC 1035
  529. // (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty,
  530. // but, if present, must contain 1 to 63 characters, and must conform to
  531. // RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32
  532. // labels can be associated with a cluster.
  533. Labels map[string]string `json:"labels,omitempty"`
  534. // Metrics: Output only. Contains cluster daemon metrics such as HDFS
  535. // and YARN stats.Beta Feature: This report is available for testing
  536. // purposes only. It may be changed before final release.
  537. Metrics *ClusterMetrics `json:"metrics,omitempty"`
  538. // ProjectId: Required. The Google Cloud Platform project ID that the
  539. // cluster belongs to.
  540. ProjectId string `json:"projectId,omitempty"`
  541. // Status: Output only. Cluster status.
  542. Status *ClusterStatus `json:"status,omitempty"`
  543. // StatusHistory: Output only. The previous cluster status.
  544. StatusHistory []*ClusterStatus `json:"statusHistory,omitempty"`
  545. // ServerResponse contains the HTTP response code and headers from the
  546. // server.
  547. googleapi.ServerResponse `json:"-"`
  548. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  549. // unconditionally include in API requests. By default, fields with
  550. // empty values are omitted from API requests. However, any non-pointer,
  551. // non-interface field appearing in ForceSendFields will be sent to the
  552. // server regardless of whether the field is empty or not. This may be
  553. // used to include empty fields in Patch requests.
  554. ForceSendFields []string `json:"-"`
  555. // NullFields is a list of field names (e.g. "ClusterName") to include
  556. // in API requests with the JSON null value. By default, fields with
  557. // empty values are omitted from API requests. However, any field with
  558. // an empty value appearing in NullFields will be sent to the server as
  559. // null. It is an error if a field in this list has a non-empty value.
  560. // This may be used to include null fields in Patch requests.
  561. NullFields []string `json:"-"`
  562. }
  563. func (s *Cluster) MarshalJSON() ([]byte, error) {
  564. type NoMethod Cluster
  565. raw := NoMethod(*s)
  566. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  567. }
  568. // ClusterConfig: The cluster config.
  569. type ClusterConfig struct {
  570. // AutoscalingConfig: Optional. Autoscaling config for the policy
  571. // associated with the cluster. Cluster does not autoscale if this field
  572. // is unset.
  573. AutoscalingConfig *AutoscalingConfig `json:"autoscalingConfig,omitempty"`
  574. // ConfigBucket: Optional. A Google Cloud Storage bucket used to stage
  575. // job dependencies, config files, and job driver console output. If you
  576. // do not specify a staging bucket, Cloud Dataproc will determine a
  577. // Cloud Storage location (US, ASIA, or EU) for your cluster's staging
  578. // bucket according to the Google Compute Engine zone where your cluster
  579. // is deployed, and then create and manage this project-level,
  580. // per-location bucket (see Cloud Dataproc staging bucket).
  581. ConfigBucket string `json:"configBucket,omitempty"`
  582. // EncryptionConfig: Optional. Encryption settings for the cluster.
  583. EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"`
  584. // EndpointConfig: Optional. Port/endpoint configuration for this
  585. // cluster
  586. EndpointConfig *EndpointConfig `json:"endpointConfig,omitempty"`
  587. // GceClusterConfig: Optional. The shared Compute Engine config settings
  588. // for all instances in a cluster.
  589. GceClusterConfig *GceClusterConfig `json:"gceClusterConfig,omitempty"`
  590. // InitializationActions: Optional. Commands to execute on each node
  591. // after config is completed. By default, executables are run on master
  592. // and all worker nodes. You can test a node's <code>role</code>
  593. // metadata to run an executable on a master or worker node, as shown
  594. // below using curl (you can also use wget):
  595. // ROLE=$(curl -H Metadata-Flavor:Google
  596. // http://metadata/computeMetadata/v1beta2/instance/attributes/dataproc-role)
  597. // if [[ "${ROLE}" == 'Master' ]]; then
  598. // ... master specific actions ...
  599. // else
  600. // ... worker specific actions ...
  601. // fi
  602. //
  603. InitializationActions []*NodeInitializationAction `json:"initializationActions,omitempty"`
  604. // LifecycleConfig: Optional. The config setting for auto delete cluster
  605. // schedule.
  606. LifecycleConfig *LifecycleConfig `json:"lifecycleConfig,omitempty"`
  607. // MasterConfig: Optional. The Compute Engine config settings for the
  608. // master instance in a cluster.
  609. MasterConfig *InstanceGroupConfig `json:"masterConfig,omitempty"`
  610. // SecondaryWorkerConfig: Optional. The Compute Engine config settings
  611. // for additional worker instances in a cluster.
  612. SecondaryWorkerConfig *InstanceGroupConfig `json:"secondaryWorkerConfig,omitempty"`
  613. // SecurityConfig: Optional. Security related configuration.
  614. SecurityConfig *SecurityConfig `json:"securityConfig,omitempty"`
  615. // SoftwareConfig: Optional. The config settings for software inside the
  616. // cluster.
  617. SoftwareConfig *SoftwareConfig `json:"softwareConfig,omitempty"`
  618. // WorkerConfig: Optional. The Compute Engine config settings for worker
  619. // instances in a cluster.
  620. WorkerConfig *InstanceGroupConfig `json:"workerConfig,omitempty"`
  621. // ForceSendFields is a list of field names (e.g. "AutoscalingConfig")
  622. // to unconditionally include in API requests. By default, fields with
  623. // empty values are omitted from API requests. However, any non-pointer,
  624. // non-interface field appearing in ForceSendFields will be sent to the
  625. // server regardless of whether the field is empty or not. This may be
  626. // used to include empty fields in Patch requests.
  627. ForceSendFields []string `json:"-"`
  628. // NullFields is a list of field names (e.g. "AutoscalingConfig") to
  629. // include in API requests with the JSON null value. By default, fields
  630. // with empty values are omitted from API requests. However, any field
  631. // with an empty value appearing in NullFields will be sent to the
  632. // server as null. It is an error if a field in this list has a
  633. // non-empty value. This may be used to include null fields in Patch
  634. // requests.
  635. NullFields []string `json:"-"`
  636. }
  637. func (s *ClusterConfig) MarshalJSON() ([]byte, error) {
  638. type NoMethod ClusterConfig
  639. raw := NoMethod(*s)
  640. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  641. }
  642. // ClusterMetrics: Contains cluster daemon metrics, such as HDFS and
  643. // YARN stats.Beta Feature: This report is available for testing
  644. // purposes only. It may be changed before final release.
  645. type ClusterMetrics struct {
  646. // HdfsMetrics: The HDFS metrics.
  647. HdfsMetrics map[string]string `json:"hdfsMetrics,omitempty"`
  648. // YarnMetrics: The YARN metrics.
  649. YarnMetrics map[string]string `json:"yarnMetrics,omitempty"`
  650. // ForceSendFields is a list of field names (e.g. "HdfsMetrics") to
  651. // unconditionally include in API requests. By default, fields with
  652. // empty values are omitted from API requests. However, any non-pointer,
  653. // non-interface field appearing in ForceSendFields will be sent to the
  654. // server regardless of whether the field is empty or not. This may be
  655. // used to include empty fields in Patch requests.
  656. ForceSendFields []string `json:"-"`
  657. // NullFields is a list of field names (e.g. "HdfsMetrics") to include
  658. // in API requests with the JSON null value. By default, fields with
  659. // empty values are omitted from API requests. However, any field with
  660. // an empty value appearing in NullFields will be sent to the server as
  661. // null. It is an error if a field in this list has a non-empty value.
  662. // This may be used to include null fields in Patch requests.
  663. NullFields []string `json:"-"`
  664. }
  665. func (s *ClusterMetrics) MarshalJSON() ([]byte, error) {
  666. type NoMethod ClusterMetrics
  667. raw := NoMethod(*s)
  668. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  669. }
  670. // ClusterOperation: The cluster operation triggered by a workflow.
  671. type ClusterOperation struct {
  672. // Done: Output only. Indicates the operation is done.
  673. Done bool `json:"done,omitempty"`
  674. // Error: Output only. Error, if operation failed.
  675. Error string `json:"error,omitempty"`
  676. // OperationId: Output only. The id of the cluster operation.
  677. OperationId string `json:"operationId,omitempty"`
  678. // ForceSendFields is a list of field names (e.g. "Done") to
  679. // unconditionally include in API requests. By default, fields with
  680. // empty values are omitted from API requests. However, any non-pointer,
  681. // non-interface field appearing in ForceSendFields will be sent to the
  682. // server regardless of whether the field is empty or not. This may be
  683. // used to include empty fields in Patch requests.
  684. ForceSendFields []string `json:"-"`
  685. // NullFields is a list of field names (e.g. "Done") to include in API
  686. // requests with the JSON null value. By default, fields with empty
  687. // values are omitted from API requests. However, any field with an
  688. // empty value appearing in NullFields will be sent to the server as
  689. // null. It is an error if a field in this list has a non-empty value.
  690. // This may be used to include null fields in Patch requests.
  691. NullFields []string `json:"-"`
  692. }
  693. func (s *ClusterOperation) MarshalJSON() ([]byte, error) {
  694. type NoMethod ClusterOperation
  695. raw := NoMethod(*s)
  696. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  697. }
  698. // ClusterOperationMetadata: Metadata describing the operation.
  699. type ClusterOperationMetadata struct {
  700. // ClusterName: Output only. Name of the cluster for the operation.
  701. ClusterName string `json:"clusterName,omitempty"`
  702. // ClusterUuid: Output only. Cluster UUID for the operation.
  703. ClusterUuid string `json:"clusterUuid,omitempty"`
  704. // Description: Output only. Short description of operation.
  705. Description string `json:"description,omitempty"`
  706. // Labels: Output only. Labels associated with the operation
  707. Labels map[string]string `json:"labels,omitempty"`
  708. // OperationType: Output only. The operation type.
  709. OperationType string `json:"operationType,omitempty"`
  710. // Status: Output only. Current operation status.
  711. Status *ClusterOperationStatus `json:"status,omitempty"`
  712. // StatusHistory: Output only. The previous operation status.
  713. StatusHistory []*ClusterOperationStatus `json:"statusHistory,omitempty"`
  714. // Warnings: Output only. Errors encountered during operation execution.
  715. Warnings []string `json:"warnings,omitempty"`
  716. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  717. // unconditionally include in API requests. By default, fields with
  718. // empty values are omitted from API requests. However, any non-pointer,
  719. // non-interface field appearing in ForceSendFields will be sent to the
  720. // server regardless of whether the field is empty or not. This may be
  721. // used to include empty fields in Patch requests.
  722. ForceSendFields []string `json:"-"`
  723. // NullFields is a list of field names (e.g. "ClusterName") to include
  724. // in API requests with the JSON null value. By default, fields with
  725. // empty values are omitted from API requests. However, any field with
  726. // an empty value appearing in NullFields will be sent to the server as
  727. // null. It is an error if a field in this list has a non-empty value.
  728. // This may be used to include null fields in Patch requests.
  729. NullFields []string `json:"-"`
  730. }
  731. func (s *ClusterOperationMetadata) MarshalJSON() ([]byte, error) {
  732. type NoMethod ClusterOperationMetadata
  733. raw := NoMethod(*s)
  734. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  735. }
  736. // ClusterOperationStatus: The status of the operation.
  737. type ClusterOperationStatus struct {
  738. // Details: Output only. A message containing any operation metadata
  739. // details.
  740. Details string `json:"details,omitempty"`
  741. // InnerState: Output only. A message containing the detailed operation
  742. // state.
  743. InnerState string `json:"innerState,omitempty"`
  744. // State: Output only. A message containing the operation state.
  745. //
  746. // Possible values:
  747. // "UNKNOWN" - Unused.
  748. // "PENDING" - The operation has been created.
  749. // "RUNNING" - The operation is running.
  750. // "DONE" - The operation is done; either cancelled or completed.
  751. State string `json:"state,omitempty"`
  752. // StateStartTime: Output only. The time this state was entered.
  753. StateStartTime string `json:"stateStartTime,omitempty"`
  754. // ForceSendFields is a list of field names (e.g. "Details") to
  755. // unconditionally include in API requests. By default, fields with
  756. // empty values are omitted from API requests. However, any non-pointer,
  757. // non-interface field appearing in ForceSendFields will be sent to the
  758. // server regardless of whether the field is empty or not. This may be
  759. // used to include empty fields in Patch requests.
  760. ForceSendFields []string `json:"-"`
  761. // NullFields is a list of field names (e.g. "Details") to include in
  762. // API requests with the JSON null value. By default, fields with empty
  763. // values are omitted from API requests. However, any field with an
  764. // empty value appearing in NullFields will be sent to the server as
  765. // null. It is an error if a field in this list has a non-empty value.
  766. // This may be used to include null fields in Patch requests.
  767. NullFields []string `json:"-"`
  768. }
  769. func (s *ClusterOperationStatus) MarshalJSON() ([]byte, error) {
  770. type NoMethod ClusterOperationStatus
  771. raw := NoMethod(*s)
  772. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  773. }
  774. // ClusterSelector: A selector that chooses target cluster for jobs
  775. // based on metadata.
  776. type ClusterSelector struct {
  777. // ClusterLabels: Required. The cluster labels. Cluster must have all
  778. // labels to match.
  779. ClusterLabels map[string]string `json:"clusterLabels,omitempty"`
  780. // Zone: Optional. The zone where workflow process executes. This
  781. // parameter does not affect the selection of the cluster.If
  782. // unspecified, the zone of the first cluster matching the selector is
  783. // used.
  784. Zone string `json:"zone,omitempty"`
  785. // ForceSendFields is a list of field names (e.g. "ClusterLabels") to
  786. // unconditionally include in API requests. By default, fields with
  787. // empty values are omitted from API requests. However, any non-pointer,
  788. // non-interface field appearing in ForceSendFields will be sent to the
  789. // server regardless of whether the field is empty or not. This may be
  790. // used to include empty fields in Patch requests.
  791. ForceSendFields []string `json:"-"`
  792. // NullFields is a list of field names (e.g. "ClusterLabels") to include
  793. // in API requests with the JSON null value. By default, fields with
  794. // empty values are omitted from API requests. However, any field with
  795. // an empty value appearing in NullFields will be sent to the server as
  796. // null. It is an error if a field in this list has a non-empty value.
  797. // This may be used to include null fields in Patch requests.
  798. NullFields []string `json:"-"`
  799. }
  800. func (s *ClusterSelector) MarshalJSON() ([]byte, error) {
  801. type NoMethod ClusterSelector
  802. raw := NoMethod(*s)
  803. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  804. }
  805. // ClusterStatus: The status of a cluster and its instances.
  806. type ClusterStatus struct {
  807. // Detail: Output only. Optional details of cluster's state.
  808. Detail string `json:"detail,omitempty"`
  809. // State: Output only. The cluster's state.
  810. //
  811. // Possible values:
  812. // "UNKNOWN" - The cluster state is unknown.
  813. // "CREATING" - The cluster is being created and set up. It is not
  814. // ready for use.
  815. // "RUNNING" - The cluster is currently running and healthy. It is
  816. // ready for use.
  817. // "ERROR" - The cluster encountered an error. It is not ready for
  818. // use.
  819. // "DELETING" - The cluster is being deleted. It cannot be used.
  820. // "UPDATING" - The cluster is being updated. It continues to accept
  821. // and process jobs.
  822. State string `json:"state,omitempty"`
  823. // StateStartTime: Output only. Time when this state was entered.
  824. StateStartTime string `json:"stateStartTime,omitempty"`
  825. // Substate: Output only. Additional state information that includes
  826. // status reported by the agent.
  827. //
  828. // Possible values:
  829. // "UNSPECIFIED" - The cluster substate is unknown.
  830. // "UNHEALTHY" - The cluster is known to be in an unhealthy state (for
  831. // example, critical daemons are not running or HDFS capacity is
  832. // exhausted).Applies to RUNNING state.
  833. // "STALE_STATUS" - The agent-reported status is out of date (may
  834. // occur if Cloud Dataproc loses communication with Agent).Applies to
  835. // RUNNING state.
  836. Substate string `json:"substate,omitempty"`
  837. // ForceSendFields is a list of field names (e.g. "Detail") to
  838. // unconditionally include in API requests. By default, fields with
  839. // empty values are omitted from API requests. However, any non-pointer,
  840. // non-interface field appearing in ForceSendFields will be sent to the
  841. // server regardless of whether the field is empty or not. This may be
  842. // used to include empty fields in Patch requests.
  843. ForceSendFields []string `json:"-"`
  844. // NullFields is a list of field names (e.g. "Detail") to include in API
  845. // requests with the JSON null value. By default, fields with empty
  846. // values are omitted from API requests. However, any field with an
  847. // empty value appearing in NullFields will be sent to the server as
  848. // null. It is an error if a field in this list has a non-empty value.
  849. // This may be used to include null fields in Patch requests.
  850. NullFields []string `json:"-"`
  851. }
  852. func (s *ClusterStatus) MarshalJSON() ([]byte, error) {
  853. type NoMethod ClusterStatus
  854. raw := NoMethod(*s)
  855. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  856. }
  857. // DiagnoseClusterRequest: A request to collect cluster diagnostic
  858. // information.
  859. type DiagnoseClusterRequest struct {
  860. }
  861. // DiagnoseClusterResults: The location of diagnostic output.
  862. type DiagnoseClusterResults struct {
  863. // OutputUri: Output only. The Cloud Storage URI of the diagnostic
  864. // output. The output report is a plain text file with a summary of
  865. // collected diagnostics.
  866. OutputUri string `json:"outputUri,omitempty"`
  867. // ForceSendFields is a list of field names (e.g. "OutputUri") to
  868. // unconditionally include in API requests. By default, fields with
  869. // empty values are omitted from API requests. However, any non-pointer,
  870. // non-interface field appearing in ForceSendFields will be sent to the
  871. // server regardless of whether the field is empty or not. This may be
  872. // used to include empty fields in Patch requests.
  873. ForceSendFields []string `json:"-"`
  874. // NullFields is a list of field names (e.g. "OutputUri") to include in
  875. // API requests with the JSON null value. By default, fields with empty
  876. // values are omitted from API requests. However, any field with an
  877. // empty value appearing in NullFields will be sent to the server as
  878. // null. It is an error if a field in this list has a non-empty value.
  879. // This may be used to include null fields in Patch requests.
  880. NullFields []string `json:"-"`
  881. }
  882. func (s *DiagnoseClusterResults) MarshalJSON() ([]byte, error) {
  883. type NoMethod DiagnoseClusterResults
  884. raw := NoMethod(*s)
  885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  886. }
  887. // DiskConfig: Specifies the config of disk options for a group of VM
  888. // instances.
  889. type DiskConfig struct {
  890. // BootDiskSizeGb: Optional. Size in GB of the boot disk (default is
  891. // 500GB).
  892. BootDiskSizeGb int64 `json:"bootDiskSizeGb,omitempty"`
  893. // BootDiskType: Optional. Type of the boot disk (default is
  894. // "pd-standard"). Valid values: "pd-ssd" (Persistent Disk Solid State
  895. // Drive) or "pd-standard" (Persistent Disk Hard Disk Drive).
  896. BootDiskType string `json:"bootDiskType,omitempty"`
  897. // NumLocalSsds: Optional. Number of attached SSDs, from 0 to 4 (default
  898. // is 0). If SSDs are not attached, the boot disk is used to store
  899. // runtime logs and HDFS
  900. // (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If
  901. // one or more SSDs are attached, this runtime bulk data is spread
  902. // across them, and the boot disk contains only basic config and
  903. // installed binaries.
  904. NumLocalSsds int64 `json:"numLocalSsds,omitempty"`
  905. // ForceSendFields is a list of field names (e.g. "BootDiskSizeGb") to
  906. // unconditionally include in API requests. By default, fields with
  907. // empty values are omitted from API requests. However, any non-pointer,
  908. // non-interface field appearing in ForceSendFields will be sent to the
  909. // server regardless of whether the field is empty or not. This may be
  910. // used to include empty fields in Patch requests.
  911. ForceSendFields []string `json:"-"`
  912. // NullFields is a list of field names (e.g. "BootDiskSizeGb") to
  913. // include in API requests with the JSON null value. By default, fields
  914. // with empty values are omitted from API requests. However, any field
  915. // with an empty value appearing in NullFields will be sent to the
  916. // server as null. It is an error if a field in this list has a
  917. // non-empty value. This may be used to include null fields in Patch
  918. // requests.
  919. NullFields []string `json:"-"`
  920. }
  921. func (s *DiskConfig) MarshalJSON() ([]byte, error) {
  922. type NoMethod DiskConfig
  923. raw := NoMethod(*s)
  924. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  925. }
  926. // Empty: A generic empty message that you can re-use to avoid defining
  927. // duplicated empty messages in your APIs. A typical example is to use
  928. // it as the request or the response type of an API method. For
  929. // instance:
  930. // service Foo {
  931. // rpc Bar(google.protobuf.Empty) returns
  932. // (google.protobuf.Empty);
  933. // }
  934. // The JSON representation for Empty is empty JSON object {}.
  935. type Empty struct {
  936. // ServerResponse contains the HTTP response code and headers from the
  937. // server.
  938. googleapi.ServerResponse `json:"-"`
  939. }
  940. // EncryptionConfig: Encryption settings for the cluster.
  941. type EncryptionConfig struct {
  942. // GcePdKmsKeyName: Optional. The Cloud KMS key name to use for PD disk
  943. // encryption for all instances in the cluster.
  944. GcePdKmsKeyName string `json:"gcePdKmsKeyName,omitempty"`
  945. // ForceSendFields is a list of field names (e.g. "GcePdKmsKeyName") to
  946. // unconditionally include in API requests. By default, fields with
  947. // empty values are omitted from API requests. However, any non-pointer,
  948. // non-interface field appearing in ForceSendFields will be sent to the
  949. // server regardless of whether the field is empty or not. This may be
  950. // used to include empty fields in Patch requests.
  951. ForceSendFields []string `json:"-"`
  952. // NullFields is a list of field names (e.g. "GcePdKmsKeyName") to
  953. // include in API requests with the JSON null value. By default, fields
  954. // with empty values are omitted from API requests. However, any field
  955. // with an empty value appearing in NullFields will be sent to the
  956. // server as null. It is an error if a field in this list has a
  957. // non-empty value. This may be used to include null fields in Patch
  958. // requests.
  959. NullFields []string `json:"-"`
  960. }
  961. func (s *EncryptionConfig) MarshalJSON() ([]byte, error) {
  962. type NoMethod EncryptionConfig
  963. raw := NoMethod(*s)
  964. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  965. }
  966. // EndpointConfig: Endpoint config for this cluster
  967. type EndpointConfig struct {
  968. // EnableHttpPortAccess: Optional. If true, enable http access to
  969. // specific ports on the cluster from external sources. Defaults to
  970. // false.
  971. EnableHttpPortAccess bool `json:"enableHttpPortAccess,omitempty"`
  972. // HttpPorts: Output only. The map of port descriptions to URLs. Will
  973. // only be populated if enable_http_port_access is true.
  974. HttpPorts map[string]string `json:"httpPorts,omitempty"`
  975. // ForceSendFields is a list of field names (e.g.
  976. // "EnableHttpPortAccess") to unconditionally include in API requests.
  977. // By default, fields with empty values are omitted from API requests.
  978. // However, any non-pointer, non-interface field appearing in
  979. // ForceSendFields will be sent to the server regardless of whether the
  980. // field is empty or not. This may be used to include empty fields in
  981. // Patch requests.
  982. ForceSendFields []string `json:"-"`
  983. // NullFields is a list of field names (e.g. "EnableHttpPortAccess") to
  984. // include in API requests with the JSON null value. By default, fields
  985. // with empty values are omitted from API requests. However, any field
  986. // with an empty value appearing in NullFields will be sent to the
  987. // server as null. It is an error if a field in this list has a
  988. // non-empty value. This may be used to include null fields in Patch
  989. // requests.
  990. NullFields []string `json:"-"`
  991. }
  992. func (s *EndpointConfig) MarshalJSON() ([]byte, error) {
  993. type NoMethod EndpointConfig
  994. raw := NoMethod(*s)
  995. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  996. }
  997. // Expr: Represents an expression text. Example:
  998. // title: "User account presence"
  999. // description: "Determines whether the request has a user
  1000. // account"
  1001. // expression: "size(request.user) > 0"
  1002. //
  1003. type Expr struct {
  1004. // Description: An optional description of the expression. This is a
  1005. // longer text which describes the expression, e.g. when hovered over it
  1006. // in a UI.
  1007. Description string `json:"description,omitempty"`
  1008. // Expression: Textual representation of an expression in Common
  1009. // Expression Language syntax.The application context of the containing
  1010. // message determines which well-known feature set of CEL is supported.
  1011. Expression string `json:"expression,omitempty"`
  1012. // Location: An optional string indicating the location of the
  1013. // expression for error reporting, e.g. a file name and a position in
  1014. // the file.
  1015. Location string `json:"location,omitempty"`
  1016. // Title: An optional title for the expression, i.e. a short string
  1017. // describing its purpose. This can be used e.g. in UIs which allow to
  1018. // enter the expression.
  1019. Title string `json:"title,omitempty"`
  1020. // ForceSendFields is a list of field names (e.g. "Description") to
  1021. // unconditionally include in API requests. By default, fields with
  1022. // empty values are omitted from API requests. However, any non-pointer,
  1023. // non-interface field appearing in ForceSendFields will be sent to the
  1024. // server regardless of whether the field is empty or not. This may be
  1025. // used to include empty fields in Patch requests.
  1026. ForceSendFields []string `json:"-"`
  1027. // NullFields is a list of field names (e.g. "Description") to include
  1028. // in API requests with the JSON null value. By default, fields with
  1029. // empty values are omitted from API requests. However, any field with
  1030. // an empty value appearing in NullFields will be sent to the server as
  1031. // null. It is an error if a field in this list has a non-empty value.
  1032. // This may be used to include null fields in Patch requests.
  1033. NullFields []string `json:"-"`
  1034. }
  1035. func (s *Expr) MarshalJSON() ([]byte, error) {
  1036. type NoMethod Expr
  1037. raw := NoMethod(*s)
  1038. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1039. }
  1040. // GceClusterConfig: Common config settings for resources of Compute
  1041. // Engine cluster instances, applicable to all instances in the cluster.
  1042. type GceClusterConfig struct {
  1043. // AllocationAffinity: Allocation Affinity for consuming Zonal
  1044. // allocation.
  1045. AllocationAffinity *AllocationAffinity `json:"allocationAffinity,omitempty"`
  1046. // InternalIpOnly: Optional. If true, all instances in the cluster will
  1047. // only have internal IP addresses. By default, clusters are not
  1048. // restricted to internal IP addresses, and will have ephemeral external
  1049. // IP addresses assigned to each instance. This internal_ip_only
  1050. // restriction can only be enabled for subnetwork enabled networks, and
  1051. // all off-cluster dependencies must be configured to be accessible
  1052. // without external IP addresses.
  1053. InternalIpOnly bool `json:"internalIpOnly,omitempty"`
  1054. // Metadata: The Compute Engine metadata entries to add to all instances
  1055. // (see Project and instance metadata
  1056. // (https://cloud.google.com/compute/docs/storing-retrieving-metadata#pro
  1057. // ject_and_instance_metadata)).
  1058. Metadata map[string]string `json:"metadata,omitempty"`
  1059. // NetworkUri: Optional. The Compute Engine network to be used for
  1060. // machine communications. Cannot be specified with subnetwork_uri. If
  1061. // neither network_uri nor subnetwork_uri is specified, the "default"
  1062. // network of the project is used, if it exists. Cannot be a "Custom
  1063. // Subnet Network" (see Using Subnetworks for more information).A full
  1064. // URL, partial URI, or short name are valid.
  1065. // Examples:
  1066. // https://www.googleapis.com/compute/v1/projects/[project_id]/
  1067. // regions/global/default
  1068. // projects/[project_id]/regions/global/default
  1069. // de
  1070. // fault
  1071. NetworkUri string `json:"networkUri,omitempty"`
  1072. // ServiceAccount: Optional. The service account of the instances.
  1073. // Defaults to the default Compute Engine service account. Custom
  1074. // service accounts need permissions equivalent to the following IAM
  1075. // roles:
  1076. // roles/logging.logWriter
  1077. // roles/storage.objectAdmin(see
  1078. // https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts for more information). Example:
  1079. // [account_id]@[project_id].iam.gserviceaccount.com
  1080. ServiceAccount string `json:"serviceAccount,omitempty"`
  1081. // ServiceAccountScopes: Optional. The URIs of service account scopes to
  1082. // be included in Compute Engine instances. The following base set of
  1083. // scopes is always
  1084. // included:
  1085. // https://www.googleapis.com/auth/cloud.useraccounts.readonly
  1086. //
  1087. // https://www.googleapis.com/auth/devstorage.read_write
  1088. // https://www.goog
  1089. // leapis.com/auth/logging.writeIf no scopes are specified, the
  1090. // following defaults are also
  1091. // provided:
  1092. // https://www.googleapis.com/auth/bigquery
  1093. // https://www.googlea
  1094. // pis.com/auth/bigtable.admin.table
  1095. // https://www.googleapis.com/auth/bigt
  1096. // able.data
  1097. // https://www.googleapis.com/auth/devstorage.full_control
  1098. ServiceAccountScopes []string `json:"serviceAccountScopes,omitempty"`
  1099. // SubnetworkUri: Optional. The Compute Engine subnetwork to be used for
  1100. // machine communications. Cannot be specified with network_uri.A full
  1101. // URL, partial URI, or short name are valid.
  1102. // Examples:
  1103. // https://www.googleapis.com/compute/v1/projects/[project_id]/
  1104. // regions/us-east1/sub0
  1105. // projects/[project_id]/regions/us-east1/sub0
  1106. // sub0
  1107. SubnetworkUri string `json:"subnetworkUri,omitempty"`
  1108. // Tags: The Compute Engine tags to add to all instances (see Tagging
  1109. // instances).
  1110. Tags []string `json:"tags,omitempty"`
  1111. // ZoneUri: Optional. The zone where the Compute Engine cluster will be
  1112. // located. On a create request, it is required in the "global" region.
  1113. // If omitted in a non-global Cloud Dataproc region, the service will
  1114. // pick a zone in the corresponding Compute Engine region. On a get
  1115. // request, zone will always be present.A full URL, partial URI, or
  1116. // short name are valid.
  1117. // Examples:
  1118. // https://www.googleapis.com/compute/v1/projects/[project_id]/
  1119. // zones/[zone]
  1120. // projects/[project_id]/zones/[zone]
  1121. // us-central1-f
  1122. ZoneUri string `json:"zoneUri,omitempty"`
  1123. // ForceSendFields is a list of field names (e.g. "AllocationAffinity")
  1124. // to unconditionally include in API requests. By default, fields with
  1125. // empty values are omitted from API requests. However, any non-pointer,
  1126. // non-interface field appearing in ForceSendFields will be sent to the
  1127. // server regardless of whether the field is empty or not. This may be
  1128. // used to include empty fields in Patch requests.
  1129. ForceSendFields []string `json:"-"`
  1130. // NullFields is a list of field names (e.g. "AllocationAffinity") to
  1131. // include in API requests with the JSON null value. By default, fields
  1132. // with empty values are omitted from API requests. However, any field
  1133. // with an empty value appearing in NullFields will be sent to the
  1134. // server as null. It is an error if a field in this list has a
  1135. // non-empty value. This may be used to include null fields in Patch
  1136. // requests.
  1137. NullFields []string `json:"-"`
  1138. }
  1139. func (s *GceClusterConfig) MarshalJSON() ([]byte, error) {
  1140. type NoMethod GceClusterConfig
  1141. raw := NoMethod(*s)
  1142. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1143. }
  1144. // GetIamPolicyRequest: Request message for GetIamPolicy method.
  1145. type GetIamPolicyRequest struct {
  1146. }
  1147. // HadoopJob: A Cloud Dataproc job for running Apache Hadoop MapReduce
  1148. // (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop
  1149. // -mapreduce-client-core/MapReduceTutorial.html) jobs on Apache Hadoop
  1150. // YARN
  1151. // (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YA
  1152. // RN.html).
  1153. type HadoopJob struct {
  1154. // ArchiveUris: Optional. HCFS URIs of archives to be extracted in the
  1155. // working directory of Hadoop drivers and tasks. Supported file types:
  1156. // .jar, .tar, .tar.gz, .tgz, or .zip.
  1157. ArchiveUris []string `json:"archiveUris,omitempty"`
  1158. // Args: Optional. The arguments to pass to the driver. Do not include
  1159. // arguments, such as -libjars or -Dfoo=bar, that can be set as job
  1160. // properties, since a collision may occur that causes an incorrect job
  1161. // submission.
  1162. Args []string `json:"args,omitempty"`
  1163. // FileUris: Optional. HCFS (Hadoop Compatible Filesystem) URIs of files
  1164. // to be copied to the working directory of Hadoop drivers and
  1165. // distributed tasks. Useful for naively parallel tasks.
  1166. FileUris []string `json:"fileUris,omitempty"`
  1167. // JarFileUris: Optional. Jar file URIs to add to the CLASSPATHs of the
  1168. // Hadoop driver and tasks.
  1169. JarFileUris []string `json:"jarFileUris,omitempty"`
  1170. // LoggingConfig: Optional. The runtime log config for job execution.
  1171. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  1172. // MainClass: The name of the driver's main class. The jar file
  1173. // containing the class must be in the default CLASSPATH or specified in
  1174. // jar_file_uris.
  1175. MainClass string `json:"mainClass,omitempty"`
  1176. // MainJarFileUri: The HCFS URI of the jar file containing the main
  1177. // class. Examples:
  1178. // 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar'
  1179. // 'hdfs:/tmp/test-samples/custom-wordcount.jar'
  1180. // 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'
  1181. MainJarFileUri string `json:"mainJarFileUri,omitempty"`
  1182. // Properties: Optional. A mapping of property names to values, used to
  1183. // configure Hadoop. Properties that conflict with values set by the
  1184. // Cloud Dataproc API may be overwritten. Can include properties set in
  1185. // /etc/hadoop/conf/*-site and classes in user code.
  1186. Properties map[string]string `json:"properties,omitempty"`
  1187. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  1188. // unconditionally include in API requests. By default, fields with
  1189. // empty values are omitted from API requests. However, any non-pointer,
  1190. // non-interface field appearing in ForceSendFields will be sent to the
  1191. // server regardless of whether the field is empty or not. This may be
  1192. // used to include empty fields in Patch requests.
  1193. ForceSendFields []string `json:"-"`
  1194. // NullFields is a list of field names (e.g. "ArchiveUris") to include
  1195. // in API requests with the JSON null value. By default, fields with
  1196. // empty values are omitted from API requests. However, any field with
  1197. // an empty value appearing in NullFields will be sent to the server as
  1198. // null. It is an error if a field in this list has a non-empty value.
  1199. // This may be used to include null fields in Patch requests.
  1200. NullFields []string `json:"-"`
  1201. }
  1202. func (s *HadoopJob) MarshalJSON() ([]byte, error) {
  1203. type NoMethod HadoopJob
  1204. raw := NoMethod(*s)
  1205. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1206. }
  1207. // HiveJob: A Cloud Dataproc job for running Apache Hive
  1208. // (https://hive.apache.org/) queries on YARN.
  1209. type HiveJob struct {
  1210. // ContinueOnFailure: Optional. Whether to continue executing queries if
  1211. // a query fails. The default value is false. Setting to true can be
  1212. // useful when executing independent parallel queries.
  1213. ContinueOnFailure bool `json:"continueOnFailure,omitempty"`
  1214. // JarFileUris: Optional. HCFS URIs of jar files to add to the CLASSPATH
  1215. // of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive
  1216. // SerDes and UDFs.
  1217. JarFileUris []string `json:"jarFileUris,omitempty"`
  1218. // Properties: Optional. A mapping of property names and values, used to
  1219. // configure Hive. Properties that conflict with values set by the Cloud
  1220. // Dataproc API may be overwritten. Can include properties set in
  1221. // /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and
  1222. // classes in user code.
  1223. Properties map[string]string `json:"properties,omitempty"`
  1224. // QueryFileUri: The HCFS URI of the script that contains Hive queries.
  1225. QueryFileUri string `json:"queryFileUri,omitempty"`
  1226. // QueryList: A list of queries.
  1227. QueryList *QueryList `json:"queryList,omitempty"`
  1228. // ScriptVariables: Optional. Mapping of query variable names to values
  1229. // (equivalent to the Hive command: SET name="value";).
  1230. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  1231. // ForceSendFields is a list of field names (e.g. "ContinueOnFailure")
  1232. // to unconditionally include in API requests. By default, fields with
  1233. // empty values are omitted from API requests. However, any non-pointer,
  1234. // non-interface field appearing in ForceSendFields will be sent to the
  1235. // server regardless of whether the field is empty or not. This may be
  1236. // used to include empty fields in Patch requests.
  1237. ForceSendFields []string `json:"-"`
  1238. // NullFields is a list of field names (e.g. "ContinueOnFailure") to
  1239. // include in API requests with the JSON null value. By default, fields
  1240. // with empty values are omitted from API requests. However, any field
  1241. // with an empty value appearing in NullFields will be sent to the
  1242. // server as null. It is an error if a field in this list has a
  1243. // non-empty value. This may be used to include null fields in Patch
  1244. // requests.
  1245. NullFields []string `json:"-"`
  1246. }
  1247. func (s *HiveJob) MarshalJSON() ([]byte, error) {
  1248. type NoMethod HiveJob
  1249. raw := NoMethod(*s)
  1250. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1251. }
  1252. // InstanceGroupAutoscalingPolicyConfig: Configuration for the size
  1253. // bounds of an instance group, including its proportional size to other
  1254. // groups.
  1255. type InstanceGroupAutoscalingPolicyConfig struct {
  1256. // MaxInstances: Optional. Maximum number of instances for this group.
  1257. // Required for primary workers. Note that by default, clusters will not
  1258. // use secondary workers.Primary workers - Bounds: [min_instances, ).
  1259. // Secondary workers - Bounds: [min_instances, ). Default: 0.
  1260. MaxInstances int64 `json:"maxInstances,omitempty"`
  1261. // MinInstances: Optional. Minimum number of instances for this
  1262. // group.Primary workers - Bounds: 2, max_instances. Default: 2.
  1263. // Secondary workers - Bounds: 0, max_instances. Default: 0.
  1264. MinInstances int64 `json:"minInstances,omitempty"`
  1265. // Weight: Optional. Weight for instance group. Determines fraction of
  1266. // total workers in cluster that will be composed of instances from this
  1267. // instance group (e.g. if primary workers have weight 2 and secondary
  1268. // workers have weight 1, then the cluster should have approximately 2
  1269. // primary workers to each secondary worker. Cluster may not reach these
  1270. // exact weights if constrained by min/max bounds or other autoscaling
  1271. // configurations.Note that all groups have an equal weight by default,
  1272. // so the cluster will attempt to maintain an equal number of workers in
  1273. // each group within configured size bounds per group. The cluster may
  1274. // not reach this balance of weights if not allowed by worker-count
  1275. // bounds. For example, if max_instances for secondary workers is 0,
  1276. // only primary workers will be added. The cluster can also be out of
  1277. // balance when created.Default: 1.
  1278. Weight int64 `json:"weight,omitempty"`
  1279. // ForceSendFields is a list of field names (e.g. "MaxInstances") to
  1280. // unconditionally include in API requests. By default, fields with
  1281. // empty values are omitted from API requests. However, any non-pointer,
  1282. // non-interface field appearing in ForceSendFields will be sent to the
  1283. // server regardless of whether the field is empty or not. This may be
  1284. // used to include empty fields in Patch requests.
  1285. ForceSendFields []string `json:"-"`
  1286. // NullFields is a list of field names (e.g. "MaxInstances") to include
  1287. // in API requests with the JSON null value. By default, fields with
  1288. // empty values are omitted from API requests. However, any field with
  1289. // an empty value appearing in NullFields will be sent to the server as
  1290. // null. It is an error if a field in this list has a non-empty value.
  1291. // This may be used to include null fields in Patch requests.
  1292. NullFields []string `json:"-"`
  1293. }
  1294. func (s *InstanceGroupAutoscalingPolicyConfig) MarshalJSON() ([]byte, error) {
  1295. type NoMethod InstanceGroupAutoscalingPolicyConfig
  1296. raw := NoMethod(*s)
  1297. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1298. }
  1299. // InstanceGroupConfig: Optional. The config settings for Compute Engine
  1300. // resources in an instance group, such as a master or worker group.
  1301. type InstanceGroupConfig struct {
  1302. // Accelerators: Optional. The Compute Engine accelerator configuration
  1303. // for these instances.Beta Feature: This feature is still under
  1304. // development. It may be changed before final release.
  1305. Accelerators []*AcceleratorConfig `json:"accelerators,omitempty"`
  1306. // DiskConfig: Optional. Disk option config settings.
  1307. DiskConfig *DiskConfig `json:"diskConfig,omitempty"`
  1308. // ImageUri: Optional. The Compute Engine image resource used for
  1309. // cluster instances. It can be specified or may be inferred from
  1310. // SoftwareConfig.image_version.
  1311. ImageUri string `json:"imageUri,omitempty"`
  1312. // InstanceNames: Output only. The list of instance names. Cloud
  1313. // Dataproc derives the names from cluster_name, num_instances, and the
  1314. // instance group.
  1315. InstanceNames []string `json:"instanceNames,omitempty"`
  1316. // IsPreemptible: Optional. Specifies that this instance group contains
  1317. // preemptible instances.
  1318. IsPreemptible bool `json:"isPreemptible,omitempty"`
  1319. // MachineTypeUri: Optional. The Compute Engine machine type used for
  1320. // cluster instances.A full URL, partial URI, or short name are valid.
  1321. // Examples:
  1322. // https://www.googleapis.com/compute/v1/projects/[project_id]/
  1323. // zones/us-east1-a/machineTypes/n1-standard-2
  1324. // projects/[project_id]/zone
  1325. // s/us-east1-a/machineTypes/n1-standard-2
  1326. // n1-standard-2Auto Zone Exception: If you are using the Cloud Dataproc
  1327. // Auto Zone Placement feature, you must use the short name of the
  1328. // machine type resource, for example, n1-standard-2.
  1329. MachineTypeUri string `json:"machineTypeUri,omitempty"`
  1330. // ManagedGroupConfig: Output only. The config for Compute Engine
  1331. // Instance Group Manager that manages this group. This is only used for
  1332. // preemptible instance groups.
  1333. ManagedGroupConfig *ManagedGroupConfig `json:"managedGroupConfig,omitempty"`
  1334. // MinCpuPlatform: Optional. Specifies the minimum cpu platform for the
  1335. // Instance Group. See Cloud Dataproc&rarr;Minimum CPU Platform.
  1336. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  1337. // NumInstances: Optional. The number of VM instances in the instance
  1338. // group. For master instance groups, must be set to 1.
  1339. NumInstances int64 `json:"numInstances,omitempty"`
  1340. // ForceSendFields is a list of field names (e.g. "Accelerators") to
  1341. // unconditionally include in API requests. By default, fields with
  1342. // empty values are omitted from API requests. However, any non-pointer,
  1343. // non-interface field appearing in ForceSendFields will be sent to the
  1344. // server regardless of whether the field is empty or not. This may be
  1345. // used to include empty fields in Patch requests.
  1346. ForceSendFields []string `json:"-"`
  1347. // NullFields is a list of field names (e.g. "Accelerators") to include
  1348. // in API requests with the JSON null value. By default, fields with
  1349. // empty values are omitted from API requests. However, any field with
  1350. // an empty value appearing in NullFields will be sent to the server as
  1351. // null. It is an error if a field in this list has a non-empty value.
  1352. // This may be used to include null fields in Patch requests.
  1353. NullFields []string `json:"-"`
  1354. }
  1355. func (s *InstanceGroupConfig) MarshalJSON() ([]byte, error) {
  1356. type NoMethod InstanceGroupConfig
  1357. raw := NoMethod(*s)
  1358. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1359. }
  1360. // InstantiateWorkflowTemplateRequest: A request to instantiate a
  1361. // workflow template.
  1362. type InstantiateWorkflowTemplateRequest struct {
  1363. // InstanceId: Deprecated. Please use request_id field instead.
  1364. InstanceId string `json:"instanceId,omitempty"`
  1365. // Parameters: Optional. Map from parameter names to values that should
  1366. // be used for those parameters. Values may not exceed 100 characters.
  1367. Parameters map[string]string `json:"parameters,omitempty"`
  1368. // RequestId: Optional. A tag that prevents multiple concurrent workflow
  1369. // instances with the same tag from running. This mitigates risk of
  1370. // concurrent instances started due to retries.It is recommended to
  1371. // always set this value to a UUID
  1372. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag
  1373. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  1374. // and hyphens (-). The maximum length is 40 characters.
  1375. RequestId string `json:"requestId,omitempty"`
  1376. // Version: Optional. The version of workflow template to instantiate.
  1377. // If specified, the workflow will be instantiated only if the current
  1378. // version of the workflow template has the supplied version.This option
  1379. // cannot be used to instantiate a previous version of workflow
  1380. // template.
  1381. Version int64 `json:"version,omitempty"`
  1382. // ForceSendFields is a list of field names (e.g. "InstanceId") to
  1383. // unconditionally include in API requests. By default, fields with
  1384. // empty values are omitted from API requests. However, any non-pointer,
  1385. // non-interface field appearing in ForceSendFields will be sent to the
  1386. // server regardless of whether the field is empty or not. This may be
  1387. // used to include empty fields in Patch requests.
  1388. ForceSendFields []string `json:"-"`
  1389. // NullFields is a list of field names (e.g. "InstanceId") to include in
  1390. // API requests with the JSON null value. By default, fields with empty
  1391. // values are omitted from API requests. However, any field with an
  1392. // empty value appearing in NullFields will be sent to the server as
  1393. // null. It is an error if a field in this list has a non-empty value.
  1394. // This may be used to include null fields in Patch requests.
  1395. NullFields []string `json:"-"`
  1396. }
  1397. func (s *InstantiateWorkflowTemplateRequest) MarshalJSON() ([]byte, error) {
  1398. type NoMethod InstantiateWorkflowTemplateRequest
  1399. raw := NoMethod(*s)
  1400. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1401. }
  1402. // Job: A Cloud Dataproc job resource.
  1403. type Job struct {
  1404. // DriverControlFilesUri: Output only. If present, the location of
  1405. // miscellaneous control files which may be used as part of job setup
  1406. // and handling. If not present, control files may be placed in the same
  1407. // location as driver_output_uri.
  1408. DriverControlFilesUri string `json:"driverControlFilesUri,omitempty"`
  1409. // DriverOutputResourceUri: Output only. A URI pointing to the location
  1410. // of the stdout of the job's driver program.
  1411. DriverOutputResourceUri string `json:"driverOutputResourceUri,omitempty"`
  1412. // HadoopJob: Job is a Hadoop job.
  1413. HadoopJob *HadoopJob `json:"hadoopJob,omitempty"`
  1414. // HiveJob: Job is a Hive job.
  1415. HiveJob *HiveJob `json:"hiveJob,omitempty"`
  1416. // JobUuid: Output only. A UUID that uniquely identifies a job within
  1417. // the project over time. This is in contrast to a user-settable
  1418. // reference.job_id that may be reused over time.
  1419. JobUuid string `json:"jobUuid,omitempty"`
  1420. // Labels: Optional. The labels to associate with this job. Label keys
  1421. // must contain 1 to 63 characters, and must conform to RFC 1035
  1422. // (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty,
  1423. // but, if present, must contain 1 to 63 characters, and must conform to
  1424. // RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32
  1425. // labels can be associated with a job.
  1426. Labels map[string]string `json:"labels,omitempty"`
  1427. // PigJob: Job is a Pig job.
  1428. PigJob *PigJob `json:"pigJob,omitempty"`
  1429. // Placement: Required. Job information, including how, when, and where
  1430. // to run the job.
  1431. Placement *JobPlacement `json:"placement,omitempty"`
  1432. // PrestoJob: Job is a Presto job
  1433. PrestoJob *PrestoJob `json:"prestoJob,omitempty"`
  1434. // PysparkJob: Job is a Pyspark job.
  1435. PysparkJob *PySparkJob `json:"pysparkJob,omitempty"`
  1436. // Reference: Optional. The fully qualified reference to the job, which
  1437. // can be used to obtain the equivalent REST path of the job resource.
  1438. // If this property is not specified when a job is created, the server
  1439. // generates a <code>job_id</code>.
  1440. Reference *JobReference `json:"reference,omitempty"`
  1441. // Scheduling: Optional. Job scheduling configuration.
  1442. Scheduling *JobScheduling `json:"scheduling,omitempty"`
  1443. // SparkJob: Job is a Spark job.
  1444. SparkJob *SparkJob `json:"sparkJob,omitempty"`
  1445. // SparkRJob: Job is a SparkR job.
  1446. SparkRJob *SparkRJob `json:"sparkRJob,omitempty"`
  1447. // SparkSqlJob: Job is a SparkSql job.
  1448. SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"`
  1449. // Status: Output only. The job status. Additional application-specific
  1450. // status information may be contained in the <code>type_job</code> and
  1451. // <code>yarn_applications</code> fields.
  1452. Status *JobStatus `json:"status,omitempty"`
  1453. // StatusHistory: Output only. The previous job status.
  1454. StatusHistory []*JobStatus `json:"statusHistory,omitempty"`
  1455. // SubmittedBy: Output only. The email address of the user submitting
  1456. // the job. For jobs submitted on the cluster, the address is
  1457. // <code>username@hostname</code>.
  1458. SubmittedBy string `json:"submittedBy,omitempty"`
  1459. // YarnApplications: Output only. The collection of YARN applications
  1460. // spun up by this job.Beta Feature: This report is available for
  1461. // testing purposes only. It may be changed before final release.
  1462. YarnApplications []*YarnApplication `json:"yarnApplications,omitempty"`
  1463. // ServerResponse contains the HTTP response code and headers from the
  1464. // server.
  1465. googleapi.ServerResponse `json:"-"`
  1466. // ForceSendFields is a list of field names (e.g.
  1467. // "DriverControlFilesUri") to unconditionally include in API requests.
  1468. // By default, fields with empty values are omitted from API requests.
  1469. // However, any non-pointer, non-interface field appearing in
  1470. // ForceSendFields will be sent to the server regardless of whether the
  1471. // field is empty or not. This may be used to include empty fields in
  1472. // Patch requests.
  1473. ForceSendFields []string `json:"-"`
  1474. // NullFields is a list of field names (e.g. "DriverControlFilesUri") to
  1475. // include in API requests with the JSON null value. By default, fields
  1476. // with empty values are omitted from API requests. However, any field
  1477. // with an empty value appearing in NullFields will be sent to the
  1478. // server as null. It is an error if a field in this list has a
  1479. // non-empty value. This may be used to include null fields in Patch
  1480. // requests.
  1481. NullFields []string `json:"-"`
  1482. }
  1483. func (s *Job) MarshalJSON() ([]byte, error) {
  1484. type NoMethod Job
  1485. raw := NoMethod(*s)
  1486. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1487. }
  1488. // JobPlacement: Cloud Dataproc job config.
  1489. type JobPlacement struct {
  1490. // ClusterName: Required. The name of the cluster where the job will be
  1491. // submitted.
  1492. ClusterName string `json:"clusterName,omitempty"`
  1493. // ClusterUuid: Output only. A cluster UUID generated by the Cloud
  1494. // Dataproc service when the job is submitted.
  1495. ClusterUuid string `json:"clusterUuid,omitempty"`
  1496. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  1497. // unconditionally include in API requests. By default, fields with
  1498. // empty values are omitted from API requests. However, any non-pointer,
  1499. // non-interface field appearing in ForceSendFields will be sent to the
  1500. // server regardless of whether the field is empty or not. This may be
  1501. // used to include empty fields in Patch requests.
  1502. ForceSendFields []string `json:"-"`
  1503. // NullFields is a list of field names (e.g. "ClusterName") to include
  1504. // in API requests with the JSON null value. By default, fields with
  1505. // empty values are omitted from API requests. However, any field with
  1506. // an empty value appearing in NullFields will be sent to the server as
  1507. // null. It is an error if a field in this list has a non-empty value.
  1508. // This may be used to include null fields in Patch requests.
  1509. NullFields []string `json:"-"`
  1510. }
  1511. func (s *JobPlacement) MarshalJSON() ([]byte, error) {
  1512. type NoMethod JobPlacement
  1513. raw := NoMethod(*s)
  1514. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1515. }
  1516. // JobReference: Encapsulates the full scoping used to reference a job.
  1517. type JobReference struct {
  1518. // JobId: Optional. The job ID, which must be unique within the
  1519. // project.The ID must contain only letters (a-z, A-Z), numbers (0-9),
  1520. // underscores (_), or hyphens (-). The maximum length is 100
  1521. // characters.If not specified by the caller, the job ID will be
  1522. // provided by the server.
  1523. JobId string `json:"jobId,omitempty"`
  1524. // ProjectId: Required. The ID of the Google Cloud Platform project that
  1525. // the job belongs to.
  1526. ProjectId string `json:"projectId,omitempty"`
  1527. // ForceSendFields is a list of field names (e.g. "JobId") to
  1528. // unconditionally include in API requests. By default, fields with
  1529. // empty values are omitted from API requests. However, any non-pointer,
  1530. // non-interface field appearing in ForceSendFields will be sent to the
  1531. // server regardless of whether the field is empty or not. This may be
  1532. // used to include empty fields in Patch requests.
  1533. ForceSendFields []string `json:"-"`
  1534. // NullFields is a list of field names (e.g. "JobId") to include in API
  1535. // requests with the JSON null value. By default, fields with empty
  1536. // values are omitted from API requests. However, any field with an
  1537. // empty value appearing in NullFields will be sent to the server as
  1538. // null. It is an error if a field in this list has a non-empty value.
  1539. // This may be used to include null fields in Patch requests.
  1540. NullFields []string `json:"-"`
  1541. }
  1542. func (s *JobReference) MarshalJSON() ([]byte, error) {
  1543. type NoMethod JobReference
  1544. raw := NoMethod(*s)
  1545. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1546. }
  1547. // JobScheduling: Job scheduling options.
  1548. type JobScheduling struct {
  1549. // MaxFailuresPerHour: Optional. Maximum number of times per hour a
  1550. // driver may be restarted as a result of driver terminating with
  1551. // non-zero code before job is reported failed.A job may be reported as
  1552. // thrashing if driver exits with non-zero code 4 times within 10 minute
  1553. // window.Maximum value is 10.
  1554. MaxFailuresPerHour int64 `json:"maxFailuresPerHour,omitempty"`
  1555. // ForceSendFields is a list of field names (e.g. "MaxFailuresPerHour")
  1556. // to unconditionally include in API requests. By default, fields with
  1557. // empty values are omitted from API requests. However, any non-pointer,
  1558. // non-interface field appearing in ForceSendFields will be sent to the
  1559. // server regardless of whether the field is empty or not. This may be
  1560. // used to include empty fields in Patch requests.
  1561. ForceSendFields []string `json:"-"`
  1562. // NullFields is a list of field names (e.g. "MaxFailuresPerHour") to
  1563. // include in API requests with the JSON null value. By default, fields
  1564. // with empty values are omitted from API requests. However, any field
  1565. // with an empty value appearing in NullFields will be sent to the
  1566. // server as null. It is an error if a field in this list has a
  1567. // non-empty value. This may be used to include null fields in Patch
  1568. // requests.
  1569. NullFields []string `json:"-"`
  1570. }
  1571. func (s *JobScheduling) MarshalJSON() ([]byte, error) {
  1572. type NoMethod JobScheduling
  1573. raw := NoMethod(*s)
  1574. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1575. }
  1576. // JobStatus: Cloud Dataproc job status.
  1577. type JobStatus struct {
  1578. // Details: Output only. Optional job state details, such as an error
  1579. // description if the state is <code>ERROR</code>.
  1580. Details string `json:"details,omitempty"`
  1581. // State: Output only. A state message specifying the overall job state.
  1582. //
  1583. // Possible values:
  1584. // "STATE_UNSPECIFIED" - The job state is unknown.
  1585. // "PENDING" - The job is pending; it has been submitted, but is not
  1586. // yet running.
  1587. // "SETUP_DONE" - Job has been received by the service and completed
  1588. // initial setup; it will soon be submitted to the cluster.
  1589. // "RUNNING" - The job is running on the cluster.
  1590. // "CANCEL_PENDING" - A CancelJob request has been received, but is
  1591. // pending.
  1592. // "CANCEL_STARTED" - Transient in-flight resources have been
  1593. // canceled, and the request to cancel the running job has been issued
  1594. // to the cluster.
  1595. // "CANCELLED" - The job cancellation was successful.
  1596. // "DONE" - The job has completed successfully.
  1597. // "ERROR" - The job has completed, but encountered an error.
  1598. // "ATTEMPT_FAILURE" - Job attempt has failed. The detail field
  1599. // contains failure details for this attempt.Applies to restartable jobs
  1600. // only.
  1601. State string `json:"state,omitempty"`
  1602. // StateStartTime: Output only. The time when this state was entered.
  1603. StateStartTime string `json:"stateStartTime,omitempty"`
  1604. // Substate: Output only. Additional state information, which includes
  1605. // status reported by the agent.
  1606. //
  1607. // Possible values:
  1608. // "UNSPECIFIED" - The job substate is unknown.
  1609. // "SUBMITTED" - The Job is submitted to the agent.Applies to RUNNING
  1610. // state.
  1611. // "QUEUED" - The Job has been received and is awaiting execution (it
  1612. // may be waiting for a condition to be met). See the "details" field
  1613. // for the reason for the delay.Applies to RUNNING state.
  1614. // "STALE_STATUS" - The agent-reported status is out of date, which
  1615. // may be caused by a loss of communication between the agent and Cloud
  1616. // Dataproc. If the agent does not send a timely update, the job will
  1617. // fail.Applies to RUNNING state.
  1618. Substate string `json:"substate,omitempty"`
  1619. // ForceSendFields is a list of field names (e.g. "Details") to
  1620. // unconditionally include in API requests. By default, fields with
  1621. // empty values are omitted from API requests. However, any non-pointer,
  1622. // non-interface field appearing in ForceSendFields will be sent to the
  1623. // server regardless of whether the field is empty or not. This may be
  1624. // used to include empty fields in Patch requests.
  1625. ForceSendFields []string `json:"-"`
  1626. // NullFields is a list of field names (e.g. "Details") to include in
  1627. // API requests with the JSON null value. By default, fields with empty
  1628. // values are omitted from API requests. However, any field with an
  1629. // empty value appearing in NullFields will be sent to the server as
  1630. // null. It is an error if a field in this list has a non-empty value.
  1631. // This may be used to include null fields in Patch requests.
  1632. NullFields []string `json:"-"`
  1633. }
  1634. func (s *JobStatus) MarshalJSON() ([]byte, error) {
  1635. type NoMethod JobStatus
  1636. raw := NoMethod(*s)
  1637. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1638. }
  1639. // KerberosConfig: Specifies Kerberos related configuration.
  1640. type KerberosConfig struct {
  1641. // CrossRealmTrustAdminServer: Optional. The admin server (IP or
  1642. // hostname) for the remote trusted realm in a cross realm trust
  1643. // relationship.
  1644. CrossRealmTrustAdminServer string `json:"crossRealmTrustAdminServer,omitempty"`
  1645. // CrossRealmTrustKdc: Optional. The KDC (IP or hostname) for the remote
  1646. // trusted realm in a cross realm trust relationship.
  1647. CrossRealmTrustKdc string `json:"crossRealmTrustKdc,omitempty"`
  1648. // CrossRealmTrustRealm: Optional. The remote realm the Dataproc
  1649. // on-cluster KDC will trust, should the user enable cross realm trust.
  1650. CrossRealmTrustRealm string `json:"crossRealmTrustRealm,omitempty"`
  1651. // CrossRealmTrustSharedPasswordUri: Optional. The GCS uri of a KMS
  1652. // encrypted file containing the shared password between the on-cluster
  1653. // Kerberos realm and the remote trusted realm, in a cross realm trust
  1654. // relationship.
  1655. CrossRealmTrustSharedPasswordUri string `json:"crossRealmTrustSharedPasswordUri,omitempty"`
  1656. // EnableKerberos: Optional. Flag to indicate whether to Kerberize the
  1657. // cluster.
  1658. EnableKerberos bool `json:"enableKerberos,omitempty"`
  1659. // KdcDbKeyUri: Optional. The GCS uri of a KMS encrypted file containing
  1660. // the master key of the KDC database.
  1661. KdcDbKeyUri string `json:"kdcDbKeyUri,omitempty"`
  1662. // KeyPasswordUri: Optional. The GCS uri of a KMS encrypted file
  1663. // containing the password to the user provided key. For the self-signed
  1664. // certificate, this password is generated by Dataproc.
  1665. KeyPasswordUri string `json:"keyPasswordUri,omitempty"`
  1666. // KeystorePasswordUri: Optional. The GCS uri of a KMS encrypted file
  1667. // containing the password to the user provided keystore. For the
  1668. // self-signed certificate, this password is generated by Dataproc.
  1669. KeystorePasswordUri string `json:"keystorePasswordUri,omitempty"`
  1670. // KeystoreUri: Optional. The GCS uri of the keystore file used for SSL
  1671. // encryption. If not provided, Dataproc will provide a self-signed
  1672. // certificate.
  1673. KeystoreUri string `json:"keystoreUri,omitempty"`
  1674. // KmsKeyUri: Required. The uri of the KMS key used to encrypt various
  1675. // sensitive files.
  1676. KmsKeyUri string `json:"kmsKeyUri,omitempty"`
  1677. // RootPrincipalPasswordUri: Required. The GCS uri of a KMS encrypted
  1678. // file containing the root principal password.
  1679. RootPrincipalPasswordUri string `json:"rootPrincipalPasswordUri,omitempty"`
  1680. // TgtLifetimeHours: Optional. The lifetime of the ticket granting
  1681. // ticket, in hours. If not specified, or user specifies 0, then default
  1682. // value 10 will be used.
  1683. TgtLifetimeHours int64 `json:"tgtLifetimeHours,omitempty"`
  1684. // TruststorePasswordUri: Optional. The GCS uri of a KMS encrypted file
  1685. // containing the password to the user provided truststore. For the
  1686. // self-signed certificate, this password is generated by Dataproc.
  1687. TruststorePasswordUri string `json:"truststorePasswordUri,omitempty"`
  1688. // TruststoreUri: Optional. The GCS uri of the truststore file used for
  1689. // SSL encryption. If not provided, Dataproc will provide a self-signed
  1690. // certificate.
  1691. TruststoreUri string `json:"truststoreUri,omitempty"`
  1692. // ForceSendFields is a list of field names (e.g.
  1693. // "CrossRealmTrustAdminServer") to unconditionally include in API
  1694. // requests. By default, fields with empty values are omitted from API
  1695. // requests. However, any non-pointer, non-interface field appearing in
  1696. // ForceSendFields will be sent to the server regardless of whether the
  1697. // field is empty or not. This may be used to include empty fields in
  1698. // Patch requests.
  1699. ForceSendFields []string `json:"-"`
  1700. // NullFields is a list of field names (e.g.
  1701. // "CrossRealmTrustAdminServer") to include in API requests with the
  1702. // JSON null value. By default, fields with empty values are omitted
  1703. // from API requests. However, any field with an empty value appearing
  1704. // in NullFields will be sent to the server as null. It is an error if a
  1705. // field in this list has a non-empty value. This may be used to include
  1706. // null fields in Patch requests.
  1707. NullFields []string `json:"-"`
  1708. }
  1709. func (s *KerberosConfig) MarshalJSON() ([]byte, error) {
  1710. type NoMethod KerberosConfig
  1711. raw := NoMethod(*s)
  1712. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1713. }
  1714. // LifecycleConfig: Specifies the cluster auto-delete schedule
  1715. // configuration.
  1716. type LifecycleConfig struct {
  1717. // AutoDeleteTime: Optional. The time when cluster will be auto-deleted.
  1718. AutoDeleteTime string `json:"autoDeleteTime,omitempty"`
  1719. // AutoDeleteTtl: Optional. The lifetime duration of cluster. The
  1720. // cluster will be auto-deleted at the end of this period. Valid range:
  1721. // 10m, 14d.Example: "1d", to delete the cluster 1 day after its
  1722. // creation..
  1723. AutoDeleteTtl string `json:"autoDeleteTtl,omitempty"`
  1724. // IdleDeleteTtl: Optional. The duration to keep the cluster alive while
  1725. // idling. Passing this threshold will cause the cluster to be deleted.
  1726. // Valid range: 10m, 14d.Example: "10m", the minimum value, to delete
  1727. // the cluster when it has had no jobs running for 10 minutes.
  1728. IdleDeleteTtl string `json:"idleDeleteTtl,omitempty"`
  1729. // ForceSendFields is a list of field names (e.g. "AutoDeleteTime") to
  1730. // unconditionally include in API requests. By default, fields with
  1731. // empty values are omitted from API requests. However, any non-pointer,
  1732. // non-interface field appearing in ForceSendFields will be sent to the
  1733. // server regardless of whether the field is empty or not. This may be
  1734. // used to include empty fields in Patch requests.
  1735. ForceSendFields []string `json:"-"`
  1736. // NullFields is a list of field names (e.g. "AutoDeleteTime") to
  1737. // include in API requests with the JSON null value. By default, fields
  1738. // with empty values are omitted from API requests. However, any field
  1739. // with an empty value appearing in NullFields will be sent to the
  1740. // server as null. It is an error if a field in this list has a
  1741. // non-empty value. This may be used to include null fields in Patch
  1742. // requests.
  1743. NullFields []string `json:"-"`
  1744. }
  1745. func (s *LifecycleConfig) MarshalJSON() ([]byte, error) {
  1746. type NoMethod LifecycleConfig
  1747. raw := NoMethod(*s)
  1748. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1749. }
  1750. // ListAutoscalingPoliciesResponse: A response to a request to list
  1751. // autoscaling policies in a project.
  1752. type ListAutoscalingPoliciesResponse struct {
  1753. // NextPageToken: Output only. This token is included in the response if
  1754. // there are more results to fetch.
  1755. NextPageToken string `json:"nextPageToken,omitempty"`
  1756. // Policies: Output only. Autoscaling policies list.
  1757. Policies []*AutoscalingPolicy `json:"policies,omitempty"`
  1758. // ServerResponse contains the HTTP response code and headers from the
  1759. // server.
  1760. googleapi.ServerResponse `json:"-"`
  1761. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1762. // unconditionally include in API requests. By default, fields with
  1763. // empty values are omitted from API requests. However, any non-pointer,
  1764. // non-interface field appearing in ForceSendFields will be sent to the
  1765. // server regardless of whether the field is empty or not. This may be
  1766. // used to include empty fields in Patch requests.
  1767. ForceSendFields []string `json:"-"`
  1768. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1769. // in API requests with the JSON null value. By default, fields with
  1770. // empty values are omitted from API requests. However, any field with
  1771. // an empty value appearing in NullFields will be sent to the server as
  1772. // null. It is an error if a field in this list has a non-empty value.
  1773. // This may be used to include null fields in Patch requests.
  1774. NullFields []string `json:"-"`
  1775. }
  1776. func (s *ListAutoscalingPoliciesResponse) MarshalJSON() ([]byte, error) {
  1777. type NoMethod ListAutoscalingPoliciesResponse
  1778. raw := NoMethod(*s)
  1779. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1780. }
  1781. // ListClustersResponse: The list of all clusters in a project.
  1782. type ListClustersResponse struct {
  1783. // Clusters: Output only. The clusters in the project.
  1784. Clusters []*Cluster `json:"clusters,omitempty"`
  1785. // NextPageToken: Output only. This token is included in the response if
  1786. // there are more results to fetch. To fetch additional results, provide
  1787. // this value as the page_token in a subsequent
  1788. // <code>ListClustersRequest</code>.
  1789. NextPageToken string `json:"nextPageToken,omitempty"`
  1790. // ServerResponse contains the HTTP response code and headers from the
  1791. // server.
  1792. googleapi.ServerResponse `json:"-"`
  1793. // ForceSendFields is a list of field names (e.g. "Clusters") to
  1794. // unconditionally include in API requests. By default, fields with
  1795. // empty values are omitted from API requests. However, any non-pointer,
  1796. // non-interface field appearing in ForceSendFields will be sent to the
  1797. // server regardless of whether the field is empty or not. This may be
  1798. // used to include empty fields in Patch requests.
  1799. ForceSendFields []string `json:"-"`
  1800. // NullFields is a list of field names (e.g. "Clusters") to include in
  1801. // API requests with the JSON null value. By default, fields with empty
  1802. // values are omitted from API requests. However, any field with an
  1803. // empty value appearing in NullFields will be sent to the server as
  1804. // null. It is an error if a field in this list has a non-empty value.
  1805. // This may be used to include null fields in Patch requests.
  1806. NullFields []string `json:"-"`
  1807. }
  1808. func (s *ListClustersResponse) MarshalJSON() ([]byte, error) {
  1809. type NoMethod ListClustersResponse
  1810. raw := NoMethod(*s)
  1811. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1812. }
  1813. // ListJobsResponse: A list of jobs in a project.
  1814. type ListJobsResponse struct {
  1815. // Jobs: Output only. Jobs list.
  1816. Jobs []*Job `json:"jobs,omitempty"`
  1817. // NextPageToken: Optional. This token is included in the response if
  1818. // there are more results to fetch. To fetch additional results, provide
  1819. // this value as the page_token in a subsequent
  1820. // <code>ListJobsRequest</code>.
  1821. NextPageToken string `json:"nextPageToken,omitempty"`
  1822. // ServerResponse contains the HTTP response code and headers from the
  1823. // server.
  1824. googleapi.ServerResponse `json:"-"`
  1825. // ForceSendFields is a list of field names (e.g. "Jobs") to
  1826. // unconditionally include in API requests. By default, fields with
  1827. // empty values are omitted from API requests. However, any non-pointer,
  1828. // non-interface field appearing in ForceSendFields will be sent to the
  1829. // server regardless of whether the field is empty or not. This may be
  1830. // used to include empty fields in Patch requests.
  1831. ForceSendFields []string `json:"-"`
  1832. // NullFields is a list of field names (e.g. "Jobs") to include in API
  1833. // requests with the JSON null value. By default, fields with empty
  1834. // values are omitted from API requests. However, any field with an
  1835. // empty value appearing in NullFields will be sent to the server as
  1836. // null. It is an error if a field in this list has a non-empty value.
  1837. // This may be used to include null fields in Patch requests.
  1838. NullFields []string `json:"-"`
  1839. }
  1840. func (s *ListJobsResponse) MarshalJSON() ([]byte, error) {
  1841. type NoMethod ListJobsResponse
  1842. raw := NoMethod(*s)
  1843. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1844. }
  1845. // ListOperationsResponse: The response message for
  1846. // Operations.ListOperations.
  1847. type ListOperationsResponse struct {
  1848. // NextPageToken: The standard List next-page token.
  1849. NextPageToken string `json:"nextPageToken,omitempty"`
  1850. // Operations: A list of operations that matches the specified filter in
  1851. // the request.
  1852. Operations []*Operation `json:"operations,omitempty"`
  1853. // ServerResponse contains the HTTP response code and headers from the
  1854. // server.
  1855. googleapi.ServerResponse `json:"-"`
  1856. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1857. // unconditionally include in API requests. By default, fields with
  1858. // empty values are omitted from API requests. However, any non-pointer,
  1859. // non-interface field appearing in ForceSendFields will be sent to the
  1860. // server regardless of whether the field is empty or not. This may be
  1861. // used to include empty fields in Patch requests.
  1862. ForceSendFields []string `json:"-"`
  1863. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1864. // in API requests with the JSON null value. By default, fields with
  1865. // empty values are omitted from API requests. However, any field with
  1866. // an 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. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  1872. type NoMethod ListOperationsResponse
  1873. raw := NoMethod(*s)
  1874. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1875. }
  1876. // ListWorkflowTemplatesResponse: A response to a request to list
  1877. // workflow templates in a project.
  1878. type ListWorkflowTemplatesResponse struct {
  1879. // NextPageToken: Output only. This token is included in the response if
  1880. // there are more results to fetch. To fetch additional results, provide
  1881. // this value as the page_token in a subsequent
  1882. // <code>ListWorkflowTemplatesRequest</code>.
  1883. NextPageToken string `json:"nextPageToken,omitempty"`
  1884. // Templates: Output only. WorkflowTemplates list.
  1885. Templates []*WorkflowTemplate `json:"templates,omitempty"`
  1886. // ServerResponse contains the HTTP response code and headers from the
  1887. // server.
  1888. googleapi.ServerResponse `json:"-"`
  1889. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1890. // unconditionally include in API requests. By default, fields with
  1891. // empty values are omitted from API requests. However, any non-pointer,
  1892. // non-interface field appearing in ForceSendFields will be sent to the
  1893. // server regardless of whether the field is empty or not. This may be
  1894. // used to include empty fields in Patch requests.
  1895. ForceSendFields []string `json:"-"`
  1896. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1897. // in API requests with the JSON null value. By default, fields with
  1898. // empty values are omitted from API requests. However, any field with
  1899. // an empty value appearing in NullFields will be sent to the server as
  1900. // null. It is an error if a field in this list has a non-empty value.
  1901. // This may be used to include null fields in Patch requests.
  1902. NullFields []string `json:"-"`
  1903. }
  1904. func (s *ListWorkflowTemplatesResponse) MarshalJSON() ([]byte, error) {
  1905. type NoMethod ListWorkflowTemplatesResponse
  1906. raw := NoMethod(*s)
  1907. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1908. }
  1909. // LoggingConfig: The runtime logging config of the job.
  1910. type LoggingConfig struct {
  1911. // DriverLogLevels: The per-package log levels for the driver. This may
  1912. // include "root" package name to configure rootLogger. Examples:
  1913. // 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'
  1914. DriverLogLevels map[string]string `json:"driverLogLevels,omitempty"`
  1915. // ForceSendFields is a list of field names (e.g. "DriverLogLevels") to
  1916. // unconditionally include in API requests. By default, fields with
  1917. // empty values are omitted from API requests. However, any non-pointer,
  1918. // non-interface field appearing in ForceSendFields will be sent to the
  1919. // server regardless of whether the field is empty or not. This may be
  1920. // used to include empty fields in Patch requests.
  1921. ForceSendFields []string `json:"-"`
  1922. // NullFields is a list of field names (e.g. "DriverLogLevels") to
  1923. // include in API requests with the JSON null value. By default, fields
  1924. // with empty values are omitted from API requests. However, any field
  1925. // with an empty value appearing in NullFields will be sent to the
  1926. // server as null. It is an error if a field in this list has a
  1927. // non-empty value. This may be used to include null fields in Patch
  1928. // requests.
  1929. NullFields []string `json:"-"`
  1930. }
  1931. func (s *LoggingConfig) MarshalJSON() ([]byte, error) {
  1932. type NoMethod LoggingConfig
  1933. raw := NoMethod(*s)
  1934. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1935. }
  1936. // ManagedCluster: Cluster that is managed by the workflow.
  1937. type ManagedCluster struct {
  1938. // ClusterName: Required. The cluster name prefix. A unique cluster name
  1939. // will be formed by appending a random suffix.The name must contain
  1940. // only lower-case letters (a-z), numbers (0-9), and hyphens (-). Must
  1941. // begin with a letter. Cannot begin or end with hyphen. Must consist of
  1942. // between 2 and 35 characters.
  1943. ClusterName string `json:"clusterName,omitempty"`
  1944. // Config: Required. The cluster configuration.
  1945. Config *ClusterConfig `json:"config,omitempty"`
  1946. // Labels: Optional. The labels to associate with this cluster.Label
  1947. // keys must be between 1 and 63 characters long, and must conform to
  1948. // the following PCRE regular expression: \p{Ll}\p{Lo}{0,62}Label values
  1949. // must be between 1 and 63 characters long, and must conform to the
  1950. // following PCRE regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more
  1951. // than 32 labels can be associated with a given cluster.
  1952. Labels map[string]string `json:"labels,omitempty"`
  1953. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  1954. // unconditionally include in API requests. By default, fields with
  1955. // empty values are omitted from API requests. However, any non-pointer,
  1956. // non-interface field appearing in ForceSendFields will be sent to the
  1957. // server regardless of whether the field is empty or not. This may be
  1958. // used to include empty fields in Patch requests.
  1959. ForceSendFields []string `json:"-"`
  1960. // NullFields is a list of field names (e.g. "ClusterName") to include
  1961. // in API requests with the JSON null value. By default, fields with
  1962. // empty values are omitted from API requests. However, any field with
  1963. // an empty value appearing in NullFields will be sent to the server as
  1964. // null. It is an error if a field in this list has a non-empty value.
  1965. // This may be used to include null fields in Patch requests.
  1966. NullFields []string `json:"-"`
  1967. }
  1968. func (s *ManagedCluster) MarshalJSON() ([]byte, error) {
  1969. type NoMethod ManagedCluster
  1970. raw := NoMethod(*s)
  1971. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1972. }
  1973. // ManagedGroupConfig: Specifies the resources used to actively manage
  1974. // an instance group.
  1975. type ManagedGroupConfig struct {
  1976. // InstanceGroupManagerName: Output only. The name of the Instance Group
  1977. // Manager for this group.
  1978. InstanceGroupManagerName string `json:"instanceGroupManagerName,omitempty"`
  1979. // InstanceTemplateName: Output only. The name of the Instance Template
  1980. // used for the Managed Instance Group.
  1981. InstanceTemplateName string `json:"instanceTemplateName,omitempty"`
  1982. // ForceSendFields is a list of field names (e.g.
  1983. // "InstanceGroupManagerName") to unconditionally include in API
  1984. // requests. By default, fields with empty values are omitted from API
  1985. // requests. However, any non-pointer, non-interface field appearing in
  1986. // ForceSendFields will be sent to the server regardless of whether the
  1987. // field is empty or not. This may be used to include empty fields in
  1988. // Patch requests.
  1989. ForceSendFields []string `json:"-"`
  1990. // NullFields is a list of field names (e.g. "InstanceGroupManagerName")
  1991. // to include in API requests with the JSON null value. By default,
  1992. // fields with empty values are omitted from API requests. However, any
  1993. // field with an empty value appearing in NullFields will be sent to the
  1994. // server as null. It is an error if a field in this list has a
  1995. // non-empty value. This may be used to include null fields in Patch
  1996. // requests.
  1997. NullFields []string `json:"-"`
  1998. }
  1999. func (s *ManagedGroupConfig) MarshalJSON() ([]byte, error) {
  2000. type NoMethod ManagedGroupConfig
  2001. raw := NoMethod(*s)
  2002. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2003. }
  2004. // NodeInitializationAction: Specifies an executable to run on a fully
  2005. // configured node and a timeout period for executable completion.
  2006. type NodeInitializationAction struct {
  2007. // ExecutableFile: Required. Cloud Storage URI of executable file.
  2008. ExecutableFile string `json:"executableFile,omitempty"`
  2009. // ExecutionTimeout: Optional. Amount of time executable has to
  2010. // complete. Default is 10 minutes. Cluster creation fails with an
  2011. // explanatory error message (the name of the executable that caused the
  2012. // error and the exceeded timeout period) if the executable is not
  2013. // completed at end of the timeout period.
  2014. ExecutionTimeout string `json:"executionTimeout,omitempty"`
  2015. // ForceSendFields is a list of field names (e.g. "ExecutableFile") to
  2016. // unconditionally include in API requests. By default, fields with
  2017. // empty values are omitted from API requests. However, any non-pointer,
  2018. // non-interface field appearing in ForceSendFields will be sent to the
  2019. // server regardless of whether the field is empty or not. This may be
  2020. // used to include empty fields in Patch requests.
  2021. ForceSendFields []string `json:"-"`
  2022. // NullFields is a list of field names (e.g. "ExecutableFile") to
  2023. // include in API requests with the JSON null value. By default, fields
  2024. // with empty values are omitted from API requests. However, any field
  2025. // with an empty value appearing in NullFields will be sent to the
  2026. // server as null. It is an error if a field in this list has a
  2027. // non-empty value. This may be used to include null fields in Patch
  2028. // requests.
  2029. NullFields []string `json:"-"`
  2030. }
  2031. func (s *NodeInitializationAction) MarshalJSON() ([]byte, error) {
  2032. type NoMethod NodeInitializationAction
  2033. raw := NoMethod(*s)
  2034. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2035. }
  2036. // Operation: This resource represents a long-running operation that is
  2037. // the result of a network API call.
  2038. type Operation struct {
  2039. // Done: If the value is false, it means the operation is still in
  2040. // progress. If true, the operation is completed, and either error or
  2041. // response is available.
  2042. Done bool `json:"done,omitempty"`
  2043. // Error: The error result of the operation in case of failure or
  2044. // cancellation.
  2045. Error *Status `json:"error,omitempty"`
  2046. // Metadata: Service-specific metadata associated with the operation. It
  2047. // typically contains progress information and common metadata such as
  2048. // create time. Some services might not provide such metadata. Any
  2049. // method that returns a long-running operation should document the
  2050. // metadata type, if any.
  2051. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  2052. // Name: The server-assigned name, which is only unique within the same
  2053. // service that originally returns it. If you use the default HTTP
  2054. // mapping, the name should have the format of
  2055. // operations/some/unique/name.
  2056. Name string `json:"name,omitempty"`
  2057. // Response: The normal response of the operation in case of success. If
  2058. // the original method returns no data on success, such as Delete, the
  2059. // response is google.protobuf.Empty. If the original method is standard
  2060. // Get/Create/Update, the response should be the resource. For other
  2061. // methods, the response should have the type XxxResponse, where Xxx is
  2062. // the original method name. For example, if the original method name is
  2063. // TakeSnapshot(), the inferred response type is TakeSnapshotResponse.
  2064. Response googleapi.RawMessage `json:"response,omitempty"`
  2065. // ServerResponse contains the HTTP response code and headers from the
  2066. // server.
  2067. googleapi.ServerResponse `json:"-"`
  2068. // ForceSendFields is a list of field names (e.g. "Done") to
  2069. // unconditionally include in API requests. By default, fields with
  2070. // empty values are omitted from API requests. However, any non-pointer,
  2071. // non-interface field appearing in ForceSendFields will be sent to the
  2072. // server regardless of whether the field is empty or not. This may be
  2073. // used to include empty fields in Patch requests.
  2074. ForceSendFields []string `json:"-"`
  2075. // NullFields is a list of field names (e.g. "Done") to include in API
  2076. // requests with the JSON null value. By default, fields with empty
  2077. // values are omitted from API requests. However, any field with an
  2078. // empty value appearing in NullFields will be sent to the server as
  2079. // null. It is an error if a field in this list has a non-empty value.
  2080. // This may be used to include null fields in Patch requests.
  2081. NullFields []string `json:"-"`
  2082. }
  2083. func (s *Operation) MarshalJSON() ([]byte, error) {
  2084. type NoMethod Operation
  2085. raw := NoMethod(*s)
  2086. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2087. }
  2088. // OrderedJob: A job executed by the workflow.
  2089. type OrderedJob struct {
  2090. // HadoopJob: Job is a Hadoop job.
  2091. HadoopJob *HadoopJob `json:"hadoopJob,omitempty"`
  2092. // HiveJob: Job is a Hive job.
  2093. HiveJob *HiveJob `json:"hiveJob,omitempty"`
  2094. // Labels: Optional. The labels to associate with this job.Label keys
  2095. // must be between 1 and 63 characters long, and must conform to the
  2096. // following regular expression: \p{Ll}\p{Lo}{0,62}Label values must be
  2097. // between 1 and 63 characters long, and must conform to the following
  2098. // regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels
  2099. // can be associated with a given job.
  2100. Labels map[string]string `json:"labels,omitempty"`
  2101. // PigJob: Job is a Pig job.
  2102. PigJob *PigJob `json:"pigJob,omitempty"`
  2103. // PrerequisiteStepIds: Optional. The optional list of prerequisite job
  2104. // step_ids. If not specified, the job will start at the beginning of
  2105. // workflow.
  2106. PrerequisiteStepIds []string `json:"prerequisiteStepIds,omitempty"`
  2107. // PysparkJob: Job is a Pyspark job.
  2108. PysparkJob *PySparkJob `json:"pysparkJob,omitempty"`
  2109. // Scheduling: Optional. Job scheduling configuration.
  2110. Scheduling *JobScheduling `json:"scheduling,omitempty"`
  2111. // SparkJob: Job is a Spark job.
  2112. SparkJob *SparkJob `json:"sparkJob,omitempty"`
  2113. // SparkSqlJob: Job is a SparkSql job.
  2114. SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"`
  2115. // StepId: Required. The step id. The id must be unique among all jobs
  2116. // within the template.The step id is used as prefix for job id, as job
  2117. // goog-dataproc-workflow-step-id label, and in prerequisiteStepIds
  2118. // field from other steps.The id must contain only letters (a-z, A-Z),
  2119. // numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end
  2120. // with underscore or hyphen. Must consist of between 3 and 50
  2121. // characters.
  2122. StepId string `json:"stepId,omitempty"`
  2123. // ForceSendFields is a list of field names (e.g. "HadoopJob") to
  2124. // unconditionally include in API requests. By default, fields with
  2125. // empty values are omitted from API requests. However, any non-pointer,
  2126. // non-interface field appearing in ForceSendFields will be sent to the
  2127. // server regardless of whether the field is empty or not. This may be
  2128. // used to include empty fields in Patch requests.
  2129. ForceSendFields []string `json:"-"`
  2130. // NullFields is a list of field names (e.g. "HadoopJob") to include in
  2131. // API requests with the JSON null value. By default, fields with empty
  2132. // values are omitted from API requests. However, any field with an
  2133. // empty value appearing in NullFields will be sent to the server as
  2134. // null. It is an error if a field in this list has a non-empty value.
  2135. // This may be used to include null fields in Patch requests.
  2136. NullFields []string `json:"-"`
  2137. }
  2138. func (s *OrderedJob) MarshalJSON() ([]byte, error) {
  2139. type NoMethod OrderedJob
  2140. raw := NoMethod(*s)
  2141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2142. }
  2143. // ParameterValidation: Configuration for parameter validation.
  2144. type ParameterValidation struct {
  2145. // Regex: Validation based on regular expressions.
  2146. Regex *RegexValidation `json:"regex,omitempty"`
  2147. // Values: Validation based on a list of allowed values.
  2148. Values *ValueValidation `json:"values,omitempty"`
  2149. // ForceSendFields is a list of field names (e.g. "Regex") to
  2150. // unconditionally include in API requests. By default, fields with
  2151. // empty values are omitted from API requests. However, any non-pointer,
  2152. // non-interface field appearing in ForceSendFields will be sent to the
  2153. // server regardless of whether the field is empty or not. This may be
  2154. // used to include empty fields in Patch requests.
  2155. ForceSendFields []string `json:"-"`
  2156. // NullFields is a list of field names (e.g. "Regex") to include in API
  2157. // requests with the JSON null value. By default, fields with empty
  2158. // values are omitted from API requests. However, any field with an
  2159. // empty value appearing in NullFields will be sent to the server as
  2160. // null. It is an error if a field in this list has a non-empty value.
  2161. // This may be used to include null fields in Patch requests.
  2162. NullFields []string `json:"-"`
  2163. }
  2164. func (s *ParameterValidation) MarshalJSON() ([]byte, error) {
  2165. type NoMethod ParameterValidation
  2166. raw := NoMethod(*s)
  2167. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2168. }
  2169. // PigJob: A Cloud Dataproc job for running Apache Pig
  2170. // (https://pig.apache.org/) queries on YARN.
  2171. type PigJob struct {
  2172. // ContinueOnFailure: Optional. Whether to continue executing queries if
  2173. // a query fails. The default value is false. Setting to true can be
  2174. // useful when executing independent parallel queries.
  2175. ContinueOnFailure bool `json:"continueOnFailure,omitempty"`
  2176. // JarFileUris: Optional. HCFS URIs of jar files to add to the CLASSPATH
  2177. // of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig
  2178. // UDFs.
  2179. JarFileUris []string `json:"jarFileUris,omitempty"`
  2180. // LoggingConfig: Optional. The runtime log config for job execution.
  2181. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  2182. // Properties: Optional. A mapping of property names to values, used to
  2183. // configure Pig. Properties that conflict with values set by the Cloud
  2184. // Dataproc API may be overwritten. Can include properties set in
  2185. // /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and
  2186. // classes in user code.
  2187. Properties map[string]string `json:"properties,omitempty"`
  2188. // QueryFileUri: The HCFS URI of the script that contains the Pig
  2189. // queries.
  2190. QueryFileUri string `json:"queryFileUri,omitempty"`
  2191. // QueryList: A list of queries.
  2192. QueryList *QueryList `json:"queryList,omitempty"`
  2193. // ScriptVariables: Optional. Mapping of query variable names to values
  2194. // (equivalent to the Pig command: name=[value]).
  2195. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  2196. // ForceSendFields is a list of field names (e.g. "ContinueOnFailure")
  2197. // to unconditionally include in API requests. By default, fields with
  2198. // empty values are omitted from API requests. However, any non-pointer,
  2199. // non-interface field appearing in ForceSendFields will be sent to the
  2200. // server regardless of whether the field is empty or not. This may be
  2201. // used to include empty fields in Patch requests.
  2202. ForceSendFields []string `json:"-"`
  2203. // NullFields is a list of field names (e.g. "ContinueOnFailure") to
  2204. // include in API requests with the JSON null value. By default, fields
  2205. // with empty values are omitted from API requests. However, any field
  2206. // with an empty value appearing in NullFields will be sent to the
  2207. // server as null. It is an error if a field in this list has a
  2208. // non-empty value. This may be used to include null fields in Patch
  2209. // requests.
  2210. NullFields []string `json:"-"`
  2211. }
  2212. func (s *PigJob) MarshalJSON() ([]byte, error) {
  2213. type NoMethod PigJob
  2214. raw := NoMethod(*s)
  2215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2216. }
  2217. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  2218. // used to specify access control policies for Cloud Platform
  2219. // resources.A Policy consists of a list of bindings. A binding binds a
  2220. // list of members to a role, where the members can be user accounts,
  2221. // Google groups, Google domains, and service accounts. A role is a
  2222. // named list of permissions defined by IAM.JSON Example
  2223. // {
  2224. // "bindings": [
  2225. // {
  2226. // "role": "roles/owner",
  2227. // "members": [
  2228. // "user:mike@example.com",
  2229. // "group:admins@example.com",
  2230. // "domain:google.com",
  2231. // "serviceAccount:my-other-app@appspot.gserviceaccount.com"
  2232. // ]
  2233. // },
  2234. // {
  2235. // "role": "roles/viewer",
  2236. // "members": ["user:sean@example.com"]
  2237. // }
  2238. // ]
  2239. // }
  2240. // YAML Example
  2241. // bindings:
  2242. // - members:
  2243. // - user:mike@example.com
  2244. // - group:admins@example.com
  2245. // - domain:google.com
  2246. // - serviceAccount:my-other-app@appspot.gserviceaccount.com
  2247. // role: roles/owner
  2248. // - members:
  2249. // - user:sean@example.com
  2250. // role: roles/viewer
  2251. // For a description of IAM and its features, see the IAM developer's
  2252. // guide (https://cloud.google.com/iam/docs).
  2253. type Policy struct {
  2254. // Bindings: Associates a list of members to a role. bindings with no
  2255. // members will result in an error.
  2256. Bindings []*Binding `json:"bindings,omitempty"`
  2257. // Etag: etag is used for optimistic concurrency control as a way to
  2258. // help prevent simultaneous updates of a policy from overwriting each
  2259. // other. It is strongly suggested that systems make use of the etag in
  2260. // the read-modify-write cycle to perform policy updates in order to
  2261. // avoid race conditions: An etag is returned in the response to
  2262. // getIamPolicy, and systems are expected to put that etag in the
  2263. // request to setIamPolicy to ensure that their change will be applied
  2264. // to the same version of the policy.If no etag is provided in the call
  2265. // to setIamPolicy, then the existing policy is overwritten blindly.
  2266. Etag string `json:"etag,omitempty"`
  2267. // Version: Deprecated.
  2268. Version int64 `json:"version,omitempty"`
  2269. // ServerResponse contains the HTTP response code and headers from the
  2270. // server.
  2271. googleapi.ServerResponse `json:"-"`
  2272. // ForceSendFields is a list of field names (e.g. "Bindings") to
  2273. // unconditionally include in API requests. By default, fields with
  2274. // empty values are omitted from API requests. However, any non-pointer,
  2275. // non-interface field appearing in ForceSendFields will be sent to the
  2276. // server regardless of whether the field is empty or not. This may be
  2277. // used to include empty fields in Patch requests.
  2278. ForceSendFields []string `json:"-"`
  2279. // NullFields is a list of field names (e.g. "Bindings") to include in
  2280. // API requests with the JSON null value. By default, fields with empty
  2281. // values are omitted from API requests. However, any field with an
  2282. // empty value appearing in NullFields will be sent to the server as
  2283. // null. It is an error if a field in this list has a non-empty value.
  2284. // This may be used to include null fields in Patch requests.
  2285. NullFields []string `json:"-"`
  2286. }
  2287. func (s *Policy) MarshalJSON() ([]byte, error) {
  2288. type NoMethod Policy
  2289. raw := NoMethod(*s)
  2290. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2291. }
  2292. // PrestoJob: A Cloud Dataproc job for running Presto
  2293. // (https://prestosql.io/) queries
  2294. type PrestoJob struct {
  2295. // ClientTags: Optional. Presto client tags to attach to this query
  2296. ClientTags []string `json:"clientTags,omitempty"`
  2297. // ContinueOnFailure: Optional. Whether to continue executing queries if
  2298. // a query fails. The default value is false. Setting to true can be
  2299. // useful when executing independent parallel queries.
  2300. ContinueOnFailure bool `json:"continueOnFailure,omitempty"`
  2301. // LoggingConfig: Optional. The runtime log config for job execution.
  2302. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  2303. // OutputFormat: Optional. The format in which query output will be
  2304. // displayed. See the Presto documentation for supported output formats
  2305. OutputFormat string `json:"outputFormat,omitempty"`
  2306. // Properties: Optional. A mapping of property names to values. Used to
  2307. // set Presto session properties
  2308. // (https://prestodb.io/docs/current/sql/set-session.html) Equivalent to
  2309. // using the --session flag in the Presto CLI
  2310. Properties map[string]string `json:"properties,omitempty"`
  2311. // QueryFileUri: The HCFS URI of the script that contains SQL queries.
  2312. QueryFileUri string `json:"queryFileUri,omitempty"`
  2313. // QueryList: A list of queries.
  2314. QueryList *QueryList `json:"queryList,omitempty"`
  2315. // ForceSendFields is a list of field names (e.g. "ClientTags") to
  2316. // unconditionally include in API requests. By default, fields with
  2317. // empty values are omitted from API requests. However, any non-pointer,
  2318. // non-interface field appearing in ForceSendFields will be sent to the
  2319. // server regardless of whether the field is empty or not. This may be
  2320. // used to include empty fields in Patch requests.
  2321. ForceSendFields []string `json:"-"`
  2322. // NullFields is a list of field names (e.g. "ClientTags") to include in
  2323. // API requests with the JSON null value. By default, fields with empty
  2324. // values are omitted from API requests. However, any field with an
  2325. // empty value appearing in NullFields will be sent to the server as
  2326. // null. It is an error if a field in this list has a non-empty value.
  2327. // This may be used to include null fields in Patch requests.
  2328. NullFields []string `json:"-"`
  2329. }
  2330. func (s *PrestoJob) MarshalJSON() ([]byte, error) {
  2331. type NoMethod PrestoJob
  2332. raw := NoMethod(*s)
  2333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2334. }
  2335. // PySparkJob: A Cloud Dataproc job for running Apache PySpark
  2336. // (https://spark.apache.org/docs/0.9.0/python-programming-guide.html)
  2337. // applications on YARN.
  2338. type PySparkJob struct {
  2339. // ArchiveUris: Optional. HCFS URIs of archives to be extracted in the
  2340. // working directory of .jar, .tar, .tar.gz, .tgz, and .zip.
  2341. ArchiveUris []string `json:"archiveUris,omitempty"`
  2342. // Args: Optional. The arguments to pass to the driver. Do not include
  2343. // arguments, such as --conf, that can be set as job properties, since a
  2344. // collision may occur that causes an incorrect job submission.
  2345. Args []string `json:"args,omitempty"`
  2346. // FileUris: Optional. HCFS URIs of files to be copied to the working
  2347. // directory of Python drivers and distributed tasks. Useful for naively
  2348. // parallel tasks.
  2349. FileUris []string `json:"fileUris,omitempty"`
  2350. // JarFileUris: Optional. HCFS URIs of jar files to add to the
  2351. // CLASSPATHs of the Python driver and tasks.
  2352. JarFileUris []string `json:"jarFileUris,omitempty"`
  2353. // LoggingConfig: Optional. The runtime log config for job execution.
  2354. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  2355. // MainPythonFileUri: Required. The HCFS URI of the main Python file to
  2356. // use as the driver. Must be a .py file.
  2357. MainPythonFileUri string `json:"mainPythonFileUri,omitempty"`
  2358. // Properties: Optional. A mapping of property names to values, used to
  2359. // configure PySpark. Properties that conflict with values set by the
  2360. // Cloud Dataproc API may be overwritten. Can include properties set in
  2361. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  2362. Properties map[string]string `json:"properties,omitempty"`
  2363. // PythonFileUris: Optional. HCFS file URIs of Python files to pass to
  2364. // the PySpark framework. Supported file types: .py, .egg, and .zip.
  2365. PythonFileUris []string `json:"pythonFileUris,omitempty"`
  2366. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  2367. // unconditionally include in API requests. By default, fields with
  2368. // empty values are omitted from API requests. However, any non-pointer,
  2369. // non-interface field appearing in ForceSendFields will be sent to the
  2370. // server regardless of whether the field is empty or not. This may be
  2371. // used to include empty fields in Patch requests.
  2372. ForceSendFields []string `json:"-"`
  2373. // NullFields is a list of field names (e.g. "ArchiveUris") to include
  2374. // in API requests with the JSON null value. By default, fields with
  2375. // empty values are omitted from API requests. However, any field with
  2376. // an empty value appearing in NullFields will be sent to the server as
  2377. // null. It is an error if a field in this list has a non-empty value.
  2378. // This may be used to include null fields in Patch requests.
  2379. NullFields []string `json:"-"`
  2380. }
  2381. func (s *PySparkJob) MarshalJSON() ([]byte, error) {
  2382. type NoMethod PySparkJob
  2383. raw := NoMethod(*s)
  2384. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2385. }
  2386. // QueryList: A list of queries to run on a cluster.
  2387. type QueryList struct {
  2388. // Queries: Required. The queries to execute. You do not need to
  2389. // terminate a query with a semicolon. Multiple queries can be specified
  2390. // in one string by separating each with a semicolon. Here is an example
  2391. // of an Cloud Dataproc API snippet that uses a QueryList to specify a
  2392. // HiveJob:
  2393. // "hiveJob": {
  2394. // "queryList": {
  2395. // "queries": [
  2396. // "query1",
  2397. // "query2",
  2398. // "query3;query4",
  2399. // ]
  2400. // }
  2401. // }
  2402. //
  2403. Queries []string `json:"queries,omitempty"`
  2404. // ForceSendFields is a list of field names (e.g. "Queries") to
  2405. // unconditionally include in API requests. By default, fields with
  2406. // empty values are omitted from API requests. However, any non-pointer,
  2407. // non-interface field appearing in ForceSendFields will be sent to the
  2408. // server regardless of whether the field is empty or not. This may be
  2409. // used to include empty fields in Patch requests.
  2410. ForceSendFields []string `json:"-"`
  2411. // NullFields is a list of field names (e.g. "Queries") to include in
  2412. // API requests with the JSON null value. By default, fields with empty
  2413. // values are omitted from API requests. However, any field with an
  2414. // empty value appearing in NullFields will be sent to the server as
  2415. // null. It is an error if a field in this list has a non-empty value.
  2416. // This may be used to include null fields in Patch requests.
  2417. NullFields []string `json:"-"`
  2418. }
  2419. func (s *QueryList) MarshalJSON() ([]byte, error) {
  2420. type NoMethod QueryList
  2421. raw := NoMethod(*s)
  2422. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2423. }
  2424. // RegexValidation: Validation based on regular expressions.
  2425. type RegexValidation struct {
  2426. // Regexes: Required. RE2 regular expressions used to validate the
  2427. // parameter's value. The value must match the regex in its entirety
  2428. // (substring matches are not sufficient).
  2429. Regexes []string `json:"regexes,omitempty"`
  2430. // ForceSendFields is a list of field names (e.g. "Regexes") to
  2431. // unconditionally include in API requests. By default, fields with
  2432. // empty values are omitted from API requests. However, any non-pointer,
  2433. // non-interface field appearing in ForceSendFields will be sent to the
  2434. // server regardless of whether the field is empty or not. This may be
  2435. // used to include empty fields in Patch requests.
  2436. ForceSendFields []string `json:"-"`
  2437. // NullFields is a list of field names (e.g. "Regexes") to include in
  2438. // API requests with the JSON null value. By default, fields with empty
  2439. // values are omitted from API requests. However, any field with an
  2440. // empty value appearing in NullFields will be sent to the server as
  2441. // null. It is an error if a field in this list has a non-empty value.
  2442. // This may be used to include null fields in Patch requests.
  2443. NullFields []string `json:"-"`
  2444. }
  2445. func (s *RegexValidation) MarshalJSON() ([]byte, error) {
  2446. type NoMethod RegexValidation
  2447. raw := NoMethod(*s)
  2448. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2449. }
  2450. // SecurityConfig: Security related configuration, including encryption,
  2451. // Kerberos, etc.
  2452. type SecurityConfig struct {
  2453. // KerberosConfig: Kerberos related configuration.
  2454. KerberosConfig *KerberosConfig `json:"kerberosConfig,omitempty"`
  2455. // ForceSendFields is a list of field names (e.g. "KerberosConfig") to
  2456. // unconditionally include in API requests. By default, fields with
  2457. // empty values are omitted from API requests. However, any non-pointer,
  2458. // non-interface field appearing in ForceSendFields will be sent to the
  2459. // server regardless of whether the field is empty or not. This may be
  2460. // used to include empty fields in Patch requests.
  2461. ForceSendFields []string `json:"-"`
  2462. // NullFields is a list of field names (e.g. "KerberosConfig") to
  2463. // include in API requests with the JSON null value. By default, fields
  2464. // with empty values are omitted from API requests. However, any field
  2465. // with an empty value appearing in NullFields will be sent to the
  2466. // server as null. It is an error if a field in this list has a
  2467. // non-empty value. This may be used to include null fields in Patch
  2468. // requests.
  2469. NullFields []string `json:"-"`
  2470. }
  2471. func (s *SecurityConfig) MarshalJSON() ([]byte, error) {
  2472. type NoMethod SecurityConfig
  2473. raw := NoMethod(*s)
  2474. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2475. }
  2476. // SetIamPolicyRequest: Request message for SetIamPolicy method.
  2477. type SetIamPolicyRequest struct {
  2478. // Policy: REQUIRED: The complete policy to be applied to the resource.
  2479. // The size of the policy is limited to a few 10s of KB. An empty policy
  2480. // is a valid policy but certain Cloud Platform services (such as
  2481. // Projects) might reject them.
  2482. Policy *Policy `json:"policy,omitempty"`
  2483. // ForceSendFields is a list of field names (e.g. "Policy") to
  2484. // unconditionally include in API requests. By default, fields with
  2485. // empty values are omitted from API requests. However, any non-pointer,
  2486. // non-interface field appearing in ForceSendFields will be sent to the
  2487. // server regardless of whether the field is empty or not. This may be
  2488. // used to include empty fields in Patch requests.
  2489. ForceSendFields []string `json:"-"`
  2490. // NullFields is a list of field names (e.g. "Policy") to include in API
  2491. // requests with the JSON null value. By default, fields with empty
  2492. // values are omitted from API requests. However, any field with an
  2493. // empty value appearing in NullFields will be sent to the server as
  2494. // null. It is an error if a field in this list has a non-empty value.
  2495. // This may be used to include null fields in Patch requests.
  2496. NullFields []string `json:"-"`
  2497. }
  2498. func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  2499. type NoMethod SetIamPolicyRequest
  2500. raw := NoMethod(*s)
  2501. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2502. }
  2503. // SoftwareConfig: Specifies the selection and config of software inside
  2504. // the cluster.
  2505. type SoftwareConfig struct {
  2506. // ImageVersion: Optional. The version of software inside the cluster.
  2507. // It must be one of the supported Cloud Dataproc Versions, such as
  2508. // "1.2" (including a subminor version, such as "1.2.29"), or the
  2509. // "preview" version. If unspecified, it defaults to the latest version.
  2510. ImageVersion string `json:"imageVersion,omitempty"`
  2511. // OptionalComponents: The set of optional components to activate on the
  2512. // cluster.
  2513. //
  2514. // Possible values:
  2515. // "COMPONENT_UNSPECIFIED" - Unspecified component.
  2516. // "ANACONDA" - The Anaconda python distribution.
  2517. // "HIVE_WEBHCAT" - The Hive Web HCatalog (the REST service for
  2518. // accessing HCatalog).
  2519. // "JUPYTER" - The Jupyter Notebook.
  2520. // "KERBEROS" - The Kerberos security feature.
  2521. // "PRESTO" - The Presto query engine.
  2522. // "ZEPPELIN" - The Zeppelin notebook.
  2523. // "ZOOKEEPER" - The Zookeeper service.
  2524. // "DRUID" - The Druid query engine.
  2525. OptionalComponents []string `json:"optionalComponents,omitempty"`
  2526. // Properties: Optional. The properties to set on daemon config
  2527. // files.Property keys are specified in prefix:property format, for
  2528. // example core:hadoop.tmp.dir. The following are supported prefixes and
  2529. // their mappings:
  2530. // capacity-scheduler: capacity-scheduler.xml
  2531. // core: core-site.xml
  2532. // distcp: distcp-default.xml
  2533. // hdfs: hdfs-site.xml
  2534. // hive: hive-site.xml
  2535. // mapred: mapred-site.xml
  2536. // pig: pig.properties
  2537. // spark: spark-defaults.conf
  2538. // yarn: yarn-site.xmlFor more information, see Cluster properties.
  2539. Properties map[string]string `json:"properties,omitempty"`
  2540. // ForceSendFields is a list of field names (e.g. "ImageVersion") to
  2541. // unconditionally include in API requests. By default, fields with
  2542. // empty values are omitted from API requests. However, any non-pointer,
  2543. // non-interface field appearing in ForceSendFields will be sent to the
  2544. // server regardless of whether the field is empty or not. This may be
  2545. // used to include empty fields in Patch requests.
  2546. ForceSendFields []string `json:"-"`
  2547. // NullFields is a list of field names (e.g. "ImageVersion") to include
  2548. // in API requests with the JSON null value. By default, fields with
  2549. // empty values are omitted from API requests. However, any field with
  2550. // an empty value appearing in NullFields will be sent to the server as
  2551. // null. It is an error if a field in this list has a non-empty value.
  2552. // This may be used to include null fields in Patch requests.
  2553. NullFields []string `json:"-"`
  2554. }
  2555. func (s *SoftwareConfig) MarshalJSON() ([]byte, error) {
  2556. type NoMethod SoftwareConfig
  2557. raw := NoMethod(*s)
  2558. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2559. }
  2560. // SparkJob: A Cloud Dataproc job for running Apache Spark
  2561. // (http://spark.apache.org/) applications on YARN.
  2562. type SparkJob struct {
  2563. // ArchiveUris: Optional. HCFS URIs of archives to be extracted in the
  2564. // working directory of Spark drivers and tasks. Supported file types:
  2565. // .jar, .tar, .tar.gz, .tgz, and .zip.
  2566. ArchiveUris []string `json:"archiveUris,omitempty"`
  2567. // Args: Optional. The arguments to pass to the driver. Do not include
  2568. // arguments, such as --conf, that can be set as job properties, since a
  2569. // collision may occur that causes an incorrect job submission.
  2570. Args []string `json:"args,omitempty"`
  2571. // FileUris: Optional. HCFS URIs of files to be copied to the working
  2572. // directory of Spark drivers and distributed tasks. Useful for naively
  2573. // parallel tasks.
  2574. FileUris []string `json:"fileUris,omitempty"`
  2575. // JarFileUris: Optional. HCFS URIs of jar files to add to the
  2576. // CLASSPATHs of the Spark driver and tasks.
  2577. JarFileUris []string `json:"jarFileUris,omitempty"`
  2578. // LoggingConfig: Optional. The runtime log config for job execution.
  2579. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  2580. // MainClass: The name of the driver's main class. The jar file that
  2581. // contains the class must be in the default CLASSPATH or specified in
  2582. // jar_file_uris.
  2583. MainClass string `json:"mainClass,omitempty"`
  2584. // MainJarFileUri: The HCFS URI of the jar file that contains the main
  2585. // class.
  2586. MainJarFileUri string `json:"mainJarFileUri,omitempty"`
  2587. // Properties: Optional. A mapping of property names to values, used to
  2588. // configure Spark. Properties that conflict with values set by the
  2589. // Cloud Dataproc API may be overwritten. Can include properties set in
  2590. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  2591. Properties map[string]string `json:"properties,omitempty"`
  2592. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  2593. // unconditionally include in API requests. By default, fields with
  2594. // empty values are omitted from API requests. However, any non-pointer,
  2595. // non-interface field appearing in ForceSendFields will be sent to the
  2596. // server regardless of whether the field is empty or not. This may be
  2597. // used to include empty fields in Patch requests.
  2598. ForceSendFields []string `json:"-"`
  2599. // NullFields is a list of field names (e.g. "ArchiveUris") to include
  2600. // in API requests with the JSON null value. By default, fields with
  2601. // empty values are omitted from API requests. However, any field with
  2602. // an empty value appearing in NullFields will be sent to the server as
  2603. // null. It is an error if a field in this list has a non-empty value.
  2604. // This may be used to include null fields in Patch requests.
  2605. NullFields []string `json:"-"`
  2606. }
  2607. func (s *SparkJob) MarshalJSON() ([]byte, error) {
  2608. type NoMethod SparkJob
  2609. raw := NoMethod(*s)
  2610. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2611. }
  2612. // SparkRJob: A Cloud Dataproc job for running Apache SparkR
  2613. // (https://spark.apache.org/docs/latest/sparkr.html) applications on
  2614. // YARN.
  2615. type SparkRJob struct {
  2616. // ArchiveUris: Optional. HCFS URIs of archives to be extracted in the
  2617. // working directory of Spark drivers and tasks. Supported file types:
  2618. // .jar, .tar, .tar.gz, .tgz, and .zip.
  2619. ArchiveUris []string `json:"archiveUris,omitempty"`
  2620. // Args: Optional. The arguments to pass to the driver. Do not include
  2621. // arguments, such as --conf, that can be set as job properties, since a
  2622. // collision may occur that causes an incorrect job submission.
  2623. Args []string `json:"args,omitempty"`
  2624. // FileUris: Optional. HCFS URIs of files to be copied to the working
  2625. // directory of R drivers and distributed tasks. Useful for naively
  2626. // parallel tasks.
  2627. FileUris []string `json:"fileUris,omitempty"`
  2628. // LoggingConfig: Optional. The runtime log config for job execution.
  2629. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  2630. // MainRFileUri: Required. The HCFS URI of the main R file to use as the
  2631. // driver. Must be a .R file.
  2632. MainRFileUri string `json:"mainRFileUri,omitempty"`
  2633. // Properties: Optional. A mapping of property names to values, used to
  2634. // configure SparkR. Properties that conflict with values set by the
  2635. // Cloud Dataproc API may be overwritten. Can include properties set in
  2636. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  2637. Properties map[string]string `json:"properties,omitempty"`
  2638. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  2639. // unconditionally include in API requests. By default, fields with
  2640. // empty values are omitted from API requests. However, any non-pointer,
  2641. // non-interface field appearing in ForceSendFields will be sent to the
  2642. // server regardless of whether the field is empty or not. This may be
  2643. // used to include empty fields in Patch requests.
  2644. ForceSendFields []string `json:"-"`
  2645. // NullFields is a list of field names (e.g. "ArchiveUris") to include
  2646. // in API requests with the JSON null value. By default, fields with
  2647. // empty values are omitted from API requests. However, any field with
  2648. // an empty value appearing in NullFields will be sent to the server as
  2649. // null. It is an error if a field in this list has a non-empty value.
  2650. // This may be used to include null fields in Patch requests.
  2651. NullFields []string `json:"-"`
  2652. }
  2653. func (s *SparkRJob) MarshalJSON() ([]byte, error) {
  2654. type NoMethod SparkRJob
  2655. raw := NoMethod(*s)
  2656. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2657. }
  2658. // SparkSqlJob: A Cloud Dataproc job for running Apache Spark SQL
  2659. // (http://spark.apache.org/sql/) queries.
  2660. type SparkSqlJob struct {
  2661. // JarFileUris: Optional. HCFS URIs of jar files to be added to the
  2662. // Spark CLASSPATH.
  2663. JarFileUris []string `json:"jarFileUris,omitempty"`
  2664. // LoggingConfig: Optional. The runtime log config for job execution.
  2665. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  2666. // Properties: Optional. A mapping of property names to values, used to
  2667. // configure Spark SQL's SparkConf. Properties that conflict with values
  2668. // set by the Cloud Dataproc API may be overwritten.
  2669. Properties map[string]string `json:"properties,omitempty"`
  2670. // QueryFileUri: The HCFS URI of the script that contains SQL queries.
  2671. QueryFileUri string `json:"queryFileUri,omitempty"`
  2672. // QueryList: A list of queries.
  2673. QueryList *QueryList `json:"queryList,omitempty"`
  2674. // ScriptVariables: Optional. Mapping of query variable names to values
  2675. // (equivalent to the Spark SQL command: SET name="value";).
  2676. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  2677. // ForceSendFields is a list of field names (e.g. "JarFileUris") to
  2678. // unconditionally include in API requests. By default, fields with
  2679. // empty values are omitted from API requests. However, any non-pointer,
  2680. // non-interface field appearing in ForceSendFields will be sent to the
  2681. // server regardless of whether the field is empty or not. This may be
  2682. // used to include empty fields in Patch requests.
  2683. ForceSendFields []string `json:"-"`
  2684. // NullFields is a list of field names (e.g. "JarFileUris") to include
  2685. // in API requests with the JSON null value. By default, fields with
  2686. // empty values are omitted from API requests. However, any field with
  2687. // an empty value appearing in NullFields will be sent to the server as
  2688. // null. It is an error if a field in this list has a non-empty value.
  2689. // This may be used to include null fields in Patch requests.
  2690. NullFields []string `json:"-"`
  2691. }
  2692. func (s *SparkSqlJob) MarshalJSON() ([]byte, error) {
  2693. type NoMethod SparkSqlJob
  2694. raw := NoMethod(*s)
  2695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2696. }
  2697. // Status: The Status type defines a logical error model that is
  2698. // suitable for different programming environments, including REST APIs
  2699. // and RPC APIs. It is used by gRPC (https://github.com/grpc). The error
  2700. // model is designed to be:
  2701. // Simple to use and understand for most users
  2702. // Flexible enough to meet unexpected needsOverviewThe Status message
  2703. // contains three pieces of data: error code, error message, and error
  2704. // details. The error code should be an enum value of google.rpc.Code,
  2705. // but it may accept additional error codes if needed. The error message
  2706. // should be a developer-facing English message that helps developers
  2707. // understand and resolve the error. If a localized user-facing error
  2708. // message is needed, put the localized message in the error details or
  2709. // localize it in the client. The optional error details may contain
  2710. // arbitrary information about the error. There is a predefined set of
  2711. // error detail types in the package google.rpc that can be used for
  2712. // common error conditions.Language mappingThe Status message is the
  2713. // logical representation of the error model, but it is not necessarily
  2714. // the actual wire format. When the Status message is exposed in
  2715. // different client libraries and different wire protocols, it can be
  2716. // mapped differently. For example, it will likely be mapped to some
  2717. // exceptions in Java, but more likely mapped to some error codes in
  2718. // C.Other usesThe error model and the Status message can be used in a
  2719. // variety of environments, either with or without APIs, to provide a
  2720. // consistent developer experience across different environments.Example
  2721. // uses of this error model include:
  2722. // Partial errors. If a service needs to return partial errors to the
  2723. // client, it may embed the Status in the normal response to indicate
  2724. // the partial errors.
  2725. // Workflow errors. A typical workflow has multiple steps. Each step may
  2726. // have a Status message for error reporting.
  2727. // Batch operations. If a client uses batch request and batch response,
  2728. // the Status message should be used directly inside batch response, one
  2729. // for each error sub-response.
  2730. // Asynchronous operations. If an API call embeds asynchronous operation
  2731. // results in its response, the status of those operations should be
  2732. // represented directly using the Status message.
  2733. // Logging. If some API errors are stored in logs, the message Status
  2734. // could be used directly after any stripping needed for
  2735. // security/privacy reasons.
  2736. type Status struct {
  2737. // Code: The status code, which should be an enum value of
  2738. // google.rpc.Code.
  2739. Code int64 `json:"code,omitempty"`
  2740. // Details: A list of messages that carry the error details. There is a
  2741. // common set of message types for APIs to use.
  2742. Details []googleapi.RawMessage `json:"details,omitempty"`
  2743. // Message: A developer-facing error message, which should be in
  2744. // English. Any user-facing error message should be localized and sent
  2745. // in the google.rpc.Status.details field, or localized by the client.
  2746. Message string `json:"message,omitempty"`
  2747. // ForceSendFields is a list of field names (e.g. "Code") to
  2748. // unconditionally include in API requests. By default, fields with
  2749. // empty values are omitted from API requests. However, any non-pointer,
  2750. // non-interface field appearing in ForceSendFields will be sent to the
  2751. // server regardless of whether the field is empty or not. This may be
  2752. // used to include empty fields in Patch requests.
  2753. ForceSendFields []string `json:"-"`
  2754. // NullFields is a list of field names (e.g. "Code") to include in API
  2755. // requests with the JSON null value. By default, fields with empty
  2756. // values are omitted from API requests. However, any field with an
  2757. // empty value appearing in NullFields will be sent to the server as
  2758. // null. It is an error if a field in this list has a non-empty value.
  2759. // This may be used to include null fields in Patch requests.
  2760. NullFields []string `json:"-"`
  2761. }
  2762. func (s *Status) MarshalJSON() ([]byte, error) {
  2763. type NoMethod Status
  2764. raw := NoMethod(*s)
  2765. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2766. }
  2767. // SubmitJobRequest: A request to submit a job.
  2768. type SubmitJobRequest struct {
  2769. // Job: Required. The job resource.
  2770. Job *Job `json:"job,omitempty"`
  2771. // RequestId: Optional. A unique id used to identify the request. If the
  2772. // server receives two SubmitJobRequest requests with the same id, then
  2773. // the second request will be ignored and the first Job created and
  2774. // stored in the backend is returned.It is recommended to always set
  2775. // this value to a UUID
  2776. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id
  2777. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  2778. // and hyphens (-). The maximum length is 40 characters.
  2779. RequestId string `json:"requestId,omitempty"`
  2780. // ForceSendFields is a list of field names (e.g. "Job") to
  2781. // unconditionally include in API requests. By default, fields with
  2782. // empty values are omitted from API requests. However, any non-pointer,
  2783. // non-interface field appearing in ForceSendFields will be sent to the
  2784. // server regardless of whether the field is empty or not. This may be
  2785. // used to include empty fields in Patch requests.
  2786. ForceSendFields []string `json:"-"`
  2787. // NullFields is a list of field names (e.g. "Job") to include in API
  2788. // requests with the JSON null value. By default, fields with empty
  2789. // values are omitted from API requests. However, any field with an
  2790. // empty value appearing in NullFields will be sent to the server as
  2791. // null. It is an error if a field in this list has a non-empty value.
  2792. // This may be used to include null fields in Patch requests.
  2793. NullFields []string `json:"-"`
  2794. }
  2795. func (s *SubmitJobRequest) MarshalJSON() ([]byte, error) {
  2796. type NoMethod SubmitJobRequest
  2797. raw := NoMethod(*s)
  2798. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2799. }
  2800. // TemplateParameter: A configurable parameter that replaces one or more
  2801. // fields in the template. Parameterizable fields: - Labels - File uris
  2802. // - Job properties - Job arguments - Script variables - Main class (in
  2803. // HadoopJob and SparkJob) - Zone (in ClusterSelector)
  2804. type TemplateParameter struct {
  2805. // Description: Optional. Brief description of the parameter. Must not
  2806. // exceed 1024 characters.
  2807. Description string `json:"description,omitempty"`
  2808. // Fields: Required. Paths to all fields that the parameter replaces. A
  2809. // field is allowed to appear in at most one parameter's list of field
  2810. // paths.A field path is similar in syntax to a
  2811. // google.protobuf.FieldMask. For example, a field path that references
  2812. // the zone field of a workflow template's cluster selector would be
  2813. // specified as placement.clusterSelector.zone.Also, field paths can
  2814. // reference fields using the following syntax:
  2815. // Values in maps can be referenced by
  2816. // key:
  2817. // labels'key'
  2818. // placement.clusterSelector.clusterLabels'key'
  2819. // placemen
  2820. // t.managedCluster.labels'key'
  2821. // placement.clusterSelector.clusterLabels'k
  2822. // ey'
  2823. // jobs'step-id'.labels'key'
  2824. // Jobs in the jobs list can be referenced by
  2825. // step-id:
  2826. // jobs'step-id'.hadoopJob.mainJarFileUri
  2827. // jobs'step-id'.hiveJob.
  2828. // queryFileUri
  2829. // jobs'step-id'.pySparkJob.mainPythonFileUri
  2830. // jobs'step-id'.
  2831. // hadoopJob.jarFileUris0
  2832. // jobs'step-id'.hadoopJob.archiveUris0
  2833. // jobs'step-
  2834. // id'.hadoopJob.fileUris0
  2835. // jobs'step-id'.pySparkJob.pythonFileUris0
  2836. // Items
  2837. // in repeated fields can be referenced by a zero-based
  2838. // index:
  2839. // jobs'step-id'.sparkJob.args0
  2840. // Other
  2841. // examples:
  2842. // jobs'step-id'.hadoopJob.properties'key'
  2843. // jobs'step-id'.hadoop
  2844. // Job.args0
  2845. // jobs'step-id'.hiveJob.scriptVariables'key'
  2846. // jobs'step-id'.had
  2847. // oopJob.mainJarFileUri
  2848. // placement.clusterSelector.zoneIt may not be possible to parameterize
  2849. // maps and repeated fields in their entirety since only individual map
  2850. // values and individual items in repeated fields can be referenced. For
  2851. // example, the following field paths are
  2852. // invalid:
  2853. // placement.clusterSelector.clusterLabels
  2854. // jobs'step-id'.sparkJo
  2855. // b.args
  2856. Fields []string `json:"fields,omitempty"`
  2857. // Name: Required. Parameter name. The parameter name is used as the
  2858. // key, and paired with the parameter value, which are passed to the
  2859. // template when the template is instantiated. The name must contain
  2860. // only capital letters (A-Z), numbers (0-9), and underscores (_), and
  2861. // must not start with a number. The maximum length is 40 characters.
  2862. Name string `json:"name,omitempty"`
  2863. // Validation: Optional. Validation rules to be applied to this
  2864. // parameter's value.
  2865. Validation *ParameterValidation `json:"validation,omitempty"`
  2866. // ForceSendFields is a list of field names (e.g. "Description") to
  2867. // unconditionally include in API requests. By default, fields with
  2868. // empty values are omitted from API requests. However, any non-pointer,
  2869. // non-interface field appearing in ForceSendFields will be sent to the
  2870. // server regardless of whether the field is empty or not. This may be
  2871. // used to include empty fields in Patch requests.
  2872. ForceSendFields []string `json:"-"`
  2873. // NullFields is a list of field names (e.g. "Description") to include
  2874. // in API requests with the JSON null value. By default, fields with
  2875. // empty values are omitted from API requests. However, any field with
  2876. // an empty value appearing in NullFields will be sent to the server as
  2877. // null. It is an error if a field in this list has a non-empty value.
  2878. // This may be used to include null fields in Patch requests.
  2879. NullFields []string `json:"-"`
  2880. }
  2881. func (s *TemplateParameter) MarshalJSON() ([]byte, error) {
  2882. type NoMethod TemplateParameter
  2883. raw := NoMethod(*s)
  2884. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2885. }
  2886. // TestIamPermissionsRequest: Request message for TestIamPermissions
  2887. // method.
  2888. type TestIamPermissionsRequest struct {
  2889. // Permissions: The set of permissions to check for the resource.
  2890. // Permissions with wildcards (such as '*' or 'storage.*') are not
  2891. // allowed. For more information see IAM Overview
  2892. // (https://cloud.google.com/iam/docs/overview#permissions).
  2893. Permissions []string `json:"permissions,omitempty"`
  2894. // ForceSendFields is a list of field names (e.g. "Permissions") to
  2895. // unconditionally include in API requests. By default, fields with
  2896. // empty values are omitted from API requests. However, any non-pointer,
  2897. // non-interface field appearing in ForceSendFields will be sent to the
  2898. // server regardless of whether the field is empty or not. This may be
  2899. // used to include empty fields in Patch requests.
  2900. ForceSendFields []string `json:"-"`
  2901. // NullFields is a list of field names (e.g. "Permissions") to include
  2902. // in API requests with the JSON null value. By default, fields with
  2903. // empty values are omitted from API requests. However, any field with
  2904. // an empty value appearing in NullFields will be sent to the server as
  2905. // null. It is an error if a field in this list has a non-empty value.
  2906. // This may be used to include null fields in Patch requests.
  2907. NullFields []string `json:"-"`
  2908. }
  2909. func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  2910. type NoMethod TestIamPermissionsRequest
  2911. raw := NoMethod(*s)
  2912. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2913. }
  2914. // TestIamPermissionsResponse: Response message for TestIamPermissions
  2915. // method.
  2916. type TestIamPermissionsResponse struct {
  2917. // Permissions: A subset of TestPermissionsRequest.permissions that the
  2918. // caller is allowed.
  2919. Permissions []string `json:"permissions,omitempty"`
  2920. // ServerResponse contains the HTTP response code and headers from the
  2921. // server.
  2922. googleapi.ServerResponse `json:"-"`
  2923. // ForceSendFields is a list of field names (e.g. "Permissions") to
  2924. // unconditionally include in API requests. By default, fields with
  2925. // empty values are omitted from API requests. However, any non-pointer,
  2926. // non-interface field appearing in ForceSendFields will be sent to the
  2927. // server regardless of whether the field is empty or not. This may be
  2928. // used to include empty fields in Patch requests.
  2929. ForceSendFields []string `json:"-"`
  2930. // NullFields is a list of field names (e.g. "Permissions") to include
  2931. // in API requests with the JSON null value. By default, fields with
  2932. // empty values are omitted from API requests. However, any field with
  2933. // an empty value appearing in NullFields will be sent to the server as
  2934. // null. It is an error if a field in this list has a non-empty value.
  2935. // This may be used to include null fields in Patch requests.
  2936. NullFields []string `json:"-"`
  2937. }
  2938. func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  2939. type NoMethod TestIamPermissionsResponse
  2940. raw := NoMethod(*s)
  2941. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2942. }
  2943. // ValueValidation: Validation based on a list of allowed values.
  2944. type ValueValidation struct {
  2945. // Values: Required. List of allowed values for the parameter.
  2946. Values []string `json:"values,omitempty"`
  2947. // ForceSendFields is a list of field names (e.g. "Values") to
  2948. // unconditionally include in API requests. By default, fields with
  2949. // empty values are omitted from API requests. However, any non-pointer,
  2950. // non-interface field appearing in ForceSendFields will be sent to the
  2951. // server regardless of whether the field is empty or not. This may be
  2952. // used to include empty fields in Patch requests.
  2953. ForceSendFields []string `json:"-"`
  2954. // NullFields is a list of field names (e.g. "Values") to include in API
  2955. // requests with the JSON null value. By default, fields with empty
  2956. // values are omitted from API requests. However, any field with an
  2957. // empty value appearing in NullFields will be sent to the server as
  2958. // null. It is an error if a field in this list has a non-empty value.
  2959. // This may be used to include null fields in Patch requests.
  2960. NullFields []string `json:"-"`
  2961. }
  2962. func (s *ValueValidation) MarshalJSON() ([]byte, error) {
  2963. type NoMethod ValueValidation
  2964. raw := NoMethod(*s)
  2965. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2966. }
  2967. // WorkflowGraph: The workflow graph.
  2968. type WorkflowGraph struct {
  2969. // Nodes: Output only. The workflow nodes.
  2970. Nodes []*WorkflowNode `json:"nodes,omitempty"`
  2971. // ForceSendFields is a list of field names (e.g. "Nodes") to
  2972. // unconditionally include in API requests. By default, fields with
  2973. // empty values are omitted from API requests. However, any non-pointer,
  2974. // non-interface field appearing in ForceSendFields will be sent to the
  2975. // server regardless of whether the field is empty or not. This may be
  2976. // used to include empty fields in Patch requests.
  2977. ForceSendFields []string `json:"-"`
  2978. // NullFields is a list of field names (e.g. "Nodes") to include in API
  2979. // requests with the JSON null value. By default, fields with empty
  2980. // values are omitted from API requests. However, any field with an
  2981. // empty value appearing in NullFields will be sent to the server as
  2982. // null. It is an error if a field in this list has a non-empty value.
  2983. // This may be used to include null fields in Patch requests.
  2984. NullFields []string `json:"-"`
  2985. }
  2986. func (s *WorkflowGraph) MarshalJSON() ([]byte, error) {
  2987. type NoMethod WorkflowGraph
  2988. raw := NoMethod(*s)
  2989. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2990. }
  2991. // WorkflowMetadata: A Cloud Dataproc workflow template resource.
  2992. type WorkflowMetadata struct {
  2993. // ClusterName: Output only. The name of the target cluster.
  2994. ClusterName string `json:"clusterName,omitempty"`
  2995. // ClusterUuid: Output only. The UUID of target cluster.
  2996. ClusterUuid string `json:"clusterUuid,omitempty"`
  2997. // CreateCluster: Output only. The create cluster operation metadata.
  2998. CreateCluster *ClusterOperation `json:"createCluster,omitempty"`
  2999. // DeleteCluster: Output only. The delete cluster operation metadata.
  3000. DeleteCluster *ClusterOperation `json:"deleteCluster,omitempty"`
  3001. // EndTime: Output only. Workflow end time.
  3002. EndTime string `json:"endTime,omitempty"`
  3003. // Graph: Output only. The workflow graph.
  3004. Graph *WorkflowGraph `json:"graph,omitempty"`
  3005. // Parameters: Map from parameter names to values that were used for
  3006. // those parameters.
  3007. Parameters map[string]string `json:"parameters,omitempty"`
  3008. // StartTime: Output only. Workflow start time.
  3009. StartTime string `json:"startTime,omitempty"`
  3010. // State: Output only. The workflow state.
  3011. //
  3012. // Possible values:
  3013. // "UNKNOWN" - Unused.
  3014. // "PENDING" - The operation has been created.
  3015. // "RUNNING" - The operation is running.
  3016. // "DONE" - The operation is done; either cancelled or completed.
  3017. State string `json:"state,omitempty"`
  3018. // Template: Output only. The "resource name" of the template.
  3019. Template string `json:"template,omitempty"`
  3020. // Version: Output only. The version of template at the time of workflow
  3021. // instantiation.
  3022. Version int64 `json:"version,omitempty"`
  3023. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  3024. // unconditionally include in API requests. By default, fields with
  3025. // empty values are omitted from API requests. However, any non-pointer,
  3026. // non-interface field appearing in ForceSendFields will be sent to the
  3027. // server regardless of whether the field is empty or not. This may be
  3028. // used to include empty fields in Patch requests.
  3029. ForceSendFields []string `json:"-"`
  3030. // NullFields is a list of field names (e.g. "ClusterName") to include
  3031. // in API requests with the JSON null value. By default, fields with
  3032. // empty values are omitted from API requests. However, any field with
  3033. // an empty value appearing in NullFields will be sent to the server as
  3034. // null. It is an error if a field in this list has a non-empty value.
  3035. // This may be used to include null fields in Patch requests.
  3036. NullFields []string `json:"-"`
  3037. }
  3038. func (s *WorkflowMetadata) MarshalJSON() ([]byte, error) {
  3039. type NoMethod WorkflowMetadata
  3040. raw := NoMethod(*s)
  3041. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3042. }
  3043. // WorkflowNode: The workflow node.
  3044. type WorkflowNode struct {
  3045. // Error: Output only. The error detail.
  3046. Error string `json:"error,omitempty"`
  3047. // JobId: Output only. The job id; populated after the node enters
  3048. // RUNNING state.
  3049. JobId string `json:"jobId,omitempty"`
  3050. // PrerequisiteStepIds: Output only. Node's prerequisite nodes.
  3051. PrerequisiteStepIds []string `json:"prerequisiteStepIds,omitempty"`
  3052. // State: Output only. The node state.
  3053. //
  3054. // Possible values:
  3055. // "NODE_STATUS_UNSPECIFIED" - State is unspecified.
  3056. // "BLOCKED" - The node is awaiting prerequisite node to finish.
  3057. // "RUNNABLE" - The node is runnable but not running.
  3058. // "RUNNING" - The node is running.
  3059. // "COMPLETED" - The node completed successfully.
  3060. // "FAILED" - The node failed. A node can be marked FAILED because its
  3061. // ancestor or peer failed.
  3062. State string `json:"state,omitempty"`
  3063. // StepId: Output only. The name of the node.
  3064. StepId string `json:"stepId,omitempty"`
  3065. // ForceSendFields is a list of field names (e.g. "Error") to
  3066. // unconditionally include in API requests. By default, fields with
  3067. // empty values are omitted from API requests. However, any non-pointer,
  3068. // non-interface field appearing in ForceSendFields will be sent to the
  3069. // server regardless of whether the field is empty or not. This may be
  3070. // used to include empty fields in Patch requests.
  3071. ForceSendFields []string `json:"-"`
  3072. // NullFields is a list of field names (e.g. "Error") to include in API
  3073. // requests with the JSON null value. By default, fields with empty
  3074. // values are omitted from API requests. However, any field with an
  3075. // empty value appearing in NullFields will be sent to the server as
  3076. // null. It is an error if a field in this list has a non-empty value.
  3077. // This may be used to include null fields in Patch requests.
  3078. NullFields []string `json:"-"`
  3079. }
  3080. func (s *WorkflowNode) MarshalJSON() ([]byte, error) {
  3081. type NoMethod WorkflowNode
  3082. raw := NoMethod(*s)
  3083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3084. }
  3085. // WorkflowTemplate: A Cloud Dataproc workflow template resource.
  3086. type WorkflowTemplate struct {
  3087. // CreateTime: Output only. The time template was created.
  3088. CreateTime string `json:"createTime,omitempty"`
  3089. // Id: Required. The template id.The id must contain only letters (a-z,
  3090. // A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin
  3091. // or end with underscore or hyphen. Must consist of between 3 and 50
  3092. // characters..
  3093. Id string `json:"id,omitempty"`
  3094. // Jobs: Required. The Directed Acyclic Graph of Jobs to submit.
  3095. Jobs []*OrderedJob `json:"jobs,omitempty"`
  3096. // Labels: Optional. The labels to associate with this template. These
  3097. // labels will be propagated to all jobs and clusters created by the
  3098. // workflow instance.Label keys must contain 1 to 63 characters, and
  3099. // must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).Label
  3100. // values may be empty, but, if present, must contain 1 to 63
  3101. // characters, and must conform to RFC 1035
  3102. // (https://www.ietf.org/rfc/rfc1035.txt).No more than 32 labels can be
  3103. // associated with a template.
  3104. Labels map[string]string `json:"labels,omitempty"`
  3105. // Name: Output only. The "resource name" of the template, as described
  3106. // in https://cloud.google.com/apis/design/resource_names of the form
  3107. // projects/{project_id}/regions/{region}/workflowTemplates/{template_id}
  3108. Name string `json:"name,omitempty"`
  3109. // Parameters: Optional. Template parameters whose values are
  3110. // substituted into the template. Values for parameters must be provided
  3111. // when the template is instantiated.
  3112. Parameters []*TemplateParameter `json:"parameters,omitempty"`
  3113. // Placement: Required. WorkflowTemplate scheduling information.
  3114. Placement *WorkflowTemplatePlacement `json:"placement,omitempty"`
  3115. // UpdateTime: Output only. The time template was last updated.
  3116. UpdateTime string `json:"updateTime,omitempty"`
  3117. // Version: Optional. Used to perform a consistent
  3118. // read-modify-write.This field should be left blank for a
  3119. // CreateWorkflowTemplate request. It is required for an
  3120. // UpdateWorkflowTemplate request, and must match the current server
  3121. // version. A typical update template flow would fetch the current
  3122. // template with a GetWorkflowTemplate request, which will return the
  3123. // current template with the version field filled in with the current
  3124. // server version. The user updates other fields in the template, then
  3125. // returns it as part of the UpdateWorkflowTemplate request.
  3126. Version int64 `json:"version,omitempty"`
  3127. // ServerResponse contains the HTTP response code and headers from the
  3128. // server.
  3129. googleapi.ServerResponse `json:"-"`
  3130. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  3131. // unconditionally include in API requests. By default, fields with
  3132. // empty values are omitted from API requests. However, any non-pointer,
  3133. // non-interface field appearing in ForceSendFields will be sent to the
  3134. // server regardless of whether the field is empty or not. This may be
  3135. // used to include empty fields in Patch requests.
  3136. ForceSendFields []string `json:"-"`
  3137. // NullFields is a list of field names (e.g. "CreateTime") to include in
  3138. // API requests with the JSON null value. By default, fields with empty
  3139. // values are omitted from API requests. However, any field with an
  3140. // empty value appearing in NullFields will be sent to the server as
  3141. // null. It is an error if a field in this list has a non-empty value.
  3142. // This may be used to include null fields in Patch requests.
  3143. NullFields []string `json:"-"`
  3144. }
  3145. func (s *WorkflowTemplate) MarshalJSON() ([]byte, error) {
  3146. type NoMethod WorkflowTemplate
  3147. raw := NoMethod(*s)
  3148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3149. }
  3150. // WorkflowTemplatePlacement: Specifies workflow execution target.Either
  3151. // managed_cluster or cluster_selector is required.
  3152. type WorkflowTemplatePlacement struct {
  3153. // ClusterSelector: Optional. A selector that chooses target cluster for
  3154. // jobs based on metadata.The selector is evaluated at the time each job
  3155. // is submitted.
  3156. ClusterSelector *ClusterSelector `json:"clusterSelector,omitempty"`
  3157. // ManagedCluster: Optional. A cluster that is managed by the workflow.
  3158. ManagedCluster *ManagedCluster `json:"managedCluster,omitempty"`
  3159. // ForceSendFields is a list of field names (e.g. "ClusterSelector") to
  3160. // unconditionally include in API requests. By default, fields with
  3161. // empty values are omitted from API requests. However, any non-pointer,
  3162. // non-interface field appearing in ForceSendFields will be sent to the
  3163. // server regardless of whether the field is empty or not. This may be
  3164. // used to include empty fields in Patch requests.
  3165. ForceSendFields []string `json:"-"`
  3166. // NullFields is a list of field names (e.g. "ClusterSelector") to
  3167. // include in API requests with the JSON null value. By default, fields
  3168. // with empty values are omitted from API requests. However, any field
  3169. // with an empty value appearing in NullFields will be sent to the
  3170. // server as null. It is an error if a field in this list has a
  3171. // non-empty value. This may be used to include null fields in Patch
  3172. // requests.
  3173. NullFields []string `json:"-"`
  3174. }
  3175. func (s *WorkflowTemplatePlacement) MarshalJSON() ([]byte, error) {
  3176. type NoMethod WorkflowTemplatePlacement
  3177. raw := NoMethod(*s)
  3178. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3179. }
  3180. // YarnApplication: A YARN application created by a job. Application
  3181. // information is a subset of
  3182. // <code>org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto</
  3183. // code>.Beta Feature: This report is available for testing purposes
  3184. // only. It may be changed before final release.
  3185. type YarnApplication struct {
  3186. // Name: Required. The application name.
  3187. Name string `json:"name,omitempty"`
  3188. // Progress: Required. The numerical progress of the application, from 1
  3189. // to 100.
  3190. Progress float64 `json:"progress,omitempty"`
  3191. // State: Required. The application state.
  3192. //
  3193. // Possible values:
  3194. // "STATE_UNSPECIFIED" - Status is unspecified.
  3195. // "NEW" - Status is NEW.
  3196. // "NEW_SAVING" - Status is NEW_SAVING.
  3197. // "SUBMITTED" - Status is SUBMITTED.
  3198. // "ACCEPTED" - Status is ACCEPTED.
  3199. // "RUNNING" - Status is RUNNING.
  3200. // "FINISHED" - Status is FINISHED.
  3201. // "FAILED" - Status is FAILED.
  3202. // "KILLED" - Status is KILLED.
  3203. State string `json:"state,omitempty"`
  3204. // TrackingUrl: Optional. The HTTP URL of the ApplicationMaster,
  3205. // HistoryServer, or TimelineServer that provides application-specific
  3206. // information. The URL uses the internal hostname, and requires a proxy
  3207. // server for resolution and, possibly, access.
  3208. TrackingUrl string `json:"trackingUrl,omitempty"`
  3209. // ForceSendFields is a list of field names (e.g. "Name") to
  3210. // unconditionally include in API requests. By default, fields with
  3211. // empty values are omitted from API requests. However, any non-pointer,
  3212. // non-interface field appearing in ForceSendFields will be sent to the
  3213. // server regardless of whether the field is empty or not. This may be
  3214. // used to include empty fields in Patch requests.
  3215. ForceSendFields []string `json:"-"`
  3216. // NullFields is a list of field names (e.g. "Name") to include in API
  3217. // requests with the JSON null value. By default, fields with empty
  3218. // values are omitted from API requests. However, any field with an
  3219. // empty value appearing in NullFields will be sent to the server as
  3220. // null. It is an error if a field in this list has a non-empty value.
  3221. // This may be used to include null fields in Patch requests.
  3222. NullFields []string `json:"-"`
  3223. }
  3224. func (s *YarnApplication) MarshalJSON() ([]byte, error) {
  3225. type NoMethod YarnApplication
  3226. raw := NoMethod(*s)
  3227. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  3228. }
  3229. func (s *YarnApplication) UnmarshalJSON(data []byte) error {
  3230. type NoMethod YarnApplication
  3231. var s1 struct {
  3232. Progress gensupport.JSONFloat64 `json:"progress"`
  3233. *NoMethod
  3234. }
  3235. s1.NoMethod = (*NoMethod)(s)
  3236. if err := json.Unmarshal(data, &s1); err != nil {
  3237. return err
  3238. }
  3239. s.Progress = float64(s1.Progress)
  3240. return nil
  3241. }
  3242. // method id "dataproc.projects.locations.autoscalingPolicies.create":
  3243. type ProjectsLocationsAutoscalingPoliciesCreateCall struct {
  3244. s *Service
  3245. parent string
  3246. autoscalingpolicy *AutoscalingPolicy
  3247. urlParams_ gensupport.URLParams
  3248. ctx_ context.Context
  3249. header_ http.Header
  3250. }
  3251. // Create: Creates new autoscaling policy.
  3252. func (r *ProjectsLocationsAutoscalingPoliciesService) Create(parent string, autoscalingpolicy *AutoscalingPolicy) *ProjectsLocationsAutoscalingPoliciesCreateCall {
  3253. c := &ProjectsLocationsAutoscalingPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3254. c.parent = parent
  3255. c.autoscalingpolicy = autoscalingpolicy
  3256. return c
  3257. }
  3258. // Fields allows partial responses to be retrieved. See
  3259. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3260. // for more information.
  3261. func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesCreateCall {
  3262. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3263. return c
  3264. }
  3265. // Context sets the context to be used in this call's Do method. Any
  3266. // pending HTTP request will be aborted if the provided context is
  3267. // canceled.
  3268. func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesCreateCall {
  3269. c.ctx_ = ctx
  3270. return c
  3271. }
  3272. // Header returns an http.Header that can be modified by the caller to
  3273. // add HTTP headers to the request.
  3274. func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Header() http.Header {
  3275. if c.header_ == nil {
  3276. c.header_ = make(http.Header)
  3277. }
  3278. return c.header_
  3279. }
  3280. func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) doRequest(alt string) (*http.Response, error) {
  3281. reqHeaders := make(http.Header)
  3282. for k, v := range c.header_ {
  3283. reqHeaders[k] = v
  3284. }
  3285. reqHeaders.Set("User-Agent", c.s.userAgent())
  3286. var body io.Reader = nil
  3287. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy)
  3288. if err != nil {
  3289. return nil, err
  3290. }
  3291. reqHeaders.Set("Content-Type", "application/json")
  3292. c.urlParams_.Set("alt", alt)
  3293. c.urlParams_.Set("prettyPrint", "false")
  3294. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/autoscalingPolicies")
  3295. urls += "?" + c.urlParams_.Encode()
  3296. req, err := http.NewRequest("POST", urls, body)
  3297. if err != nil {
  3298. return nil, err
  3299. }
  3300. req.Header = reqHeaders
  3301. googleapi.Expand(req.URL, map[string]string{
  3302. "parent": c.parent,
  3303. })
  3304. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3305. }
  3306. // Do executes the "dataproc.projects.locations.autoscalingPolicies.create" call.
  3307. // Exactly one of *AutoscalingPolicy or error will be non-nil. Any
  3308. // non-2xx status code is an error. Response headers are in either
  3309. // *AutoscalingPolicy.ServerResponse.Header or (if a response was
  3310. // returned at all) in error.(*googleapi.Error).Header. Use
  3311. // googleapi.IsNotModified to check whether the returned error was
  3312. // because http.StatusNotModified was returned.
  3313. func (c *ProjectsLocationsAutoscalingPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) {
  3314. gensupport.SetOptions(c.urlParams_, opts...)
  3315. res, err := c.doRequest("json")
  3316. if res != nil && res.StatusCode == http.StatusNotModified {
  3317. if res.Body != nil {
  3318. res.Body.Close()
  3319. }
  3320. return nil, &googleapi.Error{
  3321. Code: res.StatusCode,
  3322. Header: res.Header,
  3323. }
  3324. }
  3325. if err != nil {
  3326. return nil, err
  3327. }
  3328. defer googleapi.CloseBody(res)
  3329. if err := googleapi.CheckResponse(res); err != nil {
  3330. return nil, err
  3331. }
  3332. ret := &AutoscalingPolicy{
  3333. ServerResponse: googleapi.ServerResponse{
  3334. Header: res.Header,
  3335. HTTPStatusCode: res.StatusCode,
  3336. },
  3337. }
  3338. target := &ret
  3339. if err := gensupport.DecodeResponse(target, res); err != nil {
  3340. return nil, err
  3341. }
  3342. return ret, nil
  3343. // {
  3344. // "description": "Creates new autoscaling policy.",
  3345. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies",
  3346. // "httpMethod": "POST",
  3347. // "id": "dataproc.projects.locations.autoscalingPolicies.create",
  3348. // "parameterOrder": [
  3349. // "parent"
  3350. // ],
  3351. // "parameters": {
  3352. // "parent": {
  3353. // "description": "Required. The \"resource name\" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}.",
  3354. // "location": "path",
  3355. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  3356. // "required": true,
  3357. // "type": "string"
  3358. // }
  3359. // },
  3360. // "path": "v1beta2/{+parent}/autoscalingPolicies",
  3361. // "request": {
  3362. // "$ref": "AutoscalingPolicy"
  3363. // },
  3364. // "response": {
  3365. // "$ref": "AutoscalingPolicy"
  3366. // },
  3367. // "scopes": [
  3368. // "https://www.googleapis.com/auth/cloud-platform"
  3369. // ]
  3370. // }
  3371. }
  3372. // method id "dataproc.projects.locations.autoscalingPolicies.delete":
  3373. type ProjectsLocationsAutoscalingPoliciesDeleteCall struct {
  3374. s *Service
  3375. name string
  3376. urlParams_ gensupport.URLParams
  3377. ctx_ context.Context
  3378. header_ http.Header
  3379. }
  3380. // Delete: Deletes an autoscaling policy. It is an error to delete an
  3381. // autoscaling policy that is in use by one or more clusters.
  3382. func (r *ProjectsLocationsAutoscalingPoliciesService) Delete(name string) *ProjectsLocationsAutoscalingPoliciesDeleteCall {
  3383. c := &ProjectsLocationsAutoscalingPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3384. c.name = name
  3385. return c
  3386. }
  3387. // Fields allows partial responses to be retrieved. See
  3388. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3389. // for more information.
  3390. func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesDeleteCall {
  3391. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3392. return c
  3393. }
  3394. // Context sets the context to be used in this call's Do method. Any
  3395. // pending HTTP request will be aborted if the provided context is
  3396. // canceled.
  3397. func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesDeleteCall {
  3398. c.ctx_ = ctx
  3399. return c
  3400. }
  3401. // Header returns an http.Header that can be modified by the caller to
  3402. // add HTTP headers to the request.
  3403. func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Header() http.Header {
  3404. if c.header_ == nil {
  3405. c.header_ = make(http.Header)
  3406. }
  3407. return c.header_
  3408. }
  3409. func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  3410. reqHeaders := make(http.Header)
  3411. for k, v := range c.header_ {
  3412. reqHeaders[k] = v
  3413. }
  3414. reqHeaders.Set("User-Agent", c.s.userAgent())
  3415. var body io.Reader = nil
  3416. c.urlParams_.Set("alt", alt)
  3417. c.urlParams_.Set("prettyPrint", "false")
  3418. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  3419. urls += "?" + c.urlParams_.Encode()
  3420. req, err := http.NewRequest("DELETE", urls, body)
  3421. if err != nil {
  3422. return nil, err
  3423. }
  3424. req.Header = reqHeaders
  3425. googleapi.Expand(req.URL, map[string]string{
  3426. "name": c.name,
  3427. })
  3428. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3429. }
  3430. // Do executes the "dataproc.projects.locations.autoscalingPolicies.delete" call.
  3431. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  3432. // code is an error. Response headers are in either
  3433. // *Empty.ServerResponse.Header or (if a response was returned at all)
  3434. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3435. // check whether the returned error was because http.StatusNotModified
  3436. // was returned.
  3437. func (c *ProjectsLocationsAutoscalingPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3438. gensupport.SetOptions(c.urlParams_, opts...)
  3439. res, err := c.doRequest("json")
  3440. if res != nil && res.StatusCode == http.StatusNotModified {
  3441. if res.Body != nil {
  3442. res.Body.Close()
  3443. }
  3444. return nil, &googleapi.Error{
  3445. Code: res.StatusCode,
  3446. Header: res.Header,
  3447. }
  3448. }
  3449. if err != nil {
  3450. return nil, err
  3451. }
  3452. defer googleapi.CloseBody(res)
  3453. if err := googleapi.CheckResponse(res); err != nil {
  3454. return nil, err
  3455. }
  3456. ret := &Empty{
  3457. ServerResponse: googleapi.ServerResponse{
  3458. Header: res.Header,
  3459. HTTPStatusCode: res.StatusCode,
  3460. },
  3461. }
  3462. target := &ret
  3463. if err := gensupport.DecodeResponse(target, res); err != nil {
  3464. return nil, err
  3465. }
  3466. return ret, nil
  3467. // {
  3468. // "description": "Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.",
  3469. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}",
  3470. // "httpMethod": "DELETE",
  3471. // "id": "dataproc.projects.locations.autoscalingPolicies.delete",
  3472. // "parameterOrder": [
  3473. // "name"
  3474. // ],
  3475. // "parameters": {
  3476. // "name": {
  3477. // "description": "Required. The \"resource name\" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}.",
  3478. // "location": "path",
  3479. // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$",
  3480. // "required": true,
  3481. // "type": "string"
  3482. // }
  3483. // },
  3484. // "path": "v1beta2/{+name}",
  3485. // "response": {
  3486. // "$ref": "Empty"
  3487. // },
  3488. // "scopes": [
  3489. // "https://www.googleapis.com/auth/cloud-platform"
  3490. // ]
  3491. // }
  3492. }
  3493. // method id "dataproc.projects.locations.autoscalingPolicies.get":
  3494. type ProjectsLocationsAutoscalingPoliciesGetCall struct {
  3495. s *Service
  3496. name string
  3497. urlParams_ gensupport.URLParams
  3498. ifNoneMatch_ string
  3499. ctx_ context.Context
  3500. header_ http.Header
  3501. }
  3502. // Get: Retrieves autoscaling policy.
  3503. func (r *ProjectsLocationsAutoscalingPoliciesService) Get(name string) *ProjectsLocationsAutoscalingPoliciesGetCall {
  3504. c := &ProjectsLocationsAutoscalingPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3505. c.name = name
  3506. return c
  3507. }
  3508. // Fields allows partial responses to be retrieved. See
  3509. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3510. // for more information.
  3511. func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesGetCall {
  3512. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3513. return c
  3514. }
  3515. // IfNoneMatch sets the optional parameter which makes the operation
  3516. // fail if the object's ETag matches the given value. This is useful for
  3517. // getting updates only after the object has changed since the last
  3518. // request. Use googleapi.IsNotModified to check whether the response
  3519. // error from Do is the result of In-None-Match.
  3520. func (c *ProjectsLocationsAutoscalingPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsAutoscalingPoliciesGetCall {
  3521. c.ifNoneMatch_ = entityTag
  3522. return c
  3523. }
  3524. // Context sets the context to be used in this call's Do method. Any
  3525. // pending HTTP request will be aborted if the provided context is
  3526. // canceled.
  3527. func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesGetCall {
  3528. c.ctx_ = ctx
  3529. return c
  3530. }
  3531. // Header returns an http.Header that can be modified by the caller to
  3532. // add HTTP headers to the request.
  3533. func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Header() http.Header {
  3534. if c.header_ == nil {
  3535. c.header_ = make(http.Header)
  3536. }
  3537. return c.header_
  3538. }
  3539. func (c *ProjectsLocationsAutoscalingPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  3540. reqHeaders := make(http.Header)
  3541. for k, v := range c.header_ {
  3542. reqHeaders[k] = v
  3543. }
  3544. reqHeaders.Set("User-Agent", c.s.userAgent())
  3545. if c.ifNoneMatch_ != "" {
  3546. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3547. }
  3548. var body io.Reader = nil
  3549. c.urlParams_.Set("alt", alt)
  3550. c.urlParams_.Set("prettyPrint", "false")
  3551. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  3552. urls += "?" + c.urlParams_.Encode()
  3553. req, err := http.NewRequest("GET", urls, body)
  3554. if err != nil {
  3555. return nil, err
  3556. }
  3557. req.Header = reqHeaders
  3558. googleapi.Expand(req.URL, map[string]string{
  3559. "name": c.name,
  3560. })
  3561. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3562. }
  3563. // Do executes the "dataproc.projects.locations.autoscalingPolicies.get" call.
  3564. // Exactly one of *AutoscalingPolicy or error will be non-nil. Any
  3565. // non-2xx status code is an error. Response headers are in either
  3566. // *AutoscalingPolicy.ServerResponse.Header or (if a response was
  3567. // returned at all) in error.(*googleapi.Error).Header. Use
  3568. // googleapi.IsNotModified to check whether the returned error was
  3569. // because http.StatusNotModified was returned.
  3570. func (c *ProjectsLocationsAutoscalingPoliciesGetCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) {
  3571. gensupport.SetOptions(c.urlParams_, opts...)
  3572. res, err := c.doRequest("json")
  3573. if res != nil && res.StatusCode == http.StatusNotModified {
  3574. if res.Body != nil {
  3575. res.Body.Close()
  3576. }
  3577. return nil, &googleapi.Error{
  3578. Code: res.StatusCode,
  3579. Header: res.Header,
  3580. }
  3581. }
  3582. if err != nil {
  3583. return nil, err
  3584. }
  3585. defer googleapi.CloseBody(res)
  3586. if err := googleapi.CheckResponse(res); err != nil {
  3587. return nil, err
  3588. }
  3589. ret := &AutoscalingPolicy{
  3590. ServerResponse: googleapi.ServerResponse{
  3591. Header: res.Header,
  3592. HTTPStatusCode: res.StatusCode,
  3593. },
  3594. }
  3595. target := &ret
  3596. if err := gensupport.DecodeResponse(target, res); err != nil {
  3597. return nil, err
  3598. }
  3599. return ret, nil
  3600. // {
  3601. // "description": "Retrieves autoscaling policy.",
  3602. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}",
  3603. // "httpMethod": "GET",
  3604. // "id": "dataproc.projects.locations.autoscalingPolicies.get",
  3605. // "parameterOrder": [
  3606. // "name"
  3607. // ],
  3608. // "parameters": {
  3609. // "name": {
  3610. // "description": "Required. The \"resource name\" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}.",
  3611. // "location": "path",
  3612. // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$",
  3613. // "required": true,
  3614. // "type": "string"
  3615. // }
  3616. // },
  3617. // "path": "v1beta2/{+name}",
  3618. // "response": {
  3619. // "$ref": "AutoscalingPolicy"
  3620. // },
  3621. // "scopes": [
  3622. // "https://www.googleapis.com/auth/cloud-platform"
  3623. // ]
  3624. // }
  3625. }
  3626. // method id "dataproc.projects.locations.autoscalingPolicies.getIamPolicy":
  3627. type ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall struct {
  3628. s *Service
  3629. resource string
  3630. urlParams_ gensupport.URLParams
  3631. ifNoneMatch_ string
  3632. ctx_ context.Context
  3633. header_ http.Header
  3634. }
  3635. // GetIamPolicy: Gets the access control policy for a resource. Returns
  3636. // an empty policy if the resource exists and does not have a policy
  3637. // set.
  3638. func (r *ProjectsLocationsAutoscalingPoliciesService) GetIamPolicy(resource string) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall {
  3639. c := &ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3640. c.resource = resource
  3641. return c
  3642. }
  3643. // Fields allows partial responses to be retrieved. See
  3644. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3645. // for more information.
  3646. func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall {
  3647. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3648. return c
  3649. }
  3650. // IfNoneMatch sets the optional parameter which makes the operation
  3651. // fail if the object's ETag matches the given value. This is useful for
  3652. // getting updates only after the object has changed since the last
  3653. // request. Use googleapi.IsNotModified to check whether the response
  3654. // error from Do is the result of In-None-Match.
  3655. func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall {
  3656. c.ifNoneMatch_ = entityTag
  3657. return c
  3658. }
  3659. // Context sets the context to be used in this call's Do method. Any
  3660. // pending HTTP request will be aborted if the provided context is
  3661. // canceled.
  3662. func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall {
  3663. c.ctx_ = ctx
  3664. return c
  3665. }
  3666. // Header returns an http.Header that can be modified by the caller to
  3667. // add HTTP headers to the request.
  3668. func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Header() http.Header {
  3669. if c.header_ == nil {
  3670. c.header_ = make(http.Header)
  3671. }
  3672. return c.header_
  3673. }
  3674. func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3675. reqHeaders := make(http.Header)
  3676. for k, v := range c.header_ {
  3677. reqHeaders[k] = v
  3678. }
  3679. reqHeaders.Set("User-Agent", c.s.userAgent())
  3680. if c.ifNoneMatch_ != "" {
  3681. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3682. }
  3683. var body io.Reader = nil
  3684. c.urlParams_.Set("alt", alt)
  3685. c.urlParams_.Set("prettyPrint", "false")
  3686. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
  3687. urls += "?" + c.urlParams_.Encode()
  3688. req, err := http.NewRequest("GET", urls, body)
  3689. if err != nil {
  3690. return nil, err
  3691. }
  3692. req.Header = reqHeaders
  3693. googleapi.Expand(req.URL, map[string]string{
  3694. "resource": c.resource,
  3695. })
  3696. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3697. }
  3698. // Do executes the "dataproc.projects.locations.autoscalingPolicies.getIamPolicy" call.
  3699. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  3700. // code is an error. Response headers are in either
  3701. // *Policy.ServerResponse.Header or (if a response was returned at all)
  3702. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3703. // check whether the returned error was because http.StatusNotModified
  3704. // was returned.
  3705. func (c *ProjectsLocationsAutoscalingPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3706. gensupport.SetOptions(c.urlParams_, opts...)
  3707. res, err := c.doRequest("json")
  3708. if res != nil && res.StatusCode == http.StatusNotModified {
  3709. if res.Body != nil {
  3710. res.Body.Close()
  3711. }
  3712. return nil, &googleapi.Error{
  3713. Code: res.StatusCode,
  3714. Header: res.Header,
  3715. }
  3716. }
  3717. if err != nil {
  3718. return nil, err
  3719. }
  3720. defer googleapi.CloseBody(res)
  3721. if err := googleapi.CheckResponse(res); err != nil {
  3722. return nil, err
  3723. }
  3724. ret := &Policy{
  3725. ServerResponse: googleapi.ServerResponse{
  3726. Header: res.Header,
  3727. HTTPStatusCode: res.StatusCode,
  3728. },
  3729. }
  3730. target := &ret
  3731. if err := gensupport.DecodeResponse(target, res); err != nil {
  3732. return nil, err
  3733. }
  3734. return ret, nil
  3735. // {
  3736. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  3737. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}:getIamPolicy",
  3738. // "httpMethod": "GET",
  3739. // "id": "dataproc.projects.locations.autoscalingPolicies.getIamPolicy",
  3740. // "parameterOrder": [
  3741. // "resource"
  3742. // ],
  3743. // "parameters": {
  3744. // "resource": {
  3745. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  3746. // "location": "path",
  3747. // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$",
  3748. // "required": true,
  3749. // "type": "string"
  3750. // }
  3751. // },
  3752. // "path": "v1beta2/{+resource}:getIamPolicy",
  3753. // "response": {
  3754. // "$ref": "Policy"
  3755. // },
  3756. // "scopes": [
  3757. // "https://www.googleapis.com/auth/cloud-platform"
  3758. // ]
  3759. // }
  3760. }
  3761. // method id "dataproc.projects.locations.autoscalingPolicies.list":
  3762. type ProjectsLocationsAutoscalingPoliciesListCall struct {
  3763. s *Service
  3764. parent string
  3765. urlParams_ gensupport.URLParams
  3766. ifNoneMatch_ string
  3767. ctx_ context.Context
  3768. header_ http.Header
  3769. }
  3770. // List: Lists autoscaling policies in the project.
  3771. func (r *ProjectsLocationsAutoscalingPoliciesService) List(parent string) *ProjectsLocationsAutoscalingPoliciesListCall {
  3772. c := &ProjectsLocationsAutoscalingPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3773. c.parent = parent
  3774. return c
  3775. }
  3776. // PageSize sets the optional parameter "pageSize": The maximum number
  3777. // of results to return in each response.
  3778. func (c *ProjectsLocationsAutoscalingPoliciesListCall) PageSize(pageSize int64) *ProjectsLocationsAutoscalingPoliciesListCall {
  3779. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3780. return c
  3781. }
  3782. // PageToken sets the optional parameter "pageToken": The page token,
  3783. // returned by a previous call, to request the next page of results.
  3784. func (c *ProjectsLocationsAutoscalingPoliciesListCall) PageToken(pageToken string) *ProjectsLocationsAutoscalingPoliciesListCall {
  3785. c.urlParams_.Set("pageToken", pageToken)
  3786. return c
  3787. }
  3788. // Fields allows partial responses to be retrieved. See
  3789. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3790. // for more information.
  3791. func (c *ProjectsLocationsAutoscalingPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesListCall {
  3792. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3793. return c
  3794. }
  3795. // IfNoneMatch sets the optional parameter which makes the operation
  3796. // fail if the object's ETag matches the given value. This is useful for
  3797. // getting updates only after the object has changed since the last
  3798. // request. Use googleapi.IsNotModified to check whether the response
  3799. // error from Do is the result of In-None-Match.
  3800. func (c *ProjectsLocationsAutoscalingPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsAutoscalingPoliciesListCall {
  3801. c.ifNoneMatch_ = entityTag
  3802. return c
  3803. }
  3804. // Context sets the context to be used in this call's Do method. Any
  3805. // pending HTTP request will be aborted if the provided context is
  3806. // canceled.
  3807. func (c *ProjectsLocationsAutoscalingPoliciesListCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesListCall {
  3808. c.ctx_ = ctx
  3809. return c
  3810. }
  3811. // Header returns an http.Header that can be modified by the caller to
  3812. // add HTTP headers to the request.
  3813. func (c *ProjectsLocationsAutoscalingPoliciesListCall) Header() http.Header {
  3814. if c.header_ == nil {
  3815. c.header_ = make(http.Header)
  3816. }
  3817. return c.header_
  3818. }
  3819. func (c *ProjectsLocationsAutoscalingPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  3820. reqHeaders := make(http.Header)
  3821. for k, v := range c.header_ {
  3822. reqHeaders[k] = v
  3823. }
  3824. reqHeaders.Set("User-Agent", c.s.userAgent())
  3825. if c.ifNoneMatch_ != "" {
  3826. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3827. }
  3828. var body io.Reader = nil
  3829. c.urlParams_.Set("alt", alt)
  3830. c.urlParams_.Set("prettyPrint", "false")
  3831. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/autoscalingPolicies")
  3832. urls += "?" + c.urlParams_.Encode()
  3833. req, err := http.NewRequest("GET", urls, body)
  3834. if err != nil {
  3835. return nil, err
  3836. }
  3837. req.Header = reqHeaders
  3838. googleapi.Expand(req.URL, map[string]string{
  3839. "parent": c.parent,
  3840. })
  3841. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3842. }
  3843. // Do executes the "dataproc.projects.locations.autoscalingPolicies.list" call.
  3844. // Exactly one of *ListAutoscalingPoliciesResponse or error will be
  3845. // non-nil. Any non-2xx status code is an error. Response headers are in
  3846. // either *ListAutoscalingPoliciesResponse.ServerResponse.Header or (if
  3847. // a response was returned at all) in error.(*googleapi.Error).Header.
  3848. // Use googleapi.IsNotModified to check whether the returned error was
  3849. // because http.StatusNotModified was returned.
  3850. func (c *ProjectsLocationsAutoscalingPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListAutoscalingPoliciesResponse, error) {
  3851. gensupport.SetOptions(c.urlParams_, opts...)
  3852. res, err := c.doRequest("json")
  3853. if res != nil && res.StatusCode == http.StatusNotModified {
  3854. if res.Body != nil {
  3855. res.Body.Close()
  3856. }
  3857. return nil, &googleapi.Error{
  3858. Code: res.StatusCode,
  3859. Header: res.Header,
  3860. }
  3861. }
  3862. if err != nil {
  3863. return nil, err
  3864. }
  3865. defer googleapi.CloseBody(res)
  3866. if err := googleapi.CheckResponse(res); err != nil {
  3867. return nil, err
  3868. }
  3869. ret := &ListAutoscalingPoliciesResponse{
  3870. ServerResponse: googleapi.ServerResponse{
  3871. Header: res.Header,
  3872. HTTPStatusCode: res.StatusCode,
  3873. },
  3874. }
  3875. target := &ret
  3876. if err := gensupport.DecodeResponse(target, res); err != nil {
  3877. return nil, err
  3878. }
  3879. return ret, nil
  3880. // {
  3881. // "description": "Lists autoscaling policies in the project.",
  3882. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies",
  3883. // "httpMethod": "GET",
  3884. // "id": "dataproc.projects.locations.autoscalingPolicies.list",
  3885. // "parameterOrder": [
  3886. // "parent"
  3887. // ],
  3888. // "parameters": {
  3889. // "pageSize": {
  3890. // "description": "Optional. The maximum number of results to return in each response.",
  3891. // "format": "int32",
  3892. // "location": "query",
  3893. // "type": "integer"
  3894. // },
  3895. // "pageToken": {
  3896. // "description": "Optional. The page token, returned by a previous call, to request the next page of results.",
  3897. // "location": "query",
  3898. // "type": "string"
  3899. // },
  3900. // "parent": {
  3901. // "description": "Required. The \"resource name\" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}",
  3902. // "location": "path",
  3903. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  3904. // "required": true,
  3905. // "type": "string"
  3906. // }
  3907. // },
  3908. // "path": "v1beta2/{+parent}/autoscalingPolicies",
  3909. // "response": {
  3910. // "$ref": "ListAutoscalingPoliciesResponse"
  3911. // },
  3912. // "scopes": [
  3913. // "https://www.googleapis.com/auth/cloud-platform"
  3914. // ]
  3915. // }
  3916. }
  3917. // Pages invokes f for each page of results.
  3918. // A non-nil error returned from f will halt the iteration.
  3919. // The provided context supersedes any context provided to the Context method.
  3920. func (c *ProjectsLocationsAutoscalingPoliciesListCall) Pages(ctx context.Context, f func(*ListAutoscalingPoliciesResponse) error) error {
  3921. c.ctx_ = ctx
  3922. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3923. for {
  3924. x, err := c.Do()
  3925. if err != nil {
  3926. return err
  3927. }
  3928. if err := f(x); err != nil {
  3929. return err
  3930. }
  3931. if x.NextPageToken == "" {
  3932. return nil
  3933. }
  3934. c.PageToken(x.NextPageToken)
  3935. }
  3936. }
  3937. // method id "dataproc.projects.locations.autoscalingPolicies.setIamPolicy":
  3938. type ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall struct {
  3939. s *Service
  3940. resource string
  3941. setiampolicyrequest *SetIamPolicyRequest
  3942. urlParams_ gensupport.URLParams
  3943. ctx_ context.Context
  3944. header_ http.Header
  3945. }
  3946. // SetIamPolicy: Sets the access control policy on the specified
  3947. // resource. Replaces any existing policy.
  3948. func (r *ProjectsLocationsAutoscalingPoliciesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall {
  3949. c := &ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3950. c.resource = resource
  3951. c.setiampolicyrequest = setiampolicyrequest
  3952. return c
  3953. }
  3954. // Fields allows partial responses to be retrieved. See
  3955. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3956. // for more information.
  3957. func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall {
  3958. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3959. return c
  3960. }
  3961. // Context sets the context to be used in this call's Do method. Any
  3962. // pending HTTP request will be aborted if the provided context is
  3963. // canceled.
  3964. func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall {
  3965. c.ctx_ = ctx
  3966. return c
  3967. }
  3968. // Header returns an http.Header that can be modified by the caller to
  3969. // add HTTP headers to the request.
  3970. func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Header() http.Header {
  3971. if c.header_ == nil {
  3972. c.header_ = make(http.Header)
  3973. }
  3974. return c.header_
  3975. }
  3976. func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3977. reqHeaders := make(http.Header)
  3978. for k, v := range c.header_ {
  3979. reqHeaders[k] = v
  3980. }
  3981. reqHeaders.Set("User-Agent", c.s.userAgent())
  3982. var body io.Reader = nil
  3983. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  3984. if err != nil {
  3985. return nil, err
  3986. }
  3987. reqHeaders.Set("Content-Type", "application/json")
  3988. c.urlParams_.Set("alt", alt)
  3989. c.urlParams_.Set("prettyPrint", "false")
  3990. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy")
  3991. urls += "?" + c.urlParams_.Encode()
  3992. req, err := http.NewRequest("POST", urls, body)
  3993. if err != nil {
  3994. return nil, err
  3995. }
  3996. req.Header = reqHeaders
  3997. googleapi.Expand(req.URL, map[string]string{
  3998. "resource": c.resource,
  3999. })
  4000. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4001. }
  4002. // Do executes the "dataproc.projects.locations.autoscalingPolicies.setIamPolicy" call.
  4003. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  4004. // code is an error. Response headers are in either
  4005. // *Policy.ServerResponse.Header or (if a response was returned at all)
  4006. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4007. // check whether the returned error was because http.StatusNotModified
  4008. // was returned.
  4009. func (c *ProjectsLocationsAutoscalingPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4010. gensupport.SetOptions(c.urlParams_, opts...)
  4011. res, err := c.doRequest("json")
  4012. if res != nil && res.StatusCode == http.StatusNotModified {
  4013. if res.Body != nil {
  4014. res.Body.Close()
  4015. }
  4016. return nil, &googleapi.Error{
  4017. Code: res.StatusCode,
  4018. Header: res.Header,
  4019. }
  4020. }
  4021. if err != nil {
  4022. return nil, err
  4023. }
  4024. defer googleapi.CloseBody(res)
  4025. if err := googleapi.CheckResponse(res); err != nil {
  4026. return nil, err
  4027. }
  4028. ret := &Policy{
  4029. ServerResponse: googleapi.ServerResponse{
  4030. Header: res.Header,
  4031. HTTPStatusCode: res.StatusCode,
  4032. },
  4033. }
  4034. target := &ret
  4035. if err := gensupport.DecodeResponse(target, res); err != nil {
  4036. return nil, err
  4037. }
  4038. return ret, nil
  4039. // {
  4040. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  4041. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}:setIamPolicy",
  4042. // "httpMethod": "POST",
  4043. // "id": "dataproc.projects.locations.autoscalingPolicies.setIamPolicy",
  4044. // "parameterOrder": [
  4045. // "resource"
  4046. // ],
  4047. // "parameters": {
  4048. // "resource": {
  4049. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  4050. // "location": "path",
  4051. // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$",
  4052. // "required": true,
  4053. // "type": "string"
  4054. // }
  4055. // },
  4056. // "path": "v1beta2/{+resource}:setIamPolicy",
  4057. // "request": {
  4058. // "$ref": "SetIamPolicyRequest"
  4059. // },
  4060. // "response": {
  4061. // "$ref": "Policy"
  4062. // },
  4063. // "scopes": [
  4064. // "https://www.googleapis.com/auth/cloud-platform"
  4065. // ]
  4066. // }
  4067. }
  4068. // method id "dataproc.projects.locations.autoscalingPolicies.testIamPermissions":
  4069. type ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall struct {
  4070. s *Service
  4071. resource string
  4072. testiampermissionsrequest *TestIamPermissionsRequest
  4073. urlParams_ gensupport.URLParams
  4074. ctx_ context.Context
  4075. header_ http.Header
  4076. }
  4077. // TestIamPermissions: Returns permissions that a caller has on the
  4078. // specified resource. If the resource does not exist, this will return
  4079. // an empty set of permissions, not a NOT_FOUND error.Note: This
  4080. // operation is designed to be used for building permission-aware UIs
  4081. // and command-line tools, not for authorization checking. This
  4082. // operation may "fail open" without warning.
  4083. func (r *ProjectsLocationsAutoscalingPoliciesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall {
  4084. c := &ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4085. c.resource = resource
  4086. c.testiampermissionsrequest = testiampermissionsrequest
  4087. return c
  4088. }
  4089. // Fields allows partial responses to be retrieved. See
  4090. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4091. // for more information.
  4092. func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall {
  4093. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4094. return c
  4095. }
  4096. // Context sets the context to be used in this call's Do method. Any
  4097. // pending HTTP request will be aborted if the provided context is
  4098. // canceled.
  4099. func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall {
  4100. c.ctx_ = ctx
  4101. return c
  4102. }
  4103. // Header returns an http.Header that can be modified by the caller to
  4104. // add HTTP headers to the request.
  4105. func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Header() http.Header {
  4106. if c.header_ == nil {
  4107. c.header_ = make(http.Header)
  4108. }
  4109. return c.header_
  4110. }
  4111. func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  4112. reqHeaders := make(http.Header)
  4113. for k, v := range c.header_ {
  4114. reqHeaders[k] = v
  4115. }
  4116. reqHeaders.Set("User-Agent", c.s.userAgent())
  4117. var body io.Reader = nil
  4118. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  4119. if err != nil {
  4120. return nil, err
  4121. }
  4122. reqHeaders.Set("Content-Type", "application/json")
  4123. c.urlParams_.Set("alt", alt)
  4124. c.urlParams_.Set("prettyPrint", "false")
  4125. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
  4126. urls += "?" + c.urlParams_.Encode()
  4127. req, err := http.NewRequest("POST", urls, body)
  4128. if err != nil {
  4129. return nil, err
  4130. }
  4131. req.Header = reqHeaders
  4132. googleapi.Expand(req.URL, map[string]string{
  4133. "resource": c.resource,
  4134. })
  4135. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4136. }
  4137. // Do executes the "dataproc.projects.locations.autoscalingPolicies.testIamPermissions" call.
  4138. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  4139. // Any non-2xx status code is an error. Response headers are in either
  4140. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  4141. // was returned at all) in error.(*googleapi.Error).Header. Use
  4142. // googleapi.IsNotModified to check whether the returned error was
  4143. // because http.StatusNotModified was returned.
  4144. func (c *ProjectsLocationsAutoscalingPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  4145. gensupport.SetOptions(c.urlParams_, opts...)
  4146. res, err := c.doRequest("json")
  4147. if res != nil && res.StatusCode == http.StatusNotModified {
  4148. if res.Body != nil {
  4149. res.Body.Close()
  4150. }
  4151. return nil, &googleapi.Error{
  4152. Code: res.StatusCode,
  4153. Header: res.Header,
  4154. }
  4155. }
  4156. if err != nil {
  4157. return nil, err
  4158. }
  4159. defer googleapi.CloseBody(res)
  4160. if err := googleapi.CheckResponse(res); err != nil {
  4161. return nil, err
  4162. }
  4163. ret := &TestIamPermissionsResponse{
  4164. ServerResponse: googleapi.ServerResponse{
  4165. Header: res.Header,
  4166. HTTPStatusCode: res.StatusCode,
  4167. },
  4168. }
  4169. target := &ret
  4170. if err := gensupport.DecodeResponse(target, res); err != nil {
  4171. return nil, err
  4172. }
  4173. return ret, nil
  4174. // {
  4175. // "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.",
  4176. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}:testIamPermissions",
  4177. // "httpMethod": "POST",
  4178. // "id": "dataproc.projects.locations.autoscalingPolicies.testIamPermissions",
  4179. // "parameterOrder": [
  4180. // "resource"
  4181. // ],
  4182. // "parameters": {
  4183. // "resource": {
  4184. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  4185. // "location": "path",
  4186. // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$",
  4187. // "required": true,
  4188. // "type": "string"
  4189. // }
  4190. // },
  4191. // "path": "v1beta2/{+resource}:testIamPermissions",
  4192. // "request": {
  4193. // "$ref": "TestIamPermissionsRequest"
  4194. // },
  4195. // "response": {
  4196. // "$ref": "TestIamPermissionsResponse"
  4197. // },
  4198. // "scopes": [
  4199. // "https://www.googleapis.com/auth/cloud-platform"
  4200. // ]
  4201. // }
  4202. }
  4203. // method id "dataproc.projects.locations.autoscalingPolicies.update":
  4204. type ProjectsLocationsAutoscalingPoliciesUpdateCall struct {
  4205. s *Service
  4206. name string
  4207. autoscalingpolicy *AutoscalingPolicy
  4208. urlParams_ gensupport.URLParams
  4209. ctx_ context.Context
  4210. header_ http.Header
  4211. }
  4212. // Update: Updates (replaces) autoscaling policy.Disabled check for
  4213. // update_mask, because all updates will be full replacements.
  4214. func (r *ProjectsLocationsAutoscalingPoliciesService) Update(name string, autoscalingpolicy *AutoscalingPolicy) *ProjectsLocationsAutoscalingPoliciesUpdateCall {
  4215. c := &ProjectsLocationsAutoscalingPoliciesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4216. c.name = name
  4217. c.autoscalingpolicy = autoscalingpolicy
  4218. return c
  4219. }
  4220. // Fields allows partial responses to be retrieved. See
  4221. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4222. // for more information.
  4223. func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsAutoscalingPoliciesUpdateCall {
  4224. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4225. return c
  4226. }
  4227. // Context sets the context to be used in this call's Do method. Any
  4228. // pending HTTP request will be aborted if the provided context is
  4229. // canceled.
  4230. func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Context(ctx context.Context) *ProjectsLocationsAutoscalingPoliciesUpdateCall {
  4231. c.ctx_ = ctx
  4232. return c
  4233. }
  4234. // Header returns an http.Header that can be modified by the caller to
  4235. // add HTTP headers to the request.
  4236. func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Header() http.Header {
  4237. if c.header_ == nil {
  4238. c.header_ = make(http.Header)
  4239. }
  4240. return c.header_
  4241. }
  4242. func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) doRequest(alt string) (*http.Response, error) {
  4243. reqHeaders := make(http.Header)
  4244. for k, v := range c.header_ {
  4245. reqHeaders[k] = v
  4246. }
  4247. reqHeaders.Set("User-Agent", c.s.userAgent())
  4248. var body io.Reader = nil
  4249. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy)
  4250. if err != nil {
  4251. return nil, err
  4252. }
  4253. reqHeaders.Set("Content-Type", "application/json")
  4254. c.urlParams_.Set("alt", alt)
  4255. c.urlParams_.Set("prettyPrint", "false")
  4256. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  4257. urls += "?" + c.urlParams_.Encode()
  4258. req, err := http.NewRequest("PUT", urls, body)
  4259. if err != nil {
  4260. return nil, err
  4261. }
  4262. req.Header = reqHeaders
  4263. googleapi.Expand(req.URL, map[string]string{
  4264. "name": c.name,
  4265. })
  4266. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4267. }
  4268. // Do executes the "dataproc.projects.locations.autoscalingPolicies.update" call.
  4269. // Exactly one of *AutoscalingPolicy or error will be non-nil. Any
  4270. // non-2xx status code is an error. Response headers are in either
  4271. // *AutoscalingPolicy.ServerResponse.Header or (if a response was
  4272. // returned at all) in error.(*googleapi.Error).Header. Use
  4273. // googleapi.IsNotModified to check whether the returned error was
  4274. // because http.StatusNotModified was returned.
  4275. func (c *ProjectsLocationsAutoscalingPoliciesUpdateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) {
  4276. gensupport.SetOptions(c.urlParams_, opts...)
  4277. res, err := c.doRequest("json")
  4278. if res != nil && res.StatusCode == http.StatusNotModified {
  4279. if res.Body != nil {
  4280. res.Body.Close()
  4281. }
  4282. return nil, &googleapi.Error{
  4283. Code: res.StatusCode,
  4284. Header: res.Header,
  4285. }
  4286. }
  4287. if err != nil {
  4288. return nil, err
  4289. }
  4290. defer googleapi.CloseBody(res)
  4291. if err := googleapi.CheckResponse(res); err != nil {
  4292. return nil, err
  4293. }
  4294. ret := &AutoscalingPolicy{
  4295. ServerResponse: googleapi.ServerResponse{
  4296. Header: res.Header,
  4297. HTTPStatusCode: res.StatusCode,
  4298. },
  4299. }
  4300. target := &ret
  4301. if err := gensupport.DecodeResponse(target, res); err != nil {
  4302. return nil, err
  4303. }
  4304. return ret, nil
  4305. // {
  4306. // "description": "Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements.",
  4307. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/autoscalingPolicies/{autoscalingPoliciesId}",
  4308. // "httpMethod": "PUT",
  4309. // "id": "dataproc.projects.locations.autoscalingPolicies.update",
  4310. // "parameterOrder": [
  4311. // "name"
  4312. // ],
  4313. // "parameters": {
  4314. // "name": {
  4315. // "description": "Output only. The \"resource name\" of the policy, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}.",
  4316. // "location": "path",
  4317. // "pattern": "^projects/[^/]+/locations/[^/]+/autoscalingPolicies/[^/]+$",
  4318. // "required": true,
  4319. // "type": "string"
  4320. // }
  4321. // },
  4322. // "path": "v1beta2/{+name}",
  4323. // "request": {
  4324. // "$ref": "AutoscalingPolicy"
  4325. // },
  4326. // "response": {
  4327. // "$ref": "AutoscalingPolicy"
  4328. // },
  4329. // "scopes": [
  4330. // "https://www.googleapis.com/auth/cloud-platform"
  4331. // ]
  4332. // }
  4333. }
  4334. // method id "dataproc.projects.locations.workflowTemplates.create":
  4335. type ProjectsLocationsWorkflowTemplatesCreateCall struct {
  4336. s *Service
  4337. parent string
  4338. workflowtemplate *WorkflowTemplate
  4339. urlParams_ gensupport.URLParams
  4340. ctx_ context.Context
  4341. header_ http.Header
  4342. }
  4343. // Create: Creates new workflow template.
  4344. func (r *ProjectsLocationsWorkflowTemplatesService) Create(parent string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesCreateCall {
  4345. c := &ProjectsLocationsWorkflowTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4346. c.parent = parent
  4347. c.workflowtemplate = workflowtemplate
  4348. return c
  4349. }
  4350. // Fields allows partial responses to be retrieved. See
  4351. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4352. // for more information.
  4353. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesCreateCall {
  4354. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4355. return c
  4356. }
  4357. // Context sets the context to be used in this call's Do method. Any
  4358. // pending HTTP request will be aborted if the provided context is
  4359. // canceled.
  4360. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesCreateCall {
  4361. c.ctx_ = ctx
  4362. return c
  4363. }
  4364. // Header returns an http.Header that can be modified by the caller to
  4365. // add HTTP headers to the request.
  4366. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Header() http.Header {
  4367. if c.header_ == nil {
  4368. c.header_ = make(http.Header)
  4369. }
  4370. return c.header_
  4371. }
  4372. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) {
  4373. reqHeaders := make(http.Header)
  4374. for k, v := range c.header_ {
  4375. reqHeaders[k] = v
  4376. }
  4377. reqHeaders.Set("User-Agent", c.s.userAgent())
  4378. var body io.Reader = nil
  4379. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  4380. if err != nil {
  4381. return nil, err
  4382. }
  4383. reqHeaders.Set("Content-Type", "application/json")
  4384. c.urlParams_.Set("alt", alt)
  4385. c.urlParams_.Set("prettyPrint", "false")
  4386. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates")
  4387. urls += "?" + c.urlParams_.Encode()
  4388. req, err := http.NewRequest("POST", urls, body)
  4389. if err != nil {
  4390. return nil, err
  4391. }
  4392. req.Header = reqHeaders
  4393. googleapi.Expand(req.URL, map[string]string{
  4394. "parent": c.parent,
  4395. })
  4396. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4397. }
  4398. // Do executes the "dataproc.projects.locations.workflowTemplates.create" call.
  4399. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  4400. // non-2xx status code is an error. Response headers are in either
  4401. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  4402. // returned at all) in error.(*googleapi.Error).Header. Use
  4403. // googleapi.IsNotModified to check whether the returned error was
  4404. // because http.StatusNotModified was returned.
  4405. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  4406. gensupport.SetOptions(c.urlParams_, opts...)
  4407. res, err := c.doRequest("json")
  4408. if res != nil && res.StatusCode == http.StatusNotModified {
  4409. if res.Body != nil {
  4410. res.Body.Close()
  4411. }
  4412. return nil, &googleapi.Error{
  4413. Code: res.StatusCode,
  4414. Header: res.Header,
  4415. }
  4416. }
  4417. if err != nil {
  4418. return nil, err
  4419. }
  4420. defer googleapi.CloseBody(res)
  4421. if err := googleapi.CheckResponse(res); err != nil {
  4422. return nil, err
  4423. }
  4424. ret := &WorkflowTemplate{
  4425. ServerResponse: googleapi.ServerResponse{
  4426. Header: res.Header,
  4427. HTTPStatusCode: res.StatusCode,
  4428. },
  4429. }
  4430. target := &ret
  4431. if err := gensupport.DecodeResponse(target, res); err != nil {
  4432. return nil, err
  4433. }
  4434. return ret, nil
  4435. // {
  4436. // "description": "Creates new workflow template.",
  4437. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates",
  4438. // "httpMethod": "POST",
  4439. // "id": "dataproc.projects.locations.workflowTemplates.create",
  4440. // "parameterOrder": [
  4441. // "parent"
  4442. // ],
  4443. // "parameters": {
  4444. // "parent": {
  4445. // "description": "Required. The \"resource name\" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}",
  4446. // "location": "path",
  4447. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  4448. // "required": true,
  4449. // "type": "string"
  4450. // }
  4451. // },
  4452. // "path": "v1beta2/{+parent}/workflowTemplates",
  4453. // "request": {
  4454. // "$ref": "WorkflowTemplate"
  4455. // },
  4456. // "response": {
  4457. // "$ref": "WorkflowTemplate"
  4458. // },
  4459. // "scopes": [
  4460. // "https://www.googleapis.com/auth/cloud-platform"
  4461. // ]
  4462. // }
  4463. }
  4464. // method id "dataproc.projects.locations.workflowTemplates.delete":
  4465. type ProjectsLocationsWorkflowTemplatesDeleteCall struct {
  4466. s *Service
  4467. name string
  4468. urlParams_ gensupport.URLParams
  4469. ctx_ context.Context
  4470. header_ http.Header
  4471. }
  4472. // Delete: Deletes a workflow template. It does not cancel in-progress
  4473. // workflows.
  4474. func (r *ProjectsLocationsWorkflowTemplatesService) Delete(name string) *ProjectsLocationsWorkflowTemplatesDeleteCall {
  4475. c := &ProjectsLocationsWorkflowTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4476. c.name = name
  4477. return c
  4478. }
  4479. // Version sets the optional parameter "version": The version of
  4480. // workflow template to delete. If specified, will only delete the
  4481. // template if the current server version matches specified version.
  4482. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Version(version int64) *ProjectsLocationsWorkflowTemplatesDeleteCall {
  4483. c.urlParams_.Set("version", fmt.Sprint(version))
  4484. return c
  4485. }
  4486. // Fields allows partial responses to be retrieved. See
  4487. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4488. // for more information.
  4489. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesDeleteCall {
  4490. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4491. return c
  4492. }
  4493. // Context sets the context to be used in this call's Do method. Any
  4494. // pending HTTP request will be aborted if the provided context is
  4495. // canceled.
  4496. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesDeleteCall {
  4497. c.ctx_ = ctx
  4498. return c
  4499. }
  4500. // Header returns an http.Header that can be modified by the caller to
  4501. // add HTTP headers to the request.
  4502. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Header() http.Header {
  4503. if c.header_ == nil {
  4504. c.header_ = make(http.Header)
  4505. }
  4506. return c.header_
  4507. }
  4508. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  4509. reqHeaders := make(http.Header)
  4510. for k, v := range c.header_ {
  4511. reqHeaders[k] = v
  4512. }
  4513. reqHeaders.Set("User-Agent", c.s.userAgent())
  4514. var body io.Reader = nil
  4515. c.urlParams_.Set("alt", alt)
  4516. c.urlParams_.Set("prettyPrint", "false")
  4517. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  4518. urls += "?" + c.urlParams_.Encode()
  4519. req, err := http.NewRequest("DELETE", urls, body)
  4520. if err != nil {
  4521. return nil, err
  4522. }
  4523. req.Header = reqHeaders
  4524. googleapi.Expand(req.URL, map[string]string{
  4525. "name": c.name,
  4526. })
  4527. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4528. }
  4529. // Do executes the "dataproc.projects.locations.workflowTemplates.delete" call.
  4530. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  4531. // code is an error. Response headers are in either
  4532. // *Empty.ServerResponse.Header or (if a response was returned at all)
  4533. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4534. // check whether the returned error was because http.StatusNotModified
  4535. // was returned.
  4536. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4537. gensupport.SetOptions(c.urlParams_, opts...)
  4538. res, err := c.doRequest("json")
  4539. if res != nil && res.StatusCode == http.StatusNotModified {
  4540. if res.Body != nil {
  4541. res.Body.Close()
  4542. }
  4543. return nil, &googleapi.Error{
  4544. Code: res.StatusCode,
  4545. Header: res.Header,
  4546. }
  4547. }
  4548. if err != nil {
  4549. return nil, err
  4550. }
  4551. defer googleapi.CloseBody(res)
  4552. if err := googleapi.CheckResponse(res); err != nil {
  4553. return nil, err
  4554. }
  4555. ret := &Empty{
  4556. ServerResponse: googleapi.ServerResponse{
  4557. Header: res.Header,
  4558. HTTPStatusCode: res.StatusCode,
  4559. },
  4560. }
  4561. target := &ret
  4562. if err := gensupport.DecodeResponse(target, res); err != nil {
  4563. return nil, err
  4564. }
  4565. return ret, nil
  4566. // {
  4567. // "description": "Deletes a workflow template. It does not cancel in-progress workflows.",
  4568. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}",
  4569. // "httpMethod": "DELETE",
  4570. // "id": "dataproc.projects.locations.workflowTemplates.delete",
  4571. // "parameterOrder": [
  4572. // "name"
  4573. // ],
  4574. // "parameters": {
  4575. // "name": {
  4576. // "description": "Required. The \"resource name\" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}",
  4577. // "location": "path",
  4578. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  4579. // "required": true,
  4580. // "type": "string"
  4581. // },
  4582. // "version": {
  4583. // "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.",
  4584. // "format": "int32",
  4585. // "location": "query",
  4586. // "type": "integer"
  4587. // }
  4588. // },
  4589. // "path": "v1beta2/{+name}",
  4590. // "response": {
  4591. // "$ref": "Empty"
  4592. // },
  4593. // "scopes": [
  4594. // "https://www.googleapis.com/auth/cloud-platform"
  4595. // ]
  4596. // }
  4597. }
  4598. // method id "dataproc.projects.locations.workflowTemplates.get":
  4599. type ProjectsLocationsWorkflowTemplatesGetCall struct {
  4600. s *Service
  4601. name string
  4602. urlParams_ gensupport.URLParams
  4603. ifNoneMatch_ string
  4604. ctx_ context.Context
  4605. header_ http.Header
  4606. }
  4607. // Get: Retrieves the latest workflow template.Can retrieve previously
  4608. // instantiated template by specifying optional version parameter.
  4609. func (r *ProjectsLocationsWorkflowTemplatesService) Get(name string) *ProjectsLocationsWorkflowTemplatesGetCall {
  4610. c := &ProjectsLocationsWorkflowTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4611. c.name = name
  4612. return c
  4613. }
  4614. // Version sets the optional parameter "version": The version of
  4615. // workflow template to retrieve. Only previously instatiated versions
  4616. // can be retrieved.If unspecified, retrieves the current version.
  4617. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Version(version int64) *ProjectsLocationsWorkflowTemplatesGetCall {
  4618. c.urlParams_.Set("version", fmt.Sprint(version))
  4619. return c
  4620. }
  4621. // Fields allows partial responses to be retrieved. See
  4622. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4623. // for more information.
  4624. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesGetCall {
  4625. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4626. return c
  4627. }
  4628. // IfNoneMatch sets the optional parameter which makes the operation
  4629. // fail if the object's ETag matches the given value. This is useful for
  4630. // getting updates only after the object has changed since the last
  4631. // request. Use googleapi.IsNotModified to check whether the response
  4632. // error from Do is the result of In-None-Match.
  4633. func (c *ProjectsLocationsWorkflowTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesGetCall {
  4634. c.ifNoneMatch_ = entityTag
  4635. return c
  4636. }
  4637. // Context sets the context to be used in this call's Do method. Any
  4638. // pending HTTP request will be aborted if the provided context is
  4639. // canceled.
  4640. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesGetCall {
  4641. c.ctx_ = ctx
  4642. return c
  4643. }
  4644. // Header returns an http.Header that can be modified by the caller to
  4645. // add HTTP headers to the request.
  4646. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Header() http.Header {
  4647. if c.header_ == nil {
  4648. c.header_ = make(http.Header)
  4649. }
  4650. return c.header_
  4651. }
  4652. func (c *ProjectsLocationsWorkflowTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  4653. reqHeaders := make(http.Header)
  4654. for k, v := range c.header_ {
  4655. reqHeaders[k] = v
  4656. }
  4657. reqHeaders.Set("User-Agent", c.s.userAgent())
  4658. if c.ifNoneMatch_ != "" {
  4659. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4660. }
  4661. var body io.Reader = nil
  4662. c.urlParams_.Set("alt", alt)
  4663. c.urlParams_.Set("prettyPrint", "false")
  4664. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  4665. urls += "?" + c.urlParams_.Encode()
  4666. req, err := http.NewRequest("GET", urls, body)
  4667. if err != nil {
  4668. return nil, err
  4669. }
  4670. req.Header = reqHeaders
  4671. googleapi.Expand(req.URL, map[string]string{
  4672. "name": c.name,
  4673. })
  4674. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4675. }
  4676. // Do executes the "dataproc.projects.locations.workflowTemplates.get" call.
  4677. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  4678. // non-2xx status code is an error. Response headers are in either
  4679. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  4680. // returned at all) in error.(*googleapi.Error).Header. Use
  4681. // googleapi.IsNotModified to check whether the returned error was
  4682. // because http.StatusNotModified was returned.
  4683. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  4684. gensupport.SetOptions(c.urlParams_, opts...)
  4685. res, err := c.doRequest("json")
  4686. if res != nil && res.StatusCode == http.StatusNotModified {
  4687. if res.Body != nil {
  4688. res.Body.Close()
  4689. }
  4690. return nil, &googleapi.Error{
  4691. Code: res.StatusCode,
  4692. Header: res.Header,
  4693. }
  4694. }
  4695. if err != nil {
  4696. return nil, err
  4697. }
  4698. defer googleapi.CloseBody(res)
  4699. if err := googleapi.CheckResponse(res); err != nil {
  4700. return nil, err
  4701. }
  4702. ret := &WorkflowTemplate{
  4703. ServerResponse: googleapi.ServerResponse{
  4704. Header: res.Header,
  4705. HTTPStatusCode: res.StatusCode,
  4706. },
  4707. }
  4708. target := &ret
  4709. if err := gensupport.DecodeResponse(target, res); err != nil {
  4710. return nil, err
  4711. }
  4712. return ret, nil
  4713. // {
  4714. // "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.",
  4715. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}",
  4716. // "httpMethod": "GET",
  4717. // "id": "dataproc.projects.locations.workflowTemplates.get",
  4718. // "parameterOrder": [
  4719. // "name"
  4720. // ],
  4721. // "parameters": {
  4722. // "name": {
  4723. // "description": "Required. The \"resource name\" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}",
  4724. // "location": "path",
  4725. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  4726. // "required": true,
  4727. // "type": "string"
  4728. // },
  4729. // "version": {
  4730. // "description": "Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version.",
  4731. // "format": "int32",
  4732. // "location": "query",
  4733. // "type": "integer"
  4734. // }
  4735. // },
  4736. // "path": "v1beta2/{+name}",
  4737. // "response": {
  4738. // "$ref": "WorkflowTemplate"
  4739. // },
  4740. // "scopes": [
  4741. // "https://www.googleapis.com/auth/cloud-platform"
  4742. // ]
  4743. // }
  4744. }
  4745. // method id "dataproc.projects.locations.workflowTemplates.getIamPolicy":
  4746. type ProjectsLocationsWorkflowTemplatesGetIamPolicyCall struct {
  4747. s *Service
  4748. resource string
  4749. urlParams_ gensupport.URLParams
  4750. ifNoneMatch_ string
  4751. ctx_ context.Context
  4752. header_ http.Header
  4753. }
  4754. // GetIamPolicy: Gets the access control policy for a resource. Returns
  4755. // an empty policy if the resource exists and does not have a policy
  4756. // set.
  4757. func (r *ProjectsLocationsWorkflowTemplatesService) GetIamPolicy(resource string) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall {
  4758. c := &ProjectsLocationsWorkflowTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4759. c.resource = resource
  4760. return c
  4761. }
  4762. // Fields allows partial responses to be retrieved. See
  4763. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4764. // for more information.
  4765. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall {
  4766. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4767. return c
  4768. }
  4769. // IfNoneMatch sets the optional parameter which makes the operation
  4770. // fail if the object's ETag matches the given value. This is useful for
  4771. // getting updates only after the object has changed since the last
  4772. // request. Use googleapi.IsNotModified to check whether the response
  4773. // error from Do is the result of In-None-Match.
  4774. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall {
  4775. c.ifNoneMatch_ = entityTag
  4776. return c
  4777. }
  4778. // Context sets the context to be used in this call's Do method. Any
  4779. // pending HTTP request will be aborted if the provided context is
  4780. // canceled.
  4781. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall {
  4782. c.ctx_ = ctx
  4783. return c
  4784. }
  4785. // Header returns an http.Header that can be modified by the caller to
  4786. // add HTTP headers to the request.
  4787. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Header() http.Header {
  4788. if c.header_ == nil {
  4789. c.header_ = make(http.Header)
  4790. }
  4791. return c.header_
  4792. }
  4793. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4794. reqHeaders := make(http.Header)
  4795. for k, v := range c.header_ {
  4796. reqHeaders[k] = v
  4797. }
  4798. reqHeaders.Set("User-Agent", c.s.userAgent())
  4799. if c.ifNoneMatch_ != "" {
  4800. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4801. }
  4802. var body io.Reader = nil
  4803. c.urlParams_.Set("alt", alt)
  4804. c.urlParams_.Set("prettyPrint", "false")
  4805. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
  4806. urls += "?" + c.urlParams_.Encode()
  4807. req, err := http.NewRequest("GET", urls, body)
  4808. if err != nil {
  4809. return nil, err
  4810. }
  4811. req.Header = reqHeaders
  4812. googleapi.Expand(req.URL, map[string]string{
  4813. "resource": c.resource,
  4814. })
  4815. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4816. }
  4817. // Do executes the "dataproc.projects.locations.workflowTemplates.getIamPolicy" call.
  4818. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  4819. // code is an error. Response headers are in either
  4820. // *Policy.ServerResponse.Header or (if a response was returned at all)
  4821. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4822. // check whether the returned error was because http.StatusNotModified
  4823. // was returned.
  4824. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4825. gensupport.SetOptions(c.urlParams_, opts...)
  4826. res, err := c.doRequest("json")
  4827. if res != nil && res.StatusCode == http.StatusNotModified {
  4828. if res.Body != nil {
  4829. res.Body.Close()
  4830. }
  4831. return nil, &googleapi.Error{
  4832. Code: res.StatusCode,
  4833. Header: res.Header,
  4834. }
  4835. }
  4836. if err != nil {
  4837. return nil, err
  4838. }
  4839. defer googleapi.CloseBody(res)
  4840. if err := googleapi.CheckResponse(res); err != nil {
  4841. return nil, err
  4842. }
  4843. ret := &Policy{
  4844. ServerResponse: googleapi.ServerResponse{
  4845. Header: res.Header,
  4846. HTTPStatusCode: res.StatusCode,
  4847. },
  4848. }
  4849. target := &ret
  4850. if err := gensupport.DecodeResponse(target, res); err != nil {
  4851. return nil, err
  4852. }
  4853. return ret, nil
  4854. // {
  4855. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  4856. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:getIamPolicy",
  4857. // "httpMethod": "GET",
  4858. // "id": "dataproc.projects.locations.workflowTemplates.getIamPolicy",
  4859. // "parameterOrder": [
  4860. // "resource"
  4861. // ],
  4862. // "parameters": {
  4863. // "resource": {
  4864. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  4865. // "location": "path",
  4866. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  4867. // "required": true,
  4868. // "type": "string"
  4869. // }
  4870. // },
  4871. // "path": "v1beta2/{+resource}:getIamPolicy",
  4872. // "response": {
  4873. // "$ref": "Policy"
  4874. // },
  4875. // "scopes": [
  4876. // "https://www.googleapis.com/auth/cloud-platform"
  4877. // ]
  4878. // }
  4879. }
  4880. // method id "dataproc.projects.locations.workflowTemplates.instantiate":
  4881. type ProjectsLocationsWorkflowTemplatesInstantiateCall struct {
  4882. s *Service
  4883. name string
  4884. instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest
  4885. urlParams_ gensupport.URLParams
  4886. ctx_ context.Context
  4887. header_ http.Header
  4888. }
  4889. // Instantiate: Instantiates a template and begins execution.The
  4890. // returned Operation can be used to track execution of workflow by
  4891. // polling operations.get. The Operation will complete when entire
  4892. // workflow is finished.The running workflow can be aborted via
  4893. // operations.cancel. This will cause any inflight jobs to be cancelled
  4894. // and workflow-owned clusters to be deleted.The Operation.metadata will
  4895. // be WorkflowMetadata.On successful completion, Operation.response will
  4896. // be Empty.
  4897. func (r *ProjectsLocationsWorkflowTemplatesService) Instantiate(name string, instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest) *ProjectsLocationsWorkflowTemplatesInstantiateCall {
  4898. c := &ProjectsLocationsWorkflowTemplatesInstantiateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4899. c.name = name
  4900. c.instantiateworkflowtemplaterequest = instantiateworkflowtemplaterequest
  4901. return c
  4902. }
  4903. // Fields allows partial responses to be retrieved. See
  4904. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4905. // for more information.
  4906. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesInstantiateCall {
  4907. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4908. return c
  4909. }
  4910. // Context sets the context to be used in this call's Do method. Any
  4911. // pending HTTP request will be aborted if the provided context is
  4912. // canceled.
  4913. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesInstantiateCall {
  4914. c.ctx_ = ctx
  4915. return c
  4916. }
  4917. // Header returns an http.Header that can be modified by the caller to
  4918. // add HTTP headers to the request.
  4919. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Header() http.Header {
  4920. if c.header_ == nil {
  4921. c.header_ = make(http.Header)
  4922. }
  4923. return c.header_
  4924. }
  4925. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) {
  4926. reqHeaders := make(http.Header)
  4927. for k, v := range c.header_ {
  4928. reqHeaders[k] = v
  4929. }
  4930. reqHeaders.Set("User-Agent", c.s.userAgent())
  4931. var body io.Reader = nil
  4932. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest)
  4933. if err != nil {
  4934. return nil, err
  4935. }
  4936. reqHeaders.Set("Content-Type", "application/json")
  4937. c.urlParams_.Set("alt", alt)
  4938. c.urlParams_.Set("prettyPrint", "false")
  4939. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:instantiate")
  4940. urls += "?" + c.urlParams_.Encode()
  4941. req, err := http.NewRequest("POST", urls, body)
  4942. if err != nil {
  4943. return nil, err
  4944. }
  4945. req.Header = reqHeaders
  4946. googleapi.Expand(req.URL, map[string]string{
  4947. "name": c.name,
  4948. })
  4949. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4950. }
  4951. // Do executes the "dataproc.projects.locations.workflowTemplates.instantiate" call.
  4952. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4953. // status code is an error. Response headers are in either
  4954. // *Operation.ServerResponse.Header or (if a response was returned at
  4955. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4956. // to check whether the returned error was because
  4957. // http.StatusNotModified was returned.
  4958. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4959. gensupport.SetOptions(c.urlParams_, opts...)
  4960. res, err := c.doRequest("json")
  4961. if res != nil && res.StatusCode == http.StatusNotModified {
  4962. if res.Body != nil {
  4963. res.Body.Close()
  4964. }
  4965. return nil, &googleapi.Error{
  4966. Code: res.StatusCode,
  4967. Header: res.Header,
  4968. }
  4969. }
  4970. if err != nil {
  4971. return nil, err
  4972. }
  4973. defer googleapi.CloseBody(res)
  4974. if err := googleapi.CheckResponse(res); err != nil {
  4975. return nil, err
  4976. }
  4977. ret := &Operation{
  4978. ServerResponse: googleapi.ServerResponse{
  4979. Header: res.Header,
  4980. HTTPStatusCode: res.StatusCode,
  4981. },
  4982. }
  4983. target := &ret
  4984. if err := gensupport.DecodeResponse(target, res); err != nil {
  4985. return nil, err
  4986. }
  4987. return ret, nil
  4988. // {
  4989. // "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.On successful completion, Operation.response will be Empty.",
  4990. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:instantiate",
  4991. // "httpMethod": "POST",
  4992. // "id": "dataproc.projects.locations.workflowTemplates.instantiate",
  4993. // "parameterOrder": [
  4994. // "name"
  4995. // ],
  4996. // "parameters": {
  4997. // "name": {
  4998. // "description": "Required. The \"resource name\" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}",
  4999. // "location": "path",
  5000. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  5001. // "required": true,
  5002. // "type": "string"
  5003. // }
  5004. // },
  5005. // "path": "v1beta2/{+name}:instantiate",
  5006. // "request": {
  5007. // "$ref": "InstantiateWorkflowTemplateRequest"
  5008. // },
  5009. // "response": {
  5010. // "$ref": "Operation"
  5011. // },
  5012. // "scopes": [
  5013. // "https://www.googleapis.com/auth/cloud-platform"
  5014. // ]
  5015. // }
  5016. }
  5017. // method id "dataproc.projects.locations.workflowTemplates.instantiateInline":
  5018. type ProjectsLocationsWorkflowTemplatesInstantiateInlineCall struct {
  5019. s *Service
  5020. parent string
  5021. workflowtemplate *WorkflowTemplate
  5022. urlParams_ gensupport.URLParams
  5023. ctx_ context.Context
  5024. header_ http.Header
  5025. }
  5026. // InstantiateInline: Instantiates a template and begins execution.This
  5027. // method is equivalent to executing the sequence
  5028. // CreateWorkflowTemplate, InstantiateWorkflowTemplate,
  5029. // DeleteWorkflowTemplate.The returned Operation can be used to track
  5030. // execution of workflow by polling operations.get. The Operation will
  5031. // complete when entire workflow is finished.The running workflow can be
  5032. // aborted via operations.cancel. This will cause any inflight jobs to
  5033. // be cancelled and workflow-owned clusters to be deleted.The
  5034. // Operation.metadata will be WorkflowMetadata.On successful completion,
  5035. // Operation.response will be Empty.
  5036. func (r *ProjectsLocationsWorkflowTemplatesService) InstantiateInline(parent string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall {
  5037. c := &ProjectsLocationsWorkflowTemplatesInstantiateInlineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5038. c.parent = parent
  5039. c.workflowtemplate = workflowtemplate
  5040. return c
  5041. }
  5042. // InstanceId sets the optional parameter "instanceId": Deprecated.
  5043. // Please use request_id field instead.
  5044. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) InstanceId(instanceId string) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall {
  5045. c.urlParams_.Set("instanceId", instanceId)
  5046. return c
  5047. }
  5048. // RequestId sets the optional parameter "requestId": A tag that
  5049. // prevents multiple concurrent workflow instances with the same tag
  5050. // from running. This mitigates risk of concurrent instances started due
  5051. // to retries.It is recommended to always set this value to a UUID
  5052. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag
  5053. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  5054. // and hyphens (-). The maximum length is 40 characters.
  5055. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) RequestId(requestId string) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall {
  5056. c.urlParams_.Set("requestId", requestId)
  5057. return c
  5058. }
  5059. // Fields allows partial responses to be retrieved. See
  5060. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5061. // for more information.
  5062. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall {
  5063. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5064. return c
  5065. }
  5066. // Context sets the context to be used in this call's Do method. Any
  5067. // pending HTTP request will be aborted if the provided context is
  5068. // canceled.
  5069. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall {
  5070. c.ctx_ = ctx
  5071. return c
  5072. }
  5073. // Header returns an http.Header that can be modified by the caller to
  5074. // add HTTP headers to the request.
  5075. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Header() http.Header {
  5076. if c.header_ == nil {
  5077. c.header_ = make(http.Header)
  5078. }
  5079. return c.header_
  5080. }
  5081. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) {
  5082. reqHeaders := make(http.Header)
  5083. for k, v := range c.header_ {
  5084. reqHeaders[k] = v
  5085. }
  5086. reqHeaders.Set("User-Agent", c.s.userAgent())
  5087. var body io.Reader = nil
  5088. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  5089. if err != nil {
  5090. return nil, err
  5091. }
  5092. reqHeaders.Set("Content-Type", "application/json")
  5093. c.urlParams_.Set("alt", alt)
  5094. c.urlParams_.Set("prettyPrint", "false")
  5095. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates:instantiateInline")
  5096. urls += "?" + c.urlParams_.Encode()
  5097. req, err := http.NewRequest("POST", urls, body)
  5098. if err != nil {
  5099. return nil, err
  5100. }
  5101. req.Header = reqHeaders
  5102. googleapi.Expand(req.URL, map[string]string{
  5103. "parent": c.parent,
  5104. })
  5105. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5106. }
  5107. // Do executes the "dataproc.projects.locations.workflowTemplates.instantiateInline" call.
  5108. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5109. // status code is an error. Response headers are in either
  5110. // *Operation.ServerResponse.Header or (if a response was returned at
  5111. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5112. // to check whether the returned error was because
  5113. // http.StatusNotModified was returned.
  5114. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5115. gensupport.SetOptions(c.urlParams_, opts...)
  5116. res, err := c.doRequest("json")
  5117. if res != nil && res.StatusCode == http.StatusNotModified {
  5118. if res.Body != nil {
  5119. res.Body.Close()
  5120. }
  5121. return nil, &googleapi.Error{
  5122. Code: res.StatusCode,
  5123. Header: res.Header,
  5124. }
  5125. }
  5126. if err != nil {
  5127. return nil, err
  5128. }
  5129. defer googleapi.CloseBody(res)
  5130. if err := googleapi.CheckResponse(res); err != nil {
  5131. return nil, err
  5132. }
  5133. ret := &Operation{
  5134. ServerResponse: googleapi.ServerResponse{
  5135. Header: res.Header,
  5136. HTTPStatusCode: res.StatusCode,
  5137. },
  5138. }
  5139. target := &ret
  5140. if err := gensupport.DecodeResponse(target, res); err != nil {
  5141. return nil, err
  5142. }
  5143. return ret, nil
  5144. // {
  5145. // "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.On successful completion, Operation.response will be Empty.",
  5146. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates:instantiateInline",
  5147. // "httpMethod": "POST",
  5148. // "id": "dataproc.projects.locations.workflowTemplates.instantiateInline",
  5149. // "parameterOrder": [
  5150. // "parent"
  5151. // ],
  5152. // "parameters": {
  5153. // "instanceId": {
  5154. // "description": "Deprecated. Please use request_id field instead.",
  5155. // "location": "query",
  5156. // "type": "string"
  5157. // },
  5158. // "parent": {
  5159. // "description": "Required. The \"resource name\" of the workflow template region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}",
  5160. // "location": "path",
  5161. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  5162. // "required": true,
  5163. // "type": "string"
  5164. // },
  5165. // "requestId": {
  5166. // "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.",
  5167. // "location": "query",
  5168. // "type": "string"
  5169. // }
  5170. // },
  5171. // "path": "v1beta2/{+parent}/workflowTemplates:instantiateInline",
  5172. // "request": {
  5173. // "$ref": "WorkflowTemplate"
  5174. // },
  5175. // "response": {
  5176. // "$ref": "Operation"
  5177. // },
  5178. // "scopes": [
  5179. // "https://www.googleapis.com/auth/cloud-platform"
  5180. // ]
  5181. // }
  5182. }
  5183. // method id "dataproc.projects.locations.workflowTemplates.list":
  5184. type ProjectsLocationsWorkflowTemplatesListCall struct {
  5185. s *Service
  5186. parent string
  5187. urlParams_ gensupport.URLParams
  5188. ifNoneMatch_ string
  5189. ctx_ context.Context
  5190. header_ http.Header
  5191. }
  5192. // List: Lists workflows that match the specified filter in the request.
  5193. func (r *ProjectsLocationsWorkflowTemplatesService) List(parent string) *ProjectsLocationsWorkflowTemplatesListCall {
  5194. c := &ProjectsLocationsWorkflowTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5195. c.parent = parent
  5196. return c
  5197. }
  5198. // PageSize sets the optional parameter "pageSize": The maximum number
  5199. // of results to return in each response.
  5200. func (c *ProjectsLocationsWorkflowTemplatesListCall) PageSize(pageSize int64) *ProjectsLocationsWorkflowTemplatesListCall {
  5201. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5202. return c
  5203. }
  5204. // PageToken sets the optional parameter "pageToken": The page token,
  5205. // returned by a previous call, to request the next page of results.
  5206. func (c *ProjectsLocationsWorkflowTemplatesListCall) PageToken(pageToken string) *ProjectsLocationsWorkflowTemplatesListCall {
  5207. c.urlParams_.Set("pageToken", pageToken)
  5208. return c
  5209. }
  5210. // Fields allows partial responses to be retrieved. See
  5211. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5212. // for more information.
  5213. func (c *ProjectsLocationsWorkflowTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesListCall {
  5214. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5215. return c
  5216. }
  5217. // IfNoneMatch sets the optional parameter which makes the operation
  5218. // fail if the object's ETag matches the given value. This is useful for
  5219. // getting updates only after the object has changed since the last
  5220. // request. Use googleapi.IsNotModified to check whether the response
  5221. // error from Do is the result of In-None-Match.
  5222. func (c *ProjectsLocationsWorkflowTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesListCall {
  5223. c.ifNoneMatch_ = entityTag
  5224. return c
  5225. }
  5226. // Context sets the context to be used in this call's Do method. Any
  5227. // pending HTTP request will be aborted if the provided context is
  5228. // canceled.
  5229. func (c *ProjectsLocationsWorkflowTemplatesListCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesListCall {
  5230. c.ctx_ = ctx
  5231. return c
  5232. }
  5233. // Header returns an http.Header that can be modified by the caller to
  5234. // add HTTP headers to the request.
  5235. func (c *ProjectsLocationsWorkflowTemplatesListCall) Header() http.Header {
  5236. if c.header_ == nil {
  5237. c.header_ = make(http.Header)
  5238. }
  5239. return c.header_
  5240. }
  5241. func (c *ProjectsLocationsWorkflowTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  5242. reqHeaders := make(http.Header)
  5243. for k, v := range c.header_ {
  5244. reqHeaders[k] = v
  5245. }
  5246. reqHeaders.Set("User-Agent", c.s.userAgent())
  5247. if c.ifNoneMatch_ != "" {
  5248. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5249. }
  5250. var body io.Reader = nil
  5251. c.urlParams_.Set("alt", alt)
  5252. c.urlParams_.Set("prettyPrint", "false")
  5253. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates")
  5254. urls += "?" + c.urlParams_.Encode()
  5255. req, err := http.NewRequest("GET", urls, body)
  5256. if err != nil {
  5257. return nil, err
  5258. }
  5259. req.Header = reqHeaders
  5260. googleapi.Expand(req.URL, map[string]string{
  5261. "parent": c.parent,
  5262. })
  5263. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5264. }
  5265. // Do executes the "dataproc.projects.locations.workflowTemplates.list" call.
  5266. // Exactly one of *ListWorkflowTemplatesResponse or error will be
  5267. // non-nil. Any non-2xx status code is an error. Response headers are in
  5268. // either *ListWorkflowTemplatesResponse.ServerResponse.Header or (if a
  5269. // response was returned at all) in error.(*googleapi.Error).Header. Use
  5270. // googleapi.IsNotModified to check whether the returned error was
  5271. // because http.StatusNotModified was returned.
  5272. func (c *ProjectsLocationsWorkflowTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowTemplatesResponse, error) {
  5273. gensupport.SetOptions(c.urlParams_, opts...)
  5274. res, err := c.doRequest("json")
  5275. if res != nil && res.StatusCode == http.StatusNotModified {
  5276. if res.Body != nil {
  5277. res.Body.Close()
  5278. }
  5279. return nil, &googleapi.Error{
  5280. Code: res.StatusCode,
  5281. Header: res.Header,
  5282. }
  5283. }
  5284. if err != nil {
  5285. return nil, err
  5286. }
  5287. defer googleapi.CloseBody(res)
  5288. if err := googleapi.CheckResponse(res); err != nil {
  5289. return nil, err
  5290. }
  5291. ret := &ListWorkflowTemplatesResponse{
  5292. ServerResponse: googleapi.ServerResponse{
  5293. Header: res.Header,
  5294. HTTPStatusCode: res.StatusCode,
  5295. },
  5296. }
  5297. target := &ret
  5298. if err := gensupport.DecodeResponse(target, res); err != nil {
  5299. return nil, err
  5300. }
  5301. return ret, nil
  5302. // {
  5303. // "description": "Lists workflows that match the specified filter in the request.",
  5304. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates",
  5305. // "httpMethod": "GET",
  5306. // "id": "dataproc.projects.locations.workflowTemplates.list",
  5307. // "parameterOrder": [
  5308. // "parent"
  5309. // ],
  5310. // "parameters": {
  5311. // "pageSize": {
  5312. // "description": "Optional. The maximum number of results to return in each response.",
  5313. // "format": "int32",
  5314. // "location": "query",
  5315. // "type": "integer"
  5316. // },
  5317. // "pageToken": {
  5318. // "description": "Optional. The page token, returned by a previous call, to request the next page of results.",
  5319. // "location": "query",
  5320. // "type": "string"
  5321. // },
  5322. // "parent": {
  5323. // "description": "Required. The \"resource name\" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}",
  5324. // "location": "path",
  5325. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  5326. // "required": true,
  5327. // "type": "string"
  5328. // }
  5329. // },
  5330. // "path": "v1beta2/{+parent}/workflowTemplates",
  5331. // "response": {
  5332. // "$ref": "ListWorkflowTemplatesResponse"
  5333. // },
  5334. // "scopes": [
  5335. // "https://www.googleapis.com/auth/cloud-platform"
  5336. // ]
  5337. // }
  5338. }
  5339. // Pages invokes f for each page of results.
  5340. // A non-nil error returned from f will halt the iteration.
  5341. // The provided context supersedes any context provided to the Context method.
  5342. func (c *ProjectsLocationsWorkflowTemplatesListCall) Pages(ctx context.Context, f func(*ListWorkflowTemplatesResponse) error) error {
  5343. c.ctx_ = ctx
  5344. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5345. for {
  5346. x, err := c.Do()
  5347. if err != nil {
  5348. return err
  5349. }
  5350. if err := f(x); err != nil {
  5351. return err
  5352. }
  5353. if x.NextPageToken == "" {
  5354. return nil
  5355. }
  5356. c.PageToken(x.NextPageToken)
  5357. }
  5358. }
  5359. // method id "dataproc.projects.locations.workflowTemplates.setIamPolicy":
  5360. type ProjectsLocationsWorkflowTemplatesSetIamPolicyCall struct {
  5361. s *Service
  5362. resource string
  5363. setiampolicyrequest *SetIamPolicyRequest
  5364. urlParams_ gensupport.URLParams
  5365. ctx_ context.Context
  5366. header_ http.Header
  5367. }
  5368. // SetIamPolicy: Sets the access control policy on the specified
  5369. // resource. Replaces any existing policy.
  5370. func (r *ProjectsLocationsWorkflowTemplatesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall {
  5371. c := &ProjectsLocationsWorkflowTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5372. c.resource = resource
  5373. c.setiampolicyrequest = setiampolicyrequest
  5374. return c
  5375. }
  5376. // Fields allows partial responses to be retrieved. See
  5377. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5378. // for more information.
  5379. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall {
  5380. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5381. return c
  5382. }
  5383. // Context sets the context to be used in this call's Do method. Any
  5384. // pending HTTP request will be aborted if the provided context is
  5385. // canceled.
  5386. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall {
  5387. c.ctx_ = ctx
  5388. return c
  5389. }
  5390. // Header returns an http.Header that can be modified by the caller to
  5391. // add HTTP headers to the request.
  5392. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Header() http.Header {
  5393. if c.header_ == nil {
  5394. c.header_ = make(http.Header)
  5395. }
  5396. return c.header_
  5397. }
  5398. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  5399. reqHeaders := make(http.Header)
  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.setiampolicyrequest)
  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}:setIamPolicy")
  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. // Do executes the "dataproc.projects.locations.workflowTemplates.setIamPolicy" call.
  5425. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  5426. // code is an error. Response headers are in either
  5427. // *Policy.ServerResponse.Header or (if a response was returned at all)
  5428. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5429. // check whether the returned error was because http.StatusNotModified
  5430. // was returned.
  5431. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  5432. gensupport.SetOptions(c.urlParams_, opts...)
  5433. res, err := c.doRequest("json")
  5434. if res != nil && res.StatusCode == http.StatusNotModified {
  5435. if res.Body != nil {
  5436. res.Body.Close()
  5437. }
  5438. return nil, &googleapi.Error{
  5439. Code: res.StatusCode,
  5440. Header: res.Header,
  5441. }
  5442. }
  5443. if err != nil {
  5444. return nil, err
  5445. }
  5446. defer googleapi.CloseBody(res)
  5447. if err := googleapi.CheckResponse(res); err != nil {
  5448. return nil, err
  5449. }
  5450. ret := &Policy{
  5451. ServerResponse: googleapi.ServerResponse{
  5452. Header: res.Header,
  5453. HTTPStatusCode: res.StatusCode,
  5454. },
  5455. }
  5456. target := &ret
  5457. if err := gensupport.DecodeResponse(target, res); err != nil {
  5458. return nil, err
  5459. }
  5460. return ret, nil
  5461. // {
  5462. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  5463. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:setIamPolicy",
  5464. // "httpMethod": "POST",
  5465. // "id": "dataproc.projects.locations.workflowTemplates.setIamPolicy",
  5466. // "parameterOrder": [
  5467. // "resource"
  5468. // ],
  5469. // "parameters": {
  5470. // "resource": {
  5471. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  5472. // "location": "path",
  5473. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  5474. // "required": true,
  5475. // "type": "string"
  5476. // }
  5477. // },
  5478. // "path": "v1beta2/{+resource}:setIamPolicy",
  5479. // "request": {
  5480. // "$ref": "SetIamPolicyRequest"
  5481. // },
  5482. // "response": {
  5483. // "$ref": "Policy"
  5484. // },
  5485. // "scopes": [
  5486. // "https://www.googleapis.com/auth/cloud-platform"
  5487. // ]
  5488. // }
  5489. }
  5490. // method id "dataproc.projects.locations.workflowTemplates.testIamPermissions":
  5491. type ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall struct {
  5492. s *Service
  5493. resource string
  5494. testiampermissionsrequest *TestIamPermissionsRequest
  5495. urlParams_ gensupport.URLParams
  5496. ctx_ context.Context
  5497. header_ http.Header
  5498. }
  5499. // TestIamPermissions: Returns permissions that a caller has on the
  5500. // specified resource. If the resource does not exist, this will return
  5501. // an empty set of permissions, not a NOT_FOUND error.Note: This
  5502. // operation is designed to be used for building permission-aware UIs
  5503. // and command-line tools, not for authorization checking. This
  5504. // operation may "fail open" without warning.
  5505. func (r *ProjectsLocationsWorkflowTemplatesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall {
  5506. c := &ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5507. c.resource = resource
  5508. c.testiampermissionsrequest = testiampermissionsrequest
  5509. return c
  5510. }
  5511. // Fields allows partial responses to be retrieved. See
  5512. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5513. // for more information.
  5514. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall {
  5515. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5516. return c
  5517. }
  5518. // Context sets the context to be used in this call's Do method. Any
  5519. // pending HTTP request will be aborted if the provided context is
  5520. // canceled.
  5521. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall {
  5522. c.ctx_ = ctx
  5523. return c
  5524. }
  5525. // Header returns an http.Header that can be modified by the caller to
  5526. // add HTTP headers to the request.
  5527. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Header() http.Header {
  5528. if c.header_ == nil {
  5529. c.header_ = make(http.Header)
  5530. }
  5531. return c.header_
  5532. }
  5533. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  5534. reqHeaders := make(http.Header)
  5535. for k, v := range c.header_ {
  5536. reqHeaders[k] = v
  5537. }
  5538. reqHeaders.Set("User-Agent", c.s.userAgent())
  5539. var body io.Reader = nil
  5540. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  5541. if err != nil {
  5542. return nil, err
  5543. }
  5544. reqHeaders.Set("Content-Type", "application/json")
  5545. c.urlParams_.Set("alt", alt)
  5546. c.urlParams_.Set("prettyPrint", "false")
  5547. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
  5548. urls += "?" + c.urlParams_.Encode()
  5549. req, err := http.NewRequest("POST", urls, body)
  5550. if err != nil {
  5551. return nil, err
  5552. }
  5553. req.Header = reqHeaders
  5554. googleapi.Expand(req.URL, map[string]string{
  5555. "resource": c.resource,
  5556. })
  5557. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5558. }
  5559. // Do executes the "dataproc.projects.locations.workflowTemplates.testIamPermissions" call.
  5560. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  5561. // Any non-2xx status code is an error. Response headers are in either
  5562. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  5563. // was returned at all) in error.(*googleapi.Error).Header. Use
  5564. // googleapi.IsNotModified to check whether the returned error was
  5565. // because http.StatusNotModified was returned.
  5566. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  5567. gensupport.SetOptions(c.urlParams_, opts...)
  5568. res, err := c.doRequest("json")
  5569. if res != nil && res.StatusCode == http.StatusNotModified {
  5570. if res.Body != nil {
  5571. res.Body.Close()
  5572. }
  5573. return nil, &googleapi.Error{
  5574. Code: res.StatusCode,
  5575. Header: res.Header,
  5576. }
  5577. }
  5578. if err != nil {
  5579. return nil, err
  5580. }
  5581. defer googleapi.CloseBody(res)
  5582. if err := googleapi.CheckResponse(res); err != nil {
  5583. return nil, err
  5584. }
  5585. ret := &TestIamPermissionsResponse{
  5586. ServerResponse: googleapi.ServerResponse{
  5587. Header: res.Header,
  5588. HTTPStatusCode: res.StatusCode,
  5589. },
  5590. }
  5591. target := &ret
  5592. if err := gensupport.DecodeResponse(target, res); err != nil {
  5593. return nil, err
  5594. }
  5595. return ret, nil
  5596. // {
  5597. // "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.",
  5598. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:testIamPermissions",
  5599. // "httpMethod": "POST",
  5600. // "id": "dataproc.projects.locations.workflowTemplates.testIamPermissions",
  5601. // "parameterOrder": [
  5602. // "resource"
  5603. // ],
  5604. // "parameters": {
  5605. // "resource": {
  5606. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  5607. // "location": "path",
  5608. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  5609. // "required": true,
  5610. // "type": "string"
  5611. // }
  5612. // },
  5613. // "path": "v1beta2/{+resource}:testIamPermissions",
  5614. // "request": {
  5615. // "$ref": "TestIamPermissionsRequest"
  5616. // },
  5617. // "response": {
  5618. // "$ref": "TestIamPermissionsResponse"
  5619. // },
  5620. // "scopes": [
  5621. // "https://www.googleapis.com/auth/cloud-platform"
  5622. // ]
  5623. // }
  5624. }
  5625. // method id "dataproc.projects.locations.workflowTemplates.update":
  5626. type ProjectsLocationsWorkflowTemplatesUpdateCall struct {
  5627. s *Service
  5628. name string
  5629. workflowtemplate *WorkflowTemplate
  5630. urlParams_ gensupport.URLParams
  5631. ctx_ context.Context
  5632. header_ http.Header
  5633. }
  5634. // Update: Updates (replaces) workflow template. The updated template
  5635. // must contain version that matches the current server version.
  5636. func (r *ProjectsLocationsWorkflowTemplatesService) Update(name string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesUpdateCall {
  5637. c := &ProjectsLocationsWorkflowTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5638. c.name = name
  5639. c.workflowtemplate = workflowtemplate
  5640. return c
  5641. }
  5642. // Fields allows partial responses to be retrieved. See
  5643. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5644. // for more information.
  5645. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesUpdateCall {
  5646. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5647. return c
  5648. }
  5649. // Context sets the context to be used in this call's Do method. Any
  5650. // pending HTTP request will be aborted if the provided context is
  5651. // canceled.
  5652. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesUpdateCall {
  5653. c.ctx_ = ctx
  5654. return c
  5655. }
  5656. // Header returns an http.Header that can be modified by the caller to
  5657. // add HTTP headers to the request.
  5658. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Header() http.Header {
  5659. if c.header_ == nil {
  5660. c.header_ = make(http.Header)
  5661. }
  5662. return c.header_
  5663. }
  5664. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  5665. reqHeaders := make(http.Header)
  5666. for k, v := range c.header_ {
  5667. reqHeaders[k] = v
  5668. }
  5669. reqHeaders.Set("User-Agent", c.s.userAgent())
  5670. var body io.Reader = nil
  5671. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  5672. if err != nil {
  5673. return nil, err
  5674. }
  5675. reqHeaders.Set("Content-Type", "application/json")
  5676. c.urlParams_.Set("alt", alt)
  5677. c.urlParams_.Set("prettyPrint", "false")
  5678. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  5679. urls += "?" + c.urlParams_.Encode()
  5680. req, err := http.NewRequest("PUT", urls, body)
  5681. if err != nil {
  5682. return nil, err
  5683. }
  5684. req.Header = reqHeaders
  5685. googleapi.Expand(req.URL, map[string]string{
  5686. "name": c.name,
  5687. })
  5688. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5689. }
  5690. // Do executes the "dataproc.projects.locations.workflowTemplates.update" call.
  5691. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  5692. // non-2xx status code is an error. Response headers are in either
  5693. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  5694. // returned at all) in error.(*googleapi.Error).Header. Use
  5695. // googleapi.IsNotModified to check whether the returned error was
  5696. // because http.StatusNotModified was returned.
  5697. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  5698. gensupport.SetOptions(c.urlParams_, opts...)
  5699. res, err := c.doRequest("json")
  5700. if res != nil && res.StatusCode == http.StatusNotModified {
  5701. if res.Body != nil {
  5702. res.Body.Close()
  5703. }
  5704. return nil, &googleapi.Error{
  5705. Code: res.StatusCode,
  5706. Header: res.Header,
  5707. }
  5708. }
  5709. if err != nil {
  5710. return nil, err
  5711. }
  5712. defer googleapi.CloseBody(res)
  5713. if err := googleapi.CheckResponse(res); err != nil {
  5714. return nil, err
  5715. }
  5716. ret := &WorkflowTemplate{
  5717. ServerResponse: googleapi.ServerResponse{
  5718. Header: res.Header,
  5719. HTTPStatusCode: res.StatusCode,
  5720. },
  5721. }
  5722. target := &ret
  5723. if err := gensupport.DecodeResponse(target, res); err != nil {
  5724. return nil, err
  5725. }
  5726. return ret, nil
  5727. // {
  5728. // "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version.",
  5729. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}",
  5730. // "httpMethod": "PUT",
  5731. // "id": "dataproc.projects.locations.workflowTemplates.update",
  5732. // "parameterOrder": [
  5733. // "name"
  5734. // ],
  5735. // "parameters": {
  5736. // "name": {
  5737. // "description": "Output only. The \"resource name\" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}",
  5738. // "location": "path",
  5739. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  5740. // "required": true,
  5741. // "type": "string"
  5742. // }
  5743. // },
  5744. // "path": "v1beta2/{+name}",
  5745. // "request": {
  5746. // "$ref": "WorkflowTemplate"
  5747. // },
  5748. // "response": {
  5749. // "$ref": "WorkflowTemplate"
  5750. // },
  5751. // "scopes": [
  5752. // "https://www.googleapis.com/auth/cloud-platform"
  5753. // ]
  5754. // }
  5755. }
  5756. // method id "dataproc.projects.regions.autoscalingPolicies.create":
  5757. type ProjectsRegionsAutoscalingPoliciesCreateCall struct {
  5758. s *Service
  5759. parent string
  5760. autoscalingpolicy *AutoscalingPolicy
  5761. urlParams_ gensupport.URLParams
  5762. ctx_ context.Context
  5763. header_ http.Header
  5764. }
  5765. // Create: Creates new autoscaling policy.
  5766. func (r *ProjectsRegionsAutoscalingPoliciesService) Create(parent string, autoscalingpolicy *AutoscalingPolicy) *ProjectsRegionsAutoscalingPoliciesCreateCall {
  5767. c := &ProjectsRegionsAutoscalingPoliciesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5768. c.parent = parent
  5769. c.autoscalingpolicy = autoscalingpolicy
  5770. return c
  5771. }
  5772. // Fields allows partial responses to be retrieved. See
  5773. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5774. // for more information.
  5775. func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesCreateCall {
  5776. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5777. return c
  5778. }
  5779. // Context sets the context to be used in this call's Do method. Any
  5780. // pending HTTP request will be aborted if the provided context is
  5781. // canceled.
  5782. func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesCreateCall {
  5783. c.ctx_ = ctx
  5784. return c
  5785. }
  5786. // Header returns an http.Header that can be modified by the caller to
  5787. // add HTTP headers to the request.
  5788. func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Header() http.Header {
  5789. if c.header_ == nil {
  5790. c.header_ = make(http.Header)
  5791. }
  5792. return c.header_
  5793. }
  5794. func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) doRequest(alt string) (*http.Response, error) {
  5795. reqHeaders := make(http.Header)
  5796. for k, v := range c.header_ {
  5797. reqHeaders[k] = v
  5798. }
  5799. reqHeaders.Set("User-Agent", c.s.userAgent())
  5800. var body io.Reader = nil
  5801. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy)
  5802. if err != nil {
  5803. return nil, err
  5804. }
  5805. reqHeaders.Set("Content-Type", "application/json")
  5806. c.urlParams_.Set("alt", alt)
  5807. c.urlParams_.Set("prettyPrint", "false")
  5808. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/autoscalingPolicies")
  5809. urls += "?" + c.urlParams_.Encode()
  5810. req, err := http.NewRequest("POST", urls, body)
  5811. if err != nil {
  5812. return nil, err
  5813. }
  5814. req.Header = reqHeaders
  5815. googleapi.Expand(req.URL, map[string]string{
  5816. "parent": c.parent,
  5817. })
  5818. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5819. }
  5820. // Do executes the "dataproc.projects.regions.autoscalingPolicies.create" call.
  5821. // Exactly one of *AutoscalingPolicy or error will be non-nil. Any
  5822. // non-2xx status code is an error. Response headers are in either
  5823. // *AutoscalingPolicy.ServerResponse.Header or (if a response was
  5824. // returned at all) in error.(*googleapi.Error).Header. Use
  5825. // googleapi.IsNotModified to check whether the returned error was
  5826. // because http.StatusNotModified was returned.
  5827. func (c *ProjectsRegionsAutoscalingPoliciesCreateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) {
  5828. gensupport.SetOptions(c.urlParams_, opts...)
  5829. res, err := c.doRequest("json")
  5830. if res != nil && res.StatusCode == http.StatusNotModified {
  5831. if res.Body != nil {
  5832. res.Body.Close()
  5833. }
  5834. return nil, &googleapi.Error{
  5835. Code: res.StatusCode,
  5836. Header: res.Header,
  5837. }
  5838. }
  5839. if err != nil {
  5840. return nil, err
  5841. }
  5842. defer googleapi.CloseBody(res)
  5843. if err := googleapi.CheckResponse(res); err != nil {
  5844. return nil, err
  5845. }
  5846. ret := &AutoscalingPolicy{
  5847. ServerResponse: googleapi.ServerResponse{
  5848. Header: res.Header,
  5849. HTTPStatusCode: res.StatusCode,
  5850. },
  5851. }
  5852. target := &ret
  5853. if err := gensupport.DecodeResponse(target, res); err != nil {
  5854. return nil, err
  5855. }
  5856. return ret, nil
  5857. // {
  5858. // "description": "Creates new autoscaling policy.",
  5859. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies",
  5860. // "httpMethod": "POST",
  5861. // "id": "dataproc.projects.regions.autoscalingPolicies.create",
  5862. // "parameterOrder": [
  5863. // "parent"
  5864. // ],
  5865. // "parameters": {
  5866. // "parent": {
  5867. // "description": "Required. The \"resource name\" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}.",
  5868. // "location": "path",
  5869. // "pattern": "^projects/[^/]+/regions/[^/]+$",
  5870. // "required": true,
  5871. // "type": "string"
  5872. // }
  5873. // },
  5874. // "path": "v1beta2/{+parent}/autoscalingPolicies",
  5875. // "request": {
  5876. // "$ref": "AutoscalingPolicy"
  5877. // },
  5878. // "response": {
  5879. // "$ref": "AutoscalingPolicy"
  5880. // },
  5881. // "scopes": [
  5882. // "https://www.googleapis.com/auth/cloud-platform"
  5883. // ]
  5884. // }
  5885. }
  5886. // method id "dataproc.projects.regions.autoscalingPolicies.delete":
  5887. type ProjectsRegionsAutoscalingPoliciesDeleteCall struct {
  5888. s *Service
  5889. name string
  5890. urlParams_ gensupport.URLParams
  5891. ctx_ context.Context
  5892. header_ http.Header
  5893. }
  5894. // Delete: Deletes an autoscaling policy. It is an error to delete an
  5895. // autoscaling policy that is in use by one or more clusters.
  5896. func (r *ProjectsRegionsAutoscalingPoliciesService) Delete(name string) *ProjectsRegionsAutoscalingPoliciesDeleteCall {
  5897. c := &ProjectsRegionsAutoscalingPoliciesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5898. c.name = name
  5899. return c
  5900. }
  5901. // Fields allows partial responses to be retrieved. See
  5902. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5903. // for more information.
  5904. func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesDeleteCall {
  5905. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5906. return c
  5907. }
  5908. // Context sets the context to be used in this call's Do method. Any
  5909. // pending HTTP request will be aborted if the provided context is
  5910. // canceled.
  5911. func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesDeleteCall {
  5912. c.ctx_ = ctx
  5913. return c
  5914. }
  5915. // Header returns an http.Header that can be modified by the caller to
  5916. // add HTTP headers to the request.
  5917. func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Header() http.Header {
  5918. if c.header_ == nil {
  5919. c.header_ = make(http.Header)
  5920. }
  5921. return c.header_
  5922. }
  5923. func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) doRequest(alt string) (*http.Response, error) {
  5924. reqHeaders := make(http.Header)
  5925. for k, v := range c.header_ {
  5926. reqHeaders[k] = v
  5927. }
  5928. reqHeaders.Set("User-Agent", c.s.userAgent())
  5929. var body io.Reader = nil
  5930. c.urlParams_.Set("alt", alt)
  5931. c.urlParams_.Set("prettyPrint", "false")
  5932. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  5933. urls += "?" + c.urlParams_.Encode()
  5934. req, err := http.NewRequest("DELETE", urls, body)
  5935. if err != nil {
  5936. return nil, err
  5937. }
  5938. req.Header = reqHeaders
  5939. googleapi.Expand(req.URL, map[string]string{
  5940. "name": c.name,
  5941. })
  5942. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5943. }
  5944. // Do executes the "dataproc.projects.regions.autoscalingPolicies.delete" call.
  5945. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  5946. // code is an error. Response headers are in either
  5947. // *Empty.ServerResponse.Header or (if a response was returned at all)
  5948. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5949. // check whether the returned error was because http.StatusNotModified
  5950. // was returned.
  5951. func (c *ProjectsRegionsAutoscalingPoliciesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  5952. gensupport.SetOptions(c.urlParams_, opts...)
  5953. res, err := c.doRequest("json")
  5954. if res != nil && res.StatusCode == http.StatusNotModified {
  5955. if res.Body != nil {
  5956. res.Body.Close()
  5957. }
  5958. return nil, &googleapi.Error{
  5959. Code: res.StatusCode,
  5960. Header: res.Header,
  5961. }
  5962. }
  5963. if err != nil {
  5964. return nil, err
  5965. }
  5966. defer googleapi.CloseBody(res)
  5967. if err := googleapi.CheckResponse(res); err != nil {
  5968. return nil, err
  5969. }
  5970. ret := &Empty{
  5971. ServerResponse: googleapi.ServerResponse{
  5972. Header: res.Header,
  5973. HTTPStatusCode: res.StatusCode,
  5974. },
  5975. }
  5976. target := &ret
  5977. if err := gensupport.DecodeResponse(target, res); err != nil {
  5978. return nil, err
  5979. }
  5980. return ret, nil
  5981. // {
  5982. // "description": "Deletes an autoscaling policy. It is an error to delete an autoscaling policy that is in use by one or more clusters.",
  5983. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}",
  5984. // "httpMethod": "DELETE",
  5985. // "id": "dataproc.projects.regions.autoscalingPolicies.delete",
  5986. // "parameterOrder": [
  5987. // "name"
  5988. // ],
  5989. // "parameters": {
  5990. // "name": {
  5991. // "description": "Required. The \"resource name\" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}.",
  5992. // "location": "path",
  5993. // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$",
  5994. // "required": true,
  5995. // "type": "string"
  5996. // }
  5997. // },
  5998. // "path": "v1beta2/{+name}",
  5999. // "response": {
  6000. // "$ref": "Empty"
  6001. // },
  6002. // "scopes": [
  6003. // "https://www.googleapis.com/auth/cloud-platform"
  6004. // ]
  6005. // }
  6006. }
  6007. // method id "dataproc.projects.regions.autoscalingPolicies.get":
  6008. type ProjectsRegionsAutoscalingPoliciesGetCall struct {
  6009. s *Service
  6010. name string
  6011. urlParams_ gensupport.URLParams
  6012. ifNoneMatch_ string
  6013. ctx_ context.Context
  6014. header_ http.Header
  6015. }
  6016. // Get: Retrieves autoscaling policy.
  6017. func (r *ProjectsRegionsAutoscalingPoliciesService) Get(name string) *ProjectsRegionsAutoscalingPoliciesGetCall {
  6018. c := &ProjectsRegionsAutoscalingPoliciesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6019. c.name = name
  6020. return c
  6021. }
  6022. // Fields allows partial responses to be retrieved. See
  6023. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6024. // for more information.
  6025. func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesGetCall {
  6026. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6027. return c
  6028. }
  6029. // IfNoneMatch sets the optional parameter which makes the operation
  6030. // fail if the object's ETag matches the given value. This is useful for
  6031. // getting updates only after the object has changed since the last
  6032. // request. Use googleapi.IsNotModified to check whether the response
  6033. // error from Do is the result of In-None-Match.
  6034. func (c *ProjectsRegionsAutoscalingPoliciesGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsAutoscalingPoliciesGetCall {
  6035. c.ifNoneMatch_ = entityTag
  6036. return c
  6037. }
  6038. // Context sets the context to be used in this call's Do method. Any
  6039. // pending HTTP request will be aborted if the provided context is
  6040. // canceled.
  6041. func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesGetCall {
  6042. c.ctx_ = ctx
  6043. return c
  6044. }
  6045. // Header returns an http.Header that can be modified by the caller to
  6046. // add HTTP headers to the request.
  6047. func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Header() http.Header {
  6048. if c.header_ == nil {
  6049. c.header_ = make(http.Header)
  6050. }
  6051. return c.header_
  6052. }
  6053. func (c *ProjectsRegionsAutoscalingPoliciesGetCall) doRequest(alt string) (*http.Response, error) {
  6054. reqHeaders := make(http.Header)
  6055. for k, v := range c.header_ {
  6056. reqHeaders[k] = v
  6057. }
  6058. reqHeaders.Set("User-Agent", c.s.userAgent())
  6059. if c.ifNoneMatch_ != "" {
  6060. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6061. }
  6062. var body io.Reader = nil
  6063. c.urlParams_.Set("alt", alt)
  6064. c.urlParams_.Set("prettyPrint", "false")
  6065. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  6066. urls += "?" + c.urlParams_.Encode()
  6067. req, err := http.NewRequest("GET", urls, body)
  6068. if err != nil {
  6069. return nil, err
  6070. }
  6071. req.Header = reqHeaders
  6072. googleapi.Expand(req.URL, map[string]string{
  6073. "name": c.name,
  6074. })
  6075. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6076. }
  6077. // Do executes the "dataproc.projects.regions.autoscalingPolicies.get" call.
  6078. // Exactly one of *AutoscalingPolicy or error will be non-nil. Any
  6079. // non-2xx status code is an error. Response headers are in either
  6080. // *AutoscalingPolicy.ServerResponse.Header or (if a response was
  6081. // returned at all) in error.(*googleapi.Error).Header. Use
  6082. // googleapi.IsNotModified to check whether the returned error was
  6083. // because http.StatusNotModified was returned.
  6084. func (c *ProjectsRegionsAutoscalingPoliciesGetCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) {
  6085. gensupport.SetOptions(c.urlParams_, opts...)
  6086. res, err := c.doRequest("json")
  6087. if res != nil && res.StatusCode == http.StatusNotModified {
  6088. if res.Body != nil {
  6089. res.Body.Close()
  6090. }
  6091. return nil, &googleapi.Error{
  6092. Code: res.StatusCode,
  6093. Header: res.Header,
  6094. }
  6095. }
  6096. if err != nil {
  6097. return nil, err
  6098. }
  6099. defer googleapi.CloseBody(res)
  6100. if err := googleapi.CheckResponse(res); err != nil {
  6101. return nil, err
  6102. }
  6103. ret := &AutoscalingPolicy{
  6104. ServerResponse: googleapi.ServerResponse{
  6105. Header: res.Header,
  6106. HTTPStatusCode: res.StatusCode,
  6107. },
  6108. }
  6109. target := &ret
  6110. if err := gensupport.DecodeResponse(target, res); err != nil {
  6111. return nil, err
  6112. }
  6113. return ret, nil
  6114. // {
  6115. // "description": "Retrieves autoscaling policy.",
  6116. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}",
  6117. // "httpMethod": "GET",
  6118. // "id": "dataproc.projects.regions.autoscalingPolicies.get",
  6119. // "parameterOrder": [
  6120. // "name"
  6121. // ],
  6122. // "parameters": {
  6123. // "name": {
  6124. // "description": "Required. The \"resource name\" of the autoscaling policy, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}.",
  6125. // "location": "path",
  6126. // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$",
  6127. // "required": true,
  6128. // "type": "string"
  6129. // }
  6130. // },
  6131. // "path": "v1beta2/{+name}",
  6132. // "response": {
  6133. // "$ref": "AutoscalingPolicy"
  6134. // },
  6135. // "scopes": [
  6136. // "https://www.googleapis.com/auth/cloud-platform"
  6137. // ]
  6138. // }
  6139. }
  6140. // method id "dataproc.projects.regions.autoscalingPolicies.getIamPolicy":
  6141. type ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall struct {
  6142. s *Service
  6143. resource string
  6144. getiampolicyrequest *GetIamPolicyRequest
  6145. urlParams_ gensupport.URLParams
  6146. ctx_ context.Context
  6147. header_ http.Header
  6148. }
  6149. // GetIamPolicy: Gets the access control policy for a resource. Returns
  6150. // an empty policy if the resource exists and does not have a policy
  6151. // set.
  6152. func (r *ProjectsRegionsAutoscalingPoliciesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall {
  6153. c := &ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6154. c.resource = resource
  6155. c.getiampolicyrequest = getiampolicyrequest
  6156. return c
  6157. }
  6158. // Fields allows partial responses to be retrieved. See
  6159. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6160. // for more information.
  6161. func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall {
  6162. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6163. return c
  6164. }
  6165. // Context sets the context to be used in this call's Do method. Any
  6166. // pending HTTP request will be aborted if the provided context is
  6167. // canceled.
  6168. func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall {
  6169. c.ctx_ = ctx
  6170. return c
  6171. }
  6172. // Header returns an http.Header that can be modified by the caller to
  6173. // add HTTP headers to the request.
  6174. func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Header() http.Header {
  6175. if c.header_ == nil {
  6176. c.header_ = make(http.Header)
  6177. }
  6178. return c.header_
  6179. }
  6180. func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  6181. reqHeaders := make(http.Header)
  6182. for k, v := range c.header_ {
  6183. reqHeaders[k] = v
  6184. }
  6185. reqHeaders.Set("User-Agent", c.s.userAgent())
  6186. var body io.Reader = nil
  6187. body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  6188. if err != nil {
  6189. return nil, err
  6190. }
  6191. reqHeaders.Set("Content-Type", "application/json")
  6192. c.urlParams_.Set("alt", alt)
  6193. c.urlParams_.Set("prettyPrint", "false")
  6194. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
  6195. urls += "?" + c.urlParams_.Encode()
  6196. req, err := http.NewRequest("POST", urls, body)
  6197. if err != nil {
  6198. return nil, err
  6199. }
  6200. req.Header = reqHeaders
  6201. googleapi.Expand(req.URL, map[string]string{
  6202. "resource": c.resource,
  6203. })
  6204. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6205. }
  6206. // Do executes the "dataproc.projects.regions.autoscalingPolicies.getIamPolicy" call.
  6207. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  6208. // code is an error. Response headers are in either
  6209. // *Policy.ServerResponse.Header or (if a response was returned at all)
  6210. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6211. // check whether the returned error was because http.StatusNotModified
  6212. // was returned.
  6213. func (c *ProjectsRegionsAutoscalingPoliciesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  6214. gensupport.SetOptions(c.urlParams_, opts...)
  6215. res, err := c.doRequest("json")
  6216. if res != nil && res.StatusCode == http.StatusNotModified {
  6217. if res.Body != nil {
  6218. res.Body.Close()
  6219. }
  6220. return nil, &googleapi.Error{
  6221. Code: res.StatusCode,
  6222. Header: res.Header,
  6223. }
  6224. }
  6225. if err != nil {
  6226. return nil, err
  6227. }
  6228. defer googleapi.CloseBody(res)
  6229. if err := googleapi.CheckResponse(res); err != nil {
  6230. return nil, err
  6231. }
  6232. ret := &Policy{
  6233. ServerResponse: googleapi.ServerResponse{
  6234. Header: res.Header,
  6235. HTTPStatusCode: res.StatusCode,
  6236. },
  6237. }
  6238. target := &ret
  6239. if err := gensupport.DecodeResponse(target, res); err != nil {
  6240. return nil, err
  6241. }
  6242. return ret, nil
  6243. // {
  6244. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  6245. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}:getIamPolicy",
  6246. // "httpMethod": "POST",
  6247. // "id": "dataproc.projects.regions.autoscalingPolicies.getIamPolicy",
  6248. // "parameterOrder": [
  6249. // "resource"
  6250. // ],
  6251. // "parameters": {
  6252. // "resource": {
  6253. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  6254. // "location": "path",
  6255. // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$",
  6256. // "required": true,
  6257. // "type": "string"
  6258. // }
  6259. // },
  6260. // "path": "v1beta2/{+resource}:getIamPolicy",
  6261. // "request": {
  6262. // "$ref": "GetIamPolicyRequest"
  6263. // },
  6264. // "response": {
  6265. // "$ref": "Policy"
  6266. // },
  6267. // "scopes": [
  6268. // "https://www.googleapis.com/auth/cloud-platform"
  6269. // ]
  6270. // }
  6271. }
  6272. // method id "dataproc.projects.regions.autoscalingPolicies.list":
  6273. type ProjectsRegionsAutoscalingPoliciesListCall struct {
  6274. s *Service
  6275. parent string
  6276. urlParams_ gensupport.URLParams
  6277. ifNoneMatch_ string
  6278. ctx_ context.Context
  6279. header_ http.Header
  6280. }
  6281. // List: Lists autoscaling policies in the project.
  6282. func (r *ProjectsRegionsAutoscalingPoliciesService) List(parent string) *ProjectsRegionsAutoscalingPoliciesListCall {
  6283. c := &ProjectsRegionsAutoscalingPoliciesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6284. c.parent = parent
  6285. return c
  6286. }
  6287. // PageSize sets the optional parameter "pageSize": The maximum number
  6288. // of results to return in each response.
  6289. func (c *ProjectsRegionsAutoscalingPoliciesListCall) PageSize(pageSize int64) *ProjectsRegionsAutoscalingPoliciesListCall {
  6290. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6291. return c
  6292. }
  6293. // PageToken sets the optional parameter "pageToken": The page token,
  6294. // returned by a previous call, to request the next page of results.
  6295. func (c *ProjectsRegionsAutoscalingPoliciesListCall) PageToken(pageToken string) *ProjectsRegionsAutoscalingPoliciesListCall {
  6296. c.urlParams_.Set("pageToken", pageToken)
  6297. return c
  6298. }
  6299. // Fields allows partial responses to be retrieved. See
  6300. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6301. // for more information.
  6302. func (c *ProjectsRegionsAutoscalingPoliciesListCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesListCall {
  6303. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6304. return c
  6305. }
  6306. // IfNoneMatch sets the optional parameter which makes the operation
  6307. // fail if the object's ETag matches the given value. This is useful for
  6308. // getting updates only after the object has changed since the last
  6309. // request. Use googleapi.IsNotModified to check whether the response
  6310. // error from Do is the result of In-None-Match.
  6311. func (c *ProjectsRegionsAutoscalingPoliciesListCall) IfNoneMatch(entityTag string) *ProjectsRegionsAutoscalingPoliciesListCall {
  6312. c.ifNoneMatch_ = entityTag
  6313. return c
  6314. }
  6315. // Context sets the context to be used in this call's Do method. Any
  6316. // pending HTTP request will be aborted if the provided context is
  6317. // canceled.
  6318. func (c *ProjectsRegionsAutoscalingPoliciesListCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesListCall {
  6319. c.ctx_ = ctx
  6320. return c
  6321. }
  6322. // Header returns an http.Header that can be modified by the caller to
  6323. // add HTTP headers to the request.
  6324. func (c *ProjectsRegionsAutoscalingPoliciesListCall) Header() http.Header {
  6325. if c.header_ == nil {
  6326. c.header_ = make(http.Header)
  6327. }
  6328. return c.header_
  6329. }
  6330. func (c *ProjectsRegionsAutoscalingPoliciesListCall) doRequest(alt string) (*http.Response, error) {
  6331. reqHeaders := make(http.Header)
  6332. for k, v := range c.header_ {
  6333. reqHeaders[k] = v
  6334. }
  6335. reqHeaders.Set("User-Agent", c.s.userAgent())
  6336. if c.ifNoneMatch_ != "" {
  6337. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6338. }
  6339. var body io.Reader = nil
  6340. c.urlParams_.Set("alt", alt)
  6341. c.urlParams_.Set("prettyPrint", "false")
  6342. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/autoscalingPolicies")
  6343. urls += "?" + c.urlParams_.Encode()
  6344. req, err := http.NewRequest("GET", urls, body)
  6345. if err != nil {
  6346. return nil, err
  6347. }
  6348. req.Header = reqHeaders
  6349. googleapi.Expand(req.URL, map[string]string{
  6350. "parent": c.parent,
  6351. })
  6352. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6353. }
  6354. // Do executes the "dataproc.projects.regions.autoscalingPolicies.list" call.
  6355. // Exactly one of *ListAutoscalingPoliciesResponse or error will be
  6356. // non-nil. Any non-2xx status code is an error. Response headers are in
  6357. // either *ListAutoscalingPoliciesResponse.ServerResponse.Header or (if
  6358. // a response was returned at all) in error.(*googleapi.Error).Header.
  6359. // Use googleapi.IsNotModified to check whether the returned error was
  6360. // because http.StatusNotModified was returned.
  6361. func (c *ProjectsRegionsAutoscalingPoliciesListCall) Do(opts ...googleapi.CallOption) (*ListAutoscalingPoliciesResponse, error) {
  6362. gensupport.SetOptions(c.urlParams_, opts...)
  6363. res, err := c.doRequest("json")
  6364. if res != nil && res.StatusCode == http.StatusNotModified {
  6365. if res.Body != nil {
  6366. res.Body.Close()
  6367. }
  6368. return nil, &googleapi.Error{
  6369. Code: res.StatusCode,
  6370. Header: res.Header,
  6371. }
  6372. }
  6373. if err != nil {
  6374. return nil, err
  6375. }
  6376. defer googleapi.CloseBody(res)
  6377. if err := googleapi.CheckResponse(res); err != nil {
  6378. return nil, err
  6379. }
  6380. ret := &ListAutoscalingPoliciesResponse{
  6381. ServerResponse: googleapi.ServerResponse{
  6382. Header: res.Header,
  6383. HTTPStatusCode: res.StatusCode,
  6384. },
  6385. }
  6386. target := &ret
  6387. if err := gensupport.DecodeResponse(target, res); err != nil {
  6388. return nil, err
  6389. }
  6390. return ret, nil
  6391. // {
  6392. // "description": "Lists autoscaling policies in the project.",
  6393. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies",
  6394. // "httpMethod": "GET",
  6395. // "id": "dataproc.projects.regions.autoscalingPolicies.list",
  6396. // "parameterOrder": [
  6397. // "parent"
  6398. // ],
  6399. // "parameters": {
  6400. // "pageSize": {
  6401. // "description": "Optional. The maximum number of results to return in each response.",
  6402. // "format": "int32",
  6403. // "location": "query",
  6404. // "type": "integer"
  6405. // },
  6406. // "pageToken": {
  6407. // "description": "Optional. The page token, returned by a previous call, to request the next page of results.",
  6408. // "location": "query",
  6409. // "type": "string"
  6410. // },
  6411. // "parent": {
  6412. // "description": "Required. The \"resource name\" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}",
  6413. // "location": "path",
  6414. // "pattern": "^projects/[^/]+/regions/[^/]+$",
  6415. // "required": true,
  6416. // "type": "string"
  6417. // }
  6418. // },
  6419. // "path": "v1beta2/{+parent}/autoscalingPolicies",
  6420. // "response": {
  6421. // "$ref": "ListAutoscalingPoliciesResponse"
  6422. // },
  6423. // "scopes": [
  6424. // "https://www.googleapis.com/auth/cloud-platform"
  6425. // ]
  6426. // }
  6427. }
  6428. // Pages invokes f for each page of results.
  6429. // A non-nil error returned from f will halt the iteration.
  6430. // The provided context supersedes any context provided to the Context method.
  6431. func (c *ProjectsRegionsAutoscalingPoliciesListCall) Pages(ctx context.Context, f func(*ListAutoscalingPoliciesResponse) error) error {
  6432. c.ctx_ = ctx
  6433. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6434. for {
  6435. x, err := c.Do()
  6436. if err != nil {
  6437. return err
  6438. }
  6439. if err := f(x); err != nil {
  6440. return err
  6441. }
  6442. if x.NextPageToken == "" {
  6443. return nil
  6444. }
  6445. c.PageToken(x.NextPageToken)
  6446. }
  6447. }
  6448. // method id "dataproc.projects.regions.autoscalingPolicies.setIamPolicy":
  6449. type ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall struct {
  6450. s *Service
  6451. resource string
  6452. setiampolicyrequest *SetIamPolicyRequest
  6453. urlParams_ gensupport.URLParams
  6454. ctx_ context.Context
  6455. header_ http.Header
  6456. }
  6457. // SetIamPolicy: Sets the access control policy on the specified
  6458. // resource. Replaces any existing policy.
  6459. func (r *ProjectsRegionsAutoscalingPoliciesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall {
  6460. c := &ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6461. c.resource = resource
  6462. c.setiampolicyrequest = setiampolicyrequest
  6463. return c
  6464. }
  6465. // Fields allows partial responses to be retrieved. See
  6466. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6467. // for more information.
  6468. func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall {
  6469. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6470. return c
  6471. }
  6472. // Context sets the context to be used in this call's Do method. Any
  6473. // pending HTTP request will be aborted if the provided context is
  6474. // canceled.
  6475. func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall {
  6476. c.ctx_ = ctx
  6477. return c
  6478. }
  6479. // Header returns an http.Header that can be modified by the caller to
  6480. // add HTTP headers to the request.
  6481. func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Header() http.Header {
  6482. if c.header_ == nil {
  6483. c.header_ = make(http.Header)
  6484. }
  6485. return c.header_
  6486. }
  6487. func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  6488. reqHeaders := make(http.Header)
  6489. for k, v := range c.header_ {
  6490. reqHeaders[k] = v
  6491. }
  6492. reqHeaders.Set("User-Agent", c.s.userAgent())
  6493. var body io.Reader = nil
  6494. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  6495. if err != nil {
  6496. return nil, err
  6497. }
  6498. reqHeaders.Set("Content-Type", "application/json")
  6499. c.urlParams_.Set("alt", alt)
  6500. c.urlParams_.Set("prettyPrint", "false")
  6501. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy")
  6502. urls += "?" + c.urlParams_.Encode()
  6503. req, err := http.NewRequest("POST", urls, body)
  6504. if err != nil {
  6505. return nil, err
  6506. }
  6507. req.Header = reqHeaders
  6508. googleapi.Expand(req.URL, map[string]string{
  6509. "resource": c.resource,
  6510. })
  6511. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6512. }
  6513. // Do executes the "dataproc.projects.regions.autoscalingPolicies.setIamPolicy" call.
  6514. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  6515. // code is an error. Response headers are in either
  6516. // *Policy.ServerResponse.Header or (if a response was returned at all)
  6517. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6518. // check whether the returned error was because http.StatusNotModified
  6519. // was returned.
  6520. func (c *ProjectsRegionsAutoscalingPoliciesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  6521. gensupport.SetOptions(c.urlParams_, opts...)
  6522. res, err := c.doRequest("json")
  6523. if res != nil && res.StatusCode == http.StatusNotModified {
  6524. if res.Body != nil {
  6525. res.Body.Close()
  6526. }
  6527. return nil, &googleapi.Error{
  6528. Code: res.StatusCode,
  6529. Header: res.Header,
  6530. }
  6531. }
  6532. if err != nil {
  6533. return nil, err
  6534. }
  6535. defer googleapi.CloseBody(res)
  6536. if err := googleapi.CheckResponse(res); err != nil {
  6537. return nil, err
  6538. }
  6539. ret := &Policy{
  6540. ServerResponse: googleapi.ServerResponse{
  6541. Header: res.Header,
  6542. HTTPStatusCode: res.StatusCode,
  6543. },
  6544. }
  6545. target := &ret
  6546. if err := gensupport.DecodeResponse(target, res); err != nil {
  6547. return nil, err
  6548. }
  6549. return ret, nil
  6550. // {
  6551. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  6552. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}:setIamPolicy",
  6553. // "httpMethod": "POST",
  6554. // "id": "dataproc.projects.regions.autoscalingPolicies.setIamPolicy",
  6555. // "parameterOrder": [
  6556. // "resource"
  6557. // ],
  6558. // "parameters": {
  6559. // "resource": {
  6560. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  6561. // "location": "path",
  6562. // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$",
  6563. // "required": true,
  6564. // "type": "string"
  6565. // }
  6566. // },
  6567. // "path": "v1beta2/{+resource}:setIamPolicy",
  6568. // "request": {
  6569. // "$ref": "SetIamPolicyRequest"
  6570. // },
  6571. // "response": {
  6572. // "$ref": "Policy"
  6573. // },
  6574. // "scopes": [
  6575. // "https://www.googleapis.com/auth/cloud-platform"
  6576. // ]
  6577. // }
  6578. }
  6579. // method id "dataproc.projects.regions.autoscalingPolicies.testIamPermissions":
  6580. type ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall struct {
  6581. s *Service
  6582. resource string
  6583. testiampermissionsrequest *TestIamPermissionsRequest
  6584. urlParams_ gensupport.URLParams
  6585. ctx_ context.Context
  6586. header_ http.Header
  6587. }
  6588. // TestIamPermissions: Returns permissions that a caller has on the
  6589. // specified resource. If the resource does not exist, this will return
  6590. // an empty set of permissions, not a NOT_FOUND error.Note: This
  6591. // operation is designed to be used for building permission-aware UIs
  6592. // and command-line tools, not for authorization checking. This
  6593. // operation may "fail open" without warning.
  6594. func (r *ProjectsRegionsAutoscalingPoliciesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall {
  6595. c := &ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6596. c.resource = resource
  6597. c.testiampermissionsrequest = testiampermissionsrequest
  6598. return c
  6599. }
  6600. // Fields allows partial responses to be retrieved. See
  6601. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6602. // for more information.
  6603. func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall {
  6604. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6605. return c
  6606. }
  6607. // Context sets the context to be used in this call's Do method. Any
  6608. // pending HTTP request will be aborted if the provided context is
  6609. // canceled.
  6610. func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall {
  6611. c.ctx_ = ctx
  6612. return c
  6613. }
  6614. // Header returns an http.Header that can be modified by the caller to
  6615. // add HTTP headers to the request.
  6616. func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Header() http.Header {
  6617. if c.header_ == nil {
  6618. c.header_ = make(http.Header)
  6619. }
  6620. return c.header_
  6621. }
  6622. func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  6623. reqHeaders := make(http.Header)
  6624. for k, v := range c.header_ {
  6625. reqHeaders[k] = v
  6626. }
  6627. reqHeaders.Set("User-Agent", c.s.userAgent())
  6628. var body io.Reader = nil
  6629. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  6630. if err != nil {
  6631. return nil, err
  6632. }
  6633. reqHeaders.Set("Content-Type", "application/json")
  6634. c.urlParams_.Set("alt", alt)
  6635. c.urlParams_.Set("prettyPrint", "false")
  6636. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
  6637. urls += "?" + c.urlParams_.Encode()
  6638. req, err := http.NewRequest("POST", urls, body)
  6639. if err != nil {
  6640. return nil, err
  6641. }
  6642. req.Header = reqHeaders
  6643. googleapi.Expand(req.URL, map[string]string{
  6644. "resource": c.resource,
  6645. })
  6646. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6647. }
  6648. // Do executes the "dataproc.projects.regions.autoscalingPolicies.testIamPermissions" call.
  6649. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  6650. // Any non-2xx status code is an error. Response headers are in either
  6651. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  6652. // was returned at all) in error.(*googleapi.Error).Header. Use
  6653. // googleapi.IsNotModified to check whether the returned error was
  6654. // because http.StatusNotModified was returned.
  6655. func (c *ProjectsRegionsAutoscalingPoliciesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  6656. gensupport.SetOptions(c.urlParams_, opts...)
  6657. res, err := c.doRequest("json")
  6658. if res != nil && res.StatusCode == http.StatusNotModified {
  6659. if res.Body != nil {
  6660. res.Body.Close()
  6661. }
  6662. return nil, &googleapi.Error{
  6663. Code: res.StatusCode,
  6664. Header: res.Header,
  6665. }
  6666. }
  6667. if err != nil {
  6668. return nil, err
  6669. }
  6670. defer googleapi.CloseBody(res)
  6671. if err := googleapi.CheckResponse(res); err != nil {
  6672. return nil, err
  6673. }
  6674. ret := &TestIamPermissionsResponse{
  6675. ServerResponse: googleapi.ServerResponse{
  6676. Header: res.Header,
  6677. HTTPStatusCode: res.StatusCode,
  6678. },
  6679. }
  6680. target := &ret
  6681. if err := gensupport.DecodeResponse(target, res); err != nil {
  6682. return nil, err
  6683. }
  6684. return ret, nil
  6685. // {
  6686. // "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.",
  6687. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}:testIamPermissions",
  6688. // "httpMethod": "POST",
  6689. // "id": "dataproc.projects.regions.autoscalingPolicies.testIamPermissions",
  6690. // "parameterOrder": [
  6691. // "resource"
  6692. // ],
  6693. // "parameters": {
  6694. // "resource": {
  6695. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  6696. // "location": "path",
  6697. // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$",
  6698. // "required": true,
  6699. // "type": "string"
  6700. // }
  6701. // },
  6702. // "path": "v1beta2/{+resource}:testIamPermissions",
  6703. // "request": {
  6704. // "$ref": "TestIamPermissionsRequest"
  6705. // },
  6706. // "response": {
  6707. // "$ref": "TestIamPermissionsResponse"
  6708. // },
  6709. // "scopes": [
  6710. // "https://www.googleapis.com/auth/cloud-platform"
  6711. // ]
  6712. // }
  6713. }
  6714. // method id "dataproc.projects.regions.autoscalingPolicies.update":
  6715. type ProjectsRegionsAutoscalingPoliciesUpdateCall struct {
  6716. s *Service
  6717. name string
  6718. autoscalingpolicy *AutoscalingPolicy
  6719. urlParams_ gensupport.URLParams
  6720. ctx_ context.Context
  6721. header_ http.Header
  6722. }
  6723. // Update: Updates (replaces) autoscaling policy.Disabled check for
  6724. // update_mask, because all updates will be full replacements.
  6725. func (r *ProjectsRegionsAutoscalingPoliciesService) Update(name string, autoscalingpolicy *AutoscalingPolicy) *ProjectsRegionsAutoscalingPoliciesUpdateCall {
  6726. c := &ProjectsRegionsAutoscalingPoliciesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6727. c.name = name
  6728. c.autoscalingpolicy = autoscalingpolicy
  6729. return c
  6730. }
  6731. // Fields allows partial responses to be retrieved. See
  6732. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6733. // for more information.
  6734. func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Fields(s ...googleapi.Field) *ProjectsRegionsAutoscalingPoliciesUpdateCall {
  6735. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6736. return c
  6737. }
  6738. // Context sets the context to be used in this call's Do method. Any
  6739. // pending HTTP request will be aborted if the provided context is
  6740. // canceled.
  6741. func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Context(ctx context.Context) *ProjectsRegionsAutoscalingPoliciesUpdateCall {
  6742. c.ctx_ = ctx
  6743. return c
  6744. }
  6745. // Header returns an http.Header that can be modified by the caller to
  6746. // add HTTP headers to the request.
  6747. func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Header() http.Header {
  6748. if c.header_ == nil {
  6749. c.header_ = make(http.Header)
  6750. }
  6751. return c.header_
  6752. }
  6753. func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) doRequest(alt string) (*http.Response, error) {
  6754. reqHeaders := make(http.Header)
  6755. for k, v := range c.header_ {
  6756. reqHeaders[k] = v
  6757. }
  6758. reqHeaders.Set("User-Agent", c.s.userAgent())
  6759. var body io.Reader = nil
  6760. body, err := googleapi.WithoutDataWrapper.JSONReader(c.autoscalingpolicy)
  6761. if err != nil {
  6762. return nil, err
  6763. }
  6764. reqHeaders.Set("Content-Type", "application/json")
  6765. c.urlParams_.Set("alt", alt)
  6766. c.urlParams_.Set("prettyPrint", "false")
  6767. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  6768. urls += "?" + c.urlParams_.Encode()
  6769. req, err := http.NewRequest("PUT", urls, body)
  6770. if err != nil {
  6771. return nil, err
  6772. }
  6773. req.Header = reqHeaders
  6774. googleapi.Expand(req.URL, map[string]string{
  6775. "name": c.name,
  6776. })
  6777. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6778. }
  6779. // Do executes the "dataproc.projects.regions.autoscalingPolicies.update" call.
  6780. // Exactly one of *AutoscalingPolicy or error will be non-nil. Any
  6781. // non-2xx status code is an error. Response headers are in either
  6782. // *AutoscalingPolicy.ServerResponse.Header or (if a response was
  6783. // returned at all) in error.(*googleapi.Error).Header. Use
  6784. // googleapi.IsNotModified to check whether the returned error was
  6785. // because http.StatusNotModified was returned.
  6786. func (c *ProjectsRegionsAutoscalingPoliciesUpdateCall) Do(opts ...googleapi.CallOption) (*AutoscalingPolicy, error) {
  6787. gensupport.SetOptions(c.urlParams_, opts...)
  6788. res, err := c.doRequest("json")
  6789. if res != nil && res.StatusCode == http.StatusNotModified {
  6790. if res.Body != nil {
  6791. res.Body.Close()
  6792. }
  6793. return nil, &googleapi.Error{
  6794. Code: res.StatusCode,
  6795. Header: res.Header,
  6796. }
  6797. }
  6798. if err != nil {
  6799. return nil, err
  6800. }
  6801. defer googleapi.CloseBody(res)
  6802. if err := googleapi.CheckResponse(res); err != nil {
  6803. return nil, err
  6804. }
  6805. ret := &AutoscalingPolicy{
  6806. ServerResponse: googleapi.ServerResponse{
  6807. Header: res.Header,
  6808. HTTPStatusCode: res.StatusCode,
  6809. },
  6810. }
  6811. target := &ret
  6812. if err := gensupport.DecodeResponse(target, res); err != nil {
  6813. return nil, err
  6814. }
  6815. return ret, nil
  6816. // {
  6817. // "description": "Updates (replaces) autoscaling policy.Disabled check for update_mask, because all updates will be full replacements.",
  6818. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/autoscalingPolicies/{autoscalingPoliciesId}",
  6819. // "httpMethod": "PUT",
  6820. // "id": "dataproc.projects.regions.autoscalingPolicies.update",
  6821. // "parameterOrder": [
  6822. // "name"
  6823. // ],
  6824. // "parameters": {
  6825. // "name": {
  6826. // "description": "Output only. The \"resource name\" of the policy, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/autoscalingPolicies/{policy_id}.",
  6827. // "location": "path",
  6828. // "pattern": "^projects/[^/]+/regions/[^/]+/autoscalingPolicies/[^/]+$",
  6829. // "required": true,
  6830. // "type": "string"
  6831. // }
  6832. // },
  6833. // "path": "v1beta2/{+name}",
  6834. // "request": {
  6835. // "$ref": "AutoscalingPolicy"
  6836. // },
  6837. // "response": {
  6838. // "$ref": "AutoscalingPolicy"
  6839. // },
  6840. // "scopes": [
  6841. // "https://www.googleapis.com/auth/cloud-platform"
  6842. // ]
  6843. // }
  6844. }
  6845. // method id "dataproc.projects.regions.clusters.create":
  6846. type ProjectsRegionsClustersCreateCall struct {
  6847. s *Service
  6848. projectId string
  6849. region string
  6850. cluster *Cluster
  6851. urlParams_ gensupport.URLParams
  6852. ctx_ context.Context
  6853. header_ http.Header
  6854. }
  6855. // Create: Creates a cluster in a project.
  6856. func (r *ProjectsRegionsClustersService) Create(projectId string, region string, cluster *Cluster) *ProjectsRegionsClustersCreateCall {
  6857. c := &ProjectsRegionsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6858. c.projectId = projectId
  6859. c.region = region
  6860. c.cluster = cluster
  6861. return c
  6862. }
  6863. // RequestId sets the optional parameter "requestId": A unique id used
  6864. // to identify the request. If the server receives two
  6865. // CreateClusterRequest requests with the same id, then the second
  6866. // request will be ignored and the first google.longrunning.Operation
  6867. // created and stored in the backend is returned.It is recommended to
  6868. // always set this value to a UUID
  6869. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id
  6870. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  6871. // and hyphens (-). The maximum length is 40 characters.
  6872. func (c *ProjectsRegionsClustersCreateCall) RequestId(requestId string) *ProjectsRegionsClustersCreateCall {
  6873. c.urlParams_.Set("requestId", requestId)
  6874. return c
  6875. }
  6876. // Fields allows partial responses to be retrieved. See
  6877. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6878. // for more information.
  6879. func (c *ProjectsRegionsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersCreateCall {
  6880. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6881. return c
  6882. }
  6883. // Context sets the context to be used in this call's Do method. Any
  6884. // pending HTTP request will be aborted if the provided context is
  6885. // canceled.
  6886. func (c *ProjectsRegionsClustersCreateCall) Context(ctx context.Context) *ProjectsRegionsClustersCreateCall {
  6887. c.ctx_ = ctx
  6888. return c
  6889. }
  6890. // Header returns an http.Header that can be modified by the caller to
  6891. // add HTTP headers to the request.
  6892. func (c *ProjectsRegionsClustersCreateCall) Header() http.Header {
  6893. if c.header_ == nil {
  6894. c.header_ = make(http.Header)
  6895. }
  6896. return c.header_
  6897. }
  6898. func (c *ProjectsRegionsClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  6899. reqHeaders := make(http.Header)
  6900. for k, v := range c.header_ {
  6901. reqHeaders[k] = v
  6902. }
  6903. reqHeaders.Set("User-Agent", c.s.userAgent())
  6904. var body io.Reader = nil
  6905. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster)
  6906. if err != nil {
  6907. return nil, err
  6908. }
  6909. reqHeaders.Set("Content-Type", "application/json")
  6910. c.urlParams_.Set("alt", alt)
  6911. c.urlParams_.Set("prettyPrint", "false")
  6912. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters")
  6913. urls += "?" + c.urlParams_.Encode()
  6914. req, err := http.NewRequest("POST", urls, body)
  6915. if err != nil {
  6916. return nil, err
  6917. }
  6918. req.Header = reqHeaders
  6919. googleapi.Expand(req.URL, map[string]string{
  6920. "projectId": c.projectId,
  6921. "region": c.region,
  6922. })
  6923. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6924. }
  6925. // Do executes the "dataproc.projects.regions.clusters.create" call.
  6926. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  6927. // status code is an error. Response headers are in either
  6928. // *Operation.ServerResponse.Header or (if a response was returned at
  6929. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  6930. // to check whether the returned error was because
  6931. // http.StatusNotModified was returned.
  6932. func (c *ProjectsRegionsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  6933. gensupport.SetOptions(c.urlParams_, opts...)
  6934. res, err := c.doRequest("json")
  6935. if res != nil && res.StatusCode == http.StatusNotModified {
  6936. if res.Body != nil {
  6937. res.Body.Close()
  6938. }
  6939. return nil, &googleapi.Error{
  6940. Code: res.StatusCode,
  6941. Header: res.Header,
  6942. }
  6943. }
  6944. if err != nil {
  6945. return nil, err
  6946. }
  6947. defer googleapi.CloseBody(res)
  6948. if err := googleapi.CheckResponse(res); err != nil {
  6949. return nil, err
  6950. }
  6951. ret := &Operation{
  6952. ServerResponse: googleapi.ServerResponse{
  6953. Header: res.Header,
  6954. HTTPStatusCode: res.StatusCode,
  6955. },
  6956. }
  6957. target := &ret
  6958. if err := gensupport.DecodeResponse(target, res); err != nil {
  6959. return nil, err
  6960. }
  6961. return ret, nil
  6962. // {
  6963. // "description": "Creates a cluster in a project.",
  6964. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters",
  6965. // "httpMethod": "POST",
  6966. // "id": "dataproc.projects.regions.clusters.create",
  6967. // "parameterOrder": [
  6968. // "projectId",
  6969. // "region"
  6970. // ],
  6971. // "parameters": {
  6972. // "projectId": {
  6973. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  6974. // "location": "path",
  6975. // "required": true,
  6976. // "type": "string"
  6977. // },
  6978. // "region": {
  6979. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  6980. // "location": "path",
  6981. // "required": true,
  6982. // "type": "string"
  6983. // },
  6984. // "requestId": {
  6985. // "description": "Optional. A unique id used to identify the request. If the server receives two CreateClusterRequest requests 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.",
  6986. // "location": "query",
  6987. // "type": "string"
  6988. // }
  6989. // },
  6990. // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters",
  6991. // "request": {
  6992. // "$ref": "Cluster"
  6993. // },
  6994. // "response": {
  6995. // "$ref": "Operation"
  6996. // },
  6997. // "scopes": [
  6998. // "https://www.googleapis.com/auth/cloud-platform"
  6999. // ]
  7000. // }
  7001. }
  7002. // method id "dataproc.projects.regions.clusters.delete":
  7003. type ProjectsRegionsClustersDeleteCall struct {
  7004. s *Service
  7005. projectId string
  7006. region string
  7007. clusterName string
  7008. urlParams_ gensupport.URLParams
  7009. ctx_ context.Context
  7010. header_ http.Header
  7011. }
  7012. // Delete: Deletes a cluster in a project.
  7013. func (r *ProjectsRegionsClustersService) Delete(projectId string, region string, clusterName string) *ProjectsRegionsClustersDeleteCall {
  7014. c := &ProjectsRegionsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7015. c.projectId = projectId
  7016. c.region = region
  7017. c.clusterName = clusterName
  7018. return c
  7019. }
  7020. // ClusterUuid sets the optional parameter "clusterUuid": Specifying the
  7021. // cluster_uuid means the RPC should fail (with error NOT_FOUND) if
  7022. // cluster with specified UUID does not exist.
  7023. func (c *ProjectsRegionsClustersDeleteCall) ClusterUuid(clusterUuid string) *ProjectsRegionsClustersDeleteCall {
  7024. c.urlParams_.Set("clusterUuid", clusterUuid)
  7025. return c
  7026. }
  7027. // RequestId sets the optional parameter "requestId": A unique id used
  7028. // to identify the request. If the server receives two
  7029. // DeleteClusterRequest requests with the same id, then the second
  7030. // request will be ignored and the first google.longrunning.Operation
  7031. // created and stored in the backend is returned.It is recommended to
  7032. // always set this value to a UUID
  7033. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id
  7034. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  7035. // and hyphens (-). The maximum length is 40 characters.
  7036. func (c *ProjectsRegionsClustersDeleteCall) RequestId(requestId string) *ProjectsRegionsClustersDeleteCall {
  7037. c.urlParams_.Set("requestId", requestId)
  7038. return c
  7039. }
  7040. // Fields allows partial responses to be retrieved. See
  7041. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7042. // for more information.
  7043. func (c *ProjectsRegionsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersDeleteCall {
  7044. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7045. return c
  7046. }
  7047. // Context sets the context to be used in this call's Do method. Any
  7048. // pending HTTP request will be aborted if the provided context is
  7049. // canceled.
  7050. func (c *ProjectsRegionsClustersDeleteCall) Context(ctx context.Context) *ProjectsRegionsClustersDeleteCall {
  7051. c.ctx_ = ctx
  7052. return c
  7053. }
  7054. // Header returns an http.Header that can be modified by the caller to
  7055. // add HTTP headers to the request.
  7056. func (c *ProjectsRegionsClustersDeleteCall) Header() http.Header {
  7057. if c.header_ == nil {
  7058. c.header_ = make(http.Header)
  7059. }
  7060. return c.header_
  7061. }
  7062. func (c *ProjectsRegionsClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  7063. reqHeaders := make(http.Header)
  7064. for k, v := range c.header_ {
  7065. reqHeaders[k] = v
  7066. }
  7067. reqHeaders.Set("User-Agent", c.s.userAgent())
  7068. var body io.Reader = nil
  7069. c.urlParams_.Set("alt", alt)
  7070. c.urlParams_.Set("prettyPrint", "false")
  7071. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}")
  7072. urls += "?" + c.urlParams_.Encode()
  7073. req, err := http.NewRequest("DELETE", urls, body)
  7074. if err != nil {
  7075. return nil, err
  7076. }
  7077. req.Header = reqHeaders
  7078. googleapi.Expand(req.URL, map[string]string{
  7079. "projectId": c.projectId,
  7080. "region": c.region,
  7081. "clusterName": c.clusterName,
  7082. })
  7083. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7084. }
  7085. // Do executes the "dataproc.projects.regions.clusters.delete" call.
  7086. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7087. // status code is an error. Response headers are in either
  7088. // *Operation.ServerResponse.Header or (if a response was returned at
  7089. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7090. // to check whether the returned error was because
  7091. // http.StatusNotModified was returned.
  7092. func (c *ProjectsRegionsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7093. gensupport.SetOptions(c.urlParams_, opts...)
  7094. res, err := c.doRequest("json")
  7095. if res != nil && res.StatusCode == http.StatusNotModified {
  7096. if res.Body != nil {
  7097. res.Body.Close()
  7098. }
  7099. return nil, &googleapi.Error{
  7100. Code: res.StatusCode,
  7101. Header: res.Header,
  7102. }
  7103. }
  7104. if err != nil {
  7105. return nil, err
  7106. }
  7107. defer googleapi.CloseBody(res)
  7108. if err := googleapi.CheckResponse(res); err != nil {
  7109. return nil, err
  7110. }
  7111. ret := &Operation{
  7112. ServerResponse: googleapi.ServerResponse{
  7113. Header: res.Header,
  7114. HTTPStatusCode: res.StatusCode,
  7115. },
  7116. }
  7117. target := &ret
  7118. if err := gensupport.DecodeResponse(target, res); err != nil {
  7119. return nil, err
  7120. }
  7121. return ret, nil
  7122. // {
  7123. // "description": "Deletes a cluster in a project.",
  7124. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  7125. // "httpMethod": "DELETE",
  7126. // "id": "dataproc.projects.regions.clusters.delete",
  7127. // "parameterOrder": [
  7128. // "projectId",
  7129. // "region",
  7130. // "clusterName"
  7131. // ],
  7132. // "parameters": {
  7133. // "clusterName": {
  7134. // "description": "Required. The cluster name.",
  7135. // "location": "path",
  7136. // "required": true,
  7137. // "type": "string"
  7138. // },
  7139. // "clusterUuid": {
  7140. // "description": "Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist.",
  7141. // "location": "query",
  7142. // "type": "string"
  7143. // },
  7144. // "projectId": {
  7145. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  7146. // "location": "path",
  7147. // "required": true,
  7148. // "type": "string"
  7149. // },
  7150. // "region": {
  7151. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  7152. // "location": "path",
  7153. // "required": true,
  7154. // "type": "string"
  7155. // },
  7156. // "requestId": {
  7157. // "description": "Optional. A unique id used to identify the request. If the server receives two DeleteClusterRequest requests 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.",
  7158. // "location": "query",
  7159. // "type": "string"
  7160. // }
  7161. // },
  7162. // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  7163. // "response": {
  7164. // "$ref": "Operation"
  7165. // },
  7166. // "scopes": [
  7167. // "https://www.googleapis.com/auth/cloud-platform"
  7168. // ]
  7169. // }
  7170. }
  7171. // method id "dataproc.projects.regions.clusters.diagnose":
  7172. type ProjectsRegionsClustersDiagnoseCall struct {
  7173. s *Service
  7174. projectId string
  7175. region string
  7176. clusterName string
  7177. diagnoseclusterrequest *DiagnoseClusterRequest
  7178. urlParams_ gensupport.URLParams
  7179. ctx_ context.Context
  7180. header_ http.Header
  7181. }
  7182. // Diagnose: Gets cluster diagnostic information. After the operation
  7183. // completes, the Operation.response field contains
  7184. // DiagnoseClusterOutputLocation.
  7185. func (r *ProjectsRegionsClustersService) Diagnose(projectId string, region string, clusterName string, diagnoseclusterrequest *DiagnoseClusterRequest) *ProjectsRegionsClustersDiagnoseCall {
  7186. c := &ProjectsRegionsClustersDiagnoseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7187. c.projectId = projectId
  7188. c.region = region
  7189. c.clusterName = clusterName
  7190. c.diagnoseclusterrequest = diagnoseclusterrequest
  7191. return c
  7192. }
  7193. // Fields allows partial responses to be retrieved. See
  7194. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7195. // for more information.
  7196. func (c *ProjectsRegionsClustersDiagnoseCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersDiagnoseCall {
  7197. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7198. return c
  7199. }
  7200. // Context sets the context to be used in this call's Do method. Any
  7201. // pending HTTP request will be aborted if the provided context is
  7202. // canceled.
  7203. func (c *ProjectsRegionsClustersDiagnoseCall) Context(ctx context.Context) *ProjectsRegionsClustersDiagnoseCall {
  7204. c.ctx_ = ctx
  7205. return c
  7206. }
  7207. // Header returns an http.Header that can be modified by the caller to
  7208. // add HTTP headers to the request.
  7209. func (c *ProjectsRegionsClustersDiagnoseCall) Header() http.Header {
  7210. if c.header_ == nil {
  7211. c.header_ = make(http.Header)
  7212. }
  7213. return c.header_
  7214. }
  7215. func (c *ProjectsRegionsClustersDiagnoseCall) doRequest(alt string) (*http.Response, error) {
  7216. reqHeaders := make(http.Header)
  7217. for k, v := range c.header_ {
  7218. reqHeaders[k] = v
  7219. }
  7220. reqHeaders.Set("User-Agent", c.s.userAgent())
  7221. var body io.Reader = nil
  7222. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diagnoseclusterrequest)
  7223. if err != nil {
  7224. return nil, err
  7225. }
  7226. reqHeaders.Set("Content-Type", "application/json")
  7227. c.urlParams_.Set("alt", alt)
  7228. c.urlParams_.Set("prettyPrint", "false")
  7229. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose")
  7230. urls += "?" + c.urlParams_.Encode()
  7231. req, err := http.NewRequest("POST", urls, body)
  7232. if err != nil {
  7233. return nil, err
  7234. }
  7235. req.Header = reqHeaders
  7236. googleapi.Expand(req.URL, map[string]string{
  7237. "projectId": c.projectId,
  7238. "region": c.region,
  7239. "clusterName": c.clusterName,
  7240. })
  7241. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7242. }
  7243. // Do executes the "dataproc.projects.regions.clusters.diagnose" call.
  7244. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7245. // status code is an error. Response headers are in either
  7246. // *Operation.ServerResponse.Header or (if a response was returned at
  7247. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7248. // to check whether the returned error was because
  7249. // http.StatusNotModified was returned.
  7250. func (c *ProjectsRegionsClustersDiagnoseCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7251. gensupport.SetOptions(c.urlParams_, opts...)
  7252. res, err := c.doRequest("json")
  7253. if res != nil && res.StatusCode == http.StatusNotModified {
  7254. if res.Body != nil {
  7255. res.Body.Close()
  7256. }
  7257. return nil, &googleapi.Error{
  7258. Code: res.StatusCode,
  7259. Header: res.Header,
  7260. }
  7261. }
  7262. if err != nil {
  7263. return nil, err
  7264. }
  7265. defer googleapi.CloseBody(res)
  7266. if err := googleapi.CheckResponse(res); err != nil {
  7267. return nil, err
  7268. }
  7269. ret := &Operation{
  7270. ServerResponse: googleapi.ServerResponse{
  7271. Header: res.Header,
  7272. HTTPStatusCode: res.StatusCode,
  7273. },
  7274. }
  7275. target := &ret
  7276. if err := gensupport.DecodeResponse(target, res); err != nil {
  7277. return nil, err
  7278. }
  7279. return ret, nil
  7280. // {
  7281. // "description": "Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation.",
  7282. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose",
  7283. // "httpMethod": "POST",
  7284. // "id": "dataproc.projects.regions.clusters.diagnose",
  7285. // "parameterOrder": [
  7286. // "projectId",
  7287. // "region",
  7288. // "clusterName"
  7289. // ],
  7290. // "parameters": {
  7291. // "clusterName": {
  7292. // "description": "Required. The cluster name.",
  7293. // "location": "path",
  7294. // "required": true,
  7295. // "type": "string"
  7296. // },
  7297. // "projectId": {
  7298. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  7299. // "location": "path",
  7300. // "required": true,
  7301. // "type": "string"
  7302. // },
  7303. // "region": {
  7304. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  7305. // "location": "path",
  7306. // "required": true,
  7307. // "type": "string"
  7308. // }
  7309. // },
  7310. // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose",
  7311. // "request": {
  7312. // "$ref": "DiagnoseClusterRequest"
  7313. // },
  7314. // "response": {
  7315. // "$ref": "Operation"
  7316. // },
  7317. // "scopes": [
  7318. // "https://www.googleapis.com/auth/cloud-platform"
  7319. // ]
  7320. // }
  7321. }
  7322. // method id "dataproc.projects.regions.clusters.get":
  7323. type ProjectsRegionsClustersGetCall struct {
  7324. s *Service
  7325. projectId string
  7326. region string
  7327. clusterName string
  7328. urlParams_ gensupport.URLParams
  7329. ifNoneMatch_ string
  7330. ctx_ context.Context
  7331. header_ http.Header
  7332. }
  7333. // Get: Gets the resource representation for a cluster in a project.
  7334. func (r *ProjectsRegionsClustersService) Get(projectId string, region string, clusterName string) *ProjectsRegionsClustersGetCall {
  7335. c := &ProjectsRegionsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7336. c.projectId = projectId
  7337. c.region = region
  7338. c.clusterName = clusterName
  7339. return c
  7340. }
  7341. // Fields allows partial responses to be retrieved. See
  7342. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7343. // for more information.
  7344. func (c *ProjectsRegionsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersGetCall {
  7345. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7346. return c
  7347. }
  7348. // IfNoneMatch sets the optional parameter which makes the operation
  7349. // fail if the object's ETag matches the given value. This is useful for
  7350. // getting updates only after the object has changed since the last
  7351. // request. Use googleapi.IsNotModified to check whether the response
  7352. // error from Do is the result of In-None-Match.
  7353. func (c *ProjectsRegionsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersGetCall {
  7354. c.ifNoneMatch_ = entityTag
  7355. return c
  7356. }
  7357. // Context sets the context to be used in this call's Do method. Any
  7358. // pending HTTP request will be aborted if the provided context is
  7359. // canceled.
  7360. func (c *ProjectsRegionsClustersGetCall) Context(ctx context.Context) *ProjectsRegionsClustersGetCall {
  7361. c.ctx_ = ctx
  7362. return c
  7363. }
  7364. // Header returns an http.Header that can be modified by the caller to
  7365. // add HTTP headers to the request.
  7366. func (c *ProjectsRegionsClustersGetCall) Header() http.Header {
  7367. if c.header_ == nil {
  7368. c.header_ = make(http.Header)
  7369. }
  7370. return c.header_
  7371. }
  7372. func (c *ProjectsRegionsClustersGetCall) doRequest(alt string) (*http.Response, error) {
  7373. reqHeaders := make(http.Header)
  7374. for k, v := range c.header_ {
  7375. reqHeaders[k] = v
  7376. }
  7377. reqHeaders.Set("User-Agent", c.s.userAgent())
  7378. if c.ifNoneMatch_ != "" {
  7379. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7380. }
  7381. var body io.Reader = nil
  7382. c.urlParams_.Set("alt", alt)
  7383. c.urlParams_.Set("prettyPrint", "false")
  7384. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}")
  7385. urls += "?" + c.urlParams_.Encode()
  7386. req, err := http.NewRequest("GET", urls, body)
  7387. if err != nil {
  7388. return nil, err
  7389. }
  7390. req.Header = reqHeaders
  7391. googleapi.Expand(req.URL, map[string]string{
  7392. "projectId": c.projectId,
  7393. "region": c.region,
  7394. "clusterName": c.clusterName,
  7395. })
  7396. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7397. }
  7398. // Do executes the "dataproc.projects.regions.clusters.get" call.
  7399. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  7400. // code is an error. Response headers are in either
  7401. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  7402. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7403. // check whether the returned error was because http.StatusNotModified
  7404. // was returned.
  7405. func (c *ProjectsRegionsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  7406. gensupport.SetOptions(c.urlParams_, opts...)
  7407. res, err := c.doRequest("json")
  7408. if res != nil && res.StatusCode == http.StatusNotModified {
  7409. if res.Body != nil {
  7410. res.Body.Close()
  7411. }
  7412. return nil, &googleapi.Error{
  7413. Code: res.StatusCode,
  7414. Header: res.Header,
  7415. }
  7416. }
  7417. if err != nil {
  7418. return nil, err
  7419. }
  7420. defer googleapi.CloseBody(res)
  7421. if err := googleapi.CheckResponse(res); err != nil {
  7422. return nil, err
  7423. }
  7424. ret := &Cluster{
  7425. ServerResponse: googleapi.ServerResponse{
  7426. Header: res.Header,
  7427. HTTPStatusCode: res.StatusCode,
  7428. },
  7429. }
  7430. target := &ret
  7431. if err := gensupport.DecodeResponse(target, res); err != nil {
  7432. return nil, err
  7433. }
  7434. return ret, nil
  7435. // {
  7436. // "description": "Gets the resource representation for a cluster in a project.",
  7437. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  7438. // "httpMethod": "GET",
  7439. // "id": "dataproc.projects.regions.clusters.get",
  7440. // "parameterOrder": [
  7441. // "projectId",
  7442. // "region",
  7443. // "clusterName"
  7444. // ],
  7445. // "parameters": {
  7446. // "clusterName": {
  7447. // "description": "Required. The cluster name.",
  7448. // "location": "path",
  7449. // "required": true,
  7450. // "type": "string"
  7451. // },
  7452. // "projectId": {
  7453. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  7454. // "location": "path",
  7455. // "required": true,
  7456. // "type": "string"
  7457. // },
  7458. // "region": {
  7459. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  7460. // "location": "path",
  7461. // "required": true,
  7462. // "type": "string"
  7463. // }
  7464. // },
  7465. // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  7466. // "response": {
  7467. // "$ref": "Cluster"
  7468. // },
  7469. // "scopes": [
  7470. // "https://www.googleapis.com/auth/cloud-platform"
  7471. // ]
  7472. // }
  7473. }
  7474. // method id "dataproc.projects.regions.clusters.getIamPolicy":
  7475. type ProjectsRegionsClustersGetIamPolicyCall struct {
  7476. s *Service
  7477. resource string
  7478. urlParams_ gensupport.URLParams
  7479. ifNoneMatch_ string
  7480. ctx_ context.Context
  7481. header_ http.Header
  7482. }
  7483. // GetIamPolicy: Gets the access control policy for a resource. Returns
  7484. // an empty policy if the resource exists and does not have a policy
  7485. // set.
  7486. func (r *ProjectsRegionsClustersService) GetIamPolicy(resource string) *ProjectsRegionsClustersGetIamPolicyCall {
  7487. c := &ProjectsRegionsClustersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7488. c.resource = resource
  7489. return c
  7490. }
  7491. // Fields allows partial responses to be retrieved. See
  7492. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7493. // for more information.
  7494. func (c *ProjectsRegionsClustersGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersGetIamPolicyCall {
  7495. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7496. return c
  7497. }
  7498. // IfNoneMatch sets the optional parameter which makes the operation
  7499. // fail if the object's ETag matches the given value. This is useful for
  7500. // getting updates only after the object has changed since the last
  7501. // request. Use googleapi.IsNotModified to check whether the response
  7502. // error from Do is the result of In-None-Match.
  7503. func (c *ProjectsRegionsClustersGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersGetIamPolicyCall {
  7504. c.ifNoneMatch_ = entityTag
  7505. return c
  7506. }
  7507. // Context sets the context to be used in this call's Do method. Any
  7508. // pending HTTP request will be aborted if the provided context is
  7509. // canceled.
  7510. func (c *ProjectsRegionsClustersGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsClustersGetIamPolicyCall {
  7511. c.ctx_ = ctx
  7512. return c
  7513. }
  7514. // Header returns an http.Header that can be modified by the caller to
  7515. // add HTTP headers to the request.
  7516. func (c *ProjectsRegionsClustersGetIamPolicyCall) Header() http.Header {
  7517. if c.header_ == nil {
  7518. c.header_ = make(http.Header)
  7519. }
  7520. return c.header_
  7521. }
  7522. func (c *ProjectsRegionsClustersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  7523. reqHeaders := make(http.Header)
  7524. for k, v := range c.header_ {
  7525. reqHeaders[k] = v
  7526. }
  7527. reqHeaders.Set("User-Agent", c.s.userAgent())
  7528. if c.ifNoneMatch_ != "" {
  7529. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7530. }
  7531. var body io.Reader = nil
  7532. c.urlParams_.Set("alt", alt)
  7533. c.urlParams_.Set("prettyPrint", "false")
  7534. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
  7535. urls += "?" + c.urlParams_.Encode()
  7536. req, err := http.NewRequest("GET", urls, body)
  7537. if err != nil {
  7538. return nil, err
  7539. }
  7540. req.Header = reqHeaders
  7541. googleapi.Expand(req.URL, map[string]string{
  7542. "resource": c.resource,
  7543. })
  7544. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7545. }
  7546. // Do executes the "dataproc.projects.regions.clusters.getIamPolicy" call.
  7547. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  7548. // code is an error. Response headers are in either
  7549. // *Policy.ServerResponse.Header or (if a response was returned at all)
  7550. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7551. // check whether the returned error was because http.StatusNotModified
  7552. // was returned.
  7553. func (c *ProjectsRegionsClustersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  7554. gensupport.SetOptions(c.urlParams_, opts...)
  7555. res, err := c.doRequest("json")
  7556. if res != nil && res.StatusCode == http.StatusNotModified {
  7557. if res.Body != nil {
  7558. res.Body.Close()
  7559. }
  7560. return nil, &googleapi.Error{
  7561. Code: res.StatusCode,
  7562. Header: res.Header,
  7563. }
  7564. }
  7565. if err != nil {
  7566. return nil, err
  7567. }
  7568. defer googleapi.CloseBody(res)
  7569. if err := googleapi.CheckResponse(res); err != nil {
  7570. return nil, err
  7571. }
  7572. ret := &Policy{
  7573. ServerResponse: googleapi.ServerResponse{
  7574. Header: res.Header,
  7575. HTTPStatusCode: res.StatusCode,
  7576. },
  7577. }
  7578. target := &ret
  7579. if err := gensupport.DecodeResponse(target, res); err != nil {
  7580. return nil, err
  7581. }
  7582. return ret, nil
  7583. // {
  7584. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  7585. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:getIamPolicy",
  7586. // "httpMethod": "GET",
  7587. // "id": "dataproc.projects.regions.clusters.getIamPolicy",
  7588. // "parameterOrder": [
  7589. // "resource"
  7590. // ],
  7591. // "parameters": {
  7592. // "resource": {
  7593. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  7594. // "location": "path",
  7595. // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$",
  7596. // "required": true,
  7597. // "type": "string"
  7598. // }
  7599. // },
  7600. // "path": "v1beta2/{+resource}:getIamPolicy",
  7601. // "response": {
  7602. // "$ref": "Policy"
  7603. // },
  7604. // "scopes": [
  7605. // "https://www.googleapis.com/auth/cloud-platform"
  7606. // ]
  7607. // }
  7608. }
  7609. // method id "dataproc.projects.regions.clusters.list":
  7610. type ProjectsRegionsClustersListCall struct {
  7611. s *Service
  7612. projectId string
  7613. region string
  7614. urlParams_ gensupport.URLParams
  7615. ifNoneMatch_ string
  7616. ctx_ context.Context
  7617. header_ http.Header
  7618. }
  7619. // List: Lists all regions/{region}/clusters in a project.
  7620. func (r *ProjectsRegionsClustersService) List(projectId string, region string) *ProjectsRegionsClustersListCall {
  7621. c := &ProjectsRegionsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7622. c.projectId = projectId
  7623. c.region = region
  7624. return c
  7625. }
  7626. // Filter sets the optional parameter "filter": A filter constraining
  7627. // the clusters to list. Filters are case-sensitive and have the
  7628. // following syntax:field = value AND field = value ...where field is
  7629. // one of status.state, clusterName, or labels.[KEY], and [KEY] is a
  7630. // label key. value can be * to match all values. status.state can be
  7631. // one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR,
  7632. // DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and
  7633. // RUNNING states. INACTIVE contains the DELETING and ERROR states.
  7634. // clusterName is the name of the cluster provided at creation time.
  7635. // Only the logical AND operator is supported; space-separated items are
  7636. // treated as having an implicit AND operator.Example
  7637. // filter:status.state = ACTIVE AND clusterName = mycluster AND
  7638. // labels.env = staging AND labels.starred = *
  7639. func (c *ProjectsRegionsClustersListCall) Filter(filter string) *ProjectsRegionsClustersListCall {
  7640. c.urlParams_.Set("filter", filter)
  7641. return c
  7642. }
  7643. // PageSize sets the optional parameter "pageSize": The standard List
  7644. // page size.
  7645. func (c *ProjectsRegionsClustersListCall) PageSize(pageSize int64) *ProjectsRegionsClustersListCall {
  7646. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7647. return c
  7648. }
  7649. // PageToken sets the optional parameter "pageToken": The standard List
  7650. // page token.
  7651. func (c *ProjectsRegionsClustersListCall) PageToken(pageToken string) *ProjectsRegionsClustersListCall {
  7652. c.urlParams_.Set("pageToken", pageToken)
  7653. return c
  7654. }
  7655. // Fields allows partial responses to be retrieved. See
  7656. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7657. // for more information.
  7658. func (c *ProjectsRegionsClustersListCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersListCall {
  7659. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7660. return c
  7661. }
  7662. // IfNoneMatch sets the optional parameter which makes the operation
  7663. // fail if the object's ETag matches the given value. This is useful for
  7664. // getting updates only after the object has changed since the last
  7665. // request. Use googleapi.IsNotModified to check whether the response
  7666. // error from Do is the result of In-None-Match.
  7667. func (c *ProjectsRegionsClustersListCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersListCall {
  7668. c.ifNoneMatch_ = entityTag
  7669. return c
  7670. }
  7671. // Context sets the context to be used in this call's Do method. Any
  7672. // pending HTTP request will be aborted if the provided context is
  7673. // canceled.
  7674. func (c *ProjectsRegionsClustersListCall) Context(ctx context.Context) *ProjectsRegionsClustersListCall {
  7675. c.ctx_ = ctx
  7676. return c
  7677. }
  7678. // Header returns an http.Header that can be modified by the caller to
  7679. // add HTTP headers to the request.
  7680. func (c *ProjectsRegionsClustersListCall) Header() http.Header {
  7681. if c.header_ == nil {
  7682. c.header_ = make(http.Header)
  7683. }
  7684. return c.header_
  7685. }
  7686. func (c *ProjectsRegionsClustersListCall) doRequest(alt string) (*http.Response, error) {
  7687. reqHeaders := make(http.Header)
  7688. for k, v := range c.header_ {
  7689. reqHeaders[k] = v
  7690. }
  7691. reqHeaders.Set("User-Agent", c.s.userAgent())
  7692. if c.ifNoneMatch_ != "" {
  7693. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7694. }
  7695. var body io.Reader = nil
  7696. c.urlParams_.Set("alt", alt)
  7697. c.urlParams_.Set("prettyPrint", "false")
  7698. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters")
  7699. urls += "?" + c.urlParams_.Encode()
  7700. req, err := http.NewRequest("GET", urls, body)
  7701. if err != nil {
  7702. return nil, err
  7703. }
  7704. req.Header = reqHeaders
  7705. googleapi.Expand(req.URL, map[string]string{
  7706. "projectId": c.projectId,
  7707. "region": c.region,
  7708. })
  7709. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7710. }
  7711. // Do executes the "dataproc.projects.regions.clusters.list" call.
  7712. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  7713. // non-2xx status code is an error. Response headers are in either
  7714. // *ListClustersResponse.ServerResponse.Header or (if a response was
  7715. // returned at all) in error.(*googleapi.Error).Header. Use
  7716. // googleapi.IsNotModified to check whether the returned error was
  7717. // because http.StatusNotModified was returned.
  7718. func (c *ProjectsRegionsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  7719. gensupport.SetOptions(c.urlParams_, opts...)
  7720. res, err := c.doRequest("json")
  7721. if res != nil && res.StatusCode == http.StatusNotModified {
  7722. if res.Body != nil {
  7723. res.Body.Close()
  7724. }
  7725. return nil, &googleapi.Error{
  7726. Code: res.StatusCode,
  7727. Header: res.Header,
  7728. }
  7729. }
  7730. if err != nil {
  7731. return nil, err
  7732. }
  7733. defer googleapi.CloseBody(res)
  7734. if err := googleapi.CheckResponse(res); err != nil {
  7735. return nil, err
  7736. }
  7737. ret := &ListClustersResponse{
  7738. ServerResponse: googleapi.ServerResponse{
  7739. Header: res.Header,
  7740. HTTPStatusCode: res.StatusCode,
  7741. },
  7742. }
  7743. target := &ret
  7744. if err := gensupport.DecodeResponse(target, res); err != nil {
  7745. return nil, err
  7746. }
  7747. return ret, nil
  7748. // {
  7749. // "description": "Lists all regions/{region}/clusters in a project.",
  7750. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters",
  7751. // "httpMethod": "GET",
  7752. // "id": "dataproc.projects.regions.clusters.list",
  7753. // "parameterOrder": [
  7754. // "projectId",
  7755. // "region"
  7756. // ],
  7757. // "parameters": {
  7758. // "filter": {
  7759. // "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 = *",
  7760. // "location": "query",
  7761. // "type": "string"
  7762. // },
  7763. // "pageSize": {
  7764. // "description": "Optional. The standard List page size.",
  7765. // "format": "int32",
  7766. // "location": "query",
  7767. // "type": "integer"
  7768. // },
  7769. // "pageToken": {
  7770. // "description": "Optional. The standard List page token.",
  7771. // "location": "query",
  7772. // "type": "string"
  7773. // },
  7774. // "projectId": {
  7775. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  7776. // "location": "path",
  7777. // "required": true,
  7778. // "type": "string"
  7779. // },
  7780. // "region": {
  7781. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  7782. // "location": "path",
  7783. // "required": true,
  7784. // "type": "string"
  7785. // }
  7786. // },
  7787. // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters",
  7788. // "response": {
  7789. // "$ref": "ListClustersResponse"
  7790. // },
  7791. // "scopes": [
  7792. // "https://www.googleapis.com/auth/cloud-platform"
  7793. // ]
  7794. // }
  7795. }
  7796. // Pages invokes f for each page of results.
  7797. // A non-nil error returned from f will halt the iteration.
  7798. // The provided context supersedes any context provided to the Context method.
  7799. func (c *ProjectsRegionsClustersListCall) Pages(ctx context.Context, f func(*ListClustersResponse) error) error {
  7800. c.ctx_ = ctx
  7801. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7802. for {
  7803. x, err := c.Do()
  7804. if err != nil {
  7805. return err
  7806. }
  7807. if err := f(x); err != nil {
  7808. return err
  7809. }
  7810. if x.NextPageToken == "" {
  7811. return nil
  7812. }
  7813. c.PageToken(x.NextPageToken)
  7814. }
  7815. }
  7816. // method id "dataproc.projects.regions.clusters.patch":
  7817. type ProjectsRegionsClustersPatchCall struct {
  7818. s *Service
  7819. projectId string
  7820. region string
  7821. clusterName string
  7822. cluster *Cluster
  7823. urlParams_ gensupport.URLParams
  7824. ctx_ context.Context
  7825. header_ http.Header
  7826. }
  7827. // Patch: Updates a cluster in a project.
  7828. func (r *ProjectsRegionsClustersService) Patch(projectId string, region string, clusterName string, cluster *Cluster) *ProjectsRegionsClustersPatchCall {
  7829. c := &ProjectsRegionsClustersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7830. c.projectId = projectId
  7831. c.region = region
  7832. c.clusterName = clusterName
  7833. c.cluster = cluster
  7834. return c
  7835. }
  7836. // GracefulDecommissionTimeout sets the optional parameter
  7837. // "gracefulDecommissionTimeout": Timeout for graceful YARN
  7838. // decomissioning. Graceful decommissioning allows removing nodes from
  7839. // the cluster without interrupting jobs in progress. Timeout specifies
  7840. // how long to wait for jobs in progress to finish before forcefully
  7841. // removing nodes (and potentially interrupting jobs). Default timeout
  7842. // is 0 (for forceful decommission), and the maximum allowed timeout is
  7843. // 1 day.Only supported on Dataproc image versions 1.2 and higher.
  7844. func (c *ProjectsRegionsClustersPatchCall) GracefulDecommissionTimeout(gracefulDecommissionTimeout string) *ProjectsRegionsClustersPatchCall {
  7845. c.urlParams_.Set("gracefulDecommissionTimeout", gracefulDecommissionTimeout)
  7846. return c
  7847. }
  7848. // RequestId sets the optional parameter "requestId": A unique id used
  7849. // to identify the request. If the server receives two
  7850. // UpdateClusterRequest requests with the same id, then the second
  7851. // request will be ignored and the first google.longrunning.Operation
  7852. // created and stored in the backend is returned.It is recommended to
  7853. // always set this value to a UUID
  7854. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id
  7855. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  7856. // and hyphens (-). The maximum length is 40 characters.
  7857. func (c *ProjectsRegionsClustersPatchCall) RequestId(requestId string) *ProjectsRegionsClustersPatchCall {
  7858. c.urlParams_.Set("requestId", requestId)
  7859. return c
  7860. }
  7861. // UpdateMask sets the optional parameter "updateMask": Required.
  7862. // Specifies the path, relative to Cluster, of the field to update. For
  7863. // example, to change the number of workers in a cluster to 5, the
  7864. // update_mask parameter would be specified as
  7865. // config.worker_config.num_instances, and the PATCH request body would
  7866. // specify the new value, as follows:
  7867. // {
  7868. // "config":{
  7869. // "workerConfig":{
  7870. // "numInstances":"5"
  7871. // }
  7872. // }
  7873. // }
  7874. // Similarly, to change the number of preemptible workers in a cluster
  7875. // to 5, the update_mask parameter would be
  7876. // config.secondary_worker_config.num_instances, and the PATCH request
  7877. // body would be set as follows:
  7878. // {
  7879. // "config":{
  7880. // "secondaryWorkerConfig":{
  7881. // "numInstances":"5"
  7882. // }
  7883. // }
  7884. // }
  7885. // <strong>Note:</strong> currently only the following fields can be
  7886. // updated:
  7887. // <table>
  7888. // <tr>
  7889. // <td><strong>Mask</strong></td><td><strong>Purpos
  7890. // e</strong></td>
  7891. // </tr>
  7892. // <tr>
  7893. // <td>labels</td><td>Updates
  7894. // labels</td>
  7895. // </tr>
  7896. // <tr>
  7897. // <td>config.worker_config.num_instances</td><td>
  7898. // Resize primary worker
  7899. // group</td>
  7900. // </tr>
  7901. // <tr>
  7902. // <td>config.secondary_worker_config.num_instances
  7903. // </td><td>Resize secondary worker
  7904. // group</td>
  7905. // </tr>
  7906. // <tr>
  7907. // <td>config.lifecycle_config.auto_delete_ttl</td>
  7908. // <td>Reset MAX TTL
  7909. // duration</td>
  7910. // </tr>
  7911. // <tr>
  7912. // <td>config.lifecycle_config.auto_delete_time<
  7913. // /td><td>Update MAX TTL deletion
  7914. // timestamp</td>
  7915. // </tr>
  7916. // <tr>
  7917. // <td>config.lifecycle_config.idle_delete_ttl<
  7918. // /td><td>Update Idle TTL
  7919. // duration</td>
  7920. // </tr>
  7921. // <tr>
  7922. // <td>config.autoscaling_config.policy_uri</td>
  7923. // <td>Use, stop using, or change autoscaling
  7924. // policies</td>
  7925. // </tr>
  7926. // </table>
  7927. func (c *ProjectsRegionsClustersPatchCall) UpdateMask(updateMask string) *ProjectsRegionsClustersPatchCall {
  7928. c.urlParams_.Set("updateMask", updateMask)
  7929. return c
  7930. }
  7931. // Fields allows partial responses to be retrieved. See
  7932. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7933. // for more information.
  7934. func (c *ProjectsRegionsClustersPatchCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersPatchCall {
  7935. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7936. return c
  7937. }
  7938. // Context sets the context to be used in this call's Do method. Any
  7939. // pending HTTP request will be aborted if the provided context is
  7940. // canceled.
  7941. func (c *ProjectsRegionsClustersPatchCall) Context(ctx context.Context) *ProjectsRegionsClustersPatchCall {
  7942. c.ctx_ = ctx
  7943. return c
  7944. }
  7945. // Header returns an http.Header that can be modified by the caller to
  7946. // add HTTP headers to the request.
  7947. func (c *ProjectsRegionsClustersPatchCall) Header() http.Header {
  7948. if c.header_ == nil {
  7949. c.header_ = make(http.Header)
  7950. }
  7951. return c.header_
  7952. }
  7953. func (c *ProjectsRegionsClustersPatchCall) doRequest(alt string) (*http.Response, error) {
  7954. reqHeaders := make(http.Header)
  7955. for k, v := range c.header_ {
  7956. reqHeaders[k] = v
  7957. }
  7958. reqHeaders.Set("User-Agent", c.s.userAgent())
  7959. var body io.Reader = nil
  7960. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster)
  7961. if err != nil {
  7962. return nil, err
  7963. }
  7964. reqHeaders.Set("Content-Type", "application/json")
  7965. c.urlParams_.Set("alt", alt)
  7966. c.urlParams_.Set("prettyPrint", "false")
  7967. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}")
  7968. urls += "?" + c.urlParams_.Encode()
  7969. req, err := http.NewRequest("PATCH", urls, body)
  7970. if err != nil {
  7971. return nil, err
  7972. }
  7973. req.Header = reqHeaders
  7974. googleapi.Expand(req.URL, map[string]string{
  7975. "projectId": c.projectId,
  7976. "region": c.region,
  7977. "clusterName": c.clusterName,
  7978. })
  7979. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7980. }
  7981. // Do executes the "dataproc.projects.regions.clusters.patch" call.
  7982. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7983. // status code is an error. Response headers are in either
  7984. // *Operation.ServerResponse.Header or (if a response was returned at
  7985. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7986. // to check whether the returned error was because
  7987. // http.StatusNotModified was returned.
  7988. func (c *ProjectsRegionsClustersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7989. gensupport.SetOptions(c.urlParams_, opts...)
  7990. res, err := c.doRequest("json")
  7991. if res != nil && res.StatusCode == http.StatusNotModified {
  7992. if res.Body != nil {
  7993. res.Body.Close()
  7994. }
  7995. return nil, &googleapi.Error{
  7996. Code: res.StatusCode,
  7997. Header: res.Header,
  7998. }
  7999. }
  8000. if err != nil {
  8001. return nil, err
  8002. }
  8003. defer googleapi.CloseBody(res)
  8004. if err := googleapi.CheckResponse(res); err != nil {
  8005. return nil, err
  8006. }
  8007. ret := &Operation{
  8008. ServerResponse: googleapi.ServerResponse{
  8009. Header: res.Header,
  8010. HTTPStatusCode: res.StatusCode,
  8011. },
  8012. }
  8013. target := &ret
  8014. if err := gensupport.DecodeResponse(target, res); err != nil {
  8015. return nil, err
  8016. }
  8017. return ret, nil
  8018. // {
  8019. // "description": "Updates a cluster in a project.",
  8020. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  8021. // "httpMethod": "PATCH",
  8022. // "id": "dataproc.projects.regions.clusters.patch",
  8023. // "parameterOrder": [
  8024. // "projectId",
  8025. // "region",
  8026. // "clusterName"
  8027. // ],
  8028. // "parameters": {
  8029. // "clusterName": {
  8030. // "description": "Required. The cluster name.",
  8031. // "location": "path",
  8032. // "required": true,
  8033. // "type": "string"
  8034. // },
  8035. // "gracefulDecommissionTimeout": {
  8036. // "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.Only supported on Dataproc image versions 1.2 and higher.",
  8037. // "format": "google-duration",
  8038. // "location": "query",
  8039. // "type": "string"
  8040. // },
  8041. // "projectId": {
  8042. // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.",
  8043. // "location": "path",
  8044. // "required": true,
  8045. // "type": "string"
  8046. // },
  8047. // "region": {
  8048. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  8049. // "location": "path",
  8050. // "required": true,
  8051. // "type": "string"
  8052. // },
  8053. // "requestId": {
  8054. // "description": "Optional. A unique id used to identify the request. If the server receives two UpdateClusterRequest requests 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.",
  8055. // "location": "query",
  8056. // "type": "string"
  8057. // },
  8058. // "updateMask": {
  8059. // "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:\n{\n \"config\":{\n \"workerConfig\":{\n \"numInstances\":\"5\"\n }\n }\n}\nSimilarly, 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:\n{\n \"config\":{\n \"secondaryWorkerConfig\":{\n \"numInstances\":\"5\"\n }\n }\n}\n\u003cstrong\u003eNote:\u003c/strong\u003e currently only the following fields can be updated:\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cstrong\u003eMask\u003c/strong\u003e\u003c/td\u003e\u003ctd\u003e\u003cstrong\u003ePurpose\u003c/strong\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003elabels\u003c/td\u003e\u003ctd\u003eUpdates labels\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003econfig.worker_config.num_instances\u003c/td\u003e\u003ctd\u003eResize primary worker group\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003econfig.secondary_worker_config.num_instances\u003c/td\u003e\u003ctd\u003eResize secondary worker group\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003econfig.lifecycle_config.auto_delete_ttl\u003c/td\u003e\u003ctd\u003eReset MAX TTL duration\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003econfig.lifecycle_config.auto_delete_time\u003c/td\u003e\u003ctd\u003eUpdate MAX TTL deletion timestamp\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003econfig.lifecycle_config.idle_delete_ttl\u003c/td\u003e\u003ctd\u003eUpdate Idle TTL duration\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003econfig.autoscaling_config.policy_uri\u003c/td\u003e\u003ctd\u003eUse, stop using, or change autoscaling policies\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e",
  8060. // "format": "google-fieldmask",
  8061. // "location": "query",
  8062. // "type": "string"
  8063. // }
  8064. // },
  8065. // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  8066. // "request": {
  8067. // "$ref": "Cluster"
  8068. // },
  8069. // "response": {
  8070. // "$ref": "Operation"
  8071. // },
  8072. // "scopes": [
  8073. // "https://www.googleapis.com/auth/cloud-platform"
  8074. // ]
  8075. // }
  8076. }
  8077. // method id "dataproc.projects.regions.clusters.setIamPolicy":
  8078. type ProjectsRegionsClustersSetIamPolicyCall struct {
  8079. s *Service
  8080. resource string
  8081. setiampolicyrequest *SetIamPolicyRequest
  8082. urlParams_ gensupport.URLParams
  8083. ctx_ context.Context
  8084. header_ http.Header
  8085. }
  8086. // SetIamPolicy: Sets the access control policy on the specified
  8087. // resource. Replaces any existing policy.
  8088. func (r *ProjectsRegionsClustersService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsClustersSetIamPolicyCall {
  8089. c := &ProjectsRegionsClustersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8090. c.resource = resource
  8091. c.setiampolicyrequest = setiampolicyrequest
  8092. return c
  8093. }
  8094. // Fields allows partial responses to be retrieved. See
  8095. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8096. // for more information.
  8097. func (c *ProjectsRegionsClustersSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersSetIamPolicyCall {
  8098. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8099. return c
  8100. }
  8101. // Context sets the context to be used in this call's Do method. Any
  8102. // pending HTTP request will be aborted if the provided context is
  8103. // canceled.
  8104. func (c *ProjectsRegionsClustersSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsClustersSetIamPolicyCall {
  8105. c.ctx_ = ctx
  8106. return c
  8107. }
  8108. // Header returns an http.Header that can be modified by the caller to
  8109. // add HTTP headers to the request.
  8110. func (c *ProjectsRegionsClustersSetIamPolicyCall) Header() http.Header {
  8111. if c.header_ == nil {
  8112. c.header_ = make(http.Header)
  8113. }
  8114. return c.header_
  8115. }
  8116. func (c *ProjectsRegionsClustersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  8117. reqHeaders := make(http.Header)
  8118. for k, v := range c.header_ {
  8119. reqHeaders[k] = v
  8120. }
  8121. reqHeaders.Set("User-Agent", c.s.userAgent())
  8122. var body io.Reader = nil
  8123. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  8124. if err != nil {
  8125. return nil, err
  8126. }
  8127. reqHeaders.Set("Content-Type", "application/json")
  8128. c.urlParams_.Set("alt", alt)
  8129. c.urlParams_.Set("prettyPrint", "false")
  8130. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy")
  8131. urls += "?" + c.urlParams_.Encode()
  8132. req, err := http.NewRequest("POST", urls, body)
  8133. if err != nil {
  8134. return nil, err
  8135. }
  8136. req.Header = reqHeaders
  8137. googleapi.Expand(req.URL, map[string]string{
  8138. "resource": c.resource,
  8139. })
  8140. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8141. }
  8142. // Do executes the "dataproc.projects.regions.clusters.setIamPolicy" call.
  8143. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  8144. // code is an error. Response headers are in either
  8145. // *Policy.ServerResponse.Header or (if a response was returned at all)
  8146. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8147. // check whether the returned error was because http.StatusNotModified
  8148. // was returned.
  8149. func (c *ProjectsRegionsClustersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  8150. gensupport.SetOptions(c.urlParams_, opts...)
  8151. res, err := c.doRequest("json")
  8152. if res != nil && res.StatusCode == http.StatusNotModified {
  8153. if res.Body != nil {
  8154. res.Body.Close()
  8155. }
  8156. return nil, &googleapi.Error{
  8157. Code: res.StatusCode,
  8158. Header: res.Header,
  8159. }
  8160. }
  8161. if err != nil {
  8162. return nil, err
  8163. }
  8164. defer googleapi.CloseBody(res)
  8165. if err := googleapi.CheckResponse(res); err != nil {
  8166. return nil, err
  8167. }
  8168. ret := &Policy{
  8169. ServerResponse: googleapi.ServerResponse{
  8170. Header: res.Header,
  8171. HTTPStatusCode: res.StatusCode,
  8172. },
  8173. }
  8174. target := &ret
  8175. if err := gensupport.DecodeResponse(target, res); err != nil {
  8176. return nil, err
  8177. }
  8178. return ret, nil
  8179. // {
  8180. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  8181. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:setIamPolicy",
  8182. // "httpMethod": "POST",
  8183. // "id": "dataproc.projects.regions.clusters.setIamPolicy",
  8184. // "parameterOrder": [
  8185. // "resource"
  8186. // ],
  8187. // "parameters": {
  8188. // "resource": {
  8189. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  8190. // "location": "path",
  8191. // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$",
  8192. // "required": true,
  8193. // "type": "string"
  8194. // }
  8195. // },
  8196. // "path": "v1beta2/{+resource}:setIamPolicy",
  8197. // "request": {
  8198. // "$ref": "SetIamPolicyRequest"
  8199. // },
  8200. // "response": {
  8201. // "$ref": "Policy"
  8202. // },
  8203. // "scopes": [
  8204. // "https://www.googleapis.com/auth/cloud-platform"
  8205. // ]
  8206. // }
  8207. }
  8208. // method id "dataproc.projects.regions.clusters.testIamPermissions":
  8209. type ProjectsRegionsClustersTestIamPermissionsCall struct {
  8210. s *Service
  8211. resource string
  8212. testiampermissionsrequest *TestIamPermissionsRequest
  8213. urlParams_ gensupport.URLParams
  8214. ctx_ context.Context
  8215. header_ http.Header
  8216. }
  8217. // TestIamPermissions: Returns permissions that a caller has on the
  8218. // specified resource. If the resource does not exist, this will return
  8219. // an empty set of permissions, not a NOT_FOUND error.Note: This
  8220. // operation is designed to be used for building permission-aware UIs
  8221. // and command-line tools, not for authorization checking. This
  8222. // operation may "fail open" without warning.
  8223. func (r *ProjectsRegionsClustersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsClustersTestIamPermissionsCall {
  8224. c := &ProjectsRegionsClustersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8225. c.resource = resource
  8226. c.testiampermissionsrequest = testiampermissionsrequest
  8227. return c
  8228. }
  8229. // Fields allows partial responses to be retrieved. See
  8230. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8231. // for more information.
  8232. func (c *ProjectsRegionsClustersTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersTestIamPermissionsCall {
  8233. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8234. return c
  8235. }
  8236. // Context sets the context to be used in this call's Do method. Any
  8237. // pending HTTP request will be aborted if the provided context is
  8238. // canceled.
  8239. func (c *ProjectsRegionsClustersTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsClustersTestIamPermissionsCall {
  8240. c.ctx_ = ctx
  8241. return c
  8242. }
  8243. // Header returns an http.Header that can be modified by the caller to
  8244. // add HTTP headers to the request.
  8245. func (c *ProjectsRegionsClustersTestIamPermissionsCall) Header() http.Header {
  8246. if c.header_ == nil {
  8247. c.header_ = make(http.Header)
  8248. }
  8249. return c.header_
  8250. }
  8251. func (c *ProjectsRegionsClustersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  8252. reqHeaders := make(http.Header)
  8253. for k, v := range c.header_ {
  8254. reqHeaders[k] = v
  8255. }
  8256. reqHeaders.Set("User-Agent", c.s.userAgent())
  8257. var body io.Reader = nil
  8258. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  8259. if err != nil {
  8260. return nil, err
  8261. }
  8262. reqHeaders.Set("Content-Type", "application/json")
  8263. c.urlParams_.Set("alt", alt)
  8264. c.urlParams_.Set("prettyPrint", "false")
  8265. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
  8266. urls += "?" + c.urlParams_.Encode()
  8267. req, err := http.NewRequest("POST", urls, body)
  8268. if err != nil {
  8269. return nil, err
  8270. }
  8271. req.Header = reqHeaders
  8272. googleapi.Expand(req.URL, map[string]string{
  8273. "resource": c.resource,
  8274. })
  8275. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8276. }
  8277. // Do executes the "dataproc.projects.regions.clusters.testIamPermissions" call.
  8278. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  8279. // Any non-2xx status code is an error. Response headers are in either
  8280. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  8281. // was returned at all) in error.(*googleapi.Error).Header. Use
  8282. // googleapi.IsNotModified to check whether the returned error was
  8283. // because http.StatusNotModified was returned.
  8284. func (c *ProjectsRegionsClustersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  8285. gensupport.SetOptions(c.urlParams_, opts...)
  8286. res, err := c.doRequest("json")
  8287. if res != nil && res.StatusCode == http.StatusNotModified {
  8288. if res.Body != nil {
  8289. res.Body.Close()
  8290. }
  8291. return nil, &googleapi.Error{
  8292. Code: res.StatusCode,
  8293. Header: res.Header,
  8294. }
  8295. }
  8296. if err != nil {
  8297. return nil, err
  8298. }
  8299. defer googleapi.CloseBody(res)
  8300. if err := googleapi.CheckResponse(res); err != nil {
  8301. return nil, err
  8302. }
  8303. ret := &TestIamPermissionsResponse{
  8304. ServerResponse: googleapi.ServerResponse{
  8305. Header: res.Header,
  8306. HTTPStatusCode: res.StatusCode,
  8307. },
  8308. }
  8309. target := &ret
  8310. if err := gensupport.DecodeResponse(target, res); err != nil {
  8311. return nil, err
  8312. }
  8313. return ret, nil
  8314. // {
  8315. // "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.",
  8316. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:testIamPermissions",
  8317. // "httpMethod": "POST",
  8318. // "id": "dataproc.projects.regions.clusters.testIamPermissions",
  8319. // "parameterOrder": [
  8320. // "resource"
  8321. // ],
  8322. // "parameters": {
  8323. // "resource": {
  8324. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  8325. // "location": "path",
  8326. // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$",
  8327. // "required": true,
  8328. // "type": "string"
  8329. // }
  8330. // },
  8331. // "path": "v1beta2/{+resource}:testIamPermissions",
  8332. // "request": {
  8333. // "$ref": "TestIamPermissionsRequest"
  8334. // },
  8335. // "response": {
  8336. // "$ref": "TestIamPermissionsResponse"
  8337. // },
  8338. // "scopes": [
  8339. // "https://www.googleapis.com/auth/cloud-platform"
  8340. // ]
  8341. // }
  8342. }
  8343. // method id "dataproc.projects.regions.jobs.cancel":
  8344. type ProjectsRegionsJobsCancelCall struct {
  8345. s *Service
  8346. projectId string
  8347. region string
  8348. jobId string
  8349. canceljobrequest *CancelJobRequest
  8350. urlParams_ gensupport.URLParams
  8351. ctx_ context.Context
  8352. header_ http.Header
  8353. }
  8354. // Cancel: Starts a job cancellation request. To access the job resource
  8355. // after cancellation, call regions/{region}/jobs.list or
  8356. // regions/{region}/jobs.get.
  8357. func (r *ProjectsRegionsJobsService) Cancel(projectId string, region string, jobId string, canceljobrequest *CancelJobRequest) *ProjectsRegionsJobsCancelCall {
  8358. c := &ProjectsRegionsJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8359. c.projectId = projectId
  8360. c.region = region
  8361. c.jobId = jobId
  8362. c.canceljobrequest = canceljobrequest
  8363. return c
  8364. }
  8365. // Fields allows partial responses to be retrieved. See
  8366. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8367. // for more information.
  8368. func (c *ProjectsRegionsJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsCancelCall {
  8369. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8370. return c
  8371. }
  8372. // Context sets the context to be used in this call's Do method. Any
  8373. // pending HTTP request will be aborted if the provided context is
  8374. // canceled.
  8375. func (c *ProjectsRegionsJobsCancelCall) Context(ctx context.Context) *ProjectsRegionsJobsCancelCall {
  8376. c.ctx_ = ctx
  8377. return c
  8378. }
  8379. // Header returns an http.Header that can be modified by the caller to
  8380. // add HTTP headers to the request.
  8381. func (c *ProjectsRegionsJobsCancelCall) Header() http.Header {
  8382. if c.header_ == nil {
  8383. c.header_ = make(http.Header)
  8384. }
  8385. return c.header_
  8386. }
  8387. func (c *ProjectsRegionsJobsCancelCall) doRequest(alt string) (*http.Response, error) {
  8388. reqHeaders := make(http.Header)
  8389. for k, v := range c.header_ {
  8390. reqHeaders[k] = v
  8391. }
  8392. reqHeaders.Set("User-Agent", c.s.userAgent())
  8393. var body io.Reader = nil
  8394. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceljobrequest)
  8395. if err != nil {
  8396. return nil, err
  8397. }
  8398. reqHeaders.Set("Content-Type", "application/json")
  8399. c.urlParams_.Set("alt", alt)
  8400. c.urlParams_.Set("prettyPrint", "false")
  8401. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel")
  8402. urls += "?" + c.urlParams_.Encode()
  8403. req, err := http.NewRequest("POST", urls, body)
  8404. if err != nil {
  8405. return nil, err
  8406. }
  8407. req.Header = reqHeaders
  8408. googleapi.Expand(req.URL, map[string]string{
  8409. "projectId": c.projectId,
  8410. "region": c.region,
  8411. "jobId": c.jobId,
  8412. })
  8413. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8414. }
  8415. // Do executes the "dataproc.projects.regions.jobs.cancel" call.
  8416. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  8417. // is an error. Response headers are in either
  8418. // *Job.ServerResponse.Header or (if a response was returned at all) in
  8419. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8420. // whether the returned error was because http.StatusNotModified was
  8421. // returned.
  8422. func (c *ProjectsRegionsJobsCancelCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  8423. gensupport.SetOptions(c.urlParams_, opts...)
  8424. res, err := c.doRequest("json")
  8425. if res != nil && res.StatusCode == http.StatusNotModified {
  8426. if res.Body != nil {
  8427. res.Body.Close()
  8428. }
  8429. return nil, &googleapi.Error{
  8430. Code: res.StatusCode,
  8431. Header: res.Header,
  8432. }
  8433. }
  8434. if err != nil {
  8435. return nil, err
  8436. }
  8437. defer googleapi.CloseBody(res)
  8438. if err := googleapi.CheckResponse(res); err != nil {
  8439. return nil, err
  8440. }
  8441. ret := &Job{
  8442. ServerResponse: googleapi.ServerResponse{
  8443. Header: res.Header,
  8444. HTTPStatusCode: res.StatusCode,
  8445. },
  8446. }
  8447. target := &ret
  8448. if err := gensupport.DecodeResponse(target, res); err != nil {
  8449. return nil, err
  8450. }
  8451. return ret, nil
  8452. // {
  8453. // "description": "Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get.",
  8454. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel",
  8455. // "httpMethod": "POST",
  8456. // "id": "dataproc.projects.regions.jobs.cancel",
  8457. // "parameterOrder": [
  8458. // "projectId",
  8459. // "region",
  8460. // "jobId"
  8461. // ],
  8462. // "parameters": {
  8463. // "jobId": {
  8464. // "description": "Required. The job ID.",
  8465. // "location": "path",
  8466. // "required": true,
  8467. // "type": "string"
  8468. // },
  8469. // "projectId": {
  8470. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  8471. // "location": "path",
  8472. // "required": true,
  8473. // "type": "string"
  8474. // },
  8475. // "region": {
  8476. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  8477. // "location": "path",
  8478. // "required": true,
  8479. // "type": "string"
  8480. // }
  8481. // },
  8482. // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel",
  8483. // "request": {
  8484. // "$ref": "CancelJobRequest"
  8485. // },
  8486. // "response": {
  8487. // "$ref": "Job"
  8488. // },
  8489. // "scopes": [
  8490. // "https://www.googleapis.com/auth/cloud-platform"
  8491. // ]
  8492. // }
  8493. }
  8494. // method id "dataproc.projects.regions.jobs.delete":
  8495. type ProjectsRegionsJobsDeleteCall struct {
  8496. s *Service
  8497. projectId string
  8498. region string
  8499. jobId string
  8500. urlParams_ gensupport.URLParams
  8501. ctx_ context.Context
  8502. header_ http.Header
  8503. }
  8504. // Delete: Deletes the job from the project. If the job is active, the
  8505. // delete fails, and the response returns FAILED_PRECONDITION.
  8506. func (r *ProjectsRegionsJobsService) Delete(projectId string, region string, jobId string) *ProjectsRegionsJobsDeleteCall {
  8507. c := &ProjectsRegionsJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8508. c.projectId = projectId
  8509. c.region = region
  8510. c.jobId = jobId
  8511. return c
  8512. }
  8513. // Fields allows partial responses to be retrieved. See
  8514. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8515. // for more information.
  8516. func (c *ProjectsRegionsJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsDeleteCall {
  8517. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8518. return c
  8519. }
  8520. // Context sets the context to be used in this call's Do method. Any
  8521. // pending HTTP request will be aborted if the provided context is
  8522. // canceled.
  8523. func (c *ProjectsRegionsJobsDeleteCall) Context(ctx context.Context) *ProjectsRegionsJobsDeleteCall {
  8524. c.ctx_ = ctx
  8525. return c
  8526. }
  8527. // Header returns an http.Header that can be modified by the caller to
  8528. // add HTTP headers to the request.
  8529. func (c *ProjectsRegionsJobsDeleteCall) Header() http.Header {
  8530. if c.header_ == nil {
  8531. c.header_ = make(http.Header)
  8532. }
  8533. return c.header_
  8534. }
  8535. func (c *ProjectsRegionsJobsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8536. reqHeaders := make(http.Header)
  8537. for k, v := range c.header_ {
  8538. reqHeaders[k] = v
  8539. }
  8540. reqHeaders.Set("User-Agent", c.s.userAgent())
  8541. var body io.Reader = nil
  8542. c.urlParams_.Set("alt", alt)
  8543. c.urlParams_.Set("prettyPrint", "false")
  8544. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}")
  8545. urls += "?" + c.urlParams_.Encode()
  8546. req, err := http.NewRequest("DELETE", urls, body)
  8547. if err != nil {
  8548. return nil, err
  8549. }
  8550. req.Header = reqHeaders
  8551. googleapi.Expand(req.URL, map[string]string{
  8552. "projectId": c.projectId,
  8553. "region": c.region,
  8554. "jobId": c.jobId,
  8555. })
  8556. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8557. }
  8558. // Do executes the "dataproc.projects.regions.jobs.delete" call.
  8559. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  8560. // code is an error. Response headers are in either
  8561. // *Empty.ServerResponse.Header or (if a response was returned at all)
  8562. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8563. // check whether the returned error was because http.StatusNotModified
  8564. // was returned.
  8565. func (c *ProjectsRegionsJobsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  8566. gensupport.SetOptions(c.urlParams_, opts...)
  8567. res, err := c.doRequest("json")
  8568. if res != nil && res.StatusCode == http.StatusNotModified {
  8569. if res.Body != nil {
  8570. res.Body.Close()
  8571. }
  8572. return nil, &googleapi.Error{
  8573. Code: res.StatusCode,
  8574. Header: res.Header,
  8575. }
  8576. }
  8577. if err != nil {
  8578. return nil, err
  8579. }
  8580. defer googleapi.CloseBody(res)
  8581. if err := googleapi.CheckResponse(res); err != nil {
  8582. return nil, err
  8583. }
  8584. ret := &Empty{
  8585. ServerResponse: googleapi.ServerResponse{
  8586. Header: res.Header,
  8587. HTTPStatusCode: res.StatusCode,
  8588. },
  8589. }
  8590. target := &ret
  8591. if err := gensupport.DecodeResponse(target, res); err != nil {
  8592. return nil, err
  8593. }
  8594. return ret, nil
  8595. // {
  8596. // "description": "Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.",
  8597. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}",
  8598. // "httpMethod": "DELETE",
  8599. // "id": "dataproc.projects.regions.jobs.delete",
  8600. // "parameterOrder": [
  8601. // "projectId",
  8602. // "region",
  8603. // "jobId"
  8604. // ],
  8605. // "parameters": {
  8606. // "jobId": {
  8607. // "description": "Required. The job ID.",
  8608. // "location": "path",
  8609. // "required": true,
  8610. // "type": "string"
  8611. // },
  8612. // "projectId": {
  8613. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  8614. // "location": "path",
  8615. // "required": true,
  8616. // "type": "string"
  8617. // },
  8618. // "region": {
  8619. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  8620. // "location": "path",
  8621. // "required": true,
  8622. // "type": "string"
  8623. // }
  8624. // },
  8625. // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}",
  8626. // "response": {
  8627. // "$ref": "Empty"
  8628. // },
  8629. // "scopes": [
  8630. // "https://www.googleapis.com/auth/cloud-platform"
  8631. // ]
  8632. // }
  8633. }
  8634. // method id "dataproc.projects.regions.jobs.get":
  8635. type ProjectsRegionsJobsGetCall struct {
  8636. s *Service
  8637. projectId string
  8638. region string
  8639. jobId string
  8640. urlParams_ gensupport.URLParams
  8641. ifNoneMatch_ string
  8642. ctx_ context.Context
  8643. header_ http.Header
  8644. }
  8645. // Get: Gets the resource representation for a job in a project.
  8646. func (r *ProjectsRegionsJobsService) Get(projectId string, region string, jobId string) *ProjectsRegionsJobsGetCall {
  8647. c := &ProjectsRegionsJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8648. c.projectId = projectId
  8649. c.region = region
  8650. c.jobId = jobId
  8651. return c
  8652. }
  8653. // Fields allows partial responses to be retrieved. See
  8654. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8655. // for more information.
  8656. func (c *ProjectsRegionsJobsGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsGetCall {
  8657. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8658. return c
  8659. }
  8660. // IfNoneMatch sets the optional parameter which makes the operation
  8661. // fail if the object's ETag matches the given value. This is useful for
  8662. // getting updates only after the object has changed since the last
  8663. // request. Use googleapi.IsNotModified to check whether the response
  8664. // error from Do is the result of In-None-Match.
  8665. func (c *ProjectsRegionsJobsGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsGetCall {
  8666. c.ifNoneMatch_ = entityTag
  8667. return c
  8668. }
  8669. // Context sets the context to be used in this call's Do method. Any
  8670. // pending HTTP request will be aborted if the provided context is
  8671. // canceled.
  8672. func (c *ProjectsRegionsJobsGetCall) Context(ctx context.Context) *ProjectsRegionsJobsGetCall {
  8673. c.ctx_ = ctx
  8674. return c
  8675. }
  8676. // Header returns an http.Header that can be modified by the caller to
  8677. // add HTTP headers to the request.
  8678. func (c *ProjectsRegionsJobsGetCall) Header() http.Header {
  8679. if c.header_ == nil {
  8680. c.header_ = make(http.Header)
  8681. }
  8682. return c.header_
  8683. }
  8684. func (c *ProjectsRegionsJobsGetCall) doRequest(alt string) (*http.Response, error) {
  8685. reqHeaders := make(http.Header)
  8686. for k, v := range c.header_ {
  8687. reqHeaders[k] = v
  8688. }
  8689. reqHeaders.Set("User-Agent", c.s.userAgent())
  8690. if c.ifNoneMatch_ != "" {
  8691. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8692. }
  8693. var body io.Reader = nil
  8694. c.urlParams_.Set("alt", alt)
  8695. c.urlParams_.Set("prettyPrint", "false")
  8696. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}")
  8697. urls += "?" + c.urlParams_.Encode()
  8698. req, err := http.NewRequest("GET", urls, body)
  8699. if err != nil {
  8700. return nil, err
  8701. }
  8702. req.Header = reqHeaders
  8703. googleapi.Expand(req.URL, map[string]string{
  8704. "projectId": c.projectId,
  8705. "region": c.region,
  8706. "jobId": c.jobId,
  8707. })
  8708. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8709. }
  8710. // Do executes the "dataproc.projects.regions.jobs.get" call.
  8711. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  8712. // is an error. Response headers are in either
  8713. // *Job.ServerResponse.Header or (if a response was returned at all) in
  8714. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8715. // whether the returned error was because http.StatusNotModified was
  8716. // returned.
  8717. func (c *ProjectsRegionsJobsGetCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  8718. gensupport.SetOptions(c.urlParams_, opts...)
  8719. res, err := c.doRequest("json")
  8720. if res != nil && res.StatusCode == http.StatusNotModified {
  8721. if res.Body != nil {
  8722. res.Body.Close()
  8723. }
  8724. return nil, &googleapi.Error{
  8725. Code: res.StatusCode,
  8726. Header: res.Header,
  8727. }
  8728. }
  8729. if err != nil {
  8730. return nil, err
  8731. }
  8732. defer googleapi.CloseBody(res)
  8733. if err := googleapi.CheckResponse(res); err != nil {
  8734. return nil, err
  8735. }
  8736. ret := &Job{
  8737. ServerResponse: googleapi.ServerResponse{
  8738. Header: res.Header,
  8739. HTTPStatusCode: res.StatusCode,
  8740. },
  8741. }
  8742. target := &ret
  8743. if err := gensupport.DecodeResponse(target, res); err != nil {
  8744. return nil, err
  8745. }
  8746. return ret, nil
  8747. // {
  8748. // "description": "Gets the resource representation for a job in a project.",
  8749. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}",
  8750. // "httpMethod": "GET",
  8751. // "id": "dataproc.projects.regions.jobs.get",
  8752. // "parameterOrder": [
  8753. // "projectId",
  8754. // "region",
  8755. // "jobId"
  8756. // ],
  8757. // "parameters": {
  8758. // "jobId": {
  8759. // "description": "Required. The job ID.",
  8760. // "location": "path",
  8761. // "required": true,
  8762. // "type": "string"
  8763. // },
  8764. // "projectId": {
  8765. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  8766. // "location": "path",
  8767. // "required": true,
  8768. // "type": "string"
  8769. // },
  8770. // "region": {
  8771. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  8772. // "location": "path",
  8773. // "required": true,
  8774. // "type": "string"
  8775. // }
  8776. // },
  8777. // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}",
  8778. // "response": {
  8779. // "$ref": "Job"
  8780. // },
  8781. // "scopes": [
  8782. // "https://www.googleapis.com/auth/cloud-platform"
  8783. // ]
  8784. // }
  8785. }
  8786. // method id "dataproc.projects.regions.jobs.getIamPolicy":
  8787. type ProjectsRegionsJobsGetIamPolicyCall struct {
  8788. s *Service
  8789. resource string
  8790. urlParams_ gensupport.URLParams
  8791. ifNoneMatch_ string
  8792. ctx_ context.Context
  8793. header_ http.Header
  8794. }
  8795. // GetIamPolicy: Gets the access control policy for a resource. Returns
  8796. // an empty policy if the resource exists and does not have a policy
  8797. // set.
  8798. func (r *ProjectsRegionsJobsService) GetIamPolicy(resource string) *ProjectsRegionsJobsGetIamPolicyCall {
  8799. c := &ProjectsRegionsJobsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8800. c.resource = resource
  8801. return c
  8802. }
  8803. // Fields allows partial responses to be retrieved. See
  8804. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8805. // for more information.
  8806. func (c *ProjectsRegionsJobsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsGetIamPolicyCall {
  8807. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8808. return c
  8809. }
  8810. // IfNoneMatch sets the optional parameter which makes the operation
  8811. // fail if the object's ETag matches the given value. This is useful for
  8812. // getting updates only after the object has changed since the last
  8813. // request. Use googleapi.IsNotModified to check whether the response
  8814. // error from Do is the result of In-None-Match.
  8815. func (c *ProjectsRegionsJobsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsGetIamPolicyCall {
  8816. c.ifNoneMatch_ = entityTag
  8817. return c
  8818. }
  8819. // Context sets the context to be used in this call's Do method. Any
  8820. // pending HTTP request will be aborted if the provided context is
  8821. // canceled.
  8822. func (c *ProjectsRegionsJobsGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsJobsGetIamPolicyCall {
  8823. c.ctx_ = ctx
  8824. return c
  8825. }
  8826. // Header returns an http.Header that can be modified by the caller to
  8827. // add HTTP headers to the request.
  8828. func (c *ProjectsRegionsJobsGetIamPolicyCall) Header() http.Header {
  8829. if c.header_ == nil {
  8830. c.header_ = make(http.Header)
  8831. }
  8832. return c.header_
  8833. }
  8834. func (c *ProjectsRegionsJobsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  8835. reqHeaders := make(http.Header)
  8836. for k, v := range c.header_ {
  8837. reqHeaders[k] = v
  8838. }
  8839. reqHeaders.Set("User-Agent", c.s.userAgent())
  8840. if c.ifNoneMatch_ != "" {
  8841. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8842. }
  8843. var body io.Reader = nil
  8844. c.urlParams_.Set("alt", alt)
  8845. c.urlParams_.Set("prettyPrint", "false")
  8846. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
  8847. urls += "?" + c.urlParams_.Encode()
  8848. req, err := http.NewRequest("GET", urls, body)
  8849. if err != nil {
  8850. return nil, err
  8851. }
  8852. req.Header = reqHeaders
  8853. googleapi.Expand(req.URL, map[string]string{
  8854. "resource": c.resource,
  8855. })
  8856. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8857. }
  8858. // Do executes the "dataproc.projects.regions.jobs.getIamPolicy" call.
  8859. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  8860. // code is an error. Response headers are in either
  8861. // *Policy.ServerResponse.Header or (if a response was returned at all)
  8862. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8863. // check whether the returned error was because http.StatusNotModified
  8864. // was returned.
  8865. func (c *ProjectsRegionsJobsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  8866. gensupport.SetOptions(c.urlParams_, opts...)
  8867. res, err := c.doRequest("json")
  8868. if res != nil && res.StatusCode == http.StatusNotModified {
  8869. if res.Body != nil {
  8870. res.Body.Close()
  8871. }
  8872. return nil, &googleapi.Error{
  8873. Code: res.StatusCode,
  8874. Header: res.Header,
  8875. }
  8876. }
  8877. if err != nil {
  8878. return nil, err
  8879. }
  8880. defer googleapi.CloseBody(res)
  8881. if err := googleapi.CheckResponse(res); err != nil {
  8882. return nil, err
  8883. }
  8884. ret := &Policy{
  8885. ServerResponse: googleapi.ServerResponse{
  8886. Header: res.Header,
  8887. HTTPStatusCode: res.StatusCode,
  8888. },
  8889. }
  8890. target := &ret
  8891. if err := gensupport.DecodeResponse(target, res); err != nil {
  8892. return nil, err
  8893. }
  8894. return ret, nil
  8895. // {
  8896. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  8897. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:getIamPolicy",
  8898. // "httpMethod": "GET",
  8899. // "id": "dataproc.projects.regions.jobs.getIamPolicy",
  8900. // "parameterOrder": [
  8901. // "resource"
  8902. // ],
  8903. // "parameters": {
  8904. // "resource": {
  8905. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  8906. // "location": "path",
  8907. // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$",
  8908. // "required": true,
  8909. // "type": "string"
  8910. // }
  8911. // },
  8912. // "path": "v1beta2/{+resource}:getIamPolicy",
  8913. // "response": {
  8914. // "$ref": "Policy"
  8915. // },
  8916. // "scopes": [
  8917. // "https://www.googleapis.com/auth/cloud-platform"
  8918. // ]
  8919. // }
  8920. }
  8921. // method id "dataproc.projects.regions.jobs.list":
  8922. type ProjectsRegionsJobsListCall struct {
  8923. s *Service
  8924. projectId string
  8925. region string
  8926. urlParams_ gensupport.URLParams
  8927. ifNoneMatch_ string
  8928. ctx_ context.Context
  8929. header_ http.Header
  8930. }
  8931. // List: Lists regions/{region}/jobs in a project.
  8932. func (r *ProjectsRegionsJobsService) List(projectId string, region string) *ProjectsRegionsJobsListCall {
  8933. c := &ProjectsRegionsJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8934. c.projectId = projectId
  8935. c.region = region
  8936. return c
  8937. }
  8938. // ClusterName sets the optional parameter "clusterName": If set, the
  8939. // returned jobs list includes only jobs that were submitted to the
  8940. // named cluster.
  8941. func (c *ProjectsRegionsJobsListCall) ClusterName(clusterName string) *ProjectsRegionsJobsListCall {
  8942. c.urlParams_.Set("clusterName", clusterName)
  8943. return c
  8944. }
  8945. // Filter sets the optional parameter "filter": A filter constraining
  8946. // the jobs to list. Filters are case-sensitive and have the following
  8947. // syntax:field = value AND field = value ...where field is status.state
  8948. // or labels.[KEY], and [KEY] is a label key. value can be * to match
  8949. // all values. status.state can be either ACTIVE or NON_ACTIVE. Only the
  8950. // logical AND operator is supported; space-separated items are treated
  8951. // as having an implicit AND operator.Example filter:status.state =
  8952. // ACTIVE AND labels.env = staging AND labels.starred = *
  8953. func (c *ProjectsRegionsJobsListCall) Filter(filter string) *ProjectsRegionsJobsListCall {
  8954. c.urlParams_.Set("filter", filter)
  8955. return c
  8956. }
  8957. // JobStateMatcher sets the optional parameter "jobStateMatcher":
  8958. // Specifies enumerated categories of jobs to list. (default = match ALL
  8959. // jobs).If filter is provided, jobStateMatcher will be ignored.
  8960. //
  8961. // Possible values:
  8962. // "ALL"
  8963. // "ACTIVE"
  8964. // "NON_ACTIVE"
  8965. func (c *ProjectsRegionsJobsListCall) JobStateMatcher(jobStateMatcher string) *ProjectsRegionsJobsListCall {
  8966. c.urlParams_.Set("jobStateMatcher", jobStateMatcher)
  8967. return c
  8968. }
  8969. // PageSize sets the optional parameter "pageSize": The number of
  8970. // results to return in each response.
  8971. func (c *ProjectsRegionsJobsListCall) PageSize(pageSize int64) *ProjectsRegionsJobsListCall {
  8972. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8973. return c
  8974. }
  8975. // PageToken sets the optional parameter "pageToken": The page token,
  8976. // returned by a previous call, to request the next page of results.
  8977. func (c *ProjectsRegionsJobsListCall) PageToken(pageToken string) *ProjectsRegionsJobsListCall {
  8978. c.urlParams_.Set("pageToken", pageToken)
  8979. return c
  8980. }
  8981. // Fields allows partial responses to be retrieved. See
  8982. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8983. // for more information.
  8984. func (c *ProjectsRegionsJobsListCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsListCall {
  8985. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8986. return c
  8987. }
  8988. // IfNoneMatch sets the optional parameter which makes the operation
  8989. // fail if the object's ETag matches the given value. This is useful for
  8990. // getting updates only after the object has changed since the last
  8991. // request. Use googleapi.IsNotModified to check whether the response
  8992. // error from Do is the result of In-None-Match.
  8993. func (c *ProjectsRegionsJobsListCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsListCall {
  8994. c.ifNoneMatch_ = entityTag
  8995. return c
  8996. }
  8997. // Context sets the context to be used in this call's Do method. Any
  8998. // pending HTTP request will be aborted if the provided context is
  8999. // canceled.
  9000. func (c *ProjectsRegionsJobsListCall) Context(ctx context.Context) *ProjectsRegionsJobsListCall {
  9001. c.ctx_ = ctx
  9002. return c
  9003. }
  9004. // Header returns an http.Header that can be modified by the caller to
  9005. // add HTTP headers to the request.
  9006. func (c *ProjectsRegionsJobsListCall) Header() http.Header {
  9007. if c.header_ == nil {
  9008. c.header_ = make(http.Header)
  9009. }
  9010. return c.header_
  9011. }
  9012. func (c *ProjectsRegionsJobsListCall) doRequest(alt string) (*http.Response, error) {
  9013. reqHeaders := make(http.Header)
  9014. for k, v := range c.header_ {
  9015. reqHeaders[k] = v
  9016. }
  9017. reqHeaders.Set("User-Agent", c.s.userAgent())
  9018. if c.ifNoneMatch_ != "" {
  9019. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9020. }
  9021. var body io.Reader = nil
  9022. c.urlParams_.Set("alt", alt)
  9023. c.urlParams_.Set("prettyPrint", "false")
  9024. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs")
  9025. urls += "?" + c.urlParams_.Encode()
  9026. req, err := http.NewRequest("GET", urls, body)
  9027. if err != nil {
  9028. return nil, err
  9029. }
  9030. req.Header = reqHeaders
  9031. googleapi.Expand(req.URL, map[string]string{
  9032. "projectId": c.projectId,
  9033. "region": c.region,
  9034. })
  9035. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9036. }
  9037. // Do executes the "dataproc.projects.regions.jobs.list" call.
  9038. // Exactly one of *ListJobsResponse or error will be non-nil. Any
  9039. // non-2xx status code is an error. Response headers are in either
  9040. // *ListJobsResponse.ServerResponse.Header or (if a response was
  9041. // returned at all) in error.(*googleapi.Error).Header. Use
  9042. // googleapi.IsNotModified to check whether the returned error was
  9043. // because http.StatusNotModified was returned.
  9044. func (c *ProjectsRegionsJobsListCall) Do(opts ...googleapi.CallOption) (*ListJobsResponse, error) {
  9045. gensupport.SetOptions(c.urlParams_, opts...)
  9046. res, err := c.doRequest("json")
  9047. if res != nil && res.StatusCode == http.StatusNotModified {
  9048. if res.Body != nil {
  9049. res.Body.Close()
  9050. }
  9051. return nil, &googleapi.Error{
  9052. Code: res.StatusCode,
  9053. Header: res.Header,
  9054. }
  9055. }
  9056. if err != nil {
  9057. return nil, err
  9058. }
  9059. defer googleapi.CloseBody(res)
  9060. if err := googleapi.CheckResponse(res); err != nil {
  9061. return nil, err
  9062. }
  9063. ret := &ListJobsResponse{
  9064. ServerResponse: googleapi.ServerResponse{
  9065. Header: res.Header,
  9066. HTTPStatusCode: res.StatusCode,
  9067. },
  9068. }
  9069. target := &ret
  9070. if err := gensupport.DecodeResponse(target, res); err != nil {
  9071. return nil, err
  9072. }
  9073. return ret, nil
  9074. // {
  9075. // "description": "Lists regions/{region}/jobs in a project.",
  9076. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs",
  9077. // "httpMethod": "GET",
  9078. // "id": "dataproc.projects.regions.jobs.list",
  9079. // "parameterOrder": [
  9080. // "projectId",
  9081. // "region"
  9082. // ],
  9083. // "parameters": {
  9084. // "clusterName": {
  9085. // "description": "Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster.",
  9086. // "location": "query",
  9087. // "type": "string"
  9088. // },
  9089. // "filter": {
  9090. // "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 = *",
  9091. // "location": "query",
  9092. // "type": "string"
  9093. // },
  9094. // "jobStateMatcher": {
  9095. // "description": "Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored.",
  9096. // "enum": [
  9097. // "ALL",
  9098. // "ACTIVE",
  9099. // "NON_ACTIVE"
  9100. // ],
  9101. // "location": "query",
  9102. // "type": "string"
  9103. // },
  9104. // "pageSize": {
  9105. // "description": "Optional. The number of results to return in each response.",
  9106. // "format": "int32",
  9107. // "location": "query",
  9108. // "type": "integer"
  9109. // },
  9110. // "pageToken": {
  9111. // "description": "Optional. The page token, returned by a previous call, to request the next page of results.",
  9112. // "location": "query",
  9113. // "type": "string"
  9114. // },
  9115. // "projectId": {
  9116. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  9117. // "location": "path",
  9118. // "required": true,
  9119. // "type": "string"
  9120. // },
  9121. // "region": {
  9122. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  9123. // "location": "path",
  9124. // "required": true,
  9125. // "type": "string"
  9126. // }
  9127. // },
  9128. // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs",
  9129. // "response": {
  9130. // "$ref": "ListJobsResponse"
  9131. // },
  9132. // "scopes": [
  9133. // "https://www.googleapis.com/auth/cloud-platform"
  9134. // ]
  9135. // }
  9136. }
  9137. // Pages invokes f for each page of results.
  9138. // A non-nil error returned from f will halt the iteration.
  9139. // The provided context supersedes any context provided to the Context method.
  9140. func (c *ProjectsRegionsJobsListCall) Pages(ctx context.Context, f func(*ListJobsResponse) error) error {
  9141. c.ctx_ = ctx
  9142. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  9143. for {
  9144. x, err := c.Do()
  9145. if err != nil {
  9146. return err
  9147. }
  9148. if err := f(x); err != nil {
  9149. return err
  9150. }
  9151. if x.NextPageToken == "" {
  9152. return nil
  9153. }
  9154. c.PageToken(x.NextPageToken)
  9155. }
  9156. }
  9157. // method id "dataproc.projects.regions.jobs.patch":
  9158. type ProjectsRegionsJobsPatchCall struct {
  9159. s *Service
  9160. projectId string
  9161. region string
  9162. jobId string
  9163. job *Job
  9164. urlParams_ gensupport.URLParams
  9165. ctx_ context.Context
  9166. header_ http.Header
  9167. }
  9168. // Patch: Updates a job in a project.
  9169. func (r *ProjectsRegionsJobsService) Patch(projectId string, region string, jobId string, job *Job) *ProjectsRegionsJobsPatchCall {
  9170. c := &ProjectsRegionsJobsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9171. c.projectId = projectId
  9172. c.region = region
  9173. c.jobId = jobId
  9174. c.job = job
  9175. return c
  9176. }
  9177. // UpdateMask sets the optional parameter "updateMask": Required.
  9178. // Specifies the path, relative to <code>Job</code>, of the field to
  9179. // update. For example, to update the labels of a Job the
  9180. // <code>update_mask</code> parameter would be specified as
  9181. // <code>labels</code>, and the PATCH request body would specify the new
  9182. // value. <strong>Note:</strong> Currently, <code>labels</code> is the
  9183. // only field that can be updated.
  9184. func (c *ProjectsRegionsJobsPatchCall) UpdateMask(updateMask string) *ProjectsRegionsJobsPatchCall {
  9185. c.urlParams_.Set("updateMask", updateMask)
  9186. return c
  9187. }
  9188. // Fields allows partial responses to be retrieved. See
  9189. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9190. // for more information.
  9191. func (c *ProjectsRegionsJobsPatchCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsPatchCall {
  9192. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9193. return c
  9194. }
  9195. // Context sets the context to be used in this call's Do method. Any
  9196. // pending HTTP request will be aborted if the provided context is
  9197. // canceled.
  9198. func (c *ProjectsRegionsJobsPatchCall) Context(ctx context.Context) *ProjectsRegionsJobsPatchCall {
  9199. c.ctx_ = ctx
  9200. return c
  9201. }
  9202. // Header returns an http.Header that can be modified by the caller to
  9203. // add HTTP headers to the request.
  9204. func (c *ProjectsRegionsJobsPatchCall) Header() http.Header {
  9205. if c.header_ == nil {
  9206. c.header_ = make(http.Header)
  9207. }
  9208. return c.header_
  9209. }
  9210. func (c *ProjectsRegionsJobsPatchCall) doRequest(alt string) (*http.Response, error) {
  9211. reqHeaders := make(http.Header)
  9212. for k, v := range c.header_ {
  9213. reqHeaders[k] = v
  9214. }
  9215. reqHeaders.Set("User-Agent", c.s.userAgent())
  9216. var body io.Reader = nil
  9217. body, err := googleapi.WithoutDataWrapper.JSONReader(c.job)
  9218. if err != nil {
  9219. return nil, err
  9220. }
  9221. reqHeaders.Set("Content-Type", "application/json")
  9222. c.urlParams_.Set("alt", alt)
  9223. c.urlParams_.Set("prettyPrint", "false")
  9224. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}")
  9225. urls += "?" + c.urlParams_.Encode()
  9226. req, err := http.NewRequest("PATCH", urls, body)
  9227. if err != nil {
  9228. return nil, err
  9229. }
  9230. req.Header = reqHeaders
  9231. googleapi.Expand(req.URL, map[string]string{
  9232. "projectId": c.projectId,
  9233. "region": c.region,
  9234. "jobId": c.jobId,
  9235. })
  9236. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9237. }
  9238. // Do executes the "dataproc.projects.regions.jobs.patch" call.
  9239. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  9240. // is an error. Response headers are in either
  9241. // *Job.ServerResponse.Header or (if a response was returned at all) in
  9242. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9243. // whether the returned error was because http.StatusNotModified was
  9244. // returned.
  9245. func (c *ProjectsRegionsJobsPatchCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  9246. gensupport.SetOptions(c.urlParams_, opts...)
  9247. res, err := c.doRequest("json")
  9248. if res != nil && res.StatusCode == http.StatusNotModified {
  9249. if res.Body != nil {
  9250. res.Body.Close()
  9251. }
  9252. return nil, &googleapi.Error{
  9253. Code: res.StatusCode,
  9254. Header: res.Header,
  9255. }
  9256. }
  9257. if err != nil {
  9258. return nil, err
  9259. }
  9260. defer googleapi.CloseBody(res)
  9261. if err := googleapi.CheckResponse(res); err != nil {
  9262. return nil, err
  9263. }
  9264. ret := &Job{
  9265. ServerResponse: googleapi.ServerResponse{
  9266. Header: res.Header,
  9267. HTTPStatusCode: res.StatusCode,
  9268. },
  9269. }
  9270. target := &ret
  9271. if err := gensupport.DecodeResponse(target, res); err != nil {
  9272. return nil, err
  9273. }
  9274. return ret, nil
  9275. // {
  9276. // "description": "Updates a job in a project.",
  9277. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}",
  9278. // "httpMethod": "PATCH",
  9279. // "id": "dataproc.projects.regions.jobs.patch",
  9280. // "parameterOrder": [
  9281. // "projectId",
  9282. // "region",
  9283. // "jobId"
  9284. // ],
  9285. // "parameters": {
  9286. // "jobId": {
  9287. // "description": "Required. The job ID.",
  9288. // "location": "path",
  9289. // "required": true,
  9290. // "type": "string"
  9291. // },
  9292. // "projectId": {
  9293. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  9294. // "location": "path",
  9295. // "required": true,
  9296. // "type": "string"
  9297. // },
  9298. // "region": {
  9299. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  9300. // "location": "path",
  9301. // "required": true,
  9302. // "type": "string"
  9303. // },
  9304. // "updateMask": {
  9305. // "description": "Required. Specifies the path, relative to \u003ccode\u003eJob\u003c/code\u003e, of the field to update. For example, to update the labels of a Job the \u003ccode\u003eupdate_mask\u003c/code\u003e parameter would be specified as \u003ccode\u003elabels\u003c/code\u003e, and the PATCH request body would specify the new value. \u003cstrong\u003eNote:\u003c/strong\u003e Currently, \u003ccode\u003elabels\u003c/code\u003e is the only field that can be updated.",
  9306. // "format": "google-fieldmask",
  9307. // "location": "query",
  9308. // "type": "string"
  9309. // }
  9310. // },
  9311. // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}",
  9312. // "request": {
  9313. // "$ref": "Job"
  9314. // },
  9315. // "response": {
  9316. // "$ref": "Job"
  9317. // },
  9318. // "scopes": [
  9319. // "https://www.googleapis.com/auth/cloud-platform"
  9320. // ]
  9321. // }
  9322. }
  9323. // method id "dataproc.projects.regions.jobs.setIamPolicy":
  9324. type ProjectsRegionsJobsSetIamPolicyCall struct {
  9325. s *Service
  9326. resource string
  9327. setiampolicyrequest *SetIamPolicyRequest
  9328. urlParams_ gensupport.URLParams
  9329. ctx_ context.Context
  9330. header_ http.Header
  9331. }
  9332. // SetIamPolicy: Sets the access control policy on the specified
  9333. // resource. Replaces any existing policy.
  9334. func (r *ProjectsRegionsJobsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsJobsSetIamPolicyCall {
  9335. c := &ProjectsRegionsJobsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9336. c.resource = resource
  9337. c.setiampolicyrequest = setiampolicyrequest
  9338. return c
  9339. }
  9340. // Fields allows partial responses to be retrieved. See
  9341. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9342. // for more information.
  9343. func (c *ProjectsRegionsJobsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSetIamPolicyCall {
  9344. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9345. return c
  9346. }
  9347. // Context sets the context to be used in this call's Do method. Any
  9348. // pending HTTP request will be aborted if the provided context is
  9349. // canceled.
  9350. func (c *ProjectsRegionsJobsSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsJobsSetIamPolicyCall {
  9351. c.ctx_ = ctx
  9352. return c
  9353. }
  9354. // Header returns an http.Header that can be modified by the caller to
  9355. // add HTTP headers to the request.
  9356. func (c *ProjectsRegionsJobsSetIamPolicyCall) Header() http.Header {
  9357. if c.header_ == nil {
  9358. c.header_ = make(http.Header)
  9359. }
  9360. return c.header_
  9361. }
  9362. func (c *ProjectsRegionsJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  9363. reqHeaders := make(http.Header)
  9364. for k, v := range c.header_ {
  9365. reqHeaders[k] = v
  9366. }
  9367. reqHeaders.Set("User-Agent", c.s.userAgent())
  9368. var body io.Reader = nil
  9369. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  9370. if err != nil {
  9371. return nil, err
  9372. }
  9373. reqHeaders.Set("Content-Type", "application/json")
  9374. c.urlParams_.Set("alt", alt)
  9375. c.urlParams_.Set("prettyPrint", "false")
  9376. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy")
  9377. urls += "?" + c.urlParams_.Encode()
  9378. req, err := http.NewRequest("POST", urls, body)
  9379. if err != nil {
  9380. return nil, err
  9381. }
  9382. req.Header = reqHeaders
  9383. googleapi.Expand(req.URL, map[string]string{
  9384. "resource": c.resource,
  9385. })
  9386. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9387. }
  9388. // Do executes the "dataproc.projects.regions.jobs.setIamPolicy" call.
  9389. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  9390. // code is an error. Response headers are in either
  9391. // *Policy.ServerResponse.Header or (if a response was returned at all)
  9392. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9393. // check whether the returned error was because http.StatusNotModified
  9394. // was returned.
  9395. func (c *ProjectsRegionsJobsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  9396. gensupport.SetOptions(c.urlParams_, opts...)
  9397. res, err := c.doRequest("json")
  9398. if res != nil && res.StatusCode == http.StatusNotModified {
  9399. if res.Body != nil {
  9400. res.Body.Close()
  9401. }
  9402. return nil, &googleapi.Error{
  9403. Code: res.StatusCode,
  9404. Header: res.Header,
  9405. }
  9406. }
  9407. if err != nil {
  9408. return nil, err
  9409. }
  9410. defer googleapi.CloseBody(res)
  9411. if err := googleapi.CheckResponse(res); err != nil {
  9412. return nil, err
  9413. }
  9414. ret := &Policy{
  9415. ServerResponse: googleapi.ServerResponse{
  9416. Header: res.Header,
  9417. HTTPStatusCode: res.StatusCode,
  9418. },
  9419. }
  9420. target := &ret
  9421. if err := gensupport.DecodeResponse(target, res); err != nil {
  9422. return nil, err
  9423. }
  9424. return ret, nil
  9425. // {
  9426. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  9427. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:setIamPolicy",
  9428. // "httpMethod": "POST",
  9429. // "id": "dataproc.projects.regions.jobs.setIamPolicy",
  9430. // "parameterOrder": [
  9431. // "resource"
  9432. // ],
  9433. // "parameters": {
  9434. // "resource": {
  9435. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  9436. // "location": "path",
  9437. // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$",
  9438. // "required": true,
  9439. // "type": "string"
  9440. // }
  9441. // },
  9442. // "path": "v1beta2/{+resource}:setIamPolicy",
  9443. // "request": {
  9444. // "$ref": "SetIamPolicyRequest"
  9445. // },
  9446. // "response": {
  9447. // "$ref": "Policy"
  9448. // },
  9449. // "scopes": [
  9450. // "https://www.googleapis.com/auth/cloud-platform"
  9451. // ]
  9452. // }
  9453. }
  9454. // method id "dataproc.projects.regions.jobs.submit":
  9455. type ProjectsRegionsJobsSubmitCall struct {
  9456. s *Service
  9457. projectId string
  9458. region string
  9459. submitjobrequest *SubmitJobRequest
  9460. urlParams_ gensupport.URLParams
  9461. ctx_ context.Context
  9462. header_ http.Header
  9463. }
  9464. // Submit: Submits a job to a cluster.
  9465. func (r *ProjectsRegionsJobsService) Submit(projectId string, region string, submitjobrequest *SubmitJobRequest) *ProjectsRegionsJobsSubmitCall {
  9466. c := &ProjectsRegionsJobsSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9467. c.projectId = projectId
  9468. c.region = region
  9469. c.submitjobrequest = submitjobrequest
  9470. return c
  9471. }
  9472. // Fields allows partial responses to be retrieved. See
  9473. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9474. // for more information.
  9475. func (c *ProjectsRegionsJobsSubmitCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSubmitCall {
  9476. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9477. return c
  9478. }
  9479. // Context sets the context to be used in this call's Do method. Any
  9480. // pending HTTP request will be aborted if the provided context is
  9481. // canceled.
  9482. func (c *ProjectsRegionsJobsSubmitCall) Context(ctx context.Context) *ProjectsRegionsJobsSubmitCall {
  9483. c.ctx_ = ctx
  9484. return c
  9485. }
  9486. // Header returns an http.Header that can be modified by the caller to
  9487. // add HTTP headers to the request.
  9488. func (c *ProjectsRegionsJobsSubmitCall) Header() http.Header {
  9489. if c.header_ == nil {
  9490. c.header_ = make(http.Header)
  9491. }
  9492. return c.header_
  9493. }
  9494. func (c *ProjectsRegionsJobsSubmitCall) doRequest(alt string) (*http.Response, error) {
  9495. reqHeaders := make(http.Header)
  9496. for k, v := range c.header_ {
  9497. reqHeaders[k] = v
  9498. }
  9499. reqHeaders.Set("User-Agent", c.s.userAgent())
  9500. var body io.Reader = nil
  9501. body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitjobrequest)
  9502. if err != nil {
  9503. return nil, err
  9504. }
  9505. reqHeaders.Set("Content-Type", "application/json")
  9506. c.urlParams_.Set("alt", alt)
  9507. c.urlParams_.Set("prettyPrint", "false")
  9508. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs:submit")
  9509. urls += "?" + c.urlParams_.Encode()
  9510. req, err := http.NewRequest("POST", urls, body)
  9511. if err != nil {
  9512. return nil, err
  9513. }
  9514. req.Header = reqHeaders
  9515. googleapi.Expand(req.URL, map[string]string{
  9516. "projectId": c.projectId,
  9517. "region": c.region,
  9518. })
  9519. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9520. }
  9521. // Do executes the "dataproc.projects.regions.jobs.submit" call.
  9522. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  9523. // is an error. Response headers are in either
  9524. // *Job.ServerResponse.Header or (if a response was returned at all) in
  9525. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9526. // whether the returned error was because http.StatusNotModified was
  9527. // returned.
  9528. func (c *ProjectsRegionsJobsSubmitCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  9529. gensupport.SetOptions(c.urlParams_, opts...)
  9530. res, err := c.doRequest("json")
  9531. if res != nil && res.StatusCode == http.StatusNotModified {
  9532. if res.Body != nil {
  9533. res.Body.Close()
  9534. }
  9535. return nil, &googleapi.Error{
  9536. Code: res.StatusCode,
  9537. Header: res.Header,
  9538. }
  9539. }
  9540. if err != nil {
  9541. return nil, err
  9542. }
  9543. defer googleapi.CloseBody(res)
  9544. if err := googleapi.CheckResponse(res); err != nil {
  9545. return nil, err
  9546. }
  9547. ret := &Job{
  9548. ServerResponse: googleapi.ServerResponse{
  9549. Header: res.Header,
  9550. HTTPStatusCode: res.StatusCode,
  9551. },
  9552. }
  9553. target := &ret
  9554. if err := gensupport.DecodeResponse(target, res); err != nil {
  9555. return nil, err
  9556. }
  9557. return ret, nil
  9558. // {
  9559. // "description": "Submits a job to a cluster.",
  9560. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs:submit",
  9561. // "httpMethod": "POST",
  9562. // "id": "dataproc.projects.regions.jobs.submit",
  9563. // "parameterOrder": [
  9564. // "projectId",
  9565. // "region"
  9566. // ],
  9567. // "parameters": {
  9568. // "projectId": {
  9569. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  9570. // "location": "path",
  9571. // "required": true,
  9572. // "type": "string"
  9573. // },
  9574. // "region": {
  9575. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  9576. // "location": "path",
  9577. // "required": true,
  9578. // "type": "string"
  9579. // }
  9580. // },
  9581. // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs:submit",
  9582. // "request": {
  9583. // "$ref": "SubmitJobRequest"
  9584. // },
  9585. // "response": {
  9586. // "$ref": "Job"
  9587. // },
  9588. // "scopes": [
  9589. // "https://www.googleapis.com/auth/cloud-platform"
  9590. // ]
  9591. // }
  9592. }
  9593. // method id "dataproc.projects.regions.jobs.testIamPermissions":
  9594. type ProjectsRegionsJobsTestIamPermissionsCall struct {
  9595. s *Service
  9596. resource string
  9597. testiampermissionsrequest *TestIamPermissionsRequest
  9598. urlParams_ gensupport.URLParams
  9599. ctx_ context.Context
  9600. header_ http.Header
  9601. }
  9602. // TestIamPermissions: Returns permissions that a caller has on the
  9603. // specified resource. If the resource does not exist, this will return
  9604. // an empty set of permissions, not a NOT_FOUND error.Note: This
  9605. // operation is designed to be used for building permission-aware UIs
  9606. // and command-line tools, not for authorization checking. This
  9607. // operation may "fail open" without warning.
  9608. func (r *ProjectsRegionsJobsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsJobsTestIamPermissionsCall {
  9609. c := &ProjectsRegionsJobsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9610. c.resource = resource
  9611. c.testiampermissionsrequest = testiampermissionsrequest
  9612. return c
  9613. }
  9614. // Fields allows partial responses to be retrieved. See
  9615. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9616. // for more information.
  9617. func (c *ProjectsRegionsJobsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsTestIamPermissionsCall {
  9618. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9619. return c
  9620. }
  9621. // Context sets the context to be used in this call's Do method. Any
  9622. // pending HTTP request will be aborted if the provided context is
  9623. // canceled.
  9624. func (c *ProjectsRegionsJobsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsJobsTestIamPermissionsCall {
  9625. c.ctx_ = ctx
  9626. return c
  9627. }
  9628. // Header returns an http.Header that can be modified by the caller to
  9629. // add HTTP headers to the request.
  9630. func (c *ProjectsRegionsJobsTestIamPermissionsCall) Header() http.Header {
  9631. if c.header_ == nil {
  9632. c.header_ = make(http.Header)
  9633. }
  9634. return c.header_
  9635. }
  9636. func (c *ProjectsRegionsJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  9637. reqHeaders := make(http.Header)
  9638. for k, v := range c.header_ {
  9639. reqHeaders[k] = v
  9640. }
  9641. reqHeaders.Set("User-Agent", c.s.userAgent())
  9642. var body io.Reader = nil
  9643. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  9644. if err != nil {
  9645. return nil, err
  9646. }
  9647. reqHeaders.Set("Content-Type", "application/json")
  9648. c.urlParams_.Set("alt", alt)
  9649. c.urlParams_.Set("prettyPrint", "false")
  9650. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
  9651. urls += "?" + c.urlParams_.Encode()
  9652. req, err := http.NewRequest("POST", urls, body)
  9653. if err != nil {
  9654. return nil, err
  9655. }
  9656. req.Header = reqHeaders
  9657. googleapi.Expand(req.URL, map[string]string{
  9658. "resource": c.resource,
  9659. })
  9660. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9661. }
  9662. // Do executes the "dataproc.projects.regions.jobs.testIamPermissions" call.
  9663. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  9664. // Any non-2xx status code is an error. Response headers are in either
  9665. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  9666. // was returned at all) in error.(*googleapi.Error).Header. Use
  9667. // googleapi.IsNotModified to check whether the returned error was
  9668. // because http.StatusNotModified was returned.
  9669. func (c *ProjectsRegionsJobsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  9670. gensupport.SetOptions(c.urlParams_, opts...)
  9671. res, err := c.doRequest("json")
  9672. if res != nil && res.StatusCode == http.StatusNotModified {
  9673. if res.Body != nil {
  9674. res.Body.Close()
  9675. }
  9676. return nil, &googleapi.Error{
  9677. Code: res.StatusCode,
  9678. Header: res.Header,
  9679. }
  9680. }
  9681. if err != nil {
  9682. return nil, err
  9683. }
  9684. defer googleapi.CloseBody(res)
  9685. if err := googleapi.CheckResponse(res); err != nil {
  9686. return nil, err
  9687. }
  9688. ret := &TestIamPermissionsResponse{
  9689. ServerResponse: googleapi.ServerResponse{
  9690. Header: res.Header,
  9691. HTTPStatusCode: res.StatusCode,
  9692. },
  9693. }
  9694. target := &ret
  9695. if err := gensupport.DecodeResponse(target, res); err != nil {
  9696. return nil, err
  9697. }
  9698. return ret, nil
  9699. // {
  9700. // "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.",
  9701. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:testIamPermissions",
  9702. // "httpMethod": "POST",
  9703. // "id": "dataproc.projects.regions.jobs.testIamPermissions",
  9704. // "parameterOrder": [
  9705. // "resource"
  9706. // ],
  9707. // "parameters": {
  9708. // "resource": {
  9709. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  9710. // "location": "path",
  9711. // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$",
  9712. // "required": true,
  9713. // "type": "string"
  9714. // }
  9715. // },
  9716. // "path": "v1beta2/{+resource}:testIamPermissions",
  9717. // "request": {
  9718. // "$ref": "TestIamPermissionsRequest"
  9719. // },
  9720. // "response": {
  9721. // "$ref": "TestIamPermissionsResponse"
  9722. // },
  9723. // "scopes": [
  9724. // "https://www.googleapis.com/auth/cloud-platform"
  9725. // ]
  9726. // }
  9727. }
  9728. // method id "dataproc.projects.regions.operations.cancel":
  9729. type ProjectsRegionsOperationsCancelCall struct {
  9730. s *Service
  9731. name string
  9732. urlParams_ gensupport.URLParams
  9733. ctx_ context.Context
  9734. header_ http.Header
  9735. }
  9736. // Cancel: Starts asynchronous cancellation on a long-running operation.
  9737. // The server makes a best effort to cancel the operation, but success
  9738. // is not guaranteed. If the server doesn't support this method, it
  9739. // returns google.rpc.Code.UNIMPLEMENTED. Clients can use
  9740. // Operations.GetOperation or other methods to check whether the
  9741. // cancellation succeeded or whether the operation completed despite
  9742. // cancellation. On successful cancellation, the operation is not
  9743. // deleted; instead, it becomes an operation with an Operation.error
  9744. // value with a google.rpc.Status.code of 1, corresponding to
  9745. // Code.CANCELLED.
  9746. func (r *ProjectsRegionsOperationsService) Cancel(name string) *ProjectsRegionsOperationsCancelCall {
  9747. c := &ProjectsRegionsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9748. c.name = name
  9749. return c
  9750. }
  9751. // Fields allows partial responses to be retrieved. See
  9752. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9753. // for more information.
  9754. func (c *ProjectsRegionsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsCancelCall {
  9755. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9756. return c
  9757. }
  9758. // Context sets the context to be used in this call's Do method. Any
  9759. // pending HTTP request will be aborted if the provided context is
  9760. // canceled.
  9761. func (c *ProjectsRegionsOperationsCancelCall) Context(ctx context.Context) *ProjectsRegionsOperationsCancelCall {
  9762. c.ctx_ = ctx
  9763. return c
  9764. }
  9765. // Header returns an http.Header that can be modified by the caller to
  9766. // add HTTP headers to the request.
  9767. func (c *ProjectsRegionsOperationsCancelCall) Header() http.Header {
  9768. if c.header_ == nil {
  9769. c.header_ = make(http.Header)
  9770. }
  9771. return c.header_
  9772. }
  9773. func (c *ProjectsRegionsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  9774. reqHeaders := make(http.Header)
  9775. for k, v := range c.header_ {
  9776. reqHeaders[k] = v
  9777. }
  9778. reqHeaders.Set("User-Agent", c.s.userAgent())
  9779. var body io.Reader = nil
  9780. c.urlParams_.Set("alt", alt)
  9781. c.urlParams_.Set("prettyPrint", "false")
  9782. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:cancel")
  9783. urls += "?" + c.urlParams_.Encode()
  9784. req, err := http.NewRequest("POST", urls, body)
  9785. if err != nil {
  9786. return nil, err
  9787. }
  9788. req.Header = reqHeaders
  9789. googleapi.Expand(req.URL, map[string]string{
  9790. "name": c.name,
  9791. })
  9792. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9793. }
  9794. // Do executes the "dataproc.projects.regions.operations.cancel" call.
  9795. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  9796. // code is an error. Response headers are in either
  9797. // *Empty.ServerResponse.Header or (if a response was returned at all)
  9798. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9799. // check whether the returned error was because http.StatusNotModified
  9800. // was returned.
  9801. func (c *ProjectsRegionsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  9802. gensupport.SetOptions(c.urlParams_, opts...)
  9803. res, err := c.doRequest("json")
  9804. if res != nil && res.StatusCode == http.StatusNotModified {
  9805. if res.Body != nil {
  9806. res.Body.Close()
  9807. }
  9808. return nil, &googleapi.Error{
  9809. Code: res.StatusCode,
  9810. Header: res.Header,
  9811. }
  9812. }
  9813. if err != nil {
  9814. return nil, err
  9815. }
  9816. defer googleapi.CloseBody(res)
  9817. if err := googleapi.CheckResponse(res); err != nil {
  9818. return nil, err
  9819. }
  9820. ret := &Empty{
  9821. ServerResponse: googleapi.ServerResponse{
  9822. Header: res.Header,
  9823. HTTPStatusCode: res.StatusCode,
  9824. },
  9825. }
  9826. target := &ret
  9827. if err := gensupport.DecodeResponse(target, res); err != nil {
  9828. return nil, err
  9829. }
  9830. return ret, nil
  9831. // {
  9832. // "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.",
  9833. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:cancel",
  9834. // "httpMethod": "POST",
  9835. // "id": "dataproc.projects.regions.operations.cancel",
  9836. // "parameterOrder": [
  9837. // "name"
  9838. // ],
  9839. // "parameters": {
  9840. // "name": {
  9841. // "description": "The name of the operation resource to be cancelled.",
  9842. // "location": "path",
  9843. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  9844. // "required": true,
  9845. // "type": "string"
  9846. // }
  9847. // },
  9848. // "path": "v1beta2/{+name}:cancel",
  9849. // "response": {
  9850. // "$ref": "Empty"
  9851. // },
  9852. // "scopes": [
  9853. // "https://www.googleapis.com/auth/cloud-platform"
  9854. // ]
  9855. // }
  9856. }
  9857. // method id "dataproc.projects.regions.operations.delete":
  9858. type ProjectsRegionsOperationsDeleteCall struct {
  9859. s *Service
  9860. name string
  9861. urlParams_ gensupport.URLParams
  9862. ctx_ context.Context
  9863. header_ http.Header
  9864. }
  9865. // Delete: Deletes a long-running operation. This method indicates that
  9866. // the client is no longer interested in the operation result. It does
  9867. // not cancel the operation. If the server doesn't support this method,
  9868. // it returns google.rpc.Code.UNIMPLEMENTED.
  9869. func (r *ProjectsRegionsOperationsService) Delete(name string) *ProjectsRegionsOperationsDeleteCall {
  9870. c := &ProjectsRegionsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9871. c.name = name
  9872. return c
  9873. }
  9874. // Fields allows partial responses to be retrieved. See
  9875. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9876. // for more information.
  9877. func (c *ProjectsRegionsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsDeleteCall {
  9878. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9879. return c
  9880. }
  9881. // Context sets the context to be used in this call's Do method. Any
  9882. // pending HTTP request will be aborted if the provided context is
  9883. // canceled.
  9884. func (c *ProjectsRegionsOperationsDeleteCall) Context(ctx context.Context) *ProjectsRegionsOperationsDeleteCall {
  9885. c.ctx_ = ctx
  9886. return c
  9887. }
  9888. // Header returns an http.Header that can be modified by the caller to
  9889. // add HTTP headers to the request.
  9890. func (c *ProjectsRegionsOperationsDeleteCall) Header() http.Header {
  9891. if c.header_ == nil {
  9892. c.header_ = make(http.Header)
  9893. }
  9894. return c.header_
  9895. }
  9896. func (c *ProjectsRegionsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  9897. reqHeaders := make(http.Header)
  9898. for k, v := range c.header_ {
  9899. reqHeaders[k] = v
  9900. }
  9901. reqHeaders.Set("User-Agent", c.s.userAgent())
  9902. var body io.Reader = nil
  9903. c.urlParams_.Set("alt", alt)
  9904. c.urlParams_.Set("prettyPrint", "false")
  9905. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  9906. urls += "?" + c.urlParams_.Encode()
  9907. req, err := http.NewRequest("DELETE", urls, body)
  9908. if err != nil {
  9909. return nil, err
  9910. }
  9911. req.Header = reqHeaders
  9912. googleapi.Expand(req.URL, map[string]string{
  9913. "name": c.name,
  9914. })
  9915. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9916. }
  9917. // Do executes the "dataproc.projects.regions.operations.delete" call.
  9918. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  9919. // code is an error. Response headers are in either
  9920. // *Empty.ServerResponse.Header or (if a response was returned at all)
  9921. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9922. // check whether the returned error was because http.StatusNotModified
  9923. // was returned.
  9924. func (c *ProjectsRegionsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  9925. gensupport.SetOptions(c.urlParams_, opts...)
  9926. res, err := c.doRequest("json")
  9927. if res != nil && res.StatusCode == http.StatusNotModified {
  9928. if res.Body != nil {
  9929. res.Body.Close()
  9930. }
  9931. return nil, &googleapi.Error{
  9932. Code: res.StatusCode,
  9933. Header: res.Header,
  9934. }
  9935. }
  9936. if err != nil {
  9937. return nil, err
  9938. }
  9939. defer googleapi.CloseBody(res)
  9940. if err := googleapi.CheckResponse(res); err != nil {
  9941. return nil, err
  9942. }
  9943. ret := &Empty{
  9944. ServerResponse: googleapi.ServerResponse{
  9945. Header: res.Header,
  9946. HTTPStatusCode: res.StatusCode,
  9947. },
  9948. }
  9949. target := &ret
  9950. if err := gensupport.DecodeResponse(target, res); err != nil {
  9951. return nil, err
  9952. }
  9953. return ret, nil
  9954. // {
  9955. // "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.",
  9956. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}",
  9957. // "httpMethod": "DELETE",
  9958. // "id": "dataproc.projects.regions.operations.delete",
  9959. // "parameterOrder": [
  9960. // "name"
  9961. // ],
  9962. // "parameters": {
  9963. // "name": {
  9964. // "description": "The name of the operation resource to be deleted.",
  9965. // "location": "path",
  9966. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  9967. // "required": true,
  9968. // "type": "string"
  9969. // }
  9970. // },
  9971. // "path": "v1beta2/{+name}",
  9972. // "response": {
  9973. // "$ref": "Empty"
  9974. // },
  9975. // "scopes": [
  9976. // "https://www.googleapis.com/auth/cloud-platform"
  9977. // ]
  9978. // }
  9979. }
  9980. // method id "dataproc.projects.regions.operations.get":
  9981. type ProjectsRegionsOperationsGetCall struct {
  9982. s *Service
  9983. name string
  9984. urlParams_ gensupport.URLParams
  9985. ifNoneMatch_ string
  9986. ctx_ context.Context
  9987. header_ http.Header
  9988. }
  9989. // Get: Gets the latest state of a long-running operation. Clients can
  9990. // use this method to poll the operation result at intervals as
  9991. // recommended by the API service.
  9992. func (r *ProjectsRegionsOperationsService) Get(name string) *ProjectsRegionsOperationsGetCall {
  9993. c := &ProjectsRegionsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9994. c.name = name
  9995. return c
  9996. }
  9997. // Fields allows partial responses to be retrieved. See
  9998. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9999. // for more information.
  10000. func (c *ProjectsRegionsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsGetCall {
  10001. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10002. return c
  10003. }
  10004. // IfNoneMatch sets the optional parameter which makes the operation
  10005. // fail if the object's ETag matches the given value. This is useful for
  10006. // getting updates only after the object has changed since the last
  10007. // request. Use googleapi.IsNotModified to check whether the response
  10008. // error from Do is the result of In-None-Match.
  10009. func (c *ProjectsRegionsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsGetCall {
  10010. c.ifNoneMatch_ = entityTag
  10011. return c
  10012. }
  10013. // Context sets the context to be used in this call's Do method. Any
  10014. // pending HTTP request will be aborted if the provided context is
  10015. // canceled.
  10016. func (c *ProjectsRegionsOperationsGetCall) Context(ctx context.Context) *ProjectsRegionsOperationsGetCall {
  10017. c.ctx_ = ctx
  10018. return c
  10019. }
  10020. // Header returns an http.Header that can be modified by the caller to
  10021. // add HTTP headers to the request.
  10022. func (c *ProjectsRegionsOperationsGetCall) Header() http.Header {
  10023. if c.header_ == nil {
  10024. c.header_ = make(http.Header)
  10025. }
  10026. return c.header_
  10027. }
  10028. func (c *ProjectsRegionsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  10029. reqHeaders := make(http.Header)
  10030. for k, v := range c.header_ {
  10031. reqHeaders[k] = v
  10032. }
  10033. reqHeaders.Set("User-Agent", c.s.userAgent())
  10034. if c.ifNoneMatch_ != "" {
  10035. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10036. }
  10037. var body io.Reader = nil
  10038. c.urlParams_.Set("alt", alt)
  10039. c.urlParams_.Set("prettyPrint", "false")
  10040. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  10041. urls += "?" + c.urlParams_.Encode()
  10042. req, err := http.NewRequest("GET", urls, body)
  10043. if err != nil {
  10044. return nil, err
  10045. }
  10046. req.Header = reqHeaders
  10047. googleapi.Expand(req.URL, map[string]string{
  10048. "name": c.name,
  10049. })
  10050. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10051. }
  10052. // Do executes the "dataproc.projects.regions.operations.get" call.
  10053. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  10054. // status code is an error. Response headers are in either
  10055. // *Operation.ServerResponse.Header or (if a response was returned at
  10056. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  10057. // to check whether the returned error was because
  10058. // http.StatusNotModified was returned.
  10059. func (c *ProjectsRegionsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  10060. gensupport.SetOptions(c.urlParams_, opts...)
  10061. res, err := c.doRequest("json")
  10062. if res != nil && res.StatusCode == http.StatusNotModified {
  10063. if res.Body != nil {
  10064. res.Body.Close()
  10065. }
  10066. return nil, &googleapi.Error{
  10067. Code: res.StatusCode,
  10068. Header: res.Header,
  10069. }
  10070. }
  10071. if err != nil {
  10072. return nil, err
  10073. }
  10074. defer googleapi.CloseBody(res)
  10075. if err := googleapi.CheckResponse(res); err != nil {
  10076. return nil, err
  10077. }
  10078. ret := &Operation{
  10079. ServerResponse: googleapi.ServerResponse{
  10080. Header: res.Header,
  10081. HTTPStatusCode: res.StatusCode,
  10082. },
  10083. }
  10084. target := &ret
  10085. if err := gensupport.DecodeResponse(target, res); err != nil {
  10086. return nil, err
  10087. }
  10088. return ret, nil
  10089. // {
  10090. // "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.",
  10091. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}",
  10092. // "httpMethod": "GET",
  10093. // "id": "dataproc.projects.regions.operations.get",
  10094. // "parameterOrder": [
  10095. // "name"
  10096. // ],
  10097. // "parameters": {
  10098. // "name": {
  10099. // "description": "The name of the operation resource.",
  10100. // "location": "path",
  10101. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  10102. // "required": true,
  10103. // "type": "string"
  10104. // }
  10105. // },
  10106. // "path": "v1beta2/{+name}",
  10107. // "response": {
  10108. // "$ref": "Operation"
  10109. // },
  10110. // "scopes": [
  10111. // "https://www.googleapis.com/auth/cloud-platform"
  10112. // ]
  10113. // }
  10114. }
  10115. // method id "dataproc.projects.regions.operations.getIamPolicy":
  10116. type ProjectsRegionsOperationsGetIamPolicyCall struct {
  10117. s *Service
  10118. resource string
  10119. urlParams_ gensupport.URLParams
  10120. ifNoneMatch_ string
  10121. ctx_ context.Context
  10122. header_ http.Header
  10123. }
  10124. // GetIamPolicy: Gets the access control policy for a resource. Returns
  10125. // an empty policy if the resource exists and does not have a policy
  10126. // set.
  10127. func (r *ProjectsRegionsOperationsService) GetIamPolicy(resource string) *ProjectsRegionsOperationsGetIamPolicyCall {
  10128. c := &ProjectsRegionsOperationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10129. c.resource = resource
  10130. return c
  10131. }
  10132. // Fields allows partial responses to be retrieved. See
  10133. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10134. // for more information.
  10135. func (c *ProjectsRegionsOperationsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsGetIamPolicyCall {
  10136. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10137. return c
  10138. }
  10139. // IfNoneMatch sets the optional parameter which makes the operation
  10140. // fail if the object's ETag matches the given value. This is useful for
  10141. // getting updates only after the object has changed since the last
  10142. // request. Use googleapi.IsNotModified to check whether the response
  10143. // error from Do is the result of In-None-Match.
  10144. func (c *ProjectsRegionsOperationsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsGetIamPolicyCall {
  10145. c.ifNoneMatch_ = entityTag
  10146. return c
  10147. }
  10148. // Context sets the context to be used in this call's Do method. Any
  10149. // pending HTTP request will be aborted if the provided context is
  10150. // canceled.
  10151. func (c *ProjectsRegionsOperationsGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsOperationsGetIamPolicyCall {
  10152. c.ctx_ = ctx
  10153. return c
  10154. }
  10155. // Header returns an http.Header that can be modified by the caller to
  10156. // add HTTP headers to the request.
  10157. func (c *ProjectsRegionsOperationsGetIamPolicyCall) Header() http.Header {
  10158. if c.header_ == nil {
  10159. c.header_ = make(http.Header)
  10160. }
  10161. return c.header_
  10162. }
  10163. func (c *ProjectsRegionsOperationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  10164. reqHeaders := make(http.Header)
  10165. for k, v := range c.header_ {
  10166. reqHeaders[k] = v
  10167. }
  10168. reqHeaders.Set("User-Agent", c.s.userAgent())
  10169. if c.ifNoneMatch_ != "" {
  10170. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10171. }
  10172. var body io.Reader = nil
  10173. c.urlParams_.Set("alt", alt)
  10174. c.urlParams_.Set("prettyPrint", "false")
  10175. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
  10176. urls += "?" + c.urlParams_.Encode()
  10177. req, err := http.NewRequest("GET", urls, body)
  10178. if err != nil {
  10179. return nil, err
  10180. }
  10181. req.Header = reqHeaders
  10182. googleapi.Expand(req.URL, map[string]string{
  10183. "resource": c.resource,
  10184. })
  10185. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10186. }
  10187. // Do executes the "dataproc.projects.regions.operations.getIamPolicy" call.
  10188. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  10189. // code is an error. Response headers are in either
  10190. // *Policy.ServerResponse.Header or (if a response was returned at all)
  10191. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10192. // check whether the returned error was because http.StatusNotModified
  10193. // was returned.
  10194. func (c *ProjectsRegionsOperationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  10195. gensupport.SetOptions(c.urlParams_, opts...)
  10196. res, err := c.doRequest("json")
  10197. if res != nil && res.StatusCode == http.StatusNotModified {
  10198. if res.Body != nil {
  10199. res.Body.Close()
  10200. }
  10201. return nil, &googleapi.Error{
  10202. Code: res.StatusCode,
  10203. Header: res.Header,
  10204. }
  10205. }
  10206. if err != nil {
  10207. return nil, err
  10208. }
  10209. defer googleapi.CloseBody(res)
  10210. if err := googleapi.CheckResponse(res); err != nil {
  10211. return nil, err
  10212. }
  10213. ret := &Policy{
  10214. ServerResponse: googleapi.ServerResponse{
  10215. Header: res.Header,
  10216. HTTPStatusCode: res.StatusCode,
  10217. },
  10218. }
  10219. target := &ret
  10220. if err := gensupport.DecodeResponse(target, res); err != nil {
  10221. return nil, err
  10222. }
  10223. return ret, nil
  10224. // {
  10225. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  10226. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:getIamPolicy",
  10227. // "httpMethod": "GET",
  10228. // "id": "dataproc.projects.regions.operations.getIamPolicy",
  10229. // "parameterOrder": [
  10230. // "resource"
  10231. // ],
  10232. // "parameters": {
  10233. // "resource": {
  10234. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  10235. // "location": "path",
  10236. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  10237. // "required": true,
  10238. // "type": "string"
  10239. // }
  10240. // },
  10241. // "path": "v1beta2/{+resource}:getIamPolicy",
  10242. // "response": {
  10243. // "$ref": "Policy"
  10244. // },
  10245. // "scopes": [
  10246. // "https://www.googleapis.com/auth/cloud-platform"
  10247. // ]
  10248. // }
  10249. }
  10250. // method id "dataproc.projects.regions.operations.list":
  10251. type ProjectsRegionsOperationsListCall struct {
  10252. s *Service
  10253. name string
  10254. urlParams_ gensupport.URLParams
  10255. ifNoneMatch_ string
  10256. ctx_ context.Context
  10257. header_ http.Header
  10258. }
  10259. // List: Lists operations that match the specified filter in the
  10260. // request. If the server doesn't support this method, it returns
  10261. // UNIMPLEMENTED.NOTE: the name binding allows API services to override
  10262. // the binding to use different resource name schemes, such as
  10263. // users/*/operations. To override the binding, API services can add a
  10264. // binding such as "/v1/{name=users/*}/operations" to their service
  10265. // configuration. For backwards compatibility, the default name includes
  10266. // the operations collection id, however overriding users must ensure
  10267. // the name binding is the parent resource, without the operations
  10268. // collection id.
  10269. func (r *ProjectsRegionsOperationsService) List(name string) *ProjectsRegionsOperationsListCall {
  10270. c := &ProjectsRegionsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10271. c.name = name
  10272. return c
  10273. }
  10274. // Filter sets the optional parameter "filter": The standard list
  10275. // filter.
  10276. func (c *ProjectsRegionsOperationsListCall) Filter(filter string) *ProjectsRegionsOperationsListCall {
  10277. c.urlParams_.Set("filter", filter)
  10278. return c
  10279. }
  10280. // PageSize sets the optional parameter "pageSize": The standard list
  10281. // page size.
  10282. func (c *ProjectsRegionsOperationsListCall) PageSize(pageSize int64) *ProjectsRegionsOperationsListCall {
  10283. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  10284. return c
  10285. }
  10286. // PageToken sets the optional parameter "pageToken": The standard list
  10287. // page token.
  10288. func (c *ProjectsRegionsOperationsListCall) PageToken(pageToken string) *ProjectsRegionsOperationsListCall {
  10289. c.urlParams_.Set("pageToken", pageToken)
  10290. return c
  10291. }
  10292. // Fields allows partial responses to be retrieved. See
  10293. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10294. // for more information.
  10295. func (c *ProjectsRegionsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsListCall {
  10296. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10297. return c
  10298. }
  10299. // IfNoneMatch sets the optional parameter which makes the operation
  10300. // fail if the object's ETag matches the given value. This is useful for
  10301. // getting updates only after the object has changed since the last
  10302. // request. Use googleapi.IsNotModified to check whether the response
  10303. // error from Do is the result of In-None-Match.
  10304. func (c *ProjectsRegionsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsListCall {
  10305. c.ifNoneMatch_ = entityTag
  10306. return c
  10307. }
  10308. // Context sets the context to be used in this call's Do method. Any
  10309. // pending HTTP request will be aborted if the provided context is
  10310. // canceled.
  10311. func (c *ProjectsRegionsOperationsListCall) Context(ctx context.Context) *ProjectsRegionsOperationsListCall {
  10312. c.ctx_ = ctx
  10313. return c
  10314. }
  10315. // Header returns an http.Header that can be modified by the caller to
  10316. // add HTTP headers to the request.
  10317. func (c *ProjectsRegionsOperationsListCall) Header() http.Header {
  10318. if c.header_ == nil {
  10319. c.header_ = make(http.Header)
  10320. }
  10321. return c.header_
  10322. }
  10323. func (c *ProjectsRegionsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  10324. reqHeaders := make(http.Header)
  10325. for k, v := range c.header_ {
  10326. reqHeaders[k] = v
  10327. }
  10328. reqHeaders.Set("User-Agent", c.s.userAgent())
  10329. if c.ifNoneMatch_ != "" {
  10330. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  10331. }
  10332. var body io.Reader = nil
  10333. c.urlParams_.Set("alt", alt)
  10334. c.urlParams_.Set("prettyPrint", "false")
  10335. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  10336. urls += "?" + c.urlParams_.Encode()
  10337. req, err := http.NewRequest("GET", urls, body)
  10338. if err != nil {
  10339. return nil, err
  10340. }
  10341. req.Header = reqHeaders
  10342. googleapi.Expand(req.URL, map[string]string{
  10343. "name": c.name,
  10344. })
  10345. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10346. }
  10347. // Do executes the "dataproc.projects.regions.operations.list" call.
  10348. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  10349. // non-2xx status code is an error. Response headers are in either
  10350. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  10351. // returned at all) in error.(*googleapi.Error).Header. Use
  10352. // googleapi.IsNotModified to check whether the returned error was
  10353. // because http.StatusNotModified was returned.
  10354. func (c *ProjectsRegionsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  10355. gensupport.SetOptions(c.urlParams_, opts...)
  10356. res, err := c.doRequest("json")
  10357. if res != nil && res.StatusCode == http.StatusNotModified {
  10358. if res.Body != nil {
  10359. res.Body.Close()
  10360. }
  10361. return nil, &googleapi.Error{
  10362. Code: res.StatusCode,
  10363. Header: res.Header,
  10364. }
  10365. }
  10366. if err != nil {
  10367. return nil, err
  10368. }
  10369. defer googleapi.CloseBody(res)
  10370. if err := googleapi.CheckResponse(res); err != nil {
  10371. return nil, err
  10372. }
  10373. ret := &ListOperationsResponse{
  10374. ServerResponse: googleapi.ServerResponse{
  10375. Header: res.Header,
  10376. HTTPStatusCode: res.StatusCode,
  10377. },
  10378. }
  10379. target := &ret
  10380. if err := gensupport.DecodeResponse(target, res); err != nil {
  10381. return nil, err
  10382. }
  10383. return ret, nil
  10384. // {
  10385. // "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.",
  10386. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations",
  10387. // "httpMethod": "GET",
  10388. // "id": "dataproc.projects.regions.operations.list",
  10389. // "parameterOrder": [
  10390. // "name"
  10391. // ],
  10392. // "parameters": {
  10393. // "filter": {
  10394. // "description": "The standard list filter.",
  10395. // "location": "query",
  10396. // "type": "string"
  10397. // },
  10398. // "name": {
  10399. // "description": "The name of the operation's parent resource.",
  10400. // "location": "path",
  10401. // "pattern": "^projects/[^/]+/regions/[^/]+/operations$",
  10402. // "required": true,
  10403. // "type": "string"
  10404. // },
  10405. // "pageSize": {
  10406. // "description": "The standard list page size.",
  10407. // "format": "int32",
  10408. // "location": "query",
  10409. // "type": "integer"
  10410. // },
  10411. // "pageToken": {
  10412. // "description": "The standard list page token.",
  10413. // "location": "query",
  10414. // "type": "string"
  10415. // }
  10416. // },
  10417. // "path": "v1beta2/{+name}",
  10418. // "response": {
  10419. // "$ref": "ListOperationsResponse"
  10420. // },
  10421. // "scopes": [
  10422. // "https://www.googleapis.com/auth/cloud-platform"
  10423. // ]
  10424. // }
  10425. }
  10426. // Pages invokes f for each page of results.
  10427. // A non-nil error returned from f will halt the iteration.
  10428. // The provided context supersedes any context provided to the Context method.
  10429. func (c *ProjectsRegionsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  10430. c.ctx_ = ctx
  10431. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  10432. for {
  10433. x, err := c.Do()
  10434. if err != nil {
  10435. return err
  10436. }
  10437. if err := f(x); err != nil {
  10438. return err
  10439. }
  10440. if x.NextPageToken == "" {
  10441. return nil
  10442. }
  10443. c.PageToken(x.NextPageToken)
  10444. }
  10445. }
  10446. // method id "dataproc.projects.regions.operations.setIamPolicy":
  10447. type ProjectsRegionsOperationsSetIamPolicyCall struct {
  10448. s *Service
  10449. resource string
  10450. setiampolicyrequest *SetIamPolicyRequest
  10451. urlParams_ gensupport.URLParams
  10452. ctx_ context.Context
  10453. header_ http.Header
  10454. }
  10455. // SetIamPolicy: Sets the access control policy on the specified
  10456. // resource. Replaces any existing policy.
  10457. func (r *ProjectsRegionsOperationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsOperationsSetIamPolicyCall {
  10458. c := &ProjectsRegionsOperationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10459. c.resource = resource
  10460. c.setiampolicyrequest = setiampolicyrequest
  10461. return c
  10462. }
  10463. // Fields allows partial responses to be retrieved. See
  10464. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10465. // for more information.
  10466. func (c *ProjectsRegionsOperationsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsSetIamPolicyCall {
  10467. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10468. return c
  10469. }
  10470. // Context sets the context to be used in this call's Do method. Any
  10471. // pending HTTP request will be aborted if the provided context is
  10472. // canceled.
  10473. func (c *ProjectsRegionsOperationsSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsOperationsSetIamPolicyCall {
  10474. c.ctx_ = ctx
  10475. return c
  10476. }
  10477. // Header returns an http.Header that can be modified by the caller to
  10478. // add HTTP headers to the request.
  10479. func (c *ProjectsRegionsOperationsSetIamPolicyCall) Header() http.Header {
  10480. if c.header_ == nil {
  10481. c.header_ = make(http.Header)
  10482. }
  10483. return c.header_
  10484. }
  10485. func (c *ProjectsRegionsOperationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  10486. reqHeaders := make(http.Header)
  10487. for k, v := range c.header_ {
  10488. reqHeaders[k] = v
  10489. }
  10490. reqHeaders.Set("User-Agent", c.s.userAgent())
  10491. var body io.Reader = nil
  10492. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  10493. if err != nil {
  10494. return nil, err
  10495. }
  10496. reqHeaders.Set("Content-Type", "application/json")
  10497. c.urlParams_.Set("alt", alt)
  10498. c.urlParams_.Set("prettyPrint", "false")
  10499. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy")
  10500. urls += "?" + c.urlParams_.Encode()
  10501. req, err := http.NewRequest("POST", urls, body)
  10502. if err != nil {
  10503. return nil, err
  10504. }
  10505. req.Header = reqHeaders
  10506. googleapi.Expand(req.URL, map[string]string{
  10507. "resource": c.resource,
  10508. })
  10509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10510. }
  10511. // Do executes the "dataproc.projects.regions.operations.setIamPolicy" call.
  10512. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  10513. // code is an error. Response headers are in either
  10514. // *Policy.ServerResponse.Header or (if a response was returned at all)
  10515. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10516. // check whether the returned error was because http.StatusNotModified
  10517. // was returned.
  10518. func (c *ProjectsRegionsOperationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  10519. gensupport.SetOptions(c.urlParams_, opts...)
  10520. res, err := c.doRequest("json")
  10521. if res != nil && res.StatusCode == http.StatusNotModified {
  10522. if res.Body != nil {
  10523. res.Body.Close()
  10524. }
  10525. return nil, &googleapi.Error{
  10526. Code: res.StatusCode,
  10527. Header: res.Header,
  10528. }
  10529. }
  10530. if err != nil {
  10531. return nil, err
  10532. }
  10533. defer googleapi.CloseBody(res)
  10534. if err := googleapi.CheckResponse(res); err != nil {
  10535. return nil, err
  10536. }
  10537. ret := &Policy{
  10538. ServerResponse: googleapi.ServerResponse{
  10539. Header: res.Header,
  10540. HTTPStatusCode: res.StatusCode,
  10541. },
  10542. }
  10543. target := &ret
  10544. if err := gensupport.DecodeResponse(target, res); err != nil {
  10545. return nil, err
  10546. }
  10547. return ret, nil
  10548. // {
  10549. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  10550. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:setIamPolicy",
  10551. // "httpMethod": "POST",
  10552. // "id": "dataproc.projects.regions.operations.setIamPolicy",
  10553. // "parameterOrder": [
  10554. // "resource"
  10555. // ],
  10556. // "parameters": {
  10557. // "resource": {
  10558. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  10559. // "location": "path",
  10560. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  10561. // "required": true,
  10562. // "type": "string"
  10563. // }
  10564. // },
  10565. // "path": "v1beta2/{+resource}:setIamPolicy",
  10566. // "request": {
  10567. // "$ref": "SetIamPolicyRequest"
  10568. // },
  10569. // "response": {
  10570. // "$ref": "Policy"
  10571. // },
  10572. // "scopes": [
  10573. // "https://www.googleapis.com/auth/cloud-platform"
  10574. // ]
  10575. // }
  10576. }
  10577. // method id "dataproc.projects.regions.operations.testIamPermissions":
  10578. type ProjectsRegionsOperationsTestIamPermissionsCall struct {
  10579. s *Service
  10580. resource string
  10581. testiampermissionsrequest *TestIamPermissionsRequest
  10582. urlParams_ gensupport.URLParams
  10583. ctx_ context.Context
  10584. header_ http.Header
  10585. }
  10586. // TestIamPermissions: Returns permissions that a caller has on the
  10587. // specified resource. If the resource does not exist, this will return
  10588. // an empty set of permissions, not a NOT_FOUND error.Note: This
  10589. // operation is designed to be used for building permission-aware UIs
  10590. // and command-line tools, not for authorization checking. This
  10591. // operation may "fail open" without warning.
  10592. func (r *ProjectsRegionsOperationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsOperationsTestIamPermissionsCall {
  10593. c := &ProjectsRegionsOperationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10594. c.resource = resource
  10595. c.testiampermissionsrequest = testiampermissionsrequest
  10596. return c
  10597. }
  10598. // Fields allows partial responses to be retrieved. See
  10599. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10600. // for more information.
  10601. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsTestIamPermissionsCall {
  10602. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10603. return c
  10604. }
  10605. // Context sets the context to be used in this call's Do method. Any
  10606. // pending HTTP request will be aborted if the provided context is
  10607. // canceled.
  10608. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsOperationsTestIamPermissionsCall {
  10609. c.ctx_ = ctx
  10610. return c
  10611. }
  10612. // Header returns an http.Header that can be modified by the caller to
  10613. // add HTTP headers to the request.
  10614. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Header() http.Header {
  10615. if c.header_ == nil {
  10616. c.header_ = make(http.Header)
  10617. }
  10618. return c.header_
  10619. }
  10620. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  10621. reqHeaders := make(http.Header)
  10622. for k, v := range c.header_ {
  10623. reqHeaders[k] = v
  10624. }
  10625. reqHeaders.Set("User-Agent", c.s.userAgent())
  10626. var body io.Reader = nil
  10627. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  10628. if err != nil {
  10629. return nil, err
  10630. }
  10631. reqHeaders.Set("Content-Type", "application/json")
  10632. c.urlParams_.Set("alt", alt)
  10633. c.urlParams_.Set("prettyPrint", "false")
  10634. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
  10635. urls += "?" + c.urlParams_.Encode()
  10636. req, err := http.NewRequest("POST", urls, body)
  10637. if err != nil {
  10638. return nil, err
  10639. }
  10640. req.Header = reqHeaders
  10641. googleapi.Expand(req.URL, map[string]string{
  10642. "resource": c.resource,
  10643. })
  10644. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10645. }
  10646. // Do executes the "dataproc.projects.regions.operations.testIamPermissions" call.
  10647. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  10648. // Any non-2xx status code is an error. Response headers are in either
  10649. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  10650. // was returned at all) in error.(*googleapi.Error).Header. Use
  10651. // googleapi.IsNotModified to check whether the returned error was
  10652. // because http.StatusNotModified was returned.
  10653. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  10654. gensupport.SetOptions(c.urlParams_, opts...)
  10655. res, err := c.doRequest("json")
  10656. if res != nil && res.StatusCode == http.StatusNotModified {
  10657. if res.Body != nil {
  10658. res.Body.Close()
  10659. }
  10660. return nil, &googleapi.Error{
  10661. Code: res.StatusCode,
  10662. Header: res.Header,
  10663. }
  10664. }
  10665. if err != nil {
  10666. return nil, err
  10667. }
  10668. defer googleapi.CloseBody(res)
  10669. if err := googleapi.CheckResponse(res); err != nil {
  10670. return nil, err
  10671. }
  10672. ret := &TestIamPermissionsResponse{
  10673. ServerResponse: googleapi.ServerResponse{
  10674. Header: res.Header,
  10675. HTTPStatusCode: res.StatusCode,
  10676. },
  10677. }
  10678. target := &ret
  10679. if err := gensupport.DecodeResponse(target, res); err != nil {
  10680. return nil, err
  10681. }
  10682. return ret, nil
  10683. // {
  10684. // "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.",
  10685. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:testIamPermissions",
  10686. // "httpMethod": "POST",
  10687. // "id": "dataproc.projects.regions.operations.testIamPermissions",
  10688. // "parameterOrder": [
  10689. // "resource"
  10690. // ],
  10691. // "parameters": {
  10692. // "resource": {
  10693. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  10694. // "location": "path",
  10695. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  10696. // "required": true,
  10697. // "type": "string"
  10698. // }
  10699. // },
  10700. // "path": "v1beta2/{+resource}:testIamPermissions",
  10701. // "request": {
  10702. // "$ref": "TestIamPermissionsRequest"
  10703. // },
  10704. // "response": {
  10705. // "$ref": "TestIamPermissionsResponse"
  10706. // },
  10707. // "scopes": [
  10708. // "https://www.googleapis.com/auth/cloud-platform"
  10709. // ]
  10710. // }
  10711. }
  10712. // method id "dataproc.projects.regions.workflowTemplates.create":
  10713. type ProjectsRegionsWorkflowTemplatesCreateCall struct {
  10714. s *Service
  10715. parent string
  10716. workflowtemplate *WorkflowTemplate
  10717. urlParams_ gensupport.URLParams
  10718. ctx_ context.Context
  10719. header_ http.Header
  10720. }
  10721. // Create: Creates new workflow template.
  10722. func (r *ProjectsRegionsWorkflowTemplatesService) Create(parent string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesCreateCall {
  10723. c := &ProjectsRegionsWorkflowTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10724. c.parent = parent
  10725. c.workflowtemplate = workflowtemplate
  10726. return c
  10727. }
  10728. // Fields allows partial responses to be retrieved. See
  10729. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  10730. // for more information.
  10731. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesCreateCall {
  10732. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10733. return c
  10734. }
  10735. // Context sets the context to be used in this call's Do method. Any
  10736. // pending HTTP request will be aborted if the provided context is
  10737. // canceled.
  10738. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesCreateCall {
  10739. c.ctx_ = ctx
  10740. return c
  10741. }
  10742. // Header returns an http.Header that can be modified by the caller to
  10743. // add HTTP headers to the request.
  10744. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Header() http.Header {
  10745. if c.header_ == nil {
  10746. c.header_ = make(http.Header)
  10747. }
  10748. return c.header_
  10749. }
  10750. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) {
  10751. reqHeaders := make(http.Header)
  10752. for k, v := range c.header_ {
  10753. reqHeaders[k] = v
  10754. }
  10755. reqHeaders.Set("User-Agent", c.s.userAgent())
  10756. var body io.Reader = nil
  10757. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  10758. if err != nil {
  10759. return nil, err
  10760. }
  10761. reqHeaders.Set("Content-Type", "application/json")
  10762. c.urlParams_.Set("alt", alt)
  10763. c.urlParams_.Set("prettyPrint", "false")
  10764. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates")
  10765. urls += "?" + c.urlParams_.Encode()
  10766. req, err := http.NewRequest("POST", urls, body)
  10767. if err != nil {
  10768. return nil, err
  10769. }
  10770. req.Header = reqHeaders
  10771. googleapi.Expand(req.URL, map[string]string{
  10772. "parent": c.parent,
  10773. })
  10774. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10775. }
  10776. // Do executes the "dataproc.projects.regions.workflowTemplates.create" call.
  10777. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  10778. // non-2xx status code is an error. Response headers are in either
  10779. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  10780. // returned at all) in error.(*googleapi.Error).Header. Use
  10781. // googleapi.IsNotModified to check whether the returned error was
  10782. // because http.StatusNotModified was returned.
  10783. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  10784. gensupport.SetOptions(c.urlParams_, opts...)
  10785. res, err := c.doRequest("json")
  10786. if res != nil && res.StatusCode == http.StatusNotModified {
  10787. if res.Body != nil {
  10788. res.Body.Close()
  10789. }
  10790. return nil, &googleapi.Error{
  10791. Code: res.StatusCode,
  10792. Header: res.Header,
  10793. }
  10794. }
  10795. if err != nil {
  10796. return nil, err
  10797. }
  10798. defer googleapi.CloseBody(res)
  10799. if err := googleapi.CheckResponse(res); err != nil {
  10800. return nil, err
  10801. }
  10802. ret := &WorkflowTemplate{
  10803. ServerResponse: googleapi.ServerResponse{
  10804. Header: res.Header,
  10805. HTTPStatusCode: res.StatusCode,
  10806. },
  10807. }
  10808. target := &ret
  10809. if err := gensupport.DecodeResponse(target, res); err != nil {
  10810. return nil, err
  10811. }
  10812. return ret, nil
  10813. // {
  10814. // "description": "Creates new workflow template.",
  10815. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates",
  10816. // "httpMethod": "POST",
  10817. // "id": "dataproc.projects.regions.workflowTemplates.create",
  10818. // "parameterOrder": [
  10819. // "parent"
  10820. // ],
  10821. // "parameters": {
  10822. // "parent": {
  10823. // "description": "Required. The \"resource name\" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}",
  10824. // "location": "path",
  10825. // "pattern": "^projects/[^/]+/regions/[^/]+$",
  10826. // "required": true,
  10827. // "type": "string"
  10828. // }
  10829. // },
  10830. // "path": "v1beta2/{+parent}/workflowTemplates",
  10831. // "request": {
  10832. // "$ref": "WorkflowTemplate"
  10833. // },
  10834. // "response": {
  10835. // "$ref": "WorkflowTemplate"
  10836. // },
  10837. // "scopes": [
  10838. // "https://www.googleapis.com/auth/cloud-platform"
  10839. // ]
  10840. // }
  10841. }
  10842. // method id "dataproc.projects.regions.workflowTemplates.delete":
  10843. type ProjectsRegionsWorkflowTemplatesDeleteCall struct {
  10844. s *Service
  10845. name string
  10846. urlParams_ gensupport.URLParams
  10847. ctx_ context.Context
  10848. header_ http.Header
  10849. }
  10850. // Delete: Deletes a workflow template. It does not cancel in-progress
  10851. // workflows.
  10852. func (r *ProjectsRegionsWorkflowTemplatesService) Delete(name string) *ProjectsRegionsWorkflowTemplatesDeleteCall {
  10853. c := &ProjectsRegionsWorkflowTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10854. c.name = name
  10855. return c
  10856. }
  10857. // Version sets the optional parameter "version": The version of
  10858. // workflow template to delete. If specified, will only delete the
  10859. // template if the current server version matches specified version.
  10860. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Version(version int64) *ProjectsRegionsWorkflowTemplatesDeleteCall {
  10861. c.urlParams_.Set("version", fmt.Sprint(version))
  10862. return c
  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 *ProjectsRegionsWorkflowTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesDeleteCall {
  10868. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  10869. return c
  10870. }
  10871. // Context sets the context to be used in this call's Do method. Any
  10872. // pending HTTP request will be aborted if the provided context is
  10873. // canceled.
  10874. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesDeleteCall {
  10875. c.ctx_ = ctx
  10876. return c
  10877. }
  10878. // Header returns an http.Header that can be modified by the caller to
  10879. // add HTTP headers to the request.
  10880. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Header() http.Header {
  10881. if c.header_ == nil {
  10882. c.header_ = make(http.Header)
  10883. }
  10884. return c.header_
  10885. }
  10886. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  10887. reqHeaders := make(http.Header)
  10888. for k, v := range c.header_ {
  10889. reqHeaders[k] = v
  10890. }
  10891. reqHeaders.Set("User-Agent", c.s.userAgent())
  10892. var body io.Reader = nil
  10893. c.urlParams_.Set("alt", alt)
  10894. c.urlParams_.Set("prettyPrint", "false")
  10895. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  10896. urls += "?" + c.urlParams_.Encode()
  10897. req, err := http.NewRequest("DELETE", urls, body)
  10898. if err != nil {
  10899. return nil, err
  10900. }
  10901. req.Header = reqHeaders
  10902. googleapi.Expand(req.URL, map[string]string{
  10903. "name": c.name,
  10904. })
  10905. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  10906. }
  10907. // Do executes the "dataproc.projects.regions.workflowTemplates.delete" call.
  10908. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  10909. // code is an error. Response headers are in either
  10910. // *Empty.ServerResponse.Header or (if a response was returned at all)
  10911. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  10912. // check whether the returned error was because http.StatusNotModified
  10913. // was returned.
  10914. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  10915. gensupport.SetOptions(c.urlParams_, opts...)
  10916. res, err := c.doRequest("json")
  10917. if res != nil && res.StatusCode == http.StatusNotModified {
  10918. if res.Body != nil {
  10919. res.Body.Close()
  10920. }
  10921. return nil, &googleapi.Error{
  10922. Code: res.StatusCode,
  10923. Header: res.Header,
  10924. }
  10925. }
  10926. if err != nil {
  10927. return nil, err
  10928. }
  10929. defer googleapi.CloseBody(res)
  10930. if err := googleapi.CheckResponse(res); err != nil {
  10931. return nil, err
  10932. }
  10933. ret := &Empty{
  10934. ServerResponse: googleapi.ServerResponse{
  10935. Header: res.Header,
  10936. HTTPStatusCode: res.StatusCode,
  10937. },
  10938. }
  10939. target := &ret
  10940. if err := gensupport.DecodeResponse(target, res); err != nil {
  10941. return nil, err
  10942. }
  10943. return ret, nil
  10944. // {
  10945. // "description": "Deletes a workflow template. It does not cancel in-progress workflows.",
  10946. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}",
  10947. // "httpMethod": "DELETE",
  10948. // "id": "dataproc.projects.regions.workflowTemplates.delete",
  10949. // "parameterOrder": [
  10950. // "name"
  10951. // ],
  10952. // "parameters": {
  10953. // "name": {
  10954. // "description": "Required. The \"resource name\" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}",
  10955. // "location": "path",
  10956. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  10957. // "required": true,
  10958. // "type": "string"
  10959. // },
  10960. // "version": {
  10961. // "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.",
  10962. // "format": "int32",
  10963. // "location": "query",
  10964. // "type": "integer"
  10965. // }
  10966. // },
  10967. // "path": "v1beta2/{+name}",
  10968. // "response": {
  10969. // "$ref": "Empty"
  10970. // },
  10971. // "scopes": [
  10972. // "https://www.googleapis.com/auth/cloud-platform"
  10973. // ]
  10974. // }
  10975. }
  10976. // method id "dataproc.projects.regions.workflowTemplates.get":
  10977. type ProjectsRegionsWorkflowTemplatesGetCall struct {
  10978. s *Service
  10979. name string
  10980. urlParams_ gensupport.URLParams
  10981. ifNoneMatch_ string
  10982. ctx_ context.Context
  10983. header_ http.Header
  10984. }
  10985. // Get: Retrieves the latest workflow template.Can retrieve previously
  10986. // instantiated template by specifying optional version parameter.
  10987. func (r *ProjectsRegionsWorkflowTemplatesService) Get(name string) *ProjectsRegionsWorkflowTemplatesGetCall {
  10988. c := &ProjectsRegionsWorkflowTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  10989. c.name = name
  10990. return c
  10991. }
  10992. // Version sets the optional parameter "version": The version of
  10993. // workflow template to retrieve. Only previously instatiated versions
  10994. // can be retrieved.If unspecified, retrieves the current version.
  10995. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Version(version int64) *ProjectsRegionsWorkflowTemplatesGetCall {
  10996. c.urlParams_.Set("version", fmt.Sprint(version))
  10997. return c
  10998. }
  10999. // Fields allows partial responses to be retrieved. See
  11000. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11001. // for more information.
  11002. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesGetCall {
  11003. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11004. return c
  11005. }
  11006. // IfNoneMatch sets the optional parameter which makes the operation
  11007. // fail if the object's ETag matches the given value. This is useful for
  11008. // getting updates only after the object has changed since the last
  11009. // request. Use googleapi.IsNotModified to check whether the response
  11010. // error from Do is the result of In-None-Match.
  11011. func (c *ProjectsRegionsWorkflowTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesGetCall {
  11012. c.ifNoneMatch_ = entityTag
  11013. return c
  11014. }
  11015. // Context sets the context to be used in this call's Do method. Any
  11016. // pending HTTP request will be aborted if the provided context is
  11017. // canceled.
  11018. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesGetCall {
  11019. c.ctx_ = ctx
  11020. return c
  11021. }
  11022. // Header returns an http.Header that can be modified by the caller to
  11023. // add HTTP headers to the request.
  11024. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Header() http.Header {
  11025. if c.header_ == nil {
  11026. c.header_ = make(http.Header)
  11027. }
  11028. return c.header_
  11029. }
  11030. func (c *ProjectsRegionsWorkflowTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  11031. reqHeaders := make(http.Header)
  11032. for k, v := range c.header_ {
  11033. reqHeaders[k] = v
  11034. }
  11035. reqHeaders.Set("User-Agent", c.s.userAgent())
  11036. if c.ifNoneMatch_ != "" {
  11037. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11038. }
  11039. var body io.Reader = nil
  11040. c.urlParams_.Set("alt", alt)
  11041. c.urlParams_.Set("prettyPrint", "false")
  11042. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  11043. urls += "?" + c.urlParams_.Encode()
  11044. req, err := http.NewRequest("GET", urls, body)
  11045. if err != nil {
  11046. return nil, err
  11047. }
  11048. req.Header = reqHeaders
  11049. googleapi.Expand(req.URL, map[string]string{
  11050. "name": c.name,
  11051. })
  11052. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11053. }
  11054. // Do executes the "dataproc.projects.regions.workflowTemplates.get" call.
  11055. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  11056. // non-2xx status code is an error. Response headers are in either
  11057. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  11058. // returned at all) in error.(*googleapi.Error).Header. Use
  11059. // googleapi.IsNotModified to check whether the returned error was
  11060. // because http.StatusNotModified was returned.
  11061. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  11062. gensupport.SetOptions(c.urlParams_, opts...)
  11063. res, err := c.doRequest("json")
  11064. if res != nil && res.StatusCode == http.StatusNotModified {
  11065. if res.Body != nil {
  11066. res.Body.Close()
  11067. }
  11068. return nil, &googleapi.Error{
  11069. Code: res.StatusCode,
  11070. Header: res.Header,
  11071. }
  11072. }
  11073. if err != nil {
  11074. return nil, err
  11075. }
  11076. defer googleapi.CloseBody(res)
  11077. if err := googleapi.CheckResponse(res); err != nil {
  11078. return nil, err
  11079. }
  11080. ret := &WorkflowTemplate{
  11081. ServerResponse: googleapi.ServerResponse{
  11082. Header: res.Header,
  11083. HTTPStatusCode: res.StatusCode,
  11084. },
  11085. }
  11086. target := &ret
  11087. if err := gensupport.DecodeResponse(target, res); err != nil {
  11088. return nil, err
  11089. }
  11090. return ret, nil
  11091. // {
  11092. // "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.",
  11093. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}",
  11094. // "httpMethod": "GET",
  11095. // "id": "dataproc.projects.regions.workflowTemplates.get",
  11096. // "parameterOrder": [
  11097. // "name"
  11098. // ],
  11099. // "parameters": {
  11100. // "name": {
  11101. // "description": "Required. The \"resource name\" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}",
  11102. // "location": "path",
  11103. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  11104. // "required": true,
  11105. // "type": "string"
  11106. // },
  11107. // "version": {
  11108. // "description": "Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version.",
  11109. // "format": "int32",
  11110. // "location": "query",
  11111. // "type": "integer"
  11112. // }
  11113. // },
  11114. // "path": "v1beta2/{+name}",
  11115. // "response": {
  11116. // "$ref": "WorkflowTemplate"
  11117. // },
  11118. // "scopes": [
  11119. // "https://www.googleapis.com/auth/cloud-platform"
  11120. // ]
  11121. // }
  11122. }
  11123. // method id "dataproc.projects.regions.workflowTemplates.getIamPolicy":
  11124. type ProjectsRegionsWorkflowTemplatesGetIamPolicyCall struct {
  11125. s *Service
  11126. resource string
  11127. urlParams_ gensupport.URLParams
  11128. ifNoneMatch_ string
  11129. ctx_ context.Context
  11130. header_ http.Header
  11131. }
  11132. // GetIamPolicy: Gets the access control policy for a resource. Returns
  11133. // an empty policy if the resource exists and does not have a policy
  11134. // set.
  11135. func (r *ProjectsRegionsWorkflowTemplatesService) GetIamPolicy(resource string) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall {
  11136. c := &ProjectsRegionsWorkflowTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11137. c.resource = resource
  11138. return c
  11139. }
  11140. // Fields allows partial responses to be retrieved. See
  11141. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11142. // for more information.
  11143. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall {
  11144. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11145. return c
  11146. }
  11147. // IfNoneMatch sets the optional parameter which makes the operation
  11148. // fail if the object's ETag matches the given value. This is useful for
  11149. // getting updates only after the object has changed since the last
  11150. // request. Use googleapi.IsNotModified to check whether the response
  11151. // error from Do is the result of In-None-Match.
  11152. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall {
  11153. c.ifNoneMatch_ = entityTag
  11154. return c
  11155. }
  11156. // Context sets the context to be used in this call's Do method. Any
  11157. // pending HTTP request will be aborted if the provided context is
  11158. // canceled.
  11159. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall {
  11160. c.ctx_ = ctx
  11161. return c
  11162. }
  11163. // Header returns an http.Header that can be modified by the caller to
  11164. // add HTTP headers to the request.
  11165. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Header() http.Header {
  11166. if c.header_ == nil {
  11167. c.header_ = make(http.Header)
  11168. }
  11169. return c.header_
  11170. }
  11171. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  11172. reqHeaders := make(http.Header)
  11173. for k, v := range c.header_ {
  11174. reqHeaders[k] = v
  11175. }
  11176. reqHeaders.Set("User-Agent", c.s.userAgent())
  11177. if c.ifNoneMatch_ != "" {
  11178. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11179. }
  11180. var body io.Reader = nil
  11181. c.urlParams_.Set("alt", alt)
  11182. c.urlParams_.Set("prettyPrint", "false")
  11183. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
  11184. urls += "?" + c.urlParams_.Encode()
  11185. req, err := http.NewRequest("GET", urls, body)
  11186. if err != nil {
  11187. return nil, err
  11188. }
  11189. req.Header = reqHeaders
  11190. googleapi.Expand(req.URL, map[string]string{
  11191. "resource": c.resource,
  11192. })
  11193. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11194. }
  11195. // Do executes the "dataproc.projects.regions.workflowTemplates.getIamPolicy" call.
  11196. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  11197. // code is an error. Response headers are in either
  11198. // *Policy.ServerResponse.Header or (if a response was returned at all)
  11199. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  11200. // check whether the returned error was because http.StatusNotModified
  11201. // was returned.
  11202. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  11203. gensupport.SetOptions(c.urlParams_, opts...)
  11204. res, err := c.doRequest("json")
  11205. if res != nil && res.StatusCode == http.StatusNotModified {
  11206. if res.Body != nil {
  11207. res.Body.Close()
  11208. }
  11209. return nil, &googleapi.Error{
  11210. Code: res.StatusCode,
  11211. Header: res.Header,
  11212. }
  11213. }
  11214. if err != nil {
  11215. return nil, err
  11216. }
  11217. defer googleapi.CloseBody(res)
  11218. if err := googleapi.CheckResponse(res); err != nil {
  11219. return nil, err
  11220. }
  11221. ret := &Policy{
  11222. ServerResponse: googleapi.ServerResponse{
  11223. Header: res.Header,
  11224. HTTPStatusCode: res.StatusCode,
  11225. },
  11226. }
  11227. target := &ret
  11228. if err := gensupport.DecodeResponse(target, res); err != nil {
  11229. return nil, err
  11230. }
  11231. return ret, nil
  11232. // {
  11233. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  11234. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:getIamPolicy",
  11235. // "httpMethod": "GET",
  11236. // "id": "dataproc.projects.regions.workflowTemplates.getIamPolicy",
  11237. // "parameterOrder": [
  11238. // "resource"
  11239. // ],
  11240. // "parameters": {
  11241. // "resource": {
  11242. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  11243. // "location": "path",
  11244. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  11245. // "required": true,
  11246. // "type": "string"
  11247. // }
  11248. // },
  11249. // "path": "v1beta2/{+resource}:getIamPolicy",
  11250. // "response": {
  11251. // "$ref": "Policy"
  11252. // },
  11253. // "scopes": [
  11254. // "https://www.googleapis.com/auth/cloud-platform"
  11255. // ]
  11256. // }
  11257. }
  11258. // method id "dataproc.projects.regions.workflowTemplates.instantiate":
  11259. type ProjectsRegionsWorkflowTemplatesInstantiateCall struct {
  11260. s *Service
  11261. name string
  11262. instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest
  11263. urlParams_ gensupport.URLParams
  11264. ctx_ context.Context
  11265. header_ http.Header
  11266. }
  11267. // Instantiate: Instantiates a template and begins execution.The
  11268. // returned Operation can be used to track execution of workflow by
  11269. // polling operations.get. The Operation will complete when entire
  11270. // workflow is finished.The running workflow can be aborted via
  11271. // operations.cancel. This will cause any inflight jobs to be cancelled
  11272. // and workflow-owned clusters to be deleted.The Operation.metadata will
  11273. // be WorkflowMetadata.On successful completion, Operation.response will
  11274. // be Empty.
  11275. func (r *ProjectsRegionsWorkflowTemplatesService) Instantiate(name string, instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest) *ProjectsRegionsWorkflowTemplatesInstantiateCall {
  11276. c := &ProjectsRegionsWorkflowTemplatesInstantiateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11277. c.name = name
  11278. c.instantiateworkflowtemplaterequest = instantiateworkflowtemplaterequest
  11279. return c
  11280. }
  11281. // Fields allows partial responses to be retrieved. See
  11282. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11283. // for more information.
  11284. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesInstantiateCall {
  11285. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11286. return c
  11287. }
  11288. // Context sets the context to be used in this call's Do method. Any
  11289. // pending HTTP request will be aborted if the provided context is
  11290. // canceled.
  11291. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesInstantiateCall {
  11292. c.ctx_ = ctx
  11293. return c
  11294. }
  11295. // Header returns an http.Header that can be modified by the caller to
  11296. // add HTTP headers to the request.
  11297. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Header() http.Header {
  11298. if c.header_ == nil {
  11299. c.header_ = make(http.Header)
  11300. }
  11301. return c.header_
  11302. }
  11303. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) {
  11304. reqHeaders := make(http.Header)
  11305. for k, v := range c.header_ {
  11306. reqHeaders[k] = v
  11307. }
  11308. reqHeaders.Set("User-Agent", c.s.userAgent())
  11309. var body io.Reader = nil
  11310. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest)
  11311. if err != nil {
  11312. return nil, err
  11313. }
  11314. reqHeaders.Set("Content-Type", "application/json")
  11315. c.urlParams_.Set("alt", alt)
  11316. c.urlParams_.Set("prettyPrint", "false")
  11317. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:instantiate")
  11318. urls += "?" + c.urlParams_.Encode()
  11319. req, err := http.NewRequest("POST", urls, body)
  11320. if err != nil {
  11321. return nil, err
  11322. }
  11323. req.Header = reqHeaders
  11324. googleapi.Expand(req.URL, map[string]string{
  11325. "name": c.name,
  11326. })
  11327. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11328. }
  11329. // Do executes the "dataproc.projects.regions.workflowTemplates.instantiate" call.
  11330. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11331. // status code is an error. Response headers are in either
  11332. // *Operation.ServerResponse.Header or (if a response was returned at
  11333. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11334. // to check whether the returned error was because
  11335. // http.StatusNotModified was returned.
  11336. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11337. gensupport.SetOptions(c.urlParams_, opts...)
  11338. res, err := c.doRequest("json")
  11339. if res != nil && res.StatusCode == http.StatusNotModified {
  11340. if res.Body != nil {
  11341. res.Body.Close()
  11342. }
  11343. return nil, &googleapi.Error{
  11344. Code: res.StatusCode,
  11345. Header: res.Header,
  11346. }
  11347. }
  11348. if err != nil {
  11349. return nil, err
  11350. }
  11351. defer googleapi.CloseBody(res)
  11352. if err := googleapi.CheckResponse(res); err != nil {
  11353. return nil, err
  11354. }
  11355. ret := &Operation{
  11356. ServerResponse: googleapi.ServerResponse{
  11357. Header: res.Header,
  11358. HTTPStatusCode: res.StatusCode,
  11359. },
  11360. }
  11361. target := &ret
  11362. if err := gensupport.DecodeResponse(target, res); err != nil {
  11363. return nil, err
  11364. }
  11365. return ret, nil
  11366. // {
  11367. // "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.On successful completion, Operation.response will be Empty.",
  11368. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:instantiate",
  11369. // "httpMethod": "POST",
  11370. // "id": "dataproc.projects.regions.workflowTemplates.instantiate",
  11371. // "parameterOrder": [
  11372. // "name"
  11373. // ],
  11374. // "parameters": {
  11375. // "name": {
  11376. // "description": "Required. The \"resource name\" of the workflow template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}",
  11377. // "location": "path",
  11378. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  11379. // "required": true,
  11380. // "type": "string"
  11381. // }
  11382. // },
  11383. // "path": "v1beta2/{+name}:instantiate",
  11384. // "request": {
  11385. // "$ref": "InstantiateWorkflowTemplateRequest"
  11386. // },
  11387. // "response": {
  11388. // "$ref": "Operation"
  11389. // },
  11390. // "scopes": [
  11391. // "https://www.googleapis.com/auth/cloud-platform"
  11392. // ]
  11393. // }
  11394. }
  11395. // method id "dataproc.projects.regions.workflowTemplates.instantiateInline":
  11396. type ProjectsRegionsWorkflowTemplatesInstantiateInlineCall struct {
  11397. s *Service
  11398. parent string
  11399. workflowtemplate *WorkflowTemplate
  11400. urlParams_ gensupport.URLParams
  11401. ctx_ context.Context
  11402. header_ http.Header
  11403. }
  11404. // InstantiateInline: Instantiates a template and begins execution.This
  11405. // method is equivalent to executing the sequence
  11406. // CreateWorkflowTemplate, InstantiateWorkflowTemplate,
  11407. // DeleteWorkflowTemplate.The returned Operation can be used to track
  11408. // execution of workflow by polling operations.get. The Operation will
  11409. // complete when entire workflow is finished.The running workflow can be
  11410. // aborted via operations.cancel. This will cause any inflight jobs to
  11411. // be cancelled and workflow-owned clusters to be deleted.The
  11412. // Operation.metadata will be WorkflowMetadata.On successful completion,
  11413. // Operation.response will be Empty.
  11414. func (r *ProjectsRegionsWorkflowTemplatesService) InstantiateInline(parent string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall {
  11415. c := &ProjectsRegionsWorkflowTemplatesInstantiateInlineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11416. c.parent = parent
  11417. c.workflowtemplate = workflowtemplate
  11418. return c
  11419. }
  11420. // InstanceId sets the optional parameter "instanceId": Deprecated.
  11421. // Please use request_id field instead.
  11422. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) InstanceId(instanceId string) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall {
  11423. c.urlParams_.Set("instanceId", instanceId)
  11424. return c
  11425. }
  11426. // RequestId sets the optional parameter "requestId": A tag that
  11427. // prevents multiple concurrent workflow instances with the same tag
  11428. // from running. This mitigates risk of concurrent instances started due
  11429. // to retries.It is recommended to always set this value to a UUID
  11430. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag
  11431. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  11432. // and hyphens (-). The maximum length is 40 characters.
  11433. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) RequestId(requestId string) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall {
  11434. c.urlParams_.Set("requestId", requestId)
  11435. return c
  11436. }
  11437. // Fields allows partial responses to be retrieved. See
  11438. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11439. // for more information.
  11440. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall {
  11441. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11442. return c
  11443. }
  11444. // Context sets the context to be used in this call's Do method. Any
  11445. // pending HTTP request will be aborted if the provided context is
  11446. // canceled.
  11447. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall {
  11448. c.ctx_ = ctx
  11449. return c
  11450. }
  11451. // Header returns an http.Header that can be modified by the caller to
  11452. // add HTTP headers to the request.
  11453. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Header() http.Header {
  11454. if c.header_ == nil {
  11455. c.header_ = make(http.Header)
  11456. }
  11457. return c.header_
  11458. }
  11459. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) {
  11460. reqHeaders := make(http.Header)
  11461. for k, v := range c.header_ {
  11462. reqHeaders[k] = v
  11463. }
  11464. reqHeaders.Set("User-Agent", c.s.userAgent())
  11465. var body io.Reader = nil
  11466. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  11467. if err != nil {
  11468. return nil, err
  11469. }
  11470. reqHeaders.Set("Content-Type", "application/json")
  11471. c.urlParams_.Set("alt", alt)
  11472. c.urlParams_.Set("prettyPrint", "false")
  11473. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates:instantiateInline")
  11474. urls += "?" + c.urlParams_.Encode()
  11475. req, err := http.NewRequest("POST", urls, body)
  11476. if err != nil {
  11477. return nil, err
  11478. }
  11479. req.Header = reqHeaders
  11480. googleapi.Expand(req.URL, map[string]string{
  11481. "parent": c.parent,
  11482. })
  11483. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11484. }
  11485. // Do executes the "dataproc.projects.regions.workflowTemplates.instantiateInline" call.
  11486. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  11487. // status code is an error. Response headers are in either
  11488. // *Operation.ServerResponse.Header or (if a response was returned at
  11489. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  11490. // to check whether the returned error was because
  11491. // http.StatusNotModified was returned.
  11492. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  11493. gensupport.SetOptions(c.urlParams_, opts...)
  11494. res, err := c.doRequest("json")
  11495. if res != nil && res.StatusCode == http.StatusNotModified {
  11496. if res.Body != nil {
  11497. res.Body.Close()
  11498. }
  11499. return nil, &googleapi.Error{
  11500. Code: res.StatusCode,
  11501. Header: res.Header,
  11502. }
  11503. }
  11504. if err != nil {
  11505. return nil, err
  11506. }
  11507. defer googleapi.CloseBody(res)
  11508. if err := googleapi.CheckResponse(res); err != nil {
  11509. return nil, err
  11510. }
  11511. ret := &Operation{
  11512. ServerResponse: googleapi.ServerResponse{
  11513. Header: res.Header,
  11514. HTTPStatusCode: res.StatusCode,
  11515. },
  11516. }
  11517. target := &ret
  11518. if err := gensupport.DecodeResponse(target, res); err != nil {
  11519. return nil, err
  11520. }
  11521. return ret, nil
  11522. // {
  11523. // "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.On successful completion, Operation.response will be Empty.",
  11524. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates:instantiateInline",
  11525. // "httpMethod": "POST",
  11526. // "id": "dataproc.projects.regions.workflowTemplates.instantiateInline",
  11527. // "parameterOrder": [
  11528. // "parent"
  11529. // ],
  11530. // "parameters": {
  11531. // "instanceId": {
  11532. // "description": "Deprecated. Please use request_id field instead.",
  11533. // "location": "query",
  11534. // "type": "string"
  11535. // },
  11536. // "parent": {
  11537. // "description": "Required. The \"resource name\" of the workflow template region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}",
  11538. // "location": "path",
  11539. // "pattern": "^projects/[^/]+/regions/[^/]+$",
  11540. // "required": true,
  11541. // "type": "string"
  11542. // },
  11543. // "requestId": {
  11544. // "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.",
  11545. // "location": "query",
  11546. // "type": "string"
  11547. // }
  11548. // },
  11549. // "path": "v1beta2/{+parent}/workflowTemplates:instantiateInline",
  11550. // "request": {
  11551. // "$ref": "WorkflowTemplate"
  11552. // },
  11553. // "response": {
  11554. // "$ref": "Operation"
  11555. // },
  11556. // "scopes": [
  11557. // "https://www.googleapis.com/auth/cloud-platform"
  11558. // ]
  11559. // }
  11560. }
  11561. // method id "dataproc.projects.regions.workflowTemplates.list":
  11562. type ProjectsRegionsWorkflowTemplatesListCall struct {
  11563. s *Service
  11564. parent string
  11565. urlParams_ gensupport.URLParams
  11566. ifNoneMatch_ string
  11567. ctx_ context.Context
  11568. header_ http.Header
  11569. }
  11570. // List: Lists workflows that match the specified filter in the request.
  11571. func (r *ProjectsRegionsWorkflowTemplatesService) List(parent string) *ProjectsRegionsWorkflowTemplatesListCall {
  11572. c := &ProjectsRegionsWorkflowTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11573. c.parent = parent
  11574. return c
  11575. }
  11576. // PageSize sets the optional parameter "pageSize": The maximum number
  11577. // of results to return in each response.
  11578. func (c *ProjectsRegionsWorkflowTemplatesListCall) PageSize(pageSize int64) *ProjectsRegionsWorkflowTemplatesListCall {
  11579. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  11580. return c
  11581. }
  11582. // PageToken sets the optional parameter "pageToken": The page token,
  11583. // returned by a previous call, to request the next page of results.
  11584. func (c *ProjectsRegionsWorkflowTemplatesListCall) PageToken(pageToken string) *ProjectsRegionsWorkflowTemplatesListCall {
  11585. c.urlParams_.Set("pageToken", pageToken)
  11586. return c
  11587. }
  11588. // Fields allows partial responses to be retrieved. See
  11589. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11590. // for more information.
  11591. func (c *ProjectsRegionsWorkflowTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesListCall {
  11592. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11593. return c
  11594. }
  11595. // IfNoneMatch sets the optional parameter which makes the operation
  11596. // fail if the object's ETag matches the given value. This is useful for
  11597. // getting updates only after the object has changed since the last
  11598. // request. Use googleapi.IsNotModified to check whether the response
  11599. // error from Do is the result of In-None-Match.
  11600. func (c *ProjectsRegionsWorkflowTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesListCall {
  11601. c.ifNoneMatch_ = entityTag
  11602. return c
  11603. }
  11604. // Context sets the context to be used in this call's Do method. Any
  11605. // pending HTTP request will be aborted if the provided context is
  11606. // canceled.
  11607. func (c *ProjectsRegionsWorkflowTemplatesListCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesListCall {
  11608. c.ctx_ = ctx
  11609. return c
  11610. }
  11611. // Header returns an http.Header that can be modified by the caller to
  11612. // add HTTP headers to the request.
  11613. func (c *ProjectsRegionsWorkflowTemplatesListCall) Header() http.Header {
  11614. if c.header_ == nil {
  11615. c.header_ = make(http.Header)
  11616. }
  11617. return c.header_
  11618. }
  11619. func (c *ProjectsRegionsWorkflowTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  11620. reqHeaders := make(http.Header)
  11621. for k, v := range c.header_ {
  11622. reqHeaders[k] = v
  11623. }
  11624. reqHeaders.Set("User-Agent", c.s.userAgent())
  11625. if c.ifNoneMatch_ != "" {
  11626. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  11627. }
  11628. var body io.Reader = nil
  11629. c.urlParams_.Set("alt", alt)
  11630. c.urlParams_.Set("prettyPrint", "false")
  11631. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates")
  11632. urls += "?" + c.urlParams_.Encode()
  11633. req, err := http.NewRequest("GET", urls, body)
  11634. if err != nil {
  11635. return nil, err
  11636. }
  11637. req.Header = reqHeaders
  11638. googleapi.Expand(req.URL, map[string]string{
  11639. "parent": c.parent,
  11640. })
  11641. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11642. }
  11643. // Do executes the "dataproc.projects.regions.workflowTemplates.list" call.
  11644. // Exactly one of *ListWorkflowTemplatesResponse or error will be
  11645. // non-nil. Any non-2xx status code is an error. Response headers are in
  11646. // either *ListWorkflowTemplatesResponse.ServerResponse.Header or (if a
  11647. // response was returned at all) in error.(*googleapi.Error).Header. Use
  11648. // googleapi.IsNotModified to check whether the returned error was
  11649. // because http.StatusNotModified was returned.
  11650. func (c *ProjectsRegionsWorkflowTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowTemplatesResponse, error) {
  11651. gensupport.SetOptions(c.urlParams_, opts...)
  11652. res, err := c.doRequest("json")
  11653. if res != nil && res.StatusCode == http.StatusNotModified {
  11654. if res.Body != nil {
  11655. res.Body.Close()
  11656. }
  11657. return nil, &googleapi.Error{
  11658. Code: res.StatusCode,
  11659. Header: res.Header,
  11660. }
  11661. }
  11662. if err != nil {
  11663. return nil, err
  11664. }
  11665. defer googleapi.CloseBody(res)
  11666. if err := googleapi.CheckResponse(res); err != nil {
  11667. return nil, err
  11668. }
  11669. ret := &ListWorkflowTemplatesResponse{
  11670. ServerResponse: googleapi.ServerResponse{
  11671. Header: res.Header,
  11672. HTTPStatusCode: res.StatusCode,
  11673. },
  11674. }
  11675. target := &ret
  11676. if err := gensupport.DecodeResponse(target, res); err != nil {
  11677. return nil, err
  11678. }
  11679. return ret, nil
  11680. // {
  11681. // "description": "Lists workflows that match the specified filter in the request.",
  11682. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates",
  11683. // "httpMethod": "GET",
  11684. // "id": "dataproc.projects.regions.workflowTemplates.list",
  11685. // "parameterOrder": [
  11686. // "parent"
  11687. // ],
  11688. // "parameters": {
  11689. // "pageSize": {
  11690. // "description": "Optional. The maximum number of results to return in each response.",
  11691. // "format": "int32",
  11692. // "location": "query",
  11693. // "type": "integer"
  11694. // },
  11695. // "pageToken": {
  11696. // "description": "Optional. The page token, returned by a previous call, to request the next page of results.",
  11697. // "location": "query",
  11698. // "type": "string"
  11699. // },
  11700. // "parent": {
  11701. // "description": "Required. The \"resource name\" of the region, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}",
  11702. // "location": "path",
  11703. // "pattern": "^projects/[^/]+/regions/[^/]+$",
  11704. // "required": true,
  11705. // "type": "string"
  11706. // }
  11707. // },
  11708. // "path": "v1beta2/{+parent}/workflowTemplates",
  11709. // "response": {
  11710. // "$ref": "ListWorkflowTemplatesResponse"
  11711. // },
  11712. // "scopes": [
  11713. // "https://www.googleapis.com/auth/cloud-platform"
  11714. // ]
  11715. // }
  11716. }
  11717. // Pages invokes f for each page of results.
  11718. // A non-nil error returned from f will halt the iteration.
  11719. // The provided context supersedes any context provided to the Context method.
  11720. func (c *ProjectsRegionsWorkflowTemplatesListCall) Pages(ctx context.Context, f func(*ListWorkflowTemplatesResponse) error) error {
  11721. c.ctx_ = ctx
  11722. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  11723. for {
  11724. x, err := c.Do()
  11725. if err != nil {
  11726. return err
  11727. }
  11728. if err := f(x); err != nil {
  11729. return err
  11730. }
  11731. if x.NextPageToken == "" {
  11732. return nil
  11733. }
  11734. c.PageToken(x.NextPageToken)
  11735. }
  11736. }
  11737. // method id "dataproc.projects.regions.workflowTemplates.setIamPolicy":
  11738. type ProjectsRegionsWorkflowTemplatesSetIamPolicyCall struct {
  11739. s *Service
  11740. resource string
  11741. setiampolicyrequest *SetIamPolicyRequest
  11742. urlParams_ gensupport.URLParams
  11743. ctx_ context.Context
  11744. header_ http.Header
  11745. }
  11746. // SetIamPolicy: Sets the access control policy on the specified
  11747. // resource. Replaces any existing policy.
  11748. func (r *ProjectsRegionsWorkflowTemplatesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall {
  11749. c := &ProjectsRegionsWorkflowTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11750. c.resource = resource
  11751. c.setiampolicyrequest = setiampolicyrequest
  11752. return c
  11753. }
  11754. // Fields allows partial responses to be retrieved. See
  11755. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11756. // for more information.
  11757. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall {
  11758. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11759. return c
  11760. }
  11761. // Context sets the context to be used in this call's Do method. Any
  11762. // pending HTTP request will be aborted if the provided context is
  11763. // canceled.
  11764. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall {
  11765. c.ctx_ = ctx
  11766. return c
  11767. }
  11768. // Header returns an http.Header that can be modified by the caller to
  11769. // add HTTP headers to the request.
  11770. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Header() http.Header {
  11771. if c.header_ == nil {
  11772. c.header_ = make(http.Header)
  11773. }
  11774. return c.header_
  11775. }
  11776. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  11777. reqHeaders := make(http.Header)
  11778. for k, v := range c.header_ {
  11779. reqHeaders[k] = v
  11780. }
  11781. reqHeaders.Set("User-Agent", c.s.userAgent())
  11782. var body io.Reader = nil
  11783. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  11784. if err != nil {
  11785. return nil, err
  11786. }
  11787. reqHeaders.Set("Content-Type", "application/json")
  11788. c.urlParams_.Set("alt", alt)
  11789. c.urlParams_.Set("prettyPrint", "false")
  11790. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy")
  11791. urls += "?" + c.urlParams_.Encode()
  11792. req, err := http.NewRequest("POST", urls, body)
  11793. if err != nil {
  11794. return nil, err
  11795. }
  11796. req.Header = reqHeaders
  11797. googleapi.Expand(req.URL, map[string]string{
  11798. "resource": c.resource,
  11799. })
  11800. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11801. }
  11802. // Do executes the "dataproc.projects.regions.workflowTemplates.setIamPolicy" call.
  11803. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  11804. // code is an error. Response headers are in either
  11805. // *Policy.ServerResponse.Header or (if a response was returned at all)
  11806. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  11807. // check whether the returned error was because http.StatusNotModified
  11808. // was returned.
  11809. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  11810. gensupport.SetOptions(c.urlParams_, opts...)
  11811. res, err := c.doRequest("json")
  11812. if res != nil && res.StatusCode == http.StatusNotModified {
  11813. if res.Body != nil {
  11814. res.Body.Close()
  11815. }
  11816. return nil, &googleapi.Error{
  11817. Code: res.StatusCode,
  11818. Header: res.Header,
  11819. }
  11820. }
  11821. if err != nil {
  11822. return nil, err
  11823. }
  11824. defer googleapi.CloseBody(res)
  11825. if err := googleapi.CheckResponse(res); err != nil {
  11826. return nil, err
  11827. }
  11828. ret := &Policy{
  11829. ServerResponse: googleapi.ServerResponse{
  11830. Header: res.Header,
  11831. HTTPStatusCode: res.StatusCode,
  11832. },
  11833. }
  11834. target := &ret
  11835. if err := gensupport.DecodeResponse(target, res); err != nil {
  11836. return nil, err
  11837. }
  11838. return ret, nil
  11839. // {
  11840. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  11841. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:setIamPolicy",
  11842. // "httpMethod": "POST",
  11843. // "id": "dataproc.projects.regions.workflowTemplates.setIamPolicy",
  11844. // "parameterOrder": [
  11845. // "resource"
  11846. // ],
  11847. // "parameters": {
  11848. // "resource": {
  11849. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  11850. // "location": "path",
  11851. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  11852. // "required": true,
  11853. // "type": "string"
  11854. // }
  11855. // },
  11856. // "path": "v1beta2/{+resource}:setIamPolicy",
  11857. // "request": {
  11858. // "$ref": "SetIamPolicyRequest"
  11859. // },
  11860. // "response": {
  11861. // "$ref": "Policy"
  11862. // },
  11863. // "scopes": [
  11864. // "https://www.googleapis.com/auth/cloud-platform"
  11865. // ]
  11866. // }
  11867. }
  11868. // method id "dataproc.projects.regions.workflowTemplates.testIamPermissions":
  11869. type ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall struct {
  11870. s *Service
  11871. resource string
  11872. testiampermissionsrequest *TestIamPermissionsRequest
  11873. urlParams_ gensupport.URLParams
  11874. ctx_ context.Context
  11875. header_ http.Header
  11876. }
  11877. // TestIamPermissions: Returns permissions that a caller has on the
  11878. // specified resource. If the resource does not exist, this will return
  11879. // an empty set of permissions, not a NOT_FOUND error.Note: This
  11880. // operation is designed to be used for building permission-aware UIs
  11881. // and command-line tools, not for authorization checking. This
  11882. // operation may "fail open" without warning.
  11883. func (r *ProjectsRegionsWorkflowTemplatesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall {
  11884. c := &ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  11885. c.resource = resource
  11886. c.testiampermissionsrequest = testiampermissionsrequest
  11887. return c
  11888. }
  11889. // Fields allows partial responses to be retrieved. See
  11890. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  11891. // for more information.
  11892. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall {
  11893. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  11894. return c
  11895. }
  11896. // Context sets the context to be used in this call's Do method. Any
  11897. // pending HTTP request will be aborted if the provided context is
  11898. // canceled.
  11899. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall {
  11900. c.ctx_ = ctx
  11901. return c
  11902. }
  11903. // Header returns an http.Header that can be modified by the caller to
  11904. // add HTTP headers to the request.
  11905. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Header() http.Header {
  11906. if c.header_ == nil {
  11907. c.header_ = make(http.Header)
  11908. }
  11909. return c.header_
  11910. }
  11911. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  11912. reqHeaders := make(http.Header)
  11913. for k, v := range c.header_ {
  11914. reqHeaders[k] = v
  11915. }
  11916. reqHeaders.Set("User-Agent", c.s.userAgent())
  11917. var body io.Reader = nil
  11918. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  11919. if err != nil {
  11920. return nil, err
  11921. }
  11922. reqHeaders.Set("Content-Type", "application/json")
  11923. c.urlParams_.Set("alt", alt)
  11924. c.urlParams_.Set("prettyPrint", "false")
  11925. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
  11926. urls += "?" + c.urlParams_.Encode()
  11927. req, err := http.NewRequest("POST", urls, body)
  11928. if err != nil {
  11929. return nil, err
  11930. }
  11931. req.Header = reqHeaders
  11932. googleapi.Expand(req.URL, map[string]string{
  11933. "resource": c.resource,
  11934. })
  11935. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  11936. }
  11937. // Do executes the "dataproc.projects.regions.workflowTemplates.testIamPermissions" call.
  11938. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  11939. // Any non-2xx status code is an error. Response headers are in either
  11940. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  11941. // was returned at all) in error.(*googleapi.Error).Header. Use
  11942. // googleapi.IsNotModified to check whether the returned error was
  11943. // because http.StatusNotModified was returned.
  11944. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  11945. gensupport.SetOptions(c.urlParams_, opts...)
  11946. res, err := c.doRequest("json")
  11947. if res != nil && res.StatusCode == http.StatusNotModified {
  11948. if res.Body != nil {
  11949. res.Body.Close()
  11950. }
  11951. return nil, &googleapi.Error{
  11952. Code: res.StatusCode,
  11953. Header: res.Header,
  11954. }
  11955. }
  11956. if err != nil {
  11957. return nil, err
  11958. }
  11959. defer googleapi.CloseBody(res)
  11960. if err := googleapi.CheckResponse(res); err != nil {
  11961. return nil, err
  11962. }
  11963. ret := &TestIamPermissionsResponse{
  11964. ServerResponse: googleapi.ServerResponse{
  11965. Header: res.Header,
  11966. HTTPStatusCode: res.StatusCode,
  11967. },
  11968. }
  11969. target := &ret
  11970. if err := gensupport.DecodeResponse(target, res); err != nil {
  11971. return nil, err
  11972. }
  11973. return ret, nil
  11974. // {
  11975. // "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.",
  11976. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:testIamPermissions",
  11977. // "httpMethod": "POST",
  11978. // "id": "dataproc.projects.regions.workflowTemplates.testIamPermissions",
  11979. // "parameterOrder": [
  11980. // "resource"
  11981. // ],
  11982. // "parameters": {
  11983. // "resource": {
  11984. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  11985. // "location": "path",
  11986. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  11987. // "required": true,
  11988. // "type": "string"
  11989. // }
  11990. // },
  11991. // "path": "v1beta2/{+resource}:testIamPermissions",
  11992. // "request": {
  11993. // "$ref": "TestIamPermissionsRequest"
  11994. // },
  11995. // "response": {
  11996. // "$ref": "TestIamPermissionsResponse"
  11997. // },
  11998. // "scopes": [
  11999. // "https://www.googleapis.com/auth/cloud-platform"
  12000. // ]
  12001. // }
  12002. }
  12003. // method id "dataproc.projects.regions.workflowTemplates.update":
  12004. type ProjectsRegionsWorkflowTemplatesUpdateCall struct {
  12005. s *Service
  12006. name string
  12007. workflowtemplate *WorkflowTemplate
  12008. urlParams_ gensupport.URLParams
  12009. ctx_ context.Context
  12010. header_ http.Header
  12011. }
  12012. // Update: Updates (replaces) workflow template. The updated template
  12013. // must contain version that matches the current server version.
  12014. func (r *ProjectsRegionsWorkflowTemplatesService) Update(name string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesUpdateCall {
  12015. c := &ProjectsRegionsWorkflowTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  12016. c.name = name
  12017. c.workflowtemplate = workflowtemplate
  12018. return c
  12019. }
  12020. // Fields allows partial responses to be retrieved. See
  12021. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  12022. // for more information.
  12023. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesUpdateCall {
  12024. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  12025. return c
  12026. }
  12027. // Context sets the context to be used in this call's Do method. Any
  12028. // pending HTTP request will be aborted if the provided context is
  12029. // canceled.
  12030. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesUpdateCall {
  12031. c.ctx_ = ctx
  12032. return c
  12033. }
  12034. // Header returns an http.Header that can be modified by the caller to
  12035. // add HTTP headers to the request.
  12036. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Header() http.Header {
  12037. if c.header_ == nil {
  12038. c.header_ = make(http.Header)
  12039. }
  12040. return c.header_
  12041. }
  12042. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  12043. reqHeaders := make(http.Header)
  12044. for k, v := range c.header_ {
  12045. reqHeaders[k] = v
  12046. }
  12047. reqHeaders.Set("User-Agent", c.s.userAgent())
  12048. var body io.Reader = nil
  12049. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  12050. if err != nil {
  12051. return nil, err
  12052. }
  12053. reqHeaders.Set("Content-Type", "application/json")
  12054. c.urlParams_.Set("alt", alt)
  12055. c.urlParams_.Set("prettyPrint", "false")
  12056. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  12057. urls += "?" + c.urlParams_.Encode()
  12058. req, err := http.NewRequest("PUT", urls, body)
  12059. if err != nil {
  12060. return nil, err
  12061. }
  12062. req.Header = reqHeaders
  12063. googleapi.Expand(req.URL, map[string]string{
  12064. "name": c.name,
  12065. })
  12066. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  12067. }
  12068. // Do executes the "dataproc.projects.regions.workflowTemplates.update" call.
  12069. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  12070. // non-2xx status code is an error. Response headers are in either
  12071. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  12072. // returned at all) in error.(*googleapi.Error).Header. Use
  12073. // googleapi.IsNotModified to check whether the returned error was
  12074. // because http.StatusNotModified was returned.
  12075. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  12076. gensupport.SetOptions(c.urlParams_, opts...)
  12077. res, err := c.doRequest("json")
  12078. if res != nil && res.StatusCode == http.StatusNotModified {
  12079. if res.Body != nil {
  12080. res.Body.Close()
  12081. }
  12082. return nil, &googleapi.Error{
  12083. Code: res.StatusCode,
  12084. Header: res.Header,
  12085. }
  12086. }
  12087. if err != nil {
  12088. return nil, err
  12089. }
  12090. defer googleapi.CloseBody(res)
  12091. if err := googleapi.CheckResponse(res); err != nil {
  12092. return nil, err
  12093. }
  12094. ret := &WorkflowTemplate{
  12095. ServerResponse: googleapi.ServerResponse{
  12096. Header: res.Header,
  12097. HTTPStatusCode: res.StatusCode,
  12098. },
  12099. }
  12100. target := &ret
  12101. if err := gensupport.DecodeResponse(target, res); err != nil {
  12102. return nil, err
  12103. }
  12104. return ret, nil
  12105. // {
  12106. // "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version.",
  12107. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}",
  12108. // "httpMethod": "PUT",
  12109. // "id": "dataproc.projects.regions.workflowTemplates.update",
  12110. // "parameterOrder": [
  12111. // "name"
  12112. // ],
  12113. // "parameters": {
  12114. // "name": {
  12115. // "description": "Output only. The \"resource name\" of the template, as described in https://cloud.google.com/apis/design/resource_names of the form projects/{project_id}/regions/{region}/workflowTemplates/{template_id}",
  12116. // "location": "path",
  12117. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  12118. // "required": true,
  12119. // "type": "string"
  12120. // }
  12121. // },
  12122. // "path": "v1beta2/{+name}",
  12123. // "request": {
  12124. // "$ref": "WorkflowTemplate"
  12125. // },
  12126. // "response": {
  12127. // "$ref": "WorkflowTemplate"
  12128. // },
  12129. // "scopes": [
  12130. // "https://www.googleapis.com/auth/cloud-platform"
  12131. // ]
  12132. // }
  12133. }