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.
 
 
 

9930 lines
377 KiB

  1. // Package dataproc provides access to the Cloud Dataproc API.
  2. //
  3. // See https://cloud.google.com/dataproc/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/dataproc/v1beta2"
  8. // ...
  9. // dataprocService, err := dataproc.New(oauthHttpClient)
  10. package dataproc // import "google.golang.org/api/dataproc/v1beta2"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "dataproc:v1beta2"
  41. const apiName = "dataproc"
  42. const apiVersion = "v1beta2"
  43. const basePath = "https://dataproc.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. )
  49. func New(client *http.Client) (*Service, error) {
  50. if client == nil {
  51. return nil, errors.New("client is nil")
  52. }
  53. s := &Service{client: client, BasePath: basePath}
  54. s.Projects = NewProjectsService(s)
  55. return s, nil
  56. }
  57. type Service struct {
  58. client *http.Client
  59. BasePath string // API endpoint base URL
  60. UserAgent string // optional additional User-Agent fragment
  61. Projects *ProjectsService
  62. }
  63. func (s *Service) userAgent() string {
  64. if s.UserAgent == "" {
  65. return googleapi.UserAgent
  66. }
  67. return googleapi.UserAgent + " " + s.UserAgent
  68. }
  69. func NewProjectsService(s *Service) *ProjectsService {
  70. rs := &ProjectsService{s: s}
  71. rs.Locations = NewProjectsLocationsService(s)
  72. rs.Regions = NewProjectsRegionsService(s)
  73. return rs
  74. }
  75. type ProjectsService struct {
  76. s *Service
  77. Locations *ProjectsLocationsService
  78. Regions *ProjectsRegionsService
  79. }
  80. func NewProjectsLocationsService(s *Service) *ProjectsLocationsService {
  81. rs := &ProjectsLocationsService{s: s}
  82. rs.WorkflowTemplates = NewProjectsLocationsWorkflowTemplatesService(s)
  83. return rs
  84. }
  85. type ProjectsLocationsService struct {
  86. s *Service
  87. WorkflowTemplates *ProjectsLocationsWorkflowTemplatesService
  88. }
  89. func NewProjectsLocationsWorkflowTemplatesService(s *Service) *ProjectsLocationsWorkflowTemplatesService {
  90. rs := &ProjectsLocationsWorkflowTemplatesService{s: s}
  91. return rs
  92. }
  93. type ProjectsLocationsWorkflowTemplatesService struct {
  94. s *Service
  95. }
  96. func NewProjectsRegionsService(s *Service) *ProjectsRegionsService {
  97. rs := &ProjectsRegionsService{s: s}
  98. rs.Clusters = NewProjectsRegionsClustersService(s)
  99. rs.Jobs = NewProjectsRegionsJobsService(s)
  100. rs.Operations = NewProjectsRegionsOperationsService(s)
  101. rs.WorkflowTemplates = NewProjectsRegionsWorkflowTemplatesService(s)
  102. return rs
  103. }
  104. type ProjectsRegionsService struct {
  105. s *Service
  106. Clusters *ProjectsRegionsClustersService
  107. Jobs *ProjectsRegionsJobsService
  108. Operations *ProjectsRegionsOperationsService
  109. WorkflowTemplates *ProjectsRegionsWorkflowTemplatesService
  110. }
  111. func NewProjectsRegionsClustersService(s *Service) *ProjectsRegionsClustersService {
  112. rs := &ProjectsRegionsClustersService{s: s}
  113. return rs
  114. }
  115. type ProjectsRegionsClustersService struct {
  116. s *Service
  117. }
  118. func NewProjectsRegionsJobsService(s *Service) *ProjectsRegionsJobsService {
  119. rs := &ProjectsRegionsJobsService{s: s}
  120. return rs
  121. }
  122. type ProjectsRegionsJobsService struct {
  123. s *Service
  124. }
  125. func NewProjectsRegionsOperationsService(s *Service) *ProjectsRegionsOperationsService {
  126. rs := &ProjectsRegionsOperationsService{s: s}
  127. return rs
  128. }
  129. type ProjectsRegionsOperationsService struct {
  130. s *Service
  131. }
  132. func NewProjectsRegionsWorkflowTemplatesService(s *Service) *ProjectsRegionsWorkflowTemplatesService {
  133. rs := &ProjectsRegionsWorkflowTemplatesService{s: s}
  134. return rs
  135. }
  136. type ProjectsRegionsWorkflowTemplatesService struct {
  137. s *Service
  138. }
  139. // AcceleratorConfig: Specifies the type and number of accelerator cards
  140. // attached to the instances of an instance group (see GPUs on Compute
  141. // Engine).
  142. type AcceleratorConfig struct {
  143. // AcceleratorCount: The number of the accelerator cards of this type
  144. // exposed to this instance.
  145. AcceleratorCount int64 `json:"acceleratorCount,omitempty"`
  146. // AcceleratorTypeUri: Full URL, partial URI, or short name of the
  147. // accelerator type resource to expose to this instance. See Compute
  148. // Engine AcceleratorTypes(
  149. // /compute/docs/reference/beta/acceleratorTypes)Examples *
  150. // https://www.googleapis.com/compute/beta/projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * projects/[project_id]/zones/us-east1-a/acceleratorTypes/nvidia-tesla-k80 * nvidia-tesla-k80Auto Zone Exception: If you are using the Cloud Dataproc Auto Zone Placement feature, you must use the short name of the accelerator type resource, for example,
  151. // nvidia-tesla-k80.
  152. AcceleratorTypeUri string `json:"acceleratorTypeUri,omitempty"`
  153. // ForceSendFields is a list of field names (e.g. "AcceleratorCount") to
  154. // unconditionally include in API requests. By default, fields with
  155. // empty values are omitted from API requests. However, any non-pointer,
  156. // non-interface field appearing in ForceSendFields will be sent to the
  157. // server regardless of whether the field is empty or not. This may be
  158. // used to include empty fields in Patch requests.
  159. ForceSendFields []string `json:"-"`
  160. // NullFields is a list of field names (e.g. "AcceleratorCount") to
  161. // include in API requests with the JSON null value. By default, fields
  162. // with empty values are omitted from API requests. However, any field
  163. // with an empty value appearing in NullFields will be sent to the
  164. // server as null. It is an error if a field in this list has a
  165. // non-empty value. This may be used to include null fields in Patch
  166. // requests.
  167. NullFields []string `json:"-"`
  168. }
  169. func (s *AcceleratorConfig) MarshalJSON() ([]byte, error) {
  170. type NoMethod AcceleratorConfig
  171. raw := NoMethod(*s)
  172. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  173. }
  174. // Binding: Associates members with a role.
  175. type Binding struct {
  176. // Members: Specifies the identities requesting access for a Cloud
  177. // Platform resource. members can have the following values:
  178. // allUsers: A special identifier that represents anyone who is on the
  179. // internet; with or without a Google account.
  180. // allAuthenticatedUsers: A special identifier that represents anyone
  181. // who is authenticated with a Google account or a service
  182. // account.
  183. // user:{emailid}: An email address that represents a specific Google
  184. // account. For example, alice@gmail.com .
  185. // serviceAccount:{emailid}: An email address that represents a service
  186. // account. For example,
  187. // my-other-app@appspot.gserviceaccount.com.
  188. // group:{emailid}: An email address that represents a Google group.
  189. // For example, admins@example.com.
  190. // domain:{domain}: A Google Apps domain name that represents all the
  191. // users of that domain. For example, google.com or example.com.
  192. Members []string `json:"members,omitempty"`
  193. // Role: Role that is assigned to members. For example, roles/viewer,
  194. // roles/editor, or roles/owner. Required
  195. Role string `json:"role,omitempty"`
  196. // ForceSendFields is a list of field names (e.g. "Members") to
  197. // unconditionally include in API requests. By default, fields with
  198. // empty values are omitted from API requests. However, any non-pointer,
  199. // non-interface field appearing in ForceSendFields will be sent to the
  200. // server regardless of whether the field is empty or not. This may be
  201. // used to include empty fields in Patch requests.
  202. ForceSendFields []string `json:"-"`
  203. // NullFields is a list of field names (e.g. "Members") to include in
  204. // API requests with the JSON null value. By default, fields with empty
  205. // values are omitted from API requests. However, any field with an
  206. // empty value appearing in NullFields will be sent to the server as
  207. // null. It is an error if a field in this list has a non-empty value.
  208. // This may be used to include null fields in Patch requests.
  209. NullFields []string `json:"-"`
  210. }
  211. func (s *Binding) MarshalJSON() ([]byte, error) {
  212. type NoMethod Binding
  213. raw := NoMethod(*s)
  214. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  215. }
  216. // CancelJobRequest: A request to cancel a job.
  217. type CancelJobRequest struct {
  218. }
  219. // Cluster: Describes the identifying information, config, and status of
  220. // a cluster of Compute Engine instances.
  221. type Cluster struct {
  222. // ClusterName: Required. The cluster name. Cluster names within a
  223. // project must be unique. Names of deleted clusters can be reused.
  224. ClusterName string `json:"clusterName,omitempty"`
  225. // ClusterUuid: Output only. A cluster UUID (Unique Universal
  226. // Identifier). Cloud Dataproc generates this value when it creates the
  227. // cluster.
  228. ClusterUuid string `json:"clusterUuid,omitempty"`
  229. // Config: Required. The cluster config. Note that Cloud Dataproc may
  230. // set default values, and values may change when clusters are updated.
  231. Config *ClusterConfig `json:"config,omitempty"`
  232. // Labels: Optional. The labels to associate with this cluster. Label
  233. // keys must contain 1 to 63 characters, and must conform to RFC 1035
  234. // (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty,
  235. // but, if present, must contain 1 to 63 characters, and must conform to
  236. // RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32
  237. // labels can be associated with a cluster.
  238. Labels map[string]string `json:"labels,omitempty"`
  239. // Metrics: Contains cluster daemon metrics such as HDFS and YARN
  240. // stats.Beta Feature: This report is available for testing purposes
  241. // only. It may be changed before final release.
  242. Metrics *ClusterMetrics `json:"metrics,omitempty"`
  243. // ProjectId: Required. The Google Cloud Platform project ID that the
  244. // cluster belongs to.
  245. ProjectId string `json:"projectId,omitempty"`
  246. // Status: Output only. Cluster status.
  247. Status *ClusterStatus `json:"status,omitempty"`
  248. // StatusHistory: Output only. The previous cluster status.
  249. StatusHistory []*ClusterStatus `json:"statusHistory,omitempty"`
  250. // ServerResponse contains the HTTP response code and headers from the
  251. // server.
  252. googleapi.ServerResponse `json:"-"`
  253. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  254. // unconditionally include in API requests. By default, fields with
  255. // empty values are omitted from API requests. However, any non-pointer,
  256. // non-interface field appearing in ForceSendFields will be sent to the
  257. // server regardless of whether the field is empty or not. This may be
  258. // used to include empty fields in Patch requests.
  259. ForceSendFields []string `json:"-"`
  260. // NullFields is a list of field names (e.g. "ClusterName") to include
  261. // in API requests with the JSON null value. By default, fields with
  262. // empty values are omitted from API requests. However, any field with
  263. // an empty value appearing in NullFields will be sent to the server as
  264. // null. It is an error if a field in this list has a non-empty value.
  265. // This may be used to include null fields in Patch requests.
  266. NullFields []string `json:"-"`
  267. }
  268. func (s *Cluster) MarshalJSON() ([]byte, error) {
  269. type NoMethod Cluster
  270. raw := NoMethod(*s)
  271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  272. }
  273. // ClusterConfig: The cluster config.
  274. type ClusterConfig struct {
  275. // ConfigBucket: Optional. A Cloud Storage staging bucket used for
  276. // sharing generated SSH keys and config. If you do not specify a
  277. // staging bucket, Cloud Dataproc will determine an appropriate Cloud
  278. // Storage location (US, ASIA, or EU) for your cluster's staging bucket
  279. // according to the Google Compute Engine zone where your cluster is
  280. // deployed, and then it will create and manage this project-level,
  281. // per-location bucket for you.
  282. ConfigBucket string `json:"configBucket,omitempty"`
  283. // EncryptionConfig: Optional. Encryption settings for the cluster.
  284. EncryptionConfig *EncryptionConfig `json:"encryptionConfig,omitempty"`
  285. // GceClusterConfig: Required. The shared Compute Engine config settings
  286. // for all instances in a cluster.
  287. GceClusterConfig *GceClusterConfig `json:"gceClusterConfig,omitempty"`
  288. // InitializationActions: Optional. Commands to execute on each node
  289. // after config is completed. By default, executables are run on master
  290. // and all worker nodes. You can test a node's <code>role</code>
  291. // metadata to run an executable on a master or worker node, as shown
  292. // below using curl (you can also use wget):
  293. // ROLE=$(curl -H Metadata-Flavor:Google
  294. // http://metadata/computeMetadata/v1beta2/instance/attributes/dataproc-role)
  295. // if [[ "${ROLE}" == 'Master' ]]; then
  296. // ... master specific actions ...
  297. // else
  298. // ... worker specific actions ...
  299. // fi
  300. //
  301. InitializationActions []*NodeInitializationAction `json:"initializationActions,omitempty"`
  302. // LifecycleConfig: Optional. The config setting for auto delete cluster
  303. // schedule.
  304. LifecycleConfig *LifecycleConfig `json:"lifecycleConfig,omitempty"`
  305. // MasterConfig: Optional. The Compute Engine config settings for the
  306. // master instance in a cluster.
  307. MasterConfig *InstanceGroupConfig `json:"masterConfig,omitempty"`
  308. // SecondaryWorkerConfig: Optional. The Compute Engine config settings
  309. // for additional worker instances in a cluster.
  310. SecondaryWorkerConfig *InstanceGroupConfig `json:"secondaryWorkerConfig,omitempty"`
  311. // SoftwareConfig: Optional. The config settings for software inside the
  312. // cluster.
  313. SoftwareConfig *SoftwareConfig `json:"softwareConfig,omitempty"`
  314. // WorkerConfig: Optional. The Compute Engine config settings for worker
  315. // instances in a cluster.
  316. WorkerConfig *InstanceGroupConfig `json:"workerConfig,omitempty"`
  317. // ForceSendFields is a list of field names (e.g. "ConfigBucket") to
  318. // unconditionally include in API requests. By default, fields with
  319. // empty values are omitted from API requests. However, any non-pointer,
  320. // non-interface field appearing in ForceSendFields will be sent to the
  321. // server regardless of whether the field is empty or not. This may be
  322. // used to include empty fields in Patch requests.
  323. ForceSendFields []string `json:"-"`
  324. // NullFields is a list of field names (e.g. "ConfigBucket") to include
  325. // in API requests with the JSON null value. By default, fields with
  326. // empty values are omitted from API requests. However, any field with
  327. // an empty value appearing in NullFields will be sent to the server as
  328. // null. It is an error if a field in this list has a non-empty value.
  329. // This may be used to include null fields in Patch requests.
  330. NullFields []string `json:"-"`
  331. }
  332. func (s *ClusterConfig) MarshalJSON() ([]byte, error) {
  333. type NoMethod ClusterConfig
  334. raw := NoMethod(*s)
  335. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  336. }
  337. // ClusterMetrics: Contains cluster daemon metrics, such as HDFS and
  338. // YARN stats.Beta Feature: This report is available for testing
  339. // purposes only. It may be changed before final release.
  340. type ClusterMetrics struct {
  341. // HdfsMetrics: The HDFS metrics.
  342. HdfsMetrics map[string]string `json:"hdfsMetrics,omitempty"`
  343. // YarnMetrics: The YARN metrics.
  344. YarnMetrics map[string]string `json:"yarnMetrics,omitempty"`
  345. // ForceSendFields is a list of field names (e.g. "HdfsMetrics") to
  346. // unconditionally include in API requests. By default, fields with
  347. // empty values are omitted from API requests. However, any non-pointer,
  348. // non-interface field appearing in ForceSendFields will be sent to the
  349. // server regardless of whether the field is empty or not. This may be
  350. // used to include empty fields in Patch requests.
  351. ForceSendFields []string `json:"-"`
  352. // NullFields is a list of field names (e.g. "HdfsMetrics") to include
  353. // in API requests with the JSON null value. By default, fields with
  354. // empty values are omitted from API requests. However, any field with
  355. // an empty value appearing in NullFields will be sent to the server as
  356. // null. It is an error if a field in this list has a non-empty value.
  357. // This may be used to include null fields in Patch requests.
  358. NullFields []string `json:"-"`
  359. }
  360. func (s *ClusterMetrics) MarshalJSON() ([]byte, error) {
  361. type NoMethod ClusterMetrics
  362. raw := NoMethod(*s)
  363. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  364. }
  365. // ClusterOperation: The cluster operation triggered by a workflow.
  366. type ClusterOperation struct {
  367. // Done: Output only. Indicates the operation is done.
  368. Done bool `json:"done,omitempty"`
  369. // Error: Output only. Error, if operation failed.
  370. Error string `json:"error,omitempty"`
  371. // OperationId: Output only. The id of the cluster operation.
  372. OperationId string `json:"operationId,omitempty"`
  373. // ForceSendFields is a list of field names (e.g. "Done") to
  374. // unconditionally include in API requests. By default, fields with
  375. // empty values are omitted from API requests. However, any non-pointer,
  376. // non-interface field appearing in ForceSendFields will be sent to the
  377. // server regardless of whether the field is empty or not. This may be
  378. // used to include empty fields in Patch requests.
  379. ForceSendFields []string `json:"-"`
  380. // NullFields is a list of field names (e.g. "Done") to include in API
  381. // requests with the JSON null value. By default, fields with empty
  382. // values are omitted from API requests. However, any field with an
  383. // empty value appearing in NullFields will be sent to the server as
  384. // null. It is an error if a field in this list has a non-empty value.
  385. // This may be used to include null fields in Patch requests.
  386. NullFields []string `json:"-"`
  387. }
  388. func (s *ClusterOperation) MarshalJSON() ([]byte, error) {
  389. type NoMethod ClusterOperation
  390. raw := NoMethod(*s)
  391. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  392. }
  393. // ClusterOperationMetadata: Metadata describing the operation.
  394. type ClusterOperationMetadata struct {
  395. // ClusterName: Output only. Name of the cluster for the operation.
  396. ClusterName string `json:"clusterName,omitempty"`
  397. // ClusterUuid: Output only. Cluster UUID for the operation.
  398. ClusterUuid string `json:"clusterUuid,omitempty"`
  399. // Description: Output only. Short description of operation.
  400. Description string `json:"description,omitempty"`
  401. // Labels: Output only. Labels associated with the operation
  402. Labels map[string]string `json:"labels,omitempty"`
  403. // OperationType: Output only. The operation type.
  404. OperationType string `json:"operationType,omitempty"`
  405. // Status: Output only. Current operation status.
  406. Status *ClusterOperationStatus `json:"status,omitempty"`
  407. // StatusHistory: Output only. The previous operation status.
  408. StatusHistory []*ClusterOperationStatus `json:"statusHistory,omitempty"`
  409. // Warnings: Output only. Errors encountered during operation execution.
  410. Warnings []string `json:"warnings,omitempty"`
  411. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  412. // unconditionally include in API requests. By default, fields with
  413. // empty values are omitted from API requests. However, any non-pointer,
  414. // non-interface field appearing in ForceSendFields will be sent to the
  415. // server regardless of whether the field is empty or not. This may be
  416. // used to include empty fields in Patch requests.
  417. ForceSendFields []string `json:"-"`
  418. // NullFields is a list of field names (e.g. "ClusterName") to include
  419. // in API requests with the JSON null value. By default, fields with
  420. // empty values are omitted from API requests. However, any field with
  421. // an empty value appearing in NullFields will be sent to the server as
  422. // null. It is an error if a field in this list has a non-empty value.
  423. // This may be used to include null fields in Patch requests.
  424. NullFields []string `json:"-"`
  425. }
  426. func (s *ClusterOperationMetadata) MarshalJSON() ([]byte, error) {
  427. type NoMethod ClusterOperationMetadata
  428. raw := NoMethod(*s)
  429. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  430. }
  431. // ClusterOperationStatus: The status of the operation.
  432. type ClusterOperationStatus struct {
  433. // Details: Output only. A message containing any operation metadata
  434. // details.
  435. Details string `json:"details,omitempty"`
  436. // InnerState: Output only. A message containing the detailed operation
  437. // state.
  438. InnerState string `json:"innerState,omitempty"`
  439. // State: Output only. A message containing the operation state.
  440. //
  441. // Possible values:
  442. // "UNKNOWN" - Unused.
  443. // "PENDING" - The operation has been created.
  444. // "RUNNING" - The operation is running.
  445. // "DONE" - The operation is done; either cancelled or completed.
  446. State string `json:"state,omitempty"`
  447. // StateStartTime: Output only. The time this state was entered.
  448. StateStartTime string `json:"stateStartTime,omitempty"`
  449. // ForceSendFields is a list of field names (e.g. "Details") to
  450. // unconditionally include in API requests. By default, fields with
  451. // empty values are omitted from API requests. However, any non-pointer,
  452. // non-interface field appearing in ForceSendFields will be sent to the
  453. // server regardless of whether the field is empty or not. This may be
  454. // used to include empty fields in Patch requests.
  455. ForceSendFields []string `json:"-"`
  456. // NullFields is a list of field names (e.g. "Details") to include in
  457. // API requests with the JSON null value. By default, fields with empty
  458. // values are omitted from API requests. However, any field with an
  459. // empty value appearing in NullFields will be sent to the server as
  460. // null. It is an error if a field in this list has a non-empty value.
  461. // This may be used to include null fields in Patch requests.
  462. NullFields []string `json:"-"`
  463. }
  464. func (s *ClusterOperationStatus) MarshalJSON() ([]byte, error) {
  465. type NoMethod ClusterOperationStatus
  466. raw := NoMethod(*s)
  467. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  468. }
  469. // ClusterSelector: A selector that chooses target cluster for jobs
  470. // based on metadata.
  471. type ClusterSelector struct {
  472. // ClusterLabels: Required. The cluster labels. Cluster must have all
  473. // labels to match.
  474. ClusterLabels map[string]string `json:"clusterLabels,omitempty"`
  475. // Zone: Optional. The zone where workflow process executes. This
  476. // parameter does not affect the selection of the cluster.If
  477. // unspecified, the zone of the first cluster matching the selector is
  478. // used.
  479. Zone string `json:"zone,omitempty"`
  480. // ForceSendFields is a list of field names (e.g. "ClusterLabels") to
  481. // unconditionally include in API requests. By default, fields with
  482. // empty values are omitted from API requests. However, any non-pointer,
  483. // non-interface field appearing in ForceSendFields will be sent to the
  484. // server regardless of whether the field is empty or not. This may be
  485. // used to include empty fields in Patch requests.
  486. ForceSendFields []string `json:"-"`
  487. // NullFields is a list of field names (e.g. "ClusterLabels") to include
  488. // in API requests with the JSON null value. By default, fields with
  489. // empty values are omitted from API requests. However, any field with
  490. // an empty value appearing in NullFields will be sent to the server as
  491. // null. It is an error if a field in this list has a non-empty value.
  492. // This may be used to include null fields in Patch requests.
  493. NullFields []string `json:"-"`
  494. }
  495. func (s *ClusterSelector) MarshalJSON() ([]byte, error) {
  496. type NoMethod ClusterSelector
  497. raw := NoMethod(*s)
  498. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  499. }
  500. // ClusterStatus: The status of a cluster and its instances.
  501. type ClusterStatus struct {
  502. // Detail: Output only. Optional details of cluster's state.
  503. Detail string `json:"detail,omitempty"`
  504. // State: Output only. The cluster's state.
  505. //
  506. // Possible values:
  507. // "UNKNOWN" - The cluster state is unknown.
  508. // "CREATING" - The cluster is being created and set up. It is not
  509. // ready for use.
  510. // "RUNNING" - The cluster is currently running and healthy. It is
  511. // ready for use.
  512. // "ERROR" - The cluster encountered an error. It is not ready for
  513. // use.
  514. // "DELETING" - The cluster is being deleted. It cannot be used.
  515. // "UPDATING" - The cluster is being updated. It continues to accept
  516. // and process jobs.
  517. State string `json:"state,omitempty"`
  518. // StateStartTime: Output only. Time when this state was entered.
  519. StateStartTime string `json:"stateStartTime,omitempty"`
  520. // Substate: Output only. Additional state information that includes
  521. // status reported by the agent.
  522. //
  523. // Possible values:
  524. // "UNSPECIFIED" - The cluster substate is unknown.
  525. // "UNHEALTHY" - The cluster is known to be in an unhealthy state (for
  526. // example, critical daemons are not running or HDFS capacity is
  527. // exhausted).Applies to RUNNING state.
  528. // "STALE_STATUS" - The agent-reported status is out of date (may
  529. // occur if Cloud Dataproc loses communication with Agent).Applies to
  530. // RUNNING state.
  531. Substate string `json:"substate,omitempty"`
  532. // ForceSendFields is a list of field names (e.g. "Detail") to
  533. // unconditionally include in API requests. By default, fields with
  534. // empty values are omitted from API requests. However, any non-pointer,
  535. // non-interface field appearing in ForceSendFields will be sent to the
  536. // server regardless of whether the field is empty or not. This may be
  537. // used to include empty fields in Patch requests.
  538. ForceSendFields []string `json:"-"`
  539. // NullFields is a list of field names (e.g. "Detail") to include in API
  540. // requests with the JSON null value. By default, fields with empty
  541. // values are omitted from API requests. However, any field with an
  542. // empty value appearing in NullFields will be sent to the server as
  543. // null. It is an error if a field in this list has a non-empty value.
  544. // This may be used to include null fields in Patch requests.
  545. NullFields []string `json:"-"`
  546. }
  547. func (s *ClusterStatus) MarshalJSON() ([]byte, error) {
  548. type NoMethod ClusterStatus
  549. raw := NoMethod(*s)
  550. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  551. }
  552. // DiagnoseClusterRequest: A request to collect cluster diagnostic
  553. // information.
  554. type DiagnoseClusterRequest struct {
  555. }
  556. // DiagnoseClusterResults: The location of diagnostic output.
  557. type DiagnoseClusterResults struct {
  558. // OutputUri: Output only. The Cloud Storage URI of the diagnostic
  559. // output. The output report is a plain text file with a summary of
  560. // collected diagnostics.
  561. OutputUri string `json:"outputUri,omitempty"`
  562. // ForceSendFields is a list of field names (e.g. "OutputUri") to
  563. // unconditionally include in API requests. By default, fields with
  564. // empty values are omitted from API requests. However, any non-pointer,
  565. // non-interface field appearing in ForceSendFields will be sent to the
  566. // server regardless of whether the field is empty or not. This may be
  567. // used to include empty fields in Patch requests.
  568. ForceSendFields []string `json:"-"`
  569. // NullFields is a list of field names (e.g. "OutputUri") to include in
  570. // API requests with the JSON null value. By default, fields with empty
  571. // values are omitted from API requests. However, any field with an
  572. // empty value appearing in NullFields will be sent to the server as
  573. // null. It is an error if a field in this list has a non-empty value.
  574. // This may be used to include null fields in Patch requests.
  575. NullFields []string `json:"-"`
  576. }
  577. func (s *DiagnoseClusterResults) MarshalJSON() ([]byte, error) {
  578. type NoMethod DiagnoseClusterResults
  579. raw := NoMethod(*s)
  580. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  581. }
  582. // DiskConfig: Specifies the config of disk options for a group of VM
  583. // instances.
  584. type DiskConfig struct {
  585. // BootDiskSizeGb: Optional. Size in GB of the boot disk (default is
  586. // 500GB).
  587. BootDiskSizeGb int64 `json:"bootDiskSizeGb,omitempty"`
  588. // BootDiskType: Optional. Type of the boot disk (default is
  589. // "pd-standard"). Valid values: "pd-ssd" (Persistent Disk Solid State
  590. // Drive) or "pd-standard" (Persistent Disk Hard Disk Drive).
  591. BootDiskType string `json:"bootDiskType,omitempty"`
  592. // NumLocalSsds: Optional. Number of attached SSDs, from 0 to 4 (default
  593. // is 0). If SSDs are not attached, the boot disk is used to store
  594. // runtime logs and HDFS
  595. // (https://hadoop.apache.org/docs/r1.2.1/hdfs_user_guide.html) data. If
  596. // one or more SSDs are attached, this runtime bulk data is spread
  597. // across them, and the boot disk contains only basic config and
  598. // installed binaries.
  599. NumLocalSsds int64 `json:"numLocalSsds,omitempty"`
  600. // ForceSendFields is a list of field names (e.g. "BootDiskSizeGb") to
  601. // unconditionally include in API requests. By default, fields with
  602. // empty values are omitted from API requests. However, any non-pointer,
  603. // non-interface field appearing in ForceSendFields will be sent to the
  604. // server regardless of whether the field is empty or not. This may be
  605. // used to include empty fields in Patch requests.
  606. ForceSendFields []string `json:"-"`
  607. // NullFields is a list of field names (e.g. "BootDiskSizeGb") to
  608. // include in API requests with the JSON null value. By default, fields
  609. // with empty values are omitted from API requests. However, any field
  610. // with an empty value appearing in NullFields will be sent to the
  611. // server as null. It is an error if a field in this list has a
  612. // non-empty value. This may be used to include null fields in Patch
  613. // requests.
  614. NullFields []string `json:"-"`
  615. }
  616. func (s *DiskConfig) MarshalJSON() ([]byte, error) {
  617. type NoMethod DiskConfig
  618. raw := NoMethod(*s)
  619. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  620. }
  621. // Empty: A generic empty message that you can re-use to avoid defining
  622. // duplicated empty messages in your APIs. A typical example is to use
  623. // it as the request or the response type of an API method. For
  624. // instance:
  625. // service Foo {
  626. // rpc Bar(google.protobuf.Empty) returns
  627. // (google.protobuf.Empty);
  628. // }
  629. // The JSON representation for Empty is empty JSON object {}.
  630. type Empty struct {
  631. // ServerResponse contains the HTTP response code and headers from the
  632. // server.
  633. googleapi.ServerResponse `json:"-"`
  634. }
  635. // EncryptionConfig: Encryption settings for the cluster.
  636. type EncryptionConfig struct {
  637. // GcePdKmsKeyName: Optional. The Cloud KMS key name to use for PD disk
  638. // encryption for all instances in the cluster.
  639. GcePdKmsKeyName string `json:"gcePdKmsKeyName,omitempty"`
  640. // ForceSendFields is a list of field names (e.g. "GcePdKmsKeyName") to
  641. // unconditionally include in API requests. By default, fields with
  642. // empty values are omitted from API requests. However, any non-pointer,
  643. // non-interface field appearing in ForceSendFields will be sent to the
  644. // server regardless of whether the field is empty or not. This may be
  645. // used to include empty fields in Patch requests.
  646. ForceSendFields []string `json:"-"`
  647. // NullFields is a list of field names (e.g. "GcePdKmsKeyName") to
  648. // include in API requests with the JSON null value. By default, fields
  649. // with empty values are omitted from API requests. However, any field
  650. // with an empty value appearing in NullFields will be sent to the
  651. // server as null. It is an error if a field in this list has a
  652. // non-empty value. This may be used to include null fields in Patch
  653. // requests.
  654. NullFields []string `json:"-"`
  655. }
  656. func (s *EncryptionConfig) MarshalJSON() ([]byte, error) {
  657. type NoMethod EncryptionConfig
  658. raw := NoMethod(*s)
  659. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  660. }
  661. // GceClusterConfig: Common config settings for resources of Compute
  662. // Engine cluster instances, applicable to all instances in the cluster.
  663. type GceClusterConfig struct {
  664. // InternalIpOnly: Optional. If true, all instances in the cluster will
  665. // only have internal IP addresses. By default, clusters are not
  666. // restricted to internal IP addresses, and will have ephemeral external
  667. // IP addresses assigned to each instance. This internal_ip_only
  668. // restriction can only be enabled for subnetwork enabled networks, and
  669. // all off-cluster dependencies must be configured to be accessible
  670. // without external IP addresses.
  671. InternalIpOnly bool `json:"internalIpOnly,omitempty"`
  672. // Metadata: The Compute Engine metadata entries to add to all instances
  673. // (see Project and instance metadata
  674. // (https://cloud.google.com/compute/docs/storing-retrieving-metadata#pro
  675. // ject_and_instance_metadata)).
  676. Metadata map[string]string `json:"metadata,omitempty"`
  677. // NetworkUri: Optional. The Compute Engine network to be used for
  678. // machine communications. Cannot be specified with subnetwork_uri. If
  679. // neither network_uri nor subnetwork_uri is specified, the "default"
  680. // network of the project is used, if it exists. Cannot be a "Custom
  681. // Subnet Network" (see Using Subnetworks for more information).A full
  682. // URL, partial URI, or short name are valid.
  683. // Examples:
  684. // https://www.googleapis.com/compute/v1/projects/[project_id]/
  685. // regions/global/default
  686. // projects/[project_id]/regions/global/default
  687. // de
  688. // fault
  689. NetworkUri string `json:"networkUri,omitempty"`
  690. // ServiceAccount: Optional. The service account of the instances.
  691. // Defaults to the default Compute Engine service account. Custom
  692. // service accounts need permissions equivalent to the following IAM
  693. // roles:
  694. // roles/logging.logWriter
  695. // roles/storage.objectAdmin(see
  696. // https://cloud.google.com/compute/docs/access/service-accounts#custom_service_accounts for more information). Example:
  697. // [account_id]@[project_id].iam.gserviceaccount.com
  698. ServiceAccount string `json:"serviceAccount,omitempty"`
  699. // ServiceAccountScopes: Optional. The URIs of service account scopes to
  700. // be included in Compute Engine instances. The following base set of
  701. // scopes is always
  702. // included:
  703. // https://www.googleapis.com/auth/cloud.useraccounts.readonly
  704. //
  705. // https://www.googleapis.com/auth/devstorage.read_write
  706. // https://www.goog
  707. // leapis.com/auth/logging.writeIf no scopes are specified, the
  708. // following defaults are also
  709. // provided:
  710. // https://www.googleapis.com/auth/bigquery
  711. // https://www.googlea
  712. // pis.com/auth/bigtable.admin.table
  713. // https://www.googleapis.com/auth/bigt
  714. // able.data
  715. // https://www.googleapis.com/auth/devstorage.full_control
  716. ServiceAccountScopes []string `json:"serviceAccountScopes,omitempty"`
  717. // SubnetworkUri: Optional. The Compute Engine subnetwork to be used for
  718. // machine communications. Cannot be specified with network_uri.A full
  719. // URL, partial URI, or short name are valid.
  720. // Examples:
  721. // https://www.googleapis.com/compute/v1/projects/[project_id]/
  722. // regions/us-east1/sub0
  723. // projects/[project_id]/regions/us-east1/sub0
  724. // sub0
  725. SubnetworkUri string `json:"subnetworkUri,omitempty"`
  726. // Tags: The Compute Engine tags to add to all instances (see Tagging
  727. // instances).
  728. Tags []string `json:"tags,omitempty"`
  729. // ZoneUri: Optional. The zone where the Compute Engine cluster will be
  730. // located. On a create request, it is required in the "global" region.
  731. // If omitted in a non-global Cloud Dataproc region, the service will
  732. // pick a zone in the corresponding Compute Engine region. On a get
  733. // request, zone will always be present.A full URL, partial URI, or
  734. // short name are valid.
  735. // Examples:
  736. // https://www.googleapis.com/compute/v1/projects/[project_id]/
  737. // zones/[zone]
  738. // projects/[project_id]/zones/[zone]
  739. // us-central1-f
  740. ZoneUri string `json:"zoneUri,omitempty"`
  741. // ForceSendFields is a list of field names (e.g. "InternalIpOnly") to
  742. // unconditionally include in API requests. By default, fields with
  743. // empty values are omitted from API requests. However, any non-pointer,
  744. // non-interface field appearing in ForceSendFields will be sent to the
  745. // server regardless of whether the field is empty or not. This may be
  746. // used to include empty fields in Patch requests.
  747. ForceSendFields []string `json:"-"`
  748. // NullFields is a list of field names (e.g. "InternalIpOnly") to
  749. // include in API requests with the JSON null value. By default, fields
  750. // with empty values are omitted from API requests. However, any field
  751. // with an empty value appearing in NullFields will be sent to the
  752. // server as null. It is an error if a field in this list has a
  753. // non-empty value. This may be used to include null fields in Patch
  754. // requests.
  755. NullFields []string `json:"-"`
  756. }
  757. func (s *GceClusterConfig) MarshalJSON() ([]byte, error) {
  758. type NoMethod GceClusterConfig
  759. raw := NoMethod(*s)
  760. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  761. }
  762. // GetIamPolicyRequest: Request message for GetIamPolicy method.
  763. type GetIamPolicyRequest struct {
  764. }
  765. // HadoopJob: A Cloud Dataproc job for running Apache Hadoop MapReduce
  766. // (https://hadoop.apache.org/docs/current/hadoop-mapreduce-client/hadoop
  767. // -mapreduce-client-core/MapReduceTutorial.html) jobs on Apache Hadoop
  768. // YARN
  769. // (https://hadoop.apache.org/docs/r2.7.1/hadoop-yarn/hadoop-yarn-site/YA
  770. // RN.html).
  771. type HadoopJob struct {
  772. // ArchiveUris: Optional. HCFS URIs of archives to be extracted in the
  773. // working directory of Hadoop drivers and tasks. Supported file types:
  774. // .jar, .tar, .tar.gz, .tgz, or .zip.
  775. ArchiveUris []string `json:"archiveUris,omitempty"`
  776. // Args: Optional. The arguments to pass to the driver. Do not include
  777. // arguments, such as -libjars or -Dfoo=bar, that can be set as job
  778. // properties, since a collision may occur that causes an incorrect job
  779. // submission.
  780. Args []string `json:"args,omitempty"`
  781. // FileUris: Optional. HCFS (Hadoop Compatible Filesystem) URIs of files
  782. // to be copied to the working directory of Hadoop drivers and
  783. // distributed tasks. Useful for naively parallel tasks.
  784. FileUris []string `json:"fileUris,omitempty"`
  785. // JarFileUris: Optional. Jar file URIs to add to the CLASSPATHs of the
  786. // Hadoop driver and tasks.
  787. JarFileUris []string `json:"jarFileUris,omitempty"`
  788. // LoggingConfig: Optional. The runtime log config for job execution.
  789. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  790. // MainClass: The name of the driver's main class. The jar file
  791. // containing the class must be in the default CLASSPATH or specified in
  792. // jar_file_uris.
  793. MainClass string `json:"mainClass,omitempty"`
  794. // MainJarFileUri: The HCFS URI of the jar file containing the main
  795. // class. Examples:
  796. // 'gs://foo-bucket/analytics-binaries/extract-useful-metrics-mr.jar'
  797. // 'hdfs:/tmp/test-samples/custom-wordcount.jar'
  798. // 'file:///home/usr/lib/hadoop-mapreduce/hadoop-mapreduce-examples.jar'
  799. MainJarFileUri string `json:"mainJarFileUri,omitempty"`
  800. // Properties: Optional. A mapping of property names to values, used to
  801. // configure Hadoop. Properties that conflict with values set by the
  802. // Cloud Dataproc API may be overwritten. Can include properties set in
  803. // /etc/hadoop/conf/*-site and classes in user code.
  804. Properties map[string]string `json:"properties,omitempty"`
  805. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  806. // unconditionally include in API requests. By default, fields with
  807. // empty values are omitted from API requests. However, any non-pointer,
  808. // non-interface field appearing in ForceSendFields will be sent to the
  809. // server regardless of whether the field is empty or not. This may be
  810. // used to include empty fields in Patch requests.
  811. ForceSendFields []string `json:"-"`
  812. // NullFields is a list of field names (e.g. "ArchiveUris") to include
  813. // in API requests with the JSON null value. By default, fields with
  814. // empty values are omitted from API requests. However, any field with
  815. // an empty value appearing in NullFields will be sent to the server as
  816. // null. It is an error if a field in this list has a non-empty value.
  817. // This may be used to include null fields in Patch requests.
  818. NullFields []string `json:"-"`
  819. }
  820. func (s *HadoopJob) MarshalJSON() ([]byte, error) {
  821. type NoMethod HadoopJob
  822. raw := NoMethod(*s)
  823. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  824. }
  825. // HiveJob: A Cloud Dataproc job for running Apache Hive
  826. // (https://hive.apache.org/) queries on YARN.
  827. type HiveJob struct {
  828. // ContinueOnFailure: Optional. Whether to continue executing queries if
  829. // a query fails. The default value is false. Setting to true can be
  830. // useful when executing independent parallel queries.
  831. ContinueOnFailure bool `json:"continueOnFailure,omitempty"`
  832. // JarFileUris: Optional. HCFS URIs of jar files to add to the CLASSPATH
  833. // of the Hive server and Hadoop MapReduce (MR) tasks. Can contain Hive
  834. // SerDes and UDFs.
  835. JarFileUris []string `json:"jarFileUris,omitempty"`
  836. // Properties: Optional. A mapping of property names and values, used to
  837. // configure Hive. Properties that conflict with values set by the Cloud
  838. // Dataproc API may be overwritten. Can include properties set in
  839. // /etc/hadoop/conf/*-site.xml, /etc/hive/conf/hive-site.xml, and
  840. // classes in user code.
  841. Properties map[string]string `json:"properties,omitempty"`
  842. // QueryFileUri: The HCFS URI of the script that contains Hive queries.
  843. QueryFileUri string `json:"queryFileUri,omitempty"`
  844. // QueryList: A list of queries.
  845. QueryList *QueryList `json:"queryList,omitempty"`
  846. // ScriptVariables: Optional. Mapping of query variable names to values
  847. // (equivalent to the Hive command: SET name="value";).
  848. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  849. // ForceSendFields is a list of field names (e.g. "ContinueOnFailure")
  850. // to unconditionally include in API requests. By default, fields with
  851. // empty values are omitted from API requests. However, any non-pointer,
  852. // non-interface field appearing in ForceSendFields will be sent to the
  853. // server regardless of whether the field is empty or not. This may be
  854. // used to include empty fields in Patch requests.
  855. ForceSendFields []string `json:"-"`
  856. // NullFields is a list of field names (e.g. "ContinueOnFailure") to
  857. // include in API requests with the JSON null value. By default, fields
  858. // with empty values are omitted from API requests. However, any field
  859. // with an empty value appearing in NullFields will be sent to the
  860. // server as null. It is an error if a field in this list has a
  861. // non-empty value. This may be used to include null fields in Patch
  862. // requests.
  863. NullFields []string `json:"-"`
  864. }
  865. func (s *HiveJob) MarshalJSON() ([]byte, error) {
  866. type NoMethod HiveJob
  867. raw := NoMethod(*s)
  868. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  869. }
  870. // InstanceGroupConfig: Optional. The config settings for Compute Engine
  871. // resources in an instance group, such as a master or worker group.
  872. type InstanceGroupConfig struct {
  873. // Accelerators: Optional. The Compute Engine accelerator configuration
  874. // for these instances.Beta Feature: This feature is still under
  875. // development. It may be changed before final release.
  876. Accelerators []*AcceleratorConfig `json:"accelerators,omitempty"`
  877. // DiskConfig: Optional. Disk option config settings.
  878. DiskConfig *DiskConfig `json:"diskConfig,omitempty"`
  879. // ImageUri: Output only. The Compute Engine image resource used for
  880. // cluster instances. Inferred from SoftwareConfig.image_version.
  881. ImageUri string `json:"imageUri,omitempty"`
  882. // InstanceNames: Output only. The list of instance names. Cloud
  883. // Dataproc derives the names from cluster_name, num_instances, and the
  884. // instance group.
  885. InstanceNames []string `json:"instanceNames,omitempty"`
  886. // IsPreemptible: Optional. Specifies that this instance group contains
  887. // preemptible instances.
  888. IsPreemptible bool `json:"isPreemptible,omitempty"`
  889. // MachineTypeUri: Optional. The Compute Engine machine type used for
  890. // cluster instances.A full URL, partial URI, or short name are valid.
  891. // Examples:
  892. // https://www.googleapis.com/compute/v1/projects/[project_id]/
  893. // zones/us-east1-a/machineTypes/n1-standard-2
  894. // projects/[project_id]/zone
  895. // s/us-east1-a/machineTypes/n1-standard-2
  896. // n1-standard-2Auto Zone Exception: If you are using the Cloud Dataproc
  897. // Auto Zone Placement feature, you must use the short name of the
  898. // machine type resource, for example, n1-standard-2.
  899. MachineTypeUri string `json:"machineTypeUri,omitempty"`
  900. // ManagedGroupConfig: Output only. The config for Compute Engine
  901. // Instance Group Manager that manages this group. This is only used for
  902. // preemptible instance groups.
  903. ManagedGroupConfig *ManagedGroupConfig `json:"managedGroupConfig,omitempty"`
  904. // MinCpuPlatform: Optional. Specifies the minimum cpu platform for the
  905. // Instance Group. See Cloud Dataproc&rarr;Minimum CPU Platform.
  906. MinCpuPlatform string `json:"minCpuPlatform,omitempty"`
  907. // NumInstances: Optional. The number of VM instances in the instance
  908. // group. For master instance groups, must be set to 1.
  909. NumInstances int64 `json:"numInstances,omitempty"`
  910. // ForceSendFields is a list of field names (e.g. "Accelerators") to
  911. // unconditionally include in API requests. By default, fields with
  912. // empty values are omitted from API requests. However, any non-pointer,
  913. // non-interface field appearing in ForceSendFields will be sent to the
  914. // server regardless of whether the field is empty or not. This may be
  915. // used to include empty fields in Patch requests.
  916. ForceSendFields []string `json:"-"`
  917. // NullFields is a list of field names (e.g. "Accelerators") to include
  918. // in API requests with the JSON null value. By default, fields with
  919. // empty values are omitted from API requests. However, any field with
  920. // an empty value appearing in NullFields will be sent to the server as
  921. // null. It is an error if a field in this list has a non-empty value.
  922. // This may be used to include null fields in Patch requests.
  923. NullFields []string `json:"-"`
  924. }
  925. func (s *InstanceGroupConfig) MarshalJSON() ([]byte, error) {
  926. type NoMethod InstanceGroupConfig
  927. raw := NoMethod(*s)
  928. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  929. }
  930. // InstantiateWorkflowTemplateRequest: A request to instantiate a
  931. // workflow template.
  932. type InstantiateWorkflowTemplateRequest struct {
  933. // InstanceId: Optional. A tag that prevents multiple concurrent
  934. // workflow instances with the same tag from running. This mitigates
  935. // risk of concurrent instances started due to retries.It is recommended
  936. // to always set this value to a UUID
  937. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag
  938. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  939. // and hyphens (-). The maximum length is 40 characters.
  940. InstanceId string `json:"instanceId,omitempty"`
  941. // Parameters: Optional. Map from parameter names to values that should
  942. // be used for those parameters.
  943. Parameters map[string]string `json:"parameters,omitempty"`
  944. // Version: Optional. The version of workflow template to instantiate.
  945. // If specified, the workflow will be instantiated only if the current
  946. // version of the workflow template has the supplied version.This option
  947. // cannot be used to instantiate a previous version of workflow
  948. // template.
  949. Version int64 `json:"version,omitempty"`
  950. // ForceSendFields is a list of field names (e.g. "InstanceId") to
  951. // unconditionally include in API requests. By default, fields with
  952. // empty values are omitted from API requests. However, any non-pointer,
  953. // non-interface field appearing in ForceSendFields will be sent to the
  954. // server regardless of whether the field is empty or not. This may be
  955. // used to include empty fields in Patch requests.
  956. ForceSendFields []string `json:"-"`
  957. // NullFields is a list of field names (e.g. "InstanceId") to include in
  958. // API requests with the JSON null value. By default, fields with empty
  959. // values are omitted from API requests. However, any field with an
  960. // empty value appearing in NullFields will be sent to the server as
  961. // null. It is an error if a field in this list has a non-empty value.
  962. // This may be used to include null fields in Patch requests.
  963. NullFields []string `json:"-"`
  964. }
  965. func (s *InstantiateWorkflowTemplateRequest) MarshalJSON() ([]byte, error) {
  966. type NoMethod InstantiateWorkflowTemplateRequest
  967. raw := NoMethod(*s)
  968. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  969. }
  970. // Job: A Cloud Dataproc job resource.
  971. type Job struct {
  972. // DriverControlFilesUri: Output only. If present, the location of
  973. // miscellaneous control files which may be used as part of job setup
  974. // and handling. If not present, control files may be placed in the same
  975. // location as driver_output_uri.
  976. DriverControlFilesUri string `json:"driverControlFilesUri,omitempty"`
  977. // DriverOutputResourceUri: Output only. A URI pointing to the location
  978. // of the stdout of the job's driver program.
  979. DriverOutputResourceUri string `json:"driverOutputResourceUri,omitempty"`
  980. // HadoopJob: Job is a Hadoop job.
  981. HadoopJob *HadoopJob `json:"hadoopJob,omitempty"`
  982. // HiveJob: Job is a Hive job.
  983. HiveJob *HiveJob `json:"hiveJob,omitempty"`
  984. // Labels: Optional. The labels to associate with this job. Label keys
  985. // must contain 1 to 63 characters, and must conform to RFC 1035
  986. // (https://www.ietf.org/rfc/rfc1035.txt). Label values may be empty,
  987. // but, if present, must contain 1 to 63 characters, and must conform to
  988. // RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt). No more than 32
  989. // labels can be associated with a job.
  990. Labels map[string]string `json:"labels,omitempty"`
  991. // PigJob: Job is a Pig job.
  992. PigJob *PigJob `json:"pigJob,omitempty"`
  993. // Placement: Required. Job information, including how, when, and where
  994. // to run the job.
  995. Placement *JobPlacement `json:"placement,omitempty"`
  996. // PysparkJob: Job is a Pyspark job.
  997. PysparkJob *PySparkJob `json:"pysparkJob,omitempty"`
  998. // Reference: Optional. The fully qualified reference to the job, which
  999. // can be used to obtain the equivalent REST path of the job resource.
  1000. // If this property is not specified when a job is created, the server
  1001. // generates a <code>job_id</code>.
  1002. Reference *JobReference `json:"reference,omitempty"`
  1003. // Scheduling: Optional. Job scheduling configuration.
  1004. Scheduling *JobScheduling `json:"scheduling,omitempty"`
  1005. // SparkJob: Job is a Spark job.
  1006. SparkJob *SparkJob `json:"sparkJob,omitempty"`
  1007. // SparkSqlJob: Job is a SparkSql job.
  1008. SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"`
  1009. // Status: Output only. The job status. Additional application-specific
  1010. // status information may be contained in the <code>type_job</code> and
  1011. // <code>yarn_applications</code> fields.
  1012. Status *JobStatus `json:"status,omitempty"`
  1013. // StatusHistory: Output only. The previous job status.
  1014. StatusHistory []*JobStatus `json:"statusHistory,omitempty"`
  1015. // YarnApplications: Output only. The collection of YARN applications
  1016. // spun up by this job.Beta Feature: This report is available for
  1017. // testing purposes only. It may be changed before final release.
  1018. YarnApplications []*YarnApplication `json:"yarnApplications,omitempty"`
  1019. // ServerResponse contains the HTTP response code and headers from the
  1020. // server.
  1021. googleapi.ServerResponse `json:"-"`
  1022. // ForceSendFields is a list of field names (e.g.
  1023. // "DriverControlFilesUri") to unconditionally include in API requests.
  1024. // By default, fields with empty values are omitted from API requests.
  1025. // However, any non-pointer, non-interface field appearing in
  1026. // ForceSendFields will be sent to the server regardless of whether the
  1027. // field is empty or not. This may be used to include empty fields in
  1028. // Patch requests.
  1029. ForceSendFields []string `json:"-"`
  1030. // NullFields is a list of field names (e.g. "DriverControlFilesUri") to
  1031. // include in API requests with the JSON null value. By default, fields
  1032. // with empty values are omitted from API requests. However, any field
  1033. // with an empty value appearing in NullFields will be sent to the
  1034. // server as null. It is an error if a field in this list has a
  1035. // non-empty value. This may be used to include null fields in Patch
  1036. // requests.
  1037. NullFields []string `json:"-"`
  1038. }
  1039. func (s *Job) MarshalJSON() ([]byte, error) {
  1040. type NoMethod Job
  1041. raw := NoMethod(*s)
  1042. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1043. }
  1044. // JobPlacement: Cloud Dataproc job config.
  1045. type JobPlacement struct {
  1046. // ClusterName: Required. The name of the cluster where the job will be
  1047. // submitted.
  1048. ClusterName string `json:"clusterName,omitempty"`
  1049. // ClusterUuid: Output only. A cluster UUID generated by the Cloud
  1050. // Dataproc service when the job is submitted.
  1051. ClusterUuid string `json:"clusterUuid,omitempty"`
  1052. // ForceSendFields is a list of field names (e.g. "ClusterName") 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. "ClusterName") to include
  1060. // in API requests with the JSON null value. By default, fields with
  1061. // empty values are omitted from API requests. However, any field with
  1062. // an 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 *JobPlacement) MarshalJSON() ([]byte, error) {
  1068. type NoMethod JobPlacement
  1069. raw := NoMethod(*s)
  1070. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1071. }
  1072. // JobReference: Encapsulates the full scoping used to reference a job.
  1073. type JobReference struct {
  1074. // JobId: Optional. The job ID, which must be unique within the project.
  1075. // The job ID is generated by the server upon job submission or provided
  1076. // by the user as a means to perform retries without creating duplicate
  1077. // jobs. The ID must contain only letters (a-z, A-Z), numbers (0-9),
  1078. // underscores (_), or hyphens (-). The maximum length is 100
  1079. // characters.
  1080. JobId string `json:"jobId,omitempty"`
  1081. // ProjectId: Required. The ID of the Google Cloud Platform project that
  1082. // the job belongs to.
  1083. ProjectId string `json:"projectId,omitempty"`
  1084. // ForceSendFields is a list of field names (e.g. "JobId") to
  1085. // unconditionally include in API requests. By default, fields with
  1086. // empty values are omitted from API requests. However, any non-pointer,
  1087. // non-interface field appearing in ForceSendFields will be sent to the
  1088. // server regardless of whether the field is empty or not. This may be
  1089. // used to include empty fields in Patch requests.
  1090. ForceSendFields []string `json:"-"`
  1091. // NullFields is a list of field names (e.g. "JobId") to include in API
  1092. // requests with the JSON null value. By default, fields with empty
  1093. // values are omitted from API requests. However, any field with an
  1094. // empty value appearing in NullFields will be sent to the server as
  1095. // null. It is an error if a field in this list has a non-empty value.
  1096. // This may be used to include null fields in Patch requests.
  1097. NullFields []string `json:"-"`
  1098. }
  1099. func (s *JobReference) MarshalJSON() ([]byte, error) {
  1100. type NoMethod JobReference
  1101. raw := NoMethod(*s)
  1102. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1103. }
  1104. // JobScheduling: Job scheduling options.
  1105. type JobScheduling struct {
  1106. // MaxFailuresPerHour: Optional. Maximum number of times per hour a
  1107. // driver may be restarted as a result of driver terminating with
  1108. // non-zero code before job is reported failed.A job may be reported as
  1109. // thrashing if driver exits with non-zero code 4 times within 10 minute
  1110. // window.Maximum value is 10.
  1111. MaxFailuresPerHour int64 `json:"maxFailuresPerHour,omitempty"`
  1112. // ForceSendFields is a list of field names (e.g. "MaxFailuresPerHour")
  1113. // to unconditionally include in API requests. By default, fields with
  1114. // empty values are omitted from API requests. However, any non-pointer,
  1115. // non-interface field appearing in ForceSendFields will be sent to the
  1116. // server regardless of whether the field is empty or not. This may be
  1117. // used to include empty fields in Patch requests.
  1118. ForceSendFields []string `json:"-"`
  1119. // NullFields is a list of field names (e.g. "MaxFailuresPerHour") to
  1120. // include in API requests with the JSON null value. By default, fields
  1121. // with empty values are omitted from API requests. However, any field
  1122. // with an empty value appearing in NullFields will be sent to the
  1123. // server as null. It is an error if a field in this list has a
  1124. // non-empty value. This may be used to include null fields in Patch
  1125. // requests.
  1126. NullFields []string `json:"-"`
  1127. }
  1128. func (s *JobScheduling) MarshalJSON() ([]byte, error) {
  1129. type NoMethod JobScheduling
  1130. raw := NoMethod(*s)
  1131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1132. }
  1133. // JobStatus: Cloud Dataproc job status.
  1134. type JobStatus struct {
  1135. // Details: Output only. Optional job state details, such as an error
  1136. // description if the state is <code>ERROR</code>.
  1137. Details string `json:"details,omitempty"`
  1138. // State: Output only. A state message specifying the overall job state.
  1139. //
  1140. // Possible values:
  1141. // "STATE_UNSPECIFIED" - The job state is unknown.
  1142. // "PENDING" - The job is pending; it has been submitted, but is not
  1143. // yet running.
  1144. // "SETUP_DONE" - Job has been received by the service and completed
  1145. // initial setup; it will soon be submitted to the cluster.
  1146. // "RUNNING" - The job is running on the cluster.
  1147. // "CANCEL_PENDING" - A CancelJob request has been received, but is
  1148. // pending.
  1149. // "CANCEL_STARTED" - Transient in-flight resources have been
  1150. // canceled, and the request to cancel the running job has been issued
  1151. // to the cluster.
  1152. // "CANCELLED" - The job cancellation was successful.
  1153. // "DONE" - The job has completed successfully.
  1154. // "ERROR" - The job has completed, but encountered an error.
  1155. // "ATTEMPT_FAILURE" - Job attempt has failed. The detail field
  1156. // contains failure details for this attempt.Applies to restartable jobs
  1157. // only.
  1158. State string `json:"state,omitempty"`
  1159. // StateStartTime: Output only. The time when this state was entered.
  1160. StateStartTime string `json:"stateStartTime,omitempty"`
  1161. // Substate: Output only. Additional state information, which includes
  1162. // status reported by the agent.
  1163. //
  1164. // Possible values:
  1165. // "UNSPECIFIED" - The job substate is unknown.
  1166. // "SUBMITTED" - The Job is submitted to the agent.Applies to RUNNING
  1167. // state.
  1168. // "QUEUED" - The Job has been received and is awaiting execution (it
  1169. // may be waiting for a condition to be met). See the "details" field
  1170. // for the reason for the delay.Applies to RUNNING state.
  1171. // "STALE_STATUS" - The agent-reported status is out of date, which
  1172. // may be caused by a loss of communication between the agent and Cloud
  1173. // Dataproc. If the agent does not send a timely update, the job will
  1174. // fail.Applies to RUNNING state.
  1175. Substate string `json:"substate,omitempty"`
  1176. // ForceSendFields is a list of field names (e.g. "Details") to
  1177. // unconditionally include in API requests. By default, fields with
  1178. // empty values are omitted from API requests. However, any non-pointer,
  1179. // non-interface field appearing in ForceSendFields will be sent to the
  1180. // server regardless of whether the field is empty or not. This may be
  1181. // used to include empty fields in Patch requests.
  1182. ForceSendFields []string `json:"-"`
  1183. // NullFields is a list of field names (e.g. "Details") to include in
  1184. // API requests with the JSON null value. By default, fields with empty
  1185. // values are omitted from API requests. However, any field with an
  1186. // empty value appearing in NullFields will be sent to the server as
  1187. // null. It is an error if a field in this list has a non-empty value.
  1188. // This may be used to include null fields in Patch requests.
  1189. NullFields []string `json:"-"`
  1190. }
  1191. func (s *JobStatus) MarshalJSON() ([]byte, error) {
  1192. type NoMethod JobStatus
  1193. raw := NoMethod(*s)
  1194. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1195. }
  1196. // LifecycleConfig: Specifies the cluster auto delete related schedule
  1197. // configuration.
  1198. type LifecycleConfig struct {
  1199. // AutoDeleteTime: Optional. The time when cluster will be auto-deleted.
  1200. AutoDeleteTime string `json:"autoDeleteTime,omitempty"`
  1201. // AutoDeleteTtl: Optional. The life duration of cluster, the cluster
  1202. // will be auto-deleted at the end of this duration.
  1203. AutoDeleteTtl string `json:"autoDeleteTtl,omitempty"`
  1204. // IdleDeleteTtl: Optional. The longest duration that cluster would keep
  1205. // alive while staying idle; passing this threshold will cause cluster
  1206. // to be auto-deleted.
  1207. IdleDeleteTtl string `json:"idleDeleteTtl,omitempty"`
  1208. // ForceSendFields is a list of field names (e.g. "AutoDeleteTime") to
  1209. // unconditionally include in API requests. By default, fields with
  1210. // empty values are omitted from API requests. However, any non-pointer,
  1211. // non-interface field appearing in ForceSendFields will be sent to the
  1212. // server regardless of whether the field is empty or not. This may be
  1213. // used to include empty fields in Patch requests.
  1214. ForceSendFields []string `json:"-"`
  1215. // NullFields is a list of field names (e.g. "AutoDeleteTime") to
  1216. // include in API requests with the JSON null value. By default, fields
  1217. // with empty values are omitted from API requests. However, any field
  1218. // with an empty value appearing in NullFields will be sent to the
  1219. // server as null. It is an error if a field in this list has a
  1220. // non-empty value. This may be used to include null fields in Patch
  1221. // requests.
  1222. NullFields []string `json:"-"`
  1223. }
  1224. func (s *LifecycleConfig) MarshalJSON() ([]byte, error) {
  1225. type NoMethod LifecycleConfig
  1226. raw := NoMethod(*s)
  1227. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1228. }
  1229. // ListClustersResponse: The list of all clusters in a project.
  1230. type ListClustersResponse struct {
  1231. // Clusters: Output only. The clusters in the project.
  1232. Clusters []*Cluster `json:"clusters,omitempty"`
  1233. // NextPageToken: Output only. This token is included in the response if
  1234. // there are more results to fetch. To fetch additional results, provide
  1235. // this value as the page_token in a subsequent
  1236. // <code>ListClustersRequest</code>.
  1237. NextPageToken string `json:"nextPageToken,omitempty"`
  1238. // ServerResponse contains the HTTP response code and headers from the
  1239. // server.
  1240. googleapi.ServerResponse `json:"-"`
  1241. // ForceSendFields is a list of field names (e.g. "Clusters") to
  1242. // unconditionally include in API requests. By default, fields with
  1243. // empty values are omitted from API requests. However, any non-pointer,
  1244. // non-interface field appearing in ForceSendFields will be sent to the
  1245. // server regardless of whether the field is empty or not. This may be
  1246. // used to include empty fields in Patch requests.
  1247. ForceSendFields []string `json:"-"`
  1248. // NullFields is a list of field names (e.g. "Clusters") to include in
  1249. // API requests with the JSON null value. By default, fields with empty
  1250. // values are omitted from API requests. However, any field with an
  1251. // empty value appearing in NullFields will be sent to the server as
  1252. // null. It is an error if a field in this list has a non-empty value.
  1253. // This may be used to include null fields in Patch requests.
  1254. NullFields []string `json:"-"`
  1255. }
  1256. func (s *ListClustersResponse) MarshalJSON() ([]byte, error) {
  1257. type NoMethod ListClustersResponse
  1258. raw := NoMethod(*s)
  1259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1260. }
  1261. // ListJobsResponse: A list of jobs in a project.
  1262. type ListJobsResponse struct {
  1263. // Jobs: Output only. Jobs list.
  1264. Jobs []*Job `json:"jobs,omitempty"`
  1265. // NextPageToken: Optional. This token is included in the response if
  1266. // there are more results to fetch. To fetch additional results, provide
  1267. // this value as the page_token in a subsequent
  1268. // <code>ListJobsRequest</code>.
  1269. NextPageToken string `json:"nextPageToken,omitempty"`
  1270. // ServerResponse contains the HTTP response code and headers from the
  1271. // server.
  1272. googleapi.ServerResponse `json:"-"`
  1273. // ForceSendFields is a list of field names (e.g. "Jobs") to
  1274. // unconditionally include in API requests. By default, fields with
  1275. // empty values are omitted from API requests. However, any non-pointer,
  1276. // non-interface field appearing in ForceSendFields will be sent to the
  1277. // server regardless of whether the field is empty or not. This may be
  1278. // used to include empty fields in Patch requests.
  1279. ForceSendFields []string `json:"-"`
  1280. // NullFields is a list of field names (e.g. "Jobs") to include in API
  1281. // requests with the JSON null value. By default, fields with empty
  1282. // values are omitted from API requests. However, any field with an
  1283. // empty value appearing in NullFields will be sent to the server as
  1284. // null. It is an error if a field in this list has a non-empty value.
  1285. // This may be used to include null fields in Patch requests.
  1286. NullFields []string `json:"-"`
  1287. }
  1288. func (s *ListJobsResponse) MarshalJSON() ([]byte, error) {
  1289. type NoMethod ListJobsResponse
  1290. raw := NoMethod(*s)
  1291. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1292. }
  1293. // ListOperationsResponse: The response message for
  1294. // Operations.ListOperations.
  1295. type ListOperationsResponse struct {
  1296. // NextPageToken: The standard List next-page token.
  1297. NextPageToken string `json:"nextPageToken,omitempty"`
  1298. // Operations: A list of operations that matches the specified filter in
  1299. // the request.
  1300. Operations []*Operation `json:"operations,omitempty"`
  1301. // ServerResponse contains the HTTP response code and headers from the
  1302. // server.
  1303. googleapi.ServerResponse `json:"-"`
  1304. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1305. // unconditionally include in API requests. By default, fields with
  1306. // empty values are omitted from API requests. However, any non-pointer,
  1307. // non-interface field appearing in ForceSendFields will be sent to the
  1308. // server regardless of whether the field is empty or not. This may be
  1309. // used to include empty fields in Patch requests.
  1310. ForceSendFields []string `json:"-"`
  1311. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1312. // in API requests with the JSON null value. By default, fields with
  1313. // empty values are omitted from API requests. However, any field with
  1314. // an empty value appearing in NullFields will be sent to the server as
  1315. // null. It is an error if a field in this list has a non-empty value.
  1316. // This may be used to include null fields in Patch requests.
  1317. NullFields []string `json:"-"`
  1318. }
  1319. func (s *ListOperationsResponse) MarshalJSON() ([]byte, error) {
  1320. type NoMethod ListOperationsResponse
  1321. raw := NoMethod(*s)
  1322. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1323. }
  1324. // ListWorkflowTemplatesResponse: A response to a request to list
  1325. // workflow templates in a project.
  1326. type ListWorkflowTemplatesResponse struct {
  1327. // NextPageToken: Output only. This token is included in the response if
  1328. // there are more results to fetch. To fetch additional results, provide
  1329. // this value as the page_token in a subsequent
  1330. // <code>ListWorkflowTemplatesRequest</code>.
  1331. NextPageToken string `json:"nextPageToken,omitempty"`
  1332. // Templates: Output only. WorkflowTemplates list.
  1333. Templates []*WorkflowTemplate `json:"templates,omitempty"`
  1334. // ServerResponse contains the HTTP response code and headers from the
  1335. // server.
  1336. googleapi.ServerResponse `json:"-"`
  1337. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1338. // unconditionally include in API requests. By default, fields with
  1339. // empty values are omitted from API requests. However, any non-pointer,
  1340. // non-interface field appearing in ForceSendFields will be sent to the
  1341. // server regardless of whether the field is empty or not. This may be
  1342. // used to include empty fields in Patch requests.
  1343. ForceSendFields []string `json:"-"`
  1344. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1345. // in API requests with the JSON null value. By default, fields with
  1346. // empty values are omitted from API requests. However, any field with
  1347. // an empty value appearing in NullFields will be sent to the server as
  1348. // null. It is an error if a field in this list has a non-empty value.
  1349. // This may be used to include null fields in Patch requests.
  1350. NullFields []string `json:"-"`
  1351. }
  1352. func (s *ListWorkflowTemplatesResponse) MarshalJSON() ([]byte, error) {
  1353. type NoMethod ListWorkflowTemplatesResponse
  1354. raw := NoMethod(*s)
  1355. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1356. }
  1357. // LoggingConfig: The runtime logging config of the job.
  1358. type LoggingConfig struct {
  1359. // DriverLogLevels: The per-package log levels for the driver. This may
  1360. // include "root" package name to configure rootLogger. Examples:
  1361. // 'com.google = FATAL', 'root = INFO', 'org.apache = DEBUG'
  1362. DriverLogLevels map[string]string `json:"driverLogLevels,omitempty"`
  1363. // ForceSendFields is a list of field names (e.g. "DriverLogLevels") to
  1364. // unconditionally include in API requests. By default, fields with
  1365. // empty values are omitted from API requests. However, any non-pointer,
  1366. // non-interface field appearing in ForceSendFields will be sent to the
  1367. // server regardless of whether the field is empty or not. This may be
  1368. // used to include empty fields in Patch requests.
  1369. ForceSendFields []string `json:"-"`
  1370. // NullFields is a list of field names (e.g. "DriverLogLevels") to
  1371. // include in API requests with the JSON null value. By default, fields
  1372. // with empty values are omitted from API requests. However, any field
  1373. // with an empty value appearing in NullFields will be sent to the
  1374. // server as null. It is an error if a field in this list has a
  1375. // non-empty value. This may be used to include null fields in Patch
  1376. // requests.
  1377. NullFields []string `json:"-"`
  1378. }
  1379. func (s *LoggingConfig) MarshalJSON() ([]byte, error) {
  1380. type NoMethod LoggingConfig
  1381. raw := NoMethod(*s)
  1382. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1383. }
  1384. // ManagedCluster: Cluster that is managed by the workflow.
  1385. type ManagedCluster struct {
  1386. // ClusterName: Required. The cluster name prefix. A unique cluster name
  1387. // will be formed by appending a random suffix.The name must contain
  1388. // only lower-case letters (a-z), numbers (0-9), and hyphens (-). Must
  1389. // begin with a letter. Cannot begin or end with hyphen. Must consist of
  1390. // between 2 and 35 characters.
  1391. ClusterName string `json:"clusterName,omitempty"`
  1392. // Config: Required. The cluster configuration.
  1393. Config *ClusterConfig `json:"config,omitempty"`
  1394. // Labels: Optional. The labels to associate with this cluster.Label
  1395. // keys must be between 1 and 63 characters long, and must conform to
  1396. // the following PCRE regular expression: \p{Ll}\p{Lo}{0,62}Label values
  1397. // must be between 1 and 63 characters long, and must conform to the
  1398. // following PCRE regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more
  1399. // than 32 labels can be associated with a given cluster.
  1400. Labels map[string]string `json:"labels,omitempty"`
  1401. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  1402. // unconditionally include in API requests. By default, fields with
  1403. // empty values are omitted from API requests. However, any non-pointer,
  1404. // non-interface field appearing in ForceSendFields will be sent to the
  1405. // server regardless of whether the field is empty or not. This may be
  1406. // used to include empty fields in Patch requests.
  1407. ForceSendFields []string `json:"-"`
  1408. // NullFields is a list of field names (e.g. "ClusterName") to include
  1409. // in API requests with the JSON null value. By default, fields with
  1410. // empty values are omitted from API requests. However, any field with
  1411. // an empty value appearing in NullFields will be sent to the server as
  1412. // null. It is an error if a field in this list has a non-empty value.
  1413. // This may be used to include null fields in Patch requests.
  1414. NullFields []string `json:"-"`
  1415. }
  1416. func (s *ManagedCluster) MarshalJSON() ([]byte, error) {
  1417. type NoMethod ManagedCluster
  1418. raw := NoMethod(*s)
  1419. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1420. }
  1421. // ManagedGroupConfig: Specifies the resources used to actively manage
  1422. // an instance group.
  1423. type ManagedGroupConfig struct {
  1424. // InstanceGroupManagerName: Output only. The name of the Instance Group
  1425. // Manager for this group.
  1426. InstanceGroupManagerName string `json:"instanceGroupManagerName,omitempty"`
  1427. // InstanceTemplateName: Output only. The name of the Instance Template
  1428. // used for the Managed Instance Group.
  1429. InstanceTemplateName string `json:"instanceTemplateName,omitempty"`
  1430. // ForceSendFields is a list of field names (e.g.
  1431. // "InstanceGroupManagerName") to unconditionally include in API
  1432. // requests. By default, fields with empty values are omitted from API
  1433. // requests. However, any non-pointer, non-interface field appearing in
  1434. // ForceSendFields will be sent to the server regardless of whether the
  1435. // field is empty or not. This may be used to include empty fields in
  1436. // Patch requests.
  1437. ForceSendFields []string `json:"-"`
  1438. // NullFields is a list of field names (e.g. "InstanceGroupManagerName")
  1439. // to include in API requests with the JSON null value. By default,
  1440. // fields with empty values are omitted from API requests. However, any
  1441. // field with an empty value appearing in NullFields will be sent to the
  1442. // server as null. It is an error if a field in this list has a
  1443. // non-empty value. This may be used to include null fields in Patch
  1444. // requests.
  1445. NullFields []string `json:"-"`
  1446. }
  1447. func (s *ManagedGroupConfig) MarshalJSON() ([]byte, error) {
  1448. type NoMethod ManagedGroupConfig
  1449. raw := NoMethod(*s)
  1450. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1451. }
  1452. // NodeInitializationAction: Specifies an executable to run on a fully
  1453. // configured node and a timeout period for executable completion.
  1454. type NodeInitializationAction struct {
  1455. // ExecutableFile: Required. Cloud Storage URI of executable file.
  1456. ExecutableFile string `json:"executableFile,omitempty"`
  1457. // ExecutionTimeout: Optional. Amount of time executable has to
  1458. // complete. Default is 10 minutes. Cluster creation fails with an
  1459. // explanatory error message (the name of the executable that caused the
  1460. // error and the exceeded timeout period) if the executable is not
  1461. // completed at end of the timeout period.
  1462. ExecutionTimeout string `json:"executionTimeout,omitempty"`
  1463. // ForceSendFields is a list of field names (e.g. "ExecutableFile") to
  1464. // unconditionally include in API requests. By default, fields with
  1465. // empty values are omitted from API requests. However, any non-pointer,
  1466. // non-interface field appearing in ForceSendFields will be sent to the
  1467. // server regardless of whether the field is empty or not. This may be
  1468. // used to include empty fields in Patch requests.
  1469. ForceSendFields []string `json:"-"`
  1470. // NullFields is a list of field names (e.g. "ExecutableFile") to
  1471. // include in API requests with the JSON null value. By default, fields
  1472. // with empty values are omitted from API requests. However, any field
  1473. // with an empty value appearing in NullFields will be sent to the
  1474. // server as null. It is an error if a field in this list has a
  1475. // non-empty value. This may be used to include null fields in Patch
  1476. // requests.
  1477. NullFields []string `json:"-"`
  1478. }
  1479. func (s *NodeInitializationAction) MarshalJSON() ([]byte, error) {
  1480. type NoMethod NodeInitializationAction
  1481. raw := NoMethod(*s)
  1482. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1483. }
  1484. // Operation: This resource represents a long-running operation that is
  1485. // the result of a network API call.
  1486. type Operation struct {
  1487. // Done: If the value is false, it means the operation is still in
  1488. // progress. If true, the operation is completed, and either error or
  1489. // response is available.
  1490. Done bool `json:"done,omitempty"`
  1491. // Error: The error result of the operation in case of failure or
  1492. // cancellation.
  1493. Error *Status `json:"error,omitempty"`
  1494. // Metadata: Service-specific metadata associated with the operation. It
  1495. // typically contains progress information and common metadata such as
  1496. // create time. Some services might not provide such metadata. Any
  1497. // method that returns a long-running operation should document the
  1498. // metadata type, if any.
  1499. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1500. // Name: The server-assigned name, which is only unique within the same
  1501. // service that originally returns it. If you use the default HTTP
  1502. // mapping, the name should have the format of
  1503. // operations/some/unique/name.
  1504. Name string `json:"name,omitempty"`
  1505. // Response: The normal response of the operation in case of success. If
  1506. // the original method returns no data on success, such as Delete, the
  1507. // response is google.protobuf.Empty. If the original method is standard
  1508. // Get/Create/Update, the response should be the resource. For other
  1509. // methods, the response should have the type XxxResponse, where Xxx is
  1510. // the original method name. For example, if the original method name is
  1511. // TakeSnapshot(), the inferred response type is TakeSnapshotResponse.
  1512. Response googleapi.RawMessage `json:"response,omitempty"`
  1513. // ServerResponse contains the HTTP response code and headers from the
  1514. // server.
  1515. googleapi.ServerResponse `json:"-"`
  1516. // ForceSendFields is a list of field names (e.g. "Done") to
  1517. // unconditionally include in API requests. By default, fields with
  1518. // empty values are omitted from API requests. However, any non-pointer,
  1519. // non-interface field appearing in ForceSendFields will be sent to the
  1520. // server regardless of whether the field is empty or not. This may be
  1521. // used to include empty fields in Patch requests.
  1522. ForceSendFields []string `json:"-"`
  1523. // NullFields is a list of field names (e.g. "Done") to include in API
  1524. // requests with the JSON null value. By default, fields with empty
  1525. // values are omitted from API requests. However, any field with an
  1526. // empty value appearing in NullFields will be sent to the server as
  1527. // null. It is an error if a field in this list has a non-empty value.
  1528. // This may be used to include null fields in Patch requests.
  1529. NullFields []string `json:"-"`
  1530. }
  1531. func (s *Operation) MarshalJSON() ([]byte, error) {
  1532. type NoMethod Operation
  1533. raw := NoMethod(*s)
  1534. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1535. }
  1536. // OrderedJob: A job executed by the workflow.
  1537. type OrderedJob struct {
  1538. // HadoopJob: Job is a Hadoop job.
  1539. HadoopJob *HadoopJob `json:"hadoopJob,omitempty"`
  1540. // HiveJob: Job is a Hive job.
  1541. HiveJob *HiveJob `json:"hiveJob,omitempty"`
  1542. // Labels: Optional. The labels to associate with this job.Label keys
  1543. // must be between 1 and 63 characters long, and must conform to the
  1544. // following regular expression: \p{Ll}\p{Lo}{0,62}Label values must be
  1545. // between 1 and 63 characters long, and must conform to the following
  1546. // regular expression: \p{Ll}\p{Lo}\p{N}_-{0,63}No more than 32 labels
  1547. // can be associated with a given job.
  1548. Labels map[string]string `json:"labels,omitempty"`
  1549. // PigJob: Job is a Pig job.
  1550. PigJob *PigJob `json:"pigJob,omitempty"`
  1551. // PrerequisiteStepIds: Optional. The optional list of prerequisite job
  1552. // step_ids. If not specified, the job will start at the beginning of
  1553. // workflow.
  1554. PrerequisiteStepIds []string `json:"prerequisiteStepIds,omitempty"`
  1555. // PysparkJob: Job is a Pyspark job.
  1556. PysparkJob *PySparkJob `json:"pysparkJob,omitempty"`
  1557. // Scheduling: Optional. Job scheduling configuration.
  1558. Scheduling *JobScheduling `json:"scheduling,omitempty"`
  1559. // SparkJob: Job is a Spark job.
  1560. SparkJob *SparkJob `json:"sparkJob,omitempty"`
  1561. // SparkSqlJob: Job is a SparkSql job.
  1562. SparkSqlJob *SparkSqlJob `json:"sparkSqlJob,omitempty"`
  1563. // StepId: Required. The step id. The id must be unique among all jobs
  1564. // within the template.The step id is used as prefix for job id, as job
  1565. // goog-dataproc-workflow-step-id label, and in prerequisiteStepIds
  1566. // field from other steps.The id must contain only letters (a-z, A-Z),
  1567. // numbers (0-9), underscores (_), and hyphens (-). Cannot begin or end
  1568. // with underscore or hyphen. Must consist of between 3 and 50
  1569. // characters.
  1570. StepId string `json:"stepId,omitempty"`
  1571. // ForceSendFields is a list of field names (e.g. "HadoopJob") to
  1572. // unconditionally include in API requests. By default, fields with
  1573. // empty values are omitted from API requests. However, any non-pointer,
  1574. // non-interface field appearing in ForceSendFields will be sent to the
  1575. // server regardless of whether the field is empty or not. This may be
  1576. // used to include empty fields in Patch requests.
  1577. ForceSendFields []string `json:"-"`
  1578. // NullFields is a list of field names (e.g. "HadoopJob") to include in
  1579. // API requests with the JSON null value. By default, fields with empty
  1580. // values are omitted from API requests. However, any field with an
  1581. // empty value appearing in NullFields will be sent to the server as
  1582. // null. It is an error if a field in this list has a non-empty value.
  1583. // This may be used to include null fields in Patch requests.
  1584. NullFields []string `json:"-"`
  1585. }
  1586. func (s *OrderedJob) MarshalJSON() ([]byte, error) {
  1587. type NoMethod OrderedJob
  1588. raw := NoMethod(*s)
  1589. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1590. }
  1591. // ParameterValidation: Configuration for parameter validation.
  1592. type ParameterValidation struct {
  1593. // Regex: Validation based on regular expressions.
  1594. Regex *RegexValidation `json:"regex,omitempty"`
  1595. // Values: Validation based on a list of allowed values.
  1596. Values *ValueValidation `json:"values,omitempty"`
  1597. // ForceSendFields is a list of field names (e.g. "Regex") to
  1598. // unconditionally include in API requests. By default, fields with
  1599. // empty values are omitted from API requests. However, any non-pointer,
  1600. // non-interface field appearing in ForceSendFields will be sent to the
  1601. // server regardless of whether the field is empty or not. This may be
  1602. // used to include empty fields in Patch requests.
  1603. ForceSendFields []string `json:"-"`
  1604. // NullFields is a list of field names (e.g. "Regex") to include in API
  1605. // requests with the JSON null value. By default, fields with empty
  1606. // values are omitted from API requests. However, any field with an
  1607. // empty value appearing in NullFields will be sent to the server as
  1608. // null. It is an error if a field in this list has a non-empty value.
  1609. // This may be used to include null fields in Patch requests.
  1610. NullFields []string `json:"-"`
  1611. }
  1612. func (s *ParameterValidation) MarshalJSON() ([]byte, error) {
  1613. type NoMethod ParameterValidation
  1614. raw := NoMethod(*s)
  1615. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1616. }
  1617. // PigJob: A Cloud Dataproc job for running Apache Pig
  1618. // (https://pig.apache.org/) queries on YARN.
  1619. type PigJob struct {
  1620. // ContinueOnFailure: Optional. Whether to continue executing queries if
  1621. // a query fails. The default value is false. Setting to true can be
  1622. // useful when executing independent parallel queries.
  1623. ContinueOnFailure bool `json:"continueOnFailure,omitempty"`
  1624. // JarFileUris: Optional. HCFS URIs of jar files to add to the CLASSPATH
  1625. // of the Pig Client and Hadoop MapReduce (MR) tasks. Can contain Pig
  1626. // UDFs.
  1627. JarFileUris []string `json:"jarFileUris,omitempty"`
  1628. // LoggingConfig: Optional. The runtime log config for job execution.
  1629. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  1630. // Properties: Optional. A mapping of property names to values, used to
  1631. // configure Pig. Properties that conflict with values set by the Cloud
  1632. // Dataproc API may be overwritten. Can include properties set in
  1633. // /etc/hadoop/conf/*-site.xml, /etc/pig/conf/pig.properties, and
  1634. // classes in user code.
  1635. Properties map[string]string `json:"properties,omitempty"`
  1636. // QueryFileUri: The HCFS URI of the script that contains the Pig
  1637. // queries.
  1638. QueryFileUri string `json:"queryFileUri,omitempty"`
  1639. // QueryList: A list of queries.
  1640. QueryList *QueryList `json:"queryList,omitempty"`
  1641. // ScriptVariables: Optional. Mapping of query variable names to values
  1642. // (equivalent to the Pig command: name=[value]).
  1643. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  1644. // ForceSendFields is a list of field names (e.g. "ContinueOnFailure")
  1645. // to unconditionally include in API requests. By default, fields with
  1646. // empty values are omitted from API requests. However, any non-pointer,
  1647. // non-interface field appearing in ForceSendFields will be sent to the
  1648. // server regardless of whether the field is empty or not. This may be
  1649. // used to include empty fields in Patch requests.
  1650. ForceSendFields []string `json:"-"`
  1651. // NullFields is a list of field names (e.g. "ContinueOnFailure") to
  1652. // include in API requests with the JSON null value. By default, fields
  1653. // with empty values are omitted from API requests. However, any field
  1654. // with an empty value appearing in NullFields will be sent to the
  1655. // server as null. It is an error if a field in this list has a
  1656. // non-empty value. This may be used to include null fields in Patch
  1657. // requests.
  1658. NullFields []string `json:"-"`
  1659. }
  1660. func (s *PigJob) MarshalJSON() ([]byte, error) {
  1661. type NoMethod PigJob
  1662. raw := NoMethod(*s)
  1663. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1664. }
  1665. // Policy: Defines an Identity and Access Management (IAM) policy. It is
  1666. // used to specify access control policies for Cloud Platform
  1667. // resources.A Policy consists of a list of bindings. A binding binds a
  1668. // list of members to a role, where the members can be user accounts,
  1669. // Google groups, Google domains, and service accounts. A role is a
  1670. // named list of permissions defined by IAM.JSON Example
  1671. // {
  1672. // "bindings": [
  1673. // {
  1674. // "role": "roles/owner",
  1675. // "members": [
  1676. // "user:mike@example.com",
  1677. // "group:admins@example.com",
  1678. // "domain:google.com",
  1679. // "serviceAccount:my-other-app@appspot.gserviceaccount.com"
  1680. // ]
  1681. // },
  1682. // {
  1683. // "role": "roles/viewer",
  1684. // "members": ["user:sean@example.com"]
  1685. // }
  1686. // ]
  1687. // }
  1688. // YAML Example
  1689. // bindings:
  1690. // - members:
  1691. // - user:mike@example.com
  1692. // - group:admins@example.com
  1693. // - domain:google.com
  1694. // - serviceAccount:my-other-app@appspot.gserviceaccount.com
  1695. // role: roles/owner
  1696. // - members:
  1697. // - user:sean@example.com
  1698. // role: roles/viewer
  1699. // For a description of IAM and its features, see the IAM developer's
  1700. // guide (https://cloud.google.com/iam/docs).
  1701. type Policy struct {
  1702. // Bindings: Associates a list of members to a role. bindings with no
  1703. // members will result in an error.
  1704. Bindings []*Binding `json:"bindings,omitempty"`
  1705. // Etag: etag is used for optimistic concurrency control as a way to
  1706. // help prevent simultaneous updates of a policy from overwriting each
  1707. // other. It is strongly suggested that systems make use of the etag in
  1708. // the read-modify-write cycle to perform policy updates in order to
  1709. // avoid race conditions: An etag is returned in the response to
  1710. // getIamPolicy, and systems are expected to put that etag in the
  1711. // request to setIamPolicy to ensure that their change will be applied
  1712. // to the same version of the policy.If no etag is provided in the call
  1713. // to setIamPolicy, then the existing policy is overwritten blindly.
  1714. Etag string `json:"etag,omitempty"`
  1715. // Version: Deprecated.
  1716. Version int64 `json:"version,omitempty"`
  1717. // ServerResponse contains the HTTP response code and headers from the
  1718. // server.
  1719. googleapi.ServerResponse `json:"-"`
  1720. // ForceSendFields is a list of field names (e.g. "Bindings") to
  1721. // unconditionally include in API requests. By default, fields with
  1722. // empty values are omitted from API requests. However, any non-pointer,
  1723. // non-interface field appearing in ForceSendFields will be sent to the
  1724. // server regardless of whether the field is empty or not. This may be
  1725. // used to include empty fields in Patch requests.
  1726. ForceSendFields []string `json:"-"`
  1727. // NullFields is a list of field names (e.g. "Bindings") to include in
  1728. // API requests with the JSON null value. By default, fields with empty
  1729. // values are omitted from API requests. However, any field with an
  1730. // empty value appearing in NullFields will be sent to the server as
  1731. // null. It is an error if a field in this list has a non-empty value.
  1732. // This may be used to include null fields in Patch requests.
  1733. NullFields []string `json:"-"`
  1734. }
  1735. func (s *Policy) MarshalJSON() ([]byte, error) {
  1736. type NoMethod Policy
  1737. raw := NoMethod(*s)
  1738. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1739. }
  1740. // PySparkJob: A Cloud Dataproc job for running Apache PySpark
  1741. // (https://spark.apache.org/docs/0.9.0/python-programming-guide.html)
  1742. // applications on YARN.
  1743. type PySparkJob struct {
  1744. // ArchiveUris: Optional. HCFS URIs of archives to be extracted in the
  1745. // working directory of .jar, .tar, .tar.gz, .tgz, and .zip.
  1746. ArchiveUris []string `json:"archiveUris,omitempty"`
  1747. // Args: Optional. The arguments to pass to the driver. Do not include
  1748. // arguments, such as --conf, that can be set as job properties, since a
  1749. // collision may occur that causes an incorrect job submission.
  1750. Args []string `json:"args,omitempty"`
  1751. // FileUris: Optional. HCFS URIs of files to be copied to the working
  1752. // directory of Python drivers and distributed tasks. Useful for naively
  1753. // parallel tasks.
  1754. FileUris []string `json:"fileUris,omitempty"`
  1755. // JarFileUris: Optional. HCFS URIs of jar files to add to the
  1756. // CLASSPATHs of the Python driver and tasks.
  1757. JarFileUris []string `json:"jarFileUris,omitempty"`
  1758. // LoggingConfig: Optional. The runtime log config for job execution.
  1759. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  1760. // MainPythonFileUri: Required. The HCFS URI of the main Python file to
  1761. // use as the driver. Must be a .py file.
  1762. MainPythonFileUri string `json:"mainPythonFileUri,omitempty"`
  1763. // Properties: Optional. A mapping of property names to values, used to
  1764. // configure PySpark. Properties that conflict with values set by the
  1765. // Cloud Dataproc API may be overwritten. Can include properties set in
  1766. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  1767. Properties map[string]string `json:"properties,omitempty"`
  1768. // PythonFileUris: Optional. HCFS file URIs of Python files to pass to
  1769. // the PySpark framework. Supported file types: .py, .egg, and .zip.
  1770. PythonFileUris []string `json:"pythonFileUris,omitempty"`
  1771. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  1772. // unconditionally include in API requests. By default, fields with
  1773. // empty values are omitted from API requests. However, any non-pointer,
  1774. // non-interface field appearing in ForceSendFields will be sent to the
  1775. // server regardless of whether the field is empty or not. This may be
  1776. // used to include empty fields in Patch requests.
  1777. ForceSendFields []string `json:"-"`
  1778. // NullFields is a list of field names (e.g. "ArchiveUris") to include
  1779. // in API requests with the JSON null value. By default, fields with
  1780. // empty values are omitted from API requests. However, any field with
  1781. // an empty value appearing in NullFields will be sent to the server as
  1782. // null. It is an error if a field in this list has a non-empty value.
  1783. // This may be used to include null fields in Patch requests.
  1784. NullFields []string `json:"-"`
  1785. }
  1786. func (s *PySparkJob) MarshalJSON() ([]byte, error) {
  1787. type NoMethod PySparkJob
  1788. raw := NoMethod(*s)
  1789. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1790. }
  1791. // QueryList: A list of queries to run on a cluster.
  1792. type QueryList struct {
  1793. // Queries: Required. The queries to execute. You do not need to
  1794. // terminate a query with a semicolon. Multiple queries can be specified
  1795. // in one string by separating each with a semicolon. Here is an example
  1796. // of an Cloud Dataproc API snippet that uses a QueryList to specify a
  1797. // HiveJob:
  1798. // "hiveJob": {
  1799. // "queryList": {
  1800. // "queries": [
  1801. // "query1",
  1802. // "query2",
  1803. // "query3;query4",
  1804. // ]
  1805. // }
  1806. // }
  1807. //
  1808. Queries []string `json:"queries,omitempty"`
  1809. // ForceSendFields is a list of field names (e.g. "Queries") to
  1810. // unconditionally include in API requests. By default, fields with
  1811. // empty values are omitted from API requests. However, any non-pointer,
  1812. // non-interface field appearing in ForceSendFields will be sent to the
  1813. // server regardless of whether the field is empty or not. This may be
  1814. // used to include empty fields in Patch requests.
  1815. ForceSendFields []string `json:"-"`
  1816. // NullFields is a list of field names (e.g. "Queries") to include in
  1817. // API requests with the JSON null value. By default, fields with empty
  1818. // values are omitted from API requests. However, any field with an
  1819. // empty value appearing in NullFields will be sent to the server as
  1820. // null. It is an error if a field in this list has a non-empty value.
  1821. // This may be used to include null fields in Patch requests.
  1822. NullFields []string `json:"-"`
  1823. }
  1824. func (s *QueryList) MarshalJSON() ([]byte, error) {
  1825. type NoMethod QueryList
  1826. raw := NoMethod(*s)
  1827. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1828. }
  1829. // RegexValidation: Validation based on regular expressions.
  1830. type RegexValidation struct {
  1831. // Regexes: Required. RE2 regular expressions used to validate the
  1832. // parameter's value. The provided value must match the regexes in its
  1833. // entirety, e.g. substring matches are not enough.
  1834. Regexes []string `json:"regexes,omitempty"`
  1835. // ForceSendFields is a list of field names (e.g. "Regexes") to
  1836. // unconditionally include in API requests. By default, fields with
  1837. // empty values are omitted from API requests. However, any non-pointer,
  1838. // non-interface field appearing in ForceSendFields will be sent to the
  1839. // server regardless of whether the field is empty or not. This may be
  1840. // used to include empty fields in Patch requests.
  1841. ForceSendFields []string `json:"-"`
  1842. // NullFields is a list of field names (e.g. "Regexes") to include in
  1843. // API requests with the JSON null value. By default, fields with empty
  1844. // values are omitted from API requests. However, any field with an
  1845. // empty value appearing in NullFields will be sent to the server as
  1846. // null. It is an error if a field in this list has a non-empty value.
  1847. // This may be used to include null fields in Patch requests.
  1848. NullFields []string `json:"-"`
  1849. }
  1850. func (s *RegexValidation) MarshalJSON() ([]byte, error) {
  1851. type NoMethod RegexValidation
  1852. raw := NoMethod(*s)
  1853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1854. }
  1855. // SetIamPolicyRequest: Request message for SetIamPolicy method.
  1856. type SetIamPolicyRequest struct {
  1857. // Policy: REQUIRED: The complete policy to be applied to the resource.
  1858. // The size of the policy is limited to a few 10s of KB. An empty policy
  1859. // is a valid policy but certain Cloud Platform services (such as
  1860. // Projects) might reject them.
  1861. Policy *Policy `json:"policy,omitempty"`
  1862. // ForceSendFields is a list of field names (e.g. "Policy") to
  1863. // unconditionally include in API requests. By default, fields with
  1864. // empty values are omitted from API requests. However, any non-pointer,
  1865. // non-interface field appearing in ForceSendFields will be sent to the
  1866. // server regardless of whether the field is empty or not. This may be
  1867. // used to include empty fields in Patch requests.
  1868. ForceSendFields []string `json:"-"`
  1869. // NullFields is a list of field names (e.g. "Policy") to include in API
  1870. // requests with the JSON null value. By default, fields with empty
  1871. // values are omitted from API requests. However, any field with an
  1872. // empty value appearing in NullFields will be sent to the server as
  1873. // null. It is an error if a field in this list has a non-empty value.
  1874. // This may be used to include null fields in Patch requests.
  1875. NullFields []string `json:"-"`
  1876. }
  1877. func (s *SetIamPolicyRequest) MarshalJSON() ([]byte, error) {
  1878. type NoMethod SetIamPolicyRequest
  1879. raw := NoMethod(*s)
  1880. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1881. }
  1882. // SoftwareConfig: Specifies the selection and config of software inside
  1883. // the cluster.
  1884. type SoftwareConfig struct {
  1885. // ImageVersion: Optional. The version of software inside the cluster.
  1886. // It must be one of the supported Cloud Dataproc Versions, such as
  1887. // "1.2" (including a subminor version, such as "1.2.29"), or the
  1888. // "preview" version. If unspecified, it defaults to the latest version.
  1889. ImageVersion string `json:"imageVersion,omitempty"`
  1890. // Properties: Optional. The properties to set on daemon config
  1891. // files.Property keys are specified in prefix:property format, such as
  1892. // core:fs.defaultFS. The following are supported prefixes and their
  1893. // mappings:
  1894. // capacity-scheduler: capacity-scheduler.xml
  1895. // core: core-site.xml
  1896. // distcp: distcp-default.xml
  1897. // hdfs: hdfs-site.xml
  1898. // hive: hive-site.xml
  1899. // mapred: mapred-site.xml
  1900. // pig: pig.properties
  1901. // spark: spark-defaults.conf
  1902. // yarn: yarn-site.xmlFor more information, see Cluster properties.
  1903. Properties map[string]string `json:"properties,omitempty"`
  1904. // ForceSendFields is a list of field names (e.g. "ImageVersion") to
  1905. // unconditionally include in API requests. By default, fields with
  1906. // empty values are omitted from API requests. However, any non-pointer,
  1907. // non-interface field appearing in ForceSendFields will be sent to the
  1908. // server regardless of whether the field is empty or not. This may be
  1909. // used to include empty fields in Patch requests.
  1910. ForceSendFields []string `json:"-"`
  1911. // NullFields is a list of field names (e.g. "ImageVersion") to include
  1912. // in API requests with the JSON null value. By default, fields with
  1913. // empty values are omitted from API requests. However, any field with
  1914. // an empty value appearing in NullFields will be sent to the server as
  1915. // null. It is an error if a field in this list has a non-empty value.
  1916. // This may be used to include null fields in Patch requests.
  1917. NullFields []string `json:"-"`
  1918. }
  1919. func (s *SoftwareConfig) MarshalJSON() ([]byte, error) {
  1920. type NoMethod SoftwareConfig
  1921. raw := NoMethod(*s)
  1922. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1923. }
  1924. // SparkJob: A Cloud Dataproc job for running Apache Spark
  1925. // (http://spark.apache.org/) applications on YARN.
  1926. type SparkJob struct {
  1927. // ArchiveUris: Optional. HCFS URIs of archives to be extracted in the
  1928. // working directory of Spark drivers and tasks. Supported file types:
  1929. // .jar, .tar, .tar.gz, .tgz, and .zip.
  1930. ArchiveUris []string `json:"archiveUris,omitempty"`
  1931. // Args: Optional. The arguments to pass to the driver. Do not include
  1932. // arguments, such as --conf, that can be set as job properties, since a
  1933. // collision may occur that causes an incorrect job submission.
  1934. Args []string `json:"args,omitempty"`
  1935. // FileUris: Optional. HCFS URIs of files to be copied to the working
  1936. // directory of Spark drivers and distributed tasks. Useful for naively
  1937. // parallel tasks.
  1938. FileUris []string `json:"fileUris,omitempty"`
  1939. // JarFileUris: Optional. HCFS URIs of jar files to add to the
  1940. // CLASSPATHs of the Spark driver and tasks.
  1941. JarFileUris []string `json:"jarFileUris,omitempty"`
  1942. // LoggingConfig: Optional. The runtime log config for job execution.
  1943. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  1944. // MainClass: The name of the driver's main class. The jar file that
  1945. // contains the class must be in the default CLASSPATH or specified in
  1946. // jar_file_uris.
  1947. MainClass string `json:"mainClass,omitempty"`
  1948. // MainJarFileUri: The HCFS URI of the jar file that contains the main
  1949. // class.
  1950. MainJarFileUri string `json:"mainJarFileUri,omitempty"`
  1951. // Properties: Optional. A mapping of property names to values, used to
  1952. // configure Spark. Properties that conflict with values set by the
  1953. // Cloud Dataproc API may be overwritten. Can include properties set in
  1954. // /etc/spark/conf/spark-defaults.conf and classes in user code.
  1955. Properties map[string]string `json:"properties,omitempty"`
  1956. // ForceSendFields is a list of field names (e.g. "ArchiveUris") to
  1957. // unconditionally include in API requests. By default, fields with
  1958. // empty values are omitted from API requests. However, any non-pointer,
  1959. // non-interface field appearing in ForceSendFields will be sent to the
  1960. // server regardless of whether the field is empty or not. This may be
  1961. // used to include empty fields in Patch requests.
  1962. ForceSendFields []string `json:"-"`
  1963. // NullFields is a list of field names (e.g. "ArchiveUris") to include
  1964. // in API requests with the JSON null value. By default, fields with
  1965. // empty values are omitted from API requests. However, any field with
  1966. // an empty value appearing in NullFields will be sent to the server as
  1967. // null. It is an error if a field in this list has a non-empty value.
  1968. // This may be used to include null fields in Patch requests.
  1969. NullFields []string `json:"-"`
  1970. }
  1971. func (s *SparkJob) MarshalJSON() ([]byte, error) {
  1972. type NoMethod SparkJob
  1973. raw := NoMethod(*s)
  1974. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1975. }
  1976. // SparkSqlJob: A Cloud Dataproc job for running Apache Spark SQL
  1977. // (http://spark.apache.org/sql/) queries.
  1978. type SparkSqlJob struct {
  1979. // JarFileUris: Optional. HCFS URIs of jar files to be added to the
  1980. // Spark CLASSPATH.
  1981. JarFileUris []string `json:"jarFileUris,omitempty"`
  1982. // LoggingConfig: Optional. The runtime log config for job execution.
  1983. LoggingConfig *LoggingConfig `json:"loggingConfig,omitempty"`
  1984. // Properties: Optional. A mapping of property names to values, used to
  1985. // configure Spark SQL's SparkConf. Properties that conflict with values
  1986. // set by the Cloud Dataproc API may be overwritten.
  1987. Properties map[string]string `json:"properties,omitempty"`
  1988. // QueryFileUri: The HCFS URI of the script that contains SQL queries.
  1989. QueryFileUri string `json:"queryFileUri,omitempty"`
  1990. // QueryList: A list of queries.
  1991. QueryList *QueryList `json:"queryList,omitempty"`
  1992. // ScriptVariables: Optional. Mapping of query variable names to values
  1993. // (equivalent to the Spark SQL command: SET name="value";).
  1994. ScriptVariables map[string]string `json:"scriptVariables,omitempty"`
  1995. // ForceSendFields is a list of field names (e.g. "JarFileUris") to
  1996. // unconditionally include in API requests. By default, fields with
  1997. // empty values are omitted from API requests. However, any non-pointer,
  1998. // non-interface field appearing in ForceSendFields will be sent to the
  1999. // server regardless of whether the field is empty or not. This may be
  2000. // used to include empty fields in Patch requests.
  2001. ForceSendFields []string `json:"-"`
  2002. // NullFields is a list of field names (e.g. "JarFileUris") to include
  2003. // in API requests with the JSON null value. By default, fields with
  2004. // empty values are omitted from API requests. However, any field with
  2005. // an empty value appearing in NullFields will be sent to the server as
  2006. // null. It is an error if a field in this list has a non-empty value.
  2007. // This may be used to include null fields in Patch requests.
  2008. NullFields []string `json:"-"`
  2009. }
  2010. func (s *SparkSqlJob) MarshalJSON() ([]byte, error) {
  2011. type NoMethod SparkSqlJob
  2012. raw := NoMethod(*s)
  2013. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2014. }
  2015. // Status: The Status type defines a logical error model that is
  2016. // suitable for different programming environments, including REST APIs
  2017. // and RPC APIs. It is used by gRPC (https://github.com/grpc). The error
  2018. // model is designed to be:
  2019. // Simple to use and understand for most users
  2020. // Flexible enough to meet unexpected needsOverviewThe Status message
  2021. // contains three pieces of data: error code, error message, and error
  2022. // details. The error code should be an enum value of google.rpc.Code,
  2023. // but it may accept additional error codes if needed. The error message
  2024. // should be a developer-facing English message that helps developers
  2025. // understand and resolve the error. If a localized user-facing error
  2026. // message is needed, put the localized message in the error details or
  2027. // localize it in the client. The optional error details may contain
  2028. // arbitrary information about the error. There is a predefined set of
  2029. // error detail types in the package google.rpc that can be used for
  2030. // common error conditions.Language mappingThe Status message is the
  2031. // logical representation of the error model, but it is not necessarily
  2032. // the actual wire format. When the Status message is exposed in
  2033. // different client libraries and different wire protocols, it can be
  2034. // mapped differently. For example, it will likely be mapped to some
  2035. // exceptions in Java, but more likely mapped to some error codes in
  2036. // C.Other usesThe error model and the Status message can be used in a
  2037. // variety of environments, either with or without APIs, to provide a
  2038. // consistent developer experience across different environments.Example
  2039. // uses of this error model include:
  2040. // Partial errors. If a service needs to return partial errors to the
  2041. // client, it may embed the Status in the normal response to indicate
  2042. // the partial errors.
  2043. // Workflow errors. A typical workflow has multiple steps. Each step may
  2044. // have a Status message for error reporting.
  2045. // Batch operations. If a client uses batch request and batch response,
  2046. // the Status message should be used directly inside batch response, one
  2047. // for each error sub-response.
  2048. // Asynchronous operations. If an API call embeds asynchronous operation
  2049. // results in its response, the status of those operations should be
  2050. // represented directly using the Status message.
  2051. // Logging. If some API errors are stored in logs, the message Status
  2052. // could be used directly after any stripping needed for
  2053. // security/privacy reasons.
  2054. type Status struct {
  2055. // Code: The status code, which should be an enum value of
  2056. // google.rpc.Code.
  2057. Code int64 `json:"code,omitempty"`
  2058. // Details: A list of messages that carry the error details. There is a
  2059. // common set of message types for APIs to use.
  2060. Details []googleapi.RawMessage `json:"details,omitempty"`
  2061. // Message: A developer-facing error message, which should be in
  2062. // English. Any user-facing error message should be localized and sent
  2063. // in the google.rpc.Status.details field, or localized by the client.
  2064. Message string `json:"message,omitempty"`
  2065. // ForceSendFields is a list of field names (e.g. "Code") to
  2066. // unconditionally include in API requests. By default, fields with
  2067. // empty values are omitted from API requests. However, any non-pointer,
  2068. // non-interface field appearing in ForceSendFields will be sent to the
  2069. // server regardless of whether the field is empty or not. This may be
  2070. // used to include empty fields in Patch requests.
  2071. ForceSendFields []string `json:"-"`
  2072. // NullFields is a list of field names (e.g. "Code") to include in API
  2073. // requests with the JSON null value. By default, fields with empty
  2074. // values are omitted from API requests. However, any field with an
  2075. // empty value appearing in NullFields will be sent to the server as
  2076. // null. It is an error if a field in this list has a non-empty value.
  2077. // This may be used to include null fields in Patch requests.
  2078. NullFields []string `json:"-"`
  2079. }
  2080. func (s *Status) MarshalJSON() ([]byte, error) {
  2081. type NoMethod Status
  2082. raw := NoMethod(*s)
  2083. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2084. }
  2085. // SubmitJobRequest: A request to submit a job.
  2086. type SubmitJobRequest struct {
  2087. // Job: Required. The job resource.
  2088. Job *Job `json:"job,omitempty"`
  2089. // RequestId: Optional. A unique id used to identify the request. If the
  2090. // server receives two SubmitJobRequest requests with the same id, then
  2091. // the second request will be ignored and the first Job created and
  2092. // stored in the backend is returned.It is recommended to always set
  2093. // this value to a UUID
  2094. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id
  2095. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  2096. // and hyphens (-). The maximum length is 40 characters.
  2097. RequestId string `json:"requestId,omitempty"`
  2098. // ForceSendFields is a list of field names (e.g. "Job") to
  2099. // unconditionally include in API requests. By default, fields with
  2100. // empty values are omitted from API requests. However, any non-pointer,
  2101. // non-interface field appearing in ForceSendFields will be sent to the
  2102. // server regardless of whether the field is empty or not. This may be
  2103. // used to include empty fields in Patch requests.
  2104. ForceSendFields []string `json:"-"`
  2105. // NullFields is a list of field names (e.g. "Job") to include in API
  2106. // requests with the JSON null value. By default, fields with empty
  2107. // values are omitted from API requests. However, any field with an
  2108. // empty value appearing in NullFields will be sent to the server as
  2109. // null. It is an error if a field in this list has a non-empty value.
  2110. // This may be used to include null fields in Patch requests.
  2111. NullFields []string `json:"-"`
  2112. }
  2113. func (s *SubmitJobRequest) MarshalJSON() ([]byte, error) {
  2114. type NoMethod SubmitJobRequest
  2115. raw := NoMethod(*s)
  2116. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2117. }
  2118. // TemplateParameter: A configurable parameter that replaces one or more
  2119. // fields in the template.
  2120. type TemplateParameter struct {
  2121. // Description: Optional. User-friendly description of the parameter.
  2122. // Must not exceed 1024 characters.
  2123. Description string `json:"description,omitempty"`
  2124. // Fields: Required. Paths to all fields that this parameter replaces.
  2125. // Each field may appear in at most one Parameter's fields list.Field
  2126. // path syntax:A field path is similar to a FieldMask. For example, a
  2127. // field path that references the zone field of the template's cluster
  2128. // selector would look like:placement.clusterSelector.zoneThe only
  2129. // differences between field paths and standard field masks are
  2130. // that:
  2131. // Values in maps can be referenced by key.Example:
  2132. // placement.clusterSelector.clusterLabels'key'
  2133. // Jobs in the jobs list can be referenced by step id.Example:
  2134. // jobs'step-id'.hadoopJob.mainJarFileUri
  2135. // Items in repeated fields can be referenced by zero-based
  2136. // index.Example: jobs'step-id'.sparkJob.args0NOTE: Maps and repeated
  2137. // fields may not be parameterized in their entirety. Only individual
  2138. // map values and items in repeated fields may be referenced. For
  2139. // example, the following field paths are invalid: -
  2140. // placement.clusterSelector.clusterLabels -
  2141. // jobs'step-id'.sparkJob.argsParameterizable fields:Only certain types
  2142. // of fields may be parameterized, specifically: - Labels - File uris -
  2143. // Job properties - Job arguments - Script variables - Main class (in
  2144. // HadoopJob and SparkJob) - Zone (in ClusterSelector)Examples of
  2145. // parameterizable fields:Labels:labels'key'
  2146. // placement.managedCluster.labels'key'
  2147. // placement.clusterSelector.clusterLabels'key'
  2148. // jobs'step-id'.labels'key'File
  2149. // uris:jobs'step-id'.hadoopJob.mainJarFileUri
  2150. // jobs'step-id'.hiveJob.queryFileUri
  2151. // jobs'step-id'.pySparkJob.mainPythonFileUri
  2152. // jobs'step-id'.hadoopJob.jarFileUris0
  2153. // jobs'step-id'.hadoopJob.archiveUris0
  2154. // jobs'step-id'.hadoopJob.fileUris0
  2155. // jobs'step-id'.pySparkJob.pythonFileUris0Other:jobs'step-id'.hadoopJob.
  2156. // properties'key' jobs'step-id'.hadoopJob.args0
  2157. // jobs'step-id'.hiveJob.scriptVariables'key'
  2158. // jobs'step-id'.hadoopJob.mainJarFileUri placement.clusterSelector.zone
  2159. Fields []string `json:"fields,omitempty"`
  2160. // Name: Required. User-friendly parameter name. This name is used as a
  2161. // key when providing a value for this parameter when the template is
  2162. // instantiated. Must contain only capital letters (A-Z), numbers (0-9),
  2163. // and underscores (_), and must not start with a number. The maximum
  2164. // length is 40 characters.
  2165. Name string `json:"name,omitempty"`
  2166. // Validation: Optional. Validation rules to be applied to this
  2167. // parameter's value.
  2168. Validation *ParameterValidation `json:"validation,omitempty"`
  2169. // ForceSendFields is a list of field names (e.g. "Description") to
  2170. // unconditionally include in API requests. By default, fields with
  2171. // empty values are omitted from API requests. However, any non-pointer,
  2172. // non-interface field appearing in ForceSendFields will be sent to the
  2173. // server regardless of whether the field is empty or not. This may be
  2174. // used to include empty fields in Patch requests.
  2175. ForceSendFields []string `json:"-"`
  2176. // NullFields is a list of field names (e.g. "Description") to include
  2177. // in API requests with the JSON null value. By default, fields with
  2178. // empty values are omitted from API requests. However, any field with
  2179. // an empty value appearing in NullFields will be sent to the server as
  2180. // null. It is an error if a field in this list has a non-empty value.
  2181. // This may be used to include null fields in Patch requests.
  2182. NullFields []string `json:"-"`
  2183. }
  2184. func (s *TemplateParameter) MarshalJSON() ([]byte, error) {
  2185. type NoMethod TemplateParameter
  2186. raw := NoMethod(*s)
  2187. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2188. }
  2189. // TestIamPermissionsRequest: Request message for TestIamPermissions
  2190. // method.
  2191. type TestIamPermissionsRequest struct {
  2192. // Permissions: The set of permissions to check for the resource.
  2193. // Permissions with wildcards (such as '*' or 'storage.*') are not
  2194. // allowed. For more information see IAM Overview
  2195. // (https://cloud.google.com/iam/docs/overview#permissions).
  2196. Permissions []string `json:"permissions,omitempty"`
  2197. // ForceSendFields is a list of field names (e.g. "Permissions") to
  2198. // unconditionally include in API requests. By default, fields with
  2199. // empty values are omitted from API requests. However, any non-pointer,
  2200. // non-interface field appearing in ForceSendFields will be sent to the
  2201. // server regardless of whether the field is empty or not. This may be
  2202. // used to include empty fields in Patch requests.
  2203. ForceSendFields []string `json:"-"`
  2204. // NullFields is a list of field names (e.g. "Permissions") to include
  2205. // in API requests with the JSON null value. By default, fields with
  2206. // empty values are omitted from API requests. However, any field with
  2207. // an empty value appearing in NullFields will be sent to the server as
  2208. // null. It is an error if a field in this list has a non-empty value.
  2209. // This may be used to include null fields in Patch requests.
  2210. NullFields []string `json:"-"`
  2211. }
  2212. func (s *TestIamPermissionsRequest) MarshalJSON() ([]byte, error) {
  2213. type NoMethod TestIamPermissionsRequest
  2214. raw := NoMethod(*s)
  2215. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2216. }
  2217. // TestIamPermissionsResponse: Response message for TestIamPermissions
  2218. // method.
  2219. type TestIamPermissionsResponse struct {
  2220. // Permissions: A subset of TestPermissionsRequest.permissions that the
  2221. // caller is allowed.
  2222. Permissions []string `json:"permissions,omitempty"`
  2223. // ServerResponse contains the HTTP response code and headers from the
  2224. // server.
  2225. googleapi.ServerResponse `json:"-"`
  2226. // ForceSendFields is a list of field names (e.g. "Permissions") to
  2227. // unconditionally include in API requests. By default, fields with
  2228. // empty values are omitted from API requests. However, any non-pointer,
  2229. // non-interface field appearing in ForceSendFields will be sent to the
  2230. // server regardless of whether the field is empty or not. This may be
  2231. // used to include empty fields in Patch requests.
  2232. ForceSendFields []string `json:"-"`
  2233. // NullFields is a list of field names (e.g. "Permissions") to include
  2234. // in API requests with the JSON null value. By default, fields with
  2235. // empty values are omitted from API requests. However, any field with
  2236. // an empty value appearing in NullFields will be sent to the server as
  2237. // null. It is an error if a field in this list has a non-empty value.
  2238. // This may be used to include null fields in Patch requests.
  2239. NullFields []string `json:"-"`
  2240. }
  2241. func (s *TestIamPermissionsResponse) MarshalJSON() ([]byte, error) {
  2242. type NoMethod TestIamPermissionsResponse
  2243. raw := NoMethod(*s)
  2244. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2245. }
  2246. // ValueValidation: Validation based on a list of allowed values.
  2247. type ValueValidation struct {
  2248. // Values: Required. List of allowed values for this parameter.
  2249. Values []string `json:"values,omitempty"`
  2250. // ForceSendFields is a list of field names (e.g. "Values") to
  2251. // unconditionally include in API requests. By default, fields with
  2252. // empty values are omitted from API requests. However, any non-pointer,
  2253. // non-interface field appearing in ForceSendFields will be sent to the
  2254. // server regardless of whether the field is empty or not. This may be
  2255. // used to include empty fields in Patch requests.
  2256. ForceSendFields []string `json:"-"`
  2257. // NullFields is a list of field names (e.g. "Values") to include in API
  2258. // requests with the JSON null value. By default, fields with empty
  2259. // values are omitted from API requests. However, any field with an
  2260. // empty value appearing in NullFields will be sent to the server as
  2261. // null. It is an error if a field in this list has a non-empty value.
  2262. // This may be used to include null fields in Patch requests.
  2263. NullFields []string `json:"-"`
  2264. }
  2265. func (s *ValueValidation) MarshalJSON() ([]byte, error) {
  2266. type NoMethod ValueValidation
  2267. raw := NoMethod(*s)
  2268. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2269. }
  2270. // WorkflowGraph: The workflow graph.
  2271. type WorkflowGraph struct {
  2272. // Nodes: Output only. The workflow nodes.
  2273. Nodes []*WorkflowNode `json:"nodes,omitempty"`
  2274. // ForceSendFields is a list of field names (e.g. "Nodes") to
  2275. // unconditionally include in API requests. By default, fields with
  2276. // empty values are omitted from API requests. However, any non-pointer,
  2277. // non-interface field appearing in ForceSendFields will be sent to the
  2278. // server regardless of whether the field is empty or not. This may be
  2279. // used to include empty fields in Patch requests.
  2280. ForceSendFields []string `json:"-"`
  2281. // NullFields is a list of field names (e.g. "Nodes") to include in API
  2282. // requests with the JSON null value. By default, fields with empty
  2283. // values are omitted from API requests. However, any field with an
  2284. // empty value appearing in NullFields will be sent to the server as
  2285. // null. It is an error if a field in this list has a non-empty value.
  2286. // This may be used to include null fields in Patch requests.
  2287. NullFields []string `json:"-"`
  2288. }
  2289. func (s *WorkflowGraph) MarshalJSON() ([]byte, error) {
  2290. type NoMethod WorkflowGraph
  2291. raw := NoMethod(*s)
  2292. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2293. }
  2294. // WorkflowMetadata: A Cloud Dataproc workflow template resource.
  2295. type WorkflowMetadata struct {
  2296. // ClusterName: Output only. The name of the managed cluster.
  2297. ClusterName string `json:"clusterName,omitempty"`
  2298. // CreateCluster: Output only. The create cluster operation metadata.
  2299. CreateCluster *ClusterOperation `json:"createCluster,omitempty"`
  2300. // DeleteCluster: Output only. The delete cluster operation metadata.
  2301. DeleteCluster *ClusterOperation `json:"deleteCluster,omitempty"`
  2302. // Graph: Output only. The workflow graph.
  2303. Graph *WorkflowGraph `json:"graph,omitempty"`
  2304. // Parameters: Map from parameter names to values that were used for
  2305. // those parameters.
  2306. Parameters map[string]string `json:"parameters,omitempty"`
  2307. // State: Output only. The workflow state.
  2308. //
  2309. // Possible values:
  2310. // "UNKNOWN" - Unused.
  2311. // "PENDING" - The operation has been created.
  2312. // "RUNNING" - The operation is running.
  2313. // "DONE" - The operation is done; either cancelled or completed.
  2314. State string `json:"state,omitempty"`
  2315. // Template: Output only. The "resource name" of the template.
  2316. Template string `json:"template,omitempty"`
  2317. // Version: Output only. The version of template at the time of workflow
  2318. // instantiation.
  2319. Version int64 `json:"version,omitempty"`
  2320. // ForceSendFields is a list of field names (e.g. "ClusterName") to
  2321. // unconditionally include in API requests. By default, fields with
  2322. // empty values are omitted from API requests. However, any non-pointer,
  2323. // non-interface field appearing in ForceSendFields will be sent to the
  2324. // server regardless of whether the field is empty or not. This may be
  2325. // used to include empty fields in Patch requests.
  2326. ForceSendFields []string `json:"-"`
  2327. // NullFields is a list of field names (e.g. "ClusterName") to include
  2328. // in API requests with the JSON null value. By default, fields with
  2329. // empty values are omitted from API requests. However, any field with
  2330. // an empty value appearing in NullFields will be sent to the server as
  2331. // null. It is an error if a field in this list has a non-empty value.
  2332. // This may be used to include null fields in Patch requests.
  2333. NullFields []string `json:"-"`
  2334. }
  2335. func (s *WorkflowMetadata) MarshalJSON() ([]byte, error) {
  2336. type NoMethod WorkflowMetadata
  2337. raw := NoMethod(*s)
  2338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2339. }
  2340. // WorkflowNode: The workflow node.
  2341. type WorkflowNode struct {
  2342. // Error: Output only. The error detail.
  2343. Error string `json:"error,omitempty"`
  2344. // JobId: Output only. The job id; populated after the node enters
  2345. // RUNNING state.
  2346. JobId string `json:"jobId,omitempty"`
  2347. // PrerequisiteStepIds: Output only. Node's prerequisite nodes.
  2348. PrerequisiteStepIds []string `json:"prerequisiteStepIds,omitempty"`
  2349. // State: Output only. The node state.
  2350. //
  2351. // Possible values:
  2352. // "NODE_STATUS_UNSPECIFIED" - State is unspecified.
  2353. // "BLOCKED" - The node is awaiting prerequisite node to finish.
  2354. // "RUNNABLE" - The node is runnable but not running.
  2355. // "RUNNING" - The node is running.
  2356. // "COMPLETED" - The node completed successfully.
  2357. // "FAILED" - The node failed. A node can be marked FAILED because its
  2358. // ancestor or peer failed.
  2359. State string `json:"state,omitempty"`
  2360. // StepId: Output only. The name of the node.
  2361. StepId string `json:"stepId,omitempty"`
  2362. // ForceSendFields is a list of field names (e.g. "Error") to
  2363. // unconditionally include in API requests. By default, fields with
  2364. // empty values are omitted from API requests. However, any non-pointer,
  2365. // non-interface field appearing in ForceSendFields will be sent to the
  2366. // server regardless of whether the field is empty or not. This may be
  2367. // used to include empty fields in Patch requests.
  2368. ForceSendFields []string `json:"-"`
  2369. // NullFields is a list of field names (e.g. "Error") to include in API
  2370. // requests with the JSON null value. By default, fields with empty
  2371. // values are omitted from API requests. However, any field with an
  2372. // empty value appearing in NullFields will be sent to the server as
  2373. // null. It is an error if a field in this list has a non-empty value.
  2374. // This may be used to include null fields in Patch requests.
  2375. NullFields []string `json:"-"`
  2376. }
  2377. func (s *WorkflowNode) MarshalJSON() ([]byte, error) {
  2378. type NoMethod WorkflowNode
  2379. raw := NoMethod(*s)
  2380. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2381. }
  2382. // WorkflowTemplate: A Cloud Dataproc workflow template resource.
  2383. type WorkflowTemplate struct {
  2384. // CreateTime: Output only. The time template was created.
  2385. CreateTime string `json:"createTime,omitempty"`
  2386. // Id: Required. The template id.The id must contain only letters (a-z,
  2387. // A-Z), numbers (0-9), underscores (_), and hyphens (-). Cannot begin
  2388. // or end with underscore or hyphen. Must consist of between 3 and 50
  2389. // characters.
  2390. Id string `json:"id,omitempty"`
  2391. // Jobs: Required. The Directed Acyclic Graph of Jobs to submit.
  2392. Jobs []*OrderedJob `json:"jobs,omitempty"`
  2393. // Labels: Optional. The labels to associate with this template. These
  2394. // labels will be propagated to all jobs and clusters created by the
  2395. // workflow instance.Label keys must contain 1 to 63 characters, and
  2396. // must conform to RFC 1035 (https://www.ietf.org/rfc/rfc1035.txt).Label
  2397. // values may be empty, but, if present, must contain 1 to 63
  2398. // characters, and must conform to RFC 1035
  2399. // (https://www.ietf.org/rfc/rfc1035.txt).No more than 32 labels can be
  2400. // associated with a template.
  2401. Labels map[string]string `json:"labels,omitempty"`
  2402. // Name: Output only. The "resource name" of the template, as described
  2403. // in https://cloud.google.com/apis/design/resource_names of the form
  2404. // projects/{project_id}/regions/{region}/workflowTemplates/{template_id}
  2405. Name string `json:"name,omitempty"`
  2406. // Parameters: Optional. Template parameters whose values are
  2407. // substituted into the template. Values for these parameters must be
  2408. // provided when the template is instantiated.
  2409. Parameters []*TemplateParameter `json:"parameters,omitempty"`
  2410. // Placement: Required. WorkflowTemplate scheduling information.
  2411. Placement *WorkflowTemplatePlacement `json:"placement,omitempty"`
  2412. // UpdateTime: Output only. The time template was last updated.
  2413. UpdateTime string `json:"updateTime,omitempty"`
  2414. // Version: Optional. Used to perform a consistent
  2415. // read-modify-write.This field should be left blank for a
  2416. // CreateWorkflowTemplate request. It is required for an
  2417. // UpdateWorkflowTemplate request, and must match the current server
  2418. // version. A typical update template flow would fetch the current
  2419. // template with a GetWorkflowTemplate request, which will return the
  2420. // current template with the version field filled in with the current
  2421. // server version. The user updates other fields in the template, then
  2422. // returns it as part of the UpdateWorkflowTemplate request.
  2423. Version int64 `json:"version,omitempty"`
  2424. // ServerResponse contains the HTTP response code and headers from the
  2425. // server.
  2426. googleapi.ServerResponse `json:"-"`
  2427. // ForceSendFields is a list of field names (e.g. "CreateTime") to
  2428. // unconditionally include in API requests. By default, fields with
  2429. // empty values are omitted from API requests. However, any non-pointer,
  2430. // non-interface field appearing in ForceSendFields will be sent to the
  2431. // server regardless of whether the field is empty or not. This may be
  2432. // used to include empty fields in Patch requests.
  2433. ForceSendFields []string `json:"-"`
  2434. // NullFields is a list of field names (e.g. "CreateTime") to include in
  2435. // API requests with the JSON null value. By default, fields with empty
  2436. // values are omitted from API requests. However, any field with an
  2437. // empty value appearing in NullFields will be sent to the server as
  2438. // null. It is an error if a field in this list has a non-empty value.
  2439. // This may be used to include null fields in Patch requests.
  2440. NullFields []string `json:"-"`
  2441. }
  2442. func (s *WorkflowTemplate) MarshalJSON() ([]byte, error) {
  2443. type NoMethod WorkflowTemplate
  2444. raw := NoMethod(*s)
  2445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2446. }
  2447. // WorkflowTemplatePlacement: Specifies workflow execution target.Either
  2448. // managed_cluster or cluster_selector is required.
  2449. type WorkflowTemplatePlacement struct {
  2450. // ClusterSelector: Optional. A selector that chooses target cluster for
  2451. // jobs based on metadata.The selector is evaluated at the time each job
  2452. // is submitted.
  2453. ClusterSelector *ClusterSelector `json:"clusterSelector,omitempty"`
  2454. // ManagedCluster: Optional. A cluster that is managed by the workflow.
  2455. ManagedCluster *ManagedCluster `json:"managedCluster,omitempty"`
  2456. // ForceSendFields is a list of field names (e.g. "ClusterSelector") to
  2457. // unconditionally include in API requests. By default, fields with
  2458. // empty values are omitted from API requests. However, any non-pointer,
  2459. // non-interface field appearing in ForceSendFields will be sent to the
  2460. // server regardless of whether the field is empty or not. This may be
  2461. // used to include empty fields in Patch requests.
  2462. ForceSendFields []string `json:"-"`
  2463. // NullFields is a list of field names (e.g. "ClusterSelector") to
  2464. // include in API requests with the JSON null value. By default, fields
  2465. // with empty values are omitted from API requests. However, any field
  2466. // with an empty value appearing in NullFields will be sent to the
  2467. // server as null. It is an error if a field in this list has a
  2468. // non-empty value. This may be used to include null fields in Patch
  2469. // requests.
  2470. NullFields []string `json:"-"`
  2471. }
  2472. func (s *WorkflowTemplatePlacement) MarshalJSON() ([]byte, error) {
  2473. type NoMethod WorkflowTemplatePlacement
  2474. raw := NoMethod(*s)
  2475. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2476. }
  2477. // YarnApplication: A YARN application created by a job. Application
  2478. // information is a subset of
  2479. // <code>org.apache.hadoop.yarn.proto.YarnProtos.ApplicationReportProto</
  2480. // code>.Beta Feature: This report is available for testing purposes
  2481. // only. It may be changed before final release.
  2482. type YarnApplication struct {
  2483. // Name: Required. The application name.
  2484. Name string `json:"name,omitempty"`
  2485. // Progress: Required. The numerical progress of the application, from 1
  2486. // to 100.
  2487. Progress float64 `json:"progress,omitempty"`
  2488. // State: Required. The application state.
  2489. //
  2490. // Possible values:
  2491. // "STATE_UNSPECIFIED" - Status is unspecified.
  2492. // "NEW" - Status is NEW.
  2493. // "NEW_SAVING" - Status is NEW_SAVING.
  2494. // "SUBMITTED" - Status is SUBMITTED.
  2495. // "ACCEPTED" - Status is ACCEPTED.
  2496. // "RUNNING" - Status is RUNNING.
  2497. // "FINISHED" - Status is FINISHED.
  2498. // "FAILED" - Status is FAILED.
  2499. // "KILLED" - Status is KILLED.
  2500. State string `json:"state,omitempty"`
  2501. // TrackingUrl: Optional. The HTTP URL of the ApplicationMaster,
  2502. // HistoryServer, or TimelineServer that provides application-specific
  2503. // information. The URL uses the internal hostname, and requires a proxy
  2504. // server for resolution and, possibly, access.
  2505. TrackingUrl string `json:"trackingUrl,omitempty"`
  2506. // ForceSendFields is a list of field names (e.g. "Name") to
  2507. // unconditionally include in API requests. By default, fields with
  2508. // empty values are omitted from API requests. However, any non-pointer,
  2509. // non-interface field appearing in ForceSendFields will be sent to the
  2510. // server regardless of whether the field is empty or not. This may be
  2511. // used to include empty fields in Patch requests.
  2512. ForceSendFields []string `json:"-"`
  2513. // NullFields is a list of field names (e.g. "Name") to include in API
  2514. // requests with the JSON null value. By default, fields with empty
  2515. // values are omitted from API requests. However, any field with an
  2516. // empty value appearing in NullFields will be sent to the server as
  2517. // null. It is an error if a field in this list has a non-empty value.
  2518. // This may be used to include null fields in Patch requests.
  2519. NullFields []string `json:"-"`
  2520. }
  2521. func (s *YarnApplication) MarshalJSON() ([]byte, error) {
  2522. type NoMethod YarnApplication
  2523. raw := NoMethod(*s)
  2524. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2525. }
  2526. func (s *YarnApplication) UnmarshalJSON(data []byte) error {
  2527. type NoMethod YarnApplication
  2528. var s1 struct {
  2529. Progress gensupport.JSONFloat64 `json:"progress"`
  2530. *NoMethod
  2531. }
  2532. s1.NoMethod = (*NoMethod)(s)
  2533. if err := json.Unmarshal(data, &s1); err != nil {
  2534. return err
  2535. }
  2536. s.Progress = float64(s1.Progress)
  2537. return nil
  2538. }
  2539. // method id "dataproc.projects.locations.workflowTemplates.create":
  2540. type ProjectsLocationsWorkflowTemplatesCreateCall struct {
  2541. s *Service
  2542. parent string
  2543. workflowtemplate *WorkflowTemplate
  2544. urlParams_ gensupport.URLParams
  2545. ctx_ context.Context
  2546. header_ http.Header
  2547. }
  2548. // Create: Creates new workflow template.
  2549. func (r *ProjectsLocationsWorkflowTemplatesService) Create(parent string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesCreateCall {
  2550. c := &ProjectsLocationsWorkflowTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2551. c.parent = parent
  2552. c.workflowtemplate = workflowtemplate
  2553. return c
  2554. }
  2555. // Fields allows partial responses to be retrieved. See
  2556. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2557. // for more information.
  2558. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesCreateCall {
  2559. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2560. return c
  2561. }
  2562. // Context sets the context to be used in this call's Do method. Any
  2563. // pending HTTP request will be aborted if the provided context is
  2564. // canceled.
  2565. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesCreateCall {
  2566. c.ctx_ = ctx
  2567. return c
  2568. }
  2569. // Header returns an http.Header that can be modified by the caller to
  2570. // add HTTP headers to the request.
  2571. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Header() http.Header {
  2572. if c.header_ == nil {
  2573. c.header_ = make(http.Header)
  2574. }
  2575. return c.header_
  2576. }
  2577. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) {
  2578. reqHeaders := make(http.Header)
  2579. for k, v := range c.header_ {
  2580. reqHeaders[k] = v
  2581. }
  2582. reqHeaders.Set("User-Agent", c.s.userAgent())
  2583. var body io.Reader = nil
  2584. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  2585. if err != nil {
  2586. return nil, err
  2587. }
  2588. reqHeaders.Set("Content-Type", "application/json")
  2589. c.urlParams_.Set("alt", alt)
  2590. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates")
  2591. urls += "?" + c.urlParams_.Encode()
  2592. req, _ := http.NewRequest("POST", urls, body)
  2593. req.Header = reqHeaders
  2594. googleapi.Expand(req.URL, map[string]string{
  2595. "parent": c.parent,
  2596. })
  2597. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2598. }
  2599. // Do executes the "dataproc.projects.locations.workflowTemplates.create" call.
  2600. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  2601. // non-2xx status code is an error. Response headers are in either
  2602. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  2603. // returned at all) in error.(*googleapi.Error).Header. Use
  2604. // googleapi.IsNotModified to check whether the returned error was
  2605. // because http.StatusNotModified was returned.
  2606. func (c *ProjectsLocationsWorkflowTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  2607. gensupport.SetOptions(c.urlParams_, opts...)
  2608. res, err := c.doRequest("json")
  2609. if res != nil && res.StatusCode == http.StatusNotModified {
  2610. if res.Body != nil {
  2611. res.Body.Close()
  2612. }
  2613. return nil, &googleapi.Error{
  2614. Code: res.StatusCode,
  2615. Header: res.Header,
  2616. }
  2617. }
  2618. if err != nil {
  2619. return nil, err
  2620. }
  2621. defer googleapi.CloseBody(res)
  2622. if err := googleapi.CheckResponse(res); err != nil {
  2623. return nil, err
  2624. }
  2625. ret := &WorkflowTemplate{
  2626. ServerResponse: googleapi.ServerResponse{
  2627. Header: res.Header,
  2628. HTTPStatusCode: res.StatusCode,
  2629. },
  2630. }
  2631. target := &ret
  2632. if err := gensupport.DecodeResponse(target, res); err != nil {
  2633. return nil, err
  2634. }
  2635. return ret, nil
  2636. // {
  2637. // "description": "Creates new workflow template.",
  2638. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates",
  2639. // "httpMethod": "POST",
  2640. // "id": "dataproc.projects.locations.workflowTemplates.create",
  2641. // "parameterOrder": [
  2642. // "parent"
  2643. // ],
  2644. // "parameters": {
  2645. // "parent": {
  2646. // "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}",
  2647. // "location": "path",
  2648. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  2649. // "required": true,
  2650. // "type": "string"
  2651. // }
  2652. // },
  2653. // "path": "v1beta2/{+parent}/workflowTemplates",
  2654. // "request": {
  2655. // "$ref": "WorkflowTemplate"
  2656. // },
  2657. // "response": {
  2658. // "$ref": "WorkflowTemplate"
  2659. // },
  2660. // "scopes": [
  2661. // "https://www.googleapis.com/auth/cloud-platform"
  2662. // ]
  2663. // }
  2664. }
  2665. // method id "dataproc.projects.locations.workflowTemplates.delete":
  2666. type ProjectsLocationsWorkflowTemplatesDeleteCall struct {
  2667. s *Service
  2668. name string
  2669. urlParams_ gensupport.URLParams
  2670. ctx_ context.Context
  2671. header_ http.Header
  2672. }
  2673. // Delete: Deletes a workflow template. It does not cancel in-progress
  2674. // workflows.
  2675. func (r *ProjectsLocationsWorkflowTemplatesService) Delete(name string) *ProjectsLocationsWorkflowTemplatesDeleteCall {
  2676. c := &ProjectsLocationsWorkflowTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2677. c.name = name
  2678. return c
  2679. }
  2680. // Version sets the optional parameter "version": The version of
  2681. // workflow template to delete. If specified, will only delete the
  2682. // template if the current server version matches specified version.
  2683. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Version(version int64) *ProjectsLocationsWorkflowTemplatesDeleteCall {
  2684. c.urlParams_.Set("version", fmt.Sprint(version))
  2685. return c
  2686. }
  2687. // Fields allows partial responses to be retrieved. See
  2688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2689. // for more information.
  2690. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesDeleteCall {
  2691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2692. return c
  2693. }
  2694. // Context sets the context to be used in this call's Do method. Any
  2695. // pending HTTP request will be aborted if the provided context is
  2696. // canceled.
  2697. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesDeleteCall {
  2698. c.ctx_ = ctx
  2699. return c
  2700. }
  2701. // Header returns an http.Header that can be modified by the caller to
  2702. // add HTTP headers to the request.
  2703. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Header() http.Header {
  2704. if c.header_ == nil {
  2705. c.header_ = make(http.Header)
  2706. }
  2707. return c.header_
  2708. }
  2709. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2710. reqHeaders := make(http.Header)
  2711. for k, v := range c.header_ {
  2712. reqHeaders[k] = v
  2713. }
  2714. reqHeaders.Set("User-Agent", c.s.userAgent())
  2715. var body io.Reader = nil
  2716. c.urlParams_.Set("alt", alt)
  2717. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  2718. urls += "?" + c.urlParams_.Encode()
  2719. req, _ := http.NewRequest("DELETE", urls, body)
  2720. req.Header = reqHeaders
  2721. googleapi.Expand(req.URL, map[string]string{
  2722. "name": c.name,
  2723. })
  2724. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2725. }
  2726. // Do executes the "dataproc.projects.locations.workflowTemplates.delete" call.
  2727. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  2728. // code is an error. Response headers are in either
  2729. // *Empty.ServerResponse.Header or (if a response was returned at all)
  2730. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  2731. // check whether the returned error was because http.StatusNotModified
  2732. // was returned.
  2733. func (c *ProjectsLocationsWorkflowTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2734. gensupport.SetOptions(c.urlParams_, opts...)
  2735. res, err := c.doRequest("json")
  2736. if res != nil && res.StatusCode == http.StatusNotModified {
  2737. if res.Body != nil {
  2738. res.Body.Close()
  2739. }
  2740. return nil, &googleapi.Error{
  2741. Code: res.StatusCode,
  2742. Header: res.Header,
  2743. }
  2744. }
  2745. if err != nil {
  2746. return nil, err
  2747. }
  2748. defer googleapi.CloseBody(res)
  2749. if err := googleapi.CheckResponse(res); err != nil {
  2750. return nil, err
  2751. }
  2752. ret := &Empty{
  2753. ServerResponse: googleapi.ServerResponse{
  2754. Header: res.Header,
  2755. HTTPStatusCode: res.StatusCode,
  2756. },
  2757. }
  2758. target := &ret
  2759. if err := gensupport.DecodeResponse(target, res); err != nil {
  2760. return nil, err
  2761. }
  2762. return ret, nil
  2763. // {
  2764. // "description": "Deletes a workflow template. It does not cancel in-progress workflows.",
  2765. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}",
  2766. // "httpMethod": "DELETE",
  2767. // "id": "dataproc.projects.locations.workflowTemplates.delete",
  2768. // "parameterOrder": [
  2769. // "name"
  2770. // ],
  2771. // "parameters": {
  2772. // "name": {
  2773. // "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}",
  2774. // "location": "path",
  2775. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  2776. // "required": true,
  2777. // "type": "string"
  2778. // },
  2779. // "version": {
  2780. // "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.",
  2781. // "format": "int32",
  2782. // "location": "query",
  2783. // "type": "integer"
  2784. // }
  2785. // },
  2786. // "path": "v1beta2/{+name}",
  2787. // "response": {
  2788. // "$ref": "Empty"
  2789. // },
  2790. // "scopes": [
  2791. // "https://www.googleapis.com/auth/cloud-platform"
  2792. // ]
  2793. // }
  2794. }
  2795. // method id "dataproc.projects.locations.workflowTemplates.get":
  2796. type ProjectsLocationsWorkflowTemplatesGetCall struct {
  2797. s *Service
  2798. name string
  2799. urlParams_ gensupport.URLParams
  2800. ifNoneMatch_ string
  2801. ctx_ context.Context
  2802. header_ http.Header
  2803. }
  2804. // Get: Retrieves the latest workflow template.Can retrieve previously
  2805. // instantiated template by specifying optional version parameter.
  2806. func (r *ProjectsLocationsWorkflowTemplatesService) Get(name string) *ProjectsLocationsWorkflowTemplatesGetCall {
  2807. c := &ProjectsLocationsWorkflowTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2808. c.name = name
  2809. return c
  2810. }
  2811. // Version sets the optional parameter "version": The version of
  2812. // workflow template to retrieve. Only previously instatiated versions
  2813. // can be retrieved.If unspecified, retrieves the current version.
  2814. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Version(version int64) *ProjectsLocationsWorkflowTemplatesGetCall {
  2815. c.urlParams_.Set("version", fmt.Sprint(version))
  2816. return c
  2817. }
  2818. // Fields allows partial responses to be retrieved. See
  2819. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2820. // for more information.
  2821. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesGetCall {
  2822. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2823. return c
  2824. }
  2825. // IfNoneMatch sets the optional parameter which makes the operation
  2826. // fail if the object's ETag matches the given value. This is useful for
  2827. // getting updates only after the object has changed since the last
  2828. // request. Use googleapi.IsNotModified to check whether the response
  2829. // error from Do is the result of In-None-Match.
  2830. func (c *ProjectsLocationsWorkflowTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesGetCall {
  2831. c.ifNoneMatch_ = entityTag
  2832. return c
  2833. }
  2834. // Context sets the context to be used in this call's Do method. Any
  2835. // pending HTTP request will be aborted if the provided context is
  2836. // canceled.
  2837. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesGetCall {
  2838. c.ctx_ = ctx
  2839. return c
  2840. }
  2841. // Header returns an http.Header that can be modified by the caller to
  2842. // add HTTP headers to the request.
  2843. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Header() http.Header {
  2844. if c.header_ == nil {
  2845. c.header_ = make(http.Header)
  2846. }
  2847. return c.header_
  2848. }
  2849. func (c *ProjectsLocationsWorkflowTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  2850. reqHeaders := make(http.Header)
  2851. for k, v := range c.header_ {
  2852. reqHeaders[k] = v
  2853. }
  2854. reqHeaders.Set("User-Agent", c.s.userAgent())
  2855. if c.ifNoneMatch_ != "" {
  2856. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2857. }
  2858. var body io.Reader = nil
  2859. c.urlParams_.Set("alt", alt)
  2860. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  2861. urls += "?" + c.urlParams_.Encode()
  2862. req, _ := http.NewRequest("GET", urls, body)
  2863. req.Header = reqHeaders
  2864. googleapi.Expand(req.URL, map[string]string{
  2865. "name": c.name,
  2866. })
  2867. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2868. }
  2869. // Do executes the "dataproc.projects.locations.workflowTemplates.get" call.
  2870. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  2871. // non-2xx status code is an error. Response headers are in either
  2872. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  2873. // returned at all) in error.(*googleapi.Error).Header. Use
  2874. // googleapi.IsNotModified to check whether the returned error was
  2875. // because http.StatusNotModified was returned.
  2876. func (c *ProjectsLocationsWorkflowTemplatesGetCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  2877. gensupport.SetOptions(c.urlParams_, opts...)
  2878. res, err := c.doRequest("json")
  2879. if res != nil && res.StatusCode == http.StatusNotModified {
  2880. if res.Body != nil {
  2881. res.Body.Close()
  2882. }
  2883. return nil, &googleapi.Error{
  2884. Code: res.StatusCode,
  2885. Header: res.Header,
  2886. }
  2887. }
  2888. if err != nil {
  2889. return nil, err
  2890. }
  2891. defer googleapi.CloseBody(res)
  2892. if err := googleapi.CheckResponse(res); err != nil {
  2893. return nil, err
  2894. }
  2895. ret := &WorkflowTemplate{
  2896. ServerResponse: googleapi.ServerResponse{
  2897. Header: res.Header,
  2898. HTTPStatusCode: res.StatusCode,
  2899. },
  2900. }
  2901. target := &ret
  2902. if err := gensupport.DecodeResponse(target, res); err != nil {
  2903. return nil, err
  2904. }
  2905. return ret, nil
  2906. // {
  2907. // "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.",
  2908. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}",
  2909. // "httpMethod": "GET",
  2910. // "id": "dataproc.projects.locations.workflowTemplates.get",
  2911. // "parameterOrder": [
  2912. // "name"
  2913. // ],
  2914. // "parameters": {
  2915. // "name": {
  2916. // "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}",
  2917. // "location": "path",
  2918. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  2919. // "required": true,
  2920. // "type": "string"
  2921. // },
  2922. // "version": {
  2923. // "description": "Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version.",
  2924. // "format": "int32",
  2925. // "location": "query",
  2926. // "type": "integer"
  2927. // }
  2928. // },
  2929. // "path": "v1beta2/{+name}",
  2930. // "response": {
  2931. // "$ref": "WorkflowTemplate"
  2932. // },
  2933. // "scopes": [
  2934. // "https://www.googleapis.com/auth/cloud-platform"
  2935. // ]
  2936. // }
  2937. }
  2938. // method id "dataproc.projects.locations.workflowTemplates.getIamPolicy":
  2939. type ProjectsLocationsWorkflowTemplatesGetIamPolicyCall struct {
  2940. s *Service
  2941. resource string
  2942. urlParams_ gensupport.URLParams
  2943. ifNoneMatch_ string
  2944. ctx_ context.Context
  2945. header_ http.Header
  2946. }
  2947. // GetIamPolicy: Gets the access control policy for a resource. Returns
  2948. // an empty policy if the resource exists and does not have a policy
  2949. // set.
  2950. func (r *ProjectsLocationsWorkflowTemplatesService) GetIamPolicy(resource string) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall {
  2951. c := &ProjectsLocationsWorkflowTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2952. c.resource = resource
  2953. return c
  2954. }
  2955. // Fields allows partial responses to be retrieved. See
  2956. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2957. // for more information.
  2958. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall {
  2959. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2960. return c
  2961. }
  2962. // IfNoneMatch sets the optional parameter which makes the operation
  2963. // fail if the object's ETag matches the given value. This is useful for
  2964. // getting updates only after the object has changed since the last
  2965. // request. Use googleapi.IsNotModified to check whether the response
  2966. // error from Do is the result of In-None-Match.
  2967. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall {
  2968. c.ifNoneMatch_ = entityTag
  2969. return c
  2970. }
  2971. // Context sets the context to be used in this call's Do method. Any
  2972. // pending HTTP request will be aborted if the provided context is
  2973. // canceled.
  2974. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall {
  2975. c.ctx_ = ctx
  2976. return c
  2977. }
  2978. // Header returns an http.Header that can be modified by the caller to
  2979. // add HTTP headers to the request.
  2980. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Header() http.Header {
  2981. if c.header_ == nil {
  2982. c.header_ = make(http.Header)
  2983. }
  2984. return c.header_
  2985. }
  2986. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  2987. reqHeaders := make(http.Header)
  2988. for k, v := range c.header_ {
  2989. reqHeaders[k] = v
  2990. }
  2991. reqHeaders.Set("User-Agent", c.s.userAgent())
  2992. if c.ifNoneMatch_ != "" {
  2993. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2994. }
  2995. var body io.Reader = nil
  2996. c.urlParams_.Set("alt", alt)
  2997. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
  2998. urls += "?" + c.urlParams_.Encode()
  2999. req, _ := http.NewRequest("GET", urls, body)
  3000. req.Header = reqHeaders
  3001. googleapi.Expand(req.URL, map[string]string{
  3002. "resource": c.resource,
  3003. })
  3004. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3005. }
  3006. // Do executes the "dataproc.projects.locations.workflowTemplates.getIamPolicy" call.
  3007. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  3008. // code is an error. Response headers are in either
  3009. // *Policy.ServerResponse.Header or (if a response was returned at all)
  3010. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3011. // check whether the returned error was because http.StatusNotModified
  3012. // was returned.
  3013. func (c *ProjectsLocationsWorkflowTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3014. gensupport.SetOptions(c.urlParams_, opts...)
  3015. res, err := c.doRequest("json")
  3016. if res != nil && res.StatusCode == http.StatusNotModified {
  3017. if res.Body != nil {
  3018. res.Body.Close()
  3019. }
  3020. return nil, &googleapi.Error{
  3021. Code: res.StatusCode,
  3022. Header: res.Header,
  3023. }
  3024. }
  3025. if err != nil {
  3026. return nil, err
  3027. }
  3028. defer googleapi.CloseBody(res)
  3029. if err := googleapi.CheckResponse(res); err != nil {
  3030. return nil, err
  3031. }
  3032. ret := &Policy{
  3033. ServerResponse: googleapi.ServerResponse{
  3034. Header: res.Header,
  3035. HTTPStatusCode: res.StatusCode,
  3036. },
  3037. }
  3038. target := &ret
  3039. if err := gensupport.DecodeResponse(target, res); err != nil {
  3040. return nil, err
  3041. }
  3042. return ret, nil
  3043. // {
  3044. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  3045. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:getIamPolicy",
  3046. // "httpMethod": "GET",
  3047. // "id": "dataproc.projects.locations.workflowTemplates.getIamPolicy",
  3048. // "parameterOrder": [
  3049. // "resource"
  3050. // ],
  3051. // "parameters": {
  3052. // "resource": {
  3053. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  3054. // "location": "path",
  3055. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  3056. // "required": true,
  3057. // "type": "string"
  3058. // }
  3059. // },
  3060. // "path": "v1beta2/{+resource}:getIamPolicy",
  3061. // "response": {
  3062. // "$ref": "Policy"
  3063. // },
  3064. // "scopes": [
  3065. // "https://www.googleapis.com/auth/cloud-platform"
  3066. // ]
  3067. // }
  3068. }
  3069. // method id "dataproc.projects.locations.workflowTemplates.instantiate":
  3070. type ProjectsLocationsWorkflowTemplatesInstantiateCall struct {
  3071. s *Service
  3072. name string
  3073. instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest
  3074. urlParams_ gensupport.URLParams
  3075. ctx_ context.Context
  3076. header_ http.Header
  3077. }
  3078. // Instantiate: Instantiates a template and begins execution.The
  3079. // returned Operation can be used to track execution of workflow by
  3080. // polling operations.get. The Operation will complete when entire
  3081. // workflow is finished.The running workflow can be aborted via
  3082. // operations.cancel. This will cause any inflight jobs to be cancelled
  3083. // and workflow-owned clusters to be deleted.The Operation.metadata will
  3084. // be WorkflowMetadata.On successful completion, Operation.response will
  3085. // be Empty.
  3086. func (r *ProjectsLocationsWorkflowTemplatesService) Instantiate(name string, instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest) *ProjectsLocationsWorkflowTemplatesInstantiateCall {
  3087. c := &ProjectsLocationsWorkflowTemplatesInstantiateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3088. c.name = name
  3089. c.instantiateworkflowtemplaterequest = instantiateworkflowtemplaterequest
  3090. return c
  3091. }
  3092. // Fields allows partial responses to be retrieved. See
  3093. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3094. // for more information.
  3095. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesInstantiateCall {
  3096. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3097. return c
  3098. }
  3099. // Context sets the context to be used in this call's Do method. Any
  3100. // pending HTTP request will be aborted if the provided context is
  3101. // canceled.
  3102. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesInstantiateCall {
  3103. c.ctx_ = ctx
  3104. return c
  3105. }
  3106. // Header returns an http.Header that can be modified by the caller to
  3107. // add HTTP headers to the request.
  3108. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Header() http.Header {
  3109. if c.header_ == nil {
  3110. c.header_ = make(http.Header)
  3111. }
  3112. return c.header_
  3113. }
  3114. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) {
  3115. reqHeaders := make(http.Header)
  3116. for k, v := range c.header_ {
  3117. reqHeaders[k] = v
  3118. }
  3119. reqHeaders.Set("User-Agent", c.s.userAgent())
  3120. var body io.Reader = nil
  3121. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest)
  3122. if err != nil {
  3123. return nil, err
  3124. }
  3125. reqHeaders.Set("Content-Type", "application/json")
  3126. c.urlParams_.Set("alt", alt)
  3127. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:instantiate")
  3128. urls += "?" + c.urlParams_.Encode()
  3129. req, _ := http.NewRequest("POST", urls, body)
  3130. req.Header = reqHeaders
  3131. googleapi.Expand(req.URL, map[string]string{
  3132. "name": c.name,
  3133. })
  3134. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3135. }
  3136. // Do executes the "dataproc.projects.locations.workflowTemplates.instantiate" call.
  3137. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3138. // status code is an error. Response headers are in either
  3139. // *Operation.ServerResponse.Header or (if a response was returned at
  3140. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3141. // to check whether the returned error was because
  3142. // http.StatusNotModified was returned.
  3143. func (c *ProjectsLocationsWorkflowTemplatesInstantiateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3144. gensupport.SetOptions(c.urlParams_, opts...)
  3145. res, err := c.doRequest("json")
  3146. if res != nil && res.StatusCode == http.StatusNotModified {
  3147. if res.Body != nil {
  3148. res.Body.Close()
  3149. }
  3150. return nil, &googleapi.Error{
  3151. Code: res.StatusCode,
  3152. Header: res.Header,
  3153. }
  3154. }
  3155. if err != nil {
  3156. return nil, err
  3157. }
  3158. defer googleapi.CloseBody(res)
  3159. if err := googleapi.CheckResponse(res); err != nil {
  3160. return nil, err
  3161. }
  3162. ret := &Operation{
  3163. ServerResponse: googleapi.ServerResponse{
  3164. Header: res.Header,
  3165. HTTPStatusCode: res.StatusCode,
  3166. },
  3167. }
  3168. target := &ret
  3169. if err := gensupport.DecodeResponse(target, res); err != nil {
  3170. return nil, err
  3171. }
  3172. return ret, nil
  3173. // {
  3174. // "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.",
  3175. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:instantiate",
  3176. // "httpMethod": "POST",
  3177. // "id": "dataproc.projects.locations.workflowTemplates.instantiate",
  3178. // "parameterOrder": [
  3179. // "name"
  3180. // ],
  3181. // "parameters": {
  3182. // "name": {
  3183. // "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}",
  3184. // "location": "path",
  3185. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  3186. // "required": true,
  3187. // "type": "string"
  3188. // }
  3189. // },
  3190. // "path": "v1beta2/{+name}:instantiate",
  3191. // "request": {
  3192. // "$ref": "InstantiateWorkflowTemplateRequest"
  3193. // },
  3194. // "response": {
  3195. // "$ref": "Operation"
  3196. // },
  3197. // "scopes": [
  3198. // "https://www.googleapis.com/auth/cloud-platform"
  3199. // ]
  3200. // }
  3201. }
  3202. // method id "dataproc.projects.locations.workflowTemplates.instantiateInline":
  3203. type ProjectsLocationsWorkflowTemplatesInstantiateInlineCall struct {
  3204. s *Service
  3205. parent string
  3206. workflowtemplate *WorkflowTemplate
  3207. urlParams_ gensupport.URLParams
  3208. ctx_ context.Context
  3209. header_ http.Header
  3210. }
  3211. // InstantiateInline: Instantiates a template and begins execution.This
  3212. // method is equivalent to executing the sequence
  3213. // CreateWorkflowTemplate, InstantiateWorkflowTemplate,
  3214. // DeleteWorkflowTemplate.The returned Operation can be used to track
  3215. // execution of workflow by polling operations.get. The Operation will
  3216. // complete when entire workflow is finished.The running workflow can be
  3217. // aborted via operations.cancel. This will cause any inflight jobs to
  3218. // be cancelled and workflow-owned clusters to be deleted.The
  3219. // Operation.metadata will be WorkflowMetadata.On successful completion,
  3220. // Operation.response will be Empty.
  3221. func (r *ProjectsLocationsWorkflowTemplatesService) InstantiateInline(parent string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall {
  3222. c := &ProjectsLocationsWorkflowTemplatesInstantiateInlineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3223. c.parent = parent
  3224. c.workflowtemplate = workflowtemplate
  3225. return c
  3226. }
  3227. // InstanceId sets the optional parameter "instanceId": A tag that
  3228. // prevents multiple concurrent workflow instances with the same tag
  3229. // from running. This mitigates risk of concurrent instances started due
  3230. // to retries.It is recommended to always set this value to a UUID
  3231. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag
  3232. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  3233. // and hyphens (-). The maximum length is 40 characters.
  3234. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) InstanceId(instanceId string) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall {
  3235. c.urlParams_.Set("instanceId", instanceId)
  3236. return c
  3237. }
  3238. // Fields allows partial responses to be retrieved. See
  3239. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3240. // for more information.
  3241. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall {
  3242. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3243. return c
  3244. }
  3245. // Context sets the context to be used in this call's Do method. Any
  3246. // pending HTTP request will be aborted if the provided context is
  3247. // canceled.
  3248. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall {
  3249. c.ctx_ = ctx
  3250. return c
  3251. }
  3252. // Header returns an http.Header that can be modified by the caller to
  3253. // add HTTP headers to the request.
  3254. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Header() http.Header {
  3255. if c.header_ == nil {
  3256. c.header_ = make(http.Header)
  3257. }
  3258. return c.header_
  3259. }
  3260. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) {
  3261. reqHeaders := make(http.Header)
  3262. for k, v := range c.header_ {
  3263. reqHeaders[k] = v
  3264. }
  3265. reqHeaders.Set("User-Agent", c.s.userAgent())
  3266. var body io.Reader = nil
  3267. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  3268. if err != nil {
  3269. return nil, err
  3270. }
  3271. reqHeaders.Set("Content-Type", "application/json")
  3272. c.urlParams_.Set("alt", alt)
  3273. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates:instantiateInline")
  3274. urls += "?" + c.urlParams_.Encode()
  3275. req, _ := http.NewRequest("POST", urls, body)
  3276. req.Header = reqHeaders
  3277. googleapi.Expand(req.URL, map[string]string{
  3278. "parent": c.parent,
  3279. })
  3280. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3281. }
  3282. // Do executes the "dataproc.projects.locations.workflowTemplates.instantiateInline" call.
  3283. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3284. // status code is an error. Response headers are in either
  3285. // *Operation.ServerResponse.Header or (if a response was returned at
  3286. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3287. // to check whether the returned error was because
  3288. // http.StatusNotModified was returned.
  3289. func (c *ProjectsLocationsWorkflowTemplatesInstantiateInlineCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3290. gensupport.SetOptions(c.urlParams_, opts...)
  3291. res, err := c.doRequest("json")
  3292. if res != nil && res.StatusCode == http.StatusNotModified {
  3293. if res.Body != nil {
  3294. res.Body.Close()
  3295. }
  3296. return nil, &googleapi.Error{
  3297. Code: res.StatusCode,
  3298. Header: res.Header,
  3299. }
  3300. }
  3301. if err != nil {
  3302. return nil, err
  3303. }
  3304. defer googleapi.CloseBody(res)
  3305. if err := googleapi.CheckResponse(res); err != nil {
  3306. return nil, err
  3307. }
  3308. ret := &Operation{
  3309. ServerResponse: googleapi.ServerResponse{
  3310. Header: res.Header,
  3311. HTTPStatusCode: res.StatusCode,
  3312. },
  3313. }
  3314. target := &ret
  3315. if err := gensupport.DecodeResponse(target, res); err != nil {
  3316. return nil, err
  3317. }
  3318. return ret, nil
  3319. // {
  3320. // "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.",
  3321. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates:instantiateInline",
  3322. // "httpMethod": "POST",
  3323. // "id": "dataproc.projects.locations.workflowTemplates.instantiateInline",
  3324. // "parameterOrder": [
  3325. // "parent"
  3326. // ],
  3327. // "parameters": {
  3328. // "instanceId": {
  3329. // "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.",
  3330. // "location": "query",
  3331. // "type": "string"
  3332. // },
  3333. // "parent": {
  3334. // "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}",
  3335. // "location": "path",
  3336. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  3337. // "required": true,
  3338. // "type": "string"
  3339. // }
  3340. // },
  3341. // "path": "v1beta2/{+parent}/workflowTemplates:instantiateInline",
  3342. // "request": {
  3343. // "$ref": "WorkflowTemplate"
  3344. // },
  3345. // "response": {
  3346. // "$ref": "Operation"
  3347. // },
  3348. // "scopes": [
  3349. // "https://www.googleapis.com/auth/cloud-platform"
  3350. // ]
  3351. // }
  3352. }
  3353. // method id "dataproc.projects.locations.workflowTemplates.list":
  3354. type ProjectsLocationsWorkflowTemplatesListCall struct {
  3355. s *Service
  3356. parent string
  3357. urlParams_ gensupport.URLParams
  3358. ifNoneMatch_ string
  3359. ctx_ context.Context
  3360. header_ http.Header
  3361. }
  3362. // List: Lists workflows that match the specified filter in the request.
  3363. func (r *ProjectsLocationsWorkflowTemplatesService) List(parent string) *ProjectsLocationsWorkflowTemplatesListCall {
  3364. c := &ProjectsLocationsWorkflowTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3365. c.parent = parent
  3366. return c
  3367. }
  3368. // PageSize sets the optional parameter "pageSize": The maximum number
  3369. // of results to return in each response.
  3370. func (c *ProjectsLocationsWorkflowTemplatesListCall) PageSize(pageSize int64) *ProjectsLocationsWorkflowTemplatesListCall {
  3371. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3372. return c
  3373. }
  3374. // PageToken sets the optional parameter "pageToken": The page token,
  3375. // returned by a previous call, to request the next page of results.
  3376. func (c *ProjectsLocationsWorkflowTemplatesListCall) PageToken(pageToken string) *ProjectsLocationsWorkflowTemplatesListCall {
  3377. c.urlParams_.Set("pageToken", pageToken)
  3378. return c
  3379. }
  3380. // Fields allows partial responses to be retrieved. See
  3381. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3382. // for more information.
  3383. func (c *ProjectsLocationsWorkflowTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesListCall {
  3384. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3385. return c
  3386. }
  3387. // IfNoneMatch sets the optional parameter which makes the operation
  3388. // fail if the object's ETag matches the given value. This is useful for
  3389. // getting updates only after the object has changed since the last
  3390. // request. Use googleapi.IsNotModified to check whether the response
  3391. // error from Do is the result of In-None-Match.
  3392. func (c *ProjectsLocationsWorkflowTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsLocationsWorkflowTemplatesListCall {
  3393. c.ifNoneMatch_ = entityTag
  3394. return c
  3395. }
  3396. // Context sets the context to be used in this call's Do method. Any
  3397. // pending HTTP request will be aborted if the provided context is
  3398. // canceled.
  3399. func (c *ProjectsLocationsWorkflowTemplatesListCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesListCall {
  3400. c.ctx_ = ctx
  3401. return c
  3402. }
  3403. // Header returns an http.Header that can be modified by the caller to
  3404. // add HTTP headers to the request.
  3405. func (c *ProjectsLocationsWorkflowTemplatesListCall) Header() http.Header {
  3406. if c.header_ == nil {
  3407. c.header_ = make(http.Header)
  3408. }
  3409. return c.header_
  3410. }
  3411. func (c *ProjectsLocationsWorkflowTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  3412. reqHeaders := make(http.Header)
  3413. for k, v := range c.header_ {
  3414. reqHeaders[k] = v
  3415. }
  3416. reqHeaders.Set("User-Agent", c.s.userAgent())
  3417. if c.ifNoneMatch_ != "" {
  3418. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3419. }
  3420. var body io.Reader = nil
  3421. c.urlParams_.Set("alt", alt)
  3422. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates")
  3423. urls += "?" + c.urlParams_.Encode()
  3424. req, _ := http.NewRequest("GET", urls, body)
  3425. req.Header = reqHeaders
  3426. googleapi.Expand(req.URL, map[string]string{
  3427. "parent": c.parent,
  3428. })
  3429. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3430. }
  3431. // Do executes the "dataproc.projects.locations.workflowTemplates.list" call.
  3432. // Exactly one of *ListWorkflowTemplatesResponse or error will be
  3433. // non-nil. Any non-2xx status code is an error. Response headers are in
  3434. // either *ListWorkflowTemplatesResponse.ServerResponse.Header or (if a
  3435. // response was returned at all) in error.(*googleapi.Error).Header. Use
  3436. // googleapi.IsNotModified to check whether the returned error was
  3437. // because http.StatusNotModified was returned.
  3438. func (c *ProjectsLocationsWorkflowTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowTemplatesResponse, error) {
  3439. gensupport.SetOptions(c.urlParams_, opts...)
  3440. res, err := c.doRequest("json")
  3441. if res != nil && res.StatusCode == http.StatusNotModified {
  3442. if res.Body != nil {
  3443. res.Body.Close()
  3444. }
  3445. return nil, &googleapi.Error{
  3446. Code: res.StatusCode,
  3447. Header: res.Header,
  3448. }
  3449. }
  3450. if err != nil {
  3451. return nil, err
  3452. }
  3453. defer googleapi.CloseBody(res)
  3454. if err := googleapi.CheckResponse(res); err != nil {
  3455. return nil, err
  3456. }
  3457. ret := &ListWorkflowTemplatesResponse{
  3458. ServerResponse: googleapi.ServerResponse{
  3459. Header: res.Header,
  3460. HTTPStatusCode: res.StatusCode,
  3461. },
  3462. }
  3463. target := &ret
  3464. if err := gensupport.DecodeResponse(target, res); err != nil {
  3465. return nil, err
  3466. }
  3467. return ret, nil
  3468. // {
  3469. // "description": "Lists workflows that match the specified filter in the request.",
  3470. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates",
  3471. // "httpMethod": "GET",
  3472. // "id": "dataproc.projects.locations.workflowTemplates.list",
  3473. // "parameterOrder": [
  3474. // "parent"
  3475. // ],
  3476. // "parameters": {
  3477. // "pageSize": {
  3478. // "description": "Optional. The maximum number of results to return in each response.",
  3479. // "format": "int32",
  3480. // "location": "query",
  3481. // "type": "integer"
  3482. // },
  3483. // "pageToken": {
  3484. // "description": "Optional. The page token, returned by a previous call, to request the next page of results.",
  3485. // "location": "query",
  3486. // "type": "string"
  3487. // },
  3488. // "parent": {
  3489. // "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}",
  3490. // "location": "path",
  3491. // "pattern": "^projects/[^/]+/locations/[^/]+$",
  3492. // "required": true,
  3493. // "type": "string"
  3494. // }
  3495. // },
  3496. // "path": "v1beta2/{+parent}/workflowTemplates",
  3497. // "response": {
  3498. // "$ref": "ListWorkflowTemplatesResponse"
  3499. // },
  3500. // "scopes": [
  3501. // "https://www.googleapis.com/auth/cloud-platform"
  3502. // ]
  3503. // }
  3504. }
  3505. // Pages invokes f for each page of results.
  3506. // A non-nil error returned from f will halt the iteration.
  3507. // The provided context supersedes any context provided to the Context method.
  3508. func (c *ProjectsLocationsWorkflowTemplatesListCall) Pages(ctx context.Context, f func(*ListWorkflowTemplatesResponse) error) error {
  3509. c.ctx_ = ctx
  3510. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  3511. for {
  3512. x, err := c.Do()
  3513. if err != nil {
  3514. return err
  3515. }
  3516. if err := f(x); err != nil {
  3517. return err
  3518. }
  3519. if x.NextPageToken == "" {
  3520. return nil
  3521. }
  3522. c.PageToken(x.NextPageToken)
  3523. }
  3524. }
  3525. // method id "dataproc.projects.locations.workflowTemplates.setIamPolicy":
  3526. type ProjectsLocationsWorkflowTemplatesSetIamPolicyCall struct {
  3527. s *Service
  3528. resource string
  3529. setiampolicyrequest *SetIamPolicyRequest
  3530. urlParams_ gensupport.URLParams
  3531. ctx_ context.Context
  3532. header_ http.Header
  3533. }
  3534. // SetIamPolicy: Sets the access control policy on the specified
  3535. // resource. Replaces any existing policy.
  3536. func (r *ProjectsLocationsWorkflowTemplatesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall {
  3537. c := &ProjectsLocationsWorkflowTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3538. c.resource = resource
  3539. c.setiampolicyrequest = setiampolicyrequest
  3540. return c
  3541. }
  3542. // Fields allows partial responses to be retrieved. See
  3543. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3544. // for more information.
  3545. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall {
  3546. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3547. return c
  3548. }
  3549. // Context sets the context to be used in this call's Do method. Any
  3550. // pending HTTP request will be aborted if the provided context is
  3551. // canceled.
  3552. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall {
  3553. c.ctx_ = ctx
  3554. return c
  3555. }
  3556. // Header returns an http.Header that can be modified by the caller to
  3557. // add HTTP headers to the request.
  3558. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Header() http.Header {
  3559. if c.header_ == nil {
  3560. c.header_ = make(http.Header)
  3561. }
  3562. return c.header_
  3563. }
  3564. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  3565. reqHeaders := make(http.Header)
  3566. for k, v := range c.header_ {
  3567. reqHeaders[k] = v
  3568. }
  3569. reqHeaders.Set("User-Agent", c.s.userAgent())
  3570. var body io.Reader = nil
  3571. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  3572. if err != nil {
  3573. return nil, err
  3574. }
  3575. reqHeaders.Set("Content-Type", "application/json")
  3576. c.urlParams_.Set("alt", alt)
  3577. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy")
  3578. urls += "?" + c.urlParams_.Encode()
  3579. req, _ := http.NewRequest("POST", urls, body)
  3580. req.Header = reqHeaders
  3581. googleapi.Expand(req.URL, map[string]string{
  3582. "resource": c.resource,
  3583. })
  3584. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3585. }
  3586. // Do executes the "dataproc.projects.locations.workflowTemplates.setIamPolicy" call.
  3587. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  3588. // code is an error. Response headers are in either
  3589. // *Policy.ServerResponse.Header or (if a response was returned at all)
  3590. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3591. // check whether the returned error was because http.StatusNotModified
  3592. // was returned.
  3593. func (c *ProjectsLocationsWorkflowTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  3594. gensupport.SetOptions(c.urlParams_, opts...)
  3595. res, err := c.doRequest("json")
  3596. if res != nil && res.StatusCode == http.StatusNotModified {
  3597. if res.Body != nil {
  3598. res.Body.Close()
  3599. }
  3600. return nil, &googleapi.Error{
  3601. Code: res.StatusCode,
  3602. Header: res.Header,
  3603. }
  3604. }
  3605. if err != nil {
  3606. return nil, err
  3607. }
  3608. defer googleapi.CloseBody(res)
  3609. if err := googleapi.CheckResponse(res); err != nil {
  3610. return nil, err
  3611. }
  3612. ret := &Policy{
  3613. ServerResponse: googleapi.ServerResponse{
  3614. Header: res.Header,
  3615. HTTPStatusCode: res.StatusCode,
  3616. },
  3617. }
  3618. target := &ret
  3619. if err := gensupport.DecodeResponse(target, res); err != nil {
  3620. return nil, err
  3621. }
  3622. return ret, nil
  3623. // {
  3624. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  3625. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:setIamPolicy",
  3626. // "httpMethod": "POST",
  3627. // "id": "dataproc.projects.locations.workflowTemplates.setIamPolicy",
  3628. // "parameterOrder": [
  3629. // "resource"
  3630. // ],
  3631. // "parameters": {
  3632. // "resource": {
  3633. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  3634. // "location": "path",
  3635. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  3636. // "required": true,
  3637. // "type": "string"
  3638. // }
  3639. // },
  3640. // "path": "v1beta2/{+resource}:setIamPolicy",
  3641. // "request": {
  3642. // "$ref": "SetIamPolicyRequest"
  3643. // },
  3644. // "response": {
  3645. // "$ref": "Policy"
  3646. // },
  3647. // "scopes": [
  3648. // "https://www.googleapis.com/auth/cloud-platform"
  3649. // ]
  3650. // }
  3651. }
  3652. // method id "dataproc.projects.locations.workflowTemplates.testIamPermissions":
  3653. type ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall struct {
  3654. s *Service
  3655. resource string
  3656. testiampermissionsrequest *TestIamPermissionsRequest
  3657. urlParams_ gensupport.URLParams
  3658. ctx_ context.Context
  3659. header_ http.Header
  3660. }
  3661. // TestIamPermissions: Returns permissions that a caller has on the
  3662. // specified resource. If the resource does not exist, this will return
  3663. // an empty set of permissions, not a NOT_FOUND error.Note: This
  3664. // operation is designed to be used for building permission-aware UIs
  3665. // and command-line tools, not for authorization checking. This
  3666. // operation may "fail open" without warning.
  3667. func (r *ProjectsLocationsWorkflowTemplatesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall {
  3668. c := &ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3669. c.resource = resource
  3670. c.testiampermissionsrequest = testiampermissionsrequest
  3671. return c
  3672. }
  3673. // Fields allows partial responses to be retrieved. See
  3674. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3675. // for more information.
  3676. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall {
  3677. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3678. return c
  3679. }
  3680. // Context sets the context to be used in this call's Do method. Any
  3681. // pending HTTP request will be aborted if the provided context is
  3682. // canceled.
  3683. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall {
  3684. c.ctx_ = ctx
  3685. return c
  3686. }
  3687. // Header returns an http.Header that can be modified by the caller to
  3688. // add HTTP headers to the request.
  3689. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Header() http.Header {
  3690. if c.header_ == nil {
  3691. c.header_ = make(http.Header)
  3692. }
  3693. return c.header_
  3694. }
  3695. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  3696. reqHeaders := make(http.Header)
  3697. for k, v := range c.header_ {
  3698. reqHeaders[k] = v
  3699. }
  3700. reqHeaders.Set("User-Agent", c.s.userAgent())
  3701. var body io.Reader = nil
  3702. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  3703. if err != nil {
  3704. return nil, err
  3705. }
  3706. reqHeaders.Set("Content-Type", "application/json")
  3707. c.urlParams_.Set("alt", alt)
  3708. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
  3709. urls += "?" + c.urlParams_.Encode()
  3710. req, _ := http.NewRequest("POST", urls, body)
  3711. req.Header = reqHeaders
  3712. googleapi.Expand(req.URL, map[string]string{
  3713. "resource": c.resource,
  3714. })
  3715. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3716. }
  3717. // Do executes the "dataproc.projects.locations.workflowTemplates.testIamPermissions" call.
  3718. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  3719. // Any non-2xx status code is an error. Response headers are in either
  3720. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  3721. // was returned at all) in error.(*googleapi.Error).Header. Use
  3722. // googleapi.IsNotModified to check whether the returned error was
  3723. // because http.StatusNotModified was returned.
  3724. func (c *ProjectsLocationsWorkflowTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  3725. gensupport.SetOptions(c.urlParams_, opts...)
  3726. res, err := c.doRequest("json")
  3727. if res != nil && res.StatusCode == http.StatusNotModified {
  3728. if res.Body != nil {
  3729. res.Body.Close()
  3730. }
  3731. return nil, &googleapi.Error{
  3732. Code: res.StatusCode,
  3733. Header: res.Header,
  3734. }
  3735. }
  3736. if err != nil {
  3737. return nil, err
  3738. }
  3739. defer googleapi.CloseBody(res)
  3740. if err := googleapi.CheckResponse(res); err != nil {
  3741. return nil, err
  3742. }
  3743. ret := &TestIamPermissionsResponse{
  3744. ServerResponse: googleapi.ServerResponse{
  3745. Header: res.Header,
  3746. HTTPStatusCode: res.StatusCode,
  3747. },
  3748. }
  3749. target := &ret
  3750. if err := gensupport.DecodeResponse(target, res); err != nil {
  3751. return nil, err
  3752. }
  3753. return ret, nil
  3754. // {
  3755. // "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.",
  3756. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}:testIamPermissions",
  3757. // "httpMethod": "POST",
  3758. // "id": "dataproc.projects.locations.workflowTemplates.testIamPermissions",
  3759. // "parameterOrder": [
  3760. // "resource"
  3761. // ],
  3762. // "parameters": {
  3763. // "resource": {
  3764. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  3765. // "location": "path",
  3766. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  3767. // "required": true,
  3768. // "type": "string"
  3769. // }
  3770. // },
  3771. // "path": "v1beta2/{+resource}:testIamPermissions",
  3772. // "request": {
  3773. // "$ref": "TestIamPermissionsRequest"
  3774. // },
  3775. // "response": {
  3776. // "$ref": "TestIamPermissionsResponse"
  3777. // },
  3778. // "scopes": [
  3779. // "https://www.googleapis.com/auth/cloud-platform"
  3780. // ]
  3781. // }
  3782. }
  3783. // method id "dataproc.projects.locations.workflowTemplates.update":
  3784. type ProjectsLocationsWorkflowTemplatesUpdateCall struct {
  3785. s *Service
  3786. name string
  3787. workflowtemplate *WorkflowTemplate
  3788. urlParams_ gensupport.URLParams
  3789. ctx_ context.Context
  3790. header_ http.Header
  3791. }
  3792. // Update: Updates (replaces) workflow template. The updated template
  3793. // must contain version that matches the current server version.
  3794. func (r *ProjectsLocationsWorkflowTemplatesService) Update(name string, workflowtemplate *WorkflowTemplate) *ProjectsLocationsWorkflowTemplatesUpdateCall {
  3795. c := &ProjectsLocationsWorkflowTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3796. c.name = name
  3797. c.workflowtemplate = workflowtemplate
  3798. return c
  3799. }
  3800. // Fields allows partial responses to be retrieved. See
  3801. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3802. // for more information.
  3803. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Fields(s ...googleapi.Field) *ProjectsLocationsWorkflowTemplatesUpdateCall {
  3804. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3805. return c
  3806. }
  3807. // Context sets the context to be used in this call's Do method. Any
  3808. // pending HTTP request will be aborted if the provided context is
  3809. // canceled.
  3810. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Context(ctx context.Context) *ProjectsLocationsWorkflowTemplatesUpdateCall {
  3811. c.ctx_ = ctx
  3812. return c
  3813. }
  3814. // Header returns an http.Header that can be modified by the caller to
  3815. // add HTTP headers to the request.
  3816. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Header() http.Header {
  3817. if c.header_ == nil {
  3818. c.header_ = make(http.Header)
  3819. }
  3820. return c.header_
  3821. }
  3822. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  3823. reqHeaders := make(http.Header)
  3824. for k, v := range c.header_ {
  3825. reqHeaders[k] = v
  3826. }
  3827. reqHeaders.Set("User-Agent", c.s.userAgent())
  3828. var body io.Reader = nil
  3829. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  3830. if err != nil {
  3831. return nil, err
  3832. }
  3833. reqHeaders.Set("Content-Type", "application/json")
  3834. c.urlParams_.Set("alt", alt)
  3835. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  3836. urls += "?" + c.urlParams_.Encode()
  3837. req, _ := http.NewRequest("PUT", urls, body)
  3838. req.Header = reqHeaders
  3839. googleapi.Expand(req.URL, map[string]string{
  3840. "name": c.name,
  3841. })
  3842. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3843. }
  3844. // Do executes the "dataproc.projects.locations.workflowTemplates.update" call.
  3845. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  3846. // non-2xx status code is an error. Response headers are in either
  3847. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  3848. // returned at all) in error.(*googleapi.Error).Header. Use
  3849. // googleapi.IsNotModified to check whether the returned error was
  3850. // because http.StatusNotModified was returned.
  3851. func (c *ProjectsLocationsWorkflowTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  3852. gensupport.SetOptions(c.urlParams_, opts...)
  3853. res, err := c.doRequest("json")
  3854. if res != nil && res.StatusCode == http.StatusNotModified {
  3855. if res.Body != nil {
  3856. res.Body.Close()
  3857. }
  3858. return nil, &googleapi.Error{
  3859. Code: res.StatusCode,
  3860. Header: res.Header,
  3861. }
  3862. }
  3863. if err != nil {
  3864. return nil, err
  3865. }
  3866. defer googleapi.CloseBody(res)
  3867. if err := googleapi.CheckResponse(res); err != nil {
  3868. return nil, err
  3869. }
  3870. ret := &WorkflowTemplate{
  3871. ServerResponse: googleapi.ServerResponse{
  3872. Header: res.Header,
  3873. HTTPStatusCode: res.StatusCode,
  3874. },
  3875. }
  3876. target := &ret
  3877. if err := gensupport.DecodeResponse(target, res); err != nil {
  3878. return nil, err
  3879. }
  3880. return ret, nil
  3881. // {
  3882. // "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version.",
  3883. // "flatPath": "v1beta2/projects/{projectsId}/locations/{locationsId}/workflowTemplates/{workflowTemplatesId}",
  3884. // "httpMethod": "PUT",
  3885. // "id": "dataproc.projects.locations.workflowTemplates.update",
  3886. // "parameterOrder": [
  3887. // "name"
  3888. // ],
  3889. // "parameters": {
  3890. // "name": {
  3891. // "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}",
  3892. // "location": "path",
  3893. // "pattern": "^projects/[^/]+/locations/[^/]+/workflowTemplates/[^/]+$",
  3894. // "required": true,
  3895. // "type": "string"
  3896. // }
  3897. // },
  3898. // "path": "v1beta2/{+name}",
  3899. // "request": {
  3900. // "$ref": "WorkflowTemplate"
  3901. // },
  3902. // "response": {
  3903. // "$ref": "WorkflowTemplate"
  3904. // },
  3905. // "scopes": [
  3906. // "https://www.googleapis.com/auth/cloud-platform"
  3907. // ]
  3908. // }
  3909. }
  3910. // method id "dataproc.projects.regions.clusters.create":
  3911. type ProjectsRegionsClustersCreateCall struct {
  3912. s *Service
  3913. projectId string
  3914. region string
  3915. cluster *Cluster
  3916. urlParams_ gensupport.URLParams
  3917. ctx_ context.Context
  3918. header_ http.Header
  3919. }
  3920. // Create: Creates a cluster in a project.
  3921. func (r *ProjectsRegionsClustersService) Create(projectId string, region string, cluster *Cluster) *ProjectsRegionsClustersCreateCall {
  3922. c := &ProjectsRegionsClustersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3923. c.projectId = projectId
  3924. c.region = region
  3925. c.cluster = cluster
  3926. return c
  3927. }
  3928. // RequestId sets the optional parameter "requestId": A unique id used
  3929. // to identify the request. If the server receives two
  3930. // CreateClusterRequest requests with the same id, then the second
  3931. // request will be ignored and the first google.longrunning.Operation
  3932. // created and stored in the backend is returned.It is recommended to
  3933. // always set this value to a UUID
  3934. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id
  3935. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  3936. // and hyphens (-). The maximum length is 40 characters.
  3937. func (c *ProjectsRegionsClustersCreateCall) RequestId(requestId string) *ProjectsRegionsClustersCreateCall {
  3938. c.urlParams_.Set("requestId", requestId)
  3939. return c
  3940. }
  3941. // Fields allows partial responses to be retrieved. See
  3942. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3943. // for more information.
  3944. func (c *ProjectsRegionsClustersCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersCreateCall {
  3945. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3946. return c
  3947. }
  3948. // Context sets the context to be used in this call's Do method. Any
  3949. // pending HTTP request will be aborted if the provided context is
  3950. // canceled.
  3951. func (c *ProjectsRegionsClustersCreateCall) Context(ctx context.Context) *ProjectsRegionsClustersCreateCall {
  3952. c.ctx_ = ctx
  3953. return c
  3954. }
  3955. // Header returns an http.Header that can be modified by the caller to
  3956. // add HTTP headers to the request.
  3957. func (c *ProjectsRegionsClustersCreateCall) Header() http.Header {
  3958. if c.header_ == nil {
  3959. c.header_ = make(http.Header)
  3960. }
  3961. return c.header_
  3962. }
  3963. func (c *ProjectsRegionsClustersCreateCall) doRequest(alt string) (*http.Response, error) {
  3964. reqHeaders := make(http.Header)
  3965. for k, v := range c.header_ {
  3966. reqHeaders[k] = v
  3967. }
  3968. reqHeaders.Set("User-Agent", c.s.userAgent())
  3969. var body io.Reader = nil
  3970. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster)
  3971. if err != nil {
  3972. return nil, err
  3973. }
  3974. reqHeaders.Set("Content-Type", "application/json")
  3975. c.urlParams_.Set("alt", alt)
  3976. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters")
  3977. urls += "?" + c.urlParams_.Encode()
  3978. req, _ := http.NewRequest("POST", urls, body)
  3979. req.Header = reqHeaders
  3980. googleapi.Expand(req.URL, map[string]string{
  3981. "projectId": c.projectId,
  3982. "region": c.region,
  3983. })
  3984. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3985. }
  3986. // Do executes the "dataproc.projects.regions.clusters.create" call.
  3987. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  3988. // status code is an error. Response headers are in either
  3989. // *Operation.ServerResponse.Header or (if a response was returned at
  3990. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  3991. // to check whether the returned error was because
  3992. // http.StatusNotModified was returned.
  3993. func (c *ProjectsRegionsClustersCreateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  3994. gensupport.SetOptions(c.urlParams_, opts...)
  3995. res, err := c.doRequest("json")
  3996. if res != nil && res.StatusCode == http.StatusNotModified {
  3997. if res.Body != nil {
  3998. res.Body.Close()
  3999. }
  4000. return nil, &googleapi.Error{
  4001. Code: res.StatusCode,
  4002. Header: res.Header,
  4003. }
  4004. }
  4005. if err != nil {
  4006. return nil, err
  4007. }
  4008. defer googleapi.CloseBody(res)
  4009. if err := googleapi.CheckResponse(res); err != nil {
  4010. return nil, err
  4011. }
  4012. ret := &Operation{
  4013. ServerResponse: googleapi.ServerResponse{
  4014. Header: res.Header,
  4015. HTTPStatusCode: res.StatusCode,
  4016. },
  4017. }
  4018. target := &ret
  4019. if err := gensupport.DecodeResponse(target, res); err != nil {
  4020. return nil, err
  4021. }
  4022. return ret, nil
  4023. // {
  4024. // "description": "Creates a cluster in a project.",
  4025. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters",
  4026. // "httpMethod": "POST",
  4027. // "id": "dataproc.projects.regions.clusters.create",
  4028. // "parameterOrder": [
  4029. // "projectId",
  4030. // "region"
  4031. // ],
  4032. // "parameters": {
  4033. // "projectId": {
  4034. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  4035. // "location": "path",
  4036. // "required": true,
  4037. // "type": "string"
  4038. // },
  4039. // "region": {
  4040. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  4041. // "location": "path",
  4042. // "required": true,
  4043. // "type": "string"
  4044. // },
  4045. // "requestId": {
  4046. // "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.",
  4047. // "location": "query",
  4048. // "type": "string"
  4049. // }
  4050. // },
  4051. // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters",
  4052. // "request": {
  4053. // "$ref": "Cluster"
  4054. // },
  4055. // "response": {
  4056. // "$ref": "Operation"
  4057. // },
  4058. // "scopes": [
  4059. // "https://www.googleapis.com/auth/cloud-platform"
  4060. // ]
  4061. // }
  4062. }
  4063. // method id "dataproc.projects.regions.clusters.delete":
  4064. type ProjectsRegionsClustersDeleteCall struct {
  4065. s *Service
  4066. projectId string
  4067. region string
  4068. clusterName string
  4069. urlParams_ gensupport.URLParams
  4070. ctx_ context.Context
  4071. header_ http.Header
  4072. }
  4073. // Delete: Deletes a cluster in a project.
  4074. func (r *ProjectsRegionsClustersService) Delete(projectId string, region string, clusterName string) *ProjectsRegionsClustersDeleteCall {
  4075. c := &ProjectsRegionsClustersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4076. c.projectId = projectId
  4077. c.region = region
  4078. c.clusterName = clusterName
  4079. return c
  4080. }
  4081. // ClusterUuid sets the optional parameter "clusterUuid": Specifying the
  4082. // cluster_uuid means the RPC should fail (with error NOT_FOUND) if
  4083. // cluster with specified UUID does not exist.
  4084. func (c *ProjectsRegionsClustersDeleteCall) ClusterUuid(clusterUuid string) *ProjectsRegionsClustersDeleteCall {
  4085. c.urlParams_.Set("clusterUuid", clusterUuid)
  4086. return c
  4087. }
  4088. // RequestId sets the optional parameter "requestId": A unique id used
  4089. // to identify the request. If the server receives two
  4090. // DeleteClusterRequest requests with the same id, then the second
  4091. // request will be ignored and the first google.longrunning.Operation
  4092. // created and stored in the backend is returned.It is recommended to
  4093. // always set this value to a UUID
  4094. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id
  4095. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  4096. // and hyphens (-). The maximum length is 40 characters.
  4097. func (c *ProjectsRegionsClustersDeleteCall) RequestId(requestId string) *ProjectsRegionsClustersDeleteCall {
  4098. c.urlParams_.Set("requestId", requestId)
  4099. return c
  4100. }
  4101. // Fields allows partial responses to be retrieved. See
  4102. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4103. // for more information.
  4104. func (c *ProjectsRegionsClustersDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersDeleteCall {
  4105. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4106. return c
  4107. }
  4108. // Context sets the context to be used in this call's Do method. Any
  4109. // pending HTTP request will be aborted if the provided context is
  4110. // canceled.
  4111. func (c *ProjectsRegionsClustersDeleteCall) Context(ctx context.Context) *ProjectsRegionsClustersDeleteCall {
  4112. c.ctx_ = ctx
  4113. return c
  4114. }
  4115. // Header returns an http.Header that can be modified by the caller to
  4116. // add HTTP headers to the request.
  4117. func (c *ProjectsRegionsClustersDeleteCall) Header() http.Header {
  4118. if c.header_ == nil {
  4119. c.header_ = make(http.Header)
  4120. }
  4121. return c.header_
  4122. }
  4123. func (c *ProjectsRegionsClustersDeleteCall) doRequest(alt string) (*http.Response, error) {
  4124. reqHeaders := make(http.Header)
  4125. for k, v := range c.header_ {
  4126. reqHeaders[k] = v
  4127. }
  4128. reqHeaders.Set("User-Agent", c.s.userAgent())
  4129. var body io.Reader = nil
  4130. c.urlParams_.Set("alt", alt)
  4131. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}")
  4132. urls += "?" + c.urlParams_.Encode()
  4133. req, _ := http.NewRequest("DELETE", urls, body)
  4134. req.Header = reqHeaders
  4135. googleapi.Expand(req.URL, map[string]string{
  4136. "projectId": c.projectId,
  4137. "region": c.region,
  4138. "clusterName": c.clusterName,
  4139. })
  4140. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4141. }
  4142. // Do executes the "dataproc.projects.regions.clusters.delete" call.
  4143. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4144. // status code is an error. Response headers are in either
  4145. // *Operation.ServerResponse.Header or (if a response was returned at
  4146. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4147. // to check whether the returned error was because
  4148. // http.StatusNotModified was returned.
  4149. func (c *ProjectsRegionsClustersDeleteCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4150. gensupport.SetOptions(c.urlParams_, opts...)
  4151. res, err := c.doRequest("json")
  4152. if res != nil && res.StatusCode == http.StatusNotModified {
  4153. if res.Body != nil {
  4154. res.Body.Close()
  4155. }
  4156. return nil, &googleapi.Error{
  4157. Code: res.StatusCode,
  4158. Header: res.Header,
  4159. }
  4160. }
  4161. if err != nil {
  4162. return nil, err
  4163. }
  4164. defer googleapi.CloseBody(res)
  4165. if err := googleapi.CheckResponse(res); err != nil {
  4166. return nil, err
  4167. }
  4168. ret := &Operation{
  4169. ServerResponse: googleapi.ServerResponse{
  4170. Header: res.Header,
  4171. HTTPStatusCode: res.StatusCode,
  4172. },
  4173. }
  4174. target := &ret
  4175. if err := gensupport.DecodeResponse(target, res); err != nil {
  4176. return nil, err
  4177. }
  4178. return ret, nil
  4179. // {
  4180. // "description": "Deletes a cluster in a project.",
  4181. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  4182. // "httpMethod": "DELETE",
  4183. // "id": "dataproc.projects.regions.clusters.delete",
  4184. // "parameterOrder": [
  4185. // "projectId",
  4186. // "region",
  4187. // "clusterName"
  4188. // ],
  4189. // "parameters": {
  4190. // "clusterName": {
  4191. // "description": "Required. The cluster name.",
  4192. // "location": "path",
  4193. // "required": true,
  4194. // "type": "string"
  4195. // },
  4196. // "clusterUuid": {
  4197. // "description": "Optional. Specifying the cluster_uuid means the RPC should fail (with error NOT_FOUND) if cluster with specified UUID does not exist.",
  4198. // "location": "query",
  4199. // "type": "string"
  4200. // },
  4201. // "projectId": {
  4202. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  4203. // "location": "path",
  4204. // "required": true,
  4205. // "type": "string"
  4206. // },
  4207. // "region": {
  4208. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  4209. // "location": "path",
  4210. // "required": true,
  4211. // "type": "string"
  4212. // },
  4213. // "requestId": {
  4214. // "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.",
  4215. // "location": "query",
  4216. // "type": "string"
  4217. // }
  4218. // },
  4219. // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  4220. // "response": {
  4221. // "$ref": "Operation"
  4222. // },
  4223. // "scopes": [
  4224. // "https://www.googleapis.com/auth/cloud-platform"
  4225. // ]
  4226. // }
  4227. }
  4228. // method id "dataproc.projects.regions.clusters.diagnose":
  4229. type ProjectsRegionsClustersDiagnoseCall struct {
  4230. s *Service
  4231. projectId string
  4232. region string
  4233. clusterName string
  4234. diagnoseclusterrequest *DiagnoseClusterRequest
  4235. urlParams_ gensupport.URLParams
  4236. ctx_ context.Context
  4237. header_ http.Header
  4238. }
  4239. // Diagnose: Gets cluster diagnostic information. After the operation
  4240. // completes, the Operation.response field contains
  4241. // DiagnoseClusterOutputLocation.
  4242. func (r *ProjectsRegionsClustersService) Diagnose(projectId string, region string, clusterName string, diagnoseclusterrequest *DiagnoseClusterRequest) *ProjectsRegionsClustersDiagnoseCall {
  4243. c := &ProjectsRegionsClustersDiagnoseCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4244. c.projectId = projectId
  4245. c.region = region
  4246. c.clusterName = clusterName
  4247. c.diagnoseclusterrequest = diagnoseclusterrequest
  4248. return c
  4249. }
  4250. // Fields allows partial responses to be retrieved. See
  4251. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4252. // for more information.
  4253. func (c *ProjectsRegionsClustersDiagnoseCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersDiagnoseCall {
  4254. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4255. return c
  4256. }
  4257. // Context sets the context to be used in this call's Do method. Any
  4258. // pending HTTP request will be aborted if the provided context is
  4259. // canceled.
  4260. func (c *ProjectsRegionsClustersDiagnoseCall) Context(ctx context.Context) *ProjectsRegionsClustersDiagnoseCall {
  4261. c.ctx_ = ctx
  4262. return c
  4263. }
  4264. // Header returns an http.Header that can be modified by the caller to
  4265. // add HTTP headers to the request.
  4266. func (c *ProjectsRegionsClustersDiagnoseCall) Header() http.Header {
  4267. if c.header_ == nil {
  4268. c.header_ = make(http.Header)
  4269. }
  4270. return c.header_
  4271. }
  4272. func (c *ProjectsRegionsClustersDiagnoseCall) doRequest(alt string) (*http.Response, error) {
  4273. reqHeaders := make(http.Header)
  4274. for k, v := range c.header_ {
  4275. reqHeaders[k] = v
  4276. }
  4277. reqHeaders.Set("User-Agent", c.s.userAgent())
  4278. var body io.Reader = nil
  4279. body, err := googleapi.WithoutDataWrapper.JSONReader(c.diagnoseclusterrequest)
  4280. if err != nil {
  4281. return nil, err
  4282. }
  4283. reqHeaders.Set("Content-Type", "application/json")
  4284. c.urlParams_.Set("alt", alt)
  4285. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose")
  4286. urls += "?" + c.urlParams_.Encode()
  4287. req, _ := http.NewRequest("POST", urls, body)
  4288. req.Header = reqHeaders
  4289. googleapi.Expand(req.URL, map[string]string{
  4290. "projectId": c.projectId,
  4291. "region": c.region,
  4292. "clusterName": c.clusterName,
  4293. })
  4294. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4295. }
  4296. // Do executes the "dataproc.projects.regions.clusters.diagnose" call.
  4297. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  4298. // status code is an error. Response headers are in either
  4299. // *Operation.ServerResponse.Header or (if a response was returned at
  4300. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  4301. // to check whether the returned error was because
  4302. // http.StatusNotModified was returned.
  4303. func (c *ProjectsRegionsClustersDiagnoseCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  4304. gensupport.SetOptions(c.urlParams_, opts...)
  4305. res, err := c.doRequest("json")
  4306. if res != nil && res.StatusCode == http.StatusNotModified {
  4307. if res.Body != nil {
  4308. res.Body.Close()
  4309. }
  4310. return nil, &googleapi.Error{
  4311. Code: res.StatusCode,
  4312. Header: res.Header,
  4313. }
  4314. }
  4315. if err != nil {
  4316. return nil, err
  4317. }
  4318. defer googleapi.CloseBody(res)
  4319. if err := googleapi.CheckResponse(res); err != nil {
  4320. return nil, err
  4321. }
  4322. ret := &Operation{
  4323. ServerResponse: googleapi.ServerResponse{
  4324. Header: res.Header,
  4325. HTTPStatusCode: res.StatusCode,
  4326. },
  4327. }
  4328. target := &ret
  4329. if err := gensupport.DecodeResponse(target, res); err != nil {
  4330. return nil, err
  4331. }
  4332. return ret, nil
  4333. // {
  4334. // "description": "Gets cluster diagnostic information. After the operation completes, the Operation.response field contains DiagnoseClusterOutputLocation.",
  4335. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose",
  4336. // "httpMethod": "POST",
  4337. // "id": "dataproc.projects.regions.clusters.diagnose",
  4338. // "parameterOrder": [
  4339. // "projectId",
  4340. // "region",
  4341. // "clusterName"
  4342. // ],
  4343. // "parameters": {
  4344. // "clusterName": {
  4345. // "description": "Required. The cluster name.",
  4346. // "location": "path",
  4347. // "required": true,
  4348. // "type": "string"
  4349. // },
  4350. // "projectId": {
  4351. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  4352. // "location": "path",
  4353. // "required": true,
  4354. // "type": "string"
  4355. // },
  4356. // "region": {
  4357. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  4358. // "location": "path",
  4359. // "required": true,
  4360. // "type": "string"
  4361. // }
  4362. // },
  4363. // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}:diagnose",
  4364. // "request": {
  4365. // "$ref": "DiagnoseClusterRequest"
  4366. // },
  4367. // "response": {
  4368. // "$ref": "Operation"
  4369. // },
  4370. // "scopes": [
  4371. // "https://www.googleapis.com/auth/cloud-platform"
  4372. // ]
  4373. // }
  4374. }
  4375. // method id "dataproc.projects.regions.clusters.get":
  4376. type ProjectsRegionsClustersGetCall struct {
  4377. s *Service
  4378. projectId string
  4379. region string
  4380. clusterName string
  4381. urlParams_ gensupport.URLParams
  4382. ifNoneMatch_ string
  4383. ctx_ context.Context
  4384. header_ http.Header
  4385. }
  4386. // Get: Gets the resource representation for a cluster in a project.
  4387. func (r *ProjectsRegionsClustersService) Get(projectId string, region string, clusterName string) *ProjectsRegionsClustersGetCall {
  4388. c := &ProjectsRegionsClustersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4389. c.projectId = projectId
  4390. c.region = region
  4391. c.clusterName = clusterName
  4392. return c
  4393. }
  4394. // Fields allows partial responses to be retrieved. See
  4395. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4396. // for more information.
  4397. func (c *ProjectsRegionsClustersGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersGetCall {
  4398. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4399. return c
  4400. }
  4401. // IfNoneMatch sets the optional parameter which makes the operation
  4402. // fail if the object's ETag matches the given value. This is useful for
  4403. // getting updates only after the object has changed since the last
  4404. // request. Use googleapi.IsNotModified to check whether the response
  4405. // error from Do is the result of In-None-Match.
  4406. func (c *ProjectsRegionsClustersGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersGetCall {
  4407. c.ifNoneMatch_ = entityTag
  4408. return c
  4409. }
  4410. // Context sets the context to be used in this call's Do method. Any
  4411. // pending HTTP request will be aborted if the provided context is
  4412. // canceled.
  4413. func (c *ProjectsRegionsClustersGetCall) Context(ctx context.Context) *ProjectsRegionsClustersGetCall {
  4414. c.ctx_ = ctx
  4415. return c
  4416. }
  4417. // Header returns an http.Header that can be modified by the caller to
  4418. // add HTTP headers to the request.
  4419. func (c *ProjectsRegionsClustersGetCall) Header() http.Header {
  4420. if c.header_ == nil {
  4421. c.header_ = make(http.Header)
  4422. }
  4423. return c.header_
  4424. }
  4425. func (c *ProjectsRegionsClustersGetCall) doRequest(alt string) (*http.Response, error) {
  4426. reqHeaders := make(http.Header)
  4427. for k, v := range c.header_ {
  4428. reqHeaders[k] = v
  4429. }
  4430. reqHeaders.Set("User-Agent", c.s.userAgent())
  4431. if c.ifNoneMatch_ != "" {
  4432. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4433. }
  4434. var body io.Reader = nil
  4435. c.urlParams_.Set("alt", alt)
  4436. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}")
  4437. urls += "?" + c.urlParams_.Encode()
  4438. req, _ := http.NewRequest("GET", urls, body)
  4439. req.Header = reqHeaders
  4440. googleapi.Expand(req.URL, map[string]string{
  4441. "projectId": c.projectId,
  4442. "region": c.region,
  4443. "clusterName": c.clusterName,
  4444. })
  4445. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4446. }
  4447. // Do executes the "dataproc.projects.regions.clusters.get" call.
  4448. // Exactly one of *Cluster or error will be non-nil. Any non-2xx status
  4449. // code is an error. Response headers are in either
  4450. // *Cluster.ServerResponse.Header or (if a response was returned at all)
  4451. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4452. // check whether the returned error was because http.StatusNotModified
  4453. // was returned.
  4454. func (c *ProjectsRegionsClustersGetCall) Do(opts ...googleapi.CallOption) (*Cluster, error) {
  4455. gensupport.SetOptions(c.urlParams_, opts...)
  4456. res, err := c.doRequest("json")
  4457. if res != nil && res.StatusCode == http.StatusNotModified {
  4458. if res.Body != nil {
  4459. res.Body.Close()
  4460. }
  4461. return nil, &googleapi.Error{
  4462. Code: res.StatusCode,
  4463. Header: res.Header,
  4464. }
  4465. }
  4466. if err != nil {
  4467. return nil, err
  4468. }
  4469. defer googleapi.CloseBody(res)
  4470. if err := googleapi.CheckResponse(res); err != nil {
  4471. return nil, err
  4472. }
  4473. ret := &Cluster{
  4474. ServerResponse: googleapi.ServerResponse{
  4475. Header: res.Header,
  4476. HTTPStatusCode: res.StatusCode,
  4477. },
  4478. }
  4479. target := &ret
  4480. if err := gensupport.DecodeResponse(target, res); err != nil {
  4481. return nil, err
  4482. }
  4483. return ret, nil
  4484. // {
  4485. // "description": "Gets the resource representation for a cluster in a project.",
  4486. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  4487. // "httpMethod": "GET",
  4488. // "id": "dataproc.projects.regions.clusters.get",
  4489. // "parameterOrder": [
  4490. // "projectId",
  4491. // "region",
  4492. // "clusterName"
  4493. // ],
  4494. // "parameters": {
  4495. // "clusterName": {
  4496. // "description": "Required. The cluster name.",
  4497. // "location": "path",
  4498. // "required": true,
  4499. // "type": "string"
  4500. // },
  4501. // "projectId": {
  4502. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  4503. // "location": "path",
  4504. // "required": true,
  4505. // "type": "string"
  4506. // },
  4507. // "region": {
  4508. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  4509. // "location": "path",
  4510. // "required": true,
  4511. // "type": "string"
  4512. // }
  4513. // },
  4514. // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  4515. // "response": {
  4516. // "$ref": "Cluster"
  4517. // },
  4518. // "scopes": [
  4519. // "https://www.googleapis.com/auth/cloud-platform"
  4520. // ]
  4521. // }
  4522. }
  4523. // method id "dataproc.projects.regions.clusters.getIamPolicy":
  4524. type ProjectsRegionsClustersGetIamPolicyCall struct {
  4525. s *Service
  4526. resource string
  4527. urlParams_ gensupport.URLParams
  4528. ifNoneMatch_ string
  4529. ctx_ context.Context
  4530. header_ http.Header
  4531. }
  4532. // GetIamPolicy: Gets the access control policy for a resource. Returns
  4533. // an empty policy if the resource exists and does not have a policy
  4534. // set.
  4535. func (r *ProjectsRegionsClustersService) GetIamPolicy(resource string) *ProjectsRegionsClustersGetIamPolicyCall {
  4536. c := &ProjectsRegionsClustersGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4537. c.resource = resource
  4538. return c
  4539. }
  4540. // Fields allows partial responses to be retrieved. See
  4541. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4542. // for more information.
  4543. func (c *ProjectsRegionsClustersGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersGetIamPolicyCall {
  4544. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4545. return c
  4546. }
  4547. // IfNoneMatch sets the optional parameter which makes the operation
  4548. // fail if the object's ETag matches the given value. This is useful for
  4549. // getting updates only after the object has changed since the last
  4550. // request. Use googleapi.IsNotModified to check whether the response
  4551. // error from Do is the result of In-None-Match.
  4552. func (c *ProjectsRegionsClustersGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersGetIamPolicyCall {
  4553. c.ifNoneMatch_ = entityTag
  4554. return c
  4555. }
  4556. // Context sets the context to be used in this call's Do method. Any
  4557. // pending HTTP request will be aborted if the provided context is
  4558. // canceled.
  4559. func (c *ProjectsRegionsClustersGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsClustersGetIamPolicyCall {
  4560. c.ctx_ = ctx
  4561. return c
  4562. }
  4563. // Header returns an http.Header that can be modified by the caller to
  4564. // add HTTP headers to the request.
  4565. func (c *ProjectsRegionsClustersGetIamPolicyCall) Header() http.Header {
  4566. if c.header_ == nil {
  4567. c.header_ = make(http.Header)
  4568. }
  4569. return c.header_
  4570. }
  4571. func (c *ProjectsRegionsClustersGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  4572. reqHeaders := make(http.Header)
  4573. for k, v := range c.header_ {
  4574. reqHeaders[k] = v
  4575. }
  4576. reqHeaders.Set("User-Agent", c.s.userAgent())
  4577. if c.ifNoneMatch_ != "" {
  4578. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4579. }
  4580. var body io.Reader = nil
  4581. c.urlParams_.Set("alt", alt)
  4582. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
  4583. urls += "?" + c.urlParams_.Encode()
  4584. req, _ := http.NewRequest("GET", urls, body)
  4585. req.Header = reqHeaders
  4586. googleapi.Expand(req.URL, map[string]string{
  4587. "resource": c.resource,
  4588. })
  4589. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4590. }
  4591. // Do executes the "dataproc.projects.regions.clusters.getIamPolicy" call.
  4592. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  4593. // code is an error. Response headers are in either
  4594. // *Policy.ServerResponse.Header or (if a response was returned at all)
  4595. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4596. // check whether the returned error was because http.StatusNotModified
  4597. // was returned.
  4598. func (c *ProjectsRegionsClustersGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  4599. gensupport.SetOptions(c.urlParams_, opts...)
  4600. res, err := c.doRequest("json")
  4601. if res != nil && res.StatusCode == http.StatusNotModified {
  4602. if res.Body != nil {
  4603. res.Body.Close()
  4604. }
  4605. return nil, &googleapi.Error{
  4606. Code: res.StatusCode,
  4607. Header: res.Header,
  4608. }
  4609. }
  4610. if err != nil {
  4611. return nil, err
  4612. }
  4613. defer googleapi.CloseBody(res)
  4614. if err := googleapi.CheckResponse(res); err != nil {
  4615. return nil, err
  4616. }
  4617. ret := &Policy{
  4618. ServerResponse: googleapi.ServerResponse{
  4619. Header: res.Header,
  4620. HTTPStatusCode: res.StatusCode,
  4621. },
  4622. }
  4623. target := &ret
  4624. if err := gensupport.DecodeResponse(target, res); err != nil {
  4625. return nil, err
  4626. }
  4627. return ret, nil
  4628. // {
  4629. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  4630. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:getIamPolicy",
  4631. // "httpMethod": "GET",
  4632. // "id": "dataproc.projects.regions.clusters.getIamPolicy",
  4633. // "parameterOrder": [
  4634. // "resource"
  4635. // ],
  4636. // "parameters": {
  4637. // "resource": {
  4638. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  4639. // "location": "path",
  4640. // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$",
  4641. // "required": true,
  4642. // "type": "string"
  4643. // }
  4644. // },
  4645. // "path": "v1beta2/{+resource}:getIamPolicy",
  4646. // "response": {
  4647. // "$ref": "Policy"
  4648. // },
  4649. // "scopes": [
  4650. // "https://www.googleapis.com/auth/cloud-platform"
  4651. // ]
  4652. // }
  4653. }
  4654. // method id "dataproc.projects.regions.clusters.list":
  4655. type ProjectsRegionsClustersListCall struct {
  4656. s *Service
  4657. projectId string
  4658. region string
  4659. urlParams_ gensupport.URLParams
  4660. ifNoneMatch_ string
  4661. ctx_ context.Context
  4662. header_ http.Header
  4663. }
  4664. // List: Lists all regions/{region}/clusters in a project.
  4665. func (r *ProjectsRegionsClustersService) List(projectId string, region string) *ProjectsRegionsClustersListCall {
  4666. c := &ProjectsRegionsClustersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4667. c.projectId = projectId
  4668. c.region = region
  4669. return c
  4670. }
  4671. // Filter sets the optional parameter "filter": A filter constraining
  4672. // the clusters to list. Filters are case-sensitive and have the
  4673. // following syntax:field = value AND field = value ...where field is
  4674. // one of status.state, clusterName, or labels.[KEY], and [KEY] is a
  4675. // label key. value can be * to match all values. status.state can be
  4676. // one of the following: ACTIVE, INACTIVE, CREATING, RUNNING, ERROR,
  4677. // DELETING, or UPDATING. ACTIVE contains the CREATING, UPDATING, and
  4678. // RUNNING states. INACTIVE contains the DELETING and ERROR states.
  4679. // clusterName is the name of the cluster provided at creation time.
  4680. // Only the logical AND operator is supported; space-separated items are
  4681. // treated as having an implicit AND operator.Example
  4682. // filter:status.state = ACTIVE AND clusterName = mycluster AND
  4683. // labels.env = staging AND labels.starred = *
  4684. func (c *ProjectsRegionsClustersListCall) Filter(filter string) *ProjectsRegionsClustersListCall {
  4685. c.urlParams_.Set("filter", filter)
  4686. return c
  4687. }
  4688. // PageSize sets the optional parameter "pageSize": The standard List
  4689. // page size.
  4690. func (c *ProjectsRegionsClustersListCall) PageSize(pageSize int64) *ProjectsRegionsClustersListCall {
  4691. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4692. return c
  4693. }
  4694. // PageToken sets the optional parameter "pageToken": The standard List
  4695. // page token.
  4696. func (c *ProjectsRegionsClustersListCall) PageToken(pageToken string) *ProjectsRegionsClustersListCall {
  4697. c.urlParams_.Set("pageToken", pageToken)
  4698. return c
  4699. }
  4700. // Fields allows partial responses to be retrieved. See
  4701. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4702. // for more information.
  4703. func (c *ProjectsRegionsClustersListCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersListCall {
  4704. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4705. return c
  4706. }
  4707. // IfNoneMatch sets the optional parameter which makes the operation
  4708. // fail if the object's ETag matches the given value. This is useful for
  4709. // getting updates only after the object has changed since the last
  4710. // request. Use googleapi.IsNotModified to check whether the response
  4711. // error from Do is the result of In-None-Match.
  4712. func (c *ProjectsRegionsClustersListCall) IfNoneMatch(entityTag string) *ProjectsRegionsClustersListCall {
  4713. c.ifNoneMatch_ = entityTag
  4714. return c
  4715. }
  4716. // Context sets the context to be used in this call's Do method. Any
  4717. // pending HTTP request will be aborted if the provided context is
  4718. // canceled.
  4719. func (c *ProjectsRegionsClustersListCall) Context(ctx context.Context) *ProjectsRegionsClustersListCall {
  4720. c.ctx_ = ctx
  4721. return c
  4722. }
  4723. // Header returns an http.Header that can be modified by the caller to
  4724. // add HTTP headers to the request.
  4725. func (c *ProjectsRegionsClustersListCall) Header() http.Header {
  4726. if c.header_ == nil {
  4727. c.header_ = make(http.Header)
  4728. }
  4729. return c.header_
  4730. }
  4731. func (c *ProjectsRegionsClustersListCall) doRequest(alt string) (*http.Response, error) {
  4732. reqHeaders := make(http.Header)
  4733. for k, v := range c.header_ {
  4734. reqHeaders[k] = v
  4735. }
  4736. reqHeaders.Set("User-Agent", c.s.userAgent())
  4737. if c.ifNoneMatch_ != "" {
  4738. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4739. }
  4740. var body io.Reader = nil
  4741. c.urlParams_.Set("alt", alt)
  4742. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters")
  4743. urls += "?" + c.urlParams_.Encode()
  4744. req, _ := http.NewRequest("GET", urls, body)
  4745. req.Header = reqHeaders
  4746. googleapi.Expand(req.URL, map[string]string{
  4747. "projectId": c.projectId,
  4748. "region": c.region,
  4749. })
  4750. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4751. }
  4752. // Do executes the "dataproc.projects.regions.clusters.list" call.
  4753. // Exactly one of *ListClustersResponse or error will be non-nil. Any
  4754. // non-2xx status code is an error. Response headers are in either
  4755. // *ListClustersResponse.ServerResponse.Header or (if a response was
  4756. // returned at all) in error.(*googleapi.Error).Header. Use
  4757. // googleapi.IsNotModified to check whether the returned error was
  4758. // because http.StatusNotModified was returned.
  4759. func (c *ProjectsRegionsClustersListCall) Do(opts ...googleapi.CallOption) (*ListClustersResponse, error) {
  4760. gensupport.SetOptions(c.urlParams_, opts...)
  4761. res, err := c.doRequest("json")
  4762. if res != nil && res.StatusCode == http.StatusNotModified {
  4763. if res.Body != nil {
  4764. res.Body.Close()
  4765. }
  4766. return nil, &googleapi.Error{
  4767. Code: res.StatusCode,
  4768. Header: res.Header,
  4769. }
  4770. }
  4771. if err != nil {
  4772. return nil, err
  4773. }
  4774. defer googleapi.CloseBody(res)
  4775. if err := googleapi.CheckResponse(res); err != nil {
  4776. return nil, err
  4777. }
  4778. ret := &ListClustersResponse{
  4779. ServerResponse: googleapi.ServerResponse{
  4780. Header: res.Header,
  4781. HTTPStatusCode: res.StatusCode,
  4782. },
  4783. }
  4784. target := &ret
  4785. if err := gensupport.DecodeResponse(target, res); err != nil {
  4786. return nil, err
  4787. }
  4788. return ret, nil
  4789. // {
  4790. // "description": "Lists all regions/{region}/clusters in a project.",
  4791. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters",
  4792. // "httpMethod": "GET",
  4793. // "id": "dataproc.projects.regions.clusters.list",
  4794. // "parameterOrder": [
  4795. // "projectId",
  4796. // "region"
  4797. // ],
  4798. // "parameters": {
  4799. // "filter": {
  4800. // "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 = *",
  4801. // "location": "query",
  4802. // "type": "string"
  4803. // },
  4804. // "pageSize": {
  4805. // "description": "Optional. The standard List page size.",
  4806. // "format": "int32",
  4807. // "location": "query",
  4808. // "type": "integer"
  4809. // },
  4810. // "pageToken": {
  4811. // "description": "Optional. The standard List page token.",
  4812. // "location": "query",
  4813. // "type": "string"
  4814. // },
  4815. // "projectId": {
  4816. // "description": "Required. The ID of the Google Cloud Platform project that the cluster belongs to.",
  4817. // "location": "path",
  4818. // "required": true,
  4819. // "type": "string"
  4820. // },
  4821. // "region": {
  4822. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  4823. // "location": "path",
  4824. // "required": true,
  4825. // "type": "string"
  4826. // }
  4827. // },
  4828. // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters",
  4829. // "response": {
  4830. // "$ref": "ListClustersResponse"
  4831. // },
  4832. // "scopes": [
  4833. // "https://www.googleapis.com/auth/cloud-platform"
  4834. // ]
  4835. // }
  4836. }
  4837. // Pages invokes f for each page of results.
  4838. // A non-nil error returned from f will halt the iteration.
  4839. // The provided context supersedes any context provided to the Context method.
  4840. func (c *ProjectsRegionsClustersListCall) Pages(ctx context.Context, f func(*ListClustersResponse) error) error {
  4841. c.ctx_ = ctx
  4842. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4843. for {
  4844. x, err := c.Do()
  4845. if err != nil {
  4846. return err
  4847. }
  4848. if err := f(x); err != nil {
  4849. return err
  4850. }
  4851. if x.NextPageToken == "" {
  4852. return nil
  4853. }
  4854. c.PageToken(x.NextPageToken)
  4855. }
  4856. }
  4857. // method id "dataproc.projects.regions.clusters.patch":
  4858. type ProjectsRegionsClustersPatchCall struct {
  4859. s *Service
  4860. projectId string
  4861. region string
  4862. clusterName string
  4863. cluster *Cluster
  4864. urlParams_ gensupport.URLParams
  4865. ctx_ context.Context
  4866. header_ http.Header
  4867. }
  4868. // Patch: Updates a cluster in a project.
  4869. func (r *ProjectsRegionsClustersService) Patch(projectId string, region string, clusterName string, cluster *Cluster) *ProjectsRegionsClustersPatchCall {
  4870. c := &ProjectsRegionsClustersPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4871. c.projectId = projectId
  4872. c.region = region
  4873. c.clusterName = clusterName
  4874. c.cluster = cluster
  4875. return c
  4876. }
  4877. // GracefulDecommissionTimeout sets the optional parameter
  4878. // "gracefulDecommissionTimeout": Timeout for graceful YARN
  4879. // decomissioning. Graceful decommissioning allows removing nodes from
  4880. // the cluster without interrupting jobs in progress. Timeout specifies
  4881. // how long to wait for jobs in progress to finish before forcefully
  4882. // removing nodes (and potentially interrupting jobs). Default timeout
  4883. // is 0 (for forceful decommission), and the maximum allowed timeout is
  4884. // 1 day.Only supported on Dataproc image versions 1.2 and higher.
  4885. func (c *ProjectsRegionsClustersPatchCall) GracefulDecommissionTimeout(gracefulDecommissionTimeout string) *ProjectsRegionsClustersPatchCall {
  4886. c.urlParams_.Set("gracefulDecommissionTimeout", gracefulDecommissionTimeout)
  4887. return c
  4888. }
  4889. // RequestId sets the optional parameter "requestId": A unique id used
  4890. // to identify the request. If the server receives two
  4891. // UpdateClusterRequest requests with the same id, then the second
  4892. // request will be ignored and the first google.longrunning.Operation
  4893. // created and stored in the backend is returned.It is recommended to
  4894. // always set this value to a UUID
  4895. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The id
  4896. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  4897. // and hyphens (-). The maximum length is 40 characters.
  4898. func (c *ProjectsRegionsClustersPatchCall) RequestId(requestId string) *ProjectsRegionsClustersPatchCall {
  4899. c.urlParams_.Set("requestId", requestId)
  4900. return c
  4901. }
  4902. // UpdateMask sets the optional parameter "updateMask": Required.
  4903. // Specifies the path, relative to Cluster, of the field to update. For
  4904. // example, to change the number of workers in a cluster to 5, the
  4905. // update_mask parameter would be specified as
  4906. // config.worker_config.num_instances, and the PATCH request body would
  4907. // specify the new value, as follows:
  4908. // {
  4909. // "config":{
  4910. // "workerConfig":{
  4911. // "numInstances":"5"
  4912. // }
  4913. // }
  4914. // }
  4915. // Similarly, to change the number of preemptible workers in a cluster
  4916. // to 5, the update_mask parameter would be
  4917. // config.secondary_worker_config.num_instances, and the PATCH request
  4918. // body would be set as follows:
  4919. // {
  4920. // "config":{
  4921. // "secondaryWorkerConfig":{
  4922. // "numInstances":"5"
  4923. // }
  4924. // }
  4925. // }
  4926. // <strong>Note:</strong> currently only the following fields can be
  4927. // updated:
  4928. // <table>
  4929. // <tr>
  4930. // <td><strong>Mask</strong></td><td><strong>Purpos
  4931. // e</strong></td>
  4932. // </tr>
  4933. // <tr>
  4934. // <td>labels</td><td>Updates
  4935. // labels</td>
  4936. // </tr>
  4937. // <tr>
  4938. // <td>config.worker_config.num_instances</td><td>
  4939. // Resize primary worker
  4940. // group</td>
  4941. // </tr>
  4942. // <tr>
  4943. // <td>config.secondary_worker_config.num_instances
  4944. // </td><td>Resize secondary worker
  4945. // group</td>
  4946. // </tr>
  4947. // <tr>
  4948. // <td>config.lifecycle_config.auto_delete_ttl</td>
  4949. // <td>Reset MAX TTL
  4950. // duration</td>
  4951. // </tr>
  4952. // <tr>
  4953. // <td>config.lifecycle_config.auto_delete_time<
  4954. // /td><td>Update MAX TTL deletion
  4955. // timestamp</td>
  4956. // </tr>
  4957. // <tr>
  4958. // <td>config.lifecycle_config.idle_delete_ttl<
  4959. // /td><td>Update Idle TTL duration</td>
  4960. // </tr>
  4961. // </table>
  4962. func (c *ProjectsRegionsClustersPatchCall) UpdateMask(updateMask string) *ProjectsRegionsClustersPatchCall {
  4963. c.urlParams_.Set("updateMask", updateMask)
  4964. return c
  4965. }
  4966. // Fields allows partial responses to be retrieved. See
  4967. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4968. // for more information.
  4969. func (c *ProjectsRegionsClustersPatchCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersPatchCall {
  4970. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4971. return c
  4972. }
  4973. // Context sets the context to be used in this call's Do method. Any
  4974. // pending HTTP request will be aborted if the provided context is
  4975. // canceled.
  4976. func (c *ProjectsRegionsClustersPatchCall) Context(ctx context.Context) *ProjectsRegionsClustersPatchCall {
  4977. c.ctx_ = ctx
  4978. return c
  4979. }
  4980. // Header returns an http.Header that can be modified by the caller to
  4981. // add HTTP headers to the request.
  4982. func (c *ProjectsRegionsClustersPatchCall) Header() http.Header {
  4983. if c.header_ == nil {
  4984. c.header_ = make(http.Header)
  4985. }
  4986. return c.header_
  4987. }
  4988. func (c *ProjectsRegionsClustersPatchCall) doRequest(alt string) (*http.Response, error) {
  4989. reqHeaders := make(http.Header)
  4990. for k, v := range c.header_ {
  4991. reqHeaders[k] = v
  4992. }
  4993. reqHeaders.Set("User-Agent", c.s.userAgent())
  4994. var body io.Reader = nil
  4995. body, err := googleapi.WithoutDataWrapper.JSONReader(c.cluster)
  4996. if err != nil {
  4997. return nil, err
  4998. }
  4999. reqHeaders.Set("Content-Type", "application/json")
  5000. c.urlParams_.Set("alt", alt)
  5001. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}")
  5002. urls += "?" + c.urlParams_.Encode()
  5003. req, _ := http.NewRequest("PATCH", urls, body)
  5004. req.Header = reqHeaders
  5005. googleapi.Expand(req.URL, map[string]string{
  5006. "projectId": c.projectId,
  5007. "region": c.region,
  5008. "clusterName": c.clusterName,
  5009. })
  5010. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5011. }
  5012. // Do executes the "dataproc.projects.regions.clusters.patch" call.
  5013. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  5014. // status code is an error. Response headers are in either
  5015. // *Operation.ServerResponse.Header or (if a response was returned at
  5016. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  5017. // to check whether the returned error was because
  5018. // http.StatusNotModified was returned.
  5019. func (c *ProjectsRegionsClustersPatchCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  5020. gensupport.SetOptions(c.urlParams_, opts...)
  5021. res, err := c.doRequest("json")
  5022. if res != nil && res.StatusCode == http.StatusNotModified {
  5023. if res.Body != nil {
  5024. res.Body.Close()
  5025. }
  5026. return nil, &googleapi.Error{
  5027. Code: res.StatusCode,
  5028. Header: res.Header,
  5029. }
  5030. }
  5031. if err != nil {
  5032. return nil, err
  5033. }
  5034. defer googleapi.CloseBody(res)
  5035. if err := googleapi.CheckResponse(res); err != nil {
  5036. return nil, err
  5037. }
  5038. ret := &Operation{
  5039. ServerResponse: googleapi.ServerResponse{
  5040. Header: res.Header,
  5041. HTTPStatusCode: res.StatusCode,
  5042. },
  5043. }
  5044. target := &ret
  5045. if err := gensupport.DecodeResponse(target, res); err != nil {
  5046. return nil, err
  5047. }
  5048. return ret, nil
  5049. // {
  5050. // "description": "Updates a cluster in a project.",
  5051. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  5052. // "httpMethod": "PATCH",
  5053. // "id": "dataproc.projects.regions.clusters.patch",
  5054. // "parameterOrder": [
  5055. // "projectId",
  5056. // "region",
  5057. // "clusterName"
  5058. // ],
  5059. // "parameters": {
  5060. // "clusterName": {
  5061. // "description": "Required. The cluster name.",
  5062. // "location": "path",
  5063. // "required": true,
  5064. // "type": "string"
  5065. // },
  5066. // "gracefulDecommissionTimeout": {
  5067. // "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.",
  5068. // "format": "google-duration",
  5069. // "location": "query",
  5070. // "type": "string"
  5071. // },
  5072. // "projectId": {
  5073. // "description": "Required. The ID of the Google Cloud Platform project the cluster belongs to.",
  5074. // "location": "path",
  5075. // "required": true,
  5076. // "type": "string"
  5077. // },
  5078. // "region": {
  5079. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  5080. // "location": "path",
  5081. // "required": true,
  5082. // "type": "string"
  5083. // },
  5084. // "requestId": {
  5085. // "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.",
  5086. // "location": "query",
  5087. // "type": "string"
  5088. // },
  5089. // "updateMask": {
  5090. // "description": "Required. Specifies the path, relative to Cluster, of the field to update. For example, to change the number of workers in a cluster to 5, the update_mask parameter would be specified as config.worker_config.num_instances, and the PATCH request body would specify the new value, as follows:\n{\n \"config\":{\n \"workerConfig\":{\n \"numInstances\":\"5\"\n }\n }\n}\nSimilarly, to change the number of preemptible workers in a cluster to 5, the update_mask parameter would be config.secondary_worker_config.num_instances, and the PATCH request body would be set as follows:\n{\n \"config\":{\n \"secondaryWorkerConfig\":{\n \"numInstances\":\"5\"\n }\n }\n}\n\u003cstrong\u003eNote:\u003c/strong\u003e currently only the following fields can be updated:\n\u003ctable\u003e\n\u003ctr\u003e\n\u003ctd\u003e\u003cstrong\u003eMask\u003c/strong\u003e\u003c/td\u003e\u003ctd\u003e\u003cstrong\u003ePurpose\u003c/strong\u003e\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003elabels\u003c/td\u003e\u003ctd\u003eUpdates labels\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003econfig.worker_config.num_instances\u003c/td\u003e\u003ctd\u003eResize primary worker group\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003econfig.secondary_worker_config.num_instances\u003c/td\u003e\u003ctd\u003eResize secondary worker group\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003econfig.lifecycle_config.auto_delete_ttl\u003c/td\u003e\u003ctd\u003eReset MAX TTL duration\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003econfig.lifecycle_config.auto_delete_time\u003c/td\u003e\u003ctd\u003eUpdate MAX TTL deletion timestamp\u003c/td\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003econfig.lifecycle_config.idle_delete_ttl\u003c/td\u003e\u003ctd\u003eUpdate Idle TTL duration\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e",
  5091. // "format": "google-fieldmask",
  5092. // "location": "query",
  5093. // "type": "string"
  5094. // }
  5095. // },
  5096. // "path": "v1beta2/projects/{projectId}/regions/{region}/clusters/{clusterName}",
  5097. // "request": {
  5098. // "$ref": "Cluster"
  5099. // },
  5100. // "response": {
  5101. // "$ref": "Operation"
  5102. // },
  5103. // "scopes": [
  5104. // "https://www.googleapis.com/auth/cloud-platform"
  5105. // ]
  5106. // }
  5107. }
  5108. // method id "dataproc.projects.regions.clusters.setIamPolicy":
  5109. type ProjectsRegionsClustersSetIamPolicyCall struct {
  5110. s *Service
  5111. resource string
  5112. setiampolicyrequest *SetIamPolicyRequest
  5113. urlParams_ gensupport.URLParams
  5114. ctx_ context.Context
  5115. header_ http.Header
  5116. }
  5117. // SetIamPolicy: Sets the access control policy on the specified
  5118. // resource. Replaces any existing policy.
  5119. func (r *ProjectsRegionsClustersService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsClustersSetIamPolicyCall {
  5120. c := &ProjectsRegionsClustersSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5121. c.resource = resource
  5122. c.setiampolicyrequest = setiampolicyrequest
  5123. return c
  5124. }
  5125. // Fields allows partial responses to be retrieved. See
  5126. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5127. // for more information.
  5128. func (c *ProjectsRegionsClustersSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersSetIamPolicyCall {
  5129. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5130. return c
  5131. }
  5132. // Context sets the context to be used in this call's Do method. Any
  5133. // pending HTTP request will be aborted if the provided context is
  5134. // canceled.
  5135. func (c *ProjectsRegionsClustersSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsClustersSetIamPolicyCall {
  5136. c.ctx_ = ctx
  5137. return c
  5138. }
  5139. // Header returns an http.Header that can be modified by the caller to
  5140. // add HTTP headers to the request.
  5141. func (c *ProjectsRegionsClustersSetIamPolicyCall) Header() http.Header {
  5142. if c.header_ == nil {
  5143. c.header_ = make(http.Header)
  5144. }
  5145. return c.header_
  5146. }
  5147. func (c *ProjectsRegionsClustersSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  5148. reqHeaders := make(http.Header)
  5149. for k, v := range c.header_ {
  5150. reqHeaders[k] = v
  5151. }
  5152. reqHeaders.Set("User-Agent", c.s.userAgent())
  5153. var body io.Reader = nil
  5154. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  5155. if err != nil {
  5156. return nil, err
  5157. }
  5158. reqHeaders.Set("Content-Type", "application/json")
  5159. c.urlParams_.Set("alt", alt)
  5160. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy")
  5161. urls += "?" + c.urlParams_.Encode()
  5162. req, _ := http.NewRequest("POST", urls, body)
  5163. req.Header = reqHeaders
  5164. googleapi.Expand(req.URL, map[string]string{
  5165. "resource": c.resource,
  5166. })
  5167. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5168. }
  5169. // Do executes the "dataproc.projects.regions.clusters.setIamPolicy" call.
  5170. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  5171. // code is an error. Response headers are in either
  5172. // *Policy.ServerResponse.Header or (if a response was returned at all)
  5173. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5174. // check whether the returned error was because http.StatusNotModified
  5175. // was returned.
  5176. func (c *ProjectsRegionsClustersSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  5177. gensupport.SetOptions(c.urlParams_, opts...)
  5178. res, err := c.doRequest("json")
  5179. if res != nil && res.StatusCode == http.StatusNotModified {
  5180. if res.Body != nil {
  5181. res.Body.Close()
  5182. }
  5183. return nil, &googleapi.Error{
  5184. Code: res.StatusCode,
  5185. Header: res.Header,
  5186. }
  5187. }
  5188. if err != nil {
  5189. return nil, err
  5190. }
  5191. defer googleapi.CloseBody(res)
  5192. if err := googleapi.CheckResponse(res); err != nil {
  5193. return nil, err
  5194. }
  5195. ret := &Policy{
  5196. ServerResponse: googleapi.ServerResponse{
  5197. Header: res.Header,
  5198. HTTPStatusCode: res.StatusCode,
  5199. },
  5200. }
  5201. target := &ret
  5202. if err := gensupport.DecodeResponse(target, res); err != nil {
  5203. return nil, err
  5204. }
  5205. return ret, nil
  5206. // {
  5207. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  5208. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:setIamPolicy",
  5209. // "httpMethod": "POST",
  5210. // "id": "dataproc.projects.regions.clusters.setIamPolicy",
  5211. // "parameterOrder": [
  5212. // "resource"
  5213. // ],
  5214. // "parameters": {
  5215. // "resource": {
  5216. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  5217. // "location": "path",
  5218. // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$",
  5219. // "required": true,
  5220. // "type": "string"
  5221. // }
  5222. // },
  5223. // "path": "v1beta2/{+resource}:setIamPolicy",
  5224. // "request": {
  5225. // "$ref": "SetIamPolicyRequest"
  5226. // },
  5227. // "response": {
  5228. // "$ref": "Policy"
  5229. // },
  5230. // "scopes": [
  5231. // "https://www.googleapis.com/auth/cloud-platform"
  5232. // ]
  5233. // }
  5234. }
  5235. // method id "dataproc.projects.regions.clusters.testIamPermissions":
  5236. type ProjectsRegionsClustersTestIamPermissionsCall struct {
  5237. s *Service
  5238. resource string
  5239. testiampermissionsrequest *TestIamPermissionsRequest
  5240. urlParams_ gensupport.URLParams
  5241. ctx_ context.Context
  5242. header_ http.Header
  5243. }
  5244. // TestIamPermissions: Returns permissions that a caller has on the
  5245. // specified resource. If the resource does not exist, this will return
  5246. // an empty set of permissions, not a NOT_FOUND error.Note: This
  5247. // operation is designed to be used for building permission-aware UIs
  5248. // and command-line tools, not for authorization checking. This
  5249. // operation may "fail open" without warning.
  5250. func (r *ProjectsRegionsClustersService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsClustersTestIamPermissionsCall {
  5251. c := &ProjectsRegionsClustersTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5252. c.resource = resource
  5253. c.testiampermissionsrequest = testiampermissionsrequest
  5254. return c
  5255. }
  5256. // Fields allows partial responses to be retrieved. See
  5257. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5258. // for more information.
  5259. func (c *ProjectsRegionsClustersTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsClustersTestIamPermissionsCall {
  5260. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5261. return c
  5262. }
  5263. // Context sets the context to be used in this call's Do method. Any
  5264. // pending HTTP request will be aborted if the provided context is
  5265. // canceled.
  5266. func (c *ProjectsRegionsClustersTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsClustersTestIamPermissionsCall {
  5267. c.ctx_ = ctx
  5268. return c
  5269. }
  5270. // Header returns an http.Header that can be modified by the caller to
  5271. // add HTTP headers to the request.
  5272. func (c *ProjectsRegionsClustersTestIamPermissionsCall) Header() http.Header {
  5273. if c.header_ == nil {
  5274. c.header_ = make(http.Header)
  5275. }
  5276. return c.header_
  5277. }
  5278. func (c *ProjectsRegionsClustersTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  5279. reqHeaders := make(http.Header)
  5280. for k, v := range c.header_ {
  5281. reqHeaders[k] = v
  5282. }
  5283. reqHeaders.Set("User-Agent", c.s.userAgent())
  5284. var body io.Reader = nil
  5285. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  5286. if err != nil {
  5287. return nil, err
  5288. }
  5289. reqHeaders.Set("Content-Type", "application/json")
  5290. c.urlParams_.Set("alt", alt)
  5291. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
  5292. urls += "?" + c.urlParams_.Encode()
  5293. req, _ := http.NewRequest("POST", urls, body)
  5294. req.Header = reqHeaders
  5295. googleapi.Expand(req.URL, map[string]string{
  5296. "resource": c.resource,
  5297. })
  5298. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5299. }
  5300. // Do executes the "dataproc.projects.regions.clusters.testIamPermissions" call.
  5301. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  5302. // Any non-2xx status code is an error. Response headers are in either
  5303. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  5304. // was returned at all) in error.(*googleapi.Error).Header. Use
  5305. // googleapi.IsNotModified to check whether the returned error was
  5306. // because http.StatusNotModified was returned.
  5307. func (c *ProjectsRegionsClustersTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  5308. gensupport.SetOptions(c.urlParams_, opts...)
  5309. res, err := c.doRequest("json")
  5310. if res != nil && res.StatusCode == http.StatusNotModified {
  5311. if res.Body != nil {
  5312. res.Body.Close()
  5313. }
  5314. return nil, &googleapi.Error{
  5315. Code: res.StatusCode,
  5316. Header: res.Header,
  5317. }
  5318. }
  5319. if err != nil {
  5320. return nil, err
  5321. }
  5322. defer googleapi.CloseBody(res)
  5323. if err := googleapi.CheckResponse(res); err != nil {
  5324. return nil, err
  5325. }
  5326. ret := &TestIamPermissionsResponse{
  5327. ServerResponse: googleapi.ServerResponse{
  5328. Header: res.Header,
  5329. HTTPStatusCode: res.StatusCode,
  5330. },
  5331. }
  5332. target := &ret
  5333. if err := gensupport.DecodeResponse(target, res); err != nil {
  5334. return nil, err
  5335. }
  5336. return ret, nil
  5337. // {
  5338. // "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.",
  5339. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/clusters/{clustersId}:testIamPermissions",
  5340. // "httpMethod": "POST",
  5341. // "id": "dataproc.projects.regions.clusters.testIamPermissions",
  5342. // "parameterOrder": [
  5343. // "resource"
  5344. // ],
  5345. // "parameters": {
  5346. // "resource": {
  5347. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  5348. // "location": "path",
  5349. // "pattern": "^projects/[^/]+/regions/[^/]+/clusters/[^/]+$",
  5350. // "required": true,
  5351. // "type": "string"
  5352. // }
  5353. // },
  5354. // "path": "v1beta2/{+resource}:testIamPermissions",
  5355. // "request": {
  5356. // "$ref": "TestIamPermissionsRequest"
  5357. // },
  5358. // "response": {
  5359. // "$ref": "TestIamPermissionsResponse"
  5360. // },
  5361. // "scopes": [
  5362. // "https://www.googleapis.com/auth/cloud-platform"
  5363. // ]
  5364. // }
  5365. }
  5366. // method id "dataproc.projects.regions.jobs.cancel":
  5367. type ProjectsRegionsJobsCancelCall struct {
  5368. s *Service
  5369. projectId string
  5370. region string
  5371. jobId string
  5372. canceljobrequest *CancelJobRequest
  5373. urlParams_ gensupport.URLParams
  5374. ctx_ context.Context
  5375. header_ http.Header
  5376. }
  5377. // Cancel: Starts a job cancellation request. To access the job resource
  5378. // after cancellation, call regions/{region}/jobs.list or
  5379. // regions/{region}/jobs.get.
  5380. func (r *ProjectsRegionsJobsService) Cancel(projectId string, region string, jobId string, canceljobrequest *CancelJobRequest) *ProjectsRegionsJobsCancelCall {
  5381. c := &ProjectsRegionsJobsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5382. c.projectId = projectId
  5383. c.region = region
  5384. c.jobId = jobId
  5385. c.canceljobrequest = canceljobrequest
  5386. return c
  5387. }
  5388. // Fields allows partial responses to be retrieved. See
  5389. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5390. // for more information.
  5391. func (c *ProjectsRegionsJobsCancelCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsCancelCall {
  5392. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5393. return c
  5394. }
  5395. // Context sets the context to be used in this call's Do method. Any
  5396. // pending HTTP request will be aborted if the provided context is
  5397. // canceled.
  5398. func (c *ProjectsRegionsJobsCancelCall) Context(ctx context.Context) *ProjectsRegionsJobsCancelCall {
  5399. c.ctx_ = ctx
  5400. return c
  5401. }
  5402. // Header returns an http.Header that can be modified by the caller to
  5403. // add HTTP headers to the request.
  5404. func (c *ProjectsRegionsJobsCancelCall) Header() http.Header {
  5405. if c.header_ == nil {
  5406. c.header_ = make(http.Header)
  5407. }
  5408. return c.header_
  5409. }
  5410. func (c *ProjectsRegionsJobsCancelCall) doRequest(alt string) (*http.Response, error) {
  5411. reqHeaders := make(http.Header)
  5412. for k, v := range c.header_ {
  5413. reqHeaders[k] = v
  5414. }
  5415. reqHeaders.Set("User-Agent", c.s.userAgent())
  5416. var body io.Reader = nil
  5417. body, err := googleapi.WithoutDataWrapper.JSONReader(c.canceljobrequest)
  5418. if err != nil {
  5419. return nil, err
  5420. }
  5421. reqHeaders.Set("Content-Type", "application/json")
  5422. c.urlParams_.Set("alt", alt)
  5423. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel")
  5424. urls += "?" + c.urlParams_.Encode()
  5425. req, _ := http.NewRequest("POST", urls, body)
  5426. req.Header = reqHeaders
  5427. googleapi.Expand(req.URL, map[string]string{
  5428. "projectId": c.projectId,
  5429. "region": c.region,
  5430. "jobId": c.jobId,
  5431. })
  5432. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5433. }
  5434. // Do executes the "dataproc.projects.regions.jobs.cancel" call.
  5435. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  5436. // is an error. Response headers are in either
  5437. // *Job.ServerResponse.Header or (if a response was returned at all) in
  5438. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5439. // whether the returned error was because http.StatusNotModified was
  5440. // returned.
  5441. func (c *ProjectsRegionsJobsCancelCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  5442. gensupport.SetOptions(c.urlParams_, opts...)
  5443. res, err := c.doRequest("json")
  5444. if res != nil && res.StatusCode == http.StatusNotModified {
  5445. if res.Body != nil {
  5446. res.Body.Close()
  5447. }
  5448. return nil, &googleapi.Error{
  5449. Code: res.StatusCode,
  5450. Header: res.Header,
  5451. }
  5452. }
  5453. if err != nil {
  5454. return nil, err
  5455. }
  5456. defer googleapi.CloseBody(res)
  5457. if err := googleapi.CheckResponse(res); err != nil {
  5458. return nil, err
  5459. }
  5460. ret := &Job{
  5461. ServerResponse: googleapi.ServerResponse{
  5462. Header: res.Header,
  5463. HTTPStatusCode: res.StatusCode,
  5464. },
  5465. }
  5466. target := &ret
  5467. if err := gensupport.DecodeResponse(target, res); err != nil {
  5468. return nil, err
  5469. }
  5470. return ret, nil
  5471. // {
  5472. // "description": "Starts a job cancellation request. To access the job resource after cancellation, call regions/{region}/jobs.list or regions/{region}/jobs.get.",
  5473. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel",
  5474. // "httpMethod": "POST",
  5475. // "id": "dataproc.projects.regions.jobs.cancel",
  5476. // "parameterOrder": [
  5477. // "projectId",
  5478. // "region",
  5479. // "jobId"
  5480. // ],
  5481. // "parameters": {
  5482. // "jobId": {
  5483. // "description": "Required. The job ID.",
  5484. // "location": "path",
  5485. // "required": true,
  5486. // "type": "string"
  5487. // },
  5488. // "projectId": {
  5489. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  5490. // "location": "path",
  5491. // "required": true,
  5492. // "type": "string"
  5493. // },
  5494. // "region": {
  5495. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  5496. // "location": "path",
  5497. // "required": true,
  5498. // "type": "string"
  5499. // }
  5500. // },
  5501. // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}:cancel",
  5502. // "request": {
  5503. // "$ref": "CancelJobRequest"
  5504. // },
  5505. // "response": {
  5506. // "$ref": "Job"
  5507. // },
  5508. // "scopes": [
  5509. // "https://www.googleapis.com/auth/cloud-platform"
  5510. // ]
  5511. // }
  5512. }
  5513. // method id "dataproc.projects.regions.jobs.delete":
  5514. type ProjectsRegionsJobsDeleteCall struct {
  5515. s *Service
  5516. projectId string
  5517. region string
  5518. jobId string
  5519. urlParams_ gensupport.URLParams
  5520. ctx_ context.Context
  5521. header_ http.Header
  5522. }
  5523. // Delete: Deletes the job from the project. If the job is active, the
  5524. // delete fails, and the response returns FAILED_PRECONDITION.
  5525. func (r *ProjectsRegionsJobsService) Delete(projectId string, region string, jobId string) *ProjectsRegionsJobsDeleteCall {
  5526. c := &ProjectsRegionsJobsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5527. c.projectId = projectId
  5528. c.region = region
  5529. c.jobId = jobId
  5530. return c
  5531. }
  5532. // Fields allows partial responses to be retrieved. See
  5533. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5534. // for more information.
  5535. func (c *ProjectsRegionsJobsDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsDeleteCall {
  5536. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5537. return c
  5538. }
  5539. // Context sets the context to be used in this call's Do method. Any
  5540. // pending HTTP request will be aborted if the provided context is
  5541. // canceled.
  5542. func (c *ProjectsRegionsJobsDeleteCall) Context(ctx context.Context) *ProjectsRegionsJobsDeleteCall {
  5543. c.ctx_ = ctx
  5544. return c
  5545. }
  5546. // Header returns an http.Header that can be modified by the caller to
  5547. // add HTTP headers to the request.
  5548. func (c *ProjectsRegionsJobsDeleteCall) Header() http.Header {
  5549. if c.header_ == nil {
  5550. c.header_ = make(http.Header)
  5551. }
  5552. return c.header_
  5553. }
  5554. func (c *ProjectsRegionsJobsDeleteCall) doRequest(alt string) (*http.Response, error) {
  5555. reqHeaders := make(http.Header)
  5556. for k, v := range c.header_ {
  5557. reqHeaders[k] = v
  5558. }
  5559. reqHeaders.Set("User-Agent", c.s.userAgent())
  5560. var body io.Reader = nil
  5561. c.urlParams_.Set("alt", alt)
  5562. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}")
  5563. urls += "?" + c.urlParams_.Encode()
  5564. req, _ := http.NewRequest("DELETE", urls, body)
  5565. req.Header = reqHeaders
  5566. googleapi.Expand(req.URL, map[string]string{
  5567. "projectId": c.projectId,
  5568. "region": c.region,
  5569. "jobId": c.jobId,
  5570. })
  5571. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5572. }
  5573. // Do executes the "dataproc.projects.regions.jobs.delete" call.
  5574. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  5575. // code is an error. Response headers are in either
  5576. // *Empty.ServerResponse.Header or (if a response was returned at all)
  5577. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5578. // check whether the returned error was because http.StatusNotModified
  5579. // was returned.
  5580. func (c *ProjectsRegionsJobsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  5581. gensupport.SetOptions(c.urlParams_, opts...)
  5582. res, err := c.doRequest("json")
  5583. if res != nil && res.StatusCode == http.StatusNotModified {
  5584. if res.Body != nil {
  5585. res.Body.Close()
  5586. }
  5587. return nil, &googleapi.Error{
  5588. Code: res.StatusCode,
  5589. Header: res.Header,
  5590. }
  5591. }
  5592. if err != nil {
  5593. return nil, err
  5594. }
  5595. defer googleapi.CloseBody(res)
  5596. if err := googleapi.CheckResponse(res); err != nil {
  5597. return nil, err
  5598. }
  5599. ret := &Empty{
  5600. ServerResponse: googleapi.ServerResponse{
  5601. Header: res.Header,
  5602. HTTPStatusCode: res.StatusCode,
  5603. },
  5604. }
  5605. target := &ret
  5606. if err := gensupport.DecodeResponse(target, res); err != nil {
  5607. return nil, err
  5608. }
  5609. return ret, nil
  5610. // {
  5611. // "description": "Deletes the job from the project. If the job is active, the delete fails, and the response returns FAILED_PRECONDITION.",
  5612. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}",
  5613. // "httpMethod": "DELETE",
  5614. // "id": "dataproc.projects.regions.jobs.delete",
  5615. // "parameterOrder": [
  5616. // "projectId",
  5617. // "region",
  5618. // "jobId"
  5619. // ],
  5620. // "parameters": {
  5621. // "jobId": {
  5622. // "description": "Required. The job ID.",
  5623. // "location": "path",
  5624. // "required": true,
  5625. // "type": "string"
  5626. // },
  5627. // "projectId": {
  5628. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  5629. // "location": "path",
  5630. // "required": true,
  5631. // "type": "string"
  5632. // },
  5633. // "region": {
  5634. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  5635. // "location": "path",
  5636. // "required": true,
  5637. // "type": "string"
  5638. // }
  5639. // },
  5640. // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}",
  5641. // "response": {
  5642. // "$ref": "Empty"
  5643. // },
  5644. // "scopes": [
  5645. // "https://www.googleapis.com/auth/cloud-platform"
  5646. // ]
  5647. // }
  5648. }
  5649. // method id "dataproc.projects.regions.jobs.get":
  5650. type ProjectsRegionsJobsGetCall struct {
  5651. s *Service
  5652. projectId string
  5653. region string
  5654. jobId string
  5655. urlParams_ gensupport.URLParams
  5656. ifNoneMatch_ string
  5657. ctx_ context.Context
  5658. header_ http.Header
  5659. }
  5660. // Get: Gets the resource representation for a job in a project.
  5661. func (r *ProjectsRegionsJobsService) Get(projectId string, region string, jobId string) *ProjectsRegionsJobsGetCall {
  5662. c := &ProjectsRegionsJobsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5663. c.projectId = projectId
  5664. c.region = region
  5665. c.jobId = jobId
  5666. return c
  5667. }
  5668. // Fields allows partial responses to be retrieved. See
  5669. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5670. // for more information.
  5671. func (c *ProjectsRegionsJobsGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsGetCall {
  5672. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5673. return c
  5674. }
  5675. // IfNoneMatch sets the optional parameter which makes the operation
  5676. // fail if the object's ETag matches the given value. This is useful for
  5677. // getting updates only after the object has changed since the last
  5678. // request. Use googleapi.IsNotModified to check whether the response
  5679. // error from Do is the result of In-None-Match.
  5680. func (c *ProjectsRegionsJobsGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsGetCall {
  5681. c.ifNoneMatch_ = entityTag
  5682. return c
  5683. }
  5684. // Context sets the context to be used in this call's Do method. Any
  5685. // pending HTTP request will be aborted if the provided context is
  5686. // canceled.
  5687. func (c *ProjectsRegionsJobsGetCall) Context(ctx context.Context) *ProjectsRegionsJobsGetCall {
  5688. c.ctx_ = ctx
  5689. return c
  5690. }
  5691. // Header returns an http.Header that can be modified by the caller to
  5692. // add HTTP headers to the request.
  5693. func (c *ProjectsRegionsJobsGetCall) Header() http.Header {
  5694. if c.header_ == nil {
  5695. c.header_ = make(http.Header)
  5696. }
  5697. return c.header_
  5698. }
  5699. func (c *ProjectsRegionsJobsGetCall) doRequest(alt string) (*http.Response, error) {
  5700. reqHeaders := make(http.Header)
  5701. for k, v := range c.header_ {
  5702. reqHeaders[k] = v
  5703. }
  5704. reqHeaders.Set("User-Agent", c.s.userAgent())
  5705. if c.ifNoneMatch_ != "" {
  5706. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5707. }
  5708. var body io.Reader = nil
  5709. c.urlParams_.Set("alt", alt)
  5710. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}")
  5711. urls += "?" + c.urlParams_.Encode()
  5712. req, _ := http.NewRequest("GET", urls, body)
  5713. req.Header = reqHeaders
  5714. googleapi.Expand(req.URL, map[string]string{
  5715. "projectId": c.projectId,
  5716. "region": c.region,
  5717. "jobId": c.jobId,
  5718. })
  5719. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5720. }
  5721. // Do executes the "dataproc.projects.regions.jobs.get" call.
  5722. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  5723. // is an error. Response headers are in either
  5724. // *Job.ServerResponse.Header or (if a response was returned at all) in
  5725. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5726. // whether the returned error was because http.StatusNotModified was
  5727. // returned.
  5728. func (c *ProjectsRegionsJobsGetCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  5729. gensupport.SetOptions(c.urlParams_, opts...)
  5730. res, err := c.doRequest("json")
  5731. if res != nil && res.StatusCode == http.StatusNotModified {
  5732. if res.Body != nil {
  5733. res.Body.Close()
  5734. }
  5735. return nil, &googleapi.Error{
  5736. Code: res.StatusCode,
  5737. Header: res.Header,
  5738. }
  5739. }
  5740. if err != nil {
  5741. return nil, err
  5742. }
  5743. defer googleapi.CloseBody(res)
  5744. if err := googleapi.CheckResponse(res); err != nil {
  5745. return nil, err
  5746. }
  5747. ret := &Job{
  5748. ServerResponse: googleapi.ServerResponse{
  5749. Header: res.Header,
  5750. HTTPStatusCode: res.StatusCode,
  5751. },
  5752. }
  5753. target := &ret
  5754. if err := gensupport.DecodeResponse(target, res); err != nil {
  5755. return nil, err
  5756. }
  5757. return ret, nil
  5758. // {
  5759. // "description": "Gets the resource representation for a job in a project.",
  5760. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}",
  5761. // "httpMethod": "GET",
  5762. // "id": "dataproc.projects.regions.jobs.get",
  5763. // "parameterOrder": [
  5764. // "projectId",
  5765. // "region",
  5766. // "jobId"
  5767. // ],
  5768. // "parameters": {
  5769. // "jobId": {
  5770. // "description": "Required. The job ID.",
  5771. // "location": "path",
  5772. // "required": true,
  5773. // "type": "string"
  5774. // },
  5775. // "projectId": {
  5776. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  5777. // "location": "path",
  5778. // "required": true,
  5779. // "type": "string"
  5780. // },
  5781. // "region": {
  5782. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  5783. // "location": "path",
  5784. // "required": true,
  5785. // "type": "string"
  5786. // }
  5787. // },
  5788. // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}",
  5789. // "response": {
  5790. // "$ref": "Job"
  5791. // },
  5792. // "scopes": [
  5793. // "https://www.googleapis.com/auth/cloud-platform"
  5794. // ]
  5795. // }
  5796. }
  5797. // method id "dataproc.projects.regions.jobs.getIamPolicy":
  5798. type ProjectsRegionsJobsGetIamPolicyCall struct {
  5799. s *Service
  5800. resource string
  5801. urlParams_ gensupport.URLParams
  5802. ifNoneMatch_ string
  5803. ctx_ context.Context
  5804. header_ http.Header
  5805. }
  5806. // GetIamPolicy: Gets the access control policy for a resource. Returns
  5807. // an empty policy if the resource exists and does not have a policy
  5808. // set.
  5809. func (r *ProjectsRegionsJobsService) GetIamPolicy(resource string) *ProjectsRegionsJobsGetIamPolicyCall {
  5810. c := &ProjectsRegionsJobsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5811. c.resource = resource
  5812. return c
  5813. }
  5814. // Fields allows partial responses to be retrieved. See
  5815. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5816. // for more information.
  5817. func (c *ProjectsRegionsJobsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsGetIamPolicyCall {
  5818. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5819. return c
  5820. }
  5821. // IfNoneMatch sets the optional parameter which makes the operation
  5822. // fail if the object's ETag matches the given value. This is useful for
  5823. // getting updates only after the object has changed since the last
  5824. // request. Use googleapi.IsNotModified to check whether the response
  5825. // error from Do is the result of In-None-Match.
  5826. func (c *ProjectsRegionsJobsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsGetIamPolicyCall {
  5827. c.ifNoneMatch_ = entityTag
  5828. return c
  5829. }
  5830. // Context sets the context to be used in this call's Do method. Any
  5831. // pending HTTP request will be aborted if the provided context is
  5832. // canceled.
  5833. func (c *ProjectsRegionsJobsGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsJobsGetIamPolicyCall {
  5834. c.ctx_ = ctx
  5835. return c
  5836. }
  5837. // Header returns an http.Header that can be modified by the caller to
  5838. // add HTTP headers to the request.
  5839. func (c *ProjectsRegionsJobsGetIamPolicyCall) Header() http.Header {
  5840. if c.header_ == nil {
  5841. c.header_ = make(http.Header)
  5842. }
  5843. return c.header_
  5844. }
  5845. func (c *ProjectsRegionsJobsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  5846. reqHeaders := make(http.Header)
  5847. for k, v := range c.header_ {
  5848. reqHeaders[k] = v
  5849. }
  5850. reqHeaders.Set("User-Agent", c.s.userAgent())
  5851. if c.ifNoneMatch_ != "" {
  5852. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5853. }
  5854. var body io.Reader = nil
  5855. c.urlParams_.Set("alt", alt)
  5856. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
  5857. urls += "?" + c.urlParams_.Encode()
  5858. req, _ := http.NewRequest("GET", urls, body)
  5859. req.Header = reqHeaders
  5860. googleapi.Expand(req.URL, map[string]string{
  5861. "resource": c.resource,
  5862. })
  5863. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5864. }
  5865. // Do executes the "dataproc.projects.regions.jobs.getIamPolicy" call.
  5866. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  5867. // code is an error. Response headers are in either
  5868. // *Policy.ServerResponse.Header or (if a response was returned at all)
  5869. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5870. // check whether the returned error was because http.StatusNotModified
  5871. // was returned.
  5872. func (c *ProjectsRegionsJobsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  5873. gensupport.SetOptions(c.urlParams_, opts...)
  5874. res, err := c.doRequest("json")
  5875. if res != nil && res.StatusCode == http.StatusNotModified {
  5876. if res.Body != nil {
  5877. res.Body.Close()
  5878. }
  5879. return nil, &googleapi.Error{
  5880. Code: res.StatusCode,
  5881. Header: res.Header,
  5882. }
  5883. }
  5884. if err != nil {
  5885. return nil, err
  5886. }
  5887. defer googleapi.CloseBody(res)
  5888. if err := googleapi.CheckResponse(res); err != nil {
  5889. return nil, err
  5890. }
  5891. ret := &Policy{
  5892. ServerResponse: googleapi.ServerResponse{
  5893. Header: res.Header,
  5894. HTTPStatusCode: res.StatusCode,
  5895. },
  5896. }
  5897. target := &ret
  5898. if err := gensupport.DecodeResponse(target, res); err != nil {
  5899. return nil, err
  5900. }
  5901. return ret, nil
  5902. // {
  5903. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  5904. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:getIamPolicy",
  5905. // "httpMethod": "GET",
  5906. // "id": "dataproc.projects.regions.jobs.getIamPolicy",
  5907. // "parameterOrder": [
  5908. // "resource"
  5909. // ],
  5910. // "parameters": {
  5911. // "resource": {
  5912. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  5913. // "location": "path",
  5914. // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$",
  5915. // "required": true,
  5916. // "type": "string"
  5917. // }
  5918. // },
  5919. // "path": "v1beta2/{+resource}:getIamPolicy",
  5920. // "response": {
  5921. // "$ref": "Policy"
  5922. // },
  5923. // "scopes": [
  5924. // "https://www.googleapis.com/auth/cloud-platform"
  5925. // ]
  5926. // }
  5927. }
  5928. // method id "dataproc.projects.regions.jobs.list":
  5929. type ProjectsRegionsJobsListCall struct {
  5930. s *Service
  5931. projectId string
  5932. region string
  5933. urlParams_ gensupport.URLParams
  5934. ifNoneMatch_ string
  5935. ctx_ context.Context
  5936. header_ http.Header
  5937. }
  5938. // List: Lists regions/{region}/jobs in a project.
  5939. func (r *ProjectsRegionsJobsService) List(projectId string, region string) *ProjectsRegionsJobsListCall {
  5940. c := &ProjectsRegionsJobsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5941. c.projectId = projectId
  5942. c.region = region
  5943. return c
  5944. }
  5945. // ClusterName sets the optional parameter "clusterName": If set, the
  5946. // returned jobs list includes only jobs that were submitted to the
  5947. // named cluster.
  5948. func (c *ProjectsRegionsJobsListCall) ClusterName(clusterName string) *ProjectsRegionsJobsListCall {
  5949. c.urlParams_.Set("clusterName", clusterName)
  5950. return c
  5951. }
  5952. // Filter sets the optional parameter "filter": A filter constraining
  5953. // the jobs to list. Filters are case-sensitive and have the following
  5954. // syntax:field = value AND field = value ...where field is status.state
  5955. // or labels.[KEY], and [KEY] is a label key. value can be * to match
  5956. // all values. status.state can be either ACTIVE or NON_ACTIVE. Only the
  5957. // logical AND operator is supported; space-separated items are treated
  5958. // as having an implicit AND operator.Example filter:status.state =
  5959. // ACTIVE AND labels.env = staging AND labels.starred = *
  5960. func (c *ProjectsRegionsJobsListCall) Filter(filter string) *ProjectsRegionsJobsListCall {
  5961. c.urlParams_.Set("filter", filter)
  5962. return c
  5963. }
  5964. // JobStateMatcher sets the optional parameter "jobStateMatcher":
  5965. // Specifies enumerated categories of jobs to list. (default = match ALL
  5966. // jobs).If filter is provided, jobStateMatcher will be ignored.
  5967. //
  5968. // Possible values:
  5969. // "ALL"
  5970. // "ACTIVE"
  5971. // "NON_ACTIVE"
  5972. func (c *ProjectsRegionsJobsListCall) JobStateMatcher(jobStateMatcher string) *ProjectsRegionsJobsListCall {
  5973. c.urlParams_.Set("jobStateMatcher", jobStateMatcher)
  5974. return c
  5975. }
  5976. // PageSize sets the optional parameter "pageSize": The number of
  5977. // results to return in each response.
  5978. func (c *ProjectsRegionsJobsListCall) PageSize(pageSize int64) *ProjectsRegionsJobsListCall {
  5979. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5980. return c
  5981. }
  5982. // PageToken sets the optional parameter "pageToken": The page token,
  5983. // returned by a previous call, to request the next page of results.
  5984. func (c *ProjectsRegionsJobsListCall) PageToken(pageToken string) *ProjectsRegionsJobsListCall {
  5985. c.urlParams_.Set("pageToken", pageToken)
  5986. return c
  5987. }
  5988. // Fields allows partial responses to be retrieved. See
  5989. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  5990. // for more information.
  5991. func (c *ProjectsRegionsJobsListCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsListCall {
  5992. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5993. return c
  5994. }
  5995. // IfNoneMatch sets the optional parameter which makes the operation
  5996. // fail if the object's ETag matches the given value. This is useful for
  5997. // getting updates only after the object has changed since the last
  5998. // request. Use googleapi.IsNotModified to check whether the response
  5999. // error from Do is the result of In-None-Match.
  6000. func (c *ProjectsRegionsJobsListCall) IfNoneMatch(entityTag string) *ProjectsRegionsJobsListCall {
  6001. c.ifNoneMatch_ = entityTag
  6002. return c
  6003. }
  6004. // Context sets the context to be used in this call's Do method. Any
  6005. // pending HTTP request will be aborted if the provided context is
  6006. // canceled.
  6007. func (c *ProjectsRegionsJobsListCall) Context(ctx context.Context) *ProjectsRegionsJobsListCall {
  6008. c.ctx_ = ctx
  6009. return c
  6010. }
  6011. // Header returns an http.Header that can be modified by the caller to
  6012. // add HTTP headers to the request.
  6013. func (c *ProjectsRegionsJobsListCall) Header() http.Header {
  6014. if c.header_ == nil {
  6015. c.header_ = make(http.Header)
  6016. }
  6017. return c.header_
  6018. }
  6019. func (c *ProjectsRegionsJobsListCall) doRequest(alt string) (*http.Response, error) {
  6020. reqHeaders := make(http.Header)
  6021. for k, v := range c.header_ {
  6022. reqHeaders[k] = v
  6023. }
  6024. reqHeaders.Set("User-Agent", c.s.userAgent())
  6025. if c.ifNoneMatch_ != "" {
  6026. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6027. }
  6028. var body io.Reader = nil
  6029. c.urlParams_.Set("alt", alt)
  6030. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs")
  6031. urls += "?" + c.urlParams_.Encode()
  6032. req, _ := http.NewRequest("GET", urls, body)
  6033. req.Header = reqHeaders
  6034. googleapi.Expand(req.URL, map[string]string{
  6035. "projectId": c.projectId,
  6036. "region": c.region,
  6037. })
  6038. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6039. }
  6040. // Do executes the "dataproc.projects.regions.jobs.list" call.
  6041. // Exactly one of *ListJobsResponse or error will be non-nil. Any
  6042. // non-2xx status code is an error. Response headers are in either
  6043. // *ListJobsResponse.ServerResponse.Header or (if a response was
  6044. // returned at all) in error.(*googleapi.Error).Header. Use
  6045. // googleapi.IsNotModified to check whether the returned error was
  6046. // because http.StatusNotModified was returned.
  6047. func (c *ProjectsRegionsJobsListCall) Do(opts ...googleapi.CallOption) (*ListJobsResponse, error) {
  6048. gensupport.SetOptions(c.urlParams_, opts...)
  6049. res, err := c.doRequest("json")
  6050. if res != nil && res.StatusCode == http.StatusNotModified {
  6051. if res.Body != nil {
  6052. res.Body.Close()
  6053. }
  6054. return nil, &googleapi.Error{
  6055. Code: res.StatusCode,
  6056. Header: res.Header,
  6057. }
  6058. }
  6059. if err != nil {
  6060. return nil, err
  6061. }
  6062. defer googleapi.CloseBody(res)
  6063. if err := googleapi.CheckResponse(res); err != nil {
  6064. return nil, err
  6065. }
  6066. ret := &ListJobsResponse{
  6067. ServerResponse: googleapi.ServerResponse{
  6068. Header: res.Header,
  6069. HTTPStatusCode: res.StatusCode,
  6070. },
  6071. }
  6072. target := &ret
  6073. if err := gensupport.DecodeResponse(target, res); err != nil {
  6074. return nil, err
  6075. }
  6076. return ret, nil
  6077. // {
  6078. // "description": "Lists regions/{region}/jobs in a project.",
  6079. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs",
  6080. // "httpMethod": "GET",
  6081. // "id": "dataproc.projects.regions.jobs.list",
  6082. // "parameterOrder": [
  6083. // "projectId",
  6084. // "region"
  6085. // ],
  6086. // "parameters": {
  6087. // "clusterName": {
  6088. // "description": "Optional. If set, the returned jobs list includes only jobs that were submitted to the named cluster.",
  6089. // "location": "query",
  6090. // "type": "string"
  6091. // },
  6092. // "filter": {
  6093. // "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 = *",
  6094. // "location": "query",
  6095. // "type": "string"
  6096. // },
  6097. // "jobStateMatcher": {
  6098. // "description": "Optional. Specifies enumerated categories of jobs to list. (default = match ALL jobs).If filter is provided, jobStateMatcher will be ignored.",
  6099. // "enum": [
  6100. // "ALL",
  6101. // "ACTIVE",
  6102. // "NON_ACTIVE"
  6103. // ],
  6104. // "location": "query",
  6105. // "type": "string"
  6106. // },
  6107. // "pageSize": {
  6108. // "description": "Optional. The number of results to return in each response.",
  6109. // "format": "int32",
  6110. // "location": "query",
  6111. // "type": "integer"
  6112. // },
  6113. // "pageToken": {
  6114. // "description": "Optional. The page token, returned by a previous call, to request the next page of results.",
  6115. // "location": "query",
  6116. // "type": "string"
  6117. // },
  6118. // "projectId": {
  6119. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  6120. // "location": "path",
  6121. // "required": true,
  6122. // "type": "string"
  6123. // },
  6124. // "region": {
  6125. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  6126. // "location": "path",
  6127. // "required": true,
  6128. // "type": "string"
  6129. // }
  6130. // },
  6131. // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs",
  6132. // "response": {
  6133. // "$ref": "ListJobsResponse"
  6134. // },
  6135. // "scopes": [
  6136. // "https://www.googleapis.com/auth/cloud-platform"
  6137. // ]
  6138. // }
  6139. }
  6140. // Pages invokes f for each page of results.
  6141. // A non-nil error returned from f will halt the iteration.
  6142. // The provided context supersedes any context provided to the Context method.
  6143. func (c *ProjectsRegionsJobsListCall) Pages(ctx context.Context, f func(*ListJobsResponse) error) error {
  6144. c.ctx_ = ctx
  6145. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  6146. for {
  6147. x, err := c.Do()
  6148. if err != nil {
  6149. return err
  6150. }
  6151. if err := f(x); err != nil {
  6152. return err
  6153. }
  6154. if x.NextPageToken == "" {
  6155. return nil
  6156. }
  6157. c.PageToken(x.NextPageToken)
  6158. }
  6159. }
  6160. // method id "dataproc.projects.regions.jobs.patch":
  6161. type ProjectsRegionsJobsPatchCall struct {
  6162. s *Service
  6163. projectId string
  6164. region string
  6165. jobId string
  6166. job *Job
  6167. urlParams_ gensupport.URLParams
  6168. ctx_ context.Context
  6169. header_ http.Header
  6170. }
  6171. // Patch: Updates a job in a project.
  6172. func (r *ProjectsRegionsJobsService) Patch(projectId string, region string, jobId string, job *Job) *ProjectsRegionsJobsPatchCall {
  6173. c := &ProjectsRegionsJobsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6174. c.projectId = projectId
  6175. c.region = region
  6176. c.jobId = jobId
  6177. c.job = job
  6178. return c
  6179. }
  6180. // UpdateMask sets the optional parameter "updateMask": Required.
  6181. // Specifies the path, relative to <code>Job</code>, of the field to
  6182. // update. For example, to update the labels of a Job the
  6183. // <code>update_mask</code> parameter would be specified as
  6184. // <code>labels</code>, and the PATCH request body would specify the new
  6185. // value. <strong>Note:</strong> Currently, <code>labels</code> is the
  6186. // only field that can be updated.
  6187. func (c *ProjectsRegionsJobsPatchCall) UpdateMask(updateMask string) *ProjectsRegionsJobsPatchCall {
  6188. c.urlParams_.Set("updateMask", updateMask)
  6189. return c
  6190. }
  6191. // Fields allows partial responses to be retrieved. See
  6192. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6193. // for more information.
  6194. func (c *ProjectsRegionsJobsPatchCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsPatchCall {
  6195. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6196. return c
  6197. }
  6198. // Context sets the context to be used in this call's Do method. Any
  6199. // pending HTTP request will be aborted if the provided context is
  6200. // canceled.
  6201. func (c *ProjectsRegionsJobsPatchCall) Context(ctx context.Context) *ProjectsRegionsJobsPatchCall {
  6202. c.ctx_ = ctx
  6203. return c
  6204. }
  6205. // Header returns an http.Header that can be modified by the caller to
  6206. // add HTTP headers to the request.
  6207. func (c *ProjectsRegionsJobsPatchCall) Header() http.Header {
  6208. if c.header_ == nil {
  6209. c.header_ = make(http.Header)
  6210. }
  6211. return c.header_
  6212. }
  6213. func (c *ProjectsRegionsJobsPatchCall) doRequest(alt string) (*http.Response, error) {
  6214. reqHeaders := make(http.Header)
  6215. for k, v := range c.header_ {
  6216. reqHeaders[k] = v
  6217. }
  6218. reqHeaders.Set("User-Agent", c.s.userAgent())
  6219. var body io.Reader = nil
  6220. body, err := googleapi.WithoutDataWrapper.JSONReader(c.job)
  6221. if err != nil {
  6222. return nil, err
  6223. }
  6224. reqHeaders.Set("Content-Type", "application/json")
  6225. c.urlParams_.Set("alt", alt)
  6226. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}")
  6227. urls += "?" + c.urlParams_.Encode()
  6228. req, _ := http.NewRequest("PATCH", urls, body)
  6229. req.Header = reqHeaders
  6230. googleapi.Expand(req.URL, map[string]string{
  6231. "projectId": c.projectId,
  6232. "region": c.region,
  6233. "jobId": c.jobId,
  6234. })
  6235. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6236. }
  6237. // Do executes the "dataproc.projects.regions.jobs.patch" call.
  6238. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  6239. // is an error. Response headers are in either
  6240. // *Job.ServerResponse.Header or (if a response was returned at all) in
  6241. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6242. // whether the returned error was because http.StatusNotModified was
  6243. // returned.
  6244. func (c *ProjectsRegionsJobsPatchCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  6245. gensupport.SetOptions(c.urlParams_, opts...)
  6246. res, err := c.doRequest("json")
  6247. if res != nil && res.StatusCode == http.StatusNotModified {
  6248. if res.Body != nil {
  6249. res.Body.Close()
  6250. }
  6251. return nil, &googleapi.Error{
  6252. Code: res.StatusCode,
  6253. Header: res.Header,
  6254. }
  6255. }
  6256. if err != nil {
  6257. return nil, err
  6258. }
  6259. defer googleapi.CloseBody(res)
  6260. if err := googleapi.CheckResponse(res); err != nil {
  6261. return nil, err
  6262. }
  6263. ret := &Job{
  6264. ServerResponse: googleapi.ServerResponse{
  6265. Header: res.Header,
  6266. HTTPStatusCode: res.StatusCode,
  6267. },
  6268. }
  6269. target := &ret
  6270. if err := gensupport.DecodeResponse(target, res); err != nil {
  6271. return nil, err
  6272. }
  6273. return ret, nil
  6274. // {
  6275. // "description": "Updates a job in a project.",
  6276. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}",
  6277. // "httpMethod": "PATCH",
  6278. // "id": "dataproc.projects.regions.jobs.patch",
  6279. // "parameterOrder": [
  6280. // "projectId",
  6281. // "region",
  6282. // "jobId"
  6283. // ],
  6284. // "parameters": {
  6285. // "jobId": {
  6286. // "description": "Required. The job ID.",
  6287. // "location": "path",
  6288. // "required": true,
  6289. // "type": "string"
  6290. // },
  6291. // "projectId": {
  6292. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  6293. // "location": "path",
  6294. // "required": true,
  6295. // "type": "string"
  6296. // },
  6297. // "region": {
  6298. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  6299. // "location": "path",
  6300. // "required": true,
  6301. // "type": "string"
  6302. // },
  6303. // "updateMask": {
  6304. // "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.",
  6305. // "format": "google-fieldmask",
  6306. // "location": "query",
  6307. // "type": "string"
  6308. // }
  6309. // },
  6310. // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs/{jobId}",
  6311. // "request": {
  6312. // "$ref": "Job"
  6313. // },
  6314. // "response": {
  6315. // "$ref": "Job"
  6316. // },
  6317. // "scopes": [
  6318. // "https://www.googleapis.com/auth/cloud-platform"
  6319. // ]
  6320. // }
  6321. }
  6322. // method id "dataproc.projects.regions.jobs.setIamPolicy":
  6323. type ProjectsRegionsJobsSetIamPolicyCall struct {
  6324. s *Service
  6325. resource string
  6326. setiampolicyrequest *SetIamPolicyRequest
  6327. urlParams_ gensupport.URLParams
  6328. ctx_ context.Context
  6329. header_ http.Header
  6330. }
  6331. // SetIamPolicy: Sets the access control policy on the specified
  6332. // resource. Replaces any existing policy.
  6333. func (r *ProjectsRegionsJobsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsJobsSetIamPolicyCall {
  6334. c := &ProjectsRegionsJobsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6335. c.resource = resource
  6336. c.setiampolicyrequest = setiampolicyrequest
  6337. return c
  6338. }
  6339. // Fields allows partial responses to be retrieved. See
  6340. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6341. // for more information.
  6342. func (c *ProjectsRegionsJobsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSetIamPolicyCall {
  6343. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6344. return c
  6345. }
  6346. // Context sets the context to be used in this call's Do method. Any
  6347. // pending HTTP request will be aborted if the provided context is
  6348. // canceled.
  6349. func (c *ProjectsRegionsJobsSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsJobsSetIamPolicyCall {
  6350. c.ctx_ = ctx
  6351. return c
  6352. }
  6353. // Header returns an http.Header that can be modified by the caller to
  6354. // add HTTP headers to the request.
  6355. func (c *ProjectsRegionsJobsSetIamPolicyCall) Header() http.Header {
  6356. if c.header_ == nil {
  6357. c.header_ = make(http.Header)
  6358. }
  6359. return c.header_
  6360. }
  6361. func (c *ProjectsRegionsJobsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  6362. reqHeaders := make(http.Header)
  6363. for k, v := range c.header_ {
  6364. reqHeaders[k] = v
  6365. }
  6366. reqHeaders.Set("User-Agent", c.s.userAgent())
  6367. var body io.Reader = nil
  6368. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  6369. if err != nil {
  6370. return nil, err
  6371. }
  6372. reqHeaders.Set("Content-Type", "application/json")
  6373. c.urlParams_.Set("alt", alt)
  6374. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy")
  6375. urls += "?" + c.urlParams_.Encode()
  6376. req, _ := http.NewRequest("POST", urls, body)
  6377. req.Header = reqHeaders
  6378. googleapi.Expand(req.URL, map[string]string{
  6379. "resource": c.resource,
  6380. })
  6381. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6382. }
  6383. // Do executes the "dataproc.projects.regions.jobs.setIamPolicy" call.
  6384. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  6385. // code is an error. Response headers are in either
  6386. // *Policy.ServerResponse.Header or (if a response was returned at all)
  6387. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6388. // check whether the returned error was because http.StatusNotModified
  6389. // was returned.
  6390. func (c *ProjectsRegionsJobsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  6391. gensupport.SetOptions(c.urlParams_, opts...)
  6392. res, err := c.doRequest("json")
  6393. if res != nil && res.StatusCode == http.StatusNotModified {
  6394. if res.Body != nil {
  6395. res.Body.Close()
  6396. }
  6397. return nil, &googleapi.Error{
  6398. Code: res.StatusCode,
  6399. Header: res.Header,
  6400. }
  6401. }
  6402. if err != nil {
  6403. return nil, err
  6404. }
  6405. defer googleapi.CloseBody(res)
  6406. if err := googleapi.CheckResponse(res); err != nil {
  6407. return nil, err
  6408. }
  6409. ret := &Policy{
  6410. ServerResponse: googleapi.ServerResponse{
  6411. Header: res.Header,
  6412. HTTPStatusCode: res.StatusCode,
  6413. },
  6414. }
  6415. target := &ret
  6416. if err := gensupport.DecodeResponse(target, res); err != nil {
  6417. return nil, err
  6418. }
  6419. return ret, nil
  6420. // {
  6421. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  6422. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:setIamPolicy",
  6423. // "httpMethod": "POST",
  6424. // "id": "dataproc.projects.regions.jobs.setIamPolicy",
  6425. // "parameterOrder": [
  6426. // "resource"
  6427. // ],
  6428. // "parameters": {
  6429. // "resource": {
  6430. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  6431. // "location": "path",
  6432. // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$",
  6433. // "required": true,
  6434. // "type": "string"
  6435. // }
  6436. // },
  6437. // "path": "v1beta2/{+resource}:setIamPolicy",
  6438. // "request": {
  6439. // "$ref": "SetIamPolicyRequest"
  6440. // },
  6441. // "response": {
  6442. // "$ref": "Policy"
  6443. // },
  6444. // "scopes": [
  6445. // "https://www.googleapis.com/auth/cloud-platform"
  6446. // ]
  6447. // }
  6448. }
  6449. // method id "dataproc.projects.regions.jobs.submit":
  6450. type ProjectsRegionsJobsSubmitCall struct {
  6451. s *Service
  6452. projectId string
  6453. region string
  6454. submitjobrequest *SubmitJobRequest
  6455. urlParams_ gensupport.URLParams
  6456. ctx_ context.Context
  6457. header_ http.Header
  6458. }
  6459. // Submit: Submits a job to a cluster.
  6460. func (r *ProjectsRegionsJobsService) Submit(projectId string, region string, submitjobrequest *SubmitJobRequest) *ProjectsRegionsJobsSubmitCall {
  6461. c := &ProjectsRegionsJobsSubmitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6462. c.projectId = projectId
  6463. c.region = region
  6464. c.submitjobrequest = submitjobrequest
  6465. return c
  6466. }
  6467. // Fields allows partial responses to be retrieved. See
  6468. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6469. // for more information.
  6470. func (c *ProjectsRegionsJobsSubmitCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsSubmitCall {
  6471. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6472. return c
  6473. }
  6474. // Context sets the context to be used in this call's Do method. Any
  6475. // pending HTTP request will be aborted if the provided context is
  6476. // canceled.
  6477. func (c *ProjectsRegionsJobsSubmitCall) Context(ctx context.Context) *ProjectsRegionsJobsSubmitCall {
  6478. c.ctx_ = ctx
  6479. return c
  6480. }
  6481. // Header returns an http.Header that can be modified by the caller to
  6482. // add HTTP headers to the request.
  6483. func (c *ProjectsRegionsJobsSubmitCall) Header() http.Header {
  6484. if c.header_ == nil {
  6485. c.header_ = make(http.Header)
  6486. }
  6487. return c.header_
  6488. }
  6489. func (c *ProjectsRegionsJobsSubmitCall) doRequest(alt string) (*http.Response, error) {
  6490. reqHeaders := make(http.Header)
  6491. for k, v := range c.header_ {
  6492. reqHeaders[k] = v
  6493. }
  6494. reqHeaders.Set("User-Agent", c.s.userAgent())
  6495. var body io.Reader = nil
  6496. body, err := googleapi.WithoutDataWrapper.JSONReader(c.submitjobrequest)
  6497. if err != nil {
  6498. return nil, err
  6499. }
  6500. reqHeaders.Set("Content-Type", "application/json")
  6501. c.urlParams_.Set("alt", alt)
  6502. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/projects/{projectId}/regions/{region}/jobs:submit")
  6503. urls += "?" + c.urlParams_.Encode()
  6504. req, _ := http.NewRequest("POST", urls, body)
  6505. req.Header = reqHeaders
  6506. googleapi.Expand(req.URL, map[string]string{
  6507. "projectId": c.projectId,
  6508. "region": c.region,
  6509. })
  6510. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6511. }
  6512. // Do executes the "dataproc.projects.regions.jobs.submit" call.
  6513. // Exactly one of *Job or error will be non-nil. Any non-2xx status code
  6514. // is an error. Response headers are in either
  6515. // *Job.ServerResponse.Header or (if a response was returned at all) in
  6516. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6517. // whether the returned error was because http.StatusNotModified was
  6518. // returned.
  6519. func (c *ProjectsRegionsJobsSubmitCall) Do(opts ...googleapi.CallOption) (*Job, error) {
  6520. gensupport.SetOptions(c.urlParams_, opts...)
  6521. res, err := c.doRequest("json")
  6522. if res != nil && res.StatusCode == http.StatusNotModified {
  6523. if res.Body != nil {
  6524. res.Body.Close()
  6525. }
  6526. return nil, &googleapi.Error{
  6527. Code: res.StatusCode,
  6528. Header: res.Header,
  6529. }
  6530. }
  6531. if err != nil {
  6532. return nil, err
  6533. }
  6534. defer googleapi.CloseBody(res)
  6535. if err := googleapi.CheckResponse(res); err != nil {
  6536. return nil, err
  6537. }
  6538. ret := &Job{
  6539. ServerResponse: googleapi.ServerResponse{
  6540. Header: res.Header,
  6541. HTTPStatusCode: res.StatusCode,
  6542. },
  6543. }
  6544. target := &ret
  6545. if err := gensupport.DecodeResponse(target, res); err != nil {
  6546. return nil, err
  6547. }
  6548. return ret, nil
  6549. // {
  6550. // "description": "Submits a job to a cluster.",
  6551. // "flatPath": "v1beta2/projects/{projectId}/regions/{region}/jobs:submit",
  6552. // "httpMethod": "POST",
  6553. // "id": "dataproc.projects.regions.jobs.submit",
  6554. // "parameterOrder": [
  6555. // "projectId",
  6556. // "region"
  6557. // ],
  6558. // "parameters": {
  6559. // "projectId": {
  6560. // "description": "Required. The ID of the Google Cloud Platform project that the job belongs to.",
  6561. // "location": "path",
  6562. // "required": true,
  6563. // "type": "string"
  6564. // },
  6565. // "region": {
  6566. // "description": "Required. The Cloud Dataproc region in which to handle the request.",
  6567. // "location": "path",
  6568. // "required": true,
  6569. // "type": "string"
  6570. // }
  6571. // },
  6572. // "path": "v1beta2/projects/{projectId}/regions/{region}/jobs:submit",
  6573. // "request": {
  6574. // "$ref": "SubmitJobRequest"
  6575. // },
  6576. // "response": {
  6577. // "$ref": "Job"
  6578. // },
  6579. // "scopes": [
  6580. // "https://www.googleapis.com/auth/cloud-platform"
  6581. // ]
  6582. // }
  6583. }
  6584. // method id "dataproc.projects.regions.jobs.testIamPermissions":
  6585. type ProjectsRegionsJobsTestIamPermissionsCall struct {
  6586. s *Service
  6587. resource string
  6588. testiampermissionsrequest *TestIamPermissionsRequest
  6589. urlParams_ gensupport.URLParams
  6590. ctx_ context.Context
  6591. header_ http.Header
  6592. }
  6593. // TestIamPermissions: Returns permissions that a caller has on the
  6594. // specified resource. If the resource does not exist, this will return
  6595. // an empty set of permissions, not a NOT_FOUND error.Note: This
  6596. // operation is designed to be used for building permission-aware UIs
  6597. // and command-line tools, not for authorization checking. This
  6598. // operation may "fail open" without warning.
  6599. func (r *ProjectsRegionsJobsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsJobsTestIamPermissionsCall {
  6600. c := &ProjectsRegionsJobsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6601. c.resource = resource
  6602. c.testiampermissionsrequest = testiampermissionsrequest
  6603. return c
  6604. }
  6605. // Fields allows partial responses to be retrieved. See
  6606. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6607. // for more information.
  6608. func (c *ProjectsRegionsJobsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsJobsTestIamPermissionsCall {
  6609. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6610. return c
  6611. }
  6612. // Context sets the context to be used in this call's Do method. Any
  6613. // pending HTTP request will be aborted if the provided context is
  6614. // canceled.
  6615. func (c *ProjectsRegionsJobsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsJobsTestIamPermissionsCall {
  6616. c.ctx_ = ctx
  6617. return c
  6618. }
  6619. // Header returns an http.Header that can be modified by the caller to
  6620. // add HTTP headers to the request.
  6621. func (c *ProjectsRegionsJobsTestIamPermissionsCall) Header() http.Header {
  6622. if c.header_ == nil {
  6623. c.header_ = make(http.Header)
  6624. }
  6625. return c.header_
  6626. }
  6627. func (c *ProjectsRegionsJobsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  6628. reqHeaders := make(http.Header)
  6629. for k, v := range c.header_ {
  6630. reqHeaders[k] = v
  6631. }
  6632. reqHeaders.Set("User-Agent", c.s.userAgent())
  6633. var body io.Reader = nil
  6634. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  6635. if err != nil {
  6636. return nil, err
  6637. }
  6638. reqHeaders.Set("Content-Type", "application/json")
  6639. c.urlParams_.Set("alt", alt)
  6640. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
  6641. urls += "?" + c.urlParams_.Encode()
  6642. req, _ := http.NewRequest("POST", urls, body)
  6643. req.Header = reqHeaders
  6644. googleapi.Expand(req.URL, map[string]string{
  6645. "resource": c.resource,
  6646. })
  6647. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6648. }
  6649. // Do executes the "dataproc.projects.regions.jobs.testIamPermissions" call.
  6650. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  6651. // Any non-2xx status code is an error. Response headers are in either
  6652. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  6653. // was returned at all) in error.(*googleapi.Error).Header. Use
  6654. // googleapi.IsNotModified to check whether the returned error was
  6655. // because http.StatusNotModified was returned.
  6656. func (c *ProjectsRegionsJobsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  6657. gensupport.SetOptions(c.urlParams_, opts...)
  6658. res, err := c.doRequest("json")
  6659. if res != nil && res.StatusCode == http.StatusNotModified {
  6660. if res.Body != nil {
  6661. res.Body.Close()
  6662. }
  6663. return nil, &googleapi.Error{
  6664. Code: res.StatusCode,
  6665. Header: res.Header,
  6666. }
  6667. }
  6668. if err != nil {
  6669. return nil, err
  6670. }
  6671. defer googleapi.CloseBody(res)
  6672. if err := googleapi.CheckResponse(res); err != nil {
  6673. return nil, err
  6674. }
  6675. ret := &TestIamPermissionsResponse{
  6676. ServerResponse: googleapi.ServerResponse{
  6677. Header: res.Header,
  6678. HTTPStatusCode: res.StatusCode,
  6679. },
  6680. }
  6681. target := &ret
  6682. if err := gensupport.DecodeResponse(target, res); err != nil {
  6683. return nil, err
  6684. }
  6685. return ret, nil
  6686. // {
  6687. // "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.",
  6688. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/jobs/{jobsId}:testIamPermissions",
  6689. // "httpMethod": "POST",
  6690. // "id": "dataproc.projects.regions.jobs.testIamPermissions",
  6691. // "parameterOrder": [
  6692. // "resource"
  6693. // ],
  6694. // "parameters": {
  6695. // "resource": {
  6696. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  6697. // "location": "path",
  6698. // "pattern": "^projects/[^/]+/regions/[^/]+/jobs/[^/]+$",
  6699. // "required": true,
  6700. // "type": "string"
  6701. // }
  6702. // },
  6703. // "path": "v1beta2/{+resource}:testIamPermissions",
  6704. // "request": {
  6705. // "$ref": "TestIamPermissionsRequest"
  6706. // },
  6707. // "response": {
  6708. // "$ref": "TestIamPermissionsResponse"
  6709. // },
  6710. // "scopes": [
  6711. // "https://www.googleapis.com/auth/cloud-platform"
  6712. // ]
  6713. // }
  6714. }
  6715. // method id "dataproc.projects.regions.operations.cancel":
  6716. type ProjectsRegionsOperationsCancelCall struct {
  6717. s *Service
  6718. name string
  6719. urlParams_ gensupport.URLParams
  6720. ctx_ context.Context
  6721. header_ http.Header
  6722. }
  6723. // Cancel: Starts asynchronous cancellation on a long-running operation.
  6724. // The server makes a best effort to cancel the operation, but success
  6725. // is not guaranteed. If the server doesn't support this method, it
  6726. // returns google.rpc.Code.UNIMPLEMENTED. Clients can use
  6727. // Operations.GetOperation or other methods to check whether the
  6728. // cancellation succeeded or whether the operation completed despite
  6729. // cancellation. On successful cancellation, the operation is not
  6730. // deleted; instead, it becomes an operation with an Operation.error
  6731. // value with a google.rpc.Status.code of 1, corresponding to
  6732. // Code.CANCELLED.
  6733. func (r *ProjectsRegionsOperationsService) Cancel(name string) *ProjectsRegionsOperationsCancelCall {
  6734. c := &ProjectsRegionsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6735. c.name = name
  6736. return c
  6737. }
  6738. // Fields allows partial responses to be retrieved. See
  6739. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6740. // for more information.
  6741. func (c *ProjectsRegionsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsCancelCall {
  6742. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6743. return c
  6744. }
  6745. // Context sets the context to be used in this call's Do method. Any
  6746. // pending HTTP request will be aborted if the provided context is
  6747. // canceled.
  6748. func (c *ProjectsRegionsOperationsCancelCall) Context(ctx context.Context) *ProjectsRegionsOperationsCancelCall {
  6749. c.ctx_ = ctx
  6750. return c
  6751. }
  6752. // Header returns an http.Header that can be modified by the caller to
  6753. // add HTTP headers to the request.
  6754. func (c *ProjectsRegionsOperationsCancelCall) Header() http.Header {
  6755. if c.header_ == nil {
  6756. c.header_ = make(http.Header)
  6757. }
  6758. return c.header_
  6759. }
  6760. func (c *ProjectsRegionsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  6761. reqHeaders := make(http.Header)
  6762. for k, v := range c.header_ {
  6763. reqHeaders[k] = v
  6764. }
  6765. reqHeaders.Set("User-Agent", c.s.userAgent())
  6766. var body io.Reader = nil
  6767. c.urlParams_.Set("alt", alt)
  6768. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:cancel")
  6769. urls += "?" + c.urlParams_.Encode()
  6770. req, _ := http.NewRequest("POST", urls, body)
  6771. req.Header = reqHeaders
  6772. googleapi.Expand(req.URL, map[string]string{
  6773. "name": c.name,
  6774. })
  6775. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6776. }
  6777. // Do executes the "dataproc.projects.regions.operations.cancel" call.
  6778. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  6779. // code is an error. Response headers are in either
  6780. // *Empty.ServerResponse.Header or (if a response was returned at all)
  6781. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6782. // check whether the returned error was because http.StatusNotModified
  6783. // was returned.
  6784. func (c *ProjectsRegionsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  6785. gensupport.SetOptions(c.urlParams_, opts...)
  6786. res, err := c.doRequest("json")
  6787. if res != nil && res.StatusCode == http.StatusNotModified {
  6788. if res.Body != nil {
  6789. res.Body.Close()
  6790. }
  6791. return nil, &googleapi.Error{
  6792. Code: res.StatusCode,
  6793. Header: res.Header,
  6794. }
  6795. }
  6796. if err != nil {
  6797. return nil, err
  6798. }
  6799. defer googleapi.CloseBody(res)
  6800. if err := googleapi.CheckResponse(res); err != nil {
  6801. return nil, err
  6802. }
  6803. ret := &Empty{
  6804. ServerResponse: googleapi.ServerResponse{
  6805. Header: res.Header,
  6806. HTTPStatusCode: res.StatusCode,
  6807. },
  6808. }
  6809. target := &ret
  6810. if err := gensupport.DecodeResponse(target, res); err != nil {
  6811. return nil, err
  6812. }
  6813. return ret, nil
  6814. // {
  6815. // "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.",
  6816. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:cancel",
  6817. // "httpMethod": "POST",
  6818. // "id": "dataproc.projects.regions.operations.cancel",
  6819. // "parameterOrder": [
  6820. // "name"
  6821. // ],
  6822. // "parameters": {
  6823. // "name": {
  6824. // "description": "The name of the operation resource to be cancelled.",
  6825. // "location": "path",
  6826. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  6827. // "required": true,
  6828. // "type": "string"
  6829. // }
  6830. // },
  6831. // "path": "v1beta2/{+name}:cancel",
  6832. // "response": {
  6833. // "$ref": "Empty"
  6834. // },
  6835. // "scopes": [
  6836. // "https://www.googleapis.com/auth/cloud-platform"
  6837. // ]
  6838. // }
  6839. }
  6840. // method id "dataproc.projects.regions.operations.delete":
  6841. type ProjectsRegionsOperationsDeleteCall struct {
  6842. s *Service
  6843. name string
  6844. urlParams_ gensupport.URLParams
  6845. ctx_ context.Context
  6846. header_ http.Header
  6847. }
  6848. // Delete: Deletes a long-running operation. This method indicates that
  6849. // the client is no longer interested in the operation result. It does
  6850. // not cancel the operation. If the server doesn't support this method,
  6851. // it returns google.rpc.Code.UNIMPLEMENTED.
  6852. func (r *ProjectsRegionsOperationsService) Delete(name string) *ProjectsRegionsOperationsDeleteCall {
  6853. c := &ProjectsRegionsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6854. c.name = name
  6855. return c
  6856. }
  6857. // Fields allows partial responses to be retrieved. See
  6858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6859. // for more information.
  6860. func (c *ProjectsRegionsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsDeleteCall {
  6861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6862. return c
  6863. }
  6864. // Context sets the context to be used in this call's Do method. Any
  6865. // pending HTTP request will be aborted if the provided context is
  6866. // canceled.
  6867. func (c *ProjectsRegionsOperationsDeleteCall) Context(ctx context.Context) *ProjectsRegionsOperationsDeleteCall {
  6868. c.ctx_ = ctx
  6869. return c
  6870. }
  6871. // Header returns an http.Header that can be modified by the caller to
  6872. // add HTTP headers to the request.
  6873. func (c *ProjectsRegionsOperationsDeleteCall) Header() http.Header {
  6874. if c.header_ == nil {
  6875. c.header_ = make(http.Header)
  6876. }
  6877. return c.header_
  6878. }
  6879. func (c *ProjectsRegionsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6880. reqHeaders := make(http.Header)
  6881. for k, v := range c.header_ {
  6882. reqHeaders[k] = v
  6883. }
  6884. reqHeaders.Set("User-Agent", c.s.userAgent())
  6885. var body io.Reader = nil
  6886. c.urlParams_.Set("alt", alt)
  6887. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  6888. urls += "?" + c.urlParams_.Encode()
  6889. req, _ := http.NewRequest("DELETE", urls, body)
  6890. req.Header = reqHeaders
  6891. googleapi.Expand(req.URL, map[string]string{
  6892. "name": c.name,
  6893. })
  6894. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6895. }
  6896. // Do executes the "dataproc.projects.regions.operations.delete" call.
  6897. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  6898. // code is an error. Response headers are in either
  6899. // *Empty.ServerResponse.Header or (if a response was returned at all)
  6900. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6901. // check whether the returned error was because http.StatusNotModified
  6902. // was returned.
  6903. func (c *ProjectsRegionsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  6904. gensupport.SetOptions(c.urlParams_, opts...)
  6905. res, err := c.doRequest("json")
  6906. if res != nil && res.StatusCode == http.StatusNotModified {
  6907. if res.Body != nil {
  6908. res.Body.Close()
  6909. }
  6910. return nil, &googleapi.Error{
  6911. Code: res.StatusCode,
  6912. Header: res.Header,
  6913. }
  6914. }
  6915. if err != nil {
  6916. return nil, err
  6917. }
  6918. defer googleapi.CloseBody(res)
  6919. if err := googleapi.CheckResponse(res); err != nil {
  6920. return nil, err
  6921. }
  6922. ret := &Empty{
  6923. ServerResponse: googleapi.ServerResponse{
  6924. Header: res.Header,
  6925. HTTPStatusCode: res.StatusCode,
  6926. },
  6927. }
  6928. target := &ret
  6929. if err := gensupport.DecodeResponse(target, res); err != nil {
  6930. return nil, err
  6931. }
  6932. return ret, nil
  6933. // {
  6934. // "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.",
  6935. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}",
  6936. // "httpMethod": "DELETE",
  6937. // "id": "dataproc.projects.regions.operations.delete",
  6938. // "parameterOrder": [
  6939. // "name"
  6940. // ],
  6941. // "parameters": {
  6942. // "name": {
  6943. // "description": "The name of the operation resource to be deleted.",
  6944. // "location": "path",
  6945. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  6946. // "required": true,
  6947. // "type": "string"
  6948. // }
  6949. // },
  6950. // "path": "v1beta2/{+name}",
  6951. // "response": {
  6952. // "$ref": "Empty"
  6953. // },
  6954. // "scopes": [
  6955. // "https://www.googleapis.com/auth/cloud-platform"
  6956. // ]
  6957. // }
  6958. }
  6959. // method id "dataproc.projects.regions.operations.get":
  6960. type ProjectsRegionsOperationsGetCall struct {
  6961. s *Service
  6962. name string
  6963. urlParams_ gensupport.URLParams
  6964. ifNoneMatch_ string
  6965. ctx_ context.Context
  6966. header_ http.Header
  6967. }
  6968. // Get: Gets the latest state of a long-running operation. Clients can
  6969. // use this method to poll the operation result at intervals as
  6970. // recommended by the API service.
  6971. func (r *ProjectsRegionsOperationsService) Get(name string) *ProjectsRegionsOperationsGetCall {
  6972. c := &ProjectsRegionsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6973. c.name = name
  6974. return c
  6975. }
  6976. // Fields allows partial responses to be retrieved. See
  6977. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  6978. // for more information.
  6979. func (c *ProjectsRegionsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsGetCall {
  6980. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6981. return c
  6982. }
  6983. // IfNoneMatch sets the optional parameter which makes the operation
  6984. // fail if the object's ETag matches the given value. This is useful for
  6985. // getting updates only after the object has changed since the last
  6986. // request. Use googleapi.IsNotModified to check whether the response
  6987. // error from Do is the result of In-None-Match.
  6988. func (c *ProjectsRegionsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsGetCall {
  6989. c.ifNoneMatch_ = entityTag
  6990. return c
  6991. }
  6992. // Context sets the context to be used in this call's Do method. Any
  6993. // pending HTTP request will be aborted if the provided context is
  6994. // canceled.
  6995. func (c *ProjectsRegionsOperationsGetCall) Context(ctx context.Context) *ProjectsRegionsOperationsGetCall {
  6996. c.ctx_ = ctx
  6997. return c
  6998. }
  6999. // Header returns an http.Header that can be modified by the caller to
  7000. // add HTTP headers to the request.
  7001. func (c *ProjectsRegionsOperationsGetCall) Header() http.Header {
  7002. if c.header_ == nil {
  7003. c.header_ = make(http.Header)
  7004. }
  7005. return c.header_
  7006. }
  7007. func (c *ProjectsRegionsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  7008. reqHeaders := make(http.Header)
  7009. for k, v := range c.header_ {
  7010. reqHeaders[k] = v
  7011. }
  7012. reqHeaders.Set("User-Agent", c.s.userAgent())
  7013. if c.ifNoneMatch_ != "" {
  7014. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7015. }
  7016. var body io.Reader = nil
  7017. c.urlParams_.Set("alt", alt)
  7018. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  7019. urls += "?" + c.urlParams_.Encode()
  7020. req, _ := http.NewRequest("GET", urls, body)
  7021. req.Header = reqHeaders
  7022. googleapi.Expand(req.URL, map[string]string{
  7023. "name": c.name,
  7024. })
  7025. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7026. }
  7027. // Do executes the "dataproc.projects.regions.operations.get" call.
  7028. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  7029. // status code is an error. Response headers are in either
  7030. // *Operation.ServerResponse.Header or (if a response was returned at
  7031. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  7032. // to check whether the returned error was because
  7033. // http.StatusNotModified was returned.
  7034. func (c *ProjectsRegionsOperationsGetCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  7035. gensupport.SetOptions(c.urlParams_, opts...)
  7036. res, err := c.doRequest("json")
  7037. if res != nil && res.StatusCode == http.StatusNotModified {
  7038. if res.Body != nil {
  7039. res.Body.Close()
  7040. }
  7041. return nil, &googleapi.Error{
  7042. Code: res.StatusCode,
  7043. Header: res.Header,
  7044. }
  7045. }
  7046. if err != nil {
  7047. return nil, err
  7048. }
  7049. defer googleapi.CloseBody(res)
  7050. if err := googleapi.CheckResponse(res); err != nil {
  7051. return nil, err
  7052. }
  7053. ret := &Operation{
  7054. ServerResponse: googleapi.ServerResponse{
  7055. Header: res.Header,
  7056. HTTPStatusCode: res.StatusCode,
  7057. },
  7058. }
  7059. target := &ret
  7060. if err := gensupport.DecodeResponse(target, res); err != nil {
  7061. return nil, err
  7062. }
  7063. return ret, nil
  7064. // {
  7065. // "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.",
  7066. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}",
  7067. // "httpMethod": "GET",
  7068. // "id": "dataproc.projects.regions.operations.get",
  7069. // "parameterOrder": [
  7070. // "name"
  7071. // ],
  7072. // "parameters": {
  7073. // "name": {
  7074. // "description": "The name of the operation resource.",
  7075. // "location": "path",
  7076. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  7077. // "required": true,
  7078. // "type": "string"
  7079. // }
  7080. // },
  7081. // "path": "v1beta2/{+name}",
  7082. // "response": {
  7083. // "$ref": "Operation"
  7084. // },
  7085. // "scopes": [
  7086. // "https://www.googleapis.com/auth/cloud-platform"
  7087. // ]
  7088. // }
  7089. }
  7090. // method id "dataproc.projects.regions.operations.getIamPolicy":
  7091. type ProjectsRegionsOperationsGetIamPolicyCall struct {
  7092. s *Service
  7093. resource string
  7094. urlParams_ gensupport.URLParams
  7095. ifNoneMatch_ string
  7096. ctx_ context.Context
  7097. header_ http.Header
  7098. }
  7099. // GetIamPolicy: Gets the access control policy for a resource. Returns
  7100. // an empty policy if the resource exists and does not have a policy
  7101. // set.
  7102. func (r *ProjectsRegionsOperationsService) GetIamPolicy(resource string) *ProjectsRegionsOperationsGetIamPolicyCall {
  7103. c := &ProjectsRegionsOperationsGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7104. c.resource = resource
  7105. return c
  7106. }
  7107. // Fields allows partial responses to be retrieved. See
  7108. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7109. // for more information.
  7110. func (c *ProjectsRegionsOperationsGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsGetIamPolicyCall {
  7111. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7112. return c
  7113. }
  7114. // IfNoneMatch sets the optional parameter which makes the operation
  7115. // fail if the object's ETag matches the given value. This is useful for
  7116. // getting updates only after the object has changed since the last
  7117. // request. Use googleapi.IsNotModified to check whether the response
  7118. // error from Do is the result of In-None-Match.
  7119. func (c *ProjectsRegionsOperationsGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsGetIamPolicyCall {
  7120. c.ifNoneMatch_ = entityTag
  7121. return c
  7122. }
  7123. // Context sets the context to be used in this call's Do method. Any
  7124. // pending HTTP request will be aborted if the provided context is
  7125. // canceled.
  7126. func (c *ProjectsRegionsOperationsGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsOperationsGetIamPolicyCall {
  7127. c.ctx_ = ctx
  7128. return c
  7129. }
  7130. // Header returns an http.Header that can be modified by the caller to
  7131. // add HTTP headers to the request.
  7132. func (c *ProjectsRegionsOperationsGetIamPolicyCall) Header() http.Header {
  7133. if c.header_ == nil {
  7134. c.header_ = make(http.Header)
  7135. }
  7136. return c.header_
  7137. }
  7138. func (c *ProjectsRegionsOperationsGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  7139. reqHeaders := make(http.Header)
  7140. for k, v := range c.header_ {
  7141. reqHeaders[k] = v
  7142. }
  7143. reqHeaders.Set("User-Agent", c.s.userAgent())
  7144. if c.ifNoneMatch_ != "" {
  7145. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7146. }
  7147. var body io.Reader = nil
  7148. c.urlParams_.Set("alt", alt)
  7149. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
  7150. urls += "?" + c.urlParams_.Encode()
  7151. req, _ := http.NewRequest("GET", urls, body)
  7152. req.Header = reqHeaders
  7153. googleapi.Expand(req.URL, map[string]string{
  7154. "resource": c.resource,
  7155. })
  7156. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7157. }
  7158. // Do executes the "dataproc.projects.regions.operations.getIamPolicy" call.
  7159. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  7160. // code is an error. Response headers are in either
  7161. // *Policy.ServerResponse.Header or (if a response was returned at all)
  7162. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7163. // check whether the returned error was because http.StatusNotModified
  7164. // was returned.
  7165. func (c *ProjectsRegionsOperationsGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  7166. gensupport.SetOptions(c.urlParams_, opts...)
  7167. res, err := c.doRequest("json")
  7168. if res != nil && res.StatusCode == http.StatusNotModified {
  7169. if res.Body != nil {
  7170. res.Body.Close()
  7171. }
  7172. return nil, &googleapi.Error{
  7173. Code: res.StatusCode,
  7174. Header: res.Header,
  7175. }
  7176. }
  7177. if err != nil {
  7178. return nil, err
  7179. }
  7180. defer googleapi.CloseBody(res)
  7181. if err := googleapi.CheckResponse(res); err != nil {
  7182. return nil, err
  7183. }
  7184. ret := &Policy{
  7185. ServerResponse: googleapi.ServerResponse{
  7186. Header: res.Header,
  7187. HTTPStatusCode: res.StatusCode,
  7188. },
  7189. }
  7190. target := &ret
  7191. if err := gensupport.DecodeResponse(target, res); err != nil {
  7192. return nil, err
  7193. }
  7194. return ret, nil
  7195. // {
  7196. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  7197. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:getIamPolicy",
  7198. // "httpMethod": "GET",
  7199. // "id": "dataproc.projects.regions.operations.getIamPolicy",
  7200. // "parameterOrder": [
  7201. // "resource"
  7202. // ],
  7203. // "parameters": {
  7204. // "resource": {
  7205. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  7206. // "location": "path",
  7207. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  7208. // "required": true,
  7209. // "type": "string"
  7210. // }
  7211. // },
  7212. // "path": "v1beta2/{+resource}:getIamPolicy",
  7213. // "response": {
  7214. // "$ref": "Policy"
  7215. // },
  7216. // "scopes": [
  7217. // "https://www.googleapis.com/auth/cloud-platform"
  7218. // ]
  7219. // }
  7220. }
  7221. // method id "dataproc.projects.regions.operations.list":
  7222. type ProjectsRegionsOperationsListCall struct {
  7223. s *Service
  7224. name string
  7225. urlParams_ gensupport.URLParams
  7226. ifNoneMatch_ string
  7227. ctx_ context.Context
  7228. header_ http.Header
  7229. }
  7230. // List: Lists operations that match the specified filter in the
  7231. // request. If the server doesn't support this method, it returns
  7232. // UNIMPLEMENTED.NOTE: the name binding allows API services to override
  7233. // the binding to use different resource name schemes, such as
  7234. // users/*/operations. To override the binding, API services can add a
  7235. // binding such as "/v1/{name=users/*}/operations" to their service
  7236. // configuration. For backwards compatibility, the default name includes
  7237. // the operations collection id, however overriding users must ensure
  7238. // the name binding is the parent resource, without the operations
  7239. // collection id.
  7240. func (r *ProjectsRegionsOperationsService) List(name string) *ProjectsRegionsOperationsListCall {
  7241. c := &ProjectsRegionsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7242. c.name = name
  7243. return c
  7244. }
  7245. // Filter sets the optional parameter "filter": The standard list
  7246. // filter.
  7247. func (c *ProjectsRegionsOperationsListCall) Filter(filter string) *ProjectsRegionsOperationsListCall {
  7248. c.urlParams_.Set("filter", filter)
  7249. return c
  7250. }
  7251. // PageSize sets the optional parameter "pageSize": The standard list
  7252. // page size.
  7253. func (c *ProjectsRegionsOperationsListCall) PageSize(pageSize int64) *ProjectsRegionsOperationsListCall {
  7254. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7255. return c
  7256. }
  7257. // PageToken sets the optional parameter "pageToken": The standard list
  7258. // page token.
  7259. func (c *ProjectsRegionsOperationsListCall) PageToken(pageToken string) *ProjectsRegionsOperationsListCall {
  7260. c.urlParams_.Set("pageToken", pageToken)
  7261. return c
  7262. }
  7263. // Fields allows partial responses to be retrieved. See
  7264. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7265. // for more information.
  7266. func (c *ProjectsRegionsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsListCall {
  7267. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7268. return c
  7269. }
  7270. // IfNoneMatch sets the optional parameter which makes the operation
  7271. // fail if the object's ETag matches the given value. This is useful for
  7272. // getting updates only after the object has changed since the last
  7273. // request. Use googleapi.IsNotModified to check whether the response
  7274. // error from Do is the result of In-None-Match.
  7275. func (c *ProjectsRegionsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsRegionsOperationsListCall {
  7276. c.ifNoneMatch_ = entityTag
  7277. return c
  7278. }
  7279. // Context sets the context to be used in this call's Do method. Any
  7280. // pending HTTP request will be aborted if the provided context is
  7281. // canceled.
  7282. func (c *ProjectsRegionsOperationsListCall) Context(ctx context.Context) *ProjectsRegionsOperationsListCall {
  7283. c.ctx_ = ctx
  7284. return c
  7285. }
  7286. // Header returns an http.Header that can be modified by the caller to
  7287. // add HTTP headers to the request.
  7288. func (c *ProjectsRegionsOperationsListCall) Header() http.Header {
  7289. if c.header_ == nil {
  7290. c.header_ = make(http.Header)
  7291. }
  7292. return c.header_
  7293. }
  7294. func (c *ProjectsRegionsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  7295. reqHeaders := make(http.Header)
  7296. for k, v := range c.header_ {
  7297. reqHeaders[k] = v
  7298. }
  7299. reqHeaders.Set("User-Agent", c.s.userAgent())
  7300. if c.ifNoneMatch_ != "" {
  7301. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7302. }
  7303. var body io.Reader = nil
  7304. c.urlParams_.Set("alt", alt)
  7305. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  7306. urls += "?" + c.urlParams_.Encode()
  7307. req, _ := http.NewRequest("GET", urls, body)
  7308. req.Header = reqHeaders
  7309. googleapi.Expand(req.URL, map[string]string{
  7310. "name": c.name,
  7311. })
  7312. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7313. }
  7314. // Do executes the "dataproc.projects.regions.operations.list" call.
  7315. // Exactly one of *ListOperationsResponse or error will be non-nil. Any
  7316. // non-2xx status code is an error. Response headers are in either
  7317. // *ListOperationsResponse.ServerResponse.Header or (if a response was
  7318. // returned at all) in error.(*googleapi.Error).Header. Use
  7319. // googleapi.IsNotModified to check whether the returned error was
  7320. // because http.StatusNotModified was returned.
  7321. func (c *ProjectsRegionsOperationsListCall) Do(opts ...googleapi.CallOption) (*ListOperationsResponse, error) {
  7322. gensupport.SetOptions(c.urlParams_, opts...)
  7323. res, err := c.doRequest("json")
  7324. if res != nil && res.StatusCode == http.StatusNotModified {
  7325. if res.Body != nil {
  7326. res.Body.Close()
  7327. }
  7328. return nil, &googleapi.Error{
  7329. Code: res.StatusCode,
  7330. Header: res.Header,
  7331. }
  7332. }
  7333. if err != nil {
  7334. return nil, err
  7335. }
  7336. defer googleapi.CloseBody(res)
  7337. if err := googleapi.CheckResponse(res); err != nil {
  7338. return nil, err
  7339. }
  7340. ret := &ListOperationsResponse{
  7341. ServerResponse: googleapi.ServerResponse{
  7342. Header: res.Header,
  7343. HTTPStatusCode: res.StatusCode,
  7344. },
  7345. }
  7346. target := &ret
  7347. if err := gensupport.DecodeResponse(target, res); err != nil {
  7348. return nil, err
  7349. }
  7350. return ret, nil
  7351. // {
  7352. // "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.",
  7353. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations",
  7354. // "httpMethod": "GET",
  7355. // "id": "dataproc.projects.regions.operations.list",
  7356. // "parameterOrder": [
  7357. // "name"
  7358. // ],
  7359. // "parameters": {
  7360. // "filter": {
  7361. // "description": "The standard list filter.",
  7362. // "location": "query",
  7363. // "type": "string"
  7364. // },
  7365. // "name": {
  7366. // "description": "The name of the operation's parent resource.",
  7367. // "location": "path",
  7368. // "pattern": "^projects/[^/]+/regions/[^/]+/operations$",
  7369. // "required": true,
  7370. // "type": "string"
  7371. // },
  7372. // "pageSize": {
  7373. // "description": "The standard list page size.",
  7374. // "format": "int32",
  7375. // "location": "query",
  7376. // "type": "integer"
  7377. // },
  7378. // "pageToken": {
  7379. // "description": "The standard list page token.",
  7380. // "location": "query",
  7381. // "type": "string"
  7382. // }
  7383. // },
  7384. // "path": "v1beta2/{+name}",
  7385. // "response": {
  7386. // "$ref": "ListOperationsResponse"
  7387. // },
  7388. // "scopes": [
  7389. // "https://www.googleapis.com/auth/cloud-platform"
  7390. // ]
  7391. // }
  7392. }
  7393. // Pages invokes f for each page of results.
  7394. // A non-nil error returned from f will halt the iteration.
  7395. // The provided context supersedes any context provided to the Context method.
  7396. func (c *ProjectsRegionsOperationsListCall) Pages(ctx context.Context, f func(*ListOperationsResponse) error) error {
  7397. c.ctx_ = ctx
  7398. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  7399. for {
  7400. x, err := c.Do()
  7401. if err != nil {
  7402. return err
  7403. }
  7404. if err := f(x); err != nil {
  7405. return err
  7406. }
  7407. if x.NextPageToken == "" {
  7408. return nil
  7409. }
  7410. c.PageToken(x.NextPageToken)
  7411. }
  7412. }
  7413. // method id "dataproc.projects.regions.operations.setIamPolicy":
  7414. type ProjectsRegionsOperationsSetIamPolicyCall struct {
  7415. s *Service
  7416. resource string
  7417. setiampolicyrequest *SetIamPolicyRequest
  7418. urlParams_ gensupport.URLParams
  7419. ctx_ context.Context
  7420. header_ http.Header
  7421. }
  7422. // SetIamPolicy: Sets the access control policy on the specified
  7423. // resource. Replaces any existing policy.
  7424. func (r *ProjectsRegionsOperationsService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsOperationsSetIamPolicyCall {
  7425. c := &ProjectsRegionsOperationsSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7426. c.resource = resource
  7427. c.setiampolicyrequest = setiampolicyrequest
  7428. return c
  7429. }
  7430. // Fields allows partial responses to be retrieved. See
  7431. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7432. // for more information.
  7433. func (c *ProjectsRegionsOperationsSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsSetIamPolicyCall {
  7434. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7435. return c
  7436. }
  7437. // Context sets the context to be used in this call's Do method. Any
  7438. // pending HTTP request will be aborted if the provided context is
  7439. // canceled.
  7440. func (c *ProjectsRegionsOperationsSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsOperationsSetIamPolicyCall {
  7441. c.ctx_ = ctx
  7442. return c
  7443. }
  7444. // Header returns an http.Header that can be modified by the caller to
  7445. // add HTTP headers to the request.
  7446. func (c *ProjectsRegionsOperationsSetIamPolicyCall) Header() http.Header {
  7447. if c.header_ == nil {
  7448. c.header_ = make(http.Header)
  7449. }
  7450. return c.header_
  7451. }
  7452. func (c *ProjectsRegionsOperationsSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  7453. reqHeaders := make(http.Header)
  7454. for k, v := range c.header_ {
  7455. reqHeaders[k] = v
  7456. }
  7457. reqHeaders.Set("User-Agent", c.s.userAgent())
  7458. var body io.Reader = nil
  7459. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  7460. if err != nil {
  7461. return nil, err
  7462. }
  7463. reqHeaders.Set("Content-Type", "application/json")
  7464. c.urlParams_.Set("alt", alt)
  7465. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy")
  7466. urls += "?" + c.urlParams_.Encode()
  7467. req, _ := http.NewRequest("POST", urls, body)
  7468. req.Header = reqHeaders
  7469. googleapi.Expand(req.URL, map[string]string{
  7470. "resource": c.resource,
  7471. })
  7472. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7473. }
  7474. // Do executes the "dataproc.projects.regions.operations.setIamPolicy" call.
  7475. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  7476. // code is an error. Response headers are in either
  7477. // *Policy.ServerResponse.Header or (if a response was returned at all)
  7478. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7479. // check whether the returned error was because http.StatusNotModified
  7480. // was returned.
  7481. func (c *ProjectsRegionsOperationsSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  7482. gensupport.SetOptions(c.urlParams_, opts...)
  7483. res, err := c.doRequest("json")
  7484. if res != nil && res.StatusCode == http.StatusNotModified {
  7485. if res.Body != nil {
  7486. res.Body.Close()
  7487. }
  7488. return nil, &googleapi.Error{
  7489. Code: res.StatusCode,
  7490. Header: res.Header,
  7491. }
  7492. }
  7493. if err != nil {
  7494. return nil, err
  7495. }
  7496. defer googleapi.CloseBody(res)
  7497. if err := googleapi.CheckResponse(res); err != nil {
  7498. return nil, err
  7499. }
  7500. ret := &Policy{
  7501. ServerResponse: googleapi.ServerResponse{
  7502. Header: res.Header,
  7503. HTTPStatusCode: res.StatusCode,
  7504. },
  7505. }
  7506. target := &ret
  7507. if err := gensupport.DecodeResponse(target, res); err != nil {
  7508. return nil, err
  7509. }
  7510. return ret, nil
  7511. // {
  7512. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  7513. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:setIamPolicy",
  7514. // "httpMethod": "POST",
  7515. // "id": "dataproc.projects.regions.operations.setIamPolicy",
  7516. // "parameterOrder": [
  7517. // "resource"
  7518. // ],
  7519. // "parameters": {
  7520. // "resource": {
  7521. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  7522. // "location": "path",
  7523. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  7524. // "required": true,
  7525. // "type": "string"
  7526. // }
  7527. // },
  7528. // "path": "v1beta2/{+resource}:setIamPolicy",
  7529. // "request": {
  7530. // "$ref": "SetIamPolicyRequest"
  7531. // },
  7532. // "response": {
  7533. // "$ref": "Policy"
  7534. // },
  7535. // "scopes": [
  7536. // "https://www.googleapis.com/auth/cloud-platform"
  7537. // ]
  7538. // }
  7539. }
  7540. // method id "dataproc.projects.regions.operations.testIamPermissions":
  7541. type ProjectsRegionsOperationsTestIamPermissionsCall struct {
  7542. s *Service
  7543. resource string
  7544. testiampermissionsrequest *TestIamPermissionsRequest
  7545. urlParams_ gensupport.URLParams
  7546. ctx_ context.Context
  7547. header_ http.Header
  7548. }
  7549. // TestIamPermissions: Returns permissions that a caller has on the
  7550. // specified resource. If the resource does not exist, this will return
  7551. // an empty set of permissions, not a NOT_FOUND error.Note: This
  7552. // operation is designed to be used for building permission-aware UIs
  7553. // and command-line tools, not for authorization checking. This
  7554. // operation may "fail open" without warning.
  7555. func (r *ProjectsRegionsOperationsService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsOperationsTestIamPermissionsCall {
  7556. c := &ProjectsRegionsOperationsTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7557. c.resource = resource
  7558. c.testiampermissionsrequest = testiampermissionsrequest
  7559. return c
  7560. }
  7561. // Fields allows partial responses to be retrieved. See
  7562. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7563. // for more information.
  7564. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsOperationsTestIamPermissionsCall {
  7565. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7566. return c
  7567. }
  7568. // Context sets the context to be used in this call's Do method. Any
  7569. // pending HTTP request will be aborted if the provided context is
  7570. // canceled.
  7571. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsOperationsTestIamPermissionsCall {
  7572. c.ctx_ = ctx
  7573. return c
  7574. }
  7575. // Header returns an http.Header that can be modified by the caller to
  7576. // add HTTP headers to the request.
  7577. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Header() http.Header {
  7578. if c.header_ == nil {
  7579. c.header_ = make(http.Header)
  7580. }
  7581. return c.header_
  7582. }
  7583. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  7584. reqHeaders := make(http.Header)
  7585. for k, v := range c.header_ {
  7586. reqHeaders[k] = v
  7587. }
  7588. reqHeaders.Set("User-Agent", c.s.userAgent())
  7589. var body io.Reader = nil
  7590. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  7591. if err != nil {
  7592. return nil, err
  7593. }
  7594. reqHeaders.Set("Content-Type", "application/json")
  7595. c.urlParams_.Set("alt", alt)
  7596. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
  7597. urls += "?" + c.urlParams_.Encode()
  7598. req, _ := http.NewRequest("POST", urls, body)
  7599. req.Header = reqHeaders
  7600. googleapi.Expand(req.URL, map[string]string{
  7601. "resource": c.resource,
  7602. })
  7603. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7604. }
  7605. // Do executes the "dataproc.projects.regions.operations.testIamPermissions" call.
  7606. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  7607. // Any non-2xx status code is an error. Response headers are in either
  7608. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  7609. // was returned at all) in error.(*googleapi.Error).Header. Use
  7610. // googleapi.IsNotModified to check whether the returned error was
  7611. // because http.StatusNotModified was returned.
  7612. func (c *ProjectsRegionsOperationsTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  7613. gensupport.SetOptions(c.urlParams_, opts...)
  7614. res, err := c.doRequest("json")
  7615. if res != nil && res.StatusCode == http.StatusNotModified {
  7616. if res.Body != nil {
  7617. res.Body.Close()
  7618. }
  7619. return nil, &googleapi.Error{
  7620. Code: res.StatusCode,
  7621. Header: res.Header,
  7622. }
  7623. }
  7624. if err != nil {
  7625. return nil, err
  7626. }
  7627. defer googleapi.CloseBody(res)
  7628. if err := googleapi.CheckResponse(res); err != nil {
  7629. return nil, err
  7630. }
  7631. ret := &TestIamPermissionsResponse{
  7632. ServerResponse: googleapi.ServerResponse{
  7633. Header: res.Header,
  7634. HTTPStatusCode: res.StatusCode,
  7635. },
  7636. }
  7637. target := &ret
  7638. if err := gensupport.DecodeResponse(target, res); err != nil {
  7639. return nil, err
  7640. }
  7641. return ret, nil
  7642. // {
  7643. // "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.",
  7644. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/operations/{operationsId}:testIamPermissions",
  7645. // "httpMethod": "POST",
  7646. // "id": "dataproc.projects.regions.operations.testIamPermissions",
  7647. // "parameterOrder": [
  7648. // "resource"
  7649. // ],
  7650. // "parameters": {
  7651. // "resource": {
  7652. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  7653. // "location": "path",
  7654. // "pattern": "^projects/[^/]+/regions/[^/]+/operations/[^/]+$",
  7655. // "required": true,
  7656. // "type": "string"
  7657. // }
  7658. // },
  7659. // "path": "v1beta2/{+resource}:testIamPermissions",
  7660. // "request": {
  7661. // "$ref": "TestIamPermissionsRequest"
  7662. // },
  7663. // "response": {
  7664. // "$ref": "TestIamPermissionsResponse"
  7665. // },
  7666. // "scopes": [
  7667. // "https://www.googleapis.com/auth/cloud-platform"
  7668. // ]
  7669. // }
  7670. }
  7671. // method id "dataproc.projects.regions.workflowTemplates.create":
  7672. type ProjectsRegionsWorkflowTemplatesCreateCall struct {
  7673. s *Service
  7674. parent string
  7675. workflowtemplate *WorkflowTemplate
  7676. urlParams_ gensupport.URLParams
  7677. ctx_ context.Context
  7678. header_ http.Header
  7679. }
  7680. // Create: Creates new workflow template.
  7681. func (r *ProjectsRegionsWorkflowTemplatesService) Create(parent string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesCreateCall {
  7682. c := &ProjectsRegionsWorkflowTemplatesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7683. c.parent = parent
  7684. c.workflowtemplate = workflowtemplate
  7685. return c
  7686. }
  7687. // Fields allows partial responses to be retrieved. See
  7688. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7689. // for more information.
  7690. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesCreateCall {
  7691. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7692. return c
  7693. }
  7694. // Context sets the context to be used in this call's Do method. Any
  7695. // pending HTTP request will be aborted if the provided context is
  7696. // canceled.
  7697. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesCreateCall {
  7698. c.ctx_ = ctx
  7699. return c
  7700. }
  7701. // Header returns an http.Header that can be modified by the caller to
  7702. // add HTTP headers to the request.
  7703. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Header() http.Header {
  7704. if c.header_ == nil {
  7705. c.header_ = make(http.Header)
  7706. }
  7707. return c.header_
  7708. }
  7709. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) doRequest(alt string) (*http.Response, error) {
  7710. reqHeaders := make(http.Header)
  7711. for k, v := range c.header_ {
  7712. reqHeaders[k] = v
  7713. }
  7714. reqHeaders.Set("User-Agent", c.s.userAgent())
  7715. var body io.Reader = nil
  7716. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  7717. if err != nil {
  7718. return nil, err
  7719. }
  7720. reqHeaders.Set("Content-Type", "application/json")
  7721. c.urlParams_.Set("alt", alt)
  7722. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates")
  7723. urls += "?" + c.urlParams_.Encode()
  7724. req, _ := http.NewRequest("POST", urls, body)
  7725. req.Header = reqHeaders
  7726. googleapi.Expand(req.URL, map[string]string{
  7727. "parent": c.parent,
  7728. })
  7729. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7730. }
  7731. // Do executes the "dataproc.projects.regions.workflowTemplates.create" call.
  7732. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  7733. // non-2xx status code is an error. Response headers are in either
  7734. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  7735. // returned at all) in error.(*googleapi.Error).Header. Use
  7736. // googleapi.IsNotModified to check whether the returned error was
  7737. // because http.StatusNotModified was returned.
  7738. func (c *ProjectsRegionsWorkflowTemplatesCreateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  7739. gensupport.SetOptions(c.urlParams_, opts...)
  7740. res, err := c.doRequest("json")
  7741. if res != nil && res.StatusCode == http.StatusNotModified {
  7742. if res.Body != nil {
  7743. res.Body.Close()
  7744. }
  7745. return nil, &googleapi.Error{
  7746. Code: res.StatusCode,
  7747. Header: res.Header,
  7748. }
  7749. }
  7750. if err != nil {
  7751. return nil, err
  7752. }
  7753. defer googleapi.CloseBody(res)
  7754. if err := googleapi.CheckResponse(res); err != nil {
  7755. return nil, err
  7756. }
  7757. ret := &WorkflowTemplate{
  7758. ServerResponse: googleapi.ServerResponse{
  7759. Header: res.Header,
  7760. HTTPStatusCode: res.StatusCode,
  7761. },
  7762. }
  7763. target := &ret
  7764. if err := gensupport.DecodeResponse(target, res); err != nil {
  7765. return nil, err
  7766. }
  7767. return ret, nil
  7768. // {
  7769. // "description": "Creates new workflow template.",
  7770. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates",
  7771. // "httpMethod": "POST",
  7772. // "id": "dataproc.projects.regions.workflowTemplates.create",
  7773. // "parameterOrder": [
  7774. // "parent"
  7775. // ],
  7776. // "parameters": {
  7777. // "parent": {
  7778. // "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}",
  7779. // "location": "path",
  7780. // "pattern": "^projects/[^/]+/regions/[^/]+$",
  7781. // "required": true,
  7782. // "type": "string"
  7783. // }
  7784. // },
  7785. // "path": "v1beta2/{+parent}/workflowTemplates",
  7786. // "request": {
  7787. // "$ref": "WorkflowTemplate"
  7788. // },
  7789. // "response": {
  7790. // "$ref": "WorkflowTemplate"
  7791. // },
  7792. // "scopes": [
  7793. // "https://www.googleapis.com/auth/cloud-platform"
  7794. // ]
  7795. // }
  7796. }
  7797. // method id "dataproc.projects.regions.workflowTemplates.delete":
  7798. type ProjectsRegionsWorkflowTemplatesDeleteCall struct {
  7799. s *Service
  7800. name string
  7801. urlParams_ gensupport.URLParams
  7802. ctx_ context.Context
  7803. header_ http.Header
  7804. }
  7805. // Delete: Deletes a workflow template. It does not cancel in-progress
  7806. // workflows.
  7807. func (r *ProjectsRegionsWorkflowTemplatesService) Delete(name string) *ProjectsRegionsWorkflowTemplatesDeleteCall {
  7808. c := &ProjectsRegionsWorkflowTemplatesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7809. c.name = name
  7810. return c
  7811. }
  7812. // Version sets the optional parameter "version": The version of
  7813. // workflow template to delete. If specified, will only delete the
  7814. // template if the current server version matches specified version.
  7815. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Version(version int64) *ProjectsRegionsWorkflowTemplatesDeleteCall {
  7816. c.urlParams_.Set("version", fmt.Sprint(version))
  7817. return c
  7818. }
  7819. // Fields allows partial responses to be retrieved. See
  7820. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7821. // for more information.
  7822. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesDeleteCall {
  7823. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7824. return c
  7825. }
  7826. // Context sets the context to be used in this call's Do method. Any
  7827. // pending HTTP request will be aborted if the provided context is
  7828. // canceled.
  7829. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesDeleteCall {
  7830. c.ctx_ = ctx
  7831. return c
  7832. }
  7833. // Header returns an http.Header that can be modified by the caller to
  7834. // add HTTP headers to the request.
  7835. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Header() http.Header {
  7836. if c.header_ == nil {
  7837. c.header_ = make(http.Header)
  7838. }
  7839. return c.header_
  7840. }
  7841. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) doRequest(alt string) (*http.Response, error) {
  7842. reqHeaders := make(http.Header)
  7843. for k, v := range c.header_ {
  7844. reqHeaders[k] = v
  7845. }
  7846. reqHeaders.Set("User-Agent", c.s.userAgent())
  7847. var body io.Reader = nil
  7848. c.urlParams_.Set("alt", alt)
  7849. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  7850. urls += "?" + c.urlParams_.Encode()
  7851. req, _ := http.NewRequest("DELETE", urls, body)
  7852. req.Header = reqHeaders
  7853. googleapi.Expand(req.URL, map[string]string{
  7854. "name": c.name,
  7855. })
  7856. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7857. }
  7858. // Do executes the "dataproc.projects.regions.workflowTemplates.delete" call.
  7859. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  7860. // code is an error. Response headers are in either
  7861. // *Empty.ServerResponse.Header or (if a response was returned at all)
  7862. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7863. // check whether the returned error was because http.StatusNotModified
  7864. // was returned.
  7865. func (c *ProjectsRegionsWorkflowTemplatesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  7866. gensupport.SetOptions(c.urlParams_, opts...)
  7867. res, err := c.doRequest("json")
  7868. if res != nil && res.StatusCode == http.StatusNotModified {
  7869. if res.Body != nil {
  7870. res.Body.Close()
  7871. }
  7872. return nil, &googleapi.Error{
  7873. Code: res.StatusCode,
  7874. Header: res.Header,
  7875. }
  7876. }
  7877. if err != nil {
  7878. return nil, err
  7879. }
  7880. defer googleapi.CloseBody(res)
  7881. if err := googleapi.CheckResponse(res); err != nil {
  7882. return nil, err
  7883. }
  7884. ret := &Empty{
  7885. ServerResponse: googleapi.ServerResponse{
  7886. Header: res.Header,
  7887. HTTPStatusCode: res.StatusCode,
  7888. },
  7889. }
  7890. target := &ret
  7891. if err := gensupport.DecodeResponse(target, res); err != nil {
  7892. return nil, err
  7893. }
  7894. return ret, nil
  7895. // {
  7896. // "description": "Deletes a workflow template. It does not cancel in-progress workflows.",
  7897. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}",
  7898. // "httpMethod": "DELETE",
  7899. // "id": "dataproc.projects.regions.workflowTemplates.delete",
  7900. // "parameterOrder": [
  7901. // "name"
  7902. // ],
  7903. // "parameters": {
  7904. // "name": {
  7905. // "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}",
  7906. // "location": "path",
  7907. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  7908. // "required": true,
  7909. // "type": "string"
  7910. // },
  7911. // "version": {
  7912. // "description": "Optional. The version of workflow template to delete. If specified, will only delete the template if the current server version matches specified version.",
  7913. // "format": "int32",
  7914. // "location": "query",
  7915. // "type": "integer"
  7916. // }
  7917. // },
  7918. // "path": "v1beta2/{+name}",
  7919. // "response": {
  7920. // "$ref": "Empty"
  7921. // },
  7922. // "scopes": [
  7923. // "https://www.googleapis.com/auth/cloud-platform"
  7924. // ]
  7925. // }
  7926. }
  7927. // method id "dataproc.projects.regions.workflowTemplates.get":
  7928. type ProjectsRegionsWorkflowTemplatesGetCall struct {
  7929. s *Service
  7930. name string
  7931. urlParams_ gensupport.URLParams
  7932. ifNoneMatch_ string
  7933. ctx_ context.Context
  7934. header_ http.Header
  7935. }
  7936. // Get: Retrieves the latest workflow template.Can retrieve previously
  7937. // instantiated template by specifying optional version parameter.
  7938. func (r *ProjectsRegionsWorkflowTemplatesService) Get(name string) *ProjectsRegionsWorkflowTemplatesGetCall {
  7939. c := &ProjectsRegionsWorkflowTemplatesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7940. c.name = name
  7941. return c
  7942. }
  7943. // Version sets the optional parameter "version": The version of
  7944. // workflow template to retrieve. Only previously instatiated versions
  7945. // can be retrieved.If unspecified, retrieves the current version.
  7946. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Version(version int64) *ProjectsRegionsWorkflowTemplatesGetCall {
  7947. c.urlParams_.Set("version", fmt.Sprint(version))
  7948. return c
  7949. }
  7950. // Fields allows partial responses to be retrieved. See
  7951. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  7952. // for more information.
  7953. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesGetCall {
  7954. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7955. return c
  7956. }
  7957. // IfNoneMatch sets the optional parameter which makes the operation
  7958. // fail if the object's ETag matches the given value. This is useful for
  7959. // getting updates only after the object has changed since the last
  7960. // request. Use googleapi.IsNotModified to check whether the response
  7961. // error from Do is the result of In-None-Match.
  7962. func (c *ProjectsRegionsWorkflowTemplatesGetCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesGetCall {
  7963. c.ifNoneMatch_ = entityTag
  7964. return c
  7965. }
  7966. // Context sets the context to be used in this call's Do method. Any
  7967. // pending HTTP request will be aborted if the provided context is
  7968. // canceled.
  7969. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesGetCall {
  7970. c.ctx_ = ctx
  7971. return c
  7972. }
  7973. // Header returns an http.Header that can be modified by the caller to
  7974. // add HTTP headers to the request.
  7975. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Header() http.Header {
  7976. if c.header_ == nil {
  7977. c.header_ = make(http.Header)
  7978. }
  7979. return c.header_
  7980. }
  7981. func (c *ProjectsRegionsWorkflowTemplatesGetCall) doRequest(alt string) (*http.Response, error) {
  7982. reqHeaders := make(http.Header)
  7983. for k, v := range c.header_ {
  7984. reqHeaders[k] = v
  7985. }
  7986. reqHeaders.Set("User-Agent", c.s.userAgent())
  7987. if c.ifNoneMatch_ != "" {
  7988. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7989. }
  7990. var body io.Reader = nil
  7991. c.urlParams_.Set("alt", alt)
  7992. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  7993. urls += "?" + c.urlParams_.Encode()
  7994. req, _ := http.NewRequest("GET", urls, body)
  7995. req.Header = reqHeaders
  7996. googleapi.Expand(req.URL, map[string]string{
  7997. "name": c.name,
  7998. })
  7999. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8000. }
  8001. // Do executes the "dataproc.projects.regions.workflowTemplates.get" call.
  8002. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  8003. // non-2xx status code is an error. Response headers are in either
  8004. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  8005. // returned at all) in error.(*googleapi.Error).Header. Use
  8006. // googleapi.IsNotModified to check whether the returned error was
  8007. // because http.StatusNotModified was returned.
  8008. func (c *ProjectsRegionsWorkflowTemplatesGetCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  8009. gensupport.SetOptions(c.urlParams_, opts...)
  8010. res, err := c.doRequest("json")
  8011. if res != nil && res.StatusCode == http.StatusNotModified {
  8012. if res.Body != nil {
  8013. res.Body.Close()
  8014. }
  8015. return nil, &googleapi.Error{
  8016. Code: res.StatusCode,
  8017. Header: res.Header,
  8018. }
  8019. }
  8020. if err != nil {
  8021. return nil, err
  8022. }
  8023. defer googleapi.CloseBody(res)
  8024. if err := googleapi.CheckResponse(res); err != nil {
  8025. return nil, err
  8026. }
  8027. ret := &WorkflowTemplate{
  8028. ServerResponse: googleapi.ServerResponse{
  8029. Header: res.Header,
  8030. HTTPStatusCode: res.StatusCode,
  8031. },
  8032. }
  8033. target := &ret
  8034. if err := gensupport.DecodeResponse(target, res); err != nil {
  8035. return nil, err
  8036. }
  8037. return ret, nil
  8038. // {
  8039. // "description": "Retrieves the latest workflow template.Can retrieve previously instantiated template by specifying optional version parameter.",
  8040. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}",
  8041. // "httpMethod": "GET",
  8042. // "id": "dataproc.projects.regions.workflowTemplates.get",
  8043. // "parameterOrder": [
  8044. // "name"
  8045. // ],
  8046. // "parameters": {
  8047. // "name": {
  8048. // "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}",
  8049. // "location": "path",
  8050. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  8051. // "required": true,
  8052. // "type": "string"
  8053. // },
  8054. // "version": {
  8055. // "description": "Optional. The version of workflow template to retrieve. Only previously instatiated versions can be retrieved.If unspecified, retrieves the current version.",
  8056. // "format": "int32",
  8057. // "location": "query",
  8058. // "type": "integer"
  8059. // }
  8060. // },
  8061. // "path": "v1beta2/{+name}",
  8062. // "response": {
  8063. // "$ref": "WorkflowTemplate"
  8064. // },
  8065. // "scopes": [
  8066. // "https://www.googleapis.com/auth/cloud-platform"
  8067. // ]
  8068. // }
  8069. }
  8070. // method id "dataproc.projects.regions.workflowTemplates.getIamPolicy":
  8071. type ProjectsRegionsWorkflowTemplatesGetIamPolicyCall struct {
  8072. s *Service
  8073. resource string
  8074. urlParams_ gensupport.URLParams
  8075. ifNoneMatch_ string
  8076. ctx_ context.Context
  8077. header_ http.Header
  8078. }
  8079. // GetIamPolicy: Gets the access control policy for a resource. Returns
  8080. // an empty policy if the resource exists and does not have a policy
  8081. // set.
  8082. func (r *ProjectsRegionsWorkflowTemplatesService) GetIamPolicy(resource string) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall {
  8083. c := &ProjectsRegionsWorkflowTemplatesGetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8084. c.resource = resource
  8085. return c
  8086. }
  8087. // Fields allows partial responses to be retrieved. See
  8088. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8089. // for more information.
  8090. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall {
  8091. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8092. return c
  8093. }
  8094. // IfNoneMatch sets the optional parameter which makes the operation
  8095. // fail if the object's ETag matches the given value. This is useful for
  8096. // getting updates only after the object has changed since the last
  8097. // request. Use googleapi.IsNotModified to check whether the response
  8098. // error from Do is the result of In-None-Match.
  8099. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall {
  8100. c.ifNoneMatch_ = entityTag
  8101. return c
  8102. }
  8103. // Context sets the context to be used in this call's Do method. Any
  8104. // pending HTTP request will be aborted if the provided context is
  8105. // canceled.
  8106. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall {
  8107. c.ctx_ = ctx
  8108. return c
  8109. }
  8110. // Header returns an http.Header that can be modified by the caller to
  8111. // add HTTP headers to the request.
  8112. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Header() http.Header {
  8113. if c.header_ == nil {
  8114. c.header_ = make(http.Header)
  8115. }
  8116. return c.header_
  8117. }
  8118. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  8119. reqHeaders := make(http.Header)
  8120. for k, v := range c.header_ {
  8121. reqHeaders[k] = v
  8122. }
  8123. reqHeaders.Set("User-Agent", c.s.userAgent())
  8124. if c.ifNoneMatch_ != "" {
  8125. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8126. }
  8127. var body io.Reader = nil
  8128. c.urlParams_.Set("alt", alt)
  8129. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:getIamPolicy")
  8130. urls += "?" + c.urlParams_.Encode()
  8131. req, _ := http.NewRequest("GET", urls, body)
  8132. req.Header = reqHeaders
  8133. googleapi.Expand(req.URL, map[string]string{
  8134. "resource": c.resource,
  8135. })
  8136. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8137. }
  8138. // Do executes the "dataproc.projects.regions.workflowTemplates.getIamPolicy" call.
  8139. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  8140. // code is an error. Response headers are in either
  8141. // *Policy.ServerResponse.Header or (if a response was returned at all)
  8142. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8143. // check whether the returned error was because http.StatusNotModified
  8144. // was returned.
  8145. func (c *ProjectsRegionsWorkflowTemplatesGetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  8146. gensupport.SetOptions(c.urlParams_, opts...)
  8147. res, err := c.doRequest("json")
  8148. if res != nil && res.StatusCode == http.StatusNotModified {
  8149. if res.Body != nil {
  8150. res.Body.Close()
  8151. }
  8152. return nil, &googleapi.Error{
  8153. Code: res.StatusCode,
  8154. Header: res.Header,
  8155. }
  8156. }
  8157. if err != nil {
  8158. return nil, err
  8159. }
  8160. defer googleapi.CloseBody(res)
  8161. if err := googleapi.CheckResponse(res); err != nil {
  8162. return nil, err
  8163. }
  8164. ret := &Policy{
  8165. ServerResponse: googleapi.ServerResponse{
  8166. Header: res.Header,
  8167. HTTPStatusCode: res.StatusCode,
  8168. },
  8169. }
  8170. target := &ret
  8171. if err := gensupport.DecodeResponse(target, res); err != nil {
  8172. return nil, err
  8173. }
  8174. return ret, nil
  8175. // {
  8176. // "description": "Gets the access control policy for a resource. Returns an empty policy if the resource exists and does not have a policy set.",
  8177. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:getIamPolicy",
  8178. // "httpMethod": "GET",
  8179. // "id": "dataproc.projects.regions.workflowTemplates.getIamPolicy",
  8180. // "parameterOrder": [
  8181. // "resource"
  8182. // ],
  8183. // "parameters": {
  8184. // "resource": {
  8185. // "description": "REQUIRED: The resource for which the policy is being requested. See the operation documentation for the appropriate value for this field.",
  8186. // "location": "path",
  8187. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  8188. // "required": true,
  8189. // "type": "string"
  8190. // }
  8191. // },
  8192. // "path": "v1beta2/{+resource}:getIamPolicy",
  8193. // "response": {
  8194. // "$ref": "Policy"
  8195. // },
  8196. // "scopes": [
  8197. // "https://www.googleapis.com/auth/cloud-platform"
  8198. // ]
  8199. // }
  8200. }
  8201. // method id "dataproc.projects.regions.workflowTemplates.instantiate":
  8202. type ProjectsRegionsWorkflowTemplatesInstantiateCall struct {
  8203. s *Service
  8204. name string
  8205. instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest
  8206. urlParams_ gensupport.URLParams
  8207. ctx_ context.Context
  8208. header_ http.Header
  8209. }
  8210. // Instantiate: Instantiates a template and begins execution.The
  8211. // returned Operation can be used to track execution of workflow by
  8212. // polling operations.get. The Operation will complete when entire
  8213. // workflow is finished.The running workflow can be aborted via
  8214. // operations.cancel. This will cause any inflight jobs to be cancelled
  8215. // and workflow-owned clusters to be deleted.The Operation.metadata will
  8216. // be WorkflowMetadata.On successful completion, Operation.response will
  8217. // be Empty.
  8218. func (r *ProjectsRegionsWorkflowTemplatesService) Instantiate(name string, instantiateworkflowtemplaterequest *InstantiateWorkflowTemplateRequest) *ProjectsRegionsWorkflowTemplatesInstantiateCall {
  8219. c := &ProjectsRegionsWorkflowTemplatesInstantiateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8220. c.name = name
  8221. c.instantiateworkflowtemplaterequest = instantiateworkflowtemplaterequest
  8222. return c
  8223. }
  8224. // Fields allows partial responses to be retrieved. See
  8225. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8226. // for more information.
  8227. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesInstantiateCall {
  8228. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8229. return c
  8230. }
  8231. // Context sets the context to be used in this call's Do method. Any
  8232. // pending HTTP request will be aborted if the provided context is
  8233. // canceled.
  8234. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesInstantiateCall {
  8235. c.ctx_ = ctx
  8236. return c
  8237. }
  8238. // Header returns an http.Header that can be modified by the caller to
  8239. // add HTTP headers to the request.
  8240. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Header() http.Header {
  8241. if c.header_ == nil {
  8242. c.header_ = make(http.Header)
  8243. }
  8244. return c.header_
  8245. }
  8246. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) doRequest(alt string) (*http.Response, error) {
  8247. reqHeaders := make(http.Header)
  8248. for k, v := range c.header_ {
  8249. reqHeaders[k] = v
  8250. }
  8251. reqHeaders.Set("User-Agent", c.s.userAgent())
  8252. var body io.Reader = nil
  8253. body, err := googleapi.WithoutDataWrapper.JSONReader(c.instantiateworkflowtemplaterequest)
  8254. if err != nil {
  8255. return nil, err
  8256. }
  8257. reqHeaders.Set("Content-Type", "application/json")
  8258. c.urlParams_.Set("alt", alt)
  8259. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}:instantiate")
  8260. urls += "?" + c.urlParams_.Encode()
  8261. req, _ := http.NewRequest("POST", urls, body)
  8262. req.Header = reqHeaders
  8263. googleapi.Expand(req.URL, map[string]string{
  8264. "name": c.name,
  8265. })
  8266. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8267. }
  8268. // Do executes the "dataproc.projects.regions.workflowTemplates.instantiate" call.
  8269. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8270. // status code is an error. Response headers are in either
  8271. // *Operation.ServerResponse.Header or (if a response was returned at
  8272. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8273. // to check whether the returned error was because
  8274. // http.StatusNotModified was returned.
  8275. func (c *ProjectsRegionsWorkflowTemplatesInstantiateCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8276. gensupport.SetOptions(c.urlParams_, opts...)
  8277. res, err := c.doRequest("json")
  8278. if res != nil && res.StatusCode == http.StatusNotModified {
  8279. if res.Body != nil {
  8280. res.Body.Close()
  8281. }
  8282. return nil, &googleapi.Error{
  8283. Code: res.StatusCode,
  8284. Header: res.Header,
  8285. }
  8286. }
  8287. if err != nil {
  8288. return nil, err
  8289. }
  8290. defer googleapi.CloseBody(res)
  8291. if err := googleapi.CheckResponse(res); err != nil {
  8292. return nil, err
  8293. }
  8294. ret := &Operation{
  8295. ServerResponse: googleapi.ServerResponse{
  8296. Header: res.Header,
  8297. HTTPStatusCode: res.StatusCode,
  8298. },
  8299. }
  8300. target := &ret
  8301. if err := gensupport.DecodeResponse(target, res); err != nil {
  8302. return nil, err
  8303. }
  8304. return ret, nil
  8305. // {
  8306. // "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.",
  8307. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:instantiate",
  8308. // "httpMethod": "POST",
  8309. // "id": "dataproc.projects.regions.workflowTemplates.instantiate",
  8310. // "parameterOrder": [
  8311. // "name"
  8312. // ],
  8313. // "parameters": {
  8314. // "name": {
  8315. // "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}",
  8316. // "location": "path",
  8317. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  8318. // "required": true,
  8319. // "type": "string"
  8320. // }
  8321. // },
  8322. // "path": "v1beta2/{+name}:instantiate",
  8323. // "request": {
  8324. // "$ref": "InstantiateWorkflowTemplateRequest"
  8325. // },
  8326. // "response": {
  8327. // "$ref": "Operation"
  8328. // },
  8329. // "scopes": [
  8330. // "https://www.googleapis.com/auth/cloud-platform"
  8331. // ]
  8332. // }
  8333. }
  8334. // method id "dataproc.projects.regions.workflowTemplates.instantiateInline":
  8335. type ProjectsRegionsWorkflowTemplatesInstantiateInlineCall struct {
  8336. s *Service
  8337. parent string
  8338. workflowtemplate *WorkflowTemplate
  8339. urlParams_ gensupport.URLParams
  8340. ctx_ context.Context
  8341. header_ http.Header
  8342. }
  8343. // InstantiateInline: Instantiates a template and begins execution.This
  8344. // method is equivalent to executing the sequence
  8345. // CreateWorkflowTemplate, InstantiateWorkflowTemplate,
  8346. // DeleteWorkflowTemplate.The returned Operation can be used to track
  8347. // execution of workflow by polling operations.get. The Operation will
  8348. // complete when entire workflow is finished.The running workflow can be
  8349. // aborted via operations.cancel. This will cause any inflight jobs to
  8350. // be cancelled and workflow-owned clusters to be deleted.The
  8351. // Operation.metadata will be WorkflowMetadata.On successful completion,
  8352. // Operation.response will be Empty.
  8353. func (r *ProjectsRegionsWorkflowTemplatesService) InstantiateInline(parent string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall {
  8354. c := &ProjectsRegionsWorkflowTemplatesInstantiateInlineCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8355. c.parent = parent
  8356. c.workflowtemplate = workflowtemplate
  8357. return c
  8358. }
  8359. // InstanceId sets the optional parameter "instanceId": A tag that
  8360. // prevents multiple concurrent workflow instances with the same tag
  8361. // from running. This mitigates risk of concurrent instances started due
  8362. // to retries.It is recommended to always set this value to a UUID
  8363. // (https://en.wikipedia.org/wiki/Universally_unique_identifier).The tag
  8364. // must contain only letters (a-z, A-Z), numbers (0-9), underscores (_),
  8365. // and hyphens (-). The maximum length is 40 characters.
  8366. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) InstanceId(instanceId string) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall {
  8367. c.urlParams_.Set("instanceId", instanceId)
  8368. return c
  8369. }
  8370. // Fields allows partial responses to be retrieved. See
  8371. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8372. // for more information.
  8373. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall {
  8374. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8375. return c
  8376. }
  8377. // Context sets the context to be used in this call's Do method. Any
  8378. // pending HTTP request will be aborted if the provided context is
  8379. // canceled.
  8380. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall {
  8381. c.ctx_ = ctx
  8382. return c
  8383. }
  8384. // Header returns an http.Header that can be modified by the caller to
  8385. // add HTTP headers to the request.
  8386. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Header() http.Header {
  8387. if c.header_ == nil {
  8388. c.header_ = make(http.Header)
  8389. }
  8390. return c.header_
  8391. }
  8392. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) doRequest(alt string) (*http.Response, error) {
  8393. reqHeaders := make(http.Header)
  8394. for k, v := range c.header_ {
  8395. reqHeaders[k] = v
  8396. }
  8397. reqHeaders.Set("User-Agent", c.s.userAgent())
  8398. var body io.Reader = nil
  8399. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  8400. if err != nil {
  8401. return nil, err
  8402. }
  8403. reqHeaders.Set("Content-Type", "application/json")
  8404. c.urlParams_.Set("alt", alt)
  8405. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates:instantiateInline")
  8406. urls += "?" + c.urlParams_.Encode()
  8407. req, _ := http.NewRequest("POST", urls, body)
  8408. req.Header = reqHeaders
  8409. googleapi.Expand(req.URL, map[string]string{
  8410. "parent": c.parent,
  8411. })
  8412. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8413. }
  8414. // Do executes the "dataproc.projects.regions.workflowTemplates.instantiateInline" call.
  8415. // Exactly one of *Operation or error will be non-nil. Any non-2xx
  8416. // status code is an error. Response headers are in either
  8417. // *Operation.ServerResponse.Header or (if a response was returned at
  8418. // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified
  8419. // to check whether the returned error was because
  8420. // http.StatusNotModified was returned.
  8421. func (c *ProjectsRegionsWorkflowTemplatesInstantiateInlineCall) Do(opts ...googleapi.CallOption) (*Operation, error) {
  8422. gensupport.SetOptions(c.urlParams_, opts...)
  8423. res, err := c.doRequest("json")
  8424. if res != nil && res.StatusCode == http.StatusNotModified {
  8425. if res.Body != nil {
  8426. res.Body.Close()
  8427. }
  8428. return nil, &googleapi.Error{
  8429. Code: res.StatusCode,
  8430. Header: res.Header,
  8431. }
  8432. }
  8433. if err != nil {
  8434. return nil, err
  8435. }
  8436. defer googleapi.CloseBody(res)
  8437. if err := googleapi.CheckResponse(res); err != nil {
  8438. return nil, err
  8439. }
  8440. ret := &Operation{
  8441. ServerResponse: googleapi.ServerResponse{
  8442. Header: res.Header,
  8443. HTTPStatusCode: res.StatusCode,
  8444. },
  8445. }
  8446. target := &ret
  8447. if err := gensupport.DecodeResponse(target, res); err != nil {
  8448. return nil, err
  8449. }
  8450. return ret, nil
  8451. // {
  8452. // "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.",
  8453. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates:instantiateInline",
  8454. // "httpMethod": "POST",
  8455. // "id": "dataproc.projects.regions.workflowTemplates.instantiateInline",
  8456. // "parameterOrder": [
  8457. // "parent"
  8458. // ],
  8459. // "parameters": {
  8460. // "instanceId": {
  8461. // "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.",
  8462. // "location": "query",
  8463. // "type": "string"
  8464. // },
  8465. // "parent": {
  8466. // "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}",
  8467. // "location": "path",
  8468. // "pattern": "^projects/[^/]+/regions/[^/]+$",
  8469. // "required": true,
  8470. // "type": "string"
  8471. // }
  8472. // },
  8473. // "path": "v1beta2/{+parent}/workflowTemplates:instantiateInline",
  8474. // "request": {
  8475. // "$ref": "WorkflowTemplate"
  8476. // },
  8477. // "response": {
  8478. // "$ref": "Operation"
  8479. // },
  8480. // "scopes": [
  8481. // "https://www.googleapis.com/auth/cloud-platform"
  8482. // ]
  8483. // }
  8484. }
  8485. // method id "dataproc.projects.regions.workflowTemplates.list":
  8486. type ProjectsRegionsWorkflowTemplatesListCall struct {
  8487. s *Service
  8488. parent string
  8489. urlParams_ gensupport.URLParams
  8490. ifNoneMatch_ string
  8491. ctx_ context.Context
  8492. header_ http.Header
  8493. }
  8494. // List: Lists workflows that match the specified filter in the request.
  8495. func (r *ProjectsRegionsWorkflowTemplatesService) List(parent string) *ProjectsRegionsWorkflowTemplatesListCall {
  8496. c := &ProjectsRegionsWorkflowTemplatesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8497. c.parent = parent
  8498. return c
  8499. }
  8500. // PageSize sets the optional parameter "pageSize": The maximum number
  8501. // of results to return in each response.
  8502. func (c *ProjectsRegionsWorkflowTemplatesListCall) PageSize(pageSize int64) *ProjectsRegionsWorkflowTemplatesListCall {
  8503. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8504. return c
  8505. }
  8506. // PageToken sets the optional parameter "pageToken": The page token,
  8507. // returned by a previous call, to request the next page of results.
  8508. func (c *ProjectsRegionsWorkflowTemplatesListCall) PageToken(pageToken string) *ProjectsRegionsWorkflowTemplatesListCall {
  8509. c.urlParams_.Set("pageToken", pageToken)
  8510. return c
  8511. }
  8512. // Fields allows partial responses to be retrieved. See
  8513. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8514. // for more information.
  8515. func (c *ProjectsRegionsWorkflowTemplatesListCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesListCall {
  8516. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8517. return c
  8518. }
  8519. // IfNoneMatch sets the optional parameter which makes the operation
  8520. // fail if the object's ETag matches the given value. This is useful for
  8521. // getting updates only after the object has changed since the last
  8522. // request. Use googleapi.IsNotModified to check whether the response
  8523. // error from Do is the result of In-None-Match.
  8524. func (c *ProjectsRegionsWorkflowTemplatesListCall) IfNoneMatch(entityTag string) *ProjectsRegionsWorkflowTemplatesListCall {
  8525. c.ifNoneMatch_ = entityTag
  8526. return c
  8527. }
  8528. // Context sets the context to be used in this call's Do method. Any
  8529. // pending HTTP request will be aborted if the provided context is
  8530. // canceled.
  8531. func (c *ProjectsRegionsWorkflowTemplatesListCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesListCall {
  8532. c.ctx_ = ctx
  8533. return c
  8534. }
  8535. // Header returns an http.Header that can be modified by the caller to
  8536. // add HTTP headers to the request.
  8537. func (c *ProjectsRegionsWorkflowTemplatesListCall) Header() http.Header {
  8538. if c.header_ == nil {
  8539. c.header_ = make(http.Header)
  8540. }
  8541. return c.header_
  8542. }
  8543. func (c *ProjectsRegionsWorkflowTemplatesListCall) doRequest(alt string) (*http.Response, error) {
  8544. reqHeaders := make(http.Header)
  8545. for k, v := range c.header_ {
  8546. reqHeaders[k] = v
  8547. }
  8548. reqHeaders.Set("User-Agent", c.s.userAgent())
  8549. if c.ifNoneMatch_ != "" {
  8550. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8551. }
  8552. var body io.Reader = nil
  8553. c.urlParams_.Set("alt", alt)
  8554. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+parent}/workflowTemplates")
  8555. urls += "?" + c.urlParams_.Encode()
  8556. req, _ := http.NewRequest("GET", urls, body)
  8557. req.Header = reqHeaders
  8558. googleapi.Expand(req.URL, map[string]string{
  8559. "parent": c.parent,
  8560. })
  8561. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8562. }
  8563. // Do executes the "dataproc.projects.regions.workflowTemplates.list" call.
  8564. // Exactly one of *ListWorkflowTemplatesResponse or error will be
  8565. // non-nil. Any non-2xx status code is an error. Response headers are in
  8566. // either *ListWorkflowTemplatesResponse.ServerResponse.Header or (if a
  8567. // response was returned at all) in error.(*googleapi.Error).Header. Use
  8568. // googleapi.IsNotModified to check whether the returned error was
  8569. // because http.StatusNotModified was returned.
  8570. func (c *ProjectsRegionsWorkflowTemplatesListCall) Do(opts ...googleapi.CallOption) (*ListWorkflowTemplatesResponse, error) {
  8571. gensupport.SetOptions(c.urlParams_, opts...)
  8572. res, err := c.doRequest("json")
  8573. if res != nil && res.StatusCode == http.StatusNotModified {
  8574. if res.Body != nil {
  8575. res.Body.Close()
  8576. }
  8577. return nil, &googleapi.Error{
  8578. Code: res.StatusCode,
  8579. Header: res.Header,
  8580. }
  8581. }
  8582. if err != nil {
  8583. return nil, err
  8584. }
  8585. defer googleapi.CloseBody(res)
  8586. if err := googleapi.CheckResponse(res); err != nil {
  8587. return nil, err
  8588. }
  8589. ret := &ListWorkflowTemplatesResponse{
  8590. ServerResponse: googleapi.ServerResponse{
  8591. Header: res.Header,
  8592. HTTPStatusCode: res.StatusCode,
  8593. },
  8594. }
  8595. target := &ret
  8596. if err := gensupport.DecodeResponse(target, res); err != nil {
  8597. return nil, err
  8598. }
  8599. return ret, nil
  8600. // {
  8601. // "description": "Lists workflows that match the specified filter in the request.",
  8602. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates",
  8603. // "httpMethod": "GET",
  8604. // "id": "dataproc.projects.regions.workflowTemplates.list",
  8605. // "parameterOrder": [
  8606. // "parent"
  8607. // ],
  8608. // "parameters": {
  8609. // "pageSize": {
  8610. // "description": "Optional. The maximum number of results to return in each response.",
  8611. // "format": "int32",
  8612. // "location": "query",
  8613. // "type": "integer"
  8614. // },
  8615. // "pageToken": {
  8616. // "description": "Optional. The page token, returned by a previous call, to request the next page of results.",
  8617. // "location": "query",
  8618. // "type": "string"
  8619. // },
  8620. // "parent": {
  8621. // "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}",
  8622. // "location": "path",
  8623. // "pattern": "^projects/[^/]+/regions/[^/]+$",
  8624. // "required": true,
  8625. // "type": "string"
  8626. // }
  8627. // },
  8628. // "path": "v1beta2/{+parent}/workflowTemplates",
  8629. // "response": {
  8630. // "$ref": "ListWorkflowTemplatesResponse"
  8631. // },
  8632. // "scopes": [
  8633. // "https://www.googleapis.com/auth/cloud-platform"
  8634. // ]
  8635. // }
  8636. }
  8637. // Pages invokes f for each page of results.
  8638. // A non-nil error returned from f will halt the iteration.
  8639. // The provided context supersedes any context provided to the Context method.
  8640. func (c *ProjectsRegionsWorkflowTemplatesListCall) Pages(ctx context.Context, f func(*ListWorkflowTemplatesResponse) error) error {
  8641. c.ctx_ = ctx
  8642. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  8643. for {
  8644. x, err := c.Do()
  8645. if err != nil {
  8646. return err
  8647. }
  8648. if err := f(x); err != nil {
  8649. return err
  8650. }
  8651. if x.NextPageToken == "" {
  8652. return nil
  8653. }
  8654. c.PageToken(x.NextPageToken)
  8655. }
  8656. }
  8657. // method id "dataproc.projects.regions.workflowTemplates.setIamPolicy":
  8658. type ProjectsRegionsWorkflowTemplatesSetIamPolicyCall struct {
  8659. s *Service
  8660. resource string
  8661. setiampolicyrequest *SetIamPolicyRequest
  8662. urlParams_ gensupport.URLParams
  8663. ctx_ context.Context
  8664. header_ http.Header
  8665. }
  8666. // SetIamPolicy: Sets the access control policy on the specified
  8667. // resource. Replaces any existing policy.
  8668. func (r *ProjectsRegionsWorkflowTemplatesService) SetIamPolicy(resource string, setiampolicyrequest *SetIamPolicyRequest) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall {
  8669. c := &ProjectsRegionsWorkflowTemplatesSetIamPolicyCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8670. c.resource = resource
  8671. c.setiampolicyrequest = setiampolicyrequest
  8672. return c
  8673. }
  8674. // Fields allows partial responses to be retrieved. See
  8675. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8676. // for more information.
  8677. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall {
  8678. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8679. return c
  8680. }
  8681. // Context sets the context to be used in this call's Do method. Any
  8682. // pending HTTP request will be aborted if the provided context is
  8683. // canceled.
  8684. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall {
  8685. c.ctx_ = ctx
  8686. return c
  8687. }
  8688. // Header returns an http.Header that can be modified by the caller to
  8689. // add HTTP headers to the request.
  8690. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Header() http.Header {
  8691. if c.header_ == nil {
  8692. c.header_ = make(http.Header)
  8693. }
  8694. return c.header_
  8695. }
  8696. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) doRequest(alt string) (*http.Response, error) {
  8697. reqHeaders := make(http.Header)
  8698. for k, v := range c.header_ {
  8699. reqHeaders[k] = v
  8700. }
  8701. reqHeaders.Set("User-Agent", c.s.userAgent())
  8702. var body io.Reader = nil
  8703. body, err := googleapi.WithoutDataWrapper.JSONReader(c.setiampolicyrequest)
  8704. if err != nil {
  8705. return nil, err
  8706. }
  8707. reqHeaders.Set("Content-Type", "application/json")
  8708. c.urlParams_.Set("alt", alt)
  8709. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:setIamPolicy")
  8710. urls += "?" + c.urlParams_.Encode()
  8711. req, _ := http.NewRequest("POST", urls, body)
  8712. req.Header = reqHeaders
  8713. googleapi.Expand(req.URL, map[string]string{
  8714. "resource": c.resource,
  8715. })
  8716. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8717. }
  8718. // Do executes the "dataproc.projects.regions.workflowTemplates.setIamPolicy" call.
  8719. // Exactly one of *Policy or error will be non-nil. Any non-2xx status
  8720. // code is an error. Response headers are in either
  8721. // *Policy.ServerResponse.Header or (if a response was returned at all)
  8722. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8723. // check whether the returned error was because http.StatusNotModified
  8724. // was returned.
  8725. func (c *ProjectsRegionsWorkflowTemplatesSetIamPolicyCall) Do(opts ...googleapi.CallOption) (*Policy, error) {
  8726. gensupport.SetOptions(c.urlParams_, opts...)
  8727. res, err := c.doRequest("json")
  8728. if res != nil && res.StatusCode == http.StatusNotModified {
  8729. if res.Body != nil {
  8730. res.Body.Close()
  8731. }
  8732. return nil, &googleapi.Error{
  8733. Code: res.StatusCode,
  8734. Header: res.Header,
  8735. }
  8736. }
  8737. if err != nil {
  8738. return nil, err
  8739. }
  8740. defer googleapi.CloseBody(res)
  8741. if err := googleapi.CheckResponse(res); err != nil {
  8742. return nil, err
  8743. }
  8744. ret := &Policy{
  8745. ServerResponse: googleapi.ServerResponse{
  8746. Header: res.Header,
  8747. HTTPStatusCode: res.StatusCode,
  8748. },
  8749. }
  8750. target := &ret
  8751. if err := gensupport.DecodeResponse(target, res); err != nil {
  8752. return nil, err
  8753. }
  8754. return ret, nil
  8755. // {
  8756. // "description": "Sets the access control policy on the specified resource. Replaces any existing policy.",
  8757. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:setIamPolicy",
  8758. // "httpMethod": "POST",
  8759. // "id": "dataproc.projects.regions.workflowTemplates.setIamPolicy",
  8760. // "parameterOrder": [
  8761. // "resource"
  8762. // ],
  8763. // "parameters": {
  8764. // "resource": {
  8765. // "description": "REQUIRED: The resource for which the policy is being specified. See the operation documentation for the appropriate value for this field.",
  8766. // "location": "path",
  8767. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  8768. // "required": true,
  8769. // "type": "string"
  8770. // }
  8771. // },
  8772. // "path": "v1beta2/{+resource}:setIamPolicy",
  8773. // "request": {
  8774. // "$ref": "SetIamPolicyRequest"
  8775. // },
  8776. // "response": {
  8777. // "$ref": "Policy"
  8778. // },
  8779. // "scopes": [
  8780. // "https://www.googleapis.com/auth/cloud-platform"
  8781. // ]
  8782. // }
  8783. }
  8784. // method id "dataproc.projects.regions.workflowTemplates.testIamPermissions":
  8785. type ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall struct {
  8786. s *Service
  8787. resource string
  8788. testiampermissionsrequest *TestIamPermissionsRequest
  8789. urlParams_ gensupport.URLParams
  8790. ctx_ context.Context
  8791. header_ http.Header
  8792. }
  8793. // TestIamPermissions: Returns permissions that a caller has on the
  8794. // specified resource. If the resource does not exist, this will return
  8795. // an empty set of permissions, not a NOT_FOUND error.Note: This
  8796. // operation is designed to be used for building permission-aware UIs
  8797. // and command-line tools, not for authorization checking. This
  8798. // operation may "fail open" without warning.
  8799. func (r *ProjectsRegionsWorkflowTemplatesService) TestIamPermissions(resource string, testiampermissionsrequest *TestIamPermissionsRequest) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall {
  8800. c := &ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8801. c.resource = resource
  8802. c.testiampermissionsrequest = testiampermissionsrequest
  8803. return c
  8804. }
  8805. // Fields allows partial responses to be retrieved. See
  8806. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8807. // for more information.
  8808. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall {
  8809. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8810. return c
  8811. }
  8812. // Context sets the context to be used in this call's Do method. Any
  8813. // pending HTTP request will be aborted if the provided context is
  8814. // canceled.
  8815. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall {
  8816. c.ctx_ = ctx
  8817. return c
  8818. }
  8819. // Header returns an http.Header that can be modified by the caller to
  8820. // add HTTP headers to the request.
  8821. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Header() http.Header {
  8822. if c.header_ == nil {
  8823. c.header_ = make(http.Header)
  8824. }
  8825. return c.header_
  8826. }
  8827. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) doRequest(alt string) (*http.Response, error) {
  8828. reqHeaders := make(http.Header)
  8829. for k, v := range c.header_ {
  8830. reqHeaders[k] = v
  8831. }
  8832. reqHeaders.Set("User-Agent", c.s.userAgent())
  8833. var body io.Reader = nil
  8834. body, err := googleapi.WithoutDataWrapper.JSONReader(c.testiampermissionsrequest)
  8835. if err != nil {
  8836. return nil, err
  8837. }
  8838. reqHeaders.Set("Content-Type", "application/json")
  8839. c.urlParams_.Set("alt", alt)
  8840. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+resource}:testIamPermissions")
  8841. urls += "?" + c.urlParams_.Encode()
  8842. req, _ := http.NewRequest("POST", urls, body)
  8843. req.Header = reqHeaders
  8844. googleapi.Expand(req.URL, map[string]string{
  8845. "resource": c.resource,
  8846. })
  8847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8848. }
  8849. // Do executes the "dataproc.projects.regions.workflowTemplates.testIamPermissions" call.
  8850. // Exactly one of *TestIamPermissionsResponse or error will be non-nil.
  8851. // Any non-2xx status code is an error. Response headers are in either
  8852. // *TestIamPermissionsResponse.ServerResponse.Header or (if a response
  8853. // was returned at all) in error.(*googleapi.Error).Header. Use
  8854. // googleapi.IsNotModified to check whether the returned error was
  8855. // because http.StatusNotModified was returned.
  8856. func (c *ProjectsRegionsWorkflowTemplatesTestIamPermissionsCall) Do(opts ...googleapi.CallOption) (*TestIamPermissionsResponse, error) {
  8857. gensupport.SetOptions(c.urlParams_, opts...)
  8858. res, err := c.doRequest("json")
  8859. if res != nil && res.StatusCode == http.StatusNotModified {
  8860. if res.Body != nil {
  8861. res.Body.Close()
  8862. }
  8863. return nil, &googleapi.Error{
  8864. Code: res.StatusCode,
  8865. Header: res.Header,
  8866. }
  8867. }
  8868. if err != nil {
  8869. return nil, err
  8870. }
  8871. defer googleapi.CloseBody(res)
  8872. if err := googleapi.CheckResponse(res); err != nil {
  8873. return nil, err
  8874. }
  8875. ret := &TestIamPermissionsResponse{
  8876. ServerResponse: googleapi.ServerResponse{
  8877. Header: res.Header,
  8878. HTTPStatusCode: res.StatusCode,
  8879. },
  8880. }
  8881. target := &ret
  8882. if err := gensupport.DecodeResponse(target, res); err != nil {
  8883. return nil, err
  8884. }
  8885. return ret, nil
  8886. // {
  8887. // "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.",
  8888. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}:testIamPermissions",
  8889. // "httpMethod": "POST",
  8890. // "id": "dataproc.projects.regions.workflowTemplates.testIamPermissions",
  8891. // "parameterOrder": [
  8892. // "resource"
  8893. // ],
  8894. // "parameters": {
  8895. // "resource": {
  8896. // "description": "REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field.",
  8897. // "location": "path",
  8898. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  8899. // "required": true,
  8900. // "type": "string"
  8901. // }
  8902. // },
  8903. // "path": "v1beta2/{+resource}:testIamPermissions",
  8904. // "request": {
  8905. // "$ref": "TestIamPermissionsRequest"
  8906. // },
  8907. // "response": {
  8908. // "$ref": "TestIamPermissionsResponse"
  8909. // },
  8910. // "scopes": [
  8911. // "https://www.googleapis.com/auth/cloud-platform"
  8912. // ]
  8913. // }
  8914. }
  8915. // method id "dataproc.projects.regions.workflowTemplates.update":
  8916. type ProjectsRegionsWorkflowTemplatesUpdateCall struct {
  8917. s *Service
  8918. name string
  8919. workflowtemplate *WorkflowTemplate
  8920. urlParams_ gensupport.URLParams
  8921. ctx_ context.Context
  8922. header_ http.Header
  8923. }
  8924. // Update: Updates (replaces) workflow template. The updated template
  8925. // must contain version that matches the current server version.
  8926. func (r *ProjectsRegionsWorkflowTemplatesService) Update(name string, workflowtemplate *WorkflowTemplate) *ProjectsRegionsWorkflowTemplatesUpdateCall {
  8927. c := &ProjectsRegionsWorkflowTemplatesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8928. c.name = name
  8929. c.workflowtemplate = workflowtemplate
  8930. return c
  8931. }
  8932. // Fields allows partial responses to be retrieved. See
  8933. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  8934. // for more information.
  8935. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Fields(s ...googleapi.Field) *ProjectsRegionsWorkflowTemplatesUpdateCall {
  8936. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8937. return c
  8938. }
  8939. // Context sets the context to be used in this call's Do method. Any
  8940. // pending HTTP request will be aborted if the provided context is
  8941. // canceled.
  8942. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Context(ctx context.Context) *ProjectsRegionsWorkflowTemplatesUpdateCall {
  8943. c.ctx_ = ctx
  8944. return c
  8945. }
  8946. // Header returns an http.Header that can be modified by the caller to
  8947. // add HTTP headers to the request.
  8948. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Header() http.Header {
  8949. if c.header_ == nil {
  8950. c.header_ = make(http.Header)
  8951. }
  8952. return c.header_
  8953. }
  8954. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) doRequest(alt string) (*http.Response, error) {
  8955. reqHeaders := make(http.Header)
  8956. for k, v := range c.header_ {
  8957. reqHeaders[k] = v
  8958. }
  8959. reqHeaders.Set("User-Agent", c.s.userAgent())
  8960. var body io.Reader = nil
  8961. body, err := googleapi.WithoutDataWrapper.JSONReader(c.workflowtemplate)
  8962. if err != nil {
  8963. return nil, err
  8964. }
  8965. reqHeaders.Set("Content-Type", "application/json")
  8966. c.urlParams_.Set("alt", alt)
  8967. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta2/{+name}")
  8968. urls += "?" + c.urlParams_.Encode()
  8969. req, _ := http.NewRequest("PUT", urls, body)
  8970. req.Header = reqHeaders
  8971. googleapi.Expand(req.URL, map[string]string{
  8972. "name": c.name,
  8973. })
  8974. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8975. }
  8976. // Do executes the "dataproc.projects.regions.workflowTemplates.update" call.
  8977. // Exactly one of *WorkflowTemplate or error will be non-nil. Any
  8978. // non-2xx status code is an error. Response headers are in either
  8979. // *WorkflowTemplate.ServerResponse.Header or (if a response was
  8980. // returned at all) in error.(*googleapi.Error).Header. Use
  8981. // googleapi.IsNotModified to check whether the returned error was
  8982. // because http.StatusNotModified was returned.
  8983. func (c *ProjectsRegionsWorkflowTemplatesUpdateCall) Do(opts ...googleapi.CallOption) (*WorkflowTemplate, error) {
  8984. gensupport.SetOptions(c.urlParams_, opts...)
  8985. res, err := c.doRequest("json")
  8986. if res != nil && res.StatusCode == http.StatusNotModified {
  8987. if res.Body != nil {
  8988. res.Body.Close()
  8989. }
  8990. return nil, &googleapi.Error{
  8991. Code: res.StatusCode,
  8992. Header: res.Header,
  8993. }
  8994. }
  8995. if err != nil {
  8996. return nil, err
  8997. }
  8998. defer googleapi.CloseBody(res)
  8999. if err := googleapi.CheckResponse(res); err != nil {
  9000. return nil, err
  9001. }
  9002. ret := &WorkflowTemplate{
  9003. ServerResponse: googleapi.ServerResponse{
  9004. Header: res.Header,
  9005. HTTPStatusCode: res.StatusCode,
  9006. },
  9007. }
  9008. target := &ret
  9009. if err := gensupport.DecodeResponse(target, res); err != nil {
  9010. return nil, err
  9011. }
  9012. return ret, nil
  9013. // {
  9014. // "description": "Updates (replaces) workflow template. The updated template must contain version that matches the current server version.",
  9015. // "flatPath": "v1beta2/projects/{projectsId}/regions/{regionsId}/workflowTemplates/{workflowTemplatesId}",
  9016. // "httpMethod": "PUT",
  9017. // "id": "dataproc.projects.regions.workflowTemplates.update",
  9018. // "parameterOrder": [
  9019. // "name"
  9020. // ],
  9021. // "parameters": {
  9022. // "name": {
  9023. // "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}",
  9024. // "location": "path",
  9025. // "pattern": "^projects/[^/]+/regions/[^/]+/workflowTemplates/[^/]+$",
  9026. // "required": true,
  9027. // "type": "string"
  9028. // }
  9029. // },
  9030. // "path": "v1beta2/{+name}",
  9031. // "request": {
  9032. // "$ref": "WorkflowTemplate"
  9033. // },
  9034. // "response": {
  9035. // "$ref": "WorkflowTemplate"
  9036. // },
  9037. // "scopes": [
  9038. // "https://www.googleapis.com/auth/cloud-platform"
  9039. // ]
  9040. // }
  9041. }