You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

10176 lines
382 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/v1"
  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/v1"
  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:v1"
  69. const apiName = "dataproc"
  70. const apiVersion = "v1"
  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.WorkflowTemplates = NewProjectsLocationsWorkflowTemplatesService(s)
  136. return rs
  137. }
  138. type ProjectsLocationsService struct {
  139. s *Service
  140. WorkflowTemplates *ProjectsLocationsWorkflowTemplatesService
  141. }
  142. func NewProjectsLocationsWorkflowTemplatesService(s *Service) *ProjectsLocationsWorkflowTemplatesService {
  143. rs := &ProjectsLocationsWorkflowTemplatesService{s: s}
  144. return rs
  145. }
  146. type ProjectsLocationsWorkflowTemplatesService struct {
  147. s *Service
  148. }
  149. func NewProjectsRegionsService(s *Service) *ProjectsRegionsService {
  150. rs := &ProjectsRegionsService{s: s}
  151. rs.Clusters = NewProjectsRegionsClustersService(s)
  152. rs.Jobs = NewProjectsRegionsJobsService(s)
  153. rs.Operations = NewProjectsRegionsOperationsService(s)
  154. rs.WorkflowTemplates = NewProjectsRegionsWorkflowTemplatesService(s)
  155. return rs
  156. }
  157. type ProjectsRegionsService struct {
  158. s *Service
  159. Clusters *ProjectsRegionsClustersService
  160. Jobs *ProjectsRegionsJobsService
  161. Operations *ProjectsRegionsOperationsService
  162. WorkflowTemplates *ProjectsRegionsWorkflowTemplatesService
  163. }
  164. func NewProjectsRegionsClustersService(s *Service) *ProjectsRegionsClustersService {
  165. rs := &ProjectsRegionsClustersService{s: s}
  166. return rs
  167. }
  168. type ProjectsRegionsClustersService struct {
  169. s *Service
  170. }
  171. func NewProjectsRegionsJobsService(s *Service) *ProjectsRegionsJobsService {
  172. rs := &ProjectsRegionsJobsService{s: s}
  173. return rs
  174. }
  175. type ProjectsRegionsJobsService struct {
  176. s *Service
  177. }
  178. func NewProjectsRegionsOperationsService(s *Service) *ProjectsRegionsOperationsService {
  179. rs := &ProjectsRegionsOperationsService{s: s}
  180. return rs
  181. }
  182. type ProjectsRegionsOperationsService struct {
  183. s *Service
  184. }
  185. func NewProjectsRegionsWorkflowTemplatesService(s *Service) *ProjectsRegionsWorkflowTemplatesService {
  186. rs := &ProjectsRegionsWorkflowTemplatesService{s: s}
  187. return rs
  188. }
  189. type ProjectsRegionsWorkflowTemplatesService struct {
  190. s *Service
  191. }
  192. // AcceleratorConfig: Specifies the type and number of accelerator cards
  193. // attached to the instances of an instance. See GPUs on Compute Engine.
  194. type AcceleratorConfig struct {
  195. // AcceleratorCount: The number of the accelerator cards of this type
  196. // exposed to this instance.
  197. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  198. // AcceleratorTypeUri: Full URL, partial URI, or short name of the
  199. // accelerator type resource to expose to this instance. See Compute
  200. // Engine
  201. // AcceleratorTypes.Examples:
  202. // https://www.googleapis.com/compute/beta/pro
  203. // jects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80
  204. //
  205. // projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k
  206. // 80
  207. // nvidia-tesla-k80Auto Zone Exception: If you are using the Cloud
  208. // Dataproc Auto Zone Placement feature, you must use the short name of
  209. // the accelerator type resource, for example, nvidia-tesla-k80.
  210. AcceleratorTypeUri string `json:"acceleratorTypeUri,omitempty"`
  211. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  212. // unconditionally include in API requests. By default, fields with
  213. // empty values are omitted from API requests. However, any non-pointer,
  214. // non-interface field appearing in ForceSendFields will be sent to the
  215. // server regardless of whether the field is empty or not. This may be
  216. // used to include empty fields in Patch requests.
  217. ForceSendFields []string `json:"-"`
  218. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  219. // include in API requests with the JSON null value. By default, fields
  220. // with empty values are omitted from API requests. However, any field
  221. // with an empty value appearing in NullFields will be sent to the
  222. // server as null. It is an error if a field in this list has a
  223. // non-empty value. This may be used to include null fields in Patch
  224. // requests.
  225. NullFields []string `json:"-"`
  226. }
  227. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  228. type NoMethod AcceleratorConfig
  229. raw := NoMethod(*s)
  230. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  231. }
  232. // Binding: Associates members with a role.
  233. type Binding struct {
  234. // Condition: Unimplemented. The condition that is associated with this
  235. // binding. NOTE: an unsatisfied condition will not allow user access
  236. // via current binding. Different bindings, including their conditions,
  237. // are examined independently.
  238. Condition *Expr `json:"condition,omitempty"`
  239. // Members: Specifies the identities requesting access for a Cloud
  240. // Platform resource. members can have the following values:
  241. // allUsers: A special identifier that represents anyone who is on the
  242. // internet; with or without a Google account.
  243. // allAuthenticatedUsers: A special identifier that represents anyone
  244. // who is authenticated with a Google account or a service
  245. // account.
  246. // user:{emailid}: An email address that represents a specific Google
  247. // account. For example, alice@gmail.com .
  248. // serviceAccount:{emailid}: An email address that represents a service
  249. // account. For example,
  250. // my-other-app@appspot.gserviceaccount.com.
  251. // group:{emailid}: An email address that represents a Google group.
  252. // For example, admins@example.com.
  253. // domain:{domain}: The G Suite domain (primary) that represents all the
  254. // users of that domain. For example, google.com or example.com.
  255. Members []string `json:"members,omitempty"`
  256. // Role: Role that is assigned to members. For example, roles/viewer,
  257. // roles/editor, or roles/owner.
  258. Role string `json:"role,omitempty"`
  259. // ForceSendFields is a list of field names (e.g. "Condition") to
  260. // unconditionally include in API requests. By default, fields with
  261. // empty values are omitted from API requests. However, any non-pointer,
  262. // non-interface field appearing in ForceSendFields will be sent to the
  263. // server regardless of whether the field is empty or not. This may be
  264. // used to include empty fields in Patch requests.
  265. ForceSendFields []string `json:"-"`
  266. // NullFields is a list of field names (e.g. "Condition") to include in
  267. // API requests with the JSON null value. By default, fields with empty
  268. // values are omitted from API requests. However, any field with an
  269. // empty value appearing in NullFields will be sent to the server as
  270. // null. It is an error if a field in this list has a non-empty value.
  271. // This may be used to include null fields in Patch requests.
  272. NullFields []string `json:"-"`
  273. }
  274. func (s *Binding) MarshalJSON() ([]byte, error) {
  275. type NoMethod Binding
  276. raw := NoMethod(*s)
  277. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  278. }
  279. // CancelJobRequest: A request to cancel a job.
  280. type CancelJobRequest struct {
  281. }
  282. // Cluster: Describes the identifying information, config, and status of
  283. // a cluster of Compute Engine instances.
  284. type Cluster struct {
  285. // ClusterName: Required. The cluster name. Cluster names within a
  286. // project must be unique. Names of deleted clusters can be reused.
  287. ClusterName string `json:"clusterName,omitempty"`
  288. // ClusterUuid: Output only. A cluster UUID (Unique Universal
  289. // Identifier). Cloud Dataproc generates this value when it creates the
  290. // cluster.
  291. ClusterUuid string `json:"clusterUuid,omitempty"`
  292. // Config: Required. The cluster config. Note that Cloud Dataproc may
  293. // set default values, and values may change when clusters are updated.
  294. Config *ClusterConfig `json:"config,omitempty"`
  295. // Labels: Optional. The labels to associate with this cluster. Label
  296. // keys must contain 1 to 63 characters, and must conform to RFC 1035
  297. // (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty,
  298. // but, if present, must contain 1 to 63 characters, and must conform to
  299. // RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32
  300. // labels can be associated with a cluster.
  301. Labels map[string]string `json:"labels,omitempty"`
  302. // Metrics: Contains cluster daemon metrics such as HDFS and YARN
  303. // stats.Beta Feature: This report is available for testing purposes
  304. // only. It may be changed before final release.
  305. Metrics *ClusterMetrics `json:"metrics,omitempty"`
  306. // ProjectId: Required. The Google Cloud Platform project ID that the
  307. // cluster belongs to.
  308. ProjectId string `json:"projectId,omitempty"`
  309. // Status: Output only. Cluster status.
  310. Status *ClusterStatus `json:"status,omitempty"`
  311. // StatusHistory: Output only. The previous cluster status.
  312. StatusHistory []*ClusterStatus `json:"statusHistory,omitempty"`
  313. // ServerResponse contains the HTTP response code and headers from the
  314. // server.
  315. googleapi.ServerResponse `json:"-"`
  316. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  317. // unconditionally include in API requests. By default, fields with
  318. // empty values are omitted from API requests. However, any non-pointer,
  319. // non-interface field appearing in ForceSendFields will be sent to the
  320. // server regardless of whether the field is empty or not. This may be
  321. // used to include empty fields in Patch requests.
  322. ForceSendFields []string `json:"-"`
  323. // NullFields is a list of field names (e.g. "ClusterName") to include
  324. // in API requests with the JSON null value. By default, fields with
  325. // empty values are omitted from API requests. However, any field with
  326. // an empty value appearing in NullFields will be sent to the server as
  327. // null. It is an error if a field in this list has a non-empty value.
  328. // This may be used to include null fields in Patch requests.
  329. NullFields []string `json:"-"`
  330. }
  331. func (s *Cluster) MarshalJSON() ([]byte, error) {
  332. type NoMethod Cluster
  333. raw := NoMethod(*s)
  334. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  335. }
  336. // ClusterConfig: The cluster config.
  337. type ClusterConfig struct {
  338. // ConfigBucket: Optional. A Google Cloud Storage bucket used to stage
  339. // job dependencies, config files, and job driver console output. If you
  340. // do not specify a staging bucket, Cloud Dataproc will determine a
  341. // Cloud Storage location (US, ASIA, or EU) for your cluster's staging
  342. // bucket according to the Google Compute Engine zone where your cluster
  343. // is deployed, and then create and manage this project-level,
  344. // per-location bucket (see Cloud Dataproc staging bucket).
  345. ConfigBucket string `json:"configBucket,omitempty"`
  346. // EncryptionConfig: Optional. Encryption settings for the cluster.
  347. EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"`
  348. // GceClusterConfig: Optional. The shared Compute Engine config settings
  349. // for all instances in a cluster.
  350. GceClusterConfig *GceClusterConfig `json:"gceClusterConfig,omitempty"`
  351. // InitializationActions: Optional. Commands to execute on each node
  352. // after config is completed. By default, executables are run on master
  353. // and all worker nodes. You can test a node's role metadata to run an
  354. // executable on a master or worker node, as shown below using curl (you
  355. // can also use wget):
  356. // ROLE=$(curl -H Metadata-Flavor:Google
  357. // http://metadata/computeMetadata/v1/instance/attributes/dataproc-role)
  358. //
  359. // if [[ "${ROLE}" == 'Master' ]]; then
  360. // ... master specific actions ...
  361. // else
  362. // ... worker specific actions ...
  363. // fi
  364. //
  365. InitializationActions []*NodeInitializationAction `json:"initializationActions,omitempty"`
  366. // MasterConfig: Optional. The Compute Engine config settings for the
  367. // master instance in a cluster.
  368. MasterConfig *InstanceGroupConfig `json:"masterConfig,omitempty"`
  369. // SecondaryWorkerConfig: Optional. The Compute Engine config settings
  370. // for additional worker instances in a cluster.
  371. SecondaryWorkerConfig *InstanceGroupConfig `json:"secondaryWorkerConfig,omitempty"`
  372. // SoftwareConfig: Optional. The config settings for software inside the
  373. // cluster.
  374. SoftwareConfig *SoftwareConfig `json:"softwareConfig,omitempty"`
  375. // WorkerConfig: Optional. The Compute Engine config settings for worker
  376. // instances in a cluster.
  377. WorkerConfig *InstanceGroupConfig `json:"workerConfig,omitempty"`
  378. // ForceSendFields is a list of field names (e.g. "ConfigBucket") to
  379. // unconditionally include in API requests. By default, fields with
  380. // empty values are omitted from API requests. However, any non-pointer,
  381. // non-interface field appearing in ForceSendFields will be sent to the
  382. // server regardless of whether the field is empty or not. This may be
  383. // used to include empty fields in Patch requests.
  384. ForceSendFields []string `json:"-"`
  385. // NullFields is a list of field names (e.g. "ConfigBucket") to include
  386. // in API requests with the JSON null value. By default, fields with
  387. // empty values are omitted from API requests. However, any field with
  388. // an empty value appearing in NullFields will be sent to the server as
  389. // null. It is an error if a field in this list has a non-empty value.
  390. // This may be used to include null fields in Patch requests.
  391. NullFields []string `json:"-"`
  392. }
  393. func (s *ClusterConfig) MarshalJSON() ([]byte, error) {
  394. type NoMethod ClusterConfig
  395. raw := NoMethod(*s)
  396. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  397. }
  398. // ClusterMetrics: Contains cluster daemon metrics, such as HDFS and
  399. // YARN stats.Beta Feature: This report is available for testing
  400. // purposes only. It may be changed before final release.
  401. type ClusterMetrics struct {
  402. // HdfsMetrics: The HDFS metrics.
  403. HdfsMetrics map[string]string `json:"hdfsMetrics,omitempty"`
  404. // YarnMetrics: The YARN metrics.
  405. YarnMetrics map[string]string `json:"yarnMetrics,omitempty"`
  406. // ForceSendFields is a list of field names (e.g. "HdfsMetrics") to
  407. // unconditionally include in API requests. By default, fields with
  408. // empty values are omitted from API requests. However, any non-pointer,
  409. // non-interface field appearing in ForceSendFields will be sent to the
  410. // server regardless of whether the field is empty or not. This may be
  411. // used to include empty fields in Patch requests.
  412. ForceSendFields []string `json:"-"`
  413. // NullFields is a list of field names (e.g. "HdfsMetrics") to include
  414. // in API requests with the JSON null value. By default, fields with
  415. // empty values are omitted from API requests. However, any field with
  416. // an empty value appearing in NullFields will be sent to the server as
  417. // null. It is an error if a field in this list has a non-empty value.
  418. // This may be used to include null fields in Patch requests.
  419. NullFields []string `json:"-"`
  420. }
  421. func (s *ClusterMetrics) MarshalJSON() ([]byte, error) {
  422. type NoMethod ClusterMetrics
  423. raw := NoMethod(*s)
  424. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  425. }
  426. // ClusterOperation: The cluster operation triggered by a workflow.
  427. type ClusterOperation struct {
  428. // Done: Output only. Indicates the operation is done.
  429. Done bool `json:"done,omitempty"`
  430. // Error: Output only. Error, if operation failed.
  431. Error string `json:"error,omitempty"`
  432. // OperationId: Output only. The id of the cluster operation.
  433. OperationId string `json:"operationId,omitempty"`
  434. // ForceSendFields is a list of field names (e.g. "Done") to
  435. // unconditionally include in API requests. By default, fields with
  436. // empty values are omitted from API requests. However, any non-pointer,
  437. // non-interface field appearing in ForceSendFields will be sent to the
  438. // server regardless of whether the field is empty or not. This may be
  439. // used to include empty fields in Patch requests.
  440. ForceSendFields []string `json:"-"`
  441. // NullFields is a list of field names (e.g. "Done") to include in API
  442. // requests with the JSON null value. By default, fields with empty
  443. // values are omitted from API requests. However, any field with an
  444. // empty value appearing in NullFields will be sent to the server as
  445. // null. It is an error if a field in this list has a non-empty value.
  446. // This may be used to include null fields in Patch requests.
  447. NullFields []string `json:"-"`
  448. }
  449. func (s *ClusterOperation) MarshalJSON() ([]byte, error) {
  450. type NoMethod ClusterOperation
  451. raw := NoMethod(*s)
  452. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  453. }
  454. // ClusterOperationMetadata: Metadata describing the operation.
  455. type ClusterOperationMetadata struct {
  456. // ClusterName: Output only. Name of the cluster for the operation.
  457. ClusterName string `json:"clusterName,omitempty"`
  458. // ClusterUuid: Output only. Cluster UUID for the operation.
  459. ClusterUuid string `json:"clusterUuid,omitempty"`
  460. // Description: Output only. Short description of operation.
  461. Description string `json:"description,omitempty"`
  462. // Labels: Output only. Labels associated with the operation
  463. Labels map[string]string `json:"labels,omitempty"`
  464. // OperationType: Output only. The operation type.
  465. OperationType string `json:"operationType,omitempty"`
  466. // Status: Output only. Current operation status.
  467. Status *ClusterOperationStatus `json:"status,omitempty"`
  468. // StatusHistory: Output only. The previous operation status.
  469. StatusHistory []*ClusterOperationStatus `json:"statusHistory,omitempty"`
  470. // Warnings: Output only. Errors encountered during operation execution.
  471. Warnings []string `json:"warnings,omitempty"`
  472. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  473. // unconditionally include in API requests. By default, fields with
  474. // empty values are omitted from API requests. However, any non-pointer,
  475. // non-interface field appearing in ForceSendFields will be sent to the
  476. // server regardless of whether the field is empty or not. This may be
  477. // used to include empty fields in Patch requests.
  478. ForceSendFields []string `json:"-"`
  479. // NullFields is a list of field names (e.g. "ClusterName") to include
  480. // in API requests with the JSON null value. By default, fields with
  481. // empty values are omitted from API requests. However, any field with
  482. // an empty value appearing in NullFields will be sent to the server as
  483. // null. It is an error if a field in this list has a non-empty value.
  484. // This may be used to include null fields in Patch requests.
  485. NullFields []string `json:"-"`
  486. }
  487. func (s *ClusterOperationMetadata) MarshalJSON() ([]byte, error) {
  488. type NoMethod ClusterOperationMetadata
  489. raw := NoMethod(*s)
  490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  491. }
  492. // ClusterOperationStatus: The status of the operation.
  493. type ClusterOperationStatus struct {
  494. // Details: Output only. A message containing any operation metadata
  495. // details.
  496. Details string `json:"details,omitempty"`
  497. // InnerState: Output only. A message containing the detailed operation
  498. // state.
  499. InnerState string `json:"innerState,omitempty"`
  500. // State: Output only. A message containing the operation state.
  501. //
  502. // Possible values:
  503. // "UNKNOWN" - Unused.
  504. // "PENDING" - The operation has been created.
  505. // "RUNNING" - The operation is running.
  506. // "DONE" - The operation is done; either cancelled or completed.
  507. State string `json:"state,omitempty"`
  508. // StateStartTime: Output only. The time this state was entered.
  509. StateStartTime string `json:"stateStartTime,omitempty"`
  510. // ForceSendFields is a list of field names (e.g. "Details") to
  511. // unconditionally include in API requests. By default, fields with
  512. // empty values are omitted from API requests. However, any non-pointer,
  513. // non-interface field appearing in ForceSendFields will be sent to the
  514. // server regardless of whether the field is empty or not. This may be
  515. // used to include empty fields in Patch requests.
  516. ForceSendFields []string `json:"-"`
  517. // NullFields is a list of field names (e.g. "Details") to include in
  518. // API requests with the JSON null value. By default, fields with empty
  519. // values are omitted from API requests. However, any field with an
  520. // empty value appearing in NullFields will be sent to the server as
  521. // null. It is an error if a field in this list has a non-empty value.
  522. // This may be used to include null fields in Patch requests.
  523. NullFields []string `json:"-"`
  524. }
  525. func (s *ClusterOperationStatus) MarshalJSON() ([]byte, error) {
  526. type NoMethod ClusterOperationStatus
  527. raw := NoMethod(*s)
  528. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  529. }
  530. // ClusterSelector: A selector that chooses target cluster for jobs
  531. // based on metadata.
  532. type ClusterSelector struct {
  533. // ClusterLabels: Required. The cluster labels. Cluster must have all
  534. // labels to match.
  535. ClusterLabels map[string]string `json:"clusterLabels,omitempty"`
  536. // Zone: Optional. The zone where workflow process executes. This
  537. // parameter does not affect the selection of the cluster.If
  538. // unspecified, the zone of the first cluster matching the selector is
  539. // used.
  540. Zone string `json:"zone,omitempty"`
  541. // ForceSendFields is a list of field names (e.g. "ClusterLabels") to
  542. // unconditionally include in API requests. By default, fields with
  543. // empty values are omitted from API requests. However, any non-pointer,
  544. // non-interface field appearing in ForceSendFields will be sent to the
  545. // server regardless of whether the field is empty or not. This may be
  546. // used to include empty fields in Patch requests.
  547. ForceSendFields []string `json:"-"`
  548. // NullFields is a list of field names (e.g. "ClusterLabels") to include
  549. // in API requests with the JSON null value. By default, fields with
  550. // empty values are omitted from API requests. However, any field with
  551. // an empty value appearing in NullFields will be sent to the server as
  552. // null. It is an error if a field in this list has a non-empty value.
  553. // This may be used to include null fields in Patch requests.
  554. NullFields []string `json:"-"`
  555. }
  556. func (s *ClusterSelector) MarshalJSON() ([]byte, error) {
  557. type NoMethod ClusterSelector
  558. raw := NoMethod(*s)
  559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  560. }
  561. // ClusterStatus: The status of a cluster and its instances.
  562. type ClusterStatus struct {
  563. // Detail: Output only. Optional details of cluster's state.
  564. Detail string `json:"detail,omitempty"`
  565. // State: Output only. The cluster's state.
  566. //
  567. // Possible values:
  568. // "UNKNOWN" - The cluster state is unknown.
  569. // "CREATING" - The cluster is being created and set up. It is not
  570. // ready for use.
  571. // "RUNNING" - The cluster is currently running and healthy. It is
  572. // ready for use.
  573. // "ERROR" - The cluster encountered an error. It is not ready for
  574. // use.
  575. // "DELETING" - The cluster is being deleted. It cannot be used.
  576. // "UPDATING" - The cluster is being updated. It continues to accept
  577. // and process jobs.
  578. State string `json:"state,omitempty"`
  579. // StateStartTime: Output only. Time when this state was entered.
  580. StateStartTime string `json:"stateStartTime,omitempty"`
  581. // Substate: Output only. Additional state information that includes
  582. // status reported by the agent.
  583. //
  584. // Possible values:
  585. // "UNSPECIFIED" - The cluster substate is unknown.
  586. // "UNHEALTHY" - The cluster is known to be in an unhealthy state (for
  587. // example, critical daemons are not running or HDFS capacity is
  588. // exhausted).Applies to RUNNING state.
  589. // "STALE_STATUS" - The agent-reported status is out of date (may
  590. // occur if Cloud Dataproc loses communication with Agent).Applies to
  591. // RUNNING state.
  592. Substate string `json:"substate,omitempty"`
  593. // ForceSendFields is a list of field names (e.g. "Detail") to
  594. // unconditionally include in API requests. By default, fields with
  595. // empty values are omitted from API requests. However, any non-pointer,
  596. // non-interface field appearing in ForceSendFields will be sent to the
  597. // server regardless of whether the field is empty or not. This may be
  598. // used to include empty fields in Patch requests.
  599. ForceSendFields []string `json:"-"`
  600. // NullFields is a list of field names (e.g. "Detail") to include in API
  601. // requests with the JSON null value. By default, fields with empty
  602. // values are omitted from API requests. However, any field with an
  603. // empty value appearing in NullFields will be sent to the server as
  604. // null. It is an error if a field in this list has a non-empty value.
  605. // This may be used to include null fields in Patch requests.
  606. NullFields []string `json:"-"`
  607. }
  608. func (s *ClusterStatus) MarshalJSON() ([]byte, error) {
  609. type NoMethod ClusterStatus
  610. raw := NoMethod(*s)
  611. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  612. }
  613. // DiagnoseClusterRequest: A request to collect cluster diagnostic
  614. // information.
  615. type DiagnoseClusterRequest struct {
  616. }
  617. // DiagnoseClusterResults: The location of diagnostic output.
  618. type DiagnoseClusterResults struct {
  619. // OutputUri: Output only. The Cloud Storage URI of the diagnostic
  620. // output. The output report is a plain text file with a summary of
  621. // collected diagnostics.
  622. OutputUri string `json:"outputUri,omitempty"`
  623. // ForceSendFields is a list of field names (e.g. "OutputUri") to
  624. // unconditionally include in API requests. By default, fields with
  625. // empty values are omitted from API requests. However, any non-pointer,
  626. // non-interface field appearing in ForceSendFields will be sent to the
  627. // server regardless of whether the field is empty or not. This may be
  628. // used to include empty fields in Patch requests.
  629. ForceSendFields []string `json:"-"`
  630. // NullFields is a list of field names (e.g. "OutputUri") to include in
  631. // API requests with the JSON null value. By default, fields with empty
  632. // values are omitted from API requests. However, any field with an
  633. // empty value appearing in NullFields will be sent to the server as
  634. // null. It is an error if a field in this list has a non-empty value.
  635. // This may be used to include null fields in Patch requests.
  636. NullFields []string `json:"-"`
  637. }
  638. func (s *DiagnoseClusterResults) MarshalJSON() ([]byte, error) {
  639. type NoMethod DiagnoseClusterResults
  640. raw := NoMethod(*s)
  641. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  642. }
  643. // DiskConfig: Specifies the config of disk options for a group of VM
  644. // instances.
  645. type DiskConfig struct {
  646. // BootDiskSizeGb: Optional. Size in GB of the boot disk (default is
  647. // 500GB).
  648. BootDiskSizeGb int64 `json:"bootDiskSizeGb,omitempty"`
  649. // BootDiskType: Optional. Type of the boot disk (default is
  650. // "pd-standard"). Valid values: "pd-ssd" (Persistent Disk Solid State
  651. // Drive) or "pd-standard" (Persistent Disk Hard Disk Drive).
  652. BootDiskType string `json:"bootDiskType,omitempty"`
  653. // NumLocalSsds: Optional. Number of attached SSDs, from 0 to 4 (default
  654. // is 0). If SSDs are not attached, the boot disk is used to store
  655. // runtime logs and HDFS
  656. // (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If
  657. // one or more SSDs are attached, this runtime bulk data is spread
  658. // across them, and the boot disk contains only basic config and
  659. // installed binaries.
  660. NumLocalSsds int64 `json:"numLocalSsds,omitempty"`
  661. // ForceSendFields is a list of field names (e.g. "BootDiskSizeGb") to
  662. // unconditionally include in API requests. By default, fields with
  663. // empty values are omitted from API requests. However, any non-pointer,
  664. // non-interface field appearing in ForceSendFields will be sent to the
  665. // server regardless of whether the field is empty or not. This may be
  666. // used to include empty fields in Patch requests.
  667. ForceSendFields []string `json:"-"`
  668. // NullFields is a list of field names (e.g. "BootDiskSizeGb") to
  669. // include in API requests with the JSON null value. By default, fields
  670. // with empty values are omitted from API requests. However, any field
  671. // with an empty value appearing in NullFields will be sent to the
  672. // server as null. It is an error if a field in this list has a
  673. // non-empty value. This may be used to include null fields in Patch
  674. // requests.
  675. NullFields []string `json:"-"`
  676. }
  677. func (s *DiskConfig) MarshalJSON() ([]byte, error) {
  678. type NoMethod DiskConfig
  679. raw := NoMethod(*s)
  680. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  681. }
  682. // Empty: A generic empty message that you can re-use to avoid defining
  683. // duplicated empty messages in your APIs. A typical example is to use
  684. // it as the request or the response type of an API method. For
  685. // instance:
  686. // service Foo {
  687. // rpc Bar(google.protobuf.Empty) returns
  688. // (google.protobuf.Empty);
  689. // }
  690. // The JSON representation for Empty is empty JSON object {}.
  691. type Empty struct {
  692. // ServerResponse contains the HTTP response code and headers from the
  693. // server.
  694. googleapi.ServerResponse `json:"-"`
  695. }
  696. // EncryptionConfig: Encryption settings for the cluster.
  697. type EncryptionConfig struct {
  698. // GcePdKmsKeyName: Optional. The Cloud KMS key name to use for PD disk
  699. // encryption for all instances in the cluster.
  700. GcePdKmsKeyName string `json:"gcePdKmsKeyName,omitempty"`
  701. // ForceSendFields is a list of field names (e.g. "GcePdKmsKeyName") to
  702. // unconditionally include in API requests. By default, fields with
  703. // empty values are omitted from API requests. However, any non-pointer,
  704. // non-interface field appearing in ForceSendFields will be sent to the
  705. // server regardless of whether the field is empty or not. This may be
  706. // used to include empty fields in Patch requests.
  707. ForceSendFields []string `json:"-"`
  708. // NullFields is a list of field names (e.g. "GcePdKmsKeyName") to
  709. // include in API requests with the JSON null value. By default, fields
  710. // with empty values are omitted from API requests. However, any field
  711. // with an empty value appearing in NullFields will be sent to the
  712. // server as null. It is an error if a field in this list has a
  713. // non-empty value. This may be used to include null fields in Patch
  714. // requests.
  715. NullFields []string `json:"-"`
  716. }
  717. func (s *EncryptionConfig) MarshalJSON() ([]byte, error) {
  718. type NoMethod EncryptionConfig
  719. raw := NoMethod(*s)
  720. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  721. }
  722. // Expr: Represents an expression text. Example:
  723. // title: "User account presence"
  724. // description: "Determines whether the request has a user
  725. // account"
  726. // expression: "size(request.user) > 0"
  727. //
  728. type Expr struct {
  729. // Description: An optional description of the expression. This is a
  730. // longer text which describes the expression, e.g. when hovered over it
  731. // in a UI.
  732. Description string `json:"description,omitempty"`
  733. // Expression: Textual representation of an expression in Common
  734. // Expression Language syntax.The application context of the containing
  735. // message determines which well-known feature set of CEL is supported.
  736. Expression string `json:"expression,omitempty"`
  737. // Location: An optional string indicating the location of the
  738. // expression for error reporting, e.g. a file name and a position in
  739. // the file.
  740. Location string `json:"location,omitempty"`
  741. // Title: An optional title for the expression, i.e. a short string
  742. // describing its purpose. This can be used e.g. in UIs which allow to
  743. // enter the expression.
  744. Title string `json:"title,omitempty"`
  745. // ForceSendFields is a list of field names (e.g. "Description") to
  746. // unconditionally include in API requests. By default, fields with
  747. // empty values are omitted from API requests. However, any non-pointer,
  748. // non-interface field appearing in ForceSendFields will be sent to the
  749. // server regardless of whether the field is empty or not. This may be
  750. // used to include empty fields in Patch requests.
  751. ForceSendFields []string `json:"-"`
  752. // NullFields is a list of field names (e.g. "Description") to include
  753. // in API requests with the JSON null value. By default, fields with
  754. // empty values are omitted from API requests. However, any field with
  755. // an empty value appearing in NullFields will be sent to the server as
  756. // null. It is an error if a field in this list has a non-empty value.
  757. // This may be used to include null fields in Patch requests.
  758. NullFields []string `json:"-"`
  759. }
  760. func (s *Expr) MarshalJSON() ([]byte, error) {
  761. type NoMethod Expr
  762. raw := NoMethod(*s)
  763. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  764. }
  765. // GceClusterConfig: Common config settings for resources of Compute
  766. // Engine cluster instances, applicable to all instances in the cluster.
  767. type GceClusterConfig struct {
  768. // InternalIpOnly: Optional. If true, all instances in the cluster will
  769. // only have internal IP addresses. By default, clusters are not
  770. // restricted to internal IP addresses, and will have ephemeral external
  771. // IP addresses assigned to each instance. This internal_ip_only
  772. // restriction can only be enabled for subnetwork enabled networks, and
  773. // all off-cluster dependencies must be configured to be accessible
  774. // without external IP addresses.
  775. InternalIpOnly bool `json:"internalIpOnly,omitempty"`
  776. // Metadata: The Compute Engine metadata entries to add to all instances
  777. // (see Project and instance metadata
  778. // (https://cloud.google.com/compute/docs/storing-retrieving-metadata#pro
  779. // ject_and_instance_metadata)).
  780. Metadata map[string]string `json:"metadata,omitempty"`
  781. // NetworkUri: Optional. The Compute Engine network to be used for
  782. // machine communications. Cannot be specified with subnetwork_uri. If
  783. // neither network_uri nor subnetwork_uri is specified, the "default"
  784. // network of the project is used, if it exists. Cannot be a "Custom
  785. // Subnet Network" (see Using Subnetworks for more information).A full
  786. // URL, partial URI, or short name are valid.
  787. // Examples:
  788. // https://www.googleapis.com/compute/v1/projects/[project_id]/
  789. // regions/global/default
  790. // projects/[project_id]/regions/global/default
  791. // de
  792. // fault
  793. NetworkUri string `json:"networkUri,omitempty"`
  794. // ServiceAccount: Optional. The service account of the instances.
  795. // Defaults to the default Compute Engine service account. Custom
  796. // service accounts need permissions equivalent to the following IAM
  797. // roles:
  798. // roles/logging.logWriter
  799. // roles/storage.objectAdmin(see
  800. // https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts for more information). Example:
  801. // [account_id]@[project_id].iam.gserviceaccount.com
  802. ServiceAccount string `json:"serviceAccount,omitempty"`
  803. // ServiceAccountScopes: Optional. The URIs of service account scopes to
  804. // be included in Compute Engine instances. The following base set of
  805. // scopes is always
  806. // included:
  807. // https://www.googleapis.com/auth/cloud.useraccounts.readonly
  808. //
  809. // https://www.googleapis.com/auth/devstorage.read_write
  810. // https://www.goog
  811. // leapis.com/auth/logging.writeIf no scopes are specified, the
  812. // following defaults are also
  813. // provided:
  814. // https://www.googleapis.com/auth/bigquery
  815. // https://www.googlea
  816. // pis.com/auth/bigtable.admin.table
  817. // https://www.googleapis.com/auth/bigt
  818. // able.data
  819. // https://www.googleapis.com/auth/devstorage.full_control
  820. ServiceAccountScopes []string `json:"serviceAccountScopes,omitempty"`
  821. // SubnetworkUri: Optional. The Compute Engine subnetwork to be used for
  822. // machine communications. Cannot be specified with network_uri.A full
  823. // URL, partial URI, or short name are valid.
  824. // Examples:
  825. // https://www.googleapis.com/compute/v1/projects/[project_id]/
  826. // regions/us-east1/sub0
  827. // projects/[project_id]/regions/us-east1/sub0
  828. // sub0
  829. SubnetworkUri string `json:"subnetworkUri,omitempty"`
  830. // Tags: The Compute Engine tags to add to all instances (see Tagging
  831. // instances).
  832. Tags []string `json:"tags,omitempty"`
  833. // ZoneUri: Optional. The zone where the Compute Engine cluster will be
  834. // located. On a create request, it is required in the "global" region.
  835. // If omitted in a non-global Cloud Dataproc region, the service will
  836. // pick a zone in the corresponding Compute Engine region. On a get
  837. // request, zone will always be present.A full URL, partial URI, or
  838. // short name are valid.
  839. // Examples:
  840. // https://www.googleapis.com/compute/v1/projects/[project_id]/
  841. // zones/[zone]
  842. // projects/[project_id]/zones/[zone]
  843. // us-central1-f
  844. ZoneUri string `json:"zoneUri,omitempty"`
  845. // ForceSendFields is a list of field names (e.g. "InternalIpOnly") to
  846. // unconditionally include in API requests. By default, fields with
  847. // empty values are omitted from API requests. However, any non-pointer,
  848. // non-interface field appearing in ForceSendFields will be sent to the
  849. // server regardless of whether the field is empty or not. This may be
  850. // used to include empty fields in Patch requests.
  851. ForceSendFields []string `json:"-"`
  852. // NullFields is a list of field names (e.g. "InternalIpOnly") to
  853. // include in API requests with the JSON null value. By default, fields
  854. // with empty values are omitted from API requests. However, any field
  855. // with an empty value appearing in NullFields will be sent to the
  856. // server as null. It is an error if a field in this list has a
  857. // non-empty value. This may be used to include null fields in Patch
  858. // requests.
  859. NullFields []string `json:"-"`
  860. }
  861. func (s *GceClusterConfig) MarshalJSON() ([]byte, error) {
  862. type NoMethod GceClusterConfig
  863. raw := NoMethod(*s)
  864. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  865. }
  866. // GetIamPolicyRequest: Request message for GetIamPolicy method.
  867. type GetIamPolicyRequest struct {
  868. }
  869. // HadoopJob: A Cloud Dataproc job for running Apache Hadoop MapReduce
  870. // (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop
  871. // -mapreduce-client-core/MapReduceTutorial.html) jobs on Apache Hadoop
  872. // YARN
  873. // (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YA
  874. // RN.html).
  875. type HadoopJob struct {
  876. // ArchiveUris: Optional. HCFS URIs of archives to be extracted in the
  877. // working directory of Hadoop drivers and tasks. Supported file types:
  878. // .jar, .tar, .tar.gz, .tgz, or .zip.
  879. ArchiveUris []string `json:"archiveUris,omitempty"`
  880. // Args: Optional. The arguments to pass to the driver. Do not include
  881. // arguments, such as -libjars or -Dfoo=bar, that can be set as job
  882. // properties, since a collision may occur that causes an incorrect job
  883. // submission.
  884. Args []string `json:"args,omitempty"`
  885. // FileUris: Optional. HCFS (Hadoop Compatible Filesystem) URIs of files
  886. // to be copied to the working directory of Hadoop drivers and
  887. // distributed tasks. Useful for naively parallel tasks.
  888. FileUris []string `json:"fileUris,omitempty"`
  889. // JarFileUris: Optional. Jar file URIs to add to the CLASSPATHs of the
  890. // Hadoop driver and tasks.
  891. JarFileUris []string `json:"jarFileUris,omitempty"`
  892. // LoggingConfig: Optional. The runtime log config for job execution.
  893. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  894. // MainClass: The name of the driver's main class. The jar file
  895. // containing the class must be in the default CLASSPATH or specified in
  896. // jar_file_uris.
  897. MainClass string `json:"mainClass,omitempty"`
  898. // MainJarFileUri: The HCFS URI of the jar file containing the main
  899. // class. Examples:
  900. // 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar'
  901. // 'hdfs:/tmp/test-samples/custom-wordcount.jar'
  902. // 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'
  903. MainJarFileUri string `json:"mainJarFileUri,omitempty"`
  904. // Properties: Optional. A mapping of property names to values, used to
  905. // configure Hadoop. Properties that conflict with values set by the
  906. // Cloud Dataproc API may be overwritten. Can include properties set in
  907. // /etc/hadoop/conf/*-site and classes in user code.
  908. Properties map[string]string `json:"properties,omitempty"`
  909. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  910. // unconditionally include in API requests. By default, fields with
  911. // empty values are omitted from API requests. However, any non-pointer,
  912. // non-interface field appearing in ForceSendFields will be sent to the
  913. // server regardless of whether the field is empty or not. This may be
  914. // used to include empty fields in Patch requests.
  915. ForceSendFields []string `json:"-"`
  916. // NullFields is a list of field names (e.g. "ArchiveUris") to include
  917. // in API requests with the JSON null value. By default, fields with
  918. // empty values are omitted from API requests. However, any field with
  919. // an empty value appearing in NullFields will be sent to the server as
  920. // null. It is an error if a field in this list has a non-empty value.
  921. // This may be used to include null fields in Patch requests.
  922. NullFields []string `json:"-"`
  923. }
  924. func (s *HadoopJob) MarshalJSON() ([]byte, error) {
  925. type NoMethod HadoopJob
  926. raw := NoMethod(*s)
  927. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  928. }
  929. // HiveJob: A Cloud Dataproc job for running Apache Hive
  930. // (https://hive.apache.org/) queries on YARN.
  931. type HiveJob struct {
  932. // ContinueOnFailure: Optional. Whether to continue executing queries if
  933. // a query fails. The default value is false. Setting to true can be
  934. // useful when executing independent parallel queries.
  935. ContinueOnFailure bool `json:"continueOnFailure,omitempty"`
  936. // JarFileUris: Optional. HCFS URIs of jar files to add to the CLASSPATH
  937. // of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive
  938. // SerDes and UDFs.
  939. JarFileUris []string `json:"jarFileUris,omitempty"`
  940. // Properties: Optional. A mapping of property names and values, used to
  941. // configure Hive. Properties that conflict with values set by the Cloud
  942. // Dataproc API may be overwritten. Can include properties set in
  943. // /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and
  944. // classes in user code.
  945. Properties map[string]string `json:"properties,omitempty"`
  946. // QueryFileUri: The HCFS URI of the script that contains Hive queries.
  947. QueryFileUri string `json:"queryFileUri,omitempty"`
  948. // QueryList: A list of queries.
  949. QueryList *QueryList `json:"queryList,omitempty"`
  950. // ScriptVariables: Optional. Mapping of query variable names to values
  951. // (equivalent to the Hive command: SET name="value";).
  952. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  953. // ForceSendFields is a list of field names (e.g. "ContinueOnFailure")
  954. // to unconditionally include in API requests. By default, fields with
  955. // empty values are omitted from API requests. However, any non-pointer,
  956. // non-interface field appearing in ForceSendFields will be sent to the
  957. // server regardless of whether the field is empty or not. This may be
  958. // used to include empty fields in Patch requests.
  959. ForceSendFields []string `json:"-"`
  960. // NullFields is a list of field names (e.g. "ContinueOnFailure") to
  961. // include in API requests with the JSON null value. By default, fields
  962. // with empty values are omitted from API requests. However, any field
  963. // with an empty value appearing in NullFields will be sent to the
  964. // server as null. It is an error if a field in this list has a
  965. // non-empty value. This may be used to include null fields in Patch
  966. // requests.
  967. NullFields []string `json:"-"`
  968. }
  969. func (s *HiveJob) MarshalJSON() ([]byte, error) {
  970. type NoMethod HiveJob
  971. raw := NoMethod(*s)
  972. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  973. }
  974. // InstanceGroupConfig: Optional. The config settings for Compute Engine
  975. // resources in an instance group, such as a master or worker group.
  976. type InstanceGroupConfig struct {
  977. // Accelerators: Optional. The Compute Engine accelerator configuration
  978. // for these instances.Beta Feature: This feature is still under
  979. // development. It may be changed before final release.
  980. Accelerators []*AcceleratorConfig `json:"accelerators,omitempty"`
  981. // DiskConfig: Optional. Disk option config settings.
  982. DiskConfig *DiskConfig `json:"diskConfig,omitempty"`
  983. // ImageUri: Optional. The Compute Engine image resource used for
  984. // cluster instances. It can be specified or may be inferred from
  985. // SoftwareConfig.image_version.
  986. ImageUri string `json:"imageUri,omitempty"`
  987. // InstanceNames: Output only. The list of instance names. Cloud
  988. // Dataproc derives the names from cluster_name, num_instances, and the
  989. // instance group.
  990. InstanceNames []string `json:"instanceNames,omitempty"`
  991. // IsPreemptible: Optional. Specifies that this instance group contains
  992. // preemptible instances.
  993. IsPreemptible bool `json:"isPreemptible,omitempty"`
  994. // MachineTypeUri: Optional. The Compute Engine machine type used for
  995. // cluster instances.A full URL, partial URI, or short name are valid.
  996. // Examples:
  997. // https://www.googleapis.com/compute/v1/projects/[project_id]/
  998. // zones/us-east1-a/machineTypes/n1-standard-2
  999. // projects/[project_id]/zone
  1000. // s/us-east1-a/machineTypes/n1-standard-2
  1001. // n1-standard-2Auto Zone Exception: If you are using the Cloud Dataproc
  1002. // Auto Zone Placement feature, you must use the short name of the
  1003. // machine type resource, for example, n1-standard-2.
  1004. MachineTypeUri string `json:"machineTypeUri,omitempty"`
  1005. // ManagedGroupConfig: Output only. The config for Compute Engine
  1006. // Instance Group Manager that manages this group. This is only used for
  1007. // preemptible instance groups.
  1008. ManagedGroupConfig *ManagedGroupConfig `json:"managedGroupConfig,omitempty"`
  1009. // NumInstances: Optional. The number of VM instances in the instance
  1010. // group. For master instance groups, must be set to 1.
  1011. NumInstances int64 `json:"numInstances,omitempty"`
  1012. // ForceSendFields is a list of field names (e.g. "Accelerators") to
  1013. // unconditionally include in API requests. By default, fields with
  1014. // empty values are omitted from API requests. However, any non-pointer,
  1015. // non-interface field appearing in ForceSendFields will be sent to the
  1016. // server regardless of whether the field is empty or not. This may be
  1017. // used to include empty fields in Patch requests.
  1018. ForceSendFields []string `json:"-"`
  1019. // NullFields is a list of field names (e.g. "Accelerators") to include
  1020. // in API requests with the JSON null value. By default, fields with
  1021. // empty values are omitted from API requests. However, any field with
  1022. // an empty value appearing in NullFields will be sent to the server as
  1023. // null. It is an error if a field in this list has a non-empty value.
  1024. // This may be used to include null fields in Patch requests.
  1025. NullFields []string `json:"-"`
  1026. }
  1027. func (s *InstanceGroupConfig) MarshalJSON() ([]byte, error) {
  1028. type NoMethod InstanceGroupConfig
  1029. raw := NoMethod(*s)
  1030. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1031. }
  1032. // InstantiateWorkflowTemplateRequest: A request to instantiate a
  1033. // workflow template.
  1034. type InstantiateWorkflowTemplateRequest struct {
  1035. // Parameters: Optional. Map from parameter names to values that should
  1036. // be used for those parameters. Values may not exceed 100 characters.
  1037. Parameters map[string]string `json:"parameters,omitempty"`
  1038. // RequestId: Optional. A tag that prevents multiple concurrent workflow
  1039. // instances with the same tag from running. This mitigates risk of
  1040. // concurrent instances started due to retries.It is recommended to
  1041. // always set this value to a UUID
  1042. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag
  1043. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  1044. // and hyphens (-). The maximum length is 40 characters.
  1045. RequestId string `json:"requestId,omitempty"`
  1046. // Version: Optional. The version of workflow template to instantiate.
  1047. // If specified, the workflow will be instantiated only if the current
  1048. // version of the workflow template has the supplied version.This option
  1049. // cannot be used to instantiate a previous version of workflow
  1050. // template.
  1051. Version int64 `json:"version,omitempty"`
  1052. // ForceSendFields is a list of field names (e.g. "Parameters") to
  1053. // unconditionally include in API requests. By default, fields with
  1054. // empty values are omitted from API requests. However, any non-pointer,
  1055. // non-interface field appearing in ForceSendFields will be sent to the
  1056. // server regardless of whether the field is empty or not. This may be
  1057. // used to include empty fields in Patch requests.
  1058. ForceSendFields []string `json:"-"`
  1059. // NullFields is a list of field names (e.g. "Parameters") to include in
  1060. // API requests with the JSON null value. By default, fields with empty
  1061. // values are omitted from API requests. However, any field with an
  1062. // empty value appearing in NullFields will be sent to the server as
  1063. // null. It is an error if a field in this list has a non-empty value.
  1064. // This may be used to include null fields in Patch requests.
  1065. NullFields []string `json:"-"`
  1066. }
  1067. func (s *InstantiateWorkflowTemplateRequest) MarshalJSON() ([]byte, error) {
  1068. type NoMethod InstantiateWorkflowTemplateRequest
  1069. raw := NoMethod(*s)
  1070. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1071. }
  1072. // Job: A Cloud Dataproc job resource.
  1073. type Job struct {
  1074. // DriverControlFilesUri: Output only. If present, the location of
  1075. // miscellaneous control files which may be used as part of job setup
  1076. // and handling. If not present, control files may be placed in the same
  1077. // location as driver_output_uri.
  1078. DriverControlFilesUri string `json:"driverControlFilesUri,omitempty"`
  1079. // DriverOutputResourceUri: Output only. A URI pointing to the location
  1080. // of the stdout of the job's driver program.
  1081. DriverOutputResourceUri string `json:"driverOutputResourceUri,omitempty"`
  1082. // HadoopJob: Job is a Hadoop job.
  1083. HadoopJob *HadoopJob `json:"hadoopJob,omitempty"`
  1084. // HiveJob: Job is a Hive job.
  1085. HiveJob *HiveJob `json:"hiveJob,omitempty"`
  1086. // JobUuid: Output only. A UUID that uniquely identifies a job within
  1087. // the project over time. This is in contrast to a user-settable
  1088. // reference.job_id that may be reused over time.
  1089. JobUuid string `json:"jobUuid,omitempty"`
  1090. // Labels: Optional. The labels to associate with this job. Label keys
  1091. // must contain 1 to 63 characters, and must conform to RFC 1035
  1092. // (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty,
  1093. // but, if present, must contain 1 to 63 characters, and must conform to
  1094. // RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32
  1095. // labels can be associated with a job.
  1096. Labels map[string]string `json:"labels,omitempty"`
  1097. // PigJob: Job is a Pig job.
  1098. PigJob *PigJob `json:"pigJob,omitempty"`
  1099. // Placement: Required. Job information, including how, when, and where
  1100. // to run the job.
  1101. Placement *JobPlacement `json:"placement,omitempty"`
  1102. // PysparkJob: Job is a Pyspark job.
  1103. PysparkJob *PySparkJob `json:"pysparkJob,omitempty"`
  1104. // Reference: Optional. The fully qualified reference to the job, which
  1105. // can be used to obtain the equivalent REST path of the job resource.
  1106. // If this property is not specified when a job is created, the server
  1107. // generates a <code>job_id</code>.
  1108. Reference *JobReference `json:"reference,omitempty"`
  1109. // Scheduling: Optional. Job scheduling configuration.
  1110. Scheduling *JobScheduling `json:"scheduling,omitempty"`
  1111. // SparkJob: Job is a Spark job.
  1112. SparkJob *SparkJob `json:"sparkJob,omitempty"`
  1113. // SparkSqlJob: Job is a SparkSql job.
  1114. SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"`
  1115. // Status: Output only. The job status. Additional application-specific
  1116. // status information may be contained in the <code>type_job</code> and
  1117. // <code>yarn_applications</code> fields.
  1118. Status *JobStatus `json:"status,omitempty"`
  1119. // StatusHistory: Output only. The previous job status.
  1120. StatusHistory []*JobStatus `json:"statusHistory,omitempty"`
  1121. // YarnApplications: Output only. The collection of YARN applications
  1122. // spun up by this job.Beta Feature: This report is available for
  1123. // testing purposes only. It may be changed before final release.
  1124. YarnApplications []*YarnApplication `json:"yarnApplications,omitempty"`
  1125. // ServerResponse contains the HTTP response code and headers from the
  1126. // server.
  1127. googleapi.ServerResponse `json:"-"`
  1128. // ForceSendFields is a list of field names (e.g.
  1129. // "DriverControlFilesUri") to unconditionally include in API requests.
  1130. // By default, fields with empty values are omitted from API requests.
  1131. // However, any non-pointer, non-interface field appearing in
  1132. // ForceSendFields will be sent to the server regardless of whether the
  1133. // field is empty or not. This may be used to include empty fields in
  1134. // Patch requests.
  1135. ForceSendFields []string `json:"-"`
  1136. // NullFields is a list of field names (e.g. "DriverControlFilesUri") to
  1137. // include in API requests with the JSON null value. By default, fields
  1138. // with empty values are omitted from API requests. However, any field
  1139. // with an empty value appearing in NullFields will be sent to the
  1140. // server as null. It is an error if a field in this list has a
  1141. // non-empty value. This may be used to include null fields in Patch
  1142. // requests.
  1143. NullFields []string `json:"-"`
  1144. }
  1145. func (s *Job) MarshalJSON() ([]byte, error) {
  1146. type NoMethod Job
  1147. raw := NoMethod(*s)
  1148. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1149. }
  1150. // JobPlacement: Cloud Dataproc job config.
  1151. type JobPlacement struct {
  1152. // ClusterName: Required. The name of the cluster where the job will be
  1153. // submitted.
  1154. ClusterName string `json:"clusterName,omitempty"`
  1155. // ClusterUuid: Output only. A cluster UUID generated by the Cloud
  1156. // Dataproc service when the job is submitted.
  1157. ClusterUuid string `json:"clusterUuid,omitempty"`
  1158. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  1159. // unconditionally include in API requests. By default, fields with
  1160. // empty values are omitted from API requests. However, any non-pointer,
  1161. // non-interface field appearing in ForceSendFields will be sent to the
  1162. // server regardless of whether the field is empty or not. This may be
  1163. // used to include empty fields in Patch requests.
  1164. ForceSendFields []string `json:"-"`
  1165. // NullFields is a list of field names (e.g. "ClusterName") to include
  1166. // in API requests with the JSON null value. By default, fields with
  1167. // empty values are omitted from API requests. However, any field with
  1168. // an empty value appearing in NullFields will be sent to the server as
  1169. // null. It is an error if a field in this list has a non-empty value.
  1170. // This may be used to include null fields in Patch requests.
  1171. NullFields []string `json:"-"`
  1172. }
  1173. func (s *JobPlacement) MarshalJSON() ([]byte, error) {
  1174. type NoMethod JobPlacement
  1175. raw := NoMethod(*s)
  1176. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1177. }
  1178. // JobReference: Encapsulates the full scoping used to reference a job.
  1179. type JobReference struct {
  1180. // JobId: Optional. The job ID, which must be unique within the
  1181. // project.The ID must contain only letters (a-z, A-Z), numbers (0-9),
  1182. // underscores (_), or hyphens (-). The maximum length is 100
  1183. // characters.If not specified by the caller, the job ID will be
  1184. // provided by the server.
  1185. JobId string `json:"jobId,omitempty"`
  1186. // ProjectId: Required. The ID of the Google Cloud Platform project that
  1187. // the job belongs to.
  1188. ProjectId string `json:"projectId,omitempty"`
  1189. // ForceSendFields is a list of field names (e.g. "JobId") to
  1190. // unconditionally include in API requests. By default, fields with
  1191. // empty values are omitted from API requests. However, any non-pointer,
  1192. // non-interface field appearing in ForceSendFields will be sent to the
  1193. // server regardless of whether the field is empty or not. This may be
  1194. // used to include empty fields in Patch requests.
  1195. ForceSendFields []string `json:"-"`
  1196. // NullFields is a list of field names (e.g. "JobId") to include in API
  1197. // requests with the JSON null value. By default, fields with empty
  1198. // values are omitted from API requests. However, any field with an
  1199. // empty value appearing in NullFields will be sent to the server as
  1200. // null. It is an error if a field in this list has a non-empty value.
  1201. // This may be used to include null fields in Patch requests.
  1202. NullFields []string `json:"-"`
  1203. }
  1204. func (s *JobReference) MarshalJSON() ([]byte, error) {
  1205. type NoMethod JobReference
  1206. raw := NoMethod(*s)
  1207. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1208. }
  1209. // JobScheduling: Job scheduling options.
  1210. type JobScheduling struct {
  1211. // MaxFailuresPerHour: Optional. Maximum number of times per hour a
  1212. // driver may be restarted as a result of driver terminating with
  1213. // non-zero code before job is reported failed.A job may be reported as
  1214. // thrashing if driver exits with non-zero code 4 times within 10 minute
  1215. // window.Maximum value is 10.
  1216. MaxFailuresPerHour int64 `json:"maxFailuresPerHour,omitempty"`
  1217. // ForceSendFields is a list of field names (e.g. "MaxFailuresPerHour")
  1218. // to unconditionally include in API requests. By default, fields with
  1219. // empty values are omitted from API requests. However, any non-pointer,
  1220. // non-interface field appearing in ForceSendFields will be sent to the
  1221. // server regardless of whether the field is empty or not. This may be
  1222. // used to include empty fields in Patch requests.
  1223. ForceSendFields []string `json:"-"`
  1224. // NullFields is a list of field names (e.g. "MaxFailuresPerHour") to
  1225. // include in API requests with the JSON null value. By default, fields
  1226. // with empty values are omitted from API requests. However, any field
  1227. // with an empty value appearing in NullFields will be sent to the
  1228. // server as null. It is an error if a field in this list has a
  1229. // non-empty value. This may be used to include null fields in Patch
  1230. // requests.
  1231. NullFields []string `json:"-"`
  1232. }
  1233. func (s *JobScheduling) MarshalJSON() ([]byte, error) {
  1234. type NoMethod JobScheduling
  1235. raw := NoMethod(*s)
  1236. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1237. }
  1238. // JobStatus: Cloud Dataproc job status.
  1239. type JobStatus struct {
  1240. // Details: Output only. Optional job state details, such as an error
  1241. // description if the state is <code>ERROR</code>.
  1242. Details string `json:"details,omitempty"`
  1243. // State: Output only. A state message specifying the overall job state.
  1244. //
  1245. // Possible values:
  1246. // "STATE_UNSPECIFIED" - The job state is unknown.
  1247. // "PENDING" - The job is pending; it has been submitted, but is not
  1248. // yet running.
  1249. // "SETUP_DONE" - Job has been received by the service and completed
  1250. // initial setup; it will soon be submitted to the cluster.
  1251. // "RUNNING" - The job is running on the cluster.
  1252. // "CANCEL_PENDING" - A CancelJob request has been received, but is
  1253. // pending.
  1254. // "CANCEL_STARTED" - Transient in-flight resources have been
  1255. // canceled, and the request to cancel the running job has been issued
  1256. // to the cluster.
  1257. // "CANCELLED" - The job cancellation was successful.
  1258. // "DONE" - The job has completed successfully.
  1259. // "ERROR" - The job has completed, but encountered an error.
  1260. // "ATTEMPT_FAILURE" - Job attempt has failed. The detail field
  1261. // contains failure details for this attempt.Applies to restartable jobs
  1262. // only.
  1263. State string `json:"state,omitempty"`
  1264. // StateStartTime: Output only. The time when this state was entered.
  1265. StateStartTime string `json:"stateStartTime,omitempty"`
  1266. // Substate: Output only. Additional state information, which includes
  1267. // status reported by the agent.
  1268. //
  1269. // Possible values:
  1270. // "UNSPECIFIED" - The job substate is unknown.
  1271. // "SUBMITTED" - The Job is submitted to the agent.Applies to RUNNING
  1272. // state.
  1273. // "QUEUED" - The Job has been received and is awaiting execution (it
  1274. // may be waiting for a condition to be met). See the "details" field
  1275. // for the reason for the delay.Applies to RUNNING state.
  1276. // "STALE_STATUS" - The agent-reported status is out of date, which
  1277. // may be caused by a loss of communication between the agent and Cloud
  1278. // Dataproc. If the agent does not send a timely update, the job will
  1279. // fail.Applies to RUNNING state.
  1280. Substate string `json:"substate,omitempty"`
  1281. // ForceSendFields is a list of field names (e.g. "Details") to
  1282. // unconditionally include in API requests. By default, fields with
  1283. // empty values are omitted from API requests. However, any non-pointer,
  1284. // non-interface field appearing in ForceSendFields will be sent to the
  1285. // server regardless of whether the field is empty or not. This may be
  1286. // used to include empty fields in Patch requests.
  1287. ForceSendFields []string `json:"-"`
  1288. // NullFields is a list of field names (e.g. "Details") to include in
  1289. // API requests with the JSON null value. By default, fields with empty
  1290. // values are omitted from API requests. However, any field with an
  1291. // empty value appearing in NullFields will be sent to the server as
  1292. // null. It is an error if a field in this list has a non-empty value.
  1293. // This may be used to include null fields in Patch requests.
  1294. NullFields []string `json:"-"`
  1295. }
  1296. func (s *JobStatus) MarshalJSON() ([]byte, error) {
  1297. type NoMethod JobStatus
  1298. raw := NoMethod(*s)
  1299. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1300. }
  1301. // ListClustersResponse: The list of all clusters in a project.
  1302. type ListClustersResponse struct {
  1303. // Clusters: Output only. The clusters in the project.
  1304. Clusters []*Cluster `json:"clusters,omitempty"`
  1305. // NextPageToken: Output only. This token is included in the response if
  1306. // there are more results to fetch. To fetch additional results, provide
  1307. // this value as the page_token in a subsequent ListClustersRequest.
  1308. NextPageToken string `json:"nextPageToken,omitempty"`
  1309. // ServerResponse contains the HTTP response code and headers from the
  1310. // server.
  1311. googleapi.ServerResponse `json:"-"`
  1312. // ForceSendFields is a list of field names (e.g. "Clusters") to
  1313. // unconditionally include in API requests. By default, fields with
  1314. // empty values are omitted from API requests. However, any non-pointer,
  1315. // non-interface field appearing in ForceSendFields will be sent to the
  1316. // server regardless of whether the field is empty or not. This may be
  1317. // used to include empty fields in Patch requests.
  1318. ForceSendFields []string `json:"-"`
  1319. // NullFields is a list of field names (e.g. "Clusters") to include in
  1320. // API requests with the JSON null value. By default, fields with empty
  1321. // values are omitted from API requests. However, any field with an
  1322. // empty value appearing in NullFields will be sent to the server as
  1323. // null. It is an error if a field in this list has a non-empty value.
  1324. // This may be used to include null fields in Patch requests.
  1325. NullFields []string `json:"-"`
  1326. }
  1327. func (s *ListClustersResponse) MarshalJSON() ([]byte, error) {
  1328. type NoMethod ListClustersResponse
  1329. raw := NoMethod(*s)
  1330. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1331. }
  1332. // ListJobsResponse: A list of jobs in a project.
  1333. type ListJobsResponse struct {
  1334. // Jobs: Output only. Jobs list.
  1335. Jobs []*Job `json:"jobs,omitempty"`
  1336. // NextPageToken: Optional. This token is included in the response if
  1337. // there are more results to fetch. To fetch additional results, provide
  1338. // this value as the page_token in a subsequent
  1339. // <code>ListJobsRequest</code>.
  1340. NextPageToken string `json:"nextPageToken,omitempty"`
  1341. // ServerResponse contains the HTTP response code and headers from the
  1342. // server.
  1343. googleapi.ServerResponse `json:"-"`
  1344. // ForceSendFields is a list of field names (e.g. "Jobs") to
  1345. // unconditionally include in API requests. By default, fields with
  1346. // empty values are omitted from API requests. However, any non-pointer,
  1347. // non-interface field appearing in ForceSendFields will be sent to the
  1348. // server regardless of whether the field is empty or not. This may be
  1349. // used to include empty fields in Patch requests.
  1350. ForceSendFields []string `json:"-"`
  1351. // NullFields is a list of field names (e.g. "Jobs") to include in API
  1352. // requests with the JSON null value. By default, fields with empty
  1353. // values are omitted from API requests. However, any field with an
  1354. // empty value appearing in NullFields will be sent to the server as
  1355. // null. It is an error if a field in this list has a non-empty value.
  1356. // This may be used to include null fields in Patch requests.
  1357. NullFields []string `json:"-"`
  1358. }
  1359. func (s *ListJobsResponse) MarshalJSON() ([]byte, error) {
  1360. type NoMethod ListJobsResponse
  1361. raw := NoMethod(*s)
  1362. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1363. }
  1364. // ListOperationsResponse: The response message for
  1365. // Operations.ListOperations.
  1366. type ListOperationsResponse struct {
  1367. // NextPageToken: The standard List next-page token.
  1368. NextPageToken string `json:"nextPageToken,omitempty"`
  1369. // Operations: A list of operations that matches the specified filter in
  1370. // the request.
  1371. Operations []*Operation `json:"operations,omitempty"`
  1372. // ServerResponse contains the HTTP response code and headers from the
  1373. // server.
  1374. googleapi.ServerResponse `json:"-"`
  1375. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1376. // unconditionally include in API requests. By default, fields with
  1377. // empty values are omitted from API requests. However, any non-pointer,
  1378. // non-interface field appearing in ForceSendFields will be sent to the
  1379. // server regardless of whether the field is empty or not. This may be
  1380. // used to include empty fields in Patch requests.
  1381. ForceSendFields []string `json:"-"`
  1382. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1383. // in API requests with the JSON null value. By default, fields with
  1384. // empty values are omitted from API requests. However, any field with
  1385. // an empty value appearing in NullFields will be sent to the server as
  1386. // null. It is an error if a field in this list has a non-empty value.
  1387. // This may be used to include null fields in Patch requests.
  1388. NullFields []string `json:"-"`
  1389. }
  1390. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  1391. type NoMethod ListOperationsResponse
  1392. raw := NoMethod(*s)
  1393. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1394. }
  1395. // ListWorkflowTemplatesResponse: A response to a request to list
  1396. // workflow templates in a project.
  1397. type ListWorkflowTemplatesResponse struct {
  1398. // NextPageToken: Output only. This token is included in the response if
  1399. // there are more results to fetch. To fetch additional results, provide
  1400. // this value as the page_token in a subsequent
  1401. // <code>ListWorkflowTemplatesRequest</code>.
  1402. NextPageToken string `json:"nextPageToken,omitempty"`
  1403. // Templates: Output only. WorkflowTemplates list.
  1404. Templates []*WorkflowTemplate `json:"templates,omitempty"`
  1405. // ServerResponse contains the HTTP response code and headers from the
  1406. // server.
  1407. googleapi.ServerResponse `json:"-"`
  1408. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1409. // unconditionally include in API requests. By default, fields with
  1410. // empty values are omitted from API requests. However, any non-pointer,
  1411. // non-interface field appearing in ForceSendFields will be sent to the
  1412. // server regardless of whether the field is empty or not. This may be
  1413. // used to include empty fields in Patch requests.
  1414. ForceSendFields []string `json:"-"`
  1415. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1416. // in API requests with the JSON null value. By default, fields with
  1417. // empty values are omitted from API requests. However, any field with
  1418. // an empty value appearing in NullFields will be sent to the server as
  1419. // null. It is an error if a field in this list has a non-empty value.
  1420. // This may be used to include null fields in Patch requests.
  1421. NullFields []string `json:"-"`
  1422. }
  1423. func (s *ListWorkflowTemplatesResponse) MarshalJSON() ([]byte, error) {
  1424. type NoMethod ListWorkflowTemplatesResponse
  1425. raw := NoMethod(*s)
  1426. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1427. }
  1428. // LoggingConfig: The runtime logging config of the job.
  1429. type LoggingConfig struct {
  1430. // DriverLogLevels: The per-package log levels for the driver. This may
  1431. // include "root" package name to configure rootLogger. Examples:
  1432. // 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'
  1433. DriverLogLevels map[string]string `json:"driverLogLevels,omitempty"`
  1434. // ForceSendFields is a list of field names (e.g. "DriverLogLevels") to
  1435. // unconditionally include in API requests. By default, fields with
  1436. // empty values are omitted from API requests. However, any non-pointer,
  1437. // non-interface field appearing in ForceSendFields will be sent to the
  1438. // server regardless of whether the field is empty or not. This may be
  1439. // used to include empty fields in Patch requests.
  1440. ForceSendFields []string `json:"-"`
  1441. // NullFields is a list of field names (e.g. "DriverLogLevels") to
  1442. // include in API requests with the JSON null value. By default, fields
  1443. // with empty values are omitted from API requests. However, any field
  1444. // with an empty value appearing in NullFields will be sent to the
  1445. // server as null. It is an error if a field in this list has a
  1446. // non-empty value. This may be used to include null fields in Patch
  1447. // requests.
  1448. NullFields []string `json:"-"`
  1449. }
  1450. func (s *LoggingConfig) MarshalJSON() ([]byte, error) {
  1451. type NoMethod LoggingConfig
  1452. raw := NoMethod(*s)
  1453. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1454. }
  1455. // ManagedCluster: Cluster that is managed by the workflow.
  1456. type ManagedCluster struct {
  1457. // ClusterName: Required. The cluster name prefix. A unique cluster name
  1458. // will be formed by appending a random suffix.The name must contain
  1459. // only lower-case letters (a-z), numbers (0-9), and hyphens (-). Must
  1460. // begin with a letter. Cannot begin or end with hyphen. Must consist of
  1461. // between 2 and 35 characters.
  1462. ClusterName string `json:"clusterName,omitempty"`
  1463. // Config: Required. The cluster configuration.
  1464. Config *ClusterConfig `json:"config,omitempty"`
  1465. // Labels: Optional. The labels to associate with this cluster.Label
  1466. // keys must be between 1 and 63 characters long, and must conform to
  1467. // the following PCRE regular expression: \p{Ll}\p{Lo}{0,62}Label values
  1468. // must be between 1 and 63 characters long, and must conform to the
  1469. // following PCRE regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more
  1470. // than 32 labels can be associated with a given cluster.
  1471. Labels map[string]string `json:"labels,omitempty"`
  1472. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  1473. // unconditionally include in API requests. By default, fields with
  1474. // empty values are omitted from API requests. However, any non-pointer,
  1475. // non-interface field appearing in ForceSendFields will be sent to the
  1476. // server regardless of whether the field is empty or not. This may be
  1477. // used to include empty fields in Patch requests.
  1478. ForceSendFields []string `json:"-"`
  1479. // NullFields is a list of field names (e.g. "ClusterName") to include
  1480. // in API requests with the JSON null value. By default, fields with
  1481. // empty values are omitted from API requests. However, any field with
  1482. // an empty value appearing in NullFields will be sent to the server as
  1483. // null. It is an error if a field in this list has a non-empty value.
  1484. // This may be used to include null fields in Patch requests.
  1485. NullFields []string `json:"-"`
  1486. }
  1487. func (s *ManagedCluster) MarshalJSON() ([]byte, error) {
  1488. type NoMethod ManagedCluster
  1489. raw := NoMethod(*s)
  1490. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1491. }
  1492. // ManagedGroupConfig: Specifies the resources used to actively manage
  1493. // an instance group.
  1494. type ManagedGroupConfig struct {
  1495. // InstanceGroupManagerName: Output only. The name of the Instance Group
  1496. // Manager for this group.
  1497. InstanceGroupManagerName string `json:"instanceGroupManagerName,omitempty"`
  1498. // InstanceTemplateName: Output only. The name of the Instance Template
  1499. // used for the Managed Instance Group.
  1500. InstanceTemplateName string `json:"instanceTemplateName,omitempty"`
  1501. // ForceSendFields is a list of field names (e.g.
  1502. // "InstanceGroupManagerName") to unconditionally include in API
  1503. // requests. By default, fields with empty values are omitted from API
  1504. // requests. However, any non-pointer, non-interface field appearing in
  1505. // ForceSendFields will be sent to the server regardless of whether the
  1506. // field is empty or not. This may be used to include empty fields in
  1507. // Patch requests.
  1508. ForceSendFields []string `json:"-"`
  1509. // NullFields is a list of field names (e.g. "InstanceGroupManagerName")
  1510. // to include in API requests with the JSON null value. By default,
  1511. // fields with empty values are omitted from API requests. However, any
  1512. // field with an empty value appearing in NullFields will be sent to the
  1513. // server as null. It is an error if a field in this list has a
  1514. // non-empty value. This may be used to include null fields in Patch
  1515. // requests.
  1516. NullFields []string `json:"-"`
  1517. }
  1518. func (s *ManagedGroupConfig) MarshalJSON() ([]byte, error) {
  1519. type NoMethod ManagedGroupConfig
  1520. raw := NoMethod(*s)
  1521. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1522. }
  1523. // NodeInitializationAction: Specifies an executable to run on a fully
  1524. // configured node and a timeout period for executable completion.
  1525. type NodeInitializationAction struct {
  1526. // ExecutableFile: Required. Cloud Storage URI of executable file.
  1527. ExecutableFile string `json:"executableFile,omitempty"`
  1528. // ExecutionTimeout: Optional. Amount of time executable has to
  1529. // complete. Default is 10 minutes. Cluster creation fails with an
  1530. // explanatory error message (the name of the executable that caused the
  1531. // error and the exceeded timeout period) if the executable is not
  1532. // completed at end of the timeout period.
  1533. ExecutionTimeout string `json:"executionTimeout,omitempty"`
  1534. // ForceSendFields is a list of field names (e.g. "ExecutableFile") to
  1535. // unconditionally include in API requests. By default, fields with
  1536. // empty values are omitted from API requests. However, any non-pointer,
  1537. // non-interface field appearing in ForceSendFields will be sent to the
  1538. // server regardless of whether the field is empty or not. This may be
  1539. // used to include empty fields in Patch requests.
  1540. ForceSendFields []string `json:"-"`
  1541. // NullFields is a list of field names (e.g. "ExecutableFile") to
  1542. // include in API requests with the JSON null value. By default, fields
  1543. // with empty values are omitted from API requests. However, any field
  1544. // with an empty value appearing in NullFields will be sent to the
  1545. // server as null. It is an error if a field in this list has a
  1546. // non-empty value. This may be used to include null fields in Patch
  1547. // requests.
  1548. NullFields []string `json:"-"`
  1549. }
  1550. func (s *NodeInitializationAction) MarshalJSON() ([]byte, error) {
  1551. type NoMethod NodeInitializationAction
  1552. raw := NoMethod(*s)
  1553. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1554. }
  1555. // Operation: This resource represents a long-running operation that is
  1556. // the result of a network API call.
  1557. type Operation struct {
  1558. // Done: If the value is false, it means the operation is still in
  1559. // progress. If true, the operation is completed, and either error or
  1560. // response is available.
  1561. Done bool `json:"done,omitempty"`
  1562. // Error: The error result of the operation in case of failure or
  1563. // cancellation.
  1564. Error *Status `json:"error,omitempty"`
  1565. // Metadata: Service-specific metadata associated with the operation. It
  1566. // typically contains progress information and common metadata such as
  1567. // create time. Some services might not provide such metadata. Any
  1568. // method that returns a long-running operation should document the
  1569. // metadata type, if any.
  1570. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1571. // Name: The server-assigned name, which is only unique within the same
  1572. // service that originally returns it. If you use the default HTTP
  1573. // mapping, the name should have the format of
  1574. // operations/some/unique/name.
  1575. Name string `json:"name,omitempty"`
  1576. // Response: The normal response of the operation in case of success. If
  1577. // the original method returns no data on success, such as Delete, the
  1578. // response is google.protobuf.Empty. If the original method is standard
  1579. // Get/Create/Update, the response should be the resource. For other
  1580. // methods, the response should have the type XxxResponse, where Xxx is
  1581. // the original method name. For example, if the original method name is
  1582. // TakeSnapshot(), the inferred response type is TakeSnapshotResponse.
  1583. Response googleapi.RawMessage `json:"response,omitempty"`
  1584. // ServerResponse contains the HTTP response code and headers from the
  1585. // server.
  1586. googleapi.ServerResponse `json:"-"`
  1587. // ForceSendFields is a list of field names (e.g. "Done") to
  1588. // unconditionally include in API requests. By default, fields with
  1589. // empty values are omitted from API requests. However, any non-pointer,
  1590. // non-interface field appearing in ForceSendFields will be sent to the
  1591. // server regardless of whether the field is empty or not. This may be
  1592. // used to include empty fields in Patch requests.
  1593. ForceSendFields []string `json:"-"`
  1594. // NullFields is a list of field names (e.g. "Done") to include in API
  1595. // requests with the JSON null value. By default, fields with empty
  1596. // values are omitted from API requests. However, any field with an
  1597. // empty value appearing in NullFields will be sent to the server as
  1598. // null. It is an error if a field in this list has a non-empty value.
  1599. // This may be used to include null fields in Patch requests.
  1600. NullFields []string `json:"-"`
  1601. }
  1602. func (s *Operation) MarshalJSON() ([]byte, error) {
  1603. type NoMethod Operation
  1604. raw := NoMethod(*s)
  1605. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1606. }
  1607. // OrderedJob: A job executed by the workflow.
  1608. type OrderedJob struct {
  1609. // HadoopJob: Job is a Hadoop job.
  1610. HadoopJob *HadoopJob `json:"hadoopJob,omitempty"`
  1611. // HiveJob: Job is a Hive job.
  1612. HiveJob *HiveJob `json:"hiveJob,omitempty"`
  1613. // Labels: Optional. The labels to associate with this job.Label keys
  1614. // must be between 1 and 63 characters long, and must conform to the
  1615. // following regular expression: \p{Ll}\p{Lo}{0,62}Label values must be
  1616. // between 1 and 63 characters long, and must conform to the following
  1617. // regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels
  1618. // can be associated with a given job.
  1619. Labels map[string]string `json:"labels,omitempty"`
  1620. // PigJob: Job is a Pig job.
  1621. PigJob *PigJob `json:"pigJob,omitempty"`
  1622. // PrerequisiteStepIds: Optional. The optional list of prerequisite job
  1623. // step_ids. If not specified, the job will start at the beginning of
  1624. // workflow.
  1625. PrerequisiteStepIds []string `json:"prerequisiteStepIds,omitempty"`
  1626. // PysparkJob: Job is a Pyspark job.
  1627. PysparkJob *PySparkJob `json:"pysparkJob,omitempty"`
  1628. // Scheduling: Optional. Job scheduling configuration.
  1629. Scheduling *JobScheduling `json:"scheduling,omitempty"`
  1630. // SparkJob: Job is a Spark job.
  1631. SparkJob *SparkJob `json:"sparkJob,omitempty"`
  1632. // SparkSqlJob: Job is a SparkSql job.
  1633. SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"`
  1634. // StepId: Required. The step id. The id must be unique among all jobs
  1635. // within the template.The step id is used as prefix for job id, as job
  1636. // goog-dataproc-workflow-step-id label, and in prerequisiteStepIds
  1637. // field from other steps.The id must contain only letters (a-z, A-Z),
  1638. // numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end
  1639. // with underscore or hyphen. Must consist of between 3 and 50
  1640. // characters.
  1641. StepId string `json:"stepId,omitempty"`
  1642. // ForceSendFields is a list of field names (e.g. "HadoopJob") to
  1643. // unconditionally include in API requests. By default, fields with
  1644. // empty values are omitted from API requests. However, any non-pointer,
  1645. // non-interface field appearing in ForceSendFields will be sent to the
  1646. // server regardless of whether the field is empty or not. This may be
  1647. // used to include empty fields in Patch requests.
  1648. ForceSendFields []string `json:"-"`
  1649. // NullFields is a list of field names (e.g. "HadoopJob") to include in
  1650. // API requests with the JSON null value. By default, fields with empty
  1651. // values are omitted from API requests. However, any field with an
  1652. // empty value appearing in NullFields will be sent to the server as
  1653. // null. It is an error if a field in this list has a non-empty value.
  1654. // This may be used to include null fields in Patch requests.
  1655. NullFields []string `json:"-"`
  1656. }
  1657. func (s *OrderedJob) MarshalJSON() ([]byte, error) {
  1658. type NoMethod OrderedJob
  1659. raw := NoMethod(*s)
  1660. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1661. }
  1662. // ParameterValidation: Configuration for parameter validation.
  1663. type ParameterValidation struct {
  1664. // Regex: Validation based on regular expressions.
  1665. Regex *RegexValidation `json:"regex,omitempty"`
  1666. // Values: Validation based on a list of allowed values.
  1667. Values *ValueValidation `json:"values,omitempty"`
  1668. // ForceSendFields is a list of field names (e.g. "Regex") to
  1669. // unconditionally include in API requests. By default, fields with
  1670. // empty values are omitted from API requests. However, any non-pointer,
  1671. // non-interface field appearing in ForceSendFields will be sent to the
  1672. // server regardless of whether the field is empty or not. This may be
  1673. // used to include empty fields in Patch requests.
  1674. ForceSendFields []string `json:"-"`
  1675. // NullFields is a list of field names (e.g. "Regex") to include in API
  1676. // requests with the JSON null value. By default, fields with empty
  1677. // values are omitted from API requests. However, any field with an
  1678. // empty value appearing in NullFields will be sent to the server as
  1679. // null. It is an error if a field in this list has a non-empty value.
  1680. // This may be used to include null fields in Patch requests.
  1681. NullFields []string `json:"-"`
  1682. }
  1683. func (s *ParameterValidation) MarshalJSON() ([]byte, error) {
  1684. type NoMethod ParameterValidation
  1685. raw := NoMethod(*s)
  1686. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1687. }
  1688. // PigJob: A Cloud Dataproc job for running Apache Pig
  1689. // (https://pig.apache.org/) queries on YARN.
  1690. type PigJob struct {
  1691. // ContinueOnFailure: Optional. Whether to continue executing queries if
  1692. // a query fails. The default value is false. Setting to true can be
  1693. // useful when executing independent parallel queries.
  1694. ContinueOnFailure bool `json:"continueOnFailure,omitempty"`
  1695. // JarFileUris: Optional. HCFS URIs of jar files to add to the CLASSPATH
  1696. // of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig
  1697. // UDFs.
  1698. JarFileUris []string `json:"jarFileUris,omitempty"`
  1699. // LoggingConfig: Optional. The runtime log config for job execution.
  1700. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  1701. // Properties: Optional. A mapping of property names to values, used to
  1702. // configure Pig. Properties that conflict with values set by the Cloud
  1703. // Dataproc API may be overwritten. Can include properties set in
  1704. // /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and
  1705. // classes in user code.
  1706. Properties map[string]string `json:"properties,omitempty"`
  1707. // QueryFileUri: The HCFS URI of the script that contains the Pig
  1708. // queries.
  1709. QueryFileUri string `json:"queryFileUri,omitempty"`
  1710. // QueryList: A list of queries.
  1711. QueryList *QueryList `json:"queryList,omitempty"`
  1712. // ScriptVariables: Optional. Mapping of query variable names to values
  1713. // (equivalent to the Pig command: name=[value]).
  1714. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  1715. // ForceSendFields is a list of field names (e.g. "ContinueOnFailure")
  1716. // to unconditionally include in API requests. By default, fields with
  1717. // empty values are omitted from API requests. However, any non-pointer,
  1718. // non-interface field appearing in ForceSendFields will be sent to the
  1719. // server regardless of whether the field is empty or not. This may be
  1720. // used to include empty fields in Patch requests.
  1721. ForceSendFields []string `json:"-"`
  1722. // NullFields is a list of field names (e.g. "ContinueOnFailure") to
  1723. // include in API requests with the JSON null value. By default, fields
  1724. // with empty values are omitted from API requests. However, any field
  1725. // with an empty value appearing in NullFields will be sent to the
  1726. // server as null. It is an error if a field in this list has a
  1727. // non-empty value. This may be used to include null fields in Patch
  1728. // requests.
  1729. NullFields []string `json:"-"`
  1730. }
  1731. func (s *PigJob) MarshalJSON() ([]byte, error) {
  1732. type NoMethod PigJob
  1733. raw := NoMethod(*s)
  1734. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1735. }
  1736. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  1737. // used to specify access control policies for Cloud Platform
  1738. // resources.A Policy consists of a list of bindings. A binding binds a
  1739. // list of members to a role, where the members can be user accounts,
  1740. // Google groups, Google domains, and service accounts. A role is a
  1741. // named list of permissions defined by IAM.JSON Example
  1742. // {
  1743. // "bindings": [
  1744. // {
  1745. // "role": "roles/owner",
  1746. // "members": [
  1747. // "user:mike@example.com",
  1748. // "group:admins@example.com",
  1749. // "domain:google.com",
  1750. // "serviceAccount:my-other-app@appspot.gserviceaccount.com"
  1751. // ]
  1752. // },
  1753. // {
  1754. // "role": "roles/viewer",
  1755. // "members": ["user:sean@example.com"]
  1756. // }
  1757. // ]
  1758. // }
  1759. // YAML Example
  1760. // bindings:
  1761. // - members:
  1762. // - user:mike@example.com
  1763. // - group:admins@example.com
  1764. // - domain:google.com
  1765. // - serviceAccount:my-other-app@appspot.gserviceaccount.com
  1766. // role: roles/owner
  1767. // - members:
  1768. // - user:sean@example.com
  1769. // role: roles/viewer
  1770. // For a description of IAM and its features, see the IAM developer's
  1771. // guide (https://cloud.google.com/iam/docs).
  1772. type Policy struct {
  1773. // Bindings: Associates a list of members to a role. bindings with no
  1774. // members will result in an error.
  1775. Bindings []*Binding `json:"bindings,omitempty"`
  1776. // Etag: etag is used for optimistic concurrency control as a way to
  1777. // help prevent simultaneous updates of a policy from overwriting each
  1778. // other. It is strongly suggested that systems make use of the etag in
  1779. // the read-modify-write cycle to perform policy updates in order to
  1780. // avoid race conditions: An etag is returned in the response to
  1781. // getIamPolicy, and systems are expected to put that etag in the
  1782. // request to setIamPolicy to ensure that their change will be applied
  1783. // to the same version of the policy.If no etag is provided in the call
  1784. // to setIamPolicy, then the existing policy is overwritten blindly.
  1785. Etag string `json:"etag,omitempty"`
  1786. // Version: Deprecated.
  1787. Version int64 `json:"version,omitempty"`
  1788. // ServerResponse contains the HTTP response code and headers from the
  1789. // server.
  1790. googleapi.ServerResponse `json:"-"`
  1791. // ForceSendFields is a list of field names (e.g. "Bindings") to
  1792. // unconditionally include in API requests. By default, fields with
  1793. // empty values are omitted from API requests. However, any non-pointer,
  1794. // non-interface field appearing in ForceSendFields will be sent to the
  1795. // server regardless of whether the field is empty or not. This may be
  1796. // used to include empty fields in Patch requests.
  1797. ForceSendFields []string `json:"-"`
  1798. // NullFields is a list of field names (e.g. "Bindings") to include in
  1799. // API requests with the JSON null value. By default, fields with empty
  1800. // values are omitted from API requests. However, any field with an
  1801. // empty value appearing in NullFields will be sent to the server as
  1802. // null. It is an error if a field in this list has a non-empty value.
  1803. // This may be used to include null fields in Patch requests.
  1804. NullFields []string `json:"-"`
  1805. }
  1806. func (s *Policy) MarshalJSON() ([]byte, error) {
  1807. type NoMethod Policy
  1808. raw := NoMethod(*s)
  1809. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1810. }
  1811. // PySparkJob: A Cloud Dataproc job for running Apache PySpark
  1812. // (https://spark.apache.org/docs/0.9.0/python-programming-guide.html)
  1813. // applications on YARN.
  1814. type PySparkJob struct {
  1815. // ArchiveUris: Optional. HCFS URIs of archives to be extracted in the
  1816. // working directory of .jar, .tar, .tar.gz, .tgz, and .zip.
  1817. ArchiveUris []string `json:"archiveUris,omitempty"`
  1818. // Args: Optional. The arguments to pass to the driver. Do not include
  1819. // arguments, such as --conf, that can be set as job properties, since a
  1820. // collision may occur that causes an incorrect job submission.
  1821. Args []string `json:"args,omitempty"`
  1822. // FileUris: Optional. HCFS URIs of files to be copied to the working
  1823. // directory of Python drivers and distributed tasks. Useful for naively
  1824. // parallel tasks.
  1825. FileUris []string `json:"fileUris,omitempty"`
  1826. // JarFileUris: Optional. HCFS URIs of jar files to add to the
  1827. // CLASSPATHs of the Python driver and tasks.
  1828. JarFileUris []string `json:"jarFileUris,omitempty"`
  1829. // LoggingConfig: Optional. The runtime log config for job execution.
  1830. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  1831. // MainPythonFileUri: Required. The HCFS URI of the main Python file to
  1832. // use as the driver. Must be a .py file.
  1833. MainPythonFileUri string `json:"mainPythonFileUri,omitempty"`
  1834. // Properties: Optional. A mapping of property names to values, used to
  1835. // configure PySpark. Properties that conflict with values set by the
  1836. // Cloud Dataproc API may be overwritten. Can include properties set in
  1837. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  1838. Properties map[string]string `json:"properties,omitempty"`
  1839. // PythonFileUris: Optional. HCFS file URIs of Python files to pass to
  1840. // the PySpark framework. Supported file types: .py, .egg, and .zip.
  1841. PythonFileUris []string `json:"pythonFileUris,omitempty"`
  1842. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  1843. // unconditionally include in API requests. By default, fields with
  1844. // empty values are omitted from API requests. However, any non-pointer,
  1845. // non-interface field appearing in ForceSendFields will be sent to the
  1846. // server regardless of whether the field is empty or not. This may be
  1847. // used to include empty fields in Patch requests.
  1848. ForceSendFields []string `json:"-"`
  1849. // NullFields is a list of field names (e.g. "ArchiveUris") to include
  1850. // in API requests with the JSON null value. By default, fields with
  1851. // empty values are omitted from API requests. However, any field with
  1852. // an empty value appearing in NullFields will be sent to the server as
  1853. // null. It is an error if a field in this list has a non-empty value.
  1854. // This may be used to include null fields in Patch requests.
  1855. NullFields []string `json:"-"`
  1856. }
  1857. func (s *PySparkJob) MarshalJSON() ([]byte, error) {
  1858. type NoMethod PySparkJob
  1859. raw := NoMethod(*s)
  1860. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1861. }
  1862. // QueryList: A list of queries to run on a cluster.
  1863. type QueryList struct {
  1864. // Queries: Required. The queries to execute. You do not need to
  1865. // terminate a query with a semicolon. Multiple queries can be specified
  1866. // in one string by separating each with a semicolon. Here is an example
  1867. // of an Cloud Dataproc API snippet that uses a QueryList to specify a
  1868. // HiveJob:
  1869. // "hiveJob": {
  1870. // "queryList": {
  1871. // "queries": [
  1872. // "query1",
  1873. // "query2",
  1874. // "query3;query4",
  1875. // ]
  1876. // }
  1877. // }
  1878. //
  1879. Queries []string `json:"queries,omitempty"`
  1880. // ForceSendFields is a list of field names (e.g. "Queries") to
  1881. // unconditionally include in API requests. By default, fields with
  1882. // empty values are omitted from API requests. However, any non-pointer,
  1883. // non-interface field appearing in ForceSendFields will be sent to the
  1884. // server regardless of whether the field is empty or not. This may be
  1885. // used to include empty fields in Patch requests.
  1886. ForceSendFields []string `json:"-"`
  1887. // NullFields is a list of field names (e.g. "Queries") to include in
  1888. // API requests with the JSON null value. By default, fields with empty
  1889. // values are omitted from API requests. However, any field with an
  1890. // empty value appearing in NullFields will be sent to the server as
  1891. // null. It is an error if a field in this list has a non-empty value.
  1892. // This may be used to include null fields in Patch requests.
  1893. NullFields []string `json:"-"`
  1894. }
  1895. func (s *QueryList) MarshalJSON() ([]byte, error) {
  1896. type NoMethod QueryList
  1897. raw := NoMethod(*s)
  1898. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1899. }
  1900. // RegexValidation: Validation based on regular expressions.
  1901. type RegexValidation struct {
  1902. // Regexes: Required. RE2 regular expressions used to validate the
  1903. // parameter's value. The value must match the regex in its entirety
  1904. // (substring matches are not sufficient).
  1905. Regexes []string `json:"regexes,omitempty"`
  1906. // ForceSendFields is a list of field names (e.g. "Regexes") to
  1907. // unconditionally include in API requests. By default, fields with
  1908. // empty values are omitted from API requests. However, any non-pointer,
  1909. // non-interface field appearing in ForceSendFields will be sent to the
  1910. // server regardless of whether the field is empty or not. This may be
  1911. // used to include empty fields in Patch requests.
  1912. ForceSendFields []string `json:"-"`
  1913. // NullFields is a list of field names (e.g. "Regexes") to include in
  1914. // API requests with the JSON null value. By default, fields with empty
  1915. // values are omitted from API requests. However, any field with an
  1916. // empty value appearing in NullFields will be sent to the server as
  1917. // null. It is an error if a field in this list has a non-empty value.
  1918. // This may be used to include null fields in Patch requests.
  1919. NullFields []string `json:"-"`
  1920. }
  1921. func (s *RegexValidation) MarshalJSON() ([]byte, error) {
  1922. type NoMethod RegexValidation
  1923. raw := NoMethod(*s)
  1924. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1925. }
  1926. // SetIamPolicyRequest: Request message for SetIamPolicy method.
  1927. type SetIamPolicyRequest struct {
  1928. // Policy: REQUIRED: The complete policy to be applied to the resource.
  1929. // The size of the policy is limited to a few 10s of KB. An empty policy
  1930. // is a valid policy but certain Cloud Platform services (such as
  1931. // Projects) might reject them.
  1932. Policy *Policy `json:"policy,omitempty"`
  1933. // ForceSendFields is a list of field names (e.g. "Policy") to
  1934. // unconditionally include in API requests. By default, fields with
  1935. // empty values are omitted from API requests. However, any non-pointer,
  1936. // non-interface field appearing in ForceSendFields will be sent to the
  1937. // server regardless of whether the field is empty or not. This may be
  1938. // used to include empty fields in Patch requests.
  1939. ForceSendFields []string `json:"-"`
  1940. // NullFields is a list of field names (e.g. "Policy") to include in API
  1941. // requests with the JSON null value. By default, fields with empty
  1942. // values are omitted from API requests. However, any field with an
  1943. // empty value appearing in NullFields will be sent to the server as
  1944. // null. It is an error if a field in this list has a non-empty value.
  1945. // This may be used to include null fields in Patch requests.
  1946. NullFields []string `json:"-"`
  1947. }
  1948. func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  1949. type NoMethod SetIamPolicyRequest
  1950. raw := NoMethod(*s)
  1951. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1952. }
  1953. // SoftwareConfig: Specifies the selection and config of software inside
  1954. // the cluster.
  1955. type SoftwareConfig struct {
  1956. // ImageVersion: Optional. The version of software inside the cluster.
  1957. // It must be one of the supported Cloud Dataproc Versions, such as
  1958. // "1.2" (including a subminor version, such as "1.2.29"), or the
  1959. // "preview" version. If unspecified, it defaults to the latest version.
  1960. ImageVersion string `json:"imageVersion,omitempty"`
  1961. // OptionalComponents: The set of optional components to activate on the
  1962. // cluster.
  1963. //
  1964. // Possible values:
  1965. // "COMPONENT_UNSPECIFIED" - Unspecified component.
  1966. // "ANACONDA" - The Anaconda python distribution.
  1967. // "HIVE_WEBHCAT" - The Hive Web HCatalog (the REST service for
  1968. // accessing HCatalog).
  1969. // "JUPYTER" - The Jupyter Notebook.
  1970. // "ZEPPELIN" - The Zeppelin notebook.
  1971. OptionalComponents []string `json:"optionalComponents,omitempty"`
  1972. // Properties: Optional. The properties to set on daemon config
  1973. // files.Property keys are specified in prefix:property format, for
  1974. // example core:hadoop.tmp.dir. The following are supported prefixes and
  1975. // their mappings:
  1976. // capacity-scheduler: capacity-scheduler.xml
  1977. // core: core-site.xml
  1978. // distcp: distcp-default.xml
  1979. // hdfs: hdfs-site.xml
  1980. // hive: hive-site.xml
  1981. // mapred: mapred-site.xml
  1982. // pig: pig.properties
  1983. // spark: spark-defaults.conf
  1984. // yarn: yarn-site.xmlFor more information, see Cluster properties.
  1985. Properties map[string]string `json:"properties,omitempty"`
  1986. // ForceSendFields is a list of field names (e.g. "ImageVersion") to
  1987. // unconditionally include in API requests. By default, fields with
  1988. // empty values are omitted from API requests. However, any non-pointer,
  1989. // non-interface field appearing in ForceSendFields will be sent to the
  1990. // server regardless of whether the field is empty or not. This may be
  1991. // used to include empty fields in Patch requests.
  1992. ForceSendFields []string `json:"-"`
  1993. // NullFields is a list of field names (e.g. "ImageVersion") to include
  1994. // in API requests with the JSON null value. By default, fields with
  1995. // empty values are omitted from API requests. However, any field with
  1996. // an empty value appearing in NullFields will be sent to the server as
  1997. // null. It is an error if a field in this list has a non-empty value.
  1998. // This may be used to include null fields in Patch requests.
  1999. NullFields []string `json:"-"`
  2000. }
  2001. func (s *SoftwareConfig) MarshalJSON() ([]byte, error) {
  2002. type NoMethod SoftwareConfig
  2003. raw := NoMethod(*s)
  2004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2005. }
  2006. // SparkJob: A Cloud Dataproc job for running Apache Spark
  2007. // (http://spark.apache.org/) applications on YARN.
  2008. type SparkJob struct {
  2009. // ArchiveUris: Optional. HCFS URIs of archives to be extracted in the
  2010. // working directory of Spark drivers and tasks. Supported file types:
  2011. // .jar, .tar, .tar.gz, .tgz, and .zip.
  2012. ArchiveUris []string `json:"archiveUris,omitempty"`
  2013. // Args: Optional. The arguments to pass to the driver. Do not include
  2014. // arguments, such as --conf, that can be set as job properties, since a
  2015. // collision may occur that causes an incorrect job submission.
  2016. Args []string `json:"args,omitempty"`
  2017. // FileUris: Optional. HCFS URIs of files to be copied to the working
  2018. // directory of Spark drivers and distributed tasks. Useful for naively
  2019. // parallel tasks.
  2020. FileUris []string `json:"fileUris,omitempty"`
  2021. // JarFileUris: Optional. HCFS URIs of jar files to add to the
  2022. // CLASSPATHs of the Spark driver and tasks.
  2023. JarFileUris []string `json:"jarFileUris,omitempty"`
  2024. // LoggingConfig: Optional. The runtime log config for job execution.
  2025. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  2026. // MainClass: The name of the driver's main class. The jar file that
  2027. // contains the class must be in the default CLASSPATH or specified in
  2028. // jar_file_uris.
  2029. MainClass string `json:"mainClass,omitempty"`
  2030. // MainJarFileUri: The HCFS URI of the jar file that contains the main
  2031. // class.
  2032. MainJarFileUri string `json:"mainJarFileUri,omitempty"`
  2033. // Properties: Optional. A mapping of property names to values, used to
  2034. // configure Spark. Properties that conflict with values set by the
  2035. // Cloud Dataproc API may be overwritten. Can include properties set in
  2036. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  2037. Properties map[string]string `json:"properties,omitempty"`
  2038. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  2039. // unconditionally include in API requests. By default, fields with
  2040. // empty values are omitted from API requests. However, any non-pointer,
  2041. // non-interface field appearing in ForceSendFields will be sent to the
  2042. // server regardless of whether the field is empty or not. This may be
  2043. // used to include empty fields in Patch requests.
  2044. ForceSendFields []string `json:"-"`
  2045. // NullFields is a list of field names (e.g. "ArchiveUris") to include
  2046. // in API requests with the JSON null value. By default, fields with
  2047. // empty values are omitted from API requests. However, any field with
  2048. // an empty value appearing in NullFields will be sent to the server as
  2049. // null. It is an error if a field in this list has a non-empty value.
  2050. // This may be used to include null fields in Patch requests.
  2051. NullFields []string `json:"-"`
  2052. }
  2053. func (s *SparkJob) MarshalJSON() ([]byte, error) {
  2054. type NoMethod SparkJob
  2055. raw := NoMethod(*s)
  2056. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2057. }
  2058. // SparkSqlJob: A Cloud Dataproc job for running Apache Spark SQL
  2059. // (http://spark.apache.org/sql/) queries.
  2060. type SparkSqlJob struct {
  2061. // JarFileUris: Optional. HCFS URIs of jar files to be added to the
  2062. // Spark CLASSPATH.
  2063. JarFileUris []string `json:"jarFileUris,omitempty"`
  2064. // LoggingConfig: Optional. The runtime log config for job execution.
  2065. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  2066. // Properties: Optional. A mapping of property names to values, used to
  2067. // configure Spark SQL's SparkConf. Properties that conflict with values
  2068. // set by the Cloud Dataproc API may be overwritten.
  2069. Properties map[string]string `json:"properties,omitempty"`
  2070. // QueryFileUri: The HCFS URI of the script that contains SQL queries.
  2071. QueryFileUri string `json:"queryFileUri,omitempty"`
  2072. // QueryList: A list of queries.
  2073. QueryList *QueryList `json:"queryList,omitempty"`
  2074. // ScriptVariables: Optional. Mapping of query variable names to values
  2075. // (equivalent to the Spark SQL command: SET name="value";).
  2076. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  2077. // ForceSendFields is a list of field names (e.g. "JarFileUris") to
  2078. // unconditionally include in API requests. By default, fields with
  2079. // empty values are omitted from API requests. However, any non-pointer,
  2080. // non-interface field appearing in ForceSendFields will be sent to the
  2081. // server regardless of whether the field is empty or not. This may be
  2082. // used to include empty fields in Patch requests.
  2083. ForceSendFields []string `json:"-"`
  2084. // NullFields is a list of field names (e.g. "JarFileUris") to include
  2085. // in API requests with the JSON null value. By default, fields with
  2086. // empty values are omitted from API requests. However, any field with
  2087. // an empty value appearing in NullFields will be sent to the server as
  2088. // null. It is an error if a field in this list has a non-empty value.
  2089. // This may be used to include null fields in Patch requests.
  2090. NullFields []string `json:"-"`
  2091. }
  2092. func (s *SparkSqlJob) MarshalJSON() ([]byte, error) {
  2093. type NoMethod SparkSqlJob
  2094. raw := NoMethod(*s)
  2095. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2096. }
  2097. // Status: The Status type defines a logical error model that is
  2098. // suitable for different programming environments, including REST APIs
  2099. // and RPC APIs. It is used by gRPC (https://github.com/grpc). The error
  2100. // model is designed to be:
  2101. // Simple to use and understand for most users
  2102. // Flexible enough to meet unexpected needsOverviewThe Status message
  2103. // contains three pieces of data: error code, error message, and error
  2104. // details. The error code should be an enum value of google.rpc.Code,
  2105. // but it may accept additional error codes if needed. The error message
  2106. // should be a developer-facing English message that helps developers
  2107. // understand and resolve the error. If a localized user-facing error
  2108. // message is needed, put the localized message in the error details or
  2109. // localize it in the client. The optional error details may contain
  2110. // arbitrary information about the error. There is a predefined set of
  2111. // error detail types in the package google.rpc that can be used for
  2112. // common error conditions.Language mappingThe Status message is the
  2113. // logical representation of the error model, but it is not necessarily
  2114. // the actual wire format. When the Status message is exposed in
  2115. // different client libraries and different wire protocols, it can be
  2116. // mapped differently. For example, it will likely be mapped to some
  2117. // exceptions in Java, but more likely mapped to some error codes in
  2118. // C.Other usesThe error model and the Status message can be used in a
  2119. // variety of environments, either with or without APIs, to provide a
  2120. // consistent developer experience across different environments.Example
  2121. // uses of this error model include:
  2122. // Partial errors. If a service needs to return partial errors to the
  2123. // client, it may embed the Status in the normal response to indicate
  2124. // the partial errors.
  2125. // Workflow errors. A typical workflow has multiple steps. Each step may
  2126. // have a Status message for error reporting.
  2127. // Batch operations. If a client uses batch request and batch response,
  2128. // the Status message should be used directly inside batch response, one
  2129. // for each error sub-response.
  2130. // Asynchronous operations. If an API call embeds asynchronous operation
  2131. // results in its response, the status of those operations should be
  2132. // represented directly using the Status message.
  2133. // Logging. If some API errors are stored in logs, the message Status
  2134. // could be used directly after any stripping needed for
  2135. // security/privacy reasons.
  2136. type Status struct {
  2137. // Code: The status code, which should be an enum value of
  2138. // google.rpc.Code.
  2139. Code int64 `json:"code,omitempty"`
  2140. // Details: A list of messages that carry the error details. There is a
  2141. // common set of message types for APIs to use.
  2142. Details []googleapi.RawMessage `json:"details,omitempty"`
  2143. // Message: A developer-facing error message, which should be in
  2144. // English. Any user-facing error message should be localized and sent
  2145. // in the google.rpc.Status.details field, or localized by the client.
  2146. Message string `json:"message,omitempty"`
  2147. // ForceSendFields is a list of field names (e.g. "Code") to
  2148. // unconditionally include in API requests. By default, fields with
  2149. // empty values are omitted from API requests. However, any non-pointer,
  2150. // non-interface field appearing in ForceSendFields will be sent to the
  2151. // server regardless of whether the field is empty or not. This may be
  2152. // used to include empty fields in Patch requests.
  2153. ForceSendFields []string `json:"-"`
  2154. // NullFields is a list of field names (e.g. "Code") to include in API
  2155. // requests with the JSON null value. By default, fields with empty
  2156. // values are omitted from API requests. However, any field with an
  2157. // empty value appearing in NullFields will be sent to the server as
  2158. // null. It is an error if a field in this list has a non-empty value.
  2159. // This may be used to include null fields in Patch requests.
  2160. NullFields []string `json:"-"`
  2161. }
  2162. func (s *Status) MarshalJSON() ([]byte, error) {
  2163. type NoMethod Status
  2164. raw := NoMethod(*s)
  2165. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2166. }
  2167. // SubmitJobRequest: A request to submit a job.
  2168. type SubmitJobRequest struct {
  2169. // Job: Required. The job resource.
  2170. Job *Job `json:"job,omitempty"`
  2171. // RequestId: Optional. A unique id used to identify the request. If the
  2172. // server receives two SubmitJobRequest requests with the same id, then
  2173. // the second request will be ignored and the first Job created and
  2174. // stored in the backend is returned.It is recommended to always set
  2175. // this value to a UUID
  2176. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id
  2177. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  2178. // and hyphens (-). The maximum length is 40 characters.
  2179. RequestId string `json:"requestId,omitempty"`
  2180. // ForceSendFields is a list of field names (e.g. "Job") to
  2181. // unconditionally include in API requests. By default, fields with
  2182. // empty values are omitted from API requests. However, any non-pointer,
  2183. // non-interface field appearing in ForceSendFields will be sent to the
  2184. // server regardless of whether the field is empty or not. This may be
  2185. // used to include empty fields in Patch requests.
  2186. ForceSendFields []string `json:"-"`
  2187. // NullFields is a list of field names (e.g. "Job") to include in API
  2188. // requests with the JSON null value. By default, fields with empty
  2189. // values are omitted from API requests. However, any field with an
  2190. // empty value appearing in NullFields will be sent to the server as
  2191. // null. It is an error if a field in this list has a non-empty value.
  2192. // This may be used to include null fields in Patch requests.
  2193. NullFields []string `json:"-"`
  2194. }
  2195. func (s *SubmitJobRequest) MarshalJSON() ([]byte, error) {
  2196. type NoMethod SubmitJobRequest
  2197. raw := NoMethod(*s)
  2198. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2199. }
  2200. // TemplateParameter: A configurable parameter that replaces one or more
  2201. // fields in the template. Parameterizable fields: - Labels - File uris
  2202. // - Job properties - Job arguments - Script variables - Main class (in
  2203. // HadoopJob and SparkJob) - Zone (in ClusterSelector)
  2204. type TemplateParameter struct {
  2205. // Description: Optional. Brief description of the parameter. Must not
  2206. // exceed 1024 characters.
  2207. Description string `json:"description,omitempty"`
  2208. // Fields: Required. Paths to all fields that the parameter replaces. A
  2209. // field is allowed to appear in at most one parameter's list of field
  2210. // paths.A field path is similar in syntax to a
  2211. // google.protobuf.FieldMask. For example, a field path that references
  2212. // the zone field of a workflow template's cluster selector would be
  2213. // specified as placement.clusterSelector.zone.Also, field paths can
  2214. // reference fields using the following syntax:
  2215. // Values in maps can be referenced by
  2216. // key:
  2217. // labels'key'
  2218. // placement.clusterSelector.clusterLabels'key'
  2219. // placemen
  2220. // t.managedCluster.labels'key'
  2221. // placement.clusterSelector.clusterLabels'k
  2222. // ey'
  2223. // jobs'step-id'.labels'key'
  2224. // Jobs in the jobs list can be referenced by
  2225. // step-id:
  2226. // jobs'step-id'.hadoopJob.mainJarFileUri
  2227. // jobs'step-id'.hiveJob.
  2228. // queryFileUri
  2229. // jobs'step-id'.pySparkJob.mainPythonFileUri
  2230. // jobs'step-id'.
  2231. // hadoopJob.jarFileUris0
  2232. // jobs'step-id'.hadoopJob.archiveUris0
  2233. // jobs'step-
  2234. // id'.hadoopJob.fileUris0
  2235. // jobs'step-id'.pySparkJob.pythonFileUris0
  2236. // Items
  2237. // in repeated fields can be referenced by a zero-based
  2238. // index:
  2239. // jobs'step-id'.sparkJob.args0
  2240. // Other
  2241. // examples:
  2242. // jobs'step-id'.hadoopJob.properties'key'
  2243. // jobs'step-id'.hadoop
  2244. // Job.args0
  2245. // jobs'step-id'.hiveJob.scriptVariables'key'
  2246. // jobs'step-id'.had
  2247. // oopJob.mainJarFileUri
  2248. // placement.clusterSelector.zoneIt may not be possible to parameterize
  2249. // maps and repeated fields in their entirety since only individual map
  2250. // values and individual items in repeated fields can be referenced. For
  2251. // example, the following field paths are
  2252. // invalid:
  2253. // placement.clusterSelector.clusterLabels
  2254. // jobs'step-id'.sparkJo
  2255. // b.args
  2256. Fields []string `json:"fields,omitempty"`
  2257. // Name: Required. Parameter name. The parameter name is used as the
  2258. // key, and paired with the parameter value, which are passed to the
  2259. // template when the template is instantiated. The name must contain
  2260. // only capital letters (A-Z), numbers (0-9), and underscores (_), and
  2261. // must not start with a number. The maximum length is 40 characters.
  2262. Name string `json:"name,omitempty"`
  2263. // Validation: Optional. Validation rules to be applied to this
  2264. // parameter's value.
  2265. Validation *ParameterValidation `json:"validation,omitempty"`
  2266. // ForceSendFields is a list of field names (e.g. "Description") to
  2267. // unconditionally include in API requests. By default, fields with
  2268. // empty values are omitted from API requests. However, any non-pointer,
  2269. // non-interface field appearing in ForceSendFields will be sent to the
  2270. // server regardless of whether the field is empty or not. This may be
  2271. // used to include empty fields in Patch requests.
  2272. ForceSendFields []string `json:"-"`
  2273. // NullFields is a list of field names (e.g. "Description") to include
  2274. // in API requests with the JSON null value. By default, fields with
  2275. // empty values are omitted from API requests. However, any field with
  2276. // an empty value appearing in NullFields will be sent to the server as
  2277. // null. It is an error if a field in this list has a non-empty value.
  2278. // This may be used to include null fields in Patch requests.
  2279. NullFields []string `json:"-"`
  2280. }
  2281. func (s *TemplateParameter) MarshalJSON() ([]byte, error) {
  2282. type NoMethod TemplateParameter
  2283. raw := NoMethod(*s)
  2284. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2285. }
  2286. // TestIamPermissionsRequest: Request message for TestIamPermissions
  2287. // method.
  2288. type TestIamPermissionsRequest struct {
  2289. // Permissions: The set of permissions to check for the resource.
  2290. // Permissions with wildcards (such as '*' or 'storage.*') are not
  2291. // allowed. For more information see IAM Overview
  2292. // (https://cloud.google.com/iam/docs/overview#permissions).
  2293. Permissions []string `json:"permissions,omitempty"`
  2294. // ForceSendFields is a list of field names (e.g. "Permissions") to
  2295. // unconditionally include in API requests. By default, fields with
  2296. // empty values are omitted from API requests. However, any non-pointer,
  2297. // non-interface field appearing in ForceSendFields will be sent to the
  2298. // server regardless of whether the field is empty or not. This may be
  2299. // used to include empty fields in Patch requests.
  2300. ForceSendFields []string `json:"-"`
  2301. // NullFields is a list of field names (e.g. "Permissions") to include
  2302. // in API requests with the JSON null value. By default, fields with
  2303. // empty values are omitted from API requests. However, any field with
  2304. // an empty value appearing in NullFields will be sent to the server as
  2305. // null. It is an error if a field in this list has a non-empty value.
  2306. // This may be used to include null fields in Patch requests.
  2307. NullFields []string `json:"-"`
  2308. }
  2309. func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  2310. type NoMethod TestIamPermissionsRequest
  2311. raw := NoMethod(*s)
  2312. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2313. }
  2314. // TestIamPermissionsResponse: Response message for TestIamPermissions
  2315. // method.
  2316. type TestIamPermissionsResponse struct {
  2317. // Permissions: A subset of TestPermissionsRequest.permissions that the
  2318. // caller is allowed.
  2319. Permissions []string `json:"permissions,omitempty"`
  2320. // ServerResponse contains the HTTP response code and headers from the
  2321. // server.
  2322. googleapi.ServerResponse `json:"-"`
  2323. // ForceSendFields is a list of field names (e.g. "Permissions") to
  2324. // unconditionally include in API requests. By default, fields with
  2325. // empty values are omitted from API requests. However, any non-pointer,
  2326. // non-interface field appearing in ForceSendFields will be sent to the
  2327. // server regardless of whether the field is empty or not. This may be
  2328. // used to include empty fields in Patch requests.
  2329. ForceSendFields []string `json:"-"`
  2330. // NullFields is a list of field names (e.g. "Permissions") to include
  2331. // in API requests with the JSON null value. By default, fields with
  2332. // empty values are omitted from API requests. However, any field with
  2333. // an empty value appearing in NullFields will be sent to the server as
  2334. // null. It is an error if a field in this list has a non-empty value.
  2335. // This may be used to include null fields in Patch requests.
  2336. NullFields []string `json:"-"`
  2337. }
  2338. func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  2339. type NoMethod TestIamPermissionsResponse
  2340. raw := NoMethod(*s)
  2341. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2342. }
  2343. // ValueValidation: Validation based on a list of allowed values.
  2344. type ValueValidation struct {
  2345. // Values: Required. List of allowed values for the parameter.
  2346. Values []string `json:"values,omitempty"`
  2347. // ForceSendFields is a list of field names (e.g. "Values") to
  2348. // unconditionally include in API requests. By default, fields with
  2349. // empty values are omitted from API requests. However, any non-pointer,
  2350. // non-interface field appearing in ForceSendFields will be sent to the
  2351. // server regardless of whether the field is empty or not. This may be
  2352. // used to include empty fields in Patch requests.
  2353. ForceSendFields []string `json:"-"`
  2354. // NullFields is a list of field names (e.g. "Values") to include in API
  2355. // requests with the JSON null value. By default, fields with empty
  2356. // values are omitted from API requests. However, any field with an
  2357. // empty value appearing in NullFields will be sent to the server as
  2358. // null. It is an error if a field in this list has a non-empty value.
  2359. // This may be used to include null fields in Patch requests.
  2360. NullFields []string `json:"-"`
  2361. }
  2362. func (s *ValueValidation) MarshalJSON() ([]byte, error) {
  2363. type NoMethod ValueValidation
  2364. raw := NoMethod(*s)
  2365. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2366. }
  2367. // WorkflowGraph: The workflow graph.
  2368. type WorkflowGraph struct {
  2369. // Nodes: Output only. The workflow nodes.
  2370. Nodes []*WorkflowNode `json:"nodes,omitempty"`
  2371. // ForceSendFields is a list of field names (e.g. "Nodes") to
  2372. // unconditionally include in API requests. By default, fields with
  2373. // empty values are omitted from API requests. However, any non-pointer,
  2374. // non-interface field appearing in ForceSendFields will be sent to the
  2375. // server regardless of whether the field is empty or not. This may be
  2376. // used to include empty fields in Patch requests.
  2377. ForceSendFields []string `json:"-"`
  2378. // NullFields is a list of field names (e.g. "Nodes") to include in API
  2379. // requests with the JSON null value. By default, fields with empty
  2380. // values are omitted from API requests. However, any field with an
  2381. // empty value appearing in NullFields will be sent to the server as
  2382. // null. It is an error if a field in this list has a non-empty value.
  2383. // This may be used to include null fields in Patch requests.
  2384. NullFields []string `json:"-"`
  2385. }
  2386. func (s *WorkflowGraph) MarshalJSON() ([]byte, error) {
  2387. type NoMethod WorkflowGraph
  2388. raw := NoMethod(*s)
  2389. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2390. }
  2391. // WorkflowMetadata: A Cloud Dataproc workflow template resource.
  2392. type WorkflowMetadata struct {
  2393. // ClusterName: Output only. The name of the target cluster.
  2394. ClusterName string `json:"clusterName,omitempty"`
  2395. // ClusterUuid: Output only. The UUID of target cluster.
  2396. ClusterUuid string `json:"clusterUuid,omitempty"`
  2397. // CreateCluster: Output only. The create cluster operation metadata.
  2398. CreateCluster *ClusterOperation `json:"createCluster,omitempty"`
  2399. // DeleteCluster: Output only. The delete cluster operation metadata.
  2400. DeleteCluster *ClusterOperation `json:"deleteCluster,omitempty"`
  2401. // EndTime: Output only. Workflow end time.
  2402. EndTime string `json:"endTime,omitempty"`
  2403. // Graph: Output only. The workflow graph.
  2404. Graph *WorkflowGraph `json:"graph,omitempty"`
  2405. // Parameters: Map from parameter names to values that were used for
  2406. // those parameters.
  2407. Parameters map[string]string `json:"parameters,omitempty"`
  2408. // StartTime: Output only. Workflow start time.
  2409. StartTime string `json:"startTime,omitempty"`
  2410. // State: Output only. The workflow state.
  2411. //
  2412. // Possible values:
  2413. // "UNKNOWN" - Unused.
  2414. // "PENDING" - The operation has been created.
  2415. // "RUNNING" - The operation is running.
  2416. // "DONE" - The operation is done; either cancelled or completed.
  2417. State string `json:"state,omitempty"`
  2418. // Template: Output only. The "resource name" of the template.
  2419. Template string `json:"template,omitempty"`
  2420. // Version: Output only. The version of template at the time of workflow
  2421. // instantiation.
  2422. Version int64 `json:"version,omitempty"`
  2423. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  2424. // unconditionally include in API requests. By default, fields with
  2425. // empty values are omitted from API requests. However, any non-pointer,
  2426. // non-interface field appearing in ForceSendFields will be sent to the
  2427. // server regardless of whether the field is empty or not. This may be
  2428. // used to include empty fields in Patch requests.
  2429. ForceSendFields []string `json:"-"`
  2430. // NullFields is a list of field names (e.g. "ClusterName") to include
  2431. // in API requests with the JSON null value. By default, fields with
  2432. // empty values are omitted from API requests. However, any field with
  2433. // an empty value appearing in NullFields will be sent to the server as
  2434. // null. It is an error if a field in this list has a non-empty value.
  2435. // This may be used to include null fields in Patch requests.
  2436. NullFields []string `json:"-"`
  2437. }
  2438. func (s *WorkflowMetadata) MarshalJSON() ([]byte, error) {
  2439. type NoMethod WorkflowMetadata
  2440. raw := NoMethod(*s)
  2441. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2442. }
  2443. // WorkflowNode: The workflow node.
  2444. type WorkflowNode struct {
  2445. // Error: Output only. The error detail.
  2446. Error string `json:"error,omitempty"`
  2447. // JobId: Output only. The job id; populated after the node enters
  2448. // RUNNING state.
  2449. JobId string `json:"jobId,omitempty"`
  2450. // PrerequisiteStepIds: Output only. Node's prerequisite nodes.
  2451. PrerequisiteStepIds []string `json:"prerequisiteStepIds,omitempty"`
  2452. // State: Output only. The node state.
  2453. //
  2454. // Possible values:
  2455. // "NODE_STATE_UNSPECIFIED" - State is unspecified.
  2456. // "BLOCKED" - The node is awaiting prerequisite node to finish.
  2457. // "RUNNABLE" - The node is runnable but not running.
  2458. // "RUNNING" - The node is running.
  2459. // "COMPLETED" - The node completed successfully.
  2460. // "FAILED" - The node failed. A node can be marked FAILED because its
  2461. // ancestor or peer failed.
  2462. State string `json:"state,omitempty"`
  2463. // StepId: Output only. The name of the node.
  2464. StepId string `json:"stepId,omitempty"`
  2465. // ForceSendFields is a list of field names (e.g. "Error") to
  2466. // unconditionally include in API requests. By default, fields with
  2467. // empty values are omitted from API requests. However, any non-pointer,
  2468. // non-interface field appearing in ForceSendFields will be sent to the
  2469. // server regardless of whether the field is empty or not. This may be
  2470. // used to include empty fields in Patch requests.
  2471. ForceSendFields []string `json:"-"`
  2472. // NullFields is a list of field names (e.g. "Error") to include in API
  2473. // requests with the JSON null value. By default, fields with empty
  2474. // values are omitted from API requests. However, any field with an
  2475. // empty value appearing in NullFields will be sent to the server as
  2476. // null. It is an error if a field in this list has a non-empty value.
  2477. // This may be used to include null fields in Patch requests.
  2478. NullFields []string `json:"-"`
  2479. }
  2480. func (s *WorkflowNode) MarshalJSON() ([]byte, error) {
  2481. type NoMethod WorkflowNode
  2482. raw := NoMethod(*s)
  2483. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2484. }
  2485. // WorkflowTemplate: A Cloud Dataproc workflow template resource.
  2486. type WorkflowTemplate struct {
  2487. // CreateTime: Output only. The time template was created.
  2488. CreateTime string `json:"createTime,omitempty"`
  2489. // Id: Required. The template id.The id must contain only letters (a-z,
  2490. // A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin
  2491. // or end with underscore or hyphen. Must consist of between 3 and 50
  2492. // characters.
  2493. Id string `json:"id,omitempty"`
  2494. // Jobs: Required. The Directed Acyclic Graph of Jobs to submit.
  2495. Jobs []*OrderedJob `json:"jobs,omitempty"`
  2496. // Labels: Optional. The labels to associate with this template. These
  2497. // labels will be propagated to all jobs and clusters created by the
  2498. // workflow instance.Label keys must contain 1 to 63 characters, and
  2499. // must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).Label
  2500. // values may be empty, but, if present, must contain 1 to 63
  2501. // characters, and must conform to RFC 1035
  2502. // (https://www.ietf.org/rfc/rfc1035.txt).No more than 32 labels can be
  2503. // associated with a template.
  2504. Labels map[string]string `json:"labels,omitempty"`
  2505. // Name: Output only. The "resource name" of the template, as described
  2506. // in https://cloud.google.com/apis/design/resource_names of the form
  2507. // projects/{project_id}/regions/{region}/workflowTemplates/{template_id}
  2508. Name string `json:"name,omitempty"`
  2509. // Parameters: Optional. Template parameters whose values are
  2510. // substituted into the template. Values for parameters must be provided
  2511. // when the template is instantiated.
  2512. Parameters []*TemplateParameter `json:"parameters,omitempty"`
  2513. // Placement: Required. WorkflowTemplate scheduling information.
  2514. Placement *WorkflowTemplatePlacement `json:"placement,omitempty"`
  2515. // UpdateTime: Output only. The time template was last updated.
  2516. UpdateTime string `json:"updateTime,omitempty"`
  2517. // Version: Optional. Used to perform a consistent
  2518. // read-modify-write.This field should be left blank for a
  2519. // CreateWorkflowTemplate request. It is required for an
  2520. // UpdateWorkflowTemplate request, and must match the current server
  2521. // version. A typical update template flow would fetch the current
  2522. // template with a GetWorkflowTemplate request, which will return the
  2523. // current template with the version field filled in with the current
  2524. // server version. The user updates other fields in the template, then
  2525. // returns it as part of the UpdateWorkflowTemplate request.
  2526. Version int64 `json:"version,omitempty"`
  2527. // ServerResponse contains the HTTP response code and headers from the
  2528. // server.
  2529. googleapi.ServerResponse `json:"-"`
  2530. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  2531. // unconditionally include in API requests. By default, fields with
  2532. // empty values are omitted from API requests. However, any non-pointer,
  2533. // non-interface field appearing in ForceSendFields will be sent to the
  2534. // server regardless of whether the field is empty or not. This may be
  2535. // used to include empty fields in Patch requests.
  2536. ForceSendFields []string `json:"-"`
  2537. // NullFields is a list of field names (e.g. "CreateTime") to include in
  2538. // API requests with the JSON null value. By default, fields with empty
  2539. // values are omitted from API requests. However, any field with an
  2540. // empty value appearing in NullFields will be sent to the server as
  2541. // null. It is an error if a field in this list has a non-empty value.
  2542. // This may be used to include null fields in Patch requests.
  2543. NullFields []string `json:"-"`
  2544. }
  2545. func (s *WorkflowTemplate) MarshalJSON() ([]byte, error) {
  2546. type NoMethod WorkflowTemplate
  2547. raw := NoMethod(*s)
  2548. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2549. }
  2550. // WorkflowTemplatePlacement: Specifies workflow execution target.Either
  2551. // managed_cluster or cluster_selector is required.
  2552. type WorkflowTemplatePlacement struct {
  2553. // ClusterSelector: Optional. A selector that chooses target cluster for
  2554. // jobs based on metadata.The selector is evaluated at the time each job
  2555. // is submitted.
  2556. ClusterSelector *ClusterSelector `json:"clusterSelector,omitempty"`
  2557. // ManagedCluster: Optional. A cluster that is managed by the workflow.
  2558. ManagedCluster *ManagedCluster `json:"managedCluster,omitempty"`
  2559. // ForceSendFields is a list of field names (e.g. "ClusterSelector") to
  2560. // unconditionally include in API requests. By default, fields with
  2561. // empty values are omitted from API requests. However, any non-pointer,
  2562. // non-interface field appearing in ForceSendFields will be sent to the
  2563. // server regardless of whether the field is empty or not. This may be
  2564. // used to include empty fields in Patch requests.
  2565. ForceSendFields []string `json:"-"`
  2566. // NullFields is a list of field names (e.g. "ClusterSelector") to
  2567. // include in API requests with the JSON null value. By default, fields
  2568. // with empty values are omitted from API requests. However, any field
  2569. // with an empty value appearing in NullFields will be sent to the
  2570. // server as null. It is an error if a field in this list has a
  2571. // non-empty value. This may be used to include null fields in Patch
  2572. // requests.
  2573. NullFields []string `json:"-"`
  2574. }
  2575. func (s *WorkflowTemplatePlacement) MarshalJSON() ([]byte, error) {
  2576. type NoMethod WorkflowTemplatePlacement
  2577. raw := NoMethod(*s)
  2578. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2579. }
  2580. // YarnApplication: A YARN application created by a job. Application
  2581. // information is a subset of
  2582. // <code>org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto</
  2583. // code>.Beta Feature: This report is available for testing purposes
  2584. // only. It may be changed before final release.
  2585. type YarnApplication struct {
  2586. // Name: Required. The application name.
  2587. Name string `json:"name,omitempty"`
  2588. // Progress: Required. The numerical progress of the application, from 1
  2589. // to 100.
  2590. Progress float64 `json:"progress,omitempty"`
  2591. // State: Required. The application state.
  2592. //
  2593. // Possible values:
  2594. // "STATE_UNSPECIFIED" - Status is unspecified.
  2595. // "NEW" - Status is NEW.
  2596. // "NEW_SAVING" - Status is NEW_SAVING.
  2597. // "SUBMITTED" - Status is SUBMITTED.
  2598. // "ACCEPTED" - Status is ACCEPTED.
  2599. // "RUNNING" - Status is RUNNING.
  2600. // "FINISHED" - Status is FINISHED.
  2601. // "FAILED" - Status is FAILED.
  2602. // "KILLED" - Status is KILLED.
  2603. State string `json:"state,omitempty"`
  2604. // TrackingUrl: Optional. The HTTP URL of the ApplicationMaster,
  2605. // HistoryServer, or TimelineServer that provides application-specific
  2606. // information. The URL uses the internal hostname, and requires a proxy
  2607. // server for resolution and, possibly, access.
  2608. TrackingUrl string `json:"trackingUrl,omitempty"`
  2609. // ForceSendFields is a list of field names (e.g. "Name") to
  2610. // unconditionally include in API requests. By default, fields with
  2611. // empty values are omitted from API requests. However, any non-pointer,
  2612. // non-interface field appearing in ForceSendFields will be sent to the
  2613. // server regardless of whether the field is empty or not. This may be
  2614. // used to include empty fields in Patch requests.
  2615. ForceSendFields []string `json:"-"`
  2616. // NullFields is a list of field names (e.g. "Name") to include in API
  2617. // requests with the JSON null value. By default, fields with empty
  2618. // values are omitted from API requests. However, any field with an
  2619. // empty value appearing in NullFields will be sent to the server as
  2620. // null. It is an error if a field in this list has a non-empty value.
  2621. // This may be used to include null fields in Patch requests.
  2622. NullFields []string `json:"-"`
  2623. }
  2624. func (s *YarnApplication) MarshalJSON() ([]byte, error) {
  2625. type NoMethod YarnApplication
  2626. raw := NoMethod(*s)
  2627. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2628. }
  2629. func (s *YarnApplication) UnmarshalJSON(data []byte) error {
  2630. type NoMethod YarnApplication
  2631. var s1 struct {
  2632. Progress gensupport.JSONFloat64 `json:"progress"`
  2633. *NoMethod
  2634. }
  2635. s1.NoMethod = (*NoMethod)(s)
  2636. if err := json.Unmarshal(data, &s1); err != nil {
  2637. return err
  2638. }
  2639. s.Progress = float64(s1.Progress)
  2640. return nil
  2641. }
  2642. // method id "dataproc.projects.locations.workflowTemplates.create":
  2643. type ProjectsLocationsWorkflowTemplatesCreateCall struct {
  2644. s *Service
  2645. parent string
  2646. workflowtemplate *WorkflowTemplate
  2647. urlParams_ gensupport.URLParams
  2648. ctx_ context.Context
  2649. header_ http.Header
  2650. }
  2651. // Create: Creates new workflow template.
  2652. func (r *ProjectsLocationsWorkflowTemplatesService) Create(parent string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesCreateCall {
  2653. c := &ProjectsLocationsWorkflowTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2654. c.parent = parent
  2655. c.workflowtemplate = workflowtemplate
  2656. return c
  2657. }
  2658. // Fields allows partial responses to be retrieved. See
  2659. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2660. // for more information.
  2661. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesCreateCall {
  2662. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2663. return c
  2664. }
  2665. // Context sets the context to be used in this call's Do method. Any
  2666. // pending HTTP request will be aborted if the provided context is
  2667. // canceled.
  2668. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesCreateCall {
  2669. c.ctx_ = ctx
  2670. return c
  2671. }
  2672. // Header returns an http.Header that can be modified by the caller to
  2673. // add HTTP headers to the request.
  2674. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Header() http.Header {
  2675. if c.header_ == nil {
  2676. c.header_ = make(http.Header)
  2677. }
  2678. return c.header_
  2679. }
  2680. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) {
  2681. reqHeaders := make(http.Header)
  2682. for k, v := range c.header_ {
  2683. reqHeaders[k] = v
  2684. }
  2685. reqHeaders.Set("User-Agent", c.s.userAgent())
  2686. var body io.Reader = nil
  2687. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  2688. if err != nil {
  2689. return nil, err
  2690. }
  2691. reqHeaders.Set("Content-Type", "application/json")
  2692. c.urlParams_.Set("alt", alt)
  2693. c.urlParams_.Set("prettyPrint", "false")
  2694. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates")
  2695. urls += "?" + c.urlParams_.Encode()
  2696. req, err := http.NewRequest("POST", urls, body)
  2697. if err != nil {
  2698. return nil, err
  2699. }
  2700. req.Header = reqHeaders
  2701. googleapi.Expand(req.URL, map[string]string{
  2702. "parent": c.parent,
  2703. })
  2704. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2705. }
  2706. // Do executes the "dataproc.projects.locations.workflowTemplates.create" call.
  2707. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  2708. // non-2xx status code is an error. Response headers are in either
  2709. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  2710. // returned at all) in error.(*googleapi.Error).Header. Use
  2711. // googleapi.IsNotModified to check whether the returned error was
  2712. // because http.StatusNotModified was returned.
  2713. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  2714. gensupport.SetOptions(c.urlParams_, opts...)
  2715. res, err := c.doRequest("json")
  2716. if res != nil && res.StatusCode == http.StatusNotModified {
  2717. if res.Body != nil {
  2718. res.Body.Close()
  2719. }
  2720. return nil, &googleapi.Error{
  2721. Code: res.StatusCode,
  2722. Header: res.Header,
  2723. }
  2724. }
  2725. if err != nil {
  2726. return nil, err
  2727. }
  2728. defer googleapi.CloseBody(res)
  2729. if err := googleapi.CheckResponse(res); err != nil {
  2730. return nil, err
  2731. }
  2732. ret := &WorkflowTemplate{
  2733. ServerResponse: googleapi.ServerResponse{
  2734. Header: res.Header,
  2735. HTTPStatusCode: res.StatusCode,
  2736. },
  2737. }
  2738. target := &ret
  2739. if err := gensupport.DecodeResponse(target, res); err != nil {
  2740. return nil, err
  2741. }
  2742. return ret, nil
  2743. // {
  2744. // "description": "Creates new workflow template.",
  2745. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates",
  2746. // "httpMethod": "POST",
  2747. // "id": "dataproc.projects.locations.workflowTemplates.create",
  2748. // "parameterOrder": [
  2749. // "parent"
  2750. // ],
  2751. // "parameters": {
  2752. // "parent": {
  2753. // "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}",
  2754. // "location": "path",
  2755. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  2756. // "required": true,
  2757. // "type": "string"
  2758. // }
  2759. // },
  2760. // "path": "v1/{+parent}/workflowTemplates",
  2761. // "request": {
  2762. // "$ref": "WorkflowTemplate"
  2763. // },
  2764. // "response": {
  2765. // "$ref": "WorkflowTemplate"
  2766. // },
  2767. // "scopes": [
  2768. // "https://www.googleapis.com/auth/cloud-platform"
  2769. // ]
  2770. // }
  2771. }
  2772. // method id "dataproc.projects.locations.workflowTemplates.delete":
  2773. type ProjectsLocationsWorkflowTemplatesDeleteCall struct {
  2774. s *Service
  2775. name string
  2776. urlParams_ gensupport.URLParams
  2777. ctx_ context.Context
  2778. header_ http.Header
  2779. }
  2780. // Delete: Deletes a workflow template. It does not cancel in-progress
  2781. // workflows.
  2782. func (r *ProjectsLocationsWorkflowTemplatesService) Delete(name string) *ProjectsLocationsWorkflowTemplatesDeleteCall {
  2783. c := &ProjectsLocationsWorkflowTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2784. c.name = name
  2785. return c
  2786. }
  2787. // Version sets the optional parameter "version": The version of
  2788. // workflow template to delete. If specified, will only delete the
  2789. // template if the current server version matches specified version.
  2790. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Version(version int64) *ProjectsLocationsWorkflowTemplatesDeleteCall {
  2791. c.urlParams_.Set("version", fmt.Sprint(version))
  2792. return c
  2793. }
  2794. // Fields allows partial responses to be retrieved. See
  2795. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2796. // for more information.
  2797. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesDeleteCall {
  2798. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2799. return c
  2800. }
  2801. // Context sets the context to be used in this call's Do method. Any
  2802. // pending HTTP request will be aborted if the provided context is
  2803. // canceled.
  2804. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesDeleteCall {
  2805. c.ctx_ = ctx
  2806. return c
  2807. }
  2808. // Header returns an http.Header that can be modified by the caller to
  2809. // add HTTP headers to the request.
  2810. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Header() http.Header {
  2811. if c.header_ == nil {
  2812. c.header_ = make(http.Header)
  2813. }
  2814. return c.header_
  2815. }
  2816. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2817. reqHeaders := make(http.Header)
  2818. for k, v := range c.header_ {
  2819. reqHeaders[k] = v
  2820. }
  2821. reqHeaders.Set("User-Agent", c.s.userAgent())
  2822. var body io.Reader = nil
  2823. c.urlParams_.Set("alt", alt)
  2824. c.urlParams_.Set("prettyPrint", "false")
  2825. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2826. urls += "?" + c.urlParams_.Encode()
  2827. req, err := http.NewRequest("DELETE", urls, body)
  2828. if err != nil {
  2829. return nil, err
  2830. }
  2831. req.Header = reqHeaders
  2832. googleapi.Expand(req.URL, map[string]string{
  2833. "name": c.name,
  2834. })
  2835. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2836. }
  2837. // Do executes the "dataproc.projects.locations.workflowTemplates.delete" call.
  2838. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2839. // code is an error. Response headers are in either
  2840. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2841. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2842. // check whether the returned error was because http.StatusNotModified
  2843. // was returned.
  2844. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2845. gensupport.SetOptions(c.urlParams_, opts...)
  2846. res, err := c.doRequest("json")
  2847. if res != nil && res.StatusCode == http.StatusNotModified {
  2848. if res.Body != nil {
  2849. res.Body.Close()
  2850. }
  2851. return nil, &googleapi.Error{
  2852. Code: res.StatusCode,
  2853. Header: res.Header,
  2854. }
  2855. }
  2856. if err != nil {
  2857. return nil, err
  2858. }
  2859. defer googleapi.CloseBody(res)
  2860. if err := googleapi.CheckResponse(res); err != nil {
  2861. return nil, err
  2862. }
  2863. ret := &Empty{
  2864. ServerResponse: googleapi.ServerResponse{
  2865. Header: res.Header,
  2866. HTTPStatusCode: res.StatusCode,
  2867. },
  2868. }
  2869. target := &ret
  2870. if err := gensupport.DecodeResponse(target, res); err != nil {
  2871. return nil, err
  2872. }
  2873. return ret, nil
  2874. // {
  2875. // "description": "Deletes a workflow template. It does not cancel in-progress workflows.",
  2876. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}",
  2877. // "httpMethod": "DELETE",
  2878. // "id": "dataproc.projects.locations.workflowTemplates.delete",
  2879. // "parameterOrder": [
  2880. // "name"
  2881. // ],
  2882. // "parameters": {
  2883. // "name": {
  2884. // "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}",
  2885. // "location": "path",
  2886. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  2887. // "required": true,
  2888. // "type": "string"
  2889. // },
  2890. // "version": {
  2891. // "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.",
  2892. // "format": "int32",
  2893. // "location": "query",
  2894. // "type": "integer"
  2895. // }
  2896. // },
  2897. // "path": "v1/{+name}",
  2898. // "response": {
  2899. // "$ref": "Empty"
  2900. // },
  2901. // "scopes": [
  2902. // "https://www.googleapis.com/auth/cloud-platform"
  2903. // ]
  2904. // }
  2905. }
  2906. // method id "dataproc.projects.locations.workflowTemplates.get":
  2907. type ProjectsLocationsWorkflowTemplatesGetCall struct {
  2908. s *Service
  2909. name string
  2910. urlParams_ gensupport.URLParams
  2911. ifNoneMatch_ string
  2912. ctx_ context.Context
  2913. header_ http.Header
  2914. }
  2915. // Get: Retrieves the latest workflow template.Can retrieve previously
  2916. // instantiated template by specifying optional version parameter.
  2917. func (r *ProjectsLocationsWorkflowTemplatesService) Get(name string) *ProjectsLocationsWorkflowTemplatesGetCall {
  2918. c := &ProjectsLocationsWorkflowTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2919. c.name = name
  2920. return c
  2921. }
  2922. // Version sets the optional parameter "version": The version of
  2923. // workflow template to retrieve. Only previously instatiated versions
  2924. // can be retrieved.If unspecified, retrieves the current version.
  2925. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Version(version int64) *ProjectsLocationsWorkflowTemplatesGetCall {
  2926. c.urlParams_.Set("version", fmt.Sprint(version))
  2927. return c
  2928. }
  2929. // Fields allows partial responses to be retrieved. See
  2930. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2931. // for more information.
  2932. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesGetCall {
  2933. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2934. return c
  2935. }
  2936. // IfNoneMatch sets the optional parameter which makes the operation
  2937. // fail if the object's ETag matches the given value. This is useful for
  2938. // getting updates only after the object has changed since the last
  2939. // request. Use googleapi.IsNotModified to check whether the response
  2940. // error from Do is the result of In-None-Match.
  2941. func (c *ProjectsLocationsWorkflowTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesGetCall {
  2942. c.ifNoneMatch_ = entityTag
  2943. return c
  2944. }
  2945. // Context sets the context to be used in this call's Do method. Any
  2946. // pending HTTP request will be aborted if the provided context is
  2947. // canceled.
  2948. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesGetCall {
  2949. c.ctx_ = ctx
  2950. return c
  2951. }
  2952. // Header returns an http.Header that can be modified by the caller to
  2953. // add HTTP headers to the request.
  2954. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Header() http.Header {
  2955. if c.header_ == nil {
  2956. c.header_ = make(http.Header)
  2957. }
  2958. return c.header_
  2959. }
  2960. func (c *ProjectsLocationsWorkflowTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  2961. reqHeaders := make(http.Header)
  2962. for k, v := range c.header_ {
  2963. reqHeaders[k] = v
  2964. }
  2965. reqHeaders.Set("User-Agent", c.s.userAgent())
  2966. if c.ifNoneMatch_ != "" {
  2967. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2968. }
  2969. var body io.Reader = nil
  2970. c.urlParams_.Set("alt", alt)
  2971. c.urlParams_.Set("prettyPrint", "false")
  2972. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  2973. urls += "?" + c.urlParams_.Encode()
  2974. req, err := http.NewRequest("GET", urls, body)
  2975. if err != nil {
  2976. return nil, err
  2977. }
  2978. req.Header = reqHeaders
  2979. googleapi.Expand(req.URL, map[string]string{
  2980. "name": c.name,
  2981. })
  2982. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2983. }
  2984. // Do executes the "dataproc.projects.locations.workflowTemplates.get" call.
  2985. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  2986. // non-2xx status code is an error. Response headers are in either
  2987. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  2988. // returned at all) in error.(*googleapi.Error).Header. Use
  2989. // googleapi.IsNotModified to check whether the returned error was
  2990. // because http.StatusNotModified was returned.
  2991. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  2992. gensupport.SetOptions(c.urlParams_, opts...)
  2993. res, err := c.doRequest("json")
  2994. if res != nil && res.StatusCode == http.StatusNotModified {
  2995. if res.Body != nil {
  2996. res.Body.Close()
  2997. }
  2998. return nil, &googleapi.Error{
  2999. Code: res.StatusCode,
  3000. Header: res.Header,
  3001. }
  3002. }
  3003. if err != nil {
  3004. return nil, err
  3005. }
  3006. defer googleapi.CloseBody(res)
  3007. if err := googleapi.CheckResponse(res); err != nil {
  3008. return nil, err
  3009. }
  3010. ret := &WorkflowTemplate{
  3011. ServerResponse: googleapi.ServerResponse{
  3012. Header: res.Header,
  3013. HTTPStatusCode: res.StatusCode,
  3014. },
  3015. }
  3016. target := &ret
  3017. if err := gensupport.DecodeResponse(target, res); err != nil {
  3018. return nil, err
  3019. }
  3020. return ret, nil
  3021. // {
  3022. // "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.",
  3023. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}",
  3024. // "httpMethod": "GET",
  3025. // "id": "dataproc.projects.locations.workflowTemplates.get",
  3026. // "parameterOrder": [
  3027. // "name"
  3028. // ],
  3029. // "parameters": {
  3030. // "name": {
  3031. // "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}",
  3032. // "location": "path",
  3033. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  3034. // "required": true,
  3035. // "type": "string"
  3036. // },
  3037. // "version": {
  3038. // "description": "Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version.",
  3039. // "format": "int32",
  3040. // "location": "query",
  3041. // "type": "integer"
  3042. // }
  3043. // },
  3044. // "path": "v1/{+name}",
  3045. // "response": {
  3046. // "$ref": "WorkflowTemplate"
  3047. // },
  3048. // "scopes": [
  3049. // "https://www.googleapis.com/auth/cloud-platform"
  3050. // ]
  3051. // }
  3052. }
  3053. // method id "dataproc.projects.locations.workflowTemplates.getIamPolicy":
  3054. type ProjectsLocationsWorkflowTemplatesGetIamPolicyCall struct {
  3055. s *Service
  3056. resource string
  3057. getiampolicyrequest *GetIamPolicyRequest
  3058. urlParams_ gensupport.URLParams
  3059. ctx_ context.Context
  3060. header_ http.Header
  3061. }
  3062. // GetIamPolicy: Gets the access control policy for a resource. Returns
  3063. // an empty policy if the resource exists and does not have a policy
  3064. // set.
  3065. func (r *ProjectsLocationsWorkflowTemplatesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall {
  3066. c := &ProjectsLocationsWorkflowTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3067. c.resource = resource
  3068. c.getiampolicyrequest = getiampolicyrequest
  3069. return c
  3070. }
  3071. // Fields allows partial responses to be retrieved. See
  3072. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3073. // for more information.
  3074. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall {
  3075. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3076. return c
  3077. }
  3078. // Context sets the context to be used in this call's Do method. Any
  3079. // pending HTTP request will be aborted if the provided context is
  3080. // canceled.
  3081. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall {
  3082. c.ctx_ = ctx
  3083. return c
  3084. }
  3085. // Header returns an http.Header that can be modified by the caller to
  3086. // add HTTP headers to the request.
  3087. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Header() http.Header {
  3088. if c.header_ == nil {
  3089. c.header_ = make(http.Header)
  3090. }
  3091. return c.header_
  3092. }
  3093. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3094. reqHeaders := make(http.Header)
  3095. for k, v := range c.header_ {
  3096. reqHeaders[k] = v
  3097. }
  3098. reqHeaders.Set("User-Agent", c.s.userAgent())
  3099. var body io.Reader = nil
  3100. body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  3101. if err != nil {
  3102. return nil, err
  3103. }
  3104. reqHeaders.Set("Content-Type", "application/json")
  3105. c.urlParams_.Set("alt", alt)
  3106. c.urlParams_.Set("prettyPrint", "false")
  3107. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  3108. urls += "?" + c.urlParams_.Encode()
  3109. req, err := http.NewRequest("POST", urls, body)
  3110. if err != nil {
  3111. return nil, err
  3112. }
  3113. req.Header = reqHeaders
  3114. googleapi.Expand(req.URL, map[string]string{
  3115. "resource": c.resource,
  3116. })
  3117. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3118. }
  3119. // Do executes the "dataproc.projects.locations.workflowTemplates.getIamPolicy" call.
  3120. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  3121. // code is an error. Response headers are in either
  3122. // *Policy.ServerResponse.Header or (if a response was returned at all)
  3123. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3124. // check whether the returned error was because http.StatusNotModified
  3125. // was returned.
  3126. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3127. gensupport.SetOptions(c.urlParams_, opts...)
  3128. res, err := c.doRequest("json")
  3129. if res != nil && res.StatusCode == http.StatusNotModified {
  3130. if res.Body != nil {
  3131. res.Body.Close()
  3132. }
  3133. return nil, &googleapi.Error{
  3134. Code: res.StatusCode,
  3135. Header: res.Header,
  3136. }
  3137. }
  3138. if err != nil {
  3139. return nil, err
  3140. }
  3141. defer googleapi.CloseBody(res)
  3142. if err := googleapi.CheckResponse(res); err != nil {
  3143. return nil, err
  3144. }
  3145. ret := &Policy{
  3146. ServerResponse: googleapi.ServerResponse{
  3147. Header: res.Header,
  3148. HTTPStatusCode: res.StatusCode,
  3149. },
  3150. }
  3151. target := &ret
  3152. if err := gensupport.DecodeResponse(target, res); err != nil {
  3153. return nil, err
  3154. }
  3155. return ret, nil
  3156. // {
  3157. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  3158. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:getIamPolicy",
  3159. // "httpMethod": "POST",
  3160. // "id": "dataproc.projects.locations.workflowTemplates.getIamPolicy",
  3161. // "parameterOrder": [
  3162. // "resource"
  3163. // ],
  3164. // "parameters": {
  3165. // "resource": {
  3166. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  3167. // "location": "path",
  3168. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  3169. // "required": true,
  3170. // "type": "string"
  3171. // }
  3172. // },
  3173. // "path": "v1/{+resource}:getIamPolicy",
  3174. // "request": {
  3175. // "$ref": "GetIamPolicyRequest"
  3176. // },
  3177. // "response": {
  3178. // "$ref": "Policy"
  3179. // },
  3180. // "scopes": [
  3181. // "https://www.googleapis.com/auth/cloud-platform"
  3182. // ]
  3183. // }
  3184. }
  3185. // method id "dataproc.projects.locations.workflowTemplates.instantiate":
  3186. type ProjectsLocationsWorkflowTemplatesInstantiateCall struct {
  3187. s *Service
  3188. name string
  3189. instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest
  3190. urlParams_ gensupport.URLParams
  3191. ctx_ context.Context
  3192. header_ http.Header
  3193. }
  3194. // Instantiate: Instantiates a template and begins execution.The
  3195. // returned Operation can be used to track execution of workflow by
  3196. // polling operations.get. The Operation will complete when entire
  3197. // workflow is finished.The running workflow can be aborted via
  3198. // operations.cancel. This will cause any inflight jobs to be cancelled
  3199. // and workflow-owned clusters to be deleted.The Operation.metadata will
  3200. // be WorkflowMetadata.On successful completion, Operation.response will
  3201. // be Empty.
  3202. func (r *ProjectsLocationsWorkflowTemplatesService) Instantiate(name string, instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest) *ProjectsLocationsWorkflowTemplatesInstantiateCall {
  3203. c := &ProjectsLocationsWorkflowTemplatesInstantiateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3204. c.name = name
  3205. c.instantiateworkflowtemplaterequest = instantiateworkflowtemplaterequest
  3206. return c
  3207. }
  3208. // Fields allows partial responses to be retrieved. See
  3209. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3210. // for more information.
  3211. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesInstantiateCall {
  3212. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3213. return c
  3214. }
  3215. // Context sets the context to be used in this call's Do method. Any
  3216. // pending HTTP request will be aborted if the provided context is
  3217. // canceled.
  3218. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesInstantiateCall {
  3219. c.ctx_ = ctx
  3220. return c
  3221. }
  3222. // Header returns an http.Header that can be modified by the caller to
  3223. // add HTTP headers to the request.
  3224. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Header() http.Header {
  3225. if c.header_ == nil {
  3226. c.header_ = make(http.Header)
  3227. }
  3228. return c.header_
  3229. }
  3230. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) {
  3231. reqHeaders := make(http.Header)
  3232. for k, v := range c.header_ {
  3233. reqHeaders[k] = v
  3234. }
  3235. reqHeaders.Set("User-Agent", c.s.userAgent())
  3236. var body io.Reader = nil
  3237. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest)
  3238. if err != nil {
  3239. return nil, err
  3240. }
  3241. reqHeaders.Set("Content-Type", "application/json")
  3242. c.urlParams_.Set("alt", alt)
  3243. c.urlParams_.Set("prettyPrint", "false")
  3244. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:instantiate")
  3245. urls += "?" + c.urlParams_.Encode()
  3246. req, err := http.NewRequest("POST", urls, body)
  3247. if err != nil {
  3248. return nil, err
  3249. }
  3250. req.Header = reqHeaders
  3251. googleapi.Expand(req.URL, map[string]string{
  3252. "name": c.name,
  3253. })
  3254. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3255. }
  3256. // Do executes the "dataproc.projects.locations.workflowTemplates.instantiate" call.
  3257. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3258. // status code is an error. Response headers are in either
  3259. // *Operation.ServerResponse.Header or (if a response was returned at
  3260. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3261. // to check whether the returned error was because
  3262. // http.StatusNotModified was returned.
  3263. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3264. gensupport.SetOptions(c.urlParams_, opts...)
  3265. res, err := c.doRequest("json")
  3266. if res != nil && res.StatusCode == http.StatusNotModified {
  3267. if res.Body != nil {
  3268. res.Body.Close()
  3269. }
  3270. return nil, &googleapi.Error{
  3271. Code: res.StatusCode,
  3272. Header: res.Header,
  3273. }
  3274. }
  3275. if err != nil {
  3276. return nil, err
  3277. }
  3278. defer googleapi.CloseBody(res)
  3279. if err := googleapi.CheckResponse(res); err != nil {
  3280. return nil, err
  3281. }
  3282. ret := &Operation{
  3283. ServerResponse: googleapi.ServerResponse{
  3284. Header: res.Header,
  3285. HTTPStatusCode: res.StatusCode,
  3286. },
  3287. }
  3288. target := &ret
  3289. if err := gensupport.DecodeResponse(target, res); err != nil {
  3290. return nil, err
  3291. }
  3292. return ret, nil
  3293. // {
  3294. // "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.",
  3295. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:instantiate",
  3296. // "httpMethod": "POST",
  3297. // "id": "dataproc.projects.locations.workflowTemplates.instantiate",
  3298. // "parameterOrder": [
  3299. // "name"
  3300. // ],
  3301. // "parameters": {
  3302. // "name": {
  3303. // "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}",
  3304. // "location": "path",
  3305. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  3306. // "required": true,
  3307. // "type": "string"
  3308. // }
  3309. // },
  3310. // "path": "v1/{+name}:instantiate",
  3311. // "request": {
  3312. // "$ref": "InstantiateWorkflowTemplateRequest"
  3313. // },
  3314. // "response": {
  3315. // "$ref": "Operation"
  3316. // },
  3317. // "scopes": [
  3318. // "https://www.googleapis.com/auth/cloud-platform"
  3319. // ]
  3320. // }
  3321. }
  3322. // method id "dataproc.projects.locations.workflowTemplates.instantiateInline":
  3323. type ProjectsLocationsWorkflowTemplatesInstantiateInlineCall struct {
  3324. s *Service
  3325. parent string
  3326. workflowtemplate *WorkflowTemplate
  3327. urlParams_ gensupport.URLParams
  3328. ctx_ context.Context
  3329. header_ http.Header
  3330. }
  3331. // InstantiateInline: Instantiates a template and begins execution.This
  3332. // method is equivalent to executing the sequence
  3333. // CreateWorkflowTemplate, InstantiateWorkflowTemplate,
  3334. // DeleteWorkflowTemplate.The returned Operation can be used to track
  3335. // execution of workflow by polling operations.get. The Operation will
  3336. // complete when entire workflow is finished.The running workflow can be
  3337. // aborted via operations.cancel. This will cause any inflight jobs to
  3338. // be cancelled and workflow-owned clusters to be deleted.The
  3339. // Operation.metadata will be WorkflowMetadata.On successful completion,
  3340. // Operation.response will be Empty.
  3341. func (r *ProjectsLocationsWorkflowTemplatesService) InstantiateInline(parent string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall {
  3342. c := &ProjectsLocationsWorkflowTemplatesInstantiateInlineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3343. c.parent = parent
  3344. c.workflowtemplate = workflowtemplate
  3345. return c
  3346. }
  3347. // RequestId sets the optional parameter "requestId": A tag that
  3348. // prevents multiple concurrent workflow instances with the same tag
  3349. // from running. This mitigates risk of concurrent instances started due
  3350. // to retries.It is recommended to always set this value to a UUID
  3351. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag
  3352. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  3353. // and hyphens (-). The maximum length is 40 characters.
  3354. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) RequestId(requestId string) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall {
  3355. c.urlParams_.Set("requestId", requestId)
  3356. return c
  3357. }
  3358. // Fields allows partial responses to be retrieved. See
  3359. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3360. // for more information.
  3361. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall {
  3362. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3363. return c
  3364. }
  3365. // Context sets the context to be used in this call's Do method. Any
  3366. // pending HTTP request will be aborted if the provided context is
  3367. // canceled.
  3368. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall {
  3369. c.ctx_ = ctx
  3370. return c
  3371. }
  3372. // Header returns an http.Header that can be modified by the caller to
  3373. // add HTTP headers to the request.
  3374. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Header() http.Header {
  3375. if c.header_ == nil {
  3376. c.header_ = make(http.Header)
  3377. }
  3378. return c.header_
  3379. }
  3380. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) {
  3381. reqHeaders := make(http.Header)
  3382. for k, v := range c.header_ {
  3383. reqHeaders[k] = v
  3384. }
  3385. reqHeaders.Set("User-Agent", c.s.userAgent())
  3386. var body io.Reader = nil
  3387. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  3388. if err != nil {
  3389. return nil, err
  3390. }
  3391. reqHeaders.Set("Content-Type", "application/json")
  3392. c.urlParams_.Set("alt", alt)
  3393. c.urlParams_.Set("prettyPrint", "false")
  3394. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates:instantiateInline")
  3395. urls += "?" + c.urlParams_.Encode()
  3396. req, err := http.NewRequest("POST", urls, body)
  3397. if err != nil {
  3398. return nil, err
  3399. }
  3400. req.Header = reqHeaders
  3401. googleapi.Expand(req.URL, map[string]string{
  3402. "parent": c.parent,
  3403. })
  3404. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3405. }
  3406. // Do executes the "dataproc.projects.locations.workflowTemplates.instantiateInline" call.
  3407. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3408. // status code is an error. Response headers are in either
  3409. // *Operation.ServerResponse.Header or (if a response was returned at
  3410. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3411. // to check whether the returned error was because
  3412. // http.StatusNotModified was returned.
  3413. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3414. gensupport.SetOptions(c.urlParams_, opts...)
  3415. res, err := c.doRequest("json")
  3416. if res != nil && res.StatusCode == http.StatusNotModified {
  3417. if res.Body != nil {
  3418. res.Body.Close()
  3419. }
  3420. return nil, &googleapi.Error{
  3421. Code: res.StatusCode,
  3422. Header: res.Header,
  3423. }
  3424. }
  3425. if err != nil {
  3426. return nil, err
  3427. }
  3428. defer googleapi.CloseBody(res)
  3429. if err := googleapi.CheckResponse(res); err != nil {
  3430. return nil, err
  3431. }
  3432. ret := &Operation{
  3433. ServerResponse: googleapi.ServerResponse{
  3434. Header: res.Header,
  3435. HTTPStatusCode: res.StatusCode,
  3436. },
  3437. }
  3438. target := &ret
  3439. if err := gensupport.DecodeResponse(target, res); err != nil {
  3440. return nil, err
  3441. }
  3442. return ret, nil
  3443. // {
  3444. // "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.",
  3445. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates:instantiateInline",
  3446. // "httpMethod": "POST",
  3447. // "id": "dataproc.projects.locations.workflowTemplates.instantiateInline",
  3448. // "parameterOrder": [
  3449. // "parent"
  3450. // ],
  3451. // "parameters": {
  3452. // "parent": {
  3453. // "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}",
  3454. // "location": "path",
  3455. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  3456. // "required": true,
  3457. // "type": "string"
  3458. // },
  3459. // "requestId": {
  3460. // "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.",
  3461. // "location": "query",
  3462. // "type": "string"
  3463. // }
  3464. // },
  3465. // "path": "v1/{+parent}/workflowTemplates:instantiateInline",
  3466. // "request": {
  3467. // "$ref": "WorkflowTemplate"
  3468. // },
  3469. // "response": {
  3470. // "$ref": "Operation"
  3471. // },
  3472. // "scopes": [
  3473. // "https://www.googleapis.com/auth/cloud-platform"
  3474. // ]
  3475. // }
  3476. }
  3477. // method id "dataproc.projects.locations.workflowTemplates.list":
  3478. type ProjectsLocationsWorkflowTemplatesListCall struct {
  3479. s *Service
  3480. parent string
  3481. urlParams_ gensupport.URLParams
  3482. ifNoneMatch_ string
  3483. ctx_ context.Context
  3484. header_ http.Header
  3485. }
  3486. // List: Lists workflows that match the specified filter in the request.
  3487. func (r *ProjectsLocationsWorkflowTemplatesService) List(parent string) *ProjectsLocationsWorkflowTemplatesListCall {
  3488. c := &ProjectsLocationsWorkflowTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3489. c.parent = parent
  3490. return c
  3491. }
  3492. // PageSize sets the optional parameter "pageSize": The maximum number
  3493. // of results to return in each response.
  3494. func (c *ProjectsLocationsWorkflowTemplatesListCall) PageSize(pageSize int64) *ProjectsLocationsWorkflowTemplatesListCall {
  3495. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3496. return c
  3497. }
  3498. // PageToken sets the optional parameter "pageToken": The page token,
  3499. // returned by a previous call, to request the next page of results.
  3500. func (c *ProjectsLocationsWorkflowTemplatesListCall) PageToken(pageToken string) *ProjectsLocationsWorkflowTemplatesListCall {
  3501. c.urlParams_.Set("pageToken", pageToken)
  3502. return c
  3503. }
  3504. // Fields allows partial responses to be retrieved. See
  3505. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3506. // for more information.
  3507. func (c *ProjectsLocationsWorkflowTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesListCall {
  3508. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3509. return c
  3510. }
  3511. // IfNoneMatch sets the optional parameter which makes the operation
  3512. // fail if the object's ETag matches the given value. This is useful for
  3513. // getting updates only after the object has changed since the last
  3514. // request. Use googleapi.IsNotModified to check whether the response
  3515. // error from Do is the result of In-None-Match.
  3516. func (c *ProjectsLocationsWorkflowTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesListCall {
  3517. c.ifNoneMatch_ = entityTag
  3518. return c
  3519. }
  3520. // Context sets the context to be used in this call's Do method. Any
  3521. // pending HTTP request will be aborted if the provided context is
  3522. // canceled.
  3523. func (c *ProjectsLocationsWorkflowTemplatesListCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesListCall {
  3524. c.ctx_ = ctx
  3525. return c
  3526. }
  3527. // Header returns an http.Header that can be modified by the caller to
  3528. // add HTTP headers to the request.
  3529. func (c *ProjectsLocationsWorkflowTemplatesListCall) Header() http.Header {
  3530. if c.header_ == nil {
  3531. c.header_ = make(http.Header)
  3532. }
  3533. return c.header_
  3534. }
  3535. func (c *ProjectsLocationsWorkflowTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  3536. reqHeaders := make(http.Header)
  3537. for k, v := range c.header_ {
  3538. reqHeaders[k] = v
  3539. }
  3540. reqHeaders.Set("User-Agent", c.s.userAgent())
  3541. if c.ifNoneMatch_ != "" {
  3542. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3543. }
  3544. var body io.Reader = nil
  3545. c.urlParams_.Set("alt", alt)
  3546. c.urlParams_.Set("prettyPrint", "false")
  3547. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates")
  3548. urls += "?" + c.urlParams_.Encode()
  3549. req, err := http.NewRequest("GET", urls, body)
  3550. if err != nil {
  3551. return nil, err
  3552. }
  3553. req.Header = reqHeaders
  3554. googleapi.Expand(req.URL, map[string]string{
  3555. "parent": c.parent,
  3556. })
  3557. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3558. }
  3559. // Do executes the "dataproc.projects.locations.workflowTemplates.list" call.
  3560. // Exactly one of *ListWorkflowTemplatesResponse or error will be
  3561. // non-nil. Any non-2xx status code is an error. Response headers are in
  3562. // either *ListWorkflowTemplatesResponse.ServerResponse.Header or (if a
  3563. // response was returned at all) in error.(*googleapi.Error).Header. Use
  3564. // googleapi.IsNotModified to check whether the returned error was
  3565. // because http.StatusNotModified was returned.
  3566. func (c *ProjectsLocationsWorkflowTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowTemplatesResponse, error) {
  3567. gensupport.SetOptions(c.urlParams_, opts...)
  3568. res, err := c.doRequest("json")
  3569. if res != nil && res.StatusCode == http.StatusNotModified {
  3570. if res.Body != nil {
  3571. res.Body.Close()
  3572. }
  3573. return nil, &googleapi.Error{
  3574. Code: res.StatusCode,
  3575. Header: res.Header,
  3576. }
  3577. }
  3578. if err != nil {
  3579. return nil, err
  3580. }
  3581. defer googleapi.CloseBody(res)
  3582. if err := googleapi.CheckResponse(res); err != nil {
  3583. return nil, err
  3584. }
  3585. ret := &ListWorkflowTemplatesResponse{
  3586. ServerResponse: googleapi.ServerResponse{
  3587. Header: res.Header,
  3588. HTTPStatusCode: res.StatusCode,
  3589. },
  3590. }
  3591. target := &ret
  3592. if err := gensupport.DecodeResponse(target, res); err != nil {
  3593. return nil, err
  3594. }
  3595. return ret, nil
  3596. // {
  3597. // "description": "Lists workflows that match the specified filter in the request.",
  3598. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates",
  3599. // "httpMethod": "GET",
  3600. // "id": "dataproc.projects.locations.workflowTemplates.list",
  3601. // "parameterOrder": [
  3602. // "parent"
  3603. // ],
  3604. // "parameters": {
  3605. // "pageSize": {
  3606. // "description": "Optional. The maximum number of results to return in each response.",
  3607. // "format": "int32",
  3608. // "location": "query",
  3609. // "type": "integer"
  3610. // },
  3611. // "pageToken": {
  3612. // "description": "Optional. The page token, returned by a previous call, to request the next page of results.",
  3613. // "location": "query",
  3614. // "type": "string"
  3615. // },
  3616. // "parent": {
  3617. // "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}",
  3618. // "location": "path",
  3619. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  3620. // "required": true,
  3621. // "type": "string"
  3622. // }
  3623. // },
  3624. // "path": "v1/{+parent}/workflowTemplates",
  3625. // "response": {
  3626. // "$ref": "ListWorkflowTemplatesResponse"
  3627. // },
  3628. // "scopes": [
  3629. // "https://www.googleapis.com/auth/cloud-platform"
  3630. // ]
  3631. // }
  3632. }
  3633. // Pages invokes f for each page of results.
  3634. // A non-nil error returned from f will halt the iteration.
  3635. // The provided context supersedes any context provided to the Context method.
  3636. func (c *ProjectsLocationsWorkflowTemplatesListCall) Pages(ctx context.Context, f func(*ListWorkflowTemplatesResponse) error) error {
  3637. c.ctx_ = ctx
  3638. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3639. for {
  3640. x, err := c.Do()
  3641. if err != nil {
  3642. return err
  3643. }
  3644. if err := f(x); err != nil {
  3645. return err
  3646. }
  3647. if x.NextPageToken == "" {
  3648. return nil
  3649. }
  3650. c.PageToken(x.NextPageToken)
  3651. }
  3652. }
  3653. // method id "dataproc.projects.locations.workflowTemplates.setIamPolicy":
  3654. type ProjectsLocationsWorkflowTemplatesSetIamPolicyCall struct {
  3655. s *Service
  3656. resource string
  3657. setiampolicyrequest *SetIamPolicyRequest
  3658. urlParams_ gensupport.URLParams
  3659. ctx_ context.Context
  3660. header_ http.Header
  3661. }
  3662. // SetIamPolicy: Sets the access control policy on the specified
  3663. // resource. Replaces any existing policy.
  3664. func (r *ProjectsLocationsWorkflowTemplatesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall {
  3665. c := &ProjectsLocationsWorkflowTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3666. c.resource = resource
  3667. c.setiampolicyrequest = setiampolicyrequest
  3668. return c
  3669. }
  3670. // Fields allows partial responses to be retrieved. See
  3671. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3672. // for more information.
  3673. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall {
  3674. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3675. return c
  3676. }
  3677. // Context sets the context to be used in this call's Do method. Any
  3678. // pending HTTP request will be aborted if the provided context is
  3679. // canceled.
  3680. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall {
  3681. c.ctx_ = ctx
  3682. return c
  3683. }
  3684. // Header returns an http.Header that can be modified by the caller to
  3685. // add HTTP headers to the request.
  3686. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Header() http.Header {
  3687. if c.header_ == nil {
  3688. c.header_ = make(http.Header)
  3689. }
  3690. return c.header_
  3691. }
  3692. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3693. reqHeaders := make(http.Header)
  3694. for k, v := range c.header_ {
  3695. reqHeaders[k] = v
  3696. }
  3697. reqHeaders.Set("User-Agent", c.s.userAgent())
  3698. var body io.Reader = nil
  3699. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  3700. if err != nil {
  3701. return nil, err
  3702. }
  3703. reqHeaders.Set("Content-Type", "application/json")
  3704. c.urlParams_.Set("alt", alt)
  3705. c.urlParams_.Set("prettyPrint", "false")
  3706. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  3707. urls += "?" + c.urlParams_.Encode()
  3708. req, err := http.NewRequest("POST", urls, body)
  3709. if err != nil {
  3710. return nil, err
  3711. }
  3712. req.Header = reqHeaders
  3713. googleapi.Expand(req.URL, map[string]string{
  3714. "resource": c.resource,
  3715. })
  3716. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3717. }
  3718. // Do executes the "dataproc.projects.locations.workflowTemplates.setIamPolicy" call.
  3719. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  3720. // code is an error. Response headers are in either
  3721. // *Policy.ServerResponse.Header or (if a response was returned at all)
  3722. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3723. // check whether the returned error was because http.StatusNotModified
  3724. // was returned.
  3725. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3726. gensupport.SetOptions(c.urlParams_, opts...)
  3727. res, err := c.doRequest("json")
  3728. if res != nil && res.StatusCode == http.StatusNotModified {
  3729. if res.Body != nil {
  3730. res.Body.Close()
  3731. }
  3732. return nil, &googleapi.Error{
  3733. Code: res.StatusCode,
  3734. Header: res.Header,
  3735. }
  3736. }
  3737. if err != nil {
  3738. return nil, err
  3739. }
  3740. defer googleapi.CloseBody(res)
  3741. if err := googleapi.CheckResponse(res); err != nil {
  3742. return nil, err
  3743. }
  3744. ret := &Policy{
  3745. ServerResponse: googleapi.ServerResponse{
  3746. Header: res.Header,
  3747. HTTPStatusCode: res.StatusCode,
  3748. },
  3749. }
  3750. target := &ret
  3751. if err := gensupport.DecodeResponse(target, res); err != nil {
  3752. return nil, err
  3753. }
  3754. return ret, nil
  3755. // {
  3756. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  3757. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:setIamPolicy",
  3758. // "httpMethod": "POST",
  3759. // "id": "dataproc.projects.locations.workflowTemplates.setIamPolicy",
  3760. // "parameterOrder": [
  3761. // "resource"
  3762. // ],
  3763. // "parameters": {
  3764. // "resource": {
  3765. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  3766. // "location": "path",
  3767. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  3768. // "required": true,
  3769. // "type": "string"
  3770. // }
  3771. // },
  3772. // "path": "v1/{+resource}:setIamPolicy",
  3773. // "request": {
  3774. // "$ref": "SetIamPolicyRequest"
  3775. // },
  3776. // "response": {
  3777. // "$ref": "Policy"
  3778. // },
  3779. // "scopes": [
  3780. // "https://www.googleapis.com/auth/cloud-platform"
  3781. // ]
  3782. // }
  3783. }
  3784. // method id "dataproc.projects.locations.workflowTemplates.testIamPermissions":
  3785. type ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall struct {
  3786. s *Service
  3787. resource string
  3788. testiampermissionsrequest *TestIamPermissionsRequest
  3789. urlParams_ gensupport.URLParams
  3790. ctx_ context.Context
  3791. header_ http.Header
  3792. }
  3793. // TestIamPermissions: Returns permissions that a caller has on the
  3794. // specified resource. If the resource does not exist, this will return
  3795. // an empty set of permissions, not a NOT_FOUND error.Note: This
  3796. // operation is designed to be used for building permission-aware UIs
  3797. // and command-line tools, not for authorization checking. This
  3798. // operation may "fail open" without warning.
  3799. func (r *ProjectsLocationsWorkflowTemplatesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall {
  3800. c := &ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3801. c.resource = resource
  3802. c.testiampermissionsrequest = testiampermissionsrequest
  3803. return c
  3804. }
  3805. // Fields allows partial responses to be retrieved. See
  3806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3807. // for more information.
  3808. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall {
  3809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3810. return c
  3811. }
  3812. // Context sets the context to be used in this call's Do method. Any
  3813. // pending HTTP request will be aborted if the provided context is
  3814. // canceled.
  3815. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall {
  3816. c.ctx_ = ctx
  3817. return c
  3818. }
  3819. // Header returns an http.Header that can be modified by the caller to
  3820. // add HTTP headers to the request.
  3821. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Header() http.Header {
  3822. if c.header_ == nil {
  3823. c.header_ = make(http.Header)
  3824. }
  3825. return c.header_
  3826. }
  3827. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  3828. reqHeaders := make(http.Header)
  3829. for k, v := range c.header_ {
  3830. reqHeaders[k] = v
  3831. }
  3832. reqHeaders.Set("User-Agent", c.s.userAgent())
  3833. var body io.Reader = nil
  3834. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  3835. if err != nil {
  3836. return nil, err
  3837. }
  3838. reqHeaders.Set("Content-Type", "application/json")
  3839. c.urlParams_.Set("alt", alt)
  3840. c.urlParams_.Set("prettyPrint", "false")
  3841. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  3842. urls += "?" + c.urlParams_.Encode()
  3843. req, err := http.NewRequest("POST", urls, body)
  3844. if err != nil {
  3845. return nil, err
  3846. }
  3847. req.Header = reqHeaders
  3848. googleapi.Expand(req.URL, map[string]string{
  3849. "resource": c.resource,
  3850. })
  3851. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3852. }
  3853. // Do executes the "dataproc.projects.locations.workflowTemplates.testIamPermissions" call.
  3854. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  3855. // Any non-2xx status code is an error. Response headers are in either
  3856. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  3857. // was returned at all) in error.(*googleapi.Error).Header. Use
  3858. // googleapi.IsNotModified to check whether the returned error was
  3859. // because http.StatusNotModified was returned.
  3860. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  3861. gensupport.SetOptions(c.urlParams_, opts...)
  3862. res, err := c.doRequest("json")
  3863. if res != nil && res.StatusCode == http.StatusNotModified {
  3864. if res.Body != nil {
  3865. res.Body.Close()
  3866. }
  3867. return nil, &googleapi.Error{
  3868. Code: res.StatusCode,
  3869. Header: res.Header,
  3870. }
  3871. }
  3872. if err != nil {
  3873. return nil, err
  3874. }
  3875. defer googleapi.CloseBody(res)
  3876. if err := googleapi.CheckResponse(res); err != nil {
  3877. return nil, err
  3878. }
  3879. ret := &TestIamPermissionsResponse{
  3880. ServerResponse: googleapi.ServerResponse{
  3881. Header: res.Header,
  3882. HTTPStatusCode: res.StatusCode,
  3883. },
  3884. }
  3885. target := &ret
  3886. if err := gensupport.DecodeResponse(target, res); err != nil {
  3887. return nil, err
  3888. }
  3889. return ret, nil
  3890. // {
  3891. // "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.",
  3892. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:testIamPermissions",
  3893. // "httpMethod": "POST",
  3894. // "id": "dataproc.projects.locations.workflowTemplates.testIamPermissions",
  3895. // "parameterOrder": [
  3896. // "resource"
  3897. // ],
  3898. // "parameters": {
  3899. // "resource": {
  3900. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  3901. // "location": "path",
  3902. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  3903. // "required": true,
  3904. // "type": "string"
  3905. // }
  3906. // },
  3907. // "path": "v1/{+resource}:testIamPermissions",
  3908. // "request": {
  3909. // "$ref": "TestIamPermissionsRequest"
  3910. // },
  3911. // "response": {
  3912. // "$ref": "TestIamPermissionsResponse"
  3913. // },
  3914. // "scopes": [
  3915. // "https://www.googleapis.com/auth/cloud-platform"
  3916. // ]
  3917. // }
  3918. }
  3919. // method id "dataproc.projects.locations.workflowTemplates.update":
  3920. type ProjectsLocationsWorkflowTemplatesUpdateCall struct {
  3921. s *Service
  3922. name string
  3923. workflowtemplate *WorkflowTemplate
  3924. urlParams_ gensupport.URLParams
  3925. ctx_ context.Context
  3926. header_ http.Header
  3927. }
  3928. // Update: Updates (replaces) workflow template. The updated template
  3929. // must contain version that matches the current server version.
  3930. func (r *ProjectsLocationsWorkflowTemplatesService) Update(name string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesUpdateCall {
  3931. c := &ProjectsLocationsWorkflowTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3932. c.name = name
  3933. c.workflowtemplate = workflowtemplate
  3934. return c
  3935. }
  3936. // Fields allows partial responses to be retrieved. See
  3937. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3938. // for more information.
  3939. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesUpdateCall {
  3940. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3941. return c
  3942. }
  3943. // Context sets the context to be used in this call's Do method. Any
  3944. // pending HTTP request will be aborted if the provided context is
  3945. // canceled.
  3946. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesUpdateCall {
  3947. c.ctx_ = ctx
  3948. return c
  3949. }
  3950. // Header returns an http.Header that can be modified by the caller to
  3951. // add HTTP headers to the request.
  3952. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Header() http.Header {
  3953. if c.header_ == nil {
  3954. c.header_ = make(http.Header)
  3955. }
  3956. return c.header_
  3957. }
  3958. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  3959. reqHeaders := make(http.Header)
  3960. for k, v := range c.header_ {
  3961. reqHeaders[k] = v
  3962. }
  3963. reqHeaders.Set("User-Agent", c.s.userAgent())
  3964. var body io.Reader = nil
  3965. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  3966. if err != nil {
  3967. return nil, err
  3968. }
  3969. reqHeaders.Set("Content-Type", "application/json")
  3970. c.urlParams_.Set("alt", alt)
  3971. c.urlParams_.Set("prettyPrint", "false")
  3972. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  3973. urls += "?" + c.urlParams_.Encode()
  3974. req, err := http.NewRequest("PUT", urls, body)
  3975. if err != nil {
  3976. return nil, err
  3977. }
  3978. req.Header = reqHeaders
  3979. googleapi.Expand(req.URL, map[string]string{
  3980. "name": c.name,
  3981. })
  3982. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3983. }
  3984. // Do executes the "dataproc.projects.locations.workflowTemplates.update" call.
  3985. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  3986. // non-2xx status code is an error. Response headers are in either
  3987. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  3988. // returned at all) in error.(*googleapi.Error).Header. Use
  3989. // googleapi.IsNotModified to check whether the returned error was
  3990. // because http.StatusNotModified was returned.
  3991. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  3992. gensupport.SetOptions(c.urlParams_, opts...)
  3993. res, err := c.doRequest("json")
  3994. if res != nil && res.StatusCode == http.StatusNotModified {
  3995. if res.Body != nil {
  3996. res.Body.Close()
  3997. }
  3998. return nil, &googleapi.Error{
  3999. Code: res.StatusCode,
  4000. Header: res.Header,
  4001. }
  4002. }
  4003. if err != nil {
  4004. return nil, err
  4005. }
  4006. defer googleapi.CloseBody(res)
  4007. if err := googleapi.CheckResponse(res); err != nil {
  4008. return nil, err
  4009. }
  4010. ret := &WorkflowTemplate{
  4011. ServerResponse: googleapi.ServerResponse{
  4012. Header: res.Header,
  4013. HTTPStatusCode: res.StatusCode,
  4014. },
  4015. }
  4016. target := &ret
  4017. if err := gensupport.DecodeResponse(target, res); err != nil {
  4018. return nil, err
  4019. }
  4020. return ret, nil
  4021. // {
  4022. // "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version.",
  4023. // "flatPath": "v1/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}",
  4024. // "httpMethod": "PUT",
  4025. // "id": "dataproc.projects.locations.workflowTemplates.update",
  4026. // "parameterOrder": [
  4027. // "name"
  4028. // ],
  4029. // "parameters": {
  4030. // "name": {
  4031. // "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}",
  4032. // "location": "path",
  4033. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  4034. // "required": true,
  4035. // "type": "string"
  4036. // }
  4037. // },
  4038. // "path": "v1/{+name}",
  4039. // "request": {
  4040. // "$ref": "WorkflowTemplate"
  4041. // },
  4042. // "response": {
  4043. // "$ref": "WorkflowTemplate"
  4044. // },
  4045. // "scopes": [
  4046. // "https://www.googleapis.com/auth/cloud-platform"
  4047. // ]
  4048. // }
  4049. }
  4050. // method id "dataproc.projects.regions.clusters.create":
  4051. type ProjectsRegionsClustersCreateCall struct {
  4052. s *Service
  4053. projectId string
  4054. region string
  4055. cluster *Cluster
  4056. urlParams_ gensupport.URLParams
  4057. ctx_ context.Context
  4058. header_ http.Header
  4059. }
  4060. // Create: Creates a cluster in a project.
  4061. func (r *ProjectsRegionsClustersService) Create(projectId string, region string, cluster *Cluster) *ProjectsRegionsClustersCreateCall {
  4062. c := &ProjectsRegionsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4063. c.projectId = projectId
  4064. c.region = region
  4065. c.cluster = cluster
  4066. return c
  4067. }
  4068. // RequestId sets the optional parameter "requestId": A unique id used
  4069. // to identify the request. If the server receives two
  4070. // CreateClusterRequest requests with the same id, then the second
  4071. // request will be ignored and the first google.longrunning.Operation
  4072. // created and stored in the backend is returned.It is recommended to
  4073. // always set this value to a UUID
  4074. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id
  4075. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  4076. // and hyphens (-). The maximum length is 40 characters.
  4077. func (c *ProjectsRegionsClustersCreateCall) RequestId(requestId string) *ProjectsRegionsClustersCreateCall {
  4078. c.urlParams_.Set("requestId", requestId)
  4079. return c
  4080. }
  4081. // Fields allows partial responses to be retrieved. See
  4082. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4083. // for more information.
  4084. func (c *ProjectsRegionsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersCreateCall {
  4085. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4086. return c
  4087. }
  4088. // Context sets the context to be used in this call's Do method. Any
  4089. // pending HTTP request will be aborted if the provided context is
  4090. // canceled.
  4091. func (c *ProjectsRegionsClustersCreateCall) Context(ctx context.Context) *ProjectsRegionsClustersCreateCall {
  4092. c.ctx_ = ctx
  4093. return c
  4094. }
  4095. // Header returns an http.Header that can be modified by the caller to
  4096. // add HTTP headers to the request.
  4097. func (c *ProjectsRegionsClustersCreateCall) Header() http.Header {
  4098. if c.header_ == nil {
  4099. c.header_ = make(http.Header)
  4100. }
  4101. return c.header_
  4102. }
  4103. func (c *ProjectsRegionsClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  4104. reqHeaders := make(http.Header)
  4105. for k, v := range c.header_ {
  4106. reqHeaders[k] = v
  4107. }
  4108. reqHeaders.Set("User-Agent", c.s.userAgent())
  4109. var body io.Reader = nil
  4110. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster)
  4111. if err != nil {
  4112. return nil, err
  4113. }
  4114. reqHeaders.Set("Content-Type", "application/json")
  4115. c.urlParams_.Set("alt", alt)
  4116. c.urlParams_.Set("prettyPrint", "false")
  4117. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters")
  4118. urls += "?" + c.urlParams_.Encode()
  4119. req, err := http.NewRequest("POST", urls, body)
  4120. if err != nil {
  4121. return nil, err
  4122. }
  4123. req.Header = reqHeaders
  4124. googleapi.Expand(req.URL, map[string]string{
  4125. "projectId": c.projectId,
  4126. "region": c.region,
  4127. })
  4128. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4129. }
  4130. // Do executes the "dataproc.projects.regions.clusters.create" call.
  4131. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4132. // status code is an error. Response headers are in either
  4133. // *Operation.ServerResponse.Header or (if a response was returned at
  4134. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4135. // to check whether the returned error was because
  4136. // http.StatusNotModified was returned.
  4137. func (c *ProjectsRegionsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4138. gensupport.SetOptions(c.urlParams_, opts...)
  4139. res, err := c.doRequest("json")
  4140. if res != nil && res.StatusCode == http.StatusNotModified {
  4141. if res.Body != nil {
  4142. res.Body.Close()
  4143. }
  4144. return nil, &googleapi.Error{
  4145. Code: res.StatusCode,
  4146. Header: res.Header,
  4147. }
  4148. }
  4149. if err != nil {
  4150. return nil, err
  4151. }
  4152. defer googleapi.CloseBody(res)
  4153. if err := googleapi.CheckResponse(res); err != nil {
  4154. return nil, err
  4155. }
  4156. ret := &Operation{
  4157. ServerResponse: googleapi.ServerResponse{
  4158. Header: res.Header,
  4159. HTTPStatusCode: res.StatusCode,
  4160. },
  4161. }
  4162. target := &ret
  4163. if err := gensupport.DecodeResponse(target, res); err != nil {
  4164. return nil, err
  4165. }
  4166. return ret, nil
  4167. // {
  4168. // "description": "Creates a cluster in a project.",
  4169. // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters",
  4170. // "httpMethod": "POST",
  4171. // "id": "dataproc.projects.regions.clusters.create",
  4172. // "parameterOrder": [
  4173. // "projectId",
  4174. // "region"
  4175. // ],
  4176. // "parameters": {
  4177. // "projectId": {
  4178. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  4179. // "location": "path",
  4180. // "required": true,
  4181. // "type": "string"
  4182. // },
  4183. // "region": {
  4184. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  4185. // "location": "path",
  4186. // "required": true,
  4187. // "type": "string"
  4188. // },
  4189. // "requestId": {
  4190. // "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.",
  4191. // "location": "query",
  4192. // "type": "string"
  4193. // }
  4194. // },
  4195. // "path": "v1/projects/{projectId}/regions/{region}/clusters",
  4196. // "request": {
  4197. // "$ref": "Cluster"
  4198. // },
  4199. // "response": {
  4200. // "$ref": "Operation"
  4201. // },
  4202. // "scopes": [
  4203. // "https://www.googleapis.com/auth/cloud-platform"
  4204. // ]
  4205. // }
  4206. }
  4207. // method id "dataproc.projects.regions.clusters.delete":
  4208. type ProjectsRegionsClustersDeleteCall struct {
  4209. s *Service
  4210. projectId string
  4211. region string
  4212. clusterName string
  4213. urlParams_ gensupport.URLParams
  4214. ctx_ context.Context
  4215. header_ http.Header
  4216. }
  4217. // Delete: Deletes a cluster in a project.
  4218. func (r *ProjectsRegionsClustersService) Delete(projectId string, region string, clusterName string) *ProjectsRegionsClustersDeleteCall {
  4219. c := &ProjectsRegionsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4220. c.projectId = projectId
  4221. c.region = region
  4222. c.clusterName = clusterName
  4223. return c
  4224. }
  4225. // ClusterUuid sets the optional parameter "clusterUuid": Specifying the
  4226. // cluster_uuid means the RPC should fail (with error NOT_FOUND) if
  4227. // cluster with specified UUID does not exist.
  4228. func (c *ProjectsRegionsClustersDeleteCall) ClusterUuid(clusterUuid string) *ProjectsRegionsClustersDeleteCall {
  4229. c.urlParams_.Set("clusterUuid", clusterUuid)
  4230. return c
  4231. }
  4232. // RequestId sets the optional parameter "requestId": A unique id used
  4233. // to identify the request. If the server receives two
  4234. // DeleteClusterRequest requests with the same id, then the second
  4235. // request will be ignored and the first google.longrunning.Operation
  4236. // created and stored in the backend is returned.It is recommended to
  4237. // always set this value to a UUID
  4238. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id
  4239. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  4240. // and hyphens (-). The maximum length is 40 characters.
  4241. func (c *ProjectsRegionsClustersDeleteCall) RequestId(requestId string) *ProjectsRegionsClustersDeleteCall {
  4242. c.urlParams_.Set("requestId", requestId)
  4243. return c
  4244. }
  4245. // Fields allows partial responses to be retrieved. See
  4246. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4247. // for more information.
  4248. func (c *ProjectsRegionsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersDeleteCall {
  4249. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4250. return c
  4251. }
  4252. // Context sets the context to be used in this call's Do method. Any
  4253. // pending HTTP request will be aborted if the provided context is
  4254. // canceled.
  4255. func (c *ProjectsRegionsClustersDeleteCall) Context(ctx context.Context) *ProjectsRegionsClustersDeleteCall {
  4256. c.ctx_ = ctx
  4257. return c
  4258. }
  4259. // Header returns an http.Header that can be modified by the caller to
  4260. // add HTTP headers to the request.
  4261. func (c *ProjectsRegionsClustersDeleteCall) Header() http.Header {
  4262. if c.header_ == nil {
  4263. c.header_ = make(http.Header)
  4264. }
  4265. return c.header_
  4266. }
  4267. func (c *ProjectsRegionsClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  4268. reqHeaders := make(http.Header)
  4269. for k, v := range c.header_ {
  4270. reqHeaders[k] = v
  4271. }
  4272. reqHeaders.Set("User-Agent", c.s.userAgent())
  4273. var body io.Reader = nil
  4274. c.urlParams_.Set("alt", alt)
  4275. c.urlParams_.Set("prettyPrint", "false")
  4276. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}")
  4277. urls += "?" + c.urlParams_.Encode()
  4278. req, err := http.NewRequest("DELETE", urls, body)
  4279. if err != nil {
  4280. return nil, err
  4281. }
  4282. req.Header = reqHeaders
  4283. googleapi.Expand(req.URL, map[string]string{
  4284. "projectId": c.projectId,
  4285. "region": c.region,
  4286. "clusterName": c.clusterName,
  4287. })
  4288. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4289. }
  4290. // Do executes the "dataproc.projects.regions.clusters.delete" call.
  4291. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4292. // status code is an error. Response headers are in either
  4293. // *Operation.ServerResponse.Header or (if a response was returned at
  4294. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4295. // to check whether the returned error was because
  4296. // http.StatusNotModified was returned.
  4297. func (c *ProjectsRegionsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4298. gensupport.SetOptions(c.urlParams_, opts...)
  4299. res, err := c.doRequest("json")
  4300. if res != nil && res.StatusCode == http.StatusNotModified {
  4301. if res.Body != nil {
  4302. res.Body.Close()
  4303. }
  4304. return nil, &googleapi.Error{
  4305. Code: res.StatusCode,
  4306. Header: res.Header,
  4307. }
  4308. }
  4309. if err != nil {
  4310. return nil, err
  4311. }
  4312. defer googleapi.CloseBody(res)
  4313. if err := googleapi.CheckResponse(res); err != nil {
  4314. return nil, err
  4315. }
  4316. ret := &Operation{
  4317. ServerResponse: googleapi.ServerResponse{
  4318. Header: res.Header,
  4319. HTTPStatusCode: res.StatusCode,
  4320. },
  4321. }
  4322. target := &ret
  4323. if err := gensupport.DecodeResponse(target, res); err != nil {
  4324. return nil, err
  4325. }
  4326. return ret, nil
  4327. // {
  4328. // "description": "Deletes a cluster in a project.",
  4329. // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  4330. // "httpMethod": "DELETE",
  4331. // "id": "dataproc.projects.regions.clusters.delete",
  4332. // "parameterOrder": [
  4333. // "projectId",
  4334. // "region",
  4335. // "clusterName"
  4336. // ],
  4337. // "parameters": {
  4338. // "clusterName": {
  4339. // "description": "Required. The cluster name.",
  4340. // "location": "path",
  4341. // "required": true,
  4342. // "type": "string"
  4343. // },
  4344. // "clusterUuid": {
  4345. // "description": "Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist.",
  4346. // "location": "query",
  4347. // "type": "string"
  4348. // },
  4349. // "projectId": {
  4350. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  4351. // "location": "path",
  4352. // "required": true,
  4353. // "type": "string"
  4354. // },
  4355. // "region": {
  4356. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  4357. // "location": "path",
  4358. // "required": true,
  4359. // "type": "string"
  4360. // },
  4361. // "requestId": {
  4362. // "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.",
  4363. // "location": "query",
  4364. // "type": "string"
  4365. // }
  4366. // },
  4367. // "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  4368. // "response": {
  4369. // "$ref": "Operation"
  4370. // },
  4371. // "scopes": [
  4372. // "https://www.googleapis.com/auth/cloud-platform"
  4373. // ]
  4374. // }
  4375. }
  4376. // method id "dataproc.projects.regions.clusters.diagnose":
  4377. type ProjectsRegionsClustersDiagnoseCall struct {
  4378. s *Service
  4379. projectId string
  4380. region string
  4381. clusterName string
  4382. diagnoseclusterrequest *DiagnoseClusterRequest
  4383. urlParams_ gensupport.URLParams
  4384. ctx_ context.Context
  4385. header_ http.Header
  4386. }
  4387. // Diagnose: Gets cluster diagnostic information. After the operation
  4388. // completes, the Operation.response field contains
  4389. // DiagnoseClusterOutputLocation.
  4390. func (r *ProjectsRegionsClustersService) Diagnose(projectId string, region string, clusterName string, diagnoseclusterrequest *DiagnoseClusterRequest) *ProjectsRegionsClustersDiagnoseCall {
  4391. c := &ProjectsRegionsClustersDiagnoseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4392. c.projectId = projectId
  4393. c.region = region
  4394. c.clusterName = clusterName
  4395. c.diagnoseclusterrequest = diagnoseclusterrequest
  4396. return c
  4397. }
  4398. // Fields allows partial responses to be retrieved. See
  4399. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4400. // for more information.
  4401. func (c *ProjectsRegionsClustersDiagnoseCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersDiagnoseCall {
  4402. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4403. return c
  4404. }
  4405. // Context sets the context to be used in this call's Do method. Any
  4406. // pending HTTP request will be aborted if the provided context is
  4407. // canceled.
  4408. func (c *ProjectsRegionsClustersDiagnoseCall) Context(ctx context.Context) *ProjectsRegionsClustersDiagnoseCall {
  4409. c.ctx_ = ctx
  4410. return c
  4411. }
  4412. // Header returns an http.Header that can be modified by the caller to
  4413. // add HTTP headers to the request.
  4414. func (c *ProjectsRegionsClustersDiagnoseCall) Header() http.Header {
  4415. if c.header_ == nil {
  4416. c.header_ = make(http.Header)
  4417. }
  4418. return c.header_
  4419. }
  4420. func (c *ProjectsRegionsClustersDiagnoseCall) doRequest(alt string) (*http.Response, error) {
  4421. reqHeaders := make(http.Header)
  4422. for k, v := range c.header_ {
  4423. reqHeaders[k] = v
  4424. }
  4425. reqHeaders.Set("User-Agent", c.s.userAgent())
  4426. var body io.Reader = nil
  4427. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diagnoseclusterrequest)
  4428. if err != nil {
  4429. return nil, err
  4430. }
  4431. reqHeaders.Set("Content-Type", "application/json")
  4432. c.urlParams_.Set("alt", alt)
  4433. c.urlParams_.Set("prettyPrint", "false")
  4434. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose")
  4435. urls += "?" + c.urlParams_.Encode()
  4436. req, err := http.NewRequest("POST", urls, body)
  4437. if err != nil {
  4438. return nil, err
  4439. }
  4440. req.Header = reqHeaders
  4441. googleapi.Expand(req.URL, map[string]string{
  4442. "projectId": c.projectId,
  4443. "region": c.region,
  4444. "clusterName": c.clusterName,
  4445. })
  4446. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4447. }
  4448. // Do executes the "dataproc.projects.regions.clusters.diagnose" call.
  4449. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4450. // status code is an error. Response headers are in either
  4451. // *Operation.ServerResponse.Header or (if a response was returned at
  4452. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4453. // to check whether the returned error was because
  4454. // http.StatusNotModified was returned.
  4455. func (c *ProjectsRegionsClustersDiagnoseCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4456. gensupport.SetOptions(c.urlParams_, opts...)
  4457. res, err := c.doRequest("json")
  4458. if res != nil && res.StatusCode == http.StatusNotModified {
  4459. if res.Body != nil {
  4460. res.Body.Close()
  4461. }
  4462. return nil, &googleapi.Error{
  4463. Code: res.StatusCode,
  4464. Header: res.Header,
  4465. }
  4466. }
  4467. if err != nil {
  4468. return nil, err
  4469. }
  4470. defer googleapi.CloseBody(res)
  4471. if err := googleapi.CheckResponse(res); err != nil {
  4472. return nil, err
  4473. }
  4474. ret := &Operation{
  4475. ServerResponse: googleapi.ServerResponse{
  4476. Header: res.Header,
  4477. HTTPStatusCode: res.StatusCode,
  4478. },
  4479. }
  4480. target := &ret
  4481. if err := gensupport.DecodeResponse(target, res); err != nil {
  4482. return nil, err
  4483. }
  4484. return ret, nil
  4485. // {
  4486. // "description": "Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation.",
  4487. // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose",
  4488. // "httpMethod": "POST",
  4489. // "id": "dataproc.projects.regions.clusters.diagnose",
  4490. // "parameterOrder": [
  4491. // "projectId",
  4492. // "region",
  4493. // "clusterName"
  4494. // ],
  4495. // "parameters": {
  4496. // "clusterName": {
  4497. // "description": "Required. The cluster name.",
  4498. // "location": "path",
  4499. // "required": true,
  4500. // "type": "string"
  4501. // },
  4502. // "projectId": {
  4503. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  4504. // "location": "path",
  4505. // "required": true,
  4506. // "type": "string"
  4507. // },
  4508. // "region": {
  4509. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  4510. // "location": "path",
  4511. // "required": true,
  4512. // "type": "string"
  4513. // }
  4514. // },
  4515. // "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose",
  4516. // "request": {
  4517. // "$ref": "DiagnoseClusterRequest"
  4518. // },
  4519. // "response": {
  4520. // "$ref": "Operation"
  4521. // },
  4522. // "scopes": [
  4523. // "https://www.googleapis.com/auth/cloud-platform"
  4524. // ]
  4525. // }
  4526. }
  4527. // method id "dataproc.projects.regions.clusters.get":
  4528. type ProjectsRegionsClustersGetCall struct {
  4529. s *Service
  4530. projectId string
  4531. region string
  4532. clusterName string
  4533. urlParams_ gensupport.URLParams
  4534. ifNoneMatch_ string
  4535. ctx_ context.Context
  4536. header_ http.Header
  4537. }
  4538. // Get: Gets the resource representation for a cluster in a project.
  4539. func (r *ProjectsRegionsClustersService) Get(projectId string, region string, clusterName string) *ProjectsRegionsClustersGetCall {
  4540. c := &ProjectsRegionsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4541. c.projectId = projectId
  4542. c.region = region
  4543. c.clusterName = clusterName
  4544. return c
  4545. }
  4546. // Fields allows partial responses to be retrieved. See
  4547. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4548. // for more information.
  4549. func (c *ProjectsRegionsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersGetCall {
  4550. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4551. return c
  4552. }
  4553. // IfNoneMatch sets the optional parameter which makes the operation
  4554. // fail if the object's ETag matches the given value. This is useful for
  4555. // getting updates only after the object has changed since the last
  4556. // request. Use googleapi.IsNotModified to check whether the response
  4557. // error from Do is the result of In-None-Match.
  4558. func (c *ProjectsRegionsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersGetCall {
  4559. c.ifNoneMatch_ = entityTag
  4560. return c
  4561. }
  4562. // Context sets the context to be used in this call's Do method. Any
  4563. // pending HTTP request will be aborted if the provided context is
  4564. // canceled.
  4565. func (c *ProjectsRegionsClustersGetCall) Context(ctx context.Context) *ProjectsRegionsClustersGetCall {
  4566. c.ctx_ = ctx
  4567. return c
  4568. }
  4569. // Header returns an http.Header that can be modified by the caller to
  4570. // add HTTP headers to the request.
  4571. func (c *ProjectsRegionsClustersGetCall) Header() http.Header {
  4572. if c.header_ == nil {
  4573. c.header_ = make(http.Header)
  4574. }
  4575. return c.header_
  4576. }
  4577. func (c *ProjectsRegionsClustersGetCall) doRequest(alt string) (*http.Response, error) {
  4578. reqHeaders := make(http.Header)
  4579. for k, v := range c.header_ {
  4580. reqHeaders[k] = v
  4581. }
  4582. reqHeaders.Set("User-Agent", c.s.userAgent())
  4583. if c.ifNoneMatch_ != "" {
  4584. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4585. }
  4586. var body io.Reader = nil
  4587. c.urlParams_.Set("alt", alt)
  4588. c.urlParams_.Set("prettyPrint", "false")
  4589. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}")
  4590. urls += "?" + c.urlParams_.Encode()
  4591. req, err := http.NewRequest("GET", urls, body)
  4592. if err != nil {
  4593. return nil, err
  4594. }
  4595. req.Header = reqHeaders
  4596. googleapi.Expand(req.URL, map[string]string{
  4597. "projectId": c.projectId,
  4598. "region": c.region,
  4599. "clusterName": c.clusterName,
  4600. })
  4601. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4602. }
  4603. // Do executes the "dataproc.projects.regions.clusters.get" call.
  4604. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  4605. // code is an error. Response headers are in either
  4606. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  4607. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4608. // check whether the returned error was because http.StatusNotModified
  4609. // was returned.
  4610. func (c *ProjectsRegionsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  4611. gensupport.SetOptions(c.urlParams_, opts...)
  4612. res, err := c.doRequest("json")
  4613. if res != nil && res.StatusCode == http.StatusNotModified {
  4614. if res.Body != nil {
  4615. res.Body.Close()
  4616. }
  4617. return nil, &googleapi.Error{
  4618. Code: res.StatusCode,
  4619. Header: res.Header,
  4620. }
  4621. }
  4622. if err != nil {
  4623. return nil, err
  4624. }
  4625. defer googleapi.CloseBody(res)
  4626. if err := googleapi.CheckResponse(res); err != nil {
  4627. return nil, err
  4628. }
  4629. ret := &Cluster{
  4630. ServerResponse: googleapi.ServerResponse{
  4631. Header: res.Header,
  4632. HTTPStatusCode: res.StatusCode,
  4633. },
  4634. }
  4635. target := &ret
  4636. if err := gensupport.DecodeResponse(target, res); err != nil {
  4637. return nil, err
  4638. }
  4639. return ret, nil
  4640. // {
  4641. // "description": "Gets the resource representation for a cluster in a project.",
  4642. // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  4643. // "httpMethod": "GET",
  4644. // "id": "dataproc.projects.regions.clusters.get",
  4645. // "parameterOrder": [
  4646. // "projectId",
  4647. // "region",
  4648. // "clusterName"
  4649. // ],
  4650. // "parameters": {
  4651. // "clusterName": {
  4652. // "description": "Required. The cluster name.",
  4653. // "location": "path",
  4654. // "required": true,
  4655. // "type": "string"
  4656. // },
  4657. // "projectId": {
  4658. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  4659. // "location": "path",
  4660. // "required": true,
  4661. // "type": "string"
  4662. // },
  4663. // "region": {
  4664. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  4665. // "location": "path",
  4666. // "required": true,
  4667. // "type": "string"
  4668. // }
  4669. // },
  4670. // "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  4671. // "response": {
  4672. // "$ref": "Cluster"
  4673. // },
  4674. // "scopes": [
  4675. // "https://www.googleapis.com/auth/cloud-platform"
  4676. // ]
  4677. // }
  4678. }
  4679. // method id "dataproc.projects.regions.clusters.getIamPolicy":
  4680. type ProjectsRegionsClustersGetIamPolicyCall struct {
  4681. s *Service
  4682. resource string
  4683. getiampolicyrequest *GetIamPolicyRequest
  4684. urlParams_ gensupport.URLParams
  4685. ctx_ context.Context
  4686. header_ http.Header
  4687. }
  4688. // GetIamPolicy: Gets the access control policy for a resource. Returns
  4689. // an empty policy if the resource exists and does not have a policy
  4690. // set.
  4691. func (r *ProjectsRegionsClustersService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsRegionsClustersGetIamPolicyCall {
  4692. c := &ProjectsRegionsClustersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4693. c.resource = resource
  4694. c.getiampolicyrequest = getiampolicyrequest
  4695. return c
  4696. }
  4697. // Fields allows partial responses to be retrieved. See
  4698. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4699. // for more information.
  4700. func (c *ProjectsRegionsClustersGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersGetIamPolicyCall {
  4701. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4702. return c
  4703. }
  4704. // Context sets the context to be used in this call's Do method. Any
  4705. // pending HTTP request will be aborted if the provided context is
  4706. // canceled.
  4707. func (c *ProjectsRegionsClustersGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsClustersGetIamPolicyCall {
  4708. c.ctx_ = ctx
  4709. return c
  4710. }
  4711. // Header returns an http.Header that can be modified by the caller to
  4712. // add HTTP headers to the request.
  4713. func (c *ProjectsRegionsClustersGetIamPolicyCall) Header() http.Header {
  4714. if c.header_ == nil {
  4715. c.header_ = make(http.Header)
  4716. }
  4717. return c.header_
  4718. }
  4719. func (c *ProjectsRegionsClustersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4720. reqHeaders := make(http.Header)
  4721. for k, v := range c.header_ {
  4722. reqHeaders[k] = v
  4723. }
  4724. reqHeaders.Set("User-Agent", c.s.userAgent())
  4725. var body io.Reader = nil
  4726. body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  4727. if err != nil {
  4728. return nil, err
  4729. }
  4730. reqHeaders.Set("Content-Type", "application/json")
  4731. c.urlParams_.Set("alt", alt)
  4732. c.urlParams_.Set("prettyPrint", "false")
  4733. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  4734. urls += "?" + c.urlParams_.Encode()
  4735. req, err := http.NewRequest("POST", urls, body)
  4736. if err != nil {
  4737. return nil, err
  4738. }
  4739. req.Header = reqHeaders
  4740. googleapi.Expand(req.URL, map[string]string{
  4741. "resource": c.resource,
  4742. })
  4743. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4744. }
  4745. // Do executes the "dataproc.projects.regions.clusters.getIamPolicy" call.
  4746. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  4747. // code is an error. Response headers are in either
  4748. // *Policy.ServerResponse.Header or (if a response was returned at all)
  4749. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4750. // check whether the returned error was because http.StatusNotModified
  4751. // was returned.
  4752. func (c *ProjectsRegionsClustersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4753. gensupport.SetOptions(c.urlParams_, opts...)
  4754. res, err := c.doRequest("json")
  4755. if res != nil && res.StatusCode == http.StatusNotModified {
  4756. if res.Body != nil {
  4757. res.Body.Close()
  4758. }
  4759. return nil, &googleapi.Error{
  4760. Code: res.StatusCode,
  4761. Header: res.Header,
  4762. }
  4763. }
  4764. if err != nil {
  4765. return nil, err
  4766. }
  4767. defer googleapi.CloseBody(res)
  4768. if err := googleapi.CheckResponse(res); err != nil {
  4769. return nil, err
  4770. }
  4771. ret := &Policy{
  4772. ServerResponse: googleapi.ServerResponse{
  4773. Header: res.Header,
  4774. HTTPStatusCode: res.StatusCode,
  4775. },
  4776. }
  4777. target := &ret
  4778. if err := gensupport.DecodeResponse(target, res); err != nil {
  4779. return nil, err
  4780. }
  4781. return ret, nil
  4782. // {
  4783. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  4784. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:getIamPolicy",
  4785. // "httpMethod": "POST",
  4786. // "id": "dataproc.projects.regions.clusters.getIamPolicy",
  4787. // "parameterOrder": [
  4788. // "resource"
  4789. // ],
  4790. // "parameters": {
  4791. // "resource": {
  4792. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  4793. // "location": "path",
  4794. // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$",
  4795. // "required": true,
  4796. // "type": "string"
  4797. // }
  4798. // },
  4799. // "path": "v1/{+resource}:getIamPolicy",
  4800. // "request": {
  4801. // "$ref": "GetIamPolicyRequest"
  4802. // },
  4803. // "response": {
  4804. // "$ref": "Policy"
  4805. // },
  4806. // "scopes": [
  4807. // "https://www.googleapis.com/auth/cloud-platform"
  4808. // ]
  4809. // }
  4810. }
  4811. // method id "dataproc.projects.regions.clusters.list":
  4812. type ProjectsRegionsClustersListCall struct {
  4813. s *Service
  4814. projectId string
  4815. region string
  4816. urlParams_ gensupport.URLParams
  4817. ifNoneMatch_ string
  4818. ctx_ context.Context
  4819. header_ http.Header
  4820. }
  4821. // List: Lists all regions/{region}/clusters in a project.
  4822. func (r *ProjectsRegionsClustersService) List(projectId string, region string) *ProjectsRegionsClustersListCall {
  4823. c := &ProjectsRegionsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4824. c.projectId = projectId
  4825. c.region = region
  4826. return c
  4827. }
  4828. // Filter sets the optional parameter "filter": A filter constraining
  4829. // the clusters to list. Filters are case-sensitive and have the
  4830. // following syntax:field = value AND field = value ...where field is
  4831. // one of status.state, clusterName, or labels.[KEY], and [KEY] is a
  4832. // label key. value can be * to match all values. status.state can be
  4833. // one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR,
  4834. // DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and
  4835. // RUNNING states. INACTIVE contains the DELETING and ERROR states.
  4836. // clusterName is the name of the cluster provided at creation time.
  4837. // Only the logical AND operator is supported; space-separated items are
  4838. // treated as having an implicit AND operator.Example
  4839. // filter:status.state = ACTIVE AND clusterName = mycluster AND
  4840. // labels.env = staging AND labels.starred = *
  4841. func (c *ProjectsRegionsClustersListCall) Filter(filter string) *ProjectsRegionsClustersListCall {
  4842. c.urlParams_.Set("filter", filter)
  4843. return c
  4844. }
  4845. // PageSize sets the optional parameter "pageSize": The standard List
  4846. // page size.
  4847. func (c *ProjectsRegionsClustersListCall) PageSize(pageSize int64) *ProjectsRegionsClustersListCall {
  4848. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4849. return c
  4850. }
  4851. // PageToken sets the optional parameter "pageToken": The standard List
  4852. // page token.
  4853. func (c *ProjectsRegionsClustersListCall) PageToken(pageToken string) *ProjectsRegionsClustersListCall {
  4854. c.urlParams_.Set("pageToken", pageToken)
  4855. return c
  4856. }
  4857. // Fields allows partial responses to be retrieved. See
  4858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4859. // for more information.
  4860. func (c *ProjectsRegionsClustersListCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersListCall {
  4861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4862. return c
  4863. }
  4864. // IfNoneMatch sets the optional parameter which makes the operation
  4865. // fail if the object's ETag matches the given value. This is useful for
  4866. // getting updates only after the object has changed since the last
  4867. // request. Use googleapi.IsNotModified to check whether the response
  4868. // error from Do is the result of In-None-Match.
  4869. func (c *ProjectsRegionsClustersListCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersListCall {
  4870. c.ifNoneMatch_ = entityTag
  4871. return c
  4872. }
  4873. // Context sets the context to be used in this call's Do method. Any
  4874. // pending HTTP request will be aborted if the provided context is
  4875. // canceled.
  4876. func (c *ProjectsRegionsClustersListCall) Context(ctx context.Context) *ProjectsRegionsClustersListCall {
  4877. c.ctx_ = ctx
  4878. return c
  4879. }
  4880. // Header returns an http.Header that can be modified by the caller to
  4881. // add HTTP headers to the request.
  4882. func (c *ProjectsRegionsClustersListCall) Header() http.Header {
  4883. if c.header_ == nil {
  4884. c.header_ = make(http.Header)
  4885. }
  4886. return c.header_
  4887. }
  4888. func (c *ProjectsRegionsClustersListCall) doRequest(alt string) (*http.Response, error) {
  4889. reqHeaders := make(http.Header)
  4890. for k, v := range c.header_ {
  4891. reqHeaders[k] = v
  4892. }
  4893. reqHeaders.Set("User-Agent", c.s.userAgent())
  4894. if c.ifNoneMatch_ != "" {
  4895. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4896. }
  4897. var body io.Reader = nil
  4898. c.urlParams_.Set("alt", alt)
  4899. c.urlParams_.Set("prettyPrint", "false")
  4900. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters")
  4901. urls += "?" + c.urlParams_.Encode()
  4902. req, err := http.NewRequest("GET", urls, body)
  4903. if err != nil {
  4904. return nil, err
  4905. }
  4906. req.Header = reqHeaders
  4907. googleapi.Expand(req.URL, map[string]string{
  4908. "projectId": c.projectId,
  4909. "region": c.region,
  4910. })
  4911. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4912. }
  4913. // Do executes the "dataproc.projects.regions.clusters.list" call.
  4914. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  4915. // non-2xx status code is an error. Response headers are in either
  4916. // *ListClustersResponse.ServerResponse.Header or (if a response was
  4917. // returned at all) in error.(*googleapi.Error).Header. Use
  4918. // googleapi.IsNotModified to check whether the returned error was
  4919. // because http.StatusNotModified was returned.
  4920. func (c *ProjectsRegionsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  4921. gensupport.SetOptions(c.urlParams_, opts...)
  4922. res, err := c.doRequest("json")
  4923. if res != nil && res.StatusCode == http.StatusNotModified {
  4924. if res.Body != nil {
  4925. res.Body.Close()
  4926. }
  4927. return nil, &googleapi.Error{
  4928. Code: res.StatusCode,
  4929. Header: res.Header,
  4930. }
  4931. }
  4932. if err != nil {
  4933. return nil, err
  4934. }
  4935. defer googleapi.CloseBody(res)
  4936. if err := googleapi.CheckResponse(res); err != nil {
  4937. return nil, err
  4938. }
  4939. ret := &ListClustersResponse{
  4940. ServerResponse: googleapi.ServerResponse{
  4941. Header: res.Header,
  4942. HTTPStatusCode: res.StatusCode,
  4943. },
  4944. }
  4945. target := &ret
  4946. if err := gensupport.DecodeResponse(target, res); err != nil {
  4947. return nil, err
  4948. }
  4949. return ret, nil
  4950. // {
  4951. // "description": "Lists all regions/{region}/clusters in a project.",
  4952. // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters",
  4953. // "httpMethod": "GET",
  4954. // "id": "dataproc.projects.regions.clusters.list",
  4955. // "parameterOrder": [
  4956. // "projectId",
  4957. // "region"
  4958. // ],
  4959. // "parameters": {
  4960. // "filter": {
  4961. // "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 = *",
  4962. // "location": "query",
  4963. // "type": "string"
  4964. // },
  4965. // "pageSize": {
  4966. // "description": "Optional. The standard List page size.",
  4967. // "format": "int32",
  4968. // "location": "query",
  4969. // "type": "integer"
  4970. // },
  4971. // "pageToken": {
  4972. // "description": "Optional. The standard List page token.",
  4973. // "location": "query",
  4974. // "type": "string"
  4975. // },
  4976. // "projectId": {
  4977. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  4978. // "location": "path",
  4979. // "required": true,
  4980. // "type": "string"
  4981. // },
  4982. // "region": {
  4983. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  4984. // "location": "path",
  4985. // "required": true,
  4986. // "type": "string"
  4987. // }
  4988. // },
  4989. // "path": "v1/projects/{projectId}/regions/{region}/clusters",
  4990. // "response": {
  4991. // "$ref": "ListClustersResponse"
  4992. // },
  4993. // "scopes": [
  4994. // "https://www.googleapis.com/auth/cloud-platform"
  4995. // ]
  4996. // }
  4997. }
  4998. // Pages invokes f for each page of results.
  4999. // A non-nil error returned from f will halt the iteration.
  5000. // The provided context supersedes any context provided to the Context method.
  5001. func (c *ProjectsRegionsClustersListCall) Pages(ctx context.Context, f func(*ListClustersResponse) error) error {
  5002. c.ctx_ = ctx
  5003. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  5004. for {
  5005. x, err := c.Do()
  5006. if err != nil {
  5007. return err
  5008. }
  5009. if err := f(x); err != nil {
  5010. return err
  5011. }
  5012. if x.NextPageToken == "" {
  5013. return nil
  5014. }
  5015. c.PageToken(x.NextPageToken)
  5016. }
  5017. }
  5018. // method id "dataproc.projects.regions.clusters.patch":
  5019. type ProjectsRegionsClustersPatchCall struct {
  5020. s *Service
  5021. projectId string
  5022. region string
  5023. clusterName string
  5024. cluster *Cluster
  5025. urlParams_ gensupport.URLParams
  5026. ctx_ context.Context
  5027. header_ http.Header
  5028. }
  5029. // Patch: Updates a cluster in a project.
  5030. func (r *ProjectsRegionsClustersService) Patch(projectId string, region string, clusterName string, cluster *Cluster) *ProjectsRegionsClustersPatchCall {
  5031. c := &ProjectsRegionsClustersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5032. c.projectId = projectId
  5033. c.region = region
  5034. c.clusterName = clusterName
  5035. c.cluster = cluster
  5036. return c
  5037. }
  5038. // GracefulDecommissionTimeout sets the optional parameter
  5039. // "gracefulDecommissionTimeout": Timeout for graceful YARN
  5040. // decomissioning. Graceful decommissioning allows removing nodes from
  5041. // the cluster without interrupting jobs in progress. Timeout specifies
  5042. // how long to wait for jobs in progress to finish before forcefully
  5043. // removing nodes (and potentially interrupting jobs). Default timeout
  5044. // is 0 (for forceful decommission), and the maximum allowed timeout is
  5045. // 1 day.Only supported on Dataproc image versions 1.2 and higher.
  5046. func (c *ProjectsRegionsClustersPatchCall) GracefulDecommissionTimeout(gracefulDecommissionTimeout string) *ProjectsRegionsClustersPatchCall {
  5047. c.urlParams_.Set("gracefulDecommissionTimeout", gracefulDecommissionTimeout)
  5048. return c
  5049. }
  5050. // RequestId sets the optional parameter "requestId": A unique id used
  5051. // to identify the request. If the server receives two
  5052. // UpdateClusterRequest requests with the same id, then the second
  5053. // request will be ignored and the first google.longrunning.Operation
  5054. // created and stored in the backend is returned.It is recommended to
  5055. // always set this value to a UUID
  5056. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id
  5057. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  5058. // and hyphens (-). The maximum length is 40 characters.
  5059. func (c *ProjectsRegionsClustersPatchCall) RequestId(requestId string) *ProjectsRegionsClustersPatchCall {
  5060. c.urlParams_.Set("requestId", requestId)
  5061. return c
  5062. }
  5063. // UpdateMask sets the optional parameter "updateMask": Required.
  5064. // Specifies the path, relative to Cluster, of the field to update. For
  5065. // example, to change the number of workers in a cluster to 5, the
  5066. // update_mask parameter would be specified as
  5067. // config.worker_config.num_instances, and the PATCH request body would
  5068. // specify the new value, as follows:
  5069. // {
  5070. // "config":{
  5071. // "workerConfig":{
  5072. // "numInstances":"5"
  5073. // }
  5074. // }
  5075. // }
  5076. // Similarly, to change the number of preemptible workers in a cluster
  5077. // to 5, the update_mask parameter would be
  5078. // config.secondary_worker_config.num_instances, and the PATCH request
  5079. // body would be set as follows:
  5080. // {
  5081. // "config":{
  5082. // "secondaryWorkerConfig":{
  5083. // "numInstances":"5"
  5084. // }
  5085. // }
  5086. // }
  5087. // <strong>Note:</strong> Currently, only the following fields can be
  5088. // updated:<table> <tbody> <tr> <td><strong>Mask</strong></td>
  5089. // <td><strong>Purpose</strong></td> </tr> <tr>
  5090. // <td><strong><em>labels</em></strong></td> <td>Update labels</td>
  5091. // </tr> <tr>
  5092. // <td><strong><em>config.worker_config.num_instances</em></strong></td>
  5093. // <td>Resize primary worker group</td> </tr> <tr>
  5094. // <td><strong><em>config.secondary_worker_config.num_instances</em></str
  5095. // ong></td> <td>Resize secondary worker group</td> </tr> </tbody>
  5096. // </table>
  5097. func (c *ProjectsRegionsClustersPatchCall) UpdateMask(updateMask string) *ProjectsRegionsClustersPatchCall {
  5098. c.urlParams_.Set("updateMask", updateMask)
  5099. return c
  5100. }
  5101. // Fields allows partial responses to be retrieved. See
  5102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5103. // for more information.
  5104. func (c *ProjectsRegionsClustersPatchCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersPatchCall {
  5105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5106. return c
  5107. }
  5108. // Context sets the context to be used in this call's Do method. Any
  5109. // pending HTTP request will be aborted if the provided context is
  5110. // canceled.
  5111. func (c *ProjectsRegionsClustersPatchCall) Context(ctx context.Context) *ProjectsRegionsClustersPatchCall {
  5112. c.ctx_ = ctx
  5113. return c
  5114. }
  5115. // Header returns an http.Header that can be modified by the caller to
  5116. // add HTTP headers to the request.
  5117. func (c *ProjectsRegionsClustersPatchCall) Header() http.Header {
  5118. if c.header_ == nil {
  5119. c.header_ = make(http.Header)
  5120. }
  5121. return c.header_
  5122. }
  5123. func (c *ProjectsRegionsClustersPatchCall) doRequest(alt string) (*http.Response, error) {
  5124. reqHeaders := make(http.Header)
  5125. for k, v := range c.header_ {
  5126. reqHeaders[k] = v
  5127. }
  5128. reqHeaders.Set("User-Agent", c.s.userAgent())
  5129. var body io.Reader = nil
  5130. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster)
  5131. if err != nil {
  5132. return nil, err
  5133. }
  5134. reqHeaders.Set("Content-Type", "application/json")
  5135. c.urlParams_.Set("alt", alt)
  5136. c.urlParams_.Set("prettyPrint", "false")
  5137. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}")
  5138. urls += "?" + c.urlParams_.Encode()
  5139. req, err := http.NewRequest("PATCH", urls, body)
  5140. if err != nil {
  5141. return nil, err
  5142. }
  5143. req.Header = reqHeaders
  5144. googleapi.Expand(req.URL, map[string]string{
  5145. "projectId": c.projectId,
  5146. "region": c.region,
  5147. "clusterName": c.clusterName,
  5148. })
  5149. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5150. }
  5151. // Do executes the "dataproc.projects.regions.clusters.patch" call.
  5152. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5153. // status code is an error. Response headers are in either
  5154. // *Operation.ServerResponse.Header or (if a response was returned at
  5155. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5156. // to check whether the returned error was because
  5157. // http.StatusNotModified was returned.
  5158. func (c *ProjectsRegionsClustersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5159. gensupport.SetOptions(c.urlParams_, opts...)
  5160. res, err := c.doRequest("json")
  5161. if res != nil && res.StatusCode == http.StatusNotModified {
  5162. if res.Body != nil {
  5163. res.Body.Close()
  5164. }
  5165. return nil, &googleapi.Error{
  5166. Code: res.StatusCode,
  5167. Header: res.Header,
  5168. }
  5169. }
  5170. if err != nil {
  5171. return nil, err
  5172. }
  5173. defer googleapi.CloseBody(res)
  5174. if err := googleapi.CheckResponse(res); err != nil {
  5175. return nil, err
  5176. }
  5177. ret := &Operation{
  5178. ServerResponse: googleapi.ServerResponse{
  5179. Header: res.Header,
  5180. HTTPStatusCode: res.StatusCode,
  5181. },
  5182. }
  5183. target := &ret
  5184. if err := gensupport.DecodeResponse(target, res); err != nil {
  5185. return nil, err
  5186. }
  5187. return ret, nil
  5188. // {
  5189. // "description": "Updates a cluster in a project.",
  5190. // "flatPath": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  5191. // "httpMethod": "PATCH",
  5192. // "id": "dataproc.projects.regions.clusters.patch",
  5193. // "parameterOrder": [
  5194. // "projectId",
  5195. // "region",
  5196. // "clusterName"
  5197. // ],
  5198. // "parameters": {
  5199. // "clusterName": {
  5200. // "description": "Required. The cluster name.",
  5201. // "location": "path",
  5202. // "required": true,
  5203. // "type": "string"
  5204. // },
  5205. // "gracefulDecommissionTimeout": {
  5206. // "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.",
  5207. // "format": "google-duration",
  5208. // "location": "query",
  5209. // "type": "string"
  5210. // },
  5211. // "projectId": {
  5212. // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.",
  5213. // "location": "path",
  5214. // "required": true,
  5215. // "type": "string"
  5216. // },
  5217. // "region": {
  5218. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  5219. // "location": "path",
  5220. // "required": true,
  5221. // "type": "string"
  5222. // },
  5223. // "requestId": {
  5224. // "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.",
  5225. // "location": "query",
  5226. // "type": "string"
  5227. // },
  5228. // "updateMask": {
  5229. // "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:\u003ctable\u003e \u003ctbody\u003e \u003ctr\u003e \u003ctd\u003e\u003cstrong\u003eMask\u003c/strong\u003e\u003c/td\u003e \u003ctd\u003e\u003cstrong\u003ePurpose\u003c/strong\u003e\u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e\u003cstrong\u003e\u003cem\u003elabels\u003c/em\u003e\u003c/strong\u003e\u003c/td\u003e \u003ctd\u003eUpdate labels\u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e\u003cstrong\u003e\u003cem\u003econfig.worker_config.num_instances\u003c/em\u003e\u003c/strong\u003e\u003c/td\u003e \u003ctd\u003eResize primary worker group\u003c/td\u003e \u003c/tr\u003e \u003ctr\u003e \u003ctd\u003e\u003cstrong\u003e\u003cem\u003econfig.secondary_worker_config.num_instances\u003c/em\u003e\u003c/strong\u003e\u003c/td\u003e \u003ctd\u003eResize secondary worker group\u003c/td\u003e \u003c/tr\u003e \u003c/tbody\u003e \u003c/table\u003e",
  5230. // "format": "google-fieldmask",
  5231. // "location": "query",
  5232. // "type": "string"
  5233. // }
  5234. // },
  5235. // "path": "v1/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  5236. // "request": {
  5237. // "$ref": "Cluster"
  5238. // },
  5239. // "response": {
  5240. // "$ref": "Operation"
  5241. // },
  5242. // "scopes": [
  5243. // "https://www.googleapis.com/auth/cloud-platform"
  5244. // ]
  5245. // }
  5246. }
  5247. // method id "dataproc.projects.regions.clusters.setIamPolicy":
  5248. type ProjectsRegionsClustersSetIamPolicyCall struct {
  5249. s *Service
  5250. resource string
  5251. setiampolicyrequest *SetIamPolicyRequest
  5252. urlParams_ gensupport.URLParams
  5253. ctx_ context.Context
  5254. header_ http.Header
  5255. }
  5256. // SetIamPolicy: Sets the access control policy on the specified
  5257. // resource. Replaces any existing policy.
  5258. func (r *ProjectsRegionsClustersService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsClustersSetIamPolicyCall {
  5259. c := &ProjectsRegionsClustersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5260. c.resource = resource
  5261. c.setiampolicyrequest = setiampolicyrequest
  5262. return c
  5263. }
  5264. // Fields allows partial responses to be retrieved. See
  5265. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5266. // for more information.
  5267. func (c *ProjectsRegionsClustersSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersSetIamPolicyCall {
  5268. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5269. return c
  5270. }
  5271. // Context sets the context to be used in this call's Do method. Any
  5272. // pending HTTP request will be aborted if the provided context is
  5273. // canceled.
  5274. func (c *ProjectsRegionsClustersSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsClustersSetIamPolicyCall {
  5275. c.ctx_ = ctx
  5276. return c
  5277. }
  5278. // Header returns an http.Header that can be modified by the caller to
  5279. // add HTTP headers to the request.
  5280. func (c *ProjectsRegionsClustersSetIamPolicyCall) Header() http.Header {
  5281. if c.header_ == nil {
  5282. c.header_ = make(http.Header)
  5283. }
  5284. return c.header_
  5285. }
  5286. func (c *ProjectsRegionsClustersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  5287. reqHeaders := make(http.Header)
  5288. for k, v := range c.header_ {
  5289. reqHeaders[k] = v
  5290. }
  5291. reqHeaders.Set("User-Agent", c.s.userAgent())
  5292. var body io.Reader = nil
  5293. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  5294. if err != nil {
  5295. return nil, err
  5296. }
  5297. reqHeaders.Set("Content-Type", "application/json")
  5298. c.urlParams_.Set("alt", alt)
  5299. c.urlParams_.Set("prettyPrint", "false")
  5300. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  5301. urls += "?" + c.urlParams_.Encode()
  5302. req, err := http.NewRequest("POST", urls, body)
  5303. if err != nil {
  5304. return nil, err
  5305. }
  5306. req.Header = reqHeaders
  5307. googleapi.Expand(req.URL, map[string]string{
  5308. "resource": c.resource,
  5309. })
  5310. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5311. }
  5312. // Do executes the "dataproc.projects.regions.clusters.setIamPolicy" call.
  5313. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  5314. // code is an error. Response headers are in either
  5315. // *Policy.ServerResponse.Header or (if a response was returned at all)
  5316. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5317. // check whether the returned error was because http.StatusNotModified
  5318. // was returned.
  5319. func (c *ProjectsRegionsClustersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  5320. gensupport.SetOptions(c.urlParams_, opts...)
  5321. res, err := c.doRequest("json")
  5322. if res != nil && res.StatusCode == http.StatusNotModified {
  5323. if res.Body != nil {
  5324. res.Body.Close()
  5325. }
  5326. return nil, &googleapi.Error{
  5327. Code: res.StatusCode,
  5328. Header: res.Header,
  5329. }
  5330. }
  5331. if err != nil {
  5332. return nil, err
  5333. }
  5334. defer googleapi.CloseBody(res)
  5335. if err := googleapi.CheckResponse(res); err != nil {
  5336. return nil, err
  5337. }
  5338. ret := &Policy{
  5339. ServerResponse: googleapi.ServerResponse{
  5340. Header: res.Header,
  5341. HTTPStatusCode: res.StatusCode,
  5342. },
  5343. }
  5344. target := &ret
  5345. if err := gensupport.DecodeResponse(target, res); err != nil {
  5346. return nil, err
  5347. }
  5348. return ret, nil
  5349. // {
  5350. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  5351. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:setIamPolicy",
  5352. // "httpMethod": "POST",
  5353. // "id": "dataproc.projects.regions.clusters.setIamPolicy",
  5354. // "parameterOrder": [
  5355. // "resource"
  5356. // ],
  5357. // "parameters": {
  5358. // "resource": {
  5359. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  5360. // "location": "path",
  5361. // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$",
  5362. // "required": true,
  5363. // "type": "string"
  5364. // }
  5365. // },
  5366. // "path": "v1/{+resource}:setIamPolicy",
  5367. // "request": {
  5368. // "$ref": "SetIamPolicyRequest"
  5369. // },
  5370. // "response": {
  5371. // "$ref": "Policy"
  5372. // },
  5373. // "scopes": [
  5374. // "https://www.googleapis.com/auth/cloud-platform"
  5375. // ]
  5376. // }
  5377. }
  5378. // method id "dataproc.projects.regions.clusters.testIamPermissions":
  5379. type ProjectsRegionsClustersTestIamPermissionsCall struct {
  5380. s *Service
  5381. resource string
  5382. testiampermissionsrequest *TestIamPermissionsRequest
  5383. urlParams_ gensupport.URLParams
  5384. ctx_ context.Context
  5385. header_ http.Header
  5386. }
  5387. // TestIamPermissions: Returns permissions that a caller has on the
  5388. // specified resource. If the resource does not exist, this will return
  5389. // an empty set of permissions, not a NOT_FOUND error.Note: This
  5390. // operation is designed to be used for building permission-aware UIs
  5391. // and command-line tools, not for authorization checking. This
  5392. // operation may "fail open" without warning.
  5393. func (r *ProjectsRegionsClustersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsClustersTestIamPermissionsCall {
  5394. c := &ProjectsRegionsClustersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5395. c.resource = resource
  5396. c.testiampermissionsrequest = testiampermissionsrequest
  5397. return c
  5398. }
  5399. // Fields allows partial responses to be retrieved. See
  5400. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5401. // for more information.
  5402. func (c *ProjectsRegionsClustersTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersTestIamPermissionsCall {
  5403. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5404. return c
  5405. }
  5406. // Context sets the context to be used in this call's Do method. Any
  5407. // pending HTTP request will be aborted if the provided context is
  5408. // canceled.
  5409. func (c *ProjectsRegionsClustersTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsClustersTestIamPermissionsCall {
  5410. c.ctx_ = ctx
  5411. return c
  5412. }
  5413. // Header returns an http.Header that can be modified by the caller to
  5414. // add HTTP headers to the request.
  5415. func (c *ProjectsRegionsClustersTestIamPermissionsCall) Header() http.Header {
  5416. if c.header_ == nil {
  5417. c.header_ = make(http.Header)
  5418. }
  5419. return c.header_
  5420. }
  5421. func (c *ProjectsRegionsClustersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  5422. reqHeaders := make(http.Header)
  5423. for k, v := range c.header_ {
  5424. reqHeaders[k] = v
  5425. }
  5426. reqHeaders.Set("User-Agent", c.s.userAgent())
  5427. var body io.Reader = nil
  5428. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  5429. if err != nil {
  5430. return nil, err
  5431. }
  5432. reqHeaders.Set("Content-Type", "application/json")
  5433. c.urlParams_.Set("alt", alt)
  5434. c.urlParams_.Set("prettyPrint", "false")
  5435. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  5436. urls += "?" + c.urlParams_.Encode()
  5437. req, err := http.NewRequest("POST", urls, body)
  5438. if err != nil {
  5439. return nil, err
  5440. }
  5441. req.Header = reqHeaders
  5442. googleapi.Expand(req.URL, map[string]string{
  5443. "resource": c.resource,
  5444. })
  5445. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5446. }
  5447. // Do executes the "dataproc.projects.regions.clusters.testIamPermissions" call.
  5448. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  5449. // Any non-2xx status code is an error. Response headers are in either
  5450. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  5451. // was returned at all) in error.(*googleapi.Error).Header. Use
  5452. // googleapi.IsNotModified to check whether the returned error was
  5453. // because http.StatusNotModified was returned.
  5454. func (c *ProjectsRegionsClustersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  5455. gensupport.SetOptions(c.urlParams_, opts...)
  5456. res, err := c.doRequest("json")
  5457. if res != nil && res.StatusCode == http.StatusNotModified {
  5458. if res.Body != nil {
  5459. res.Body.Close()
  5460. }
  5461. return nil, &googleapi.Error{
  5462. Code: res.StatusCode,
  5463. Header: res.Header,
  5464. }
  5465. }
  5466. if err != nil {
  5467. return nil, err
  5468. }
  5469. defer googleapi.CloseBody(res)
  5470. if err := googleapi.CheckResponse(res); err != nil {
  5471. return nil, err
  5472. }
  5473. ret := &TestIamPermissionsResponse{
  5474. ServerResponse: googleapi.ServerResponse{
  5475. Header: res.Header,
  5476. HTTPStatusCode: res.StatusCode,
  5477. },
  5478. }
  5479. target := &ret
  5480. if err := gensupport.DecodeResponse(target, res); err != nil {
  5481. return nil, err
  5482. }
  5483. return ret, nil
  5484. // {
  5485. // "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.",
  5486. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:testIamPermissions",
  5487. // "httpMethod": "POST",
  5488. // "id": "dataproc.projects.regions.clusters.testIamPermissions",
  5489. // "parameterOrder": [
  5490. // "resource"
  5491. // ],
  5492. // "parameters": {
  5493. // "resource": {
  5494. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  5495. // "location": "path",
  5496. // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$",
  5497. // "required": true,
  5498. // "type": "string"
  5499. // }
  5500. // },
  5501. // "path": "v1/{+resource}:testIamPermissions",
  5502. // "request": {
  5503. // "$ref": "TestIamPermissionsRequest"
  5504. // },
  5505. // "response": {
  5506. // "$ref": "TestIamPermissionsResponse"
  5507. // },
  5508. // "scopes": [
  5509. // "https://www.googleapis.com/auth/cloud-platform"
  5510. // ]
  5511. // }
  5512. }
  5513. // method id "dataproc.projects.regions.jobs.cancel":
  5514. type ProjectsRegionsJobsCancelCall struct {
  5515. s *Service
  5516. projectId string
  5517. region string
  5518. jobId string
  5519. canceljobrequest *CancelJobRequest
  5520. urlParams_ gensupport.URLParams
  5521. ctx_ context.Context
  5522. header_ http.Header
  5523. }
  5524. // Cancel: Starts a job cancellation request. To access the job resource
  5525. // after cancellation, call regions/{region}/jobs.list or
  5526. // regions/{region}/jobs.get.
  5527. func (r *ProjectsRegionsJobsService) Cancel(projectId string, region string, jobId string, canceljobrequest *CancelJobRequest) *ProjectsRegionsJobsCancelCall {
  5528. c := &ProjectsRegionsJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5529. c.projectId = projectId
  5530. c.region = region
  5531. c.jobId = jobId
  5532. c.canceljobrequest = canceljobrequest
  5533. return c
  5534. }
  5535. // Fields allows partial responses to be retrieved. See
  5536. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5537. // for more information.
  5538. func (c *ProjectsRegionsJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsCancelCall {
  5539. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5540. return c
  5541. }
  5542. // Context sets the context to be used in this call's Do method. Any
  5543. // pending HTTP request will be aborted if the provided context is
  5544. // canceled.
  5545. func (c *ProjectsRegionsJobsCancelCall) Context(ctx context.Context) *ProjectsRegionsJobsCancelCall {
  5546. c.ctx_ = ctx
  5547. return c
  5548. }
  5549. // Header returns an http.Header that can be modified by the caller to
  5550. // add HTTP headers to the request.
  5551. func (c *ProjectsRegionsJobsCancelCall) Header() http.Header {
  5552. if c.header_ == nil {
  5553. c.header_ = make(http.Header)
  5554. }
  5555. return c.header_
  5556. }
  5557. func (c *ProjectsRegionsJobsCancelCall) doRequest(alt string) (*http.Response, error) {
  5558. reqHeaders := make(http.Header)
  5559. for k, v := range c.header_ {
  5560. reqHeaders[k] = v
  5561. }
  5562. reqHeaders.Set("User-Agent", c.s.userAgent())
  5563. var body io.Reader = nil
  5564. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceljobrequest)
  5565. if err != nil {
  5566. return nil, err
  5567. }
  5568. reqHeaders.Set("Content-Type", "application/json")
  5569. c.urlParams_.Set("alt", alt)
  5570. c.urlParams_.Set("prettyPrint", "false")
  5571. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel")
  5572. urls += "?" + c.urlParams_.Encode()
  5573. req, err := http.NewRequest("POST", urls, body)
  5574. if err != nil {
  5575. return nil, err
  5576. }
  5577. req.Header = reqHeaders
  5578. googleapi.Expand(req.URL, map[string]string{
  5579. "projectId": c.projectId,
  5580. "region": c.region,
  5581. "jobId": c.jobId,
  5582. })
  5583. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5584. }
  5585. // Do executes the "dataproc.projects.regions.jobs.cancel" call.
  5586. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  5587. // is an error. Response headers are in either
  5588. // *Job.ServerResponse.Header or (if a response was returned at all) in
  5589. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5590. // whether the returned error was because http.StatusNotModified was
  5591. // returned.
  5592. func (c *ProjectsRegionsJobsCancelCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  5593. gensupport.SetOptions(c.urlParams_, opts...)
  5594. res, err := c.doRequest("json")
  5595. if res != nil && res.StatusCode == http.StatusNotModified {
  5596. if res.Body != nil {
  5597. res.Body.Close()
  5598. }
  5599. return nil, &googleapi.Error{
  5600. Code: res.StatusCode,
  5601. Header: res.Header,
  5602. }
  5603. }
  5604. if err != nil {
  5605. return nil, err
  5606. }
  5607. defer googleapi.CloseBody(res)
  5608. if err := googleapi.CheckResponse(res); err != nil {
  5609. return nil, err
  5610. }
  5611. ret := &Job{
  5612. ServerResponse: googleapi.ServerResponse{
  5613. Header: res.Header,
  5614. HTTPStatusCode: res.StatusCode,
  5615. },
  5616. }
  5617. target := &ret
  5618. if err := gensupport.DecodeResponse(target, res); err != nil {
  5619. return nil, err
  5620. }
  5621. return ret, nil
  5622. // {
  5623. // "description": "Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get.",
  5624. // "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel",
  5625. // "httpMethod": "POST",
  5626. // "id": "dataproc.projects.regions.jobs.cancel",
  5627. // "parameterOrder": [
  5628. // "projectId",
  5629. // "region",
  5630. // "jobId"
  5631. // ],
  5632. // "parameters": {
  5633. // "jobId": {
  5634. // "description": "Required. The job ID.",
  5635. // "location": "path",
  5636. // "required": true,
  5637. // "type": "string"
  5638. // },
  5639. // "projectId": {
  5640. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  5641. // "location": "path",
  5642. // "required": true,
  5643. // "type": "string"
  5644. // },
  5645. // "region": {
  5646. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  5647. // "location": "path",
  5648. // "required": true,
  5649. // "type": "string"
  5650. // }
  5651. // },
  5652. // "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel",
  5653. // "request": {
  5654. // "$ref": "CancelJobRequest"
  5655. // },
  5656. // "response": {
  5657. // "$ref": "Job"
  5658. // },
  5659. // "scopes": [
  5660. // "https://www.googleapis.com/auth/cloud-platform"
  5661. // ]
  5662. // }
  5663. }
  5664. // method id "dataproc.projects.regions.jobs.delete":
  5665. type ProjectsRegionsJobsDeleteCall struct {
  5666. s *Service
  5667. projectId string
  5668. region string
  5669. jobId string
  5670. urlParams_ gensupport.URLParams
  5671. ctx_ context.Context
  5672. header_ http.Header
  5673. }
  5674. // Delete: Deletes the job from the project. If the job is active, the
  5675. // delete fails, and the response returns FAILED_PRECONDITION.
  5676. func (r *ProjectsRegionsJobsService) Delete(projectId string, region string, jobId string) *ProjectsRegionsJobsDeleteCall {
  5677. c := &ProjectsRegionsJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5678. c.projectId = projectId
  5679. c.region = region
  5680. c.jobId = jobId
  5681. return c
  5682. }
  5683. // Fields allows partial responses to be retrieved. See
  5684. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5685. // for more information.
  5686. func (c *ProjectsRegionsJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsDeleteCall {
  5687. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5688. return c
  5689. }
  5690. // Context sets the context to be used in this call's Do method. Any
  5691. // pending HTTP request will be aborted if the provided context is
  5692. // canceled.
  5693. func (c *ProjectsRegionsJobsDeleteCall) Context(ctx context.Context) *ProjectsRegionsJobsDeleteCall {
  5694. c.ctx_ = ctx
  5695. return c
  5696. }
  5697. // Header returns an http.Header that can be modified by the caller to
  5698. // add HTTP headers to the request.
  5699. func (c *ProjectsRegionsJobsDeleteCall) Header() http.Header {
  5700. if c.header_ == nil {
  5701. c.header_ = make(http.Header)
  5702. }
  5703. return c.header_
  5704. }
  5705. func (c *ProjectsRegionsJobsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5706. reqHeaders := make(http.Header)
  5707. for k, v := range c.header_ {
  5708. reqHeaders[k] = v
  5709. }
  5710. reqHeaders.Set("User-Agent", c.s.userAgent())
  5711. var body io.Reader = nil
  5712. c.urlParams_.Set("alt", alt)
  5713. c.urlParams_.Set("prettyPrint", "false")
  5714. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs/{jobId}")
  5715. urls += "?" + c.urlParams_.Encode()
  5716. req, err := http.NewRequest("DELETE", urls, body)
  5717. if err != nil {
  5718. return nil, err
  5719. }
  5720. req.Header = reqHeaders
  5721. googleapi.Expand(req.URL, map[string]string{
  5722. "projectId": c.projectId,
  5723. "region": c.region,
  5724. "jobId": c.jobId,
  5725. })
  5726. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5727. }
  5728. // Do executes the "dataproc.projects.regions.jobs.delete" call.
  5729. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  5730. // code is an error. Response headers are in either
  5731. // *Empty.ServerResponse.Header or (if a response was returned at all)
  5732. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5733. // check whether the returned error was because http.StatusNotModified
  5734. // was returned.
  5735. func (c *ProjectsRegionsJobsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  5736. gensupport.SetOptions(c.urlParams_, opts...)
  5737. res, err := c.doRequest("json")
  5738. if res != nil && res.StatusCode == http.StatusNotModified {
  5739. if res.Body != nil {
  5740. res.Body.Close()
  5741. }
  5742. return nil, &googleapi.Error{
  5743. Code: res.StatusCode,
  5744. Header: res.Header,
  5745. }
  5746. }
  5747. if err != nil {
  5748. return nil, err
  5749. }
  5750. defer googleapi.CloseBody(res)
  5751. if err := googleapi.CheckResponse(res); err != nil {
  5752. return nil, err
  5753. }
  5754. ret := &Empty{
  5755. ServerResponse: googleapi.ServerResponse{
  5756. Header: res.Header,
  5757. HTTPStatusCode: res.StatusCode,
  5758. },
  5759. }
  5760. target := &ret
  5761. if err := gensupport.DecodeResponse(target, res); err != nil {
  5762. return nil, err
  5763. }
  5764. return ret, nil
  5765. // {
  5766. // "description": "Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.",
  5767. // "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}",
  5768. // "httpMethod": "DELETE",
  5769. // "id": "dataproc.projects.regions.jobs.delete",
  5770. // "parameterOrder": [
  5771. // "projectId",
  5772. // "region",
  5773. // "jobId"
  5774. // ],
  5775. // "parameters": {
  5776. // "jobId": {
  5777. // "description": "Required. The job ID.",
  5778. // "location": "path",
  5779. // "required": true,
  5780. // "type": "string"
  5781. // },
  5782. // "projectId": {
  5783. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  5784. // "location": "path",
  5785. // "required": true,
  5786. // "type": "string"
  5787. // },
  5788. // "region": {
  5789. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  5790. // "location": "path",
  5791. // "required": true,
  5792. // "type": "string"
  5793. // }
  5794. // },
  5795. // "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}",
  5796. // "response": {
  5797. // "$ref": "Empty"
  5798. // },
  5799. // "scopes": [
  5800. // "https://www.googleapis.com/auth/cloud-platform"
  5801. // ]
  5802. // }
  5803. }
  5804. // method id "dataproc.projects.regions.jobs.get":
  5805. type ProjectsRegionsJobsGetCall struct {
  5806. s *Service
  5807. projectId string
  5808. region string
  5809. jobId string
  5810. urlParams_ gensupport.URLParams
  5811. ifNoneMatch_ string
  5812. ctx_ context.Context
  5813. header_ http.Header
  5814. }
  5815. // Get: Gets the resource representation for a job in a project.
  5816. func (r *ProjectsRegionsJobsService) Get(projectId string, region string, jobId string) *ProjectsRegionsJobsGetCall {
  5817. c := &ProjectsRegionsJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5818. c.projectId = projectId
  5819. c.region = region
  5820. c.jobId = jobId
  5821. return c
  5822. }
  5823. // Fields allows partial responses to be retrieved. See
  5824. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5825. // for more information.
  5826. func (c *ProjectsRegionsJobsGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsGetCall {
  5827. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5828. return c
  5829. }
  5830. // IfNoneMatch sets the optional parameter which makes the operation
  5831. // fail if the object's ETag matches the given value. This is useful for
  5832. // getting updates only after the object has changed since the last
  5833. // request. Use googleapi.IsNotModified to check whether the response
  5834. // error from Do is the result of In-None-Match.
  5835. func (c *ProjectsRegionsJobsGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsGetCall {
  5836. c.ifNoneMatch_ = entityTag
  5837. return c
  5838. }
  5839. // Context sets the context to be used in this call's Do method. Any
  5840. // pending HTTP request will be aborted if the provided context is
  5841. // canceled.
  5842. func (c *ProjectsRegionsJobsGetCall) Context(ctx context.Context) *ProjectsRegionsJobsGetCall {
  5843. c.ctx_ = ctx
  5844. return c
  5845. }
  5846. // Header returns an http.Header that can be modified by the caller to
  5847. // add HTTP headers to the request.
  5848. func (c *ProjectsRegionsJobsGetCall) Header() http.Header {
  5849. if c.header_ == nil {
  5850. c.header_ = make(http.Header)
  5851. }
  5852. return c.header_
  5853. }
  5854. func (c *ProjectsRegionsJobsGetCall) doRequest(alt string) (*http.Response, error) {
  5855. reqHeaders := make(http.Header)
  5856. for k, v := range c.header_ {
  5857. reqHeaders[k] = v
  5858. }
  5859. reqHeaders.Set("User-Agent", c.s.userAgent())
  5860. if c.ifNoneMatch_ != "" {
  5861. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5862. }
  5863. var body io.Reader = nil
  5864. c.urlParams_.Set("alt", alt)
  5865. c.urlParams_.Set("prettyPrint", "false")
  5866. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs/{jobId}")
  5867. urls += "?" + c.urlParams_.Encode()
  5868. req, err := http.NewRequest("GET", urls, body)
  5869. if err != nil {
  5870. return nil, err
  5871. }
  5872. req.Header = reqHeaders
  5873. googleapi.Expand(req.URL, map[string]string{
  5874. "projectId": c.projectId,
  5875. "region": c.region,
  5876. "jobId": c.jobId,
  5877. })
  5878. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5879. }
  5880. // Do executes the "dataproc.projects.regions.jobs.get" call.
  5881. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  5882. // is an error. Response headers are in either
  5883. // *Job.ServerResponse.Header or (if a response was returned at all) in
  5884. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5885. // whether the returned error was because http.StatusNotModified was
  5886. // returned.
  5887. func (c *ProjectsRegionsJobsGetCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  5888. gensupport.SetOptions(c.urlParams_, opts...)
  5889. res, err := c.doRequest("json")
  5890. if res != nil && res.StatusCode == http.StatusNotModified {
  5891. if res.Body != nil {
  5892. res.Body.Close()
  5893. }
  5894. return nil, &googleapi.Error{
  5895. Code: res.StatusCode,
  5896. Header: res.Header,
  5897. }
  5898. }
  5899. if err != nil {
  5900. return nil, err
  5901. }
  5902. defer googleapi.CloseBody(res)
  5903. if err := googleapi.CheckResponse(res); err != nil {
  5904. return nil, err
  5905. }
  5906. ret := &Job{
  5907. ServerResponse: googleapi.ServerResponse{
  5908. Header: res.Header,
  5909. HTTPStatusCode: res.StatusCode,
  5910. },
  5911. }
  5912. target := &ret
  5913. if err := gensupport.DecodeResponse(target, res); err != nil {
  5914. return nil, err
  5915. }
  5916. return ret, nil
  5917. // {
  5918. // "description": "Gets the resource representation for a job in a project.",
  5919. // "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}",
  5920. // "httpMethod": "GET",
  5921. // "id": "dataproc.projects.regions.jobs.get",
  5922. // "parameterOrder": [
  5923. // "projectId",
  5924. // "region",
  5925. // "jobId"
  5926. // ],
  5927. // "parameters": {
  5928. // "jobId": {
  5929. // "description": "Required. The job ID.",
  5930. // "location": "path",
  5931. // "required": true,
  5932. // "type": "string"
  5933. // },
  5934. // "projectId": {
  5935. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  5936. // "location": "path",
  5937. // "required": true,
  5938. // "type": "string"
  5939. // },
  5940. // "region": {
  5941. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  5942. // "location": "path",
  5943. // "required": true,
  5944. // "type": "string"
  5945. // }
  5946. // },
  5947. // "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}",
  5948. // "response": {
  5949. // "$ref": "Job"
  5950. // },
  5951. // "scopes": [
  5952. // "https://www.googleapis.com/auth/cloud-platform"
  5953. // ]
  5954. // }
  5955. }
  5956. // method id "dataproc.projects.regions.jobs.getIamPolicy":
  5957. type ProjectsRegionsJobsGetIamPolicyCall struct {
  5958. s *Service
  5959. resource string
  5960. getiampolicyrequest *GetIamPolicyRequest
  5961. urlParams_ gensupport.URLParams
  5962. ctx_ context.Context
  5963. header_ http.Header
  5964. }
  5965. // GetIamPolicy: Gets the access control policy for a resource. Returns
  5966. // an empty policy if the resource exists and does not have a policy
  5967. // set.
  5968. func (r *ProjectsRegionsJobsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsRegionsJobsGetIamPolicyCall {
  5969. c := &ProjectsRegionsJobsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5970. c.resource = resource
  5971. c.getiampolicyrequest = getiampolicyrequest
  5972. return c
  5973. }
  5974. // Fields allows partial responses to be retrieved. See
  5975. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5976. // for more information.
  5977. func (c *ProjectsRegionsJobsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsGetIamPolicyCall {
  5978. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5979. return c
  5980. }
  5981. // Context sets the context to be used in this call's Do method. Any
  5982. // pending HTTP request will be aborted if the provided context is
  5983. // canceled.
  5984. func (c *ProjectsRegionsJobsGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsJobsGetIamPolicyCall {
  5985. c.ctx_ = ctx
  5986. return c
  5987. }
  5988. // Header returns an http.Header that can be modified by the caller to
  5989. // add HTTP headers to the request.
  5990. func (c *ProjectsRegionsJobsGetIamPolicyCall) Header() http.Header {
  5991. if c.header_ == nil {
  5992. c.header_ = make(http.Header)
  5993. }
  5994. return c.header_
  5995. }
  5996. func (c *ProjectsRegionsJobsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  5997. reqHeaders := make(http.Header)
  5998. for k, v := range c.header_ {
  5999. reqHeaders[k] = v
  6000. }
  6001. reqHeaders.Set("User-Agent", c.s.userAgent())
  6002. var body io.Reader = nil
  6003. body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  6004. if err != nil {
  6005. return nil, err
  6006. }
  6007. reqHeaders.Set("Content-Type", "application/json")
  6008. c.urlParams_.Set("alt", alt)
  6009. c.urlParams_.Set("prettyPrint", "false")
  6010. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  6011. urls += "?" + c.urlParams_.Encode()
  6012. req, err := http.NewRequest("POST", urls, body)
  6013. if err != nil {
  6014. return nil, err
  6015. }
  6016. req.Header = reqHeaders
  6017. googleapi.Expand(req.URL, map[string]string{
  6018. "resource": c.resource,
  6019. })
  6020. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6021. }
  6022. // Do executes the "dataproc.projects.regions.jobs.getIamPolicy" call.
  6023. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  6024. // code is an error. Response headers are in either
  6025. // *Policy.ServerResponse.Header or (if a response was returned at all)
  6026. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6027. // check whether the returned error was because http.StatusNotModified
  6028. // was returned.
  6029. func (c *ProjectsRegionsJobsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  6030. gensupport.SetOptions(c.urlParams_, opts...)
  6031. res, err := c.doRequest("json")
  6032. if res != nil && res.StatusCode == http.StatusNotModified {
  6033. if res.Body != nil {
  6034. res.Body.Close()
  6035. }
  6036. return nil, &googleapi.Error{
  6037. Code: res.StatusCode,
  6038. Header: res.Header,
  6039. }
  6040. }
  6041. if err != nil {
  6042. return nil, err
  6043. }
  6044. defer googleapi.CloseBody(res)
  6045. if err := googleapi.CheckResponse(res); err != nil {
  6046. return nil, err
  6047. }
  6048. ret := &Policy{
  6049. ServerResponse: googleapi.ServerResponse{
  6050. Header: res.Header,
  6051. HTTPStatusCode: res.StatusCode,
  6052. },
  6053. }
  6054. target := &ret
  6055. if err := gensupport.DecodeResponse(target, res); err != nil {
  6056. return nil, err
  6057. }
  6058. return ret, nil
  6059. // {
  6060. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  6061. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:getIamPolicy",
  6062. // "httpMethod": "POST",
  6063. // "id": "dataproc.projects.regions.jobs.getIamPolicy",
  6064. // "parameterOrder": [
  6065. // "resource"
  6066. // ],
  6067. // "parameters": {
  6068. // "resource": {
  6069. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  6070. // "location": "path",
  6071. // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$",
  6072. // "required": true,
  6073. // "type": "string"
  6074. // }
  6075. // },
  6076. // "path": "v1/{+resource}:getIamPolicy",
  6077. // "request": {
  6078. // "$ref": "GetIamPolicyRequest"
  6079. // },
  6080. // "response": {
  6081. // "$ref": "Policy"
  6082. // },
  6083. // "scopes": [
  6084. // "https://www.googleapis.com/auth/cloud-platform"
  6085. // ]
  6086. // }
  6087. }
  6088. // method id "dataproc.projects.regions.jobs.list":
  6089. type ProjectsRegionsJobsListCall struct {
  6090. s *Service
  6091. projectId string
  6092. region string
  6093. urlParams_ gensupport.URLParams
  6094. ifNoneMatch_ string
  6095. ctx_ context.Context
  6096. header_ http.Header
  6097. }
  6098. // List: Lists regions/{region}/jobs in a project.
  6099. func (r *ProjectsRegionsJobsService) List(projectId string, region string) *ProjectsRegionsJobsListCall {
  6100. c := &ProjectsRegionsJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6101. c.projectId = projectId
  6102. c.region = region
  6103. return c
  6104. }
  6105. // ClusterName sets the optional parameter "clusterName": If set, the
  6106. // returned jobs list includes only jobs that were submitted to the
  6107. // named cluster.
  6108. func (c *ProjectsRegionsJobsListCall) ClusterName(clusterName string) *ProjectsRegionsJobsListCall {
  6109. c.urlParams_.Set("clusterName", clusterName)
  6110. return c
  6111. }
  6112. // Filter sets the optional parameter "filter": A filter constraining
  6113. // the jobs to list. Filters are case-sensitive and have the following
  6114. // syntax:field = value AND field = value ...where field is status.state
  6115. // or labels.[KEY], and [KEY] is a label key. value can be * to match
  6116. // all values. status.state can be either ACTIVE or NON_ACTIVE. Only the
  6117. // logical AND operator is supported; space-separated items are treated
  6118. // as having an implicit AND operator.Example filter:status.state =
  6119. // ACTIVE AND labels.env = staging AND labels.starred = *
  6120. func (c *ProjectsRegionsJobsListCall) Filter(filter string) *ProjectsRegionsJobsListCall {
  6121. c.urlParams_.Set("filter", filter)
  6122. return c
  6123. }
  6124. // JobStateMatcher sets the optional parameter "jobStateMatcher":
  6125. // Specifies enumerated categories of jobs to list. (default = match ALL
  6126. // jobs).If filter is provided, jobStateMatcher will be ignored.
  6127. //
  6128. // Possible values:
  6129. // "ALL"
  6130. // "ACTIVE"
  6131. // "NON_ACTIVE"
  6132. func (c *ProjectsRegionsJobsListCall) JobStateMatcher(jobStateMatcher string) *ProjectsRegionsJobsListCall {
  6133. c.urlParams_.Set("jobStateMatcher", jobStateMatcher)
  6134. return c
  6135. }
  6136. // PageSize sets the optional parameter "pageSize": The number of
  6137. // results to return in each response.
  6138. func (c *ProjectsRegionsJobsListCall) PageSize(pageSize int64) *ProjectsRegionsJobsListCall {
  6139. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6140. return c
  6141. }
  6142. // PageToken sets the optional parameter "pageToken": The page token,
  6143. // returned by a previous call, to request the next page of results.
  6144. func (c *ProjectsRegionsJobsListCall) PageToken(pageToken string) *ProjectsRegionsJobsListCall {
  6145. c.urlParams_.Set("pageToken", pageToken)
  6146. return c
  6147. }
  6148. // Fields allows partial responses to be retrieved. See
  6149. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6150. // for more information.
  6151. func (c *ProjectsRegionsJobsListCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsListCall {
  6152. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6153. return c
  6154. }
  6155. // IfNoneMatch sets the optional parameter which makes the operation
  6156. // fail if the object's ETag matches the given value. This is useful for
  6157. // getting updates only after the object has changed since the last
  6158. // request. Use googleapi.IsNotModified to check whether the response
  6159. // error from Do is the result of In-None-Match.
  6160. func (c *ProjectsRegionsJobsListCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsListCall {
  6161. c.ifNoneMatch_ = entityTag
  6162. return c
  6163. }
  6164. // Context sets the context to be used in this call's Do method. Any
  6165. // pending HTTP request will be aborted if the provided context is
  6166. // canceled.
  6167. func (c *ProjectsRegionsJobsListCall) Context(ctx context.Context) *ProjectsRegionsJobsListCall {
  6168. c.ctx_ = ctx
  6169. return c
  6170. }
  6171. // Header returns an http.Header that can be modified by the caller to
  6172. // add HTTP headers to the request.
  6173. func (c *ProjectsRegionsJobsListCall) Header() http.Header {
  6174. if c.header_ == nil {
  6175. c.header_ = make(http.Header)
  6176. }
  6177. return c.header_
  6178. }
  6179. func (c *ProjectsRegionsJobsListCall) doRequest(alt string) (*http.Response, error) {
  6180. reqHeaders := make(http.Header)
  6181. for k, v := range c.header_ {
  6182. reqHeaders[k] = v
  6183. }
  6184. reqHeaders.Set("User-Agent", c.s.userAgent())
  6185. if c.ifNoneMatch_ != "" {
  6186. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6187. }
  6188. var body io.Reader = nil
  6189. c.urlParams_.Set("alt", alt)
  6190. c.urlParams_.Set("prettyPrint", "false")
  6191. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs")
  6192. urls += "?" + c.urlParams_.Encode()
  6193. req, err := http.NewRequest("GET", urls, body)
  6194. if err != nil {
  6195. return nil, err
  6196. }
  6197. req.Header = reqHeaders
  6198. googleapi.Expand(req.URL, map[string]string{
  6199. "projectId": c.projectId,
  6200. "region": c.region,
  6201. })
  6202. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6203. }
  6204. // Do executes the "dataproc.projects.regions.jobs.list" call.
  6205. // Exactly one of *ListJobsResponse or error will be non-nil. Any
  6206. // non-2xx status code is an error. Response headers are in either
  6207. // *ListJobsResponse.ServerResponse.Header or (if a response was
  6208. // returned at all) in error.(*googleapi.Error).Header. Use
  6209. // googleapi.IsNotModified to check whether the returned error was
  6210. // because http.StatusNotModified was returned.
  6211. func (c *ProjectsRegionsJobsListCall) Do(opts ...googleapi.CallOption) (*ListJobsResponse, error) {
  6212. gensupport.SetOptions(c.urlParams_, opts...)
  6213. res, err := c.doRequest("json")
  6214. if res != nil && res.StatusCode == http.StatusNotModified {
  6215. if res.Body != nil {
  6216. res.Body.Close()
  6217. }
  6218. return nil, &googleapi.Error{
  6219. Code: res.StatusCode,
  6220. Header: res.Header,
  6221. }
  6222. }
  6223. if err != nil {
  6224. return nil, err
  6225. }
  6226. defer googleapi.CloseBody(res)
  6227. if err := googleapi.CheckResponse(res); err != nil {
  6228. return nil, err
  6229. }
  6230. ret := &ListJobsResponse{
  6231. ServerResponse: googleapi.ServerResponse{
  6232. Header: res.Header,
  6233. HTTPStatusCode: res.StatusCode,
  6234. },
  6235. }
  6236. target := &ret
  6237. if err := gensupport.DecodeResponse(target, res); err != nil {
  6238. return nil, err
  6239. }
  6240. return ret, nil
  6241. // {
  6242. // "description": "Lists regions/{region}/jobs in a project.",
  6243. // "flatPath": "v1/projects/{projectId}/regions/{region}/jobs",
  6244. // "httpMethod": "GET",
  6245. // "id": "dataproc.projects.regions.jobs.list",
  6246. // "parameterOrder": [
  6247. // "projectId",
  6248. // "region"
  6249. // ],
  6250. // "parameters": {
  6251. // "clusterName": {
  6252. // "description": "Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster.",
  6253. // "location": "query",
  6254. // "type": "string"
  6255. // },
  6256. // "filter": {
  6257. // "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 = *",
  6258. // "location": "query",
  6259. // "type": "string"
  6260. // },
  6261. // "jobStateMatcher": {
  6262. // "description": "Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored.",
  6263. // "enum": [
  6264. // "ALL",
  6265. // "ACTIVE",
  6266. // "NON_ACTIVE"
  6267. // ],
  6268. // "location": "query",
  6269. // "type": "string"
  6270. // },
  6271. // "pageSize": {
  6272. // "description": "Optional. The number of results to return in each response.",
  6273. // "format": "int32",
  6274. // "location": "query",
  6275. // "type": "integer"
  6276. // },
  6277. // "pageToken": {
  6278. // "description": "Optional. The page token, returned by a previous call, to request the next page of results.",
  6279. // "location": "query",
  6280. // "type": "string"
  6281. // },
  6282. // "projectId": {
  6283. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  6284. // "location": "path",
  6285. // "required": true,
  6286. // "type": "string"
  6287. // },
  6288. // "region": {
  6289. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  6290. // "location": "path",
  6291. // "required": true,
  6292. // "type": "string"
  6293. // }
  6294. // },
  6295. // "path": "v1/projects/{projectId}/regions/{region}/jobs",
  6296. // "response": {
  6297. // "$ref": "ListJobsResponse"
  6298. // },
  6299. // "scopes": [
  6300. // "https://www.googleapis.com/auth/cloud-platform"
  6301. // ]
  6302. // }
  6303. }
  6304. // Pages invokes f for each page of results.
  6305. // A non-nil error returned from f will halt the iteration.
  6306. // The provided context supersedes any context provided to the Context method.
  6307. func (c *ProjectsRegionsJobsListCall) Pages(ctx context.Context, f func(*ListJobsResponse) error) error {
  6308. c.ctx_ = ctx
  6309. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6310. for {
  6311. x, err := c.Do()
  6312. if err != nil {
  6313. return err
  6314. }
  6315. if err := f(x); err != nil {
  6316. return err
  6317. }
  6318. if x.NextPageToken == "" {
  6319. return nil
  6320. }
  6321. c.PageToken(x.NextPageToken)
  6322. }
  6323. }
  6324. // method id "dataproc.projects.regions.jobs.patch":
  6325. type ProjectsRegionsJobsPatchCall struct {
  6326. s *Service
  6327. projectId string
  6328. region string
  6329. jobId string
  6330. job *Job
  6331. urlParams_ gensupport.URLParams
  6332. ctx_ context.Context
  6333. header_ http.Header
  6334. }
  6335. // Patch: Updates a job in a project.
  6336. func (r *ProjectsRegionsJobsService) Patch(projectId string, region string, jobId string, job *Job) *ProjectsRegionsJobsPatchCall {
  6337. c := &ProjectsRegionsJobsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6338. c.projectId = projectId
  6339. c.region = region
  6340. c.jobId = jobId
  6341. c.job = job
  6342. return c
  6343. }
  6344. // UpdateMask sets the optional parameter "updateMask": Required.
  6345. // Specifies the path, relative to <code>Job</code>, of the field to
  6346. // update. For example, to update the labels of a Job the
  6347. // <code>update_mask</code> parameter would be specified as
  6348. // <code>labels</code>, and the PATCH request body would specify the new
  6349. // value. <strong>Note:</strong> Currently, <code>labels</code> is the
  6350. // only field that can be updated.
  6351. func (c *ProjectsRegionsJobsPatchCall) UpdateMask(updateMask string) *ProjectsRegionsJobsPatchCall {
  6352. c.urlParams_.Set("updateMask", updateMask)
  6353. return c
  6354. }
  6355. // Fields allows partial responses to be retrieved. See
  6356. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6357. // for more information.
  6358. func (c *ProjectsRegionsJobsPatchCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsPatchCall {
  6359. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6360. return c
  6361. }
  6362. // Context sets the context to be used in this call's Do method. Any
  6363. // pending HTTP request will be aborted if the provided context is
  6364. // canceled.
  6365. func (c *ProjectsRegionsJobsPatchCall) Context(ctx context.Context) *ProjectsRegionsJobsPatchCall {
  6366. c.ctx_ = ctx
  6367. return c
  6368. }
  6369. // Header returns an http.Header that can be modified by the caller to
  6370. // add HTTP headers to the request.
  6371. func (c *ProjectsRegionsJobsPatchCall) Header() http.Header {
  6372. if c.header_ == nil {
  6373. c.header_ = make(http.Header)
  6374. }
  6375. return c.header_
  6376. }
  6377. func (c *ProjectsRegionsJobsPatchCall) doRequest(alt string) (*http.Response, error) {
  6378. reqHeaders := make(http.Header)
  6379. for k, v := range c.header_ {
  6380. reqHeaders[k] = v
  6381. }
  6382. reqHeaders.Set("User-Agent", c.s.userAgent())
  6383. var body io.Reader = nil
  6384. body, err := googleapi.WithoutDataWrapper.JSONReader(c.job)
  6385. if err != nil {
  6386. return nil, err
  6387. }
  6388. reqHeaders.Set("Content-Type", "application/json")
  6389. c.urlParams_.Set("alt", alt)
  6390. c.urlParams_.Set("prettyPrint", "false")
  6391. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs/{jobId}")
  6392. urls += "?" + c.urlParams_.Encode()
  6393. req, err := http.NewRequest("PATCH", urls, body)
  6394. if err != nil {
  6395. return nil, err
  6396. }
  6397. req.Header = reqHeaders
  6398. googleapi.Expand(req.URL, map[string]string{
  6399. "projectId": c.projectId,
  6400. "region": c.region,
  6401. "jobId": c.jobId,
  6402. })
  6403. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6404. }
  6405. // Do executes the "dataproc.projects.regions.jobs.patch" call.
  6406. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  6407. // is an error. Response headers are in either
  6408. // *Job.ServerResponse.Header or (if a response was returned at all) in
  6409. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6410. // whether the returned error was because http.StatusNotModified was
  6411. // returned.
  6412. func (c *ProjectsRegionsJobsPatchCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  6413. gensupport.SetOptions(c.urlParams_, opts...)
  6414. res, err := c.doRequest("json")
  6415. if res != nil && res.StatusCode == http.StatusNotModified {
  6416. if res.Body != nil {
  6417. res.Body.Close()
  6418. }
  6419. return nil, &googleapi.Error{
  6420. Code: res.StatusCode,
  6421. Header: res.Header,
  6422. }
  6423. }
  6424. if err != nil {
  6425. return nil, err
  6426. }
  6427. defer googleapi.CloseBody(res)
  6428. if err := googleapi.CheckResponse(res); err != nil {
  6429. return nil, err
  6430. }
  6431. ret := &Job{
  6432. ServerResponse: googleapi.ServerResponse{
  6433. Header: res.Header,
  6434. HTTPStatusCode: res.StatusCode,
  6435. },
  6436. }
  6437. target := &ret
  6438. if err := gensupport.DecodeResponse(target, res); err != nil {
  6439. return nil, err
  6440. }
  6441. return ret, nil
  6442. // {
  6443. // "description": "Updates a job in a project.",
  6444. // "flatPath": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}",
  6445. // "httpMethod": "PATCH",
  6446. // "id": "dataproc.projects.regions.jobs.patch",
  6447. // "parameterOrder": [
  6448. // "projectId",
  6449. // "region",
  6450. // "jobId"
  6451. // ],
  6452. // "parameters": {
  6453. // "jobId": {
  6454. // "description": "Required. The job ID.",
  6455. // "location": "path",
  6456. // "required": true,
  6457. // "type": "string"
  6458. // },
  6459. // "projectId": {
  6460. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  6461. // "location": "path",
  6462. // "required": true,
  6463. // "type": "string"
  6464. // },
  6465. // "region": {
  6466. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  6467. // "location": "path",
  6468. // "required": true,
  6469. // "type": "string"
  6470. // },
  6471. // "updateMask": {
  6472. // "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.",
  6473. // "format": "google-fieldmask",
  6474. // "location": "query",
  6475. // "type": "string"
  6476. // }
  6477. // },
  6478. // "path": "v1/projects/{projectId}/regions/{region}/jobs/{jobId}",
  6479. // "request": {
  6480. // "$ref": "Job"
  6481. // },
  6482. // "response": {
  6483. // "$ref": "Job"
  6484. // },
  6485. // "scopes": [
  6486. // "https://www.googleapis.com/auth/cloud-platform"
  6487. // ]
  6488. // }
  6489. }
  6490. // method id "dataproc.projects.regions.jobs.setIamPolicy":
  6491. type ProjectsRegionsJobsSetIamPolicyCall struct {
  6492. s *Service
  6493. resource string
  6494. setiampolicyrequest *SetIamPolicyRequest
  6495. urlParams_ gensupport.URLParams
  6496. ctx_ context.Context
  6497. header_ http.Header
  6498. }
  6499. // SetIamPolicy: Sets the access control policy on the specified
  6500. // resource. Replaces any existing policy.
  6501. func (r *ProjectsRegionsJobsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsJobsSetIamPolicyCall {
  6502. c := &ProjectsRegionsJobsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6503. c.resource = resource
  6504. c.setiampolicyrequest = setiampolicyrequest
  6505. return c
  6506. }
  6507. // Fields allows partial responses to be retrieved. See
  6508. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6509. // for more information.
  6510. func (c *ProjectsRegionsJobsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSetIamPolicyCall {
  6511. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6512. return c
  6513. }
  6514. // Context sets the context to be used in this call's Do method. Any
  6515. // pending HTTP request will be aborted if the provided context is
  6516. // canceled.
  6517. func (c *ProjectsRegionsJobsSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsJobsSetIamPolicyCall {
  6518. c.ctx_ = ctx
  6519. return c
  6520. }
  6521. // Header returns an http.Header that can be modified by the caller to
  6522. // add HTTP headers to the request.
  6523. func (c *ProjectsRegionsJobsSetIamPolicyCall) Header() http.Header {
  6524. if c.header_ == nil {
  6525. c.header_ = make(http.Header)
  6526. }
  6527. return c.header_
  6528. }
  6529. func (c *ProjectsRegionsJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  6530. reqHeaders := make(http.Header)
  6531. for k, v := range c.header_ {
  6532. reqHeaders[k] = v
  6533. }
  6534. reqHeaders.Set("User-Agent", c.s.userAgent())
  6535. var body io.Reader = nil
  6536. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  6537. if err != nil {
  6538. return nil, err
  6539. }
  6540. reqHeaders.Set("Content-Type", "application/json")
  6541. c.urlParams_.Set("alt", alt)
  6542. c.urlParams_.Set("prettyPrint", "false")
  6543. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  6544. urls += "?" + c.urlParams_.Encode()
  6545. req, err := http.NewRequest("POST", urls, body)
  6546. if err != nil {
  6547. return nil, err
  6548. }
  6549. req.Header = reqHeaders
  6550. googleapi.Expand(req.URL, map[string]string{
  6551. "resource": c.resource,
  6552. })
  6553. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6554. }
  6555. // Do executes the "dataproc.projects.regions.jobs.setIamPolicy" call.
  6556. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  6557. // code is an error. Response headers are in either
  6558. // *Policy.ServerResponse.Header or (if a response was returned at all)
  6559. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6560. // check whether the returned error was because http.StatusNotModified
  6561. // was returned.
  6562. func (c *ProjectsRegionsJobsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  6563. gensupport.SetOptions(c.urlParams_, opts...)
  6564. res, err := c.doRequest("json")
  6565. if res != nil && res.StatusCode == http.StatusNotModified {
  6566. if res.Body != nil {
  6567. res.Body.Close()
  6568. }
  6569. return nil, &googleapi.Error{
  6570. Code: res.StatusCode,
  6571. Header: res.Header,
  6572. }
  6573. }
  6574. if err != nil {
  6575. return nil, err
  6576. }
  6577. defer googleapi.CloseBody(res)
  6578. if err := googleapi.CheckResponse(res); err != nil {
  6579. return nil, err
  6580. }
  6581. ret := &Policy{
  6582. ServerResponse: googleapi.ServerResponse{
  6583. Header: res.Header,
  6584. HTTPStatusCode: res.StatusCode,
  6585. },
  6586. }
  6587. target := &ret
  6588. if err := gensupport.DecodeResponse(target, res); err != nil {
  6589. return nil, err
  6590. }
  6591. return ret, nil
  6592. // {
  6593. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  6594. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:setIamPolicy",
  6595. // "httpMethod": "POST",
  6596. // "id": "dataproc.projects.regions.jobs.setIamPolicy",
  6597. // "parameterOrder": [
  6598. // "resource"
  6599. // ],
  6600. // "parameters": {
  6601. // "resource": {
  6602. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  6603. // "location": "path",
  6604. // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$",
  6605. // "required": true,
  6606. // "type": "string"
  6607. // }
  6608. // },
  6609. // "path": "v1/{+resource}:setIamPolicy",
  6610. // "request": {
  6611. // "$ref": "SetIamPolicyRequest"
  6612. // },
  6613. // "response": {
  6614. // "$ref": "Policy"
  6615. // },
  6616. // "scopes": [
  6617. // "https://www.googleapis.com/auth/cloud-platform"
  6618. // ]
  6619. // }
  6620. }
  6621. // method id "dataproc.projects.regions.jobs.submit":
  6622. type ProjectsRegionsJobsSubmitCall struct {
  6623. s *Service
  6624. projectId string
  6625. region string
  6626. submitjobrequest *SubmitJobRequest
  6627. urlParams_ gensupport.URLParams
  6628. ctx_ context.Context
  6629. header_ http.Header
  6630. }
  6631. // Submit: Submits a job to a cluster.
  6632. func (r *ProjectsRegionsJobsService) Submit(projectId string, region string, submitjobrequest *SubmitJobRequest) *ProjectsRegionsJobsSubmitCall {
  6633. c := &ProjectsRegionsJobsSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6634. c.projectId = projectId
  6635. c.region = region
  6636. c.submitjobrequest = submitjobrequest
  6637. return c
  6638. }
  6639. // Fields allows partial responses to be retrieved. See
  6640. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6641. // for more information.
  6642. func (c *ProjectsRegionsJobsSubmitCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSubmitCall {
  6643. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6644. return c
  6645. }
  6646. // Context sets the context to be used in this call's Do method. Any
  6647. // pending HTTP request will be aborted if the provided context is
  6648. // canceled.
  6649. func (c *ProjectsRegionsJobsSubmitCall) Context(ctx context.Context) *ProjectsRegionsJobsSubmitCall {
  6650. c.ctx_ = ctx
  6651. return c
  6652. }
  6653. // Header returns an http.Header that can be modified by the caller to
  6654. // add HTTP headers to the request.
  6655. func (c *ProjectsRegionsJobsSubmitCall) Header() http.Header {
  6656. if c.header_ == nil {
  6657. c.header_ = make(http.Header)
  6658. }
  6659. return c.header_
  6660. }
  6661. func (c *ProjectsRegionsJobsSubmitCall) doRequest(alt string) (*http.Response, error) {
  6662. reqHeaders := make(http.Header)
  6663. for k, v := range c.header_ {
  6664. reqHeaders[k] = v
  6665. }
  6666. reqHeaders.Set("User-Agent", c.s.userAgent())
  6667. var body io.Reader = nil
  6668. body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitjobrequest)
  6669. if err != nil {
  6670. return nil, err
  6671. }
  6672. reqHeaders.Set("Content-Type", "application/json")
  6673. c.urlParams_.Set("alt", alt)
  6674. c.urlParams_.Set("prettyPrint", "false")
  6675. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/regions/{region}/jobs:submit")
  6676. urls += "?" + c.urlParams_.Encode()
  6677. req, err := http.NewRequest("POST", urls, body)
  6678. if err != nil {
  6679. return nil, err
  6680. }
  6681. req.Header = reqHeaders
  6682. googleapi.Expand(req.URL, map[string]string{
  6683. "projectId": c.projectId,
  6684. "region": c.region,
  6685. })
  6686. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6687. }
  6688. // Do executes the "dataproc.projects.regions.jobs.submit" call.
  6689. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  6690. // is an error. Response headers are in either
  6691. // *Job.ServerResponse.Header or (if a response was returned at all) in
  6692. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6693. // whether the returned error was because http.StatusNotModified was
  6694. // returned.
  6695. func (c *ProjectsRegionsJobsSubmitCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  6696. gensupport.SetOptions(c.urlParams_, opts...)
  6697. res, err := c.doRequest("json")
  6698. if res != nil && res.StatusCode == http.StatusNotModified {
  6699. if res.Body != nil {
  6700. res.Body.Close()
  6701. }
  6702. return nil, &googleapi.Error{
  6703. Code: res.StatusCode,
  6704. Header: res.Header,
  6705. }
  6706. }
  6707. if err != nil {
  6708. return nil, err
  6709. }
  6710. defer googleapi.CloseBody(res)
  6711. if err := googleapi.CheckResponse(res); err != nil {
  6712. return nil, err
  6713. }
  6714. ret := &Job{
  6715. ServerResponse: googleapi.ServerResponse{
  6716. Header: res.Header,
  6717. HTTPStatusCode: res.StatusCode,
  6718. },
  6719. }
  6720. target := &ret
  6721. if err := gensupport.DecodeResponse(target, res); err != nil {
  6722. return nil, err
  6723. }
  6724. return ret, nil
  6725. // {
  6726. // "description": "Submits a job to a cluster.",
  6727. // "flatPath": "v1/projects/{projectId}/regions/{region}/jobs:submit",
  6728. // "httpMethod": "POST",
  6729. // "id": "dataproc.projects.regions.jobs.submit",
  6730. // "parameterOrder": [
  6731. // "projectId",
  6732. // "region"
  6733. // ],
  6734. // "parameters": {
  6735. // "projectId": {
  6736. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  6737. // "location": "path",
  6738. // "required": true,
  6739. // "type": "string"
  6740. // },
  6741. // "region": {
  6742. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  6743. // "location": "path",
  6744. // "required": true,
  6745. // "type": "string"
  6746. // }
  6747. // },
  6748. // "path": "v1/projects/{projectId}/regions/{region}/jobs:submit",
  6749. // "request": {
  6750. // "$ref": "SubmitJobRequest"
  6751. // },
  6752. // "response": {
  6753. // "$ref": "Job"
  6754. // },
  6755. // "scopes": [
  6756. // "https://www.googleapis.com/auth/cloud-platform"
  6757. // ]
  6758. // }
  6759. }
  6760. // method id "dataproc.projects.regions.jobs.testIamPermissions":
  6761. type ProjectsRegionsJobsTestIamPermissionsCall struct {
  6762. s *Service
  6763. resource string
  6764. testiampermissionsrequest *TestIamPermissionsRequest
  6765. urlParams_ gensupport.URLParams
  6766. ctx_ context.Context
  6767. header_ http.Header
  6768. }
  6769. // TestIamPermissions: Returns permissions that a caller has on the
  6770. // specified resource. If the resource does not exist, this will return
  6771. // an empty set of permissions, not a NOT_FOUND error.Note: This
  6772. // operation is designed to be used for building permission-aware UIs
  6773. // and command-line tools, not for authorization checking. This
  6774. // operation may "fail open" without warning.
  6775. func (r *ProjectsRegionsJobsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsJobsTestIamPermissionsCall {
  6776. c := &ProjectsRegionsJobsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6777. c.resource = resource
  6778. c.testiampermissionsrequest = testiampermissionsrequest
  6779. return c
  6780. }
  6781. // Fields allows partial responses to be retrieved. See
  6782. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6783. // for more information.
  6784. func (c *ProjectsRegionsJobsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsTestIamPermissionsCall {
  6785. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6786. return c
  6787. }
  6788. // Context sets the context to be used in this call's Do method. Any
  6789. // pending HTTP request will be aborted if the provided context is
  6790. // canceled.
  6791. func (c *ProjectsRegionsJobsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsJobsTestIamPermissionsCall {
  6792. c.ctx_ = ctx
  6793. return c
  6794. }
  6795. // Header returns an http.Header that can be modified by the caller to
  6796. // add HTTP headers to the request.
  6797. func (c *ProjectsRegionsJobsTestIamPermissionsCall) Header() http.Header {
  6798. if c.header_ == nil {
  6799. c.header_ = make(http.Header)
  6800. }
  6801. return c.header_
  6802. }
  6803. func (c *ProjectsRegionsJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  6804. reqHeaders := make(http.Header)
  6805. for k, v := range c.header_ {
  6806. reqHeaders[k] = v
  6807. }
  6808. reqHeaders.Set("User-Agent", c.s.userAgent())
  6809. var body io.Reader = nil
  6810. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  6811. if err != nil {
  6812. return nil, err
  6813. }
  6814. reqHeaders.Set("Content-Type", "application/json")
  6815. c.urlParams_.Set("alt", alt)
  6816. c.urlParams_.Set("prettyPrint", "false")
  6817. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  6818. urls += "?" + c.urlParams_.Encode()
  6819. req, err := http.NewRequest("POST", urls, body)
  6820. if err != nil {
  6821. return nil, err
  6822. }
  6823. req.Header = reqHeaders
  6824. googleapi.Expand(req.URL, map[string]string{
  6825. "resource": c.resource,
  6826. })
  6827. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6828. }
  6829. // Do executes the "dataproc.projects.regions.jobs.testIamPermissions" call.
  6830. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  6831. // Any non-2xx status code is an error. Response headers are in either
  6832. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  6833. // was returned at all) in error.(*googleapi.Error).Header. Use
  6834. // googleapi.IsNotModified to check whether the returned error was
  6835. // because http.StatusNotModified was returned.
  6836. func (c *ProjectsRegionsJobsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  6837. gensupport.SetOptions(c.urlParams_, opts...)
  6838. res, err := c.doRequest("json")
  6839. if res != nil && res.StatusCode == http.StatusNotModified {
  6840. if res.Body != nil {
  6841. res.Body.Close()
  6842. }
  6843. return nil, &googleapi.Error{
  6844. Code: res.StatusCode,
  6845. Header: res.Header,
  6846. }
  6847. }
  6848. if err != nil {
  6849. return nil, err
  6850. }
  6851. defer googleapi.CloseBody(res)
  6852. if err := googleapi.CheckResponse(res); err != nil {
  6853. return nil, err
  6854. }
  6855. ret := &TestIamPermissionsResponse{
  6856. ServerResponse: googleapi.ServerResponse{
  6857. Header: res.Header,
  6858. HTTPStatusCode: res.StatusCode,
  6859. },
  6860. }
  6861. target := &ret
  6862. if err := gensupport.DecodeResponse(target, res); err != nil {
  6863. return nil, err
  6864. }
  6865. return ret, nil
  6866. // {
  6867. // "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.",
  6868. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:testIamPermissions",
  6869. // "httpMethod": "POST",
  6870. // "id": "dataproc.projects.regions.jobs.testIamPermissions",
  6871. // "parameterOrder": [
  6872. // "resource"
  6873. // ],
  6874. // "parameters": {
  6875. // "resource": {
  6876. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  6877. // "location": "path",
  6878. // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$",
  6879. // "required": true,
  6880. // "type": "string"
  6881. // }
  6882. // },
  6883. // "path": "v1/{+resource}:testIamPermissions",
  6884. // "request": {
  6885. // "$ref": "TestIamPermissionsRequest"
  6886. // },
  6887. // "response": {
  6888. // "$ref": "TestIamPermissionsResponse"
  6889. // },
  6890. // "scopes": [
  6891. // "https://www.googleapis.com/auth/cloud-platform"
  6892. // ]
  6893. // }
  6894. }
  6895. // method id "dataproc.projects.regions.operations.cancel":
  6896. type ProjectsRegionsOperationsCancelCall struct {
  6897. s *Service
  6898. name string
  6899. urlParams_ gensupport.URLParams
  6900. ctx_ context.Context
  6901. header_ http.Header
  6902. }
  6903. // Cancel: Starts asynchronous cancellation on a long-running operation.
  6904. // The server makes a best effort to cancel the operation, but success
  6905. // is not guaranteed. If the server doesn't support this method, it
  6906. // returns google.rpc.Code.UNIMPLEMENTED. Clients can use
  6907. // Operations.GetOperation or other methods to check whether the
  6908. // cancellation succeeded or whether the operation completed despite
  6909. // cancellation. On successful cancellation, the operation is not
  6910. // deleted; instead, it becomes an operation with an Operation.error
  6911. // value with a google.rpc.Status.code of 1, corresponding to
  6912. // Code.CANCELLED.
  6913. func (r *ProjectsRegionsOperationsService) Cancel(name string) *ProjectsRegionsOperationsCancelCall {
  6914. c := &ProjectsRegionsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6915. c.name = name
  6916. return c
  6917. }
  6918. // Fields allows partial responses to be retrieved. See
  6919. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6920. // for more information.
  6921. func (c *ProjectsRegionsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsCancelCall {
  6922. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6923. return c
  6924. }
  6925. // Context sets the context to be used in this call's Do method. Any
  6926. // pending HTTP request will be aborted if the provided context is
  6927. // canceled.
  6928. func (c *ProjectsRegionsOperationsCancelCall) Context(ctx context.Context) *ProjectsRegionsOperationsCancelCall {
  6929. c.ctx_ = ctx
  6930. return c
  6931. }
  6932. // Header returns an http.Header that can be modified by the caller to
  6933. // add HTTP headers to the request.
  6934. func (c *ProjectsRegionsOperationsCancelCall) Header() http.Header {
  6935. if c.header_ == nil {
  6936. c.header_ = make(http.Header)
  6937. }
  6938. return c.header_
  6939. }
  6940. func (c *ProjectsRegionsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  6941. reqHeaders := make(http.Header)
  6942. for k, v := range c.header_ {
  6943. reqHeaders[k] = v
  6944. }
  6945. reqHeaders.Set("User-Agent", c.s.userAgent())
  6946. var body io.Reader = nil
  6947. c.urlParams_.Set("alt", alt)
  6948. c.urlParams_.Set("prettyPrint", "false")
  6949. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  6950. urls += "?" + c.urlParams_.Encode()
  6951. req, err := http.NewRequest("POST", urls, body)
  6952. if err != nil {
  6953. return nil, err
  6954. }
  6955. req.Header = reqHeaders
  6956. googleapi.Expand(req.URL, map[string]string{
  6957. "name": c.name,
  6958. })
  6959. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6960. }
  6961. // Do executes the "dataproc.projects.regions.operations.cancel" call.
  6962. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  6963. // code is an error. Response headers are in either
  6964. // *Empty.ServerResponse.Header or (if a response was returned at all)
  6965. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6966. // check whether the returned error was because http.StatusNotModified
  6967. // was returned.
  6968. func (c *ProjectsRegionsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  6969. gensupport.SetOptions(c.urlParams_, opts...)
  6970. res, err := c.doRequest("json")
  6971. if res != nil && res.StatusCode == http.StatusNotModified {
  6972. if res.Body != nil {
  6973. res.Body.Close()
  6974. }
  6975. return nil, &googleapi.Error{
  6976. Code: res.StatusCode,
  6977. Header: res.Header,
  6978. }
  6979. }
  6980. if err != nil {
  6981. return nil, err
  6982. }
  6983. defer googleapi.CloseBody(res)
  6984. if err := googleapi.CheckResponse(res); err != nil {
  6985. return nil, err
  6986. }
  6987. ret := &Empty{
  6988. ServerResponse: googleapi.ServerResponse{
  6989. Header: res.Header,
  6990. HTTPStatusCode: res.StatusCode,
  6991. },
  6992. }
  6993. target := &ret
  6994. if err := gensupport.DecodeResponse(target, res); err != nil {
  6995. return nil, err
  6996. }
  6997. return ret, nil
  6998. // {
  6999. // "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.",
  7000. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:cancel",
  7001. // "httpMethod": "POST",
  7002. // "id": "dataproc.projects.regions.operations.cancel",
  7003. // "parameterOrder": [
  7004. // "name"
  7005. // ],
  7006. // "parameters": {
  7007. // "name": {
  7008. // "description": "The name of the operation resource to be cancelled.",
  7009. // "location": "path",
  7010. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  7011. // "required": true,
  7012. // "type": "string"
  7013. // }
  7014. // },
  7015. // "path": "v1/{+name}:cancel",
  7016. // "response": {
  7017. // "$ref": "Empty"
  7018. // },
  7019. // "scopes": [
  7020. // "https://www.googleapis.com/auth/cloud-platform"
  7021. // ]
  7022. // }
  7023. }
  7024. // method id "dataproc.projects.regions.operations.delete":
  7025. type ProjectsRegionsOperationsDeleteCall struct {
  7026. s *Service
  7027. name string
  7028. urlParams_ gensupport.URLParams
  7029. ctx_ context.Context
  7030. header_ http.Header
  7031. }
  7032. // Delete: Deletes a long-running operation. This method indicates that
  7033. // the client is no longer interested in the operation result. It does
  7034. // not cancel the operation. If the server doesn't support this method,
  7035. // it returns google.rpc.Code.UNIMPLEMENTED.
  7036. func (r *ProjectsRegionsOperationsService) Delete(name string) *ProjectsRegionsOperationsDeleteCall {
  7037. c := &ProjectsRegionsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7038. c.name = name
  7039. return c
  7040. }
  7041. // Fields allows partial responses to be retrieved. See
  7042. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7043. // for more information.
  7044. func (c *ProjectsRegionsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsDeleteCall {
  7045. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7046. return c
  7047. }
  7048. // Context sets the context to be used in this call's Do method. Any
  7049. // pending HTTP request will be aborted if the provided context is
  7050. // canceled.
  7051. func (c *ProjectsRegionsOperationsDeleteCall) Context(ctx context.Context) *ProjectsRegionsOperationsDeleteCall {
  7052. c.ctx_ = ctx
  7053. return c
  7054. }
  7055. // Header returns an http.Header that can be modified by the caller to
  7056. // add HTTP headers to the request.
  7057. func (c *ProjectsRegionsOperationsDeleteCall) Header() http.Header {
  7058. if c.header_ == nil {
  7059. c.header_ = make(http.Header)
  7060. }
  7061. return c.header_
  7062. }
  7063. func (c *ProjectsRegionsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7064. reqHeaders := make(http.Header)
  7065. for k, v := range c.header_ {
  7066. reqHeaders[k] = v
  7067. }
  7068. reqHeaders.Set("User-Agent", c.s.userAgent())
  7069. var body io.Reader = nil
  7070. c.urlParams_.Set("alt", alt)
  7071. c.urlParams_.Set("prettyPrint", "false")
  7072. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  7073. urls += "?" + c.urlParams_.Encode()
  7074. req, err := http.NewRequest("DELETE", urls, body)
  7075. if err != nil {
  7076. return nil, err
  7077. }
  7078. req.Header = reqHeaders
  7079. googleapi.Expand(req.URL, map[string]string{
  7080. "name": c.name,
  7081. })
  7082. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7083. }
  7084. // Do executes the "dataproc.projects.regions.operations.delete" call.
  7085. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  7086. // code is an error. Response headers are in either
  7087. // *Empty.ServerResponse.Header or (if a response was returned at all)
  7088. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7089. // check whether the returned error was because http.StatusNotModified
  7090. // was returned.
  7091. func (c *ProjectsRegionsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  7092. gensupport.SetOptions(c.urlParams_, opts...)
  7093. res, err := c.doRequest("json")
  7094. if res != nil && res.StatusCode == http.StatusNotModified {
  7095. if res.Body != nil {
  7096. res.Body.Close()
  7097. }
  7098. return nil, &googleapi.Error{
  7099. Code: res.StatusCode,
  7100. Header: res.Header,
  7101. }
  7102. }
  7103. if err != nil {
  7104. return nil, err
  7105. }
  7106. defer googleapi.CloseBody(res)
  7107. if err := googleapi.CheckResponse(res); err != nil {
  7108. return nil, err
  7109. }
  7110. ret := &Empty{
  7111. ServerResponse: googleapi.ServerResponse{
  7112. Header: res.Header,
  7113. HTTPStatusCode: res.StatusCode,
  7114. },
  7115. }
  7116. target := &ret
  7117. if err := gensupport.DecodeResponse(target, res); err != nil {
  7118. return nil, err
  7119. }
  7120. return ret, nil
  7121. // {
  7122. // "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.",
  7123. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}",
  7124. // "httpMethod": "DELETE",
  7125. // "id": "dataproc.projects.regions.operations.delete",
  7126. // "parameterOrder": [
  7127. // "name"
  7128. // ],
  7129. // "parameters": {
  7130. // "name": {
  7131. // "description": "The name of the operation resource to be deleted.",
  7132. // "location": "path",
  7133. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  7134. // "required": true,
  7135. // "type": "string"
  7136. // }
  7137. // },
  7138. // "path": "v1/{+name}",
  7139. // "response": {
  7140. // "$ref": "Empty"
  7141. // },
  7142. // "scopes": [
  7143. // "https://www.googleapis.com/auth/cloud-platform"
  7144. // ]
  7145. // }
  7146. }
  7147. // method id "dataproc.projects.regions.operations.get":
  7148. type ProjectsRegionsOperationsGetCall struct {
  7149. s *Service
  7150. name string
  7151. urlParams_ gensupport.URLParams
  7152. ifNoneMatch_ string
  7153. ctx_ context.Context
  7154. header_ http.Header
  7155. }
  7156. // Get: Gets the latest state of a long-running operation. Clients can
  7157. // use this method to poll the operation result at intervals as
  7158. // recommended by the API service.
  7159. func (r *ProjectsRegionsOperationsService) Get(name string) *ProjectsRegionsOperationsGetCall {
  7160. c := &ProjectsRegionsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7161. c.name = name
  7162. return c
  7163. }
  7164. // Fields allows partial responses to be retrieved. See
  7165. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7166. // for more information.
  7167. func (c *ProjectsRegionsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsGetCall {
  7168. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7169. return c
  7170. }
  7171. // IfNoneMatch sets the optional parameter which makes the operation
  7172. // fail if the object's ETag matches the given value. This is useful for
  7173. // getting updates only after the object has changed since the last
  7174. // request. Use googleapi.IsNotModified to check whether the response
  7175. // error from Do is the result of In-None-Match.
  7176. func (c *ProjectsRegionsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsGetCall {
  7177. c.ifNoneMatch_ = entityTag
  7178. return c
  7179. }
  7180. // Context sets the context to be used in this call's Do method. Any
  7181. // pending HTTP request will be aborted if the provided context is
  7182. // canceled.
  7183. func (c *ProjectsRegionsOperationsGetCall) Context(ctx context.Context) *ProjectsRegionsOperationsGetCall {
  7184. c.ctx_ = ctx
  7185. return c
  7186. }
  7187. // Header returns an http.Header that can be modified by the caller to
  7188. // add HTTP headers to the request.
  7189. func (c *ProjectsRegionsOperationsGetCall) Header() http.Header {
  7190. if c.header_ == nil {
  7191. c.header_ = make(http.Header)
  7192. }
  7193. return c.header_
  7194. }
  7195. func (c *ProjectsRegionsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  7196. reqHeaders := make(http.Header)
  7197. for k, v := range c.header_ {
  7198. reqHeaders[k] = v
  7199. }
  7200. reqHeaders.Set("User-Agent", c.s.userAgent())
  7201. if c.ifNoneMatch_ != "" {
  7202. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7203. }
  7204. var body io.Reader = nil
  7205. c.urlParams_.Set("alt", alt)
  7206. c.urlParams_.Set("prettyPrint", "false")
  7207. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  7208. urls += "?" + c.urlParams_.Encode()
  7209. req, err := http.NewRequest("GET", urls, body)
  7210. if err != nil {
  7211. return nil, err
  7212. }
  7213. req.Header = reqHeaders
  7214. googleapi.Expand(req.URL, map[string]string{
  7215. "name": c.name,
  7216. })
  7217. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7218. }
  7219. // Do executes the "dataproc.projects.regions.operations.get" call.
  7220. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7221. // status code is an error. Response headers are in either
  7222. // *Operation.ServerResponse.Header or (if a response was returned at
  7223. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7224. // to check whether the returned error was because
  7225. // http.StatusNotModified was returned.
  7226. func (c *ProjectsRegionsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7227. gensupport.SetOptions(c.urlParams_, opts...)
  7228. res, err := c.doRequest("json")
  7229. if res != nil && res.StatusCode == http.StatusNotModified {
  7230. if res.Body != nil {
  7231. res.Body.Close()
  7232. }
  7233. return nil, &googleapi.Error{
  7234. Code: res.StatusCode,
  7235. Header: res.Header,
  7236. }
  7237. }
  7238. if err != nil {
  7239. return nil, err
  7240. }
  7241. defer googleapi.CloseBody(res)
  7242. if err := googleapi.CheckResponse(res); err != nil {
  7243. return nil, err
  7244. }
  7245. ret := &Operation{
  7246. ServerResponse: googleapi.ServerResponse{
  7247. Header: res.Header,
  7248. HTTPStatusCode: res.StatusCode,
  7249. },
  7250. }
  7251. target := &ret
  7252. if err := gensupport.DecodeResponse(target, res); err != nil {
  7253. return nil, err
  7254. }
  7255. return ret, nil
  7256. // {
  7257. // "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.",
  7258. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}",
  7259. // "httpMethod": "GET",
  7260. // "id": "dataproc.projects.regions.operations.get",
  7261. // "parameterOrder": [
  7262. // "name"
  7263. // ],
  7264. // "parameters": {
  7265. // "name": {
  7266. // "description": "The name of the operation resource.",
  7267. // "location": "path",
  7268. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  7269. // "required": true,
  7270. // "type": "string"
  7271. // }
  7272. // },
  7273. // "path": "v1/{+name}",
  7274. // "response": {
  7275. // "$ref": "Operation"
  7276. // },
  7277. // "scopes": [
  7278. // "https://www.googleapis.com/auth/cloud-platform"
  7279. // ]
  7280. // }
  7281. }
  7282. // method id "dataproc.projects.regions.operations.getIamPolicy":
  7283. type ProjectsRegionsOperationsGetIamPolicyCall struct {
  7284. s *Service
  7285. resource string
  7286. getiampolicyrequest *GetIamPolicyRequest
  7287. urlParams_ gensupport.URLParams
  7288. ctx_ context.Context
  7289. header_ http.Header
  7290. }
  7291. // GetIamPolicy: Gets the access control policy for a resource. Returns
  7292. // an empty policy if the resource exists and does not have a policy
  7293. // set.
  7294. func (r *ProjectsRegionsOperationsService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsRegionsOperationsGetIamPolicyCall {
  7295. c := &ProjectsRegionsOperationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7296. c.resource = resource
  7297. c.getiampolicyrequest = getiampolicyrequest
  7298. return c
  7299. }
  7300. // Fields allows partial responses to be retrieved. See
  7301. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7302. // for more information.
  7303. func (c *ProjectsRegionsOperationsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsGetIamPolicyCall {
  7304. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7305. return c
  7306. }
  7307. // Context sets the context to be used in this call's Do method. Any
  7308. // pending HTTP request will be aborted if the provided context is
  7309. // canceled.
  7310. func (c *ProjectsRegionsOperationsGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsOperationsGetIamPolicyCall {
  7311. c.ctx_ = ctx
  7312. return c
  7313. }
  7314. // Header returns an http.Header that can be modified by the caller to
  7315. // add HTTP headers to the request.
  7316. func (c *ProjectsRegionsOperationsGetIamPolicyCall) Header() http.Header {
  7317. if c.header_ == nil {
  7318. c.header_ = make(http.Header)
  7319. }
  7320. return c.header_
  7321. }
  7322. func (c *ProjectsRegionsOperationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  7323. reqHeaders := make(http.Header)
  7324. for k, v := range c.header_ {
  7325. reqHeaders[k] = v
  7326. }
  7327. reqHeaders.Set("User-Agent", c.s.userAgent())
  7328. var body io.Reader = nil
  7329. body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  7330. if err != nil {
  7331. return nil, err
  7332. }
  7333. reqHeaders.Set("Content-Type", "application/json")
  7334. c.urlParams_.Set("alt", alt)
  7335. c.urlParams_.Set("prettyPrint", "false")
  7336. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  7337. urls += "?" + c.urlParams_.Encode()
  7338. req, err := http.NewRequest("POST", urls, body)
  7339. if err != nil {
  7340. return nil, err
  7341. }
  7342. req.Header = reqHeaders
  7343. googleapi.Expand(req.URL, map[string]string{
  7344. "resource": c.resource,
  7345. })
  7346. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7347. }
  7348. // Do executes the "dataproc.projects.regions.operations.getIamPolicy" call.
  7349. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  7350. // code is an error. Response headers are in either
  7351. // *Policy.ServerResponse.Header or (if a response was returned at all)
  7352. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7353. // check whether the returned error was because http.StatusNotModified
  7354. // was returned.
  7355. func (c *ProjectsRegionsOperationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  7356. gensupport.SetOptions(c.urlParams_, opts...)
  7357. res, err := c.doRequest("json")
  7358. if res != nil && res.StatusCode == http.StatusNotModified {
  7359. if res.Body != nil {
  7360. res.Body.Close()
  7361. }
  7362. return nil, &googleapi.Error{
  7363. Code: res.StatusCode,
  7364. Header: res.Header,
  7365. }
  7366. }
  7367. if err != nil {
  7368. return nil, err
  7369. }
  7370. defer googleapi.CloseBody(res)
  7371. if err := googleapi.CheckResponse(res); err != nil {
  7372. return nil, err
  7373. }
  7374. ret := &Policy{
  7375. ServerResponse: googleapi.ServerResponse{
  7376. Header: res.Header,
  7377. HTTPStatusCode: res.StatusCode,
  7378. },
  7379. }
  7380. target := &ret
  7381. if err := gensupport.DecodeResponse(target, res); err != nil {
  7382. return nil, err
  7383. }
  7384. return ret, nil
  7385. // {
  7386. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  7387. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:getIamPolicy",
  7388. // "httpMethod": "POST",
  7389. // "id": "dataproc.projects.regions.operations.getIamPolicy",
  7390. // "parameterOrder": [
  7391. // "resource"
  7392. // ],
  7393. // "parameters": {
  7394. // "resource": {
  7395. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  7396. // "location": "path",
  7397. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  7398. // "required": true,
  7399. // "type": "string"
  7400. // }
  7401. // },
  7402. // "path": "v1/{+resource}:getIamPolicy",
  7403. // "request": {
  7404. // "$ref": "GetIamPolicyRequest"
  7405. // },
  7406. // "response": {
  7407. // "$ref": "Policy"
  7408. // },
  7409. // "scopes": [
  7410. // "https://www.googleapis.com/auth/cloud-platform"
  7411. // ]
  7412. // }
  7413. }
  7414. // method id "dataproc.projects.regions.operations.list":
  7415. type ProjectsRegionsOperationsListCall struct {
  7416. s *Service
  7417. name string
  7418. urlParams_ gensupport.URLParams
  7419. ifNoneMatch_ string
  7420. ctx_ context.Context
  7421. header_ http.Header
  7422. }
  7423. // List: Lists operations that match the specified filter in the
  7424. // request. If the server doesn't support this method, it returns
  7425. // UNIMPLEMENTED.NOTE: the name binding allows API services to override
  7426. // the binding to use different resource name schemes, such as
  7427. // users/*/operations. To override the binding, API services can add a
  7428. // binding such as "/v1/{name=users/*}/operations" to their service
  7429. // configuration. For backwards compatibility, the default name includes
  7430. // the operations collection id, however overriding users must ensure
  7431. // the name binding is the parent resource, without the operations
  7432. // collection id.
  7433. func (r *ProjectsRegionsOperationsService) List(name string) *ProjectsRegionsOperationsListCall {
  7434. c := &ProjectsRegionsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7435. c.name = name
  7436. return c
  7437. }
  7438. // Filter sets the optional parameter "filter": The standard list
  7439. // filter.
  7440. func (c *ProjectsRegionsOperationsListCall) Filter(filter string) *ProjectsRegionsOperationsListCall {
  7441. c.urlParams_.Set("filter", filter)
  7442. return c
  7443. }
  7444. // PageSize sets the optional parameter "pageSize": The standard list
  7445. // page size.
  7446. func (c *ProjectsRegionsOperationsListCall) PageSize(pageSize int64) *ProjectsRegionsOperationsListCall {
  7447. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7448. return c
  7449. }
  7450. // PageToken sets the optional parameter "pageToken": The standard list
  7451. // page token.
  7452. func (c *ProjectsRegionsOperationsListCall) PageToken(pageToken string) *ProjectsRegionsOperationsListCall {
  7453. c.urlParams_.Set("pageToken", pageToken)
  7454. return c
  7455. }
  7456. // Fields allows partial responses to be retrieved. See
  7457. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7458. // for more information.
  7459. func (c *ProjectsRegionsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsListCall {
  7460. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7461. return c
  7462. }
  7463. // IfNoneMatch sets the optional parameter which makes the operation
  7464. // fail if the object's ETag matches the given value. This is useful for
  7465. // getting updates only after the object has changed since the last
  7466. // request. Use googleapi.IsNotModified to check whether the response
  7467. // error from Do is the result of In-None-Match.
  7468. func (c *ProjectsRegionsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsListCall {
  7469. c.ifNoneMatch_ = entityTag
  7470. return c
  7471. }
  7472. // Context sets the context to be used in this call's Do method. Any
  7473. // pending HTTP request will be aborted if the provided context is
  7474. // canceled.
  7475. func (c *ProjectsRegionsOperationsListCall) Context(ctx context.Context) *ProjectsRegionsOperationsListCall {
  7476. c.ctx_ = ctx
  7477. return c
  7478. }
  7479. // Header returns an http.Header that can be modified by the caller to
  7480. // add HTTP headers to the request.
  7481. func (c *ProjectsRegionsOperationsListCall) Header() http.Header {
  7482. if c.header_ == nil {
  7483. c.header_ = make(http.Header)
  7484. }
  7485. return c.header_
  7486. }
  7487. func (c *ProjectsRegionsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  7488. reqHeaders := make(http.Header)
  7489. for k, v := range c.header_ {
  7490. reqHeaders[k] = v
  7491. }
  7492. reqHeaders.Set("User-Agent", c.s.userAgent())
  7493. if c.ifNoneMatch_ != "" {
  7494. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7495. }
  7496. var body io.Reader = nil
  7497. c.urlParams_.Set("alt", alt)
  7498. c.urlParams_.Set("prettyPrint", "false")
  7499. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  7500. urls += "?" + c.urlParams_.Encode()
  7501. req, err := http.NewRequest("GET", urls, body)
  7502. if err != nil {
  7503. return nil, err
  7504. }
  7505. req.Header = reqHeaders
  7506. googleapi.Expand(req.URL, map[string]string{
  7507. "name": c.name,
  7508. })
  7509. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7510. }
  7511. // Do executes the "dataproc.projects.regions.operations.list" call.
  7512. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  7513. // non-2xx status code is an error. Response headers are in either
  7514. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  7515. // returned at all) in error.(*googleapi.Error).Header. Use
  7516. // googleapi.IsNotModified to check whether the returned error was
  7517. // because http.StatusNotModified was returned.
  7518. func (c *ProjectsRegionsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  7519. gensupport.SetOptions(c.urlParams_, opts...)
  7520. res, err := c.doRequest("json")
  7521. if res != nil && res.StatusCode == http.StatusNotModified {
  7522. if res.Body != nil {
  7523. res.Body.Close()
  7524. }
  7525. return nil, &googleapi.Error{
  7526. Code: res.StatusCode,
  7527. Header: res.Header,
  7528. }
  7529. }
  7530. if err != nil {
  7531. return nil, err
  7532. }
  7533. defer googleapi.CloseBody(res)
  7534. if err := googleapi.CheckResponse(res); err != nil {
  7535. return nil, err
  7536. }
  7537. ret := &ListOperationsResponse{
  7538. ServerResponse: googleapi.ServerResponse{
  7539. Header: res.Header,
  7540. HTTPStatusCode: res.StatusCode,
  7541. },
  7542. }
  7543. target := &ret
  7544. if err := gensupport.DecodeResponse(target, res); err != nil {
  7545. return nil, err
  7546. }
  7547. return ret, nil
  7548. // {
  7549. // "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.",
  7550. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations",
  7551. // "httpMethod": "GET",
  7552. // "id": "dataproc.projects.regions.operations.list",
  7553. // "parameterOrder": [
  7554. // "name"
  7555. // ],
  7556. // "parameters": {
  7557. // "filter": {
  7558. // "description": "The standard list filter.",
  7559. // "location": "query",
  7560. // "type": "string"
  7561. // },
  7562. // "name": {
  7563. // "description": "The name of the operation's parent resource.",
  7564. // "location": "path",
  7565. // "pattern": "^projects/[^/]+/regions/[^/]+/operations$",
  7566. // "required": true,
  7567. // "type": "string"
  7568. // },
  7569. // "pageSize": {
  7570. // "description": "The standard list page size.",
  7571. // "format": "int32",
  7572. // "location": "query",
  7573. // "type": "integer"
  7574. // },
  7575. // "pageToken": {
  7576. // "description": "The standard list page token.",
  7577. // "location": "query",
  7578. // "type": "string"
  7579. // }
  7580. // },
  7581. // "path": "v1/{+name}",
  7582. // "response": {
  7583. // "$ref": "ListOperationsResponse"
  7584. // },
  7585. // "scopes": [
  7586. // "https://www.googleapis.com/auth/cloud-platform"
  7587. // ]
  7588. // }
  7589. }
  7590. // Pages invokes f for each page of results.
  7591. // A non-nil error returned from f will halt the iteration.
  7592. // The provided context supersedes any context provided to the Context method.
  7593. func (c *ProjectsRegionsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  7594. c.ctx_ = ctx
  7595. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7596. for {
  7597. x, err := c.Do()
  7598. if err != nil {
  7599. return err
  7600. }
  7601. if err := f(x); err != nil {
  7602. return err
  7603. }
  7604. if x.NextPageToken == "" {
  7605. return nil
  7606. }
  7607. c.PageToken(x.NextPageToken)
  7608. }
  7609. }
  7610. // method id "dataproc.projects.regions.operations.setIamPolicy":
  7611. type ProjectsRegionsOperationsSetIamPolicyCall struct {
  7612. s *Service
  7613. resource string
  7614. setiampolicyrequest *SetIamPolicyRequest
  7615. urlParams_ gensupport.URLParams
  7616. ctx_ context.Context
  7617. header_ http.Header
  7618. }
  7619. // SetIamPolicy: Sets the access control policy on the specified
  7620. // resource. Replaces any existing policy.
  7621. func (r *ProjectsRegionsOperationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsOperationsSetIamPolicyCall {
  7622. c := &ProjectsRegionsOperationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7623. c.resource = resource
  7624. c.setiampolicyrequest = setiampolicyrequest
  7625. return c
  7626. }
  7627. // Fields allows partial responses to be retrieved. See
  7628. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7629. // for more information.
  7630. func (c *ProjectsRegionsOperationsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsSetIamPolicyCall {
  7631. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7632. return c
  7633. }
  7634. // Context sets the context to be used in this call's Do method. Any
  7635. // pending HTTP request will be aborted if the provided context is
  7636. // canceled.
  7637. func (c *ProjectsRegionsOperationsSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsOperationsSetIamPolicyCall {
  7638. c.ctx_ = ctx
  7639. return c
  7640. }
  7641. // Header returns an http.Header that can be modified by the caller to
  7642. // add HTTP headers to the request.
  7643. func (c *ProjectsRegionsOperationsSetIamPolicyCall) Header() http.Header {
  7644. if c.header_ == nil {
  7645. c.header_ = make(http.Header)
  7646. }
  7647. return c.header_
  7648. }
  7649. func (c *ProjectsRegionsOperationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  7650. reqHeaders := make(http.Header)
  7651. for k, v := range c.header_ {
  7652. reqHeaders[k] = v
  7653. }
  7654. reqHeaders.Set("User-Agent", c.s.userAgent())
  7655. var body io.Reader = nil
  7656. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  7657. if err != nil {
  7658. return nil, err
  7659. }
  7660. reqHeaders.Set("Content-Type", "application/json")
  7661. c.urlParams_.Set("alt", alt)
  7662. c.urlParams_.Set("prettyPrint", "false")
  7663. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  7664. urls += "?" + c.urlParams_.Encode()
  7665. req, err := http.NewRequest("POST", urls, body)
  7666. if err != nil {
  7667. return nil, err
  7668. }
  7669. req.Header = reqHeaders
  7670. googleapi.Expand(req.URL, map[string]string{
  7671. "resource": c.resource,
  7672. })
  7673. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7674. }
  7675. // Do executes the "dataproc.projects.regions.operations.setIamPolicy" call.
  7676. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  7677. // code is an error. Response headers are in either
  7678. // *Policy.ServerResponse.Header or (if a response was returned at all)
  7679. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7680. // check whether the returned error was because http.StatusNotModified
  7681. // was returned.
  7682. func (c *ProjectsRegionsOperationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  7683. gensupport.SetOptions(c.urlParams_, opts...)
  7684. res, err := c.doRequest("json")
  7685. if res != nil && res.StatusCode == http.StatusNotModified {
  7686. if res.Body != nil {
  7687. res.Body.Close()
  7688. }
  7689. return nil, &googleapi.Error{
  7690. Code: res.StatusCode,
  7691. Header: res.Header,
  7692. }
  7693. }
  7694. if err != nil {
  7695. return nil, err
  7696. }
  7697. defer googleapi.CloseBody(res)
  7698. if err := googleapi.CheckResponse(res); err != nil {
  7699. return nil, err
  7700. }
  7701. ret := &Policy{
  7702. ServerResponse: googleapi.ServerResponse{
  7703. Header: res.Header,
  7704. HTTPStatusCode: res.StatusCode,
  7705. },
  7706. }
  7707. target := &ret
  7708. if err := gensupport.DecodeResponse(target, res); err != nil {
  7709. return nil, err
  7710. }
  7711. return ret, nil
  7712. // {
  7713. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  7714. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:setIamPolicy",
  7715. // "httpMethod": "POST",
  7716. // "id": "dataproc.projects.regions.operations.setIamPolicy",
  7717. // "parameterOrder": [
  7718. // "resource"
  7719. // ],
  7720. // "parameters": {
  7721. // "resource": {
  7722. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  7723. // "location": "path",
  7724. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  7725. // "required": true,
  7726. // "type": "string"
  7727. // }
  7728. // },
  7729. // "path": "v1/{+resource}:setIamPolicy",
  7730. // "request": {
  7731. // "$ref": "SetIamPolicyRequest"
  7732. // },
  7733. // "response": {
  7734. // "$ref": "Policy"
  7735. // },
  7736. // "scopes": [
  7737. // "https://www.googleapis.com/auth/cloud-platform"
  7738. // ]
  7739. // }
  7740. }
  7741. // method id "dataproc.projects.regions.operations.testIamPermissions":
  7742. type ProjectsRegionsOperationsTestIamPermissionsCall struct {
  7743. s *Service
  7744. resource string
  7745. testiampermissionsrequest *TestIamPermissionsRequest
  7746. urlParams_ gensupport.URLParams
  7747. ctx_ context.Context
  7748. header_ http.Header
  7749. }
  7750. // TestIamPermissions: Returns permissions that a caller has on the
  7751. // specified resource. If the resource does not exist, this will return
  7752. // an empty set of permissions, not a NOT_FOUND error.Note: This
  7753. // operation is designed to be used for building permission-aware UIs
  7754. // and command-line tools, not for authorization checking. This
  7755. // operation may "fail open" without warning.
  7756. func (r *ProjectsRegionsOperationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsOperationsTestIamPermissionsCall {
  7757. c := &ProjectsRegionsOperationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7758. c.resource = resource
  7759. c.testiampermissionsrequest = testiampermissionsrequest
  7760. return c
  7761. }
  7762. // Fields allows partial responses to be retrieved. See
  7763. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7764. // for more information.
  7765. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsTestIamPermissionsCall {
  7766. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7767. return c
  7768. }
  7769. // Context sets the context to be used in this call's Do method. Any
  7770. // pending HTTP request will be aborted if the provided context is
  7771. // canceled.
  7772. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsOperationsTestIamPermissionsCall {
  7773. c.ctx_ = ctx
  7774. return c
  7775. }
  7776. // Header returns an http.Header that can be modified by the caller to
  7777. // add HTTP headers to the request.
  7778. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Header() http.Header {
  7779. if c.header_ == nil {
  7780. c.header_ = make(http.Header)
  7781. }
  7782. return c.header_
  7783. }
  7784. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  7785. reqHeaders := make(http.Header)
  7786. for k, v := range c.header_ {
  7787. reqHeaders[k] = v
  7788. }
  7789. reqHeaders.Set("User-Agent", c.s.userAgent())
  7790. var body io.Reader = nil
  7791. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  7792. if err != nil {
  7793. return nil, err
  7794. }
  7795. reqHeaders.Set("Content-Type", "application/json")
  7796. c.urlParams_.Set("alt", alt)
  7797. c.urlParams_.Set("prettyPrint", "false")
  7798. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  7799. urls += "?" + c.urlParams_.Encode()
  7800. req, err := http.NewRequest("POST", urls, body)
  7801. if err != nil {
  7802. return nil, err
  7803. }
  7804. req.Header = reqHeaders
  7805. googleapi.Expand(req.URL, map[string]string{
  7806. "resource": c.resource,
  7807. })
  7808. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7809. }
  7810. // Do executes the "dataproc.projects.regions.operations.testIamPermissions" call.
  7811. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  7812. // Any non-2xx status code is an error. Response headers are in either
  7813. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  7814. // was returned at all) in error.(*googleapi.Error).Header. Use
  7815. // googleapi.IsNotModified to check whether the returned error was
  7816. // because http.StatusNotModified was returned.
  7817. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  7818. gensupport.SetOptions(c.urlParams_, opts...)
  7819. res, err := c.doRequest("json")
  7820. if res != nil && res.StatusCode == http.StatusNotModified {
  7821. if res.Body != nil {
  7822. res.Body.Close()
  7823. }
  7824. return nil, &googleapi.Error{
  7825. Code: res.StatusCode,
  7826. Header: res.Header,
  7827. }
  7828. }
  7829. if err != nil {
  7830. return nil, err
  7831. }
  7832. defer googleapi.CloseBody(res)
  7833. if err := googleapi.CheckResponse(res); err != nil {
  7834. return nil, err
  7835. }
  7836. ret := &TestIamPermissionsResponse{
  7837. ServerResponse: googleapi.ServerResponse{
  7838. Header: res.Header,
  7839. HTTPStatusCode: res.StatusCode,
  7840. },
  7841. }
  7842. target := &ret
  7843. if err := gensupport.DecodeResponse(target, res); err != nil {
  7844. return nil, err
  7845. }
  7846. return ret, nil
  7847. // {
  7848. // "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.",
  7849. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:testIamPermissions",
  7850. // "httpMethod": "POST",
  7851. // "id": "dataproc.projects.regions.operations.testIamPermissions",
  7852. // "parameterOrder": [
  7853. // "resource"
  7854. // ],
  7855. // "parameters": {
  7856. // "resource": {
  7857. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  7858. // "location": "path",
  7859. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  7860. // "required": true,
  7861. // "type": "string"
  7862. // }
  7863. // },
  7864. // "path": "v1/{+resource}:testIamPermissions",
  7865. // "request": {
  7866. // "$ref": "TestIamPermissionsRequest"
  7867. // },
  7868. // "response": {
  7869. // "$ref": "TestIamPermissionsResponse"
  7870. // },
  7871. // "scopes": [
  7872. // "https://www.googleapis.com/auth/cloud-platform"
  7873. // ]
  7874. // }
  7875. }
  7876. // method id "dataproc.projects.regions.workflowTemplates.create":
  7877. type ProjectsRegionsWorkflowTemplatesCreateCall struct {
  7878. s *Service
  7879. parent string
  7880. workflowtemplate *WorkflowTemplate
  7881. urlParams_ gensupport.URLParams
  7882. ctx_ context.Context
  7883. header_ http.Header
  7884. }
  7885. // Create: Creates new workflow template.
  7886. func (r *ProjectsRegionsWorkflowTemplatesService) Create(parent string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesCreateCall {
  7887. c := &ProjectsRegionsWorkflowTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7888. c.parent = parent
  7889. c.workflowtemplate = workflowtemplate
  7890. return c
  7891. }
  7892. // Fields allows partial responses to be retrieved. See
  7893. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7894. // for more information.
  7895. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesCreateCall {
  7896. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7897. return c
  7898. }
  7899. // Context sets the context to be used in this call's Do method. Any
  7900. // pending HTTP request will be aborted if the provided context is
  7901. // canceled.
  7902. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesCreateCall {
  7903. c.ctx_ = ctx
  7904. return c
  7905. }
  7906. // Header returns an http.Header that can be modified by the caller to
  7907. // add HTTP headers to the request.
  7908. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Header() http.Header {
  7909. if c.header_ == nil {
  7910. c.header_ = make(http.Header)
  7911. }
  7912. return c.header_
  7913. }
  7914. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) {
  7915. reqHeaders := make(http.Header)
  7916. for k, v := range c.header_ {
  7917. reqHeaders[k] = v
  7918. }
  7919. reqHeaders.Set("User-Agent", c.s.userAgent())
  7920. var body io.Reader = nil
  7921. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  7922. if err != nil {
  7923. return nil, err
  7924. }
  7925. reqHeaders.Set("Content-Type", "application/json")
  7926. c.urlParams_.Set("alt", alt)
  7927. c.urlParams_.Set("prettyPrint", "false")
  7928. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates")
  7929. urls += "?" + c.urlParams_.Encode()
  7930. req, err := http.NewRequest("POST", urls, body)
  7931. if err != nil {
  7932. return nil, err
  7933. }
  7934. req.Header = reqHeaders
  7935. googleapi.Expand(req.URL, map[string]string{
  7936. "parent": c.parent,
  7937. })
  7938. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7939. }
  7940. // Do executes the "dataproc.projects.regions.workflowTemplates.create" call.
  7941. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  7942. // non-2xx status code is an error. Response headers are in either
  7943. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  7944. // returned at all) in error.(*googleapi.Error).Header. Use
  7945. // googleapi.IsNotModified to check whether the returned error was
  7946. // because http.StatusNotModified was returned.
  7947. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  7948. gensupport.SetOptions(c.urlParams_, opts...)
  7949. res, err := c.doRequest("json")
  7950. if res != nil && res.StatusCode == http.StatusNotModified {
  7951. if res.Body != nil {
  7952. res.Body.Close()
  7953. }
  7954. return nil, &googleapi.Error{
  7955. Code: res.StatusCode,
  7956. Header: res.Header,
  7957. }
  7958. }
  7959. if err != nil {
  7960. return nil, err
  7961. }
  7962. defer googleapi.CloseBody(res)
  7963. if err := googleapi.CheckResponse(res); err != nil {
  7964. return nil, err
  7965. }
  7966. ret := &WorkflowTemplate{
  7967. ServerResponse: googleapi.ServerResponse{
  7968. Header: res.Header,
  7969. HTTPStatusCode: res.StatusCode,
  7970. },
  7971. }
  7972. target := &ret
  7973. if err := gensupport.DecodeResponse(target, res); err != nil {
  7974. return nil, err
  7975. }
  7976. return ret, nil
  7977. // {
  7978. // "description": "Creates new workflow template.",
  7979. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates",
  7980. // "httpMethod": "POST",
  7981. // "id": "dataproc.projects.regions.workflowTemplates.create",
  7982. // "parameterOrder": [
  7983. // "parent"
  7984. // ],
  7985. // "parameters": {
  7986. // "parent": {
  7987. // "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}",
  7988. // "location": "path",
  7989. // "pattern": "^projects/[^/]+/regions/[^/]+$",
  7990. // "required": true,
  7991. // "type": "string"
  7992. // }
  7993. // },
  7994. // "path": "v1/{+parent}/workflowTemplates",
  7995. // "request": {
  7996. // "$ref": "WorkflowTemplate"
  7997. // },
  7998. // "response": {
  7999. // "$ref": "WorkflowTemplate"
  8000. // },
  8001. // "scopes": [
  8002. // "https://www.googleapis.com/auth/cloud-platform"
  8003. // ]
  8004. // }
  8005. }
  8006. // method id "dataproc.projects.regions.workflowTemplates.delete":
  8007. type ProjectsRegionsWorkflowTemplatesDeleteCall struct {
  8008. s *Service
  8009. name string
  8010. urlParams_ gensupport.URLParams
  8011. ctx_ context.Context
  8012. header_ http.Header
  8013. }
  8014. // Delete: Deletes a workflow template. It does not cancel in-progress
  8015. // workflows.
  8016. func (r *ProjectsRegionsWorkflowTemplatesService) Delete(name string) *ProjectsRegionsWorkflowTemplatesDeleteCall {
  8017. c := &ProjectsRegionsWorkflowTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8018. c.name = name
  8019. return c
  8020. }
  8021. // Version sets the optional parameter "version": The version of
  8022. // workflow template to delete. If specified, will only delete the
  8023. // template if the current server version matches specified version.
  8024. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Version(version int64) *ProjectsRegionsWorkflowTemplatesDeleteCall {
  8025. c.urlParams_.Set("version", fmt.Sprint(version))
  8026. return c
  8027. }
  8028. // Fields allows partial responses to be retrieved. See
  8029. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8030. // for more information.
  8031. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesDeleteCall {
  8032. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8033. return c
  8034. }
  8035. // Context sets the context to be used in this call's Do method. Any
  8036. // pending HTTP request will be aborted if the provided context is
  8037. // canceled.
  8038. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesDeleteCall {
  8039. c.ctx_ = ctx
  8040. return c
  8041. }
  8042. // Header returns an http.Header that can be modified by the caller to
  8043. // add HTTP headers to the request.
  8044. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Header() http.Header {
  8045. if c.header_ == nil {
  8046. c.header_ = make(http.Header)
  8047. }
  8048. return c.header_
  8049. }
  8050. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  8051. reqHeaders := make(http.Header)
  8052. for k, v := range c.header_ {
  8053. reqHeaders[k] = v
  8054. }
  8055. reqHeaders.Set("User-Agent", c.s.userAgent())
  8056. var body io.Reader = nil
  8057. c.urlParams_.Set("alt", alt)
  8058. c.urlParams_.Set("prettyPrint", "false")
  8059. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  8060. urls += "?" + c.urlParams_.Encode()
  8061. req, err := http.NewRequest("DELETE", urls, body)
  8062. if err != nil {
  8063. return nil, err
  8064. }
  8065. req.Header = reqHeaders
  8066. googleapi.Expand(req.URL, map[string]string{
  8067. "name": c.name,
  8068. })
  8069. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8070. }
  8071. // Do executes the "dataproc.projects.regions.workflowTemplates.delete" call.
  8072. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  8073. // code is an error. Response headers are in either
  8074. // *Empty.ServerResponse.Header or (if a response was returned at all)
  8075. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8076. // check whether the returned error was because http.StatusNotModified
  8077. // was returned.
  8078. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  8079. gensupport.SetOptions(c.urlParams_, opts...)
  8080. res, err := c.doRequest("json")
  8081. if res != nil && res.StatusCode == http.StatusNotModified {
  8082. if res.Body != nil {
  8083. res.Body.Close()
  8084. }
  8085. return nil, &googleapi.Error{
  8086. Code: res.StatusCode,
  8087. Header: res.Header,
  8088. }
  8089. }
  8090. if err != nil {
  8091. return nil, err
  8092. }
  8093. defer googleapi.CloseBody(res)
  8094. if err := googleapi.CheckResponse(res); err != nil {
  8095. return nil, err
  8096. }
  8097. ret := &Empty{
  8098. ServerResponse: googleapi.ServerResponse{
  8099. Header: res.Header,
  8100. HTTPStatusCode: res.StatusCode,
  8101. },
  8102. }
  8103. target := &ret
  8104. if err := gensupport.DecodeResponse(target, res); err != nil {
  8105. return nil, err
  8106. }
  8107. return ret, nil
  8108. // {
  8109. // "description": "Deletes a workflow template. It does not cancel in-progress workflows.",
  8110. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}",
  8111. // "httpMethod": "DELETE",
  8112. // "id": "dataproc.projects.regions.workflowTemplates.delete",
  8113. // "parameterOrder": [
  8114. // "name"
  8115. // ],
  8116. // "parameters": {
  8117. // "name": {
  8118. // "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}",
  8119. // "location": "path",
  8120. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  8121. // "required": true,
  8122. // "type": "string"
  8123. // },
  8124. // "version": {
  8125. // "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.",
  8126. // "format": "int32",
  8127. // "location": "query",
  8128. // "type": "integer"
  8129. // }
  8130. // },
  8131. // "path": "v1/{+name}",
  8132. // "response": {
  8133. // "$ref": "Empty"
  8134. // },
  8135. // "scopes": [
  8136. // "https://www.googleapis.com/auth/cloud-platform"
  8137. // ]
  8138. // }
  8139. }
  8140. // method id "dataproc.projects.regions.workflowTemplates.get":
  8141. type ProjectsRegionsWorkflowTemplatesGetCall struct {
  8142. s *Service
  8143. name string
  8144. urlParams_ gensupport.URLParams
  8145. ifNoneMatch_ string
  8146. ctx_ context.Context
  8147. header_ http.Header
  8148. }
  8149. // Get: Retrieves the latest workflow template.Can retrieve previously
  8150. // instantiated template by specifying optional version parameter.
  8151. func (r *ProjectsRegionsWorkflowTemplatesService) Get(name string) *ProjectsRegionsWorkflowTemplatesGetCall {
  8152. c := &ProjectsRegionsWorkflowTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8153. c.name = name
  8154. return c
  8155. }
  8156. // Version sets the optional parameter "version": The version of
  8157. // workflow template to retrieve. Only previously instatiated versions
  8158. // can be retrieved.If unspecified, retrieves the current version.
  8159. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Version(version int64) *ProjectsRegionsWorkflowTemplatesGetCall {
  8160. c.urlParams_.Set("version", fmt.Sprint(version))
  8161. return c
  8162. }
  8163. // Fields allows partial responses to be retrieved. See
  8164. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8165. // for more information.
  8166. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesGetCall {
  8167. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8168. return c
  8169. }
  8170. // IfNoneMatch sets the optional parameter which makes the operation
  8171. // fail if the object's ETag matches the given value. This is useful for
  8172. // getting updates only after the object has changed since the last
  8173. // request. Use googleapi.IsNotModified to check whether the response
  8174. // error from Do is the result of In-None-Match.
  8175. func (c *ProjectsRegionsWorkflowTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesGetCall {
  8176. c.ifNoneMatch_ = entityTag
  8177. return c
  8178. }
  8179. // Context sets the context to be used in this call's Do method. Any
  8180. // pending HTTP request will be aborted if the provided context is
  8181. // canceled.
  8182. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesGetCall {
  8183. c.ctx_ = ctx
  8184. return c
  8185. }
  8186. // Header returns an http.Header that can be modified by the caller to
  8187. // add HTTP headers to the request.
  8188. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Header() http.Header {
  8189. if c.header_ == nil {
  8190. c.header_ = make(http.Header)
  8191. }
  8192. return c.header_
  8193. }
  8194. func (c *ProjectsRegionsWorkflowTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  8195. reqHeaders := make(http.Header)
  8196. for k, v := range c.header_ {
  8197. reqHeaders[k] = v
  8198. }
  8199. reqHeaders.Set("User-Agent", c.s.userAgent())
  8200. if c.ifNoneMatch_ != "" {
  8201. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8202. }
  8203. var body io.Reader = nil
  8204. c.urlParams_.Set("alt", alt)
  8205. c.urlParams_.Set("prettyPrint", "false")
  8206. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  8207. urls += "?" + c.urlParams_.Encode()
  8208. req, err := http.NewRequest("GET", urls, body)
  8209. if err != nil {
  8210. return nil, err
  8211. }
  8212. req.Header = reqHeaders
  8213. googleapi.Expand(req.URL, map[string]string{
  8214. "name": c.name,
  8215. })
  8216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8217. }
  8218. // Do executes the "dataproc.projects.regions.workflowTemplates.get" call.
  8219. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  8220. // non-2xx status code is an error. Response headers are in either
  8221. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  8222. // returned at all) in error.(*googleapi.Error).Header. Use
  8223. // googleapi.IsNotModified to check whether the returned error was
  8224. // because http.StatusNotModified was returned.
  8225. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  8226. gensupport.SetOptions(c.urlParams_, opts...)
  8227. res, err := c.doRequest("json")
  8228. if res != nil && res.StatusCode == http.StatusNotModified {
  8229. if res.Body != nil {
  8230. res.Body.Close()
  8231. }
  8232. return nil, &googleapi.Error{
  8233. Code: res.StatusCode,
  8234. Header: res.Header,
  8235. }
  8236. }
  8237. if err != nil {
  8238. return nil, err
  8239. }
  8240. defer googleapi.CloseBody(res)
  8241. if err := googleapi.CheckResponse(res); err != nil {
  8242. return nil, err
  8243. }
  8244. ret := &WorkflowTemplate{
  8245. ServerResponse: googleapi.ServerResponse{
  8246. Header: res.Header,
  8247. HTTPStatusCode: res.StatusCode,
  8248. },
  8249. }
  8250. target := &ret
  8251. if err := gensupport.DecodeResponse(target, res); err != nil {
  8252. return nil, err
  8253. }
  8254. return ret, nil
  8255. // {
  8256. // "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.",
  8257. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}",
  8258. // "httpMethod": "GET",
  8259. // "id": "dataproc.projects.regions.workflowTemplates.get",
  8260. // "parameterOrder": [
  8261. // "name"
  8262. // ],
  8263. // "parameters": {
  8264. // "name": {
  8265. // "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}",
  8266. // "location": "path",
  8267. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  8268. // "required": true,
  8269. // "type": "string"
  8270. // },
  8271. // "version": {
  8272. // "description": "Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version.",
  8273. // "format": "int32",
  8274. // "location": "query",
  8275. // "type": "integer"
  8276. // }
  8277. // },
  8278. // "path": "v1/{+name}",
  8279. // "response": {
  8280. // "$ref": "WorkflowTemplate"
  8281. // },
  8282. // "scopes": [
  8283. // "https://www.googleapis.com/auth/cloud-platform"
  8284. // ]
  8285. // }
  8286. }
  8287. // method id "dataproc.projects.regions.workflowTemplates.getIamPolicy":
  8288. type ProjectsRegionsWorkflowTemplatesGetIamPolicyCall struct {
  8289. s *Service
  8290. resource string
  8291. getiampolicyrequest *GetIamPolicyRequest
  8292. urlParams_ gensupport.URLParams
  8293. ctx_ context.Context
  8294. header_ http.Header
  8295. }
  8296. // GetIamPolicy: Gets the access control policy for a resource. Returns
  8297. // an empty policy if the resource exists and does not have a policy
  8298. // set.
  8299. func (r *ProjectsRegionsWorkflowTemplatesService) GetIamPolicy(resource string, getiampolicyrequest *GetIamPolicyRequest) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall {
  8300. c := &ProjectsRegionsWorkflowTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8301. c.resource = resource
  8302. c.getiampolicyrequest = getiampolicyrequest
  8303. return c
  8304. }
  8305. // Fields allows partial responses to be retrieved. See
  8306. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8307. // for more information.
  8308. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall {
  8309. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8310. return c
  8311. }
  8312. // Context sets the context to be used in this call's Do method. Any
  8313. // pending HTTP request will be aborted if the provided context is
  8314. // canceled.
  8315. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall {
  8316. c.ctx_ = ctx
  8317. return c
  8318. }
  8319. // Header returns an http.Header that can be modified by the caller to
  8320. // add HTTP headers to the request.
  8321. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Header() http.Header {
  8322. if c.header_ == nil {
  8323. c.header_ = make(http.Header)
  8324. }
  8325. return c.header_
  8326. }
  8327. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  8328. reqHeaders := make(http.Header)
  8329. for k, v := range c.header_ {
  8330. reqHeaders[k] = v
  8331. }
  8332. reqHeaders.Set("User-Agent", c.s.userAgent())
  8333. var body io.Reader = nil
  8334. body, err := googleapi.WithoutDataWrapper.JSONReader(c.getiampolicyrequest)
  8335. if err != nil {
  8336. return nil, err
  8337. }
  8338. reqHeaders.Set("Content-Type", "application/json")
  8339. c.urlParams_.Set("alt", alt)
  8340. c.urlParams_.Set("prettyPrint", "false")
  8341. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:getIamPolicy")
  8342. urls += "?" + c.urlParams_.Encode()
  8343. req, err := http.NewRequest("POST", urls, body)
  8344. if err != nil {
  8345. return nil, err
  8346. }
  8347. req.Header = reqHeaders
  8348. googleapi.Expand(req.URL, map[string]string{
  8349. "resource": c.resource,
  8350. })
  8351. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8352. }
  8353. // Do executes the "dataproc.projects.regions.workflowTemplates.getIamPolicy" call.
  8354. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  8355. // code is an error. Response headers are in either
  8356. // *Policy.ServerResponse.Header or (if a response was returned at all)
  8357. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8358. // check whether the returned error was because http.StatusNotModified
  8359. // was returned.
  8360. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  8361. gensupport.SetOptions(c.urlParams_, opts...)
  8362. res, err := c.doRequest("json")
  8363. if res != nil && res.StatusCode == http.StatusNotModified {
  8364. if res.Body != nil {
  8365. res.Body.Close()
  8366. }
  8367. return nil, &googleapi.Error{
  8368. Code: res.StatusCode,
  8369. Header: res.Header,
  8370. }
  8371. }
  8372. if err != nil {
  8373. return nil, err
  8374. }
  8375. defer googleapi.CloseBody(res)
  8376. if err := googleapi.CheckResponse(res); err != nil {
  8377. return nil, err
  8378. }
  8379. ret := &Policy{
  8380. ServerResponse: googleapi.ServerResponse{
  8381. Header: res.Header,
  8382. HTTPStatusCode: res.StatusCode,
  8383. },
  8384. }
  8385. target := &ret
  8386. if err := gensupport.DecodeResponse(target, res); err != nil {
  8387. return nil, err
  8388. }
  8389. return ret, nil
  8390. // {
  8391. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  8392. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:getIamPolicy",
  8393. // "httpMethod": "POST",
  8394. // "id": "dataproc.projects.regions.workflowTemplates.getIamPolicy",
  8395. // "parameterOrder": [
  8396. // "resource"
  8397. // ],
  8398. // "parameters": {
  8399. // "resource": {
  8400. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  8401. // "location": "path",
  8402. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  8403. // "required": true,
  8404. // "type": "string"
  8405. // }
  8406. // },
  8407. // "path": "v1/{+resource}:getIamPolicy",
  8408. // "request": {
  8409. // "$ref": "GetIamPolicyRequest"
  8410. // },
  8411. // "response": {
  8412. // "$ref": "Policy"
  8413. // },
  8414. // "scopes": [
  8415. // "https://www.googleapis.com/auth/cloud-platform"
  8416. // ]
  8417. // }
  8418. }
  8419. // method id "dataproc.projects.regions.workflowTemplates.instantiate":
  8420. type ProjectsRegionsWorkflowTemplatesInstantiateCall struct {
  8421. s *Service
  8422. name string
  8423. instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest
  8424. urlParams_ gensupport.URLParams
  8425. ctx_ context.Context
  8426. header_ http.Header
  8427. }
  8428. // Instantiate: Instantiates a template and begins execution.The
  8429. // returned Operation can be used to track execution of workflow by
  8430. // polling operations.get. The Operation will complete when entire
  8431. // workflow is finished.The running workflow can be aborted via
  8432. // operations.cancel. This will cause any inflight jobs to be cancelled
  8433. // and workflow-owned clusters to be deleted.The Operation.metadata will
  8434. // be WorkflowMetadata.On successful completion, Operation.response will
  8435. // be Empty.
  8436. func (r *ProjectsRegionsWorkflowTemplatesService) Instantiate(name string, instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest) *ProjectsRegionsWorkflowTemplatesInstantiateCall {
  8437. c := &ProjectsRegionsWorkflowTemplatesInstantiateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8438. c.name = name
  8439. c.instantiateworkflowtemplaterequest = instantiateworkflowtemplaterequest
  8440. return c
  8441. }
  8442. // Fields allows partial responses to be retrieved. See
  8443. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8444. // for more information.
  8445. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesInstantiateCall {
  8446. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8447. return c
  8448. }
  8449. // Context sets the context to be used in this call's Do method. Any
  8450. // pending HTTP request will be aborted if the provided context is
  8451. // canceled.
  8452. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesInstantiateCall {
  8453. c.ctx_ = ctx
  8454. return c
  8455. }
  8456. // Header returns an http.Header that can be modified by the caller to
  8457. // add HTTP headers to the request.
  8458. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Header() http.Header {
  8459. if c.header_ == nil {
  8460. c.header_ = make(http.Header)
  8461. }
  8462. return c.header_
  8463. }
  8464. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) {
  8465. reqHeaders := make(http.Header)
  8466. for k, v := range c.header_ {
  8467. reqHeaders[k] = v
  8468. }
  8469. reqHeaders.Set("User-Agent", c.s.userAgent())
  8470. var body io.Reader = nil
  8471. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest)
  8472. if err != nil {
  8473. return nil, err
  8474. }
  8475. reqHeaders.Set("Content-Type", "application/json")
  8476. c.urlParams_.Set("alt", alt)
  8477. c.urlParams_.Set("prettyPrint", "false")
  8478. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:instantiate")
  8479. urls += "?" + c.urlParams_.Encode()
  8480. req, err := http.NewRequest("POST", urls, body)
  8481. if err != nil {
  8482. return nil, err
  8483. }
  8484. req.Header = reqHeaders
  8485. googleapi.Expand(req.URL, map[string]string{
  8486. "name": c.name,
  8487. })
  8488. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8489. }
  8490. // Do executes the "dataproc.projects.regions.workflowTemplates.instantiate" call.
  8491. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8492. // status code is an error. Response headers are in either
  8493. // *Operation.ServerResponse.Header or (if a response was returned at
  8494. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8495. // to check whether the returned error was because
  8496. // http.StatusNotModified was returned.
  8497. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8498. gensupport.SetOptions(c.urlParams_, opts...)
  8499. res, err := c.doRequest("json")
  8500. if res != nil && res.StatusCode == http.StatusNotModified {
  8501. if res.Body != nil {
  8502. res.Body.Close()
  8503. }
  8504. return nil, &googleapi.Error{
  8505. Code: res.StatusCode,
  8506. Header: res.Header,
  8507. }
  8508. }
  8509. if err != nil {
  8510. return nil, err
  8511. }
  8512. defer googleapi.CloseBody(res)
  8513. if err := googleapi.CheckResponse(res); err != nil {
  8514. return nil, err
  8515. }
  8516. ret := &Operation{
  8517. ServerResponse: googleapi.ServerResponse{
  8518. Header: res.Header,
  8519. HTTPStatusCode: res.StatusCode,
  8520. },
  8521. }
  8522. target := &ret
  8523. if err := gensupport.DecodeResponse(target, res); err != nil {
  8524. return nil, err
  8525. }
  8526. return ret, nil
  8527. // {
  8528. // "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.",
  8529. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:instantiate",
  8530. // "httpMethod": "POST",
  8531. // "id": "dataproc.projects.regions.workflowTemplates.instantiate",
  8532. // "parameterOrder": [
  8533. // "name"
  8534. // ],
  8535. // "parameters": {
  8536. // "name": {
  8537. // "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}",
  8538. // "location": "path",
  8539. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  8540. // "required": true,
  8541. // "type": "string"
  8542. // }
  8543. // },
  8544. // "path": "v1/{+name}:instantiate",
  8545. // "request": {
  8546. // "$ref": "InstantiateWorkflowTemplateRequest"
  8547. // },
  8548. // "response": {
  8549. // "$ref": "Operation"
  8550. // },
  8551. // "scopes": [
  8552. // "https://www.googleapis.com/auth/cloud-platform"
  8553. // ]
  8554. // }
  8555. }
  8556. // method id "dataproc.projects.regions.workflowTemplates.instantiateInline":
  8557. type ProjectsRegionsWorkflowTemplatesInstantiateInlineCall struct {
  8558. s *Service
  8559. parent string
  8560. workflowtemplate *WorkflowTemplate
  8561. urlParams_ gensupport.URLParams
  8562. ctx_ context.Context
  8563. header_ http.Header
  8564. }
  8565. // InstantiateInline: Instantiates a template and begins execution.This
  8566. // method is equivalent to executing the sequence
  8567. // CreateWorkflowTemplate, InstantiateWorkflowTemplate,
  8568. // DeleteWorkflowTemplate.The returned Operation can be used to track
  8569. // execution of workflow by polling operations.get. The Operation will
  8570. // complete when entire workflow is finished.The running workflow can be
  8571. // aborted via operations.cancel. This will cause any inflight jobs to
  8572. // be cancelled and workflow-owned clusters to be deleted.The
  8573. // Operation.metadata will be WorkflowMetadata.On successful completion,
  8574. // Operation.response will be Empty.
  8575. func (r *ProjectsRegionsWorkflowTemplatesService) InstantiateInline(parent string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall {
  8576. c := &ProjectsRegionsWorkflowTemplatesInstantiateInlineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8577. c.parent = parent
  8578. c.workflowtemplate = workflowtemplate
  8579. return c
  8580. }
  8581. // RequestId sets the optional parameter "requestId": A tag that
  8582. // prevents multiple concurrent workflow instances with the same tag
  8583. // from running. This mitigates risk of concurrent instances started due
  8584. // to retries.It is recommended to always set this value to a UUID
  8585. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag
  8586. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  8587. // and hyphens (-). The maximum length is 40 characters.
  8588. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) RequestId(requestId string) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall {
  8589. c.urlParams_.Set("requestId", requestId)
  8590. return c
  8591. }
  8592. // Fields allows partial responses to be retrieved. See
  8593. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8594. // for more information.
  8595. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall {
  8596. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8597. return c
  8598. }
  8599. // Context sets the context to be used in this call's Do method. Any
  8600. // pending HTTP request will be aborted if the provided context is
  8601. // canceled.
  8602. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall {
  8603. c.ctx_ = ctx
  8604. return c
  8605. }
  8606. // Header returns an http.Header that can be modified by the caller to
  8607. // add HTTP headers to the request.
  8608. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Header() http.Header {
  8609. if c.header_ == nil {
  8610. c.header_ = make(http.Header)
  8611. }
  8612. return c.header_
  8613. }
  8614. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) {
  8615. reqHeaders := make(http.Header)
  8616. for k, v := range c.header_ {
  8617. reqHeaders[k] = v
  8618. }
  8619. reqHeaders.Set("User-Agent", c.s.userAgent())
  8620. var body io.Reader = nil
  8621. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  8622. if err != nil {
  8623. return nil, err
  8624. }
  8625. reqHeaders.Set("Content-Type", "application/json")
  8626. c.urlParams_.Set("alt", alt)
  8627. c.urlParams_.Set("prettyPrint", "false")
  8628. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates:instantiateInline")
  8629. urls += "?" + c.urlParams_.Encode()
  8630. req, err := http.NewRequest("POST", urls, body)
  8631. if err != nil {
  8632. return nil, err
  8633. }
  8634. req.Header = reqHeaders
  8635. googleapi.Expand(req.URL, map[string]string{
  8636. "parent": c.parent,
  8637. })
  8638. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8639. }
  8640. // Do executes the "dataproc.projects.regions.workflowTemplates.instantiateInline" call.
  8641. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8642. // status code is an error. Response headers are in either
  8643. // *Operation.ServerResponse.Header or (if a response was returned at
  8644. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8645. // to check whether the returned error was because
  8646. // http.StatusNotModified was returned.
  8647. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8648. gensupport.SetOptions(c.urlParams_, opts...)
  8649. res, err := c.doRequest("json")
  8650. if res != nil && res.StatusCode == http.StatusNotModified {
  8651. if res.Body != nil {
  8652. res.Body.Close()
  8653. }
  8654. return nil, &googleapi.Error{
  8655. Code: res.StatusCode,
  8656. Header: res.Header,
  8657. }
  8658. }
  8659. if err != nil {
  8660. return nil, err
  8661. }
  8662. defer googleapi.CloseBody(res)
  8663. if err := googleapi.CheckResponse(res); err != nil {
  8664. return nil, err
  8665. }
  8666. ret := &Operation{
  8667. ServerResponse: googleapi.ServerResponse{
  8668. Header: res.Header,
  8669. HTTPStatusCode: res.StatusCode,
  8670. },
  8671. }
  8672. target := &ret
  8673. if err := gensupport.DecodeResponse(target, res); err != nil {
  8674. return nil, err
  8675. }
  8676. return ret, nil
  8677. // {
  8678. // "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.",
  8679. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates:instantiateInline",
  8680. // "httpMethod": "POST",
  8681. // "id": "dataproc.projects.regions.workflowTemplates.instantiateInline",
  8682. // "parameterOrder": [
  8683. // "parent"
  8684. // ],
  8685. // "parameters": {
  8686. // "parent": {
  8687. // "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}",
  8688. // "location": "path",
  8689. // "pattern": "^projects/[^/]+/regions/[^/]+$",
  8690. // "required": true,
  8691. // "type": "string"
  8692. // },
  8693. // "requestId": {
  8694. // "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.",
  8695. // "location": "query",
  8696. // "type": "string"
  8697. // }
  8698. // },
  8699. // "path": "v1/{+parent}/workflowTemplates:instantiateInline",
  8700. // "request": {
  8701. // "$ref": "WorkflowTemplate"
  8702. // },
  8703. // "response": {
  8704. // "$ref": "Operation"
  8705. // },
  8706. // "scopes": [
  8707. // "https://www.googleapis.com/auth/cloud-platform"
  8708. // ]
  8709. // }
  8710. }
  8711. // method id "dataproc.projects.regions.workflowTemplates.list":
  8712. type ProjectsRegionsWorkflowTemplatesListCall struct {
  8713. s *Service
  8714. parent string
  8715. urlParams_ gensupport.URLParams
  8716. ifNoneMatch_ string
  8717. ctx_ context.Context
  8718. header_ http.Header
  8719. }
  8720. // List: Lists workflows that match the specified filter in the request.
  8721. func (r *ProjectsRegionsWorkflowTemplatesService) List(parent string) *ProjectsRegionsWorkflowTemplatesListCall {
  8722. c := &ProjectsRegionsWorkflowTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8723. c.parent = parent
  8724. return c
  8725. }
  8726. // PageSize sets the optional parameter "pageSize": The maximum number
  8727. // of results to return in each response.
  8728. func (c *ProjectsRegionsWorkflowTemplatesListCall) PageSize(pageSize int64) *ProjectsRegionsWorkflowTemplatesListCall {
  8729. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8730. return c
  8731. }
  8732. // PageToken sets the optional parameter "pageToken": The page token,
  8733. // returned by a previous call, to request the next page of results.
  8734. func (c *ProjectsRegionsWorkflowTemplatesListCall) PageToken(pageToken string) *ProjectsRegionsWorkflowTemplatesListCall {
  8735. c.urlParams_.Set("pageToken", pageToken)
  8736. return c
  8737. }
  8738. // Fields allows partial responses to be retrieved. See
  8739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8740. // for more information.
  8741. func (c *ProjectsRegionsWorkflowTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesListCall {
  8742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8743. return c
  8744. }
  8745. // IfNoneMatch sets the optional parameter which makes the operation
  8746. // fail if the object's ETag matches the given value. This is useful for
  8747. // getting updates only after the object has changed since the last
  8748. // request. Use googleapi.IsNotModified to check whether the response
  8749. // error from Do is the result of In-None-Match.
  8750. func (c *ProjectsRegionsWorkflowTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesListCall {
  8751. c.ifNoneMatch_ = entityTag
  8752. return c
  8753. }
  8754. // Context sets the context to be used in this call's Do method. Any
  8755. // pending HTTP request will be aborted if the provided context is
  8756. // canceled.
  8757. func (c *ProjectsRegionsWorkflowTemplatesListCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesListCall {
  8758. c.ctx_ = ctx
  8759. return c
  8760. }
  8761. // Header returns an http.Header that can be modified by the caller to
  8762. // add HTTP headers to the request.
  8763. func (c *ProjectsRegionsWorkflowTemplatesListCall) Header() http.Header {
  8764. if c.header_ == nil {
  8765. c.header_ = make(http.Header)
  8766. }
  8767. return c.header_
  8768. }
  8769. func (c *ProjectsRegionsWorkflowTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  8770. reqHeaders := make(http.Header)
  8771. for k, v := range c.header_ {
  8772. reqHeaders[k] = v
  8773. }
  8774. reqHeaders.Set("User-Agent", c.s.userAgent())
  8775. if c.ifNoneMatch_ != "" {
  8776. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8777. }
  8778. var body io.Reader = nil
  8779. c.urlParams_.Set("alt", alt)
  8780. c.urlParams_.Set("prettyPrint", "false")
  8781. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+parent}/workflowTemplates")
  8782. urls += "?" + c.urlParams_.Encode()
  8783. req, err := http.NewRequest("GET", urls, body)
  8784. if err != nil {
  8785. return nil, err
  8786. }
  8787. req.Header = reqHeaders
  8788. googleapi.Expand(req.URL, map[string]string{
  8789. "parent": c.parent,
  8790. })
  8791. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8792. }
  8793. // Do executes the "dataproc.projects.regions.workflowTemplates.list" call.
  8794. // Exactly one of *ListWorkflowTemplatesResponse or error will be
  8795. // non-nil. Any non-2xx status code is an error. Response headers are in
  8796. // either *ListWorkflowTemplatesResponse.ServerResponse.Header or (if a
  8797. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8798. // googleapi.IsNotModified to check whether the returned error was
  8799. // because http.StatusNotModified was returned.
  8800. func (c *ProjectsRegionsWorkflowTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowTemplatesResponse, error) {
  8801. gensupport.SetOptions(c.urlParams_, opts...)
  8802. res, err := c.doRequest("json")
  8803. if res != nil && res.StatusCode == http.StatusNotModified {
  8804. if res.Body != nil {
  8805. res.Body.Close()
  8806. }
  8807. return nil, &googleapi.Error{
  8808. Code: res.StatusCode,
  8809. Header: res.Header,
  8810. }
  8811. }
  8812. if err != nil {
  8813. return nil, err
  8814. }
  8815. defer googleapi.CloseBody(res)
  8816. if err := googleapi.CheckResponse(res); err != nil {
  8817. return nil, err
  8818. }
  8819. ret := &ListWorkflowTemplatesResponse{
  8820. ServerResponse: googleapi.ServerResponse{
  8821. Header: res.Header,
  8822. HTTPStatusCode: res.StatusCode,
  8823. },
  8824. }
  8825. target := &ret
  8826. if err := gensupport.DecodeResponse(target, res); err != nil {
  8827. return nil, err
  8828. }
  8829. return ret, nil
  8830. // {
  8831. // "description": "Lists workflows that match the specified filter in the request.",
  8832. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates",
  8833. // "httpMethod": "GET",
  8834. // "id": "dataproc.projects.regions.workflowTemplates.list",
  8835. // "parameterOrder": [
  8836. // "parent"
  8837. // ],
  8838. // "parameters": {
  8839. // "pageSize": {
  8840. // "description": "Optional. The maximum number of results to return in each response.",
  8841. // "format": "int32",
  8842. // "location": "query",
  8843. // "type": "integer"
  8844. // },
  8845. // "pageToken": {
  8846. // "description": "Optional. The page token, returned by a previous call, to request the next page of results.",
  8847. // "location": "query",
  8848. // "type": "string"
  8849. // },
  8850. // "parent": {
  8851. // "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}",
  8852. // "location": "path",
  8853. // "pattern": "^projects/[^/]+/regions/[^/]+$",
  8854. // "required": true,
  8855. // "type": "string"
  8856. // }
  8857. // },
  8858. // "path": "v1/{+parent}/workflowTemplates",
  8859. // "response": {
  8860. // "$ref": "ListWorkflowTemplatesResponse"
  8861. // },
  8862. // "scopes": [
  8863. // "https://www.googleapis.com/auth/cloud-platform"
  8864. // ]
  8865. // }
  8866. }
  8867. // Pages invokes f for each page of results.
  8868. // A non-nil error returned from f will halt the iteration.
  8869. // The provided context supersedes any context provided to the Context method.
  8870. func (c *ProjectsRegionsWorkflowTemplatesListCall) Pages(ctx context.Context, f func(*ListWorkflowTemplatesResponse) error) error {
  8871. c.ctx_ = ctx
  8872. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8873. for {
  8874. x, err := c.Do()
  8875. if err != nil {
  8876. return err
  8877. }
  8878. if err := f(x); err != nil {
  8879. return err
  8880. }
  8881. if x.NextPageToken == "" {
  8882. return nil
  8883. }
  8884. c.PageToken(x.NextPageToken)
  8885. }
  8886. }
  8887. // method id "dataproc.projects.regions.workflowTemplates.setIamPolicy":
  8888. type ProjectsRegionsWorkflowTemplatesSetIamPolicyCall struct {
  8889. s *Service
  8890. resource string
  8891. setiampolicyrequest *SetIamPolicyRequest
  8892. urlParams_ gensupport.URLParams
  8893. ctx_ context.Context
  8894. header_ http.Header
  8895. }
  8896. // SetIamPolicy: Sets the access control policy on the specified
  8897. // resource. Replaces any existing policy.
  8898. func (r *ProjectsRegionsWorkflowTemplatesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall {
  8899. c := &ProjectsRegionsWorkflowTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8900. c.resource = resource
  8901. c.setiampolicyrequest = setiampolicyrequest
  8902. return c
  8903. }
  8904. // Fields allows partial responses to be retrieved. See
  8905. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8906. // for more information.
  8907. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall {
  8908. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8909. return c
  8910. }
  8911. // Context sets the context to be used in this call's Do method. Any
  8912. // pending HTTP request will be aborted if the provided context is
  8913. // canceled.
  8914. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall {
  8915. c.ctx_ = ctx
  8916. return c
  8917. }
  8918. // Header returns an http.Header that can be modified by the caller to
  8919. // add HTTP headers to the request.
  8920. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Header() http.Header {
  8921. if c.header_ == nil {
  8922. c.header_ = make(http.Header)
  8923. }
  8924. return c.header_
  8925. }
  8926. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  8927. reqHeaders := make(http.Header)
  8928. for k, v := range c.header_ {
  8929. reqHeaders[k] = v
  8930. }
  8931. reqHeaders.Set("User-Agent", c.s.userAgent())
  8932. var body io.Reader = nil
  8933. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  8934. if err != nil {
  8935. return nil, err
  8936. }
  8937. reqHeaders.Set("Content-Type", "application/json")
  8938. c.urlParams_.Set("alt", alt)
  8939. c.urlParams_.Set("prettyPrint", "false")
  8940. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:setIamPolicy")
  8941. urls += "?" + c.urlParams_.Encode()
  8942. req, err := http.NewRequest("POST", urls, body)
  8943. if err != nil {
  8944. return nil, err
  8945. }
  8946. req.Header = reqHeaders
  8947. googleapi.Expand(req.URL, map[string]string{
  8948. "resource": c.resource,
  8949. })
  8950. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8951. }
  8952. // Do executes the "dataproc.projects.regions.workflowTemplates.setIamPolicy" call.
  8953. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  8954. // code is an error. Response headers are in either
  8955. // *Policy.ServerResponse.Header or (if a response was returned at all)
  8956. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8957. // check whether the returned error was because http.StatusNotModified
  8958. // was returned.
  8959. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  8960. gensupport.SetOptions(c.urlParams_, opts...)
  8961. res, err := c.doRequest("json")
  8962. if res != nil && res.StatusCode == http.StatusNotModified {
  8963. if res.Body != nil {
  8964. res.Body.Close()
  8965. }
  8966. return nil, &googleapi.Error{
  8967. Code: res.StatusCode,
  8968. Header: res.Header,
  8969. }
  8970. }
  8971. if err != nil {
  8972. return nil, err
  8973. }
  8974. defer googleapi.CloseBody(res)
  8975. if err := googleapi.CheckResponse(res); err != nil {
  8976. return nil, err
  8977. }
  8978. ret := &Policy{
  8979. ServerResponse: googleapi.ServerResponse{
  8980. Header: res.Header,
  8981. HTTPStatusCode: res.StatusCode,
  8982. },
  8983. }
  8984. target := &ret
  8985. if err := gensupport.DecodeResponse(target, res); err != nil {
  8986. return nil, err
  8987. }
  8988. return ret, nil
  8989. // {
  8990. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  8991. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:setIamPolicy",
  8992. // "httpMethod": "POST",
  8993. // "id": "dataproc.projects.regions.workflowTemplates.setIamPolicy",
  8994. // "parameterOrder": [
  8995. // "resource"
  8996. // ],
  8997. // "parameters": {
  8998. // "resource": {
  8999. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  9000. // "location": "path",
  9001. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  9002. // "required": true,
  9003. // "type": "string"
  9004. // }
  9005. // },
  9006. // "path": "v1/{+resource}:setIamPolicy",
  9007. // "request": {
  9008. // "$ref": "SetIamPolicyRequest"
  9009. // },
  9010. // "response": {
  9011. // "$ref": "Policy"
  9012. // },
  9013. // "scopes": [
  9014. // "https://www.googleapis.com/auth/cloud-platform"
  9015. // ]
  9016. // }
  9017. }
  9018. // method id "dataproc.projects.regions.workflowTemplates.testIamPermissions":
  9019. type ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall struct {
  9020. s *Service
  9021. resource string
  9022. testiampermissionsrequest *TestIamPermissionsRequest
  9023. urlParams_ gensupport.URLParams
  9024. ctx_ context.Context
  9025. header_ http.Header
  9026. }
  9027. // TestIamPermissions: Returns permissions that a caller has on the
  9028. // specified resource. If the resource does not exist, this will return
  9029. // an empty set of permissions, not a NOT_FOUND error.Note: This
  9030. // operation is designed to be used for building permission-aware UIs
  9031. // and command-line tools, not for authorization checking. This
  9032. // operation may "fail open" without warning.
  9033. func (r *ProjectsRegionsWorkflowTemplatesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall {
  9034. c := &ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9035. c.resource = resource
  9036. c.testiampermissionsrequest = testiampermissionsrequest
  9037. return c
  9038. }
  9039. // Fields allows partial responses to be retrieved. See
  9040. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9041. // for more information.
  9042. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall {
  9043. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9044. return c
  9045. }
  9046. // Context sets the context to be used in this call's Do method. Any
  9047. // pending HTTP request will be aborted if the provided context is
  9048. // canceled.
  9049. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall {
  9050. c.ctx_ = ctx
  9051. return c
  9052. }
  9053. // Header returns an http.Header that can be modified by the caller to
  9054. // add HTTP headers to the request.
  9055. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Header() http.Header {
  9056. if c.header_ == nil {
  9057. c.header_ = make(http.Header)
  9058. }
  9059. return c.header_
  9060. }
  9061. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  9062. reqHeaders := make(http.Header)
  9063. for k, v := range c.header_ {
  9064. reqHeaders[k] = v
  9065. }
  9066. reqHeaders.Set("User-Agent", c.s.userAgent())
  9067. var body io.Reader = nil
  9068. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  9069. if err != nil {
  9070. return nil, err
  9071. }
  9072. reqHeaders.Set("Content-Type", "application/json")
  9073. c.urlParams_.Set("alt", alt)
  9074. c.urlParams_.Set("prettyPrint", "false")
  9075. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+resource}:testIamPermissions")
  9076. urls += "?" + c.urlParams_.Encode()
  9077. req, err := http.NewRequest("POST", urls, body)
  9078. if err != nil {
  9079. return nil, err
  9080. }
  9081. req.Header = reqHeaders
  9082. googleapi.Expand(req.URL, map[string]string{
  9083. "resource": c.resource,
  9084. })
  9085. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9086. }
  9087. // Do executes the "dataproc.projects.regions.workflowTemplates.testIamPermissions" call.
  9088. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  9089. // Any non-2xx status code is an error. Response headers are in either
  9090. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  9091. // was returned at all) in error.(*googleapi.Error).Header. Use
  9092. // googleapi.IsNotModified to check whether the returned error was
  9093. // because http.StatusNotModified was returned.
  9094. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  9095. gensupport.SetOptions(c.urlParams_, opts...)
  9096. res, err := c.doRequest("json")
  9097. if res != nil && res.StatusCode == http.StatusNotModified {
  9098. if res.Body != nil {
  9099. res.Body.Close()
  9100. }
  9101. return nil, &googleapi.Error{
  9102. Code: res.StatusCode,
  9103. Header: res.Header,
  9104. }
  9105. }
  9106. if err != nil {
  9107. return nil, err
  9108. }
  9109. defer googleapi.CloseBody(res)
  9110. if err := googleapi.CheckResponse(res); err != nil {
  9111. return nil, err
  9112. }
  9113. ret := &TestIamPermissionsResponse{
  9114. ServerResponse: googleapi.ServerResponse{
  9115. Header: res.Header,
  9116. HTTPStatusCode: res.StatusCode,
  9117. },
  9118. }
  9119. target := &ret
  9120. if err := gensupport.DecodeResponse(target, res); err != nil {
  9121. return nil, err
  9122. }
  9123. return ret, nil
  9124. // {
  9125. // "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.",
  9126. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:testIamPermissions",
  9127. // "httpMethod": "POST",
  9128. // "id": "dataproc.projects.regions.workflowTemplates.testIamPermissions",
  9129. // "parameterOrder": [
  9130. // "resource"
  9131. // ],
  9132. // "parameters": {
  9133. // "resource": {
  9134. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  9135. // "location": "path",
  9136. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  9137. // "required": true,
  9138. // "type": "string"
  9139. // }
  9140. // },
  9141. // "path": "v1/{+resource}:testIamPermissions",
  9142. // "request": {
  9143. // "$ref": "TestIamPermissionsRequest"
  9144. // },
  9145. // "response": {
  9146. // "$ref": "TestIamPermissionsResponse"
  9147. // },
  9148. // "scopes": [
  9149. // "https://www.googleapis.com/auth/cloud-platform"
  9150. // ]
  9151. // }
  9152. }
  9153. // method id "dataproc.projects.regions.workflowTemplates.update":
  9154. type ProjectsRegionsWorkflowTemplatesUpdateCall struct {
  9155. s *Service
  9156. name string
  9157. workflowtemplate *WorkflowTemplate
  9158. urlParams_ gensupport.URLParams
  9159. ctx_ context.Context
  9160. header_ http.Header
  9161. }
  9162. // Update: Updates (replaces) workflow template. The updated template
  9163. // must contain version that matches the current server version.
  9164. func (r *ProjectsRegionsWorkflowTemplatesService) Update(name string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesUpdateCall {
  9165. c := &ProjectsRegionsWorkflowTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9166. c.name = name
  9167. c.workflowtemplate = workflowtemplate
  9168. return c
  9169. }
  9170. // Fields allows partial responses to be retrieved. See
  9171. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  9172. // for more information.
  9173. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesUpdateCall {
  9174. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9175. return c
  9176. }
  9177. // Context sets the context to be used in this call's Do method. Any
  9178. // pending HTTP request will be aborted if the provided context is
  9179. // canceled.
  9180. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesUpdateCall {
  9181. c.ctx_ = ctx
  9182. return c
  9183. }
  9184. // Header returns an http.Header that can be modified by the caller to
  9185. // add HTTP headers to the request.
  9186. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Header() http.Header {
  9187. if c.header_ == nil {
  9188. c.header_ = make(http.Header)
  9189. }
  9190. return c.header_
  9191. }
  9192. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  9193. reqHeaders := make(http.Header)
  9194. for k, v := range c.header_ {
  9195. reqHeaders[k] = v
  9196. }
  9197. reqHeaders.Set("User-Agent", c.s.userAgent())
  9198. var body io.Reader = nil
  9199. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  9200. if err != nil {
  9201. return nil, err
  9202. }
  9203. reqHeaders.Set("Content-Type", "application/json")
  9204. c.urlParams_.Set("alt", alt)
  9205. c.urlParams_.Set("prettyPrint", "false")
  9206. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  9207. urls += "?" + c.urlParams_.Encode()
  9208. req, err := http.NewRequest("PUT", urls, body)
  9209. if err != nil {
  9210. return nil, err
  9211. }
  9212. req.Header = reqHeaders
  9213. googleapi.Expand(req.URL, map[string]string{
  9214. "name": c.name,
  9215. })
  9216. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9217. }
  9218. // Do executes the "dataproc.projects.regions.workflowTemplates.update" call.
  9219. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  9220. // non-2xx status code is an error. Response headers are in either
  9221. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  9222. // returned at all) in error.(*googleapi.Error).Header. Use
  9223. // googleapi.IsNotModified to check whether the returned error was
  9224. // because http.StatusNotModified was returned.
  9225. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  9226. gensupport.SetOptions(c.urlParams_, opts...)
  9227. res, err := c.doRequest("json")
  9228. if res != nil && res.StatusCode == http.StatusNotModified {
  9229. if res.Body != nil {
  9230. res.Body.Close()
  9231. }
  9232. return nil, &googleapi.Error{
  9233. Code: res.StatusCode,
  9234. Header: res.Header,
  9235. }
  9236. }
  9237. if err != nil {
  9238. return nil, err
  9239. }
  9240. defer googleapi.CloseBody(res)
  9241. if err := googleapi.CheckResponse(res); err != nil {
  9242. return nil, err
  9243. }
  9244. ret := &WorkflowTemplate{
  9245. ServerResponse: googleapi.ServerResponse{
  9246. Header: res.Header,
  9247. HTTPStatusCode: res.StatusCode,
  9248. },
  9249. }
  9250. target := &ret
  9251. if err := gensupport.DecodeResponse(target, res); err != nil {
  9252. return nil, err
  9253. }
  9254. return ret, nil
  9255. // {
  9256. // "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version.",
  9257. // "flatPath": "v1/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}",
  9258. // "httpMethod": "PUT",
  9259. // "id": "dataproc.projects.regions.workflowTemplates.update",
  9260. // "parameterOrder": [
  9261. // "name"
  9262. // ],
  9263. // "parameters": {
  9264. // "name": {
  9265. // "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}",
  9266. // "location": "path",
  9267. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  9268. // "required": true,
  9269. // "type": "string"
  9270. // }
  9271. // },
  9272. // "path": "v1/{+name}",
  9273. // "request": {
  9274. // "$ref": "WorkflowTemplate"
  9275. // },
  9276. // "response": {
  9277. // "$ref": "WorkflowTemplate"
  9278. // },
  9279. // "scopes": [
  9280. // "https://www.googleapis.com/auth/cloud-platform"
  9281. // ]
  9282. // }
  9283. }