google_cloud_dataproc_v1/client.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16#![allow(rustdoc::redundant_explicit_links)]
17#![allow(rustdoc::broken_intra_doc_links)]
18
19/// Implements a client for the Cloud Dataproc API.
20///
21/// # Example
22/// ```
23/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
24/// # use google_cloud_dataproc_v1::client::AutoscalingPolicyService;
25/// let client = AutoscalingPolicyService::builder().build().await?;
26/// // use `client` to make requests to the Cloud Dataproc API.
27/// # Ok(()) }
28/// ```
29///
30/// # Service Description
31///
32/// The API interface for managing autoscaling policies in the
33/// Dataproc API.
34///
35/// # Configuration
36///
37/// To configure `AutoscalingPolicyService` use the `with_*` methods in the type returned
38/// by [builder()][AutoscalingPolicyService::builder]. The default configuration should
39/// work for most applications. Common configuration changes include
40///
41/// * [with_endpoint()]: by default this client uses the global default endpoint
42/// (`https://dataproc.googleapis.com`). Applications using regional
43/// endpoints or running in restricted networks (e.g. a network configured
44// with [Private Google Access with VPC Service Controls]) may want to
45/// override this default.
46/// * [with_credentials()]: by default this client uses
47/// [Application Default Credentials]. Applications using custom
48/// authentication may need to override this default.
49///
50/// [with_endpoint()]: super::builder::autoscaling_policy_service::ClientBuilder::with_endpoint
51/// [with_credentials()]: super::builder::autoscaling_policy_service::ClientBuilder::credentials
52/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
53/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
54///
55/// # Pooling and Cloning
56///
57/// `AutoscalingPolicyService` holds a connection pool internally, it is advised to
58/// create one and the reuse it. You do not need to wrap `AutoscalingPolicyService` in
59/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
60/// already uses an `Arc` internally.
61#[derive(Clone, Debug)]
62pub struct AutoscalingPolicyService {
63 inner: std::sync::Arc<dyn super::stub::dynamic::AutoscalingPolicyService>,
64}
65
66impl AutoscalingPolicyService {
67 /// Returns a builder for [AutoscalingPolicyService].
68 ///
69 /// ```
70 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
71 /// # use google_cloud_dataproc_v1::client::AutoscalingPolicyService;
72 /// let client = AutoscalingPolicyService::builder().build().await?;
73 /// # Ok(()) }
74 /// ```
75 pub fn builder() -> super::builder::autoscaling_policy_service::ClientBuilder {
76 crate::new_client_builder(super::builder::autoscaling_policy_service::client::Factory)
77 }
78
79 /// Creates a new client from the provided stub.
80 ///
81 /// The most common case for calling this function is in tests mocking the
82 /// client's behavior.
83 pub fn from_stub<T>(stub: T) -> Self
84 where
85 T: super::stub::AutoscalingPolicyService + 'static,
86 {
87 Self {
88 inner: std::sync::Arc::new(stub),
89 }
90 }
91
92 pub(crate) async fn new(
93 config: gaxi::options::ClientConfig,
94 ) -> crate::ClientBuilderResult<Self> {
95 let inner = Self::build_inner(config).await?;
96 Ok(Self { inner })
97 }
98
99 async fn build_inner(
100 conf: gaxi::options::ClientConfig,
101 ) -> crate::ClientBuilderResult<
102 std::sync::Arc<dyn super::stub::dynamic::AutoscalingPolicyService>,
103 > {
104 if gaxi::options::tracing_enabled(&conf) {
105 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
106 }
107 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
108 }
109
110 async fn build_transport(
111 conf: gaxi::options::ClientConfig,
112 ) -> crate::ClientBuilderResult<impl super::stub::AutoscalingPolicyService> {
113 super::transport::AutoscalingPolicyService::new(conf).await
114 }
115
116 async fn build_with_tracing(
117 conf: gaxi::options::ClientConfig,
118 ) -> crate::ClientBuilderResult<impl super::stub::AutoscalingPolicyService> {
119 Self::build_transport(conf)
120 .await
121 .map(super::tracing::AutoscalingPolicyService::new)
122 }
123
124 /// Creates new autoscaling policy.
125 pub fn create_autoscaling_policy(
126 &self,
127 ) -> super::builder::autoscaling_policy_service::CreateAutoscalingPolicy {
128 super::builder::autoscaling_policy_service::CreateAutoscalingPolicy::new(self.inner.clone())
129 }
130
131 /// Updates (replaces) autoscaling policy.
132 ///
133 /// Disabled check for update_mask, because all updates will be full
134 /// replacements.
135 pub fn update_autoscaling_policy(
136 &self,
137 ) -> super::builder::autoscaling_policy_service::UpdateAutoscalingPolicy {
138 super::builder::autoscaling_policy_service::UpdateAutoscalingPolicy::new(self.inner.clone())
139 }
140
141 /// Retrieves autoscaling policy.
142 pub fn get_autoscaling_policy(
143 &self,
144 ) -> super::builder::autoscaling_policy_service::GetAutoscalingPolicy {
145 super::builder::autoscaling_policy_service::GetAutoscalingPolicy::new(self.inner.clone())
146 }
147
148 /// Lists autoscaling policies in the project.
149 pub fn list_autoscaling_policies(
150 &self,
151 ) -> super::builder::autoscaling_policy_service::ListAutoscalingPolicies {
152 super::builder::autoscaling_policy_service::ListAutoscalingPolicies::new(self.inner.clone())
153 }
154
155 /// Deletes an autoscaling policy. It is an error to delete an autoscaling
156 /// policy that is in use by one or more clusters.
157 pub fn delete_autoscaling_policy(
158 &self,
159 ) -> super::builder::autoscaling_policy_service::DeleteAutoscalingPolicy {
160 super::builder::autoscaling_policy_service::DeleteAutoscalingPolicy::new(self.inner.clone())
161 }
162
163 /// Sets the access control policy on the specified resource. Replaces
164 /// any existing policy.
165 ///
166 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
167 /// errors.
168 pub fn set_iam_policy(&self) -> super::builder::autoscaling_policy_service::SetIamPolicy {
169 super::builder::autoscaling_policy_service::SetIamPolicy::new(self.inner.clone())
170 }
171
172 /// Gets the access control policy for a resource. Returns an empty policy
173 /// if the resource exists and does not have a policy set.
174 pub fn get_iam_policy(&self) -> super::builder::autoscaling_policy_service::GetIamPolicy {
175 super::builder::autoscaling_policy_service::GetIamPolicy::new(self.inner.clone())
176 }
177
178 /// Returns permissions that a caller has on the specified resource. If the
179 /// resource does not exist, this will return an empty set of
180 /// permissions, not a `NOT_FOUND` error.
181 ///
182 /// Note: This operation is designed to be used for building
183 /// permission-aware UIs and command-line tools, not for authorization
184 /// checking. This operation may "fail open" without warning.
185 pub fn test_iam_permissions(
186 &self,
187 ) -> super::builder::autoscaling_policy_service::TestIamPermissions {
188 super::builder::autoscaling_policy_service::TestIamPermissions::new(self.inner.clone())
189 }
190
191 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
192 ///
193 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
194 pub fn list_operations(&self) -> super::builder::autoscaling_policy_service::ListOperations {
195 super::builder::autoscaling_policy_service::ListOperations::new(self.inner.clone())
196 }
197
198 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
199 ///
200 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
201 pub fn get_operation(&self) -> super::builder::autoscaling_policy_service::GetOperation {
202 super::builder::autoscaling_policy_service::GetOperation::new(self.inner.clone())
203 }
204
205 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
206 ///
207 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
208 pub fn delete_operation(&self) -> super::builder::autoscaling_policy_service::DeleteOperation {
209 super::builder::autoscaling_policy_service::DeleteOperation::new(self.inner.clone())
210 }
211
212 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
213 ///
214 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
215 pub fn cancel_operation(&self) -> super::builder::autoscaling_policy_service::CancelOperation {
216 super::builder::autoscaling_policy_service::CancelOperation::new(self.inner.clone())
217 }
218}
219
220/// Implements a client for the Cloud Dataproc API.
221///
222/// # Example
223/// ```
224/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
225/// # use google_cloud_dataproc_v1::client::BatchController;
226/// let client = BatchController::builder().build().await?;
227/// // use `client` to make requests to the Cloud Dataproc API.
228/// # Ok(()) }
229/// ```
230///
231/// # Service Description
232///
233/// The BatchController provides methods to manage batch workloads.
234///
235/// # Configuration
236///
237/// To configure `BatchController` use the `with_*` methods in the type returned
238/// by [builder()][BatchController::builder]. The default configuration should
239/// work for most applications. Common configuration changes include
240///
241/// * [with_endpoint()]: by default this client uses the global default endpoint
242/// (`https://dataproc.googleapis.com`). Applications using regional
243/// endpoints or running in restricted networks (e.g. a network configured
244// with [Private Google Access with VPC Service Controls]) may want to
245/// override this default.
246/// * [with_credentials()]: by default this client uses
247/// [Application Default Credentials]. Applications using custom
248/// authentication may need to override this default.
249///
250/// [with_endpoint()]: super::builder::batch_controller::ClientBuilder::with_endpoint
251/// [with_credentials()]: super::builder::batch_controller::ClientBuilder::credentials
252/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
253/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
254///
255/// # Pooling and Cloning
256///
257/// `BatchController` holds a connection pool internally, it is advised to
258/// create one and the reuse it. You do not need to wrap `BatchController` in
259/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
260/// already uses an `Arc` internally.
261#[derive(Clone, Debug)]
262pub struct BatchController {
263 inner: std::sync::Arc<dyn super::stub::dynamic::BatchController>,
264}
265
266impl BatchController {
267 /// Returns a builder for [BatchController].
268 ///
269 /// ```
270 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
271 /// # use google_cloud_dataproc_v1::client::BatchController;
272 /// let client = BatchController::builder().build().await?;
273 /// # Ok(()) }
274 /// ```
275 pub fn builder() -> super::builder::batch_controller::ClientBuilder {
276 crate::new_client_builder(super::builder::batch_controller::client::Factory)
277 }
278
279 /// Creates a new client from the provided stub.
280 ///
281 /// The most common case for calling this function is in tests mocking the
282 /// client's behavior.
283 pub fn from_stub<T>(stub: T) -> Self
284 where
285 T: super::stub::BatchController + 'static,
286 {
287 Self {
288 inner: std::sync::Arc::new(stub),
289 }
290 }
291
292 pub(crate) async fn new(
293 config: gaxi::options::ClientConfig,
294 ) -> crate::ClientBuilderResult<Self> {
295 let inner = Self::build_inner(config).await?;
296 Ok(Self { inner })
297 }
298
299 async fn build_inner(
300 conf: gaxi::options::ClientConfig,
301 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BatchController>> {
302 if gaxi::options::tracing_enabled(&conf) {
303 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
304 }
305 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
306 }
307
308 async fn build_transport(
309 conf: gaxi::options::ClientConfig,
310 ) -> crate::ClientBuilderResult<impl super::stub::BatchController> {
311 super::transport::BatchController::new(conf).await
312 }
313
314 async fn build_with_tracing(
315 conf: gaxi::options::ClientConfig,
316 ) -> crate::ClientBuilderResult<impl super::stub::BatchController> {
317 Self::build_transport(conf)
318 .await
319 .map(super::tracing::BatchController::new)
320 }
321
322 /// Creates a batch workload that executes asynchronously.
323 ///
324 /// # Long running operations
325 ///
326 /// This method is used to start, and/or poll a [long-running Operation].
327 /// The [Working with long-running operations] chapter in the [user guide]
328 /// covers these operations in detail.
329 ///
330 /// [long-running operation]: https://google.aip.dev/151
331 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
332 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
333 pub fn create_batch(&self) -> super::builder::batch_controller::CreateBatch {
334 super::builder::batch_controller::CreateBatch::new(self.inner.clone())
335 }
336
337 /// Gets the batch workload resource representation.
338 pub fn get_batch(&self) -> super::builder::batch_controller::GetBatch {
339 super::builder::batch_controller::GetBatch::new(self.inner.clone())
340 }
341
342 /// Lists batch workloads.
343 pub fn list_batches(&self) -> super::builder::batch_controller::ListBatches {
344 super::builder::batch_controller::ListBatches::new(self.inner.clone())
345 }
346
347 /// Deletes the batch workload resource. If the batch is not in terminal state,
348 /// the delete fails and the response returns `FAILED_PRECONDITION`.
349 pub fn delete_batch(&self) -> super::builder::batch_controller::DeleteBatch {
350 super::builder::batch_controller::DeleteBatch::new(self.inner.clone())
351 }
352
353 /// Sets the access control policy on the specified resource. Replaces
354 /// any existing policy.
355 ///
356 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
357 /// errors.
358 pub fn set_iam_policy(&self) -> super::builder::batch_controller::SetIamPolicy {
359 super::builder::batch_controller::SetIamPolicy::new(self.inner.clone())
360 }
361
362 /// Gets the access control policy for a resource. Returns an empty policy
363 /// if the resource exists and does not have a policy set.
364 pub fn get_iam_policy(&self) -> super::builder::batch_controller::GetIamPolicy {
365 super::builder::batch_controller::GetIamPolicy::new(self.inner.clone())
366 }
367
368 /// Returns permissions that a caller has on the specified resource. If the
369 /// resource does not exist, this will return an empty set of
370 /// permissions, not a `NOT_FOUND` error.
371 ///
372 /// Note: This operation is designed to be used for building
373 /// permission-aware UIs and command-line tools, not for authorization
374 /// checking. This operation may "fail open" without warning.
375 pub fn test_iam_permissions(&self) -> super::builder::batch_controller::TestIamPermissions {
376 super::builder::batch_controller::TestIamPermissions::new(self.inner.clone())
377 }
378
379 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
380 ///
381 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
382 pub fn list_operations(&self) -> super::builder::batch_controller::ListOperations {
383 super::builder::batch_controller::ListOperations::new(self.inner.clone())
384 }
385
386 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
387 ///
388 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
389 pub fn get_operation(&self) -> super::builder::batch_controller::GetOperation {
390 super::builder::batch_controller::GetOperation::new(self.inner.clone())
391 }
392
393 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
394 ///
395 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
396 pub fn delete_operation(&self) -> super::builder::batch_controller::DeleteOperation {
397 super::builder::batch_controller::DeleteOperation::new(self.inner.clone())
398 }
399
400 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
401 ///
402 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
403 pub fn cancel_operation(&self) -> super::builder::batch_controller::CancelOperation {
404 super::builder::batch_controller::CancelOperation::new(self.inner.clone())
405 }
406}
407
408/// Implements a client for the Cloud Dataproc API.
409///
410/// # Example
411/// ```
412/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
413/// # use google_cloud_dataproc_v1::client::ClusterController;
414/// let client = ClusterController::builder().build().await?;
415/// // use `client` to make requests to the Cloud Dataproc API.
416/// # Ok(()) }
417/// ```
418///
419/// # Service Description
420///
421/// The ClusterControllerService provides methods to manage clusters
422/// of Compute Engine instances.
423///
424/// # Configuration
425///
426/// To configure `ClusterController` use the `with_*` methods in the type returned
427/// by [builder()][ClusterController::builder]. The default configuration should
428/// work for most applications. Common configuration changes include
429///
430/// * [with_endpoint()]: by default this client uses the global default endpoint
431/// (`https://dataproc.googleapis.com`). Applications using regional
432/// endpoints or running in restricted networks (e.g. a network configured
433// with [Private Google Access with VPC Service Controls]) may want to
434/// override this default.
435/// * [with_credentials()]: by default this client uses
436/// [Application Default Credentials]. Applications using custom
437/// authentication may need to override this default.
438///
439/// [with_endpoint()]: super::builder::cluster_controller::ClientBuilder::with_endpoint
440/// [with_credentials()]: super::builder::cluster_controller::ClientBuilder::credentials
441/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
442/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
443///
444/// # Pooling and Cloning
445///
446/// `ClusterController` holds a connection pool internally, it is advised to
447/// create one and the reuse it. You do not need to wrap `ClusterController` in
448/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
449/// already uses an `Arc` internally.
450#[derive(Clone, Debug)]
451pub struct ClusterController {
452 inner: std::sync::Arc<dyn super::stub::dynamic::ClusterController>,
453}
454
455impl ClusterController {
456 /// Returns a builder for [ClusterController].
457 ///
458 /// ```
459 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
460 /// # use google_cloud_dataproc_v1::client::ClusterController;
461 /// let client = ClusterController::builder().build().await?;
462 /// # Ok(()) }
463 /// ```
464 pub fn builder() -> super::builder::cluster_controller::ClientBuilder {
465 crate::new_client_builder(super::builder::cluster_controller::client::Factory)
466 }
467
468 /// Creates a new client from the provided stub.
469 ///
470 /// The most common case for calling this function is in tests mocking the
471 /// client's behavior.
472 pub fn from_stub<T>(stub: T) -> Self
473 where
474 T: super::stub::ClusterController + 'static,
475 {
476 Self {
477 inner: std::sync::Arc::new(stub),
478 }
479 }
480
481 pub(crate) async fn new(
482 config: gaxi::options::ClientConfig,
483 ) -> crate::ClientBuilderResult<Self> {
484 let inner = Self::build_inner(config).await?;
485 Ok(Self { inner })
486 }
487
488 async fn build_inner(
489 conf: gaxi::options::ClientConfig,
490 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ClusterController>>
491 {
492 if gaxi::options::tracing_enabled(&conf) {
493 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
494 }
495 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
496 }
497
498 async fn build_transport(
499 conf: gaxi::options::ClientConfig,
500 ) -> crate::ClientBuilderResult<impl super::stub::ClusterController> {
501 super::transport::ClusterController::new(conf).await
502 }
503
504 async fn build_with_tracing(
505 conf: gaxi::options::ClientConfig,
506 ) -> crate::ClientBuilderResult<impl super::stub::ClusterController> {
507 Self::build_transport(conf)
508 .await
509 .map(super::tracing::ClusterController::new)
510 }
511
512 /// Creates a cluster in a project. The returned
513 /// [Operation.metadata][google.longrunning.Operation.metadata] will be
514 /// [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
515 ///
516 /// [google.longrunning.Operation.metadata]: google_cloud_longrunning::model::Operation::metadata
517 ///
518 /// # Long running operations
519 ///
520 /// This method is used to start, and/or poll a [long-running Operation].
521 /// The [Working with long-running operations] chapter in the [user guide]
522 /// covers these operations in detail.
523 ///
524 /// [long-running operation]: https://google.aip.dev/151
525 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
526 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
527 pub fn create_cluster(&self) -> super::builder::cluster_controller::CreateCluster {
528 super::builder::cluster_controller::CreateCluster::new(self.inner.clone())
529 }
530
531 /// Updates a cluster in a project. The returned
532 /// [Operation.metadata][google.longrunning.Operation.metadata] will be
533 /// [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
534 /// The cluster must be in a
535 /// [`RUNNING`][google.cloud.dataproc.v1.ClusterStatus.State] state or an error
536 /// is returned.
537 ///
538 /// [google.cloud.dataproc.v1.ClusterStatus.State]: crate::model::cluster_status::State
539 /// [google.longrunning.Operation.metadata]: google_cloud_longrunning::model::Operation::metadata
540 ///
541 /// # Long running operations
542 ///
543 /// This method is used to start, and/or poll a [long-running Operation].
544 /// The [Working with long-running operations] chapter in the [user guide]
545 /// covers these operations in detail.
546 ///
547 /// [long-running operation]: https://google.aip.dev/151
548 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
549 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
550 pub fn update_cluster(&self) -> super::builder::cluster_controller::UpdateCluster {
551 super::builder::cluster_controller::UpdateCluster::new(self.inner.clone())
552 }
553
554 /// Stops a cluster in a project.
555 ///
556 /// # Long running operations
557 ///
558 /// This method is used to start, and/or poll a [long-running Operation].
559 /// The [Working with long-running operations] chapter in the [user guide]
560 /// covers these operations in detail.
561 ///
562 /// [long-running operation]: https://google.aip.dev/151
563 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
564 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
565 pub fn stop_cluster(&self) -> super::builder::cluster_controller::StopCluster {
566 super::builder::cluster_controller::StopCluster::new(self.inner.clone())
567 }
568
569 /// Starts a cluster in a project.
570 ///
571 /// # Long running operations
572 ///
573 /// This method is used to start, and/or poll a [long-running Operation].
574 /// The [Working with long-running operations] chapter in the [user guide]
575 /// covers these operations in detail.
576 ///
577 /// [long-running operation]: https://google.aip.dev/151
578 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
579 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
580 pub fn start_cluster(&self) -> super::builder::cluster_controller::StartCluster {
581 super::builder::cluster_controller::StartCluster::new(self.inner.clone())
582 }
583
584 /// Deletes a cluster in a project. The returned
585 /// [Operation.metadata][google.longrunning.Operation.metadata] will be
586 /// [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
587 ///
588 /// [google.longrunning.Operation.metadata]: google_cloud_longrunning::model::Operation::metadata
589 ///
590 /// # Long running operations
591 ///
592 /// This method is used to start, and/or poll a [long-running Operation].
593 /// The [Working with long-running operations] chapter in the [user guide]
594 /// covers these operations in detail.
595 ///
596 /// [long-running operation]: https://google.aip.dev/151
597 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
598 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
599 pub fn delete_cluster(&self) -> super::builder::cluster_controller::DeleteCluster {
600 super::builder::cluster_controller::DeleteCluster::new(self.inner.clone())
601 }
602
603 /// Gets the resource representation for a cluster in a project.
604 pub fn get_cluster(&self) -> super::builder::cluster_controller::GetCluster {
605 super::builder::cluster_controller::GetCluster::new(self.inner.clone())
606 }
607
608 /// Lists all regions/{region}/clusters in a project alphabetically.
609 pub fn list_clusters(&self) -> super::builder::cluster_controller::ListClusters {
610 super::builder::cluster_controller::ListClusters::new(self.inner.clone())
611 }
612
613 /// Gets cluster diagnostic information. The returned
614 /// [Operation.metadata][google.longrunning.Operation.metadata] will be
615 /// [ClusterOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#clusteroperationmetadata).
616 /// After the operation completes,
617 /// [Operation.response][google.longrunning.Operation.response]
618 /// contains
619 /// [DiagnoseClusterResults](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#diagnoseclusterresults).
620 ///
621 /// [google.longrunning.Operation.metadata]: google_cloud_longrunning::model::Operation::metadata
622 /// [google.longrunning.Operation.response]: google_cloud_longrunning::model::Operation::result
623 ///
624 /// # Long running operations
625 ///
626 /// This method is used to start, and/or poll a [long-running Operation].
627 /// The [Working with long-running operations] chapter in the [user guide]
628 /// covers these operations in detail.
629 ///
630 /// [long-running operation]: https://google.aip.dev/151
631 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
632 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
633 pub fn diagnose_cluster(&self) -> super::builder::cluster_controller::DiagnoseCluster {
634 super::builder::cluster_controller::DiagnoseCluster::new(self.inner.clone())
635 }
636
637 /// Sets the access control policy on the specified resource. Replaces
638 /// any existing policy.
639 ///
640 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
641 /// errors.
642 pub fn set_iam_policy(&self) -> super::builder::cluster_controller::SetIamPolicy {
643 super::builder::cluster_controller::SetIamPolicy::new(self.inner.clone())
644 }
645
646 /// Gets the access control policy for a resource. Returns an empty policy
647 /// if the resource exists and does not have a policy set.
648 pub fn get_iam_policy(&self) -> super::builder::cluster_controller::GetIamPolicy {
649 super::builder::cluster_controller::GetIamPolicy::new(self.inner.clone())
650 }
651
652 /// Returns permissions that a caller has on the specified resource. If the
653 /// resource does not exist, this will return an empty set of
654 /// permissions, not a `NOT_FOUND` error.
655 ///
656 /// Note: This operation is designed to be used for building
657 /// permission-aware UIs and command-line tools, not for authorization
658 /// checking. This operation may "fail open" without warning.
659 pub fn test_iam_permissions(&self) -> super::builder::cluster_controller::TestIamPermissions {
660 super::builder::cluster_controller::TestIamPermissions::new(self.inner.clone())
661 }
662
663 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
664 ///
665 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
666 pub fn list_operations(&self) -> super::builder::cluster_controller::ListOperations {
667 super::builder::cluster_controller::ListOperations::new(self.inner.clone())
668 }
669
670 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
671 ///
672 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
673 pub fn get_operation(&self) -> super::builder::cluster_controller::GetOperation {
674 super::builder::cluster_controller::GetOperation::new(self.inner.clone())
675 }
676
677 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
678 ///
679 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
680 pub fn delete_operation(&self) -> super::builder::cluster_controller::DeleteOperation {
681 super::builder::cluster_controller::DeleteOperation::new(self.inner.clone())
682 }
683
684 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
685 ///
686 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
687 pub fn cancel_operation(&self) -> super::builder::cluster_controller::CancelOperation {
688 super::builder::cluster_controller::CancelOperation::new(self.inner.clone())
689 }
690}
691
692/// Implements a client for the Cloud Dataproc API.
693///
694/// # Example
695/// ```
696/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
697/// # use google_cloud_dataproc_v1::client::JobController;
698/// let client = JobController::builder().build().await?;
699/// // use `client` to make requests to the Cloud Dataproc API.
700/// # Ok(()) }
701/// ```
702///
703/// # Service Description
704///
705/// The JobController provides methods to manage jobs.
706///
707/// # Configuration
708///
709/// To configure `JobController` use the `with_*` methods in the type returned
710/// by [builder()][JobController::builder]. The default configuration should
711/// work for most applications. Common configuration changes include
712///
713/// * [with_endpoint()]: by default this client uses the global default endpoint
714/// (`https://dataproc.googleapis.com`). Applications using regional
715/// endpoints or running in restricted networks (e.g. a network configured
716// with [Private Google Access with VPC Service Controls]) may want to
717/// override this default.
718/// * [with_credentials()]: by default this client uses
719/// [Application Default Credentials]. Applications using custom
720/// authentication may need to override this default.
721///
722/// [with_endpoint()]: super::builder::job_controller::ClientBuilder::with_endpoint
723/// [with_credentials()]: super::builder::job_controller::ClientBuilder::credentials
724/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
725/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
726///
727/// # Pooling and Cloning
728///
729/// `JobController` holds a connection pool internally, it is advised to
730/// create one and the reuse it. You do not need to wrap `JobController` in
731/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
732/// already uses an `Arc` internally.
733#[derive(Clone, Debug)]
734pub struct JobController {
735 inner: std::sync::Arc<dyn super::stub::dynamic::JobController>,
736}
737
738impl JobController {
739 /// Returns a builder for [JobController].
740 ///
741 /// ```
742 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
743 /// # use google_cloud_dataproc_v1::client::JobController;
744 /// let client = JobController::builder().build().await?;
745 /// # Ok(()) }
746 /// ```
747 pub fn builder() -> super::builder::job_controller::ClientBuilder {
748 crate::new_client_builder(super::builder::job_controller::client::Factory)
749 }
750
751 /// Creates a new client from the provided stub.
752 ///
753 /// The most common case for calling this function is in tests mocking the
754 /// client's behavior.
755 pub fn from_stub<T>(stub: T) -> Self
756 where
757 T: super::stub::JobController + 'static,
758 {
759 Self {
760 inner: std::sync::Arc::new(stub),
761 }
762 }
763
764 pub(crate) async fn new(
765 config: gaxi::options::ClientConfig,
766 ) -> crate::ClientBuilderResult<Self> {
767 let inner = Self::build_inner(config).await?;
768 Ok(Self { inner })
769 }
770
771 async fn build_inner(
772 conf: gaxi::options::ClientConfig,
773 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::JobController>> {
774 if gaxi::options::tracing_enabled(&conf) {
775 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
776 }
777 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
778 }
779
780 async fn build_transport(
781 conf: gaxi::options::ClientConfig,
782 ) -> crate::ClientBuilderResult<impl super::stub::JobController> {
783 super::transport::JobController::new(conf).await
784 }
785
786 async fn build_with_tracing(
787 conf: gaxi::options::ClientConfig,
788 ) -> crate::ClientBuilderResult<impl super::stub::JobController> {
789 Self::build_transport(conf)
790 .await
791 .map(super::tracing::JobController::new)
792 }
793
794 /// Submits a job to a cluster.
795 pub fn submit_job(&self) -> super::builder::job_controller::SubmitJob {
796 super::builder::job_controller::SubmitJob::new(self.inner.clone())
797 }
798
799 /// Submits job to a cluster.
800 ///
801 /// # Long running operations
802 ///
803 /// This method is used to start, and/or poll a [long-running Operation].
804 /// The [Working with long-running operations] chapter in the [user guide]
805 /// covers these operations in detail.
806 ///
807 /// [long-running operation]: https://google.aip.dev/151
808 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
809 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
810 pub fn submit_job_as_operation(&self) -> super::builder::job_controller::SubmitJobAsOperation {
811 super::builder::job_controller::SubmitJobAsOperation::new(self.inner.clone())
812 }
813
814 /// Gets the resource representation for a job in a project.
815 pub fn get_job(&self) -> super::builder::job_controller::GetJob {
816 super::builder::job_controller::GetJob::new(self.inner.clone())
817 }
818
819 /// Lists regions/{region}/jobs in a project.
820 pub fn list_jobs(&self) -> super::builder::job_controller::ListJobs {
821 super::builder::job_controller::ListJobs::new(self.inner.clone())
822 }
823
824 /// Updates a job in a project.
825 pub fn update_job(&self) -> super::builder::job_controller::UpdateJob {
826 super::builder::job_controller::UpdateJob::new(self.inner.clone())
827 }
828
829 /// Starts a job cancellation request. To access the job resource
830 /// after cancellation, call
831 /// [regions/{region}/jobs.list](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/list)
832 /// or
833 /// [regions/{region}/jobs.get](https://cloud.google.com/dataproc/docs/reference/rest/v1/projects.regions.jobs/get).
834 pub fn cancel_job(&self) -> super::builder::job_controller::CancelJob {
835 super::builder::job_controller::CancelJob::new(self.inner.clone())
836 }
837
838 /// Deletes the job from the project. If the job is active, the delete fails,
839 /// and the response returns `FAILED_PRECONDITION`.
840 pub fn delete_job(&self) -> super::builder::job_controller::DeleteJob {
841 super::builder::job_controller::DeleteJob::new(self.inner.clone())
842 }
843
844 /// Sets the access control policy on the specified resource. Replaces
845 /// any existing policy.
846 ///
847 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
848 /// errors.
849 pub fn set_iam_policy(&self) -> super::builder::job_controller::SetIamPolicy {
850 super::builder::job_controller::SetIamPolicy::new(self.inner.clone())
851 }
852
853 /// Gets the access control policy for a resource. Returns an empty policy
854 /// if the resource exists and does not have a policy set.
855 pub fn get_iam_policy(&self) -> super::builder::job_controller::GetIamPolicy {
856 super::builder::job_controller::GetIamPolicy::new(self.inner.clone())
857 }
858
859 /// Returns permissions that a caller has on the specified resource. If the
860 /// resource does not exist, this will return an empty set of
861 /// permissions, not a `NOT_FOUND` error.
862 ///
863 /// Note: This operation is designed to be used for building
864 /// permission-aware UIs and command-line tools, not for authorization
865 /// checking. This operation may "fail open" without warning.
866 pub fn test_iam_permissions(&self) -> super::builder::job_controller::TestIamPermissions {
867 super::builder::job_controller::TestIamPermissions::new(self.inner.clone())
868 }
869
870 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
871 ///
872 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
873 pub fn list_operations(&self) -> super::builder::job_controller::ListOperations {
874 super::builder::job_controller::ListOperations::new(self.inner.clone())
875 }
876
877 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
878 ///
879 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
880 pub fn get_operation(&self) -> super::builder::job_controller::GetOperation {
881 super::builder::job_controller::GetOperation::new(self.inner.clone())
882 }
883
884 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
885 ///
886 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
887 pub fn delete_operation(&self) -> super::builder::job_controller::DeleteOperation {
888 super::builder::job_controller::DeleteOperation::new(self.inner.clone())
889 }
890
891 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
892 ///
893 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
894 pub fn cancel_operation(&self) -> super::builder::job_controller::CancelOperation {
895 super::builder::job_controller::CancelOperation::new(self.inner.clone())
896 }
897}
898
899/// Implements a client for the Cloud Dataproc API.
900///
901/// # Example
902/// ```
903/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
904/// # use google_cloud_dataproc_v1::client::NodeGroupController;
905/// let client = NodeGroupController::builder().build().await?;
906/// // use `client` to make requests to the Cloud Dataproc API.
907/// # Ok(()) }
908/// ```
909///
910/// # Service Description
911///
912/// The `NodeGroupControllerService` provides methods to manage node groups
913/// of Compute Engine managed instances.
914///
915/// # Configuration
916///
917/// To configure `NodeGroupController` use the `with_*` methods in the type returned
918/// by [builder()][NodeGroupController::builder]. The default configuration should
919/// work for most applications. Common configuration changes include
920///
921/// * [with_endpoint()]: by default this client uses the global default endpoint
922/// (`https://dataproc.googleapis.com`). Applications using regional
923/// endpoints or running in restricted networks (e.g. a network configured
924// with [Private Google Access with VPC Service Controls]) may want to
925/// override this default.
926/// * [with_credentials()]: by default this client uses
927/// [Application Default Credentials]. Applications using custom
928/// authentication may need to override this default.
929///
930/// [with_endpoint()]: super::builder::node_group_controller::ClientBuilder::with_endpoint
931/// [with_credentials()]: super::builder::node_group_controller::ClientBuilder::credentials
932/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
933/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
934///
935/// # Pooling and Cloning
936///
937/// `NodeGroupController` holds a connection pool internally, it is advised to
938/// create one and the reuse it. You do not need to wrap `NodeGroupController` in
939/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
940/// already uses an `Arc` internally.
941#[derive(Clone, Debug)]
942pub struct NodeGroupController {
943 inner: std::sync::Arc<dyn super::stub::dynamic::NodeGroupController>,
944}
945
946impl NodeGroupController {
947 /// Returns a builder for [NodeGroupController].
948 ///
949 /// ```
950 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
951 /// # use google_cloud_dataproc_v1::client::NodeGroupController;
952 /// let client = NodeGroupController::builder().build().await?;
953 /// # Ok(()) }
954 /// ```
955 pub fn builder() -> super::builder::node_group_controller::ClientBuilder {
956 crate::new_client_builder(super::builder::node_group_controller::client::Factory)
957 }
958
959 /// Creates a new client from the provided stub.
960 ///
961 /// The most common case for calling this function is in tests mocking the
962 /// client's behavior.
963 pub fn from_stub<T>(stub: T) -> Self
964 where
965 T: super::stub::NodeGroupController + 'static,
966 {
967 Self {
968 inner: std::sync::Arc::new(stub),
969 }
970 }
971
972 pub(crate) async fn new(
973 config: gaxi::options::ClientConfig,
974 ) -> crate::ClientBuilderResult<Self> {
975 let inner = Self::build_inner(config).await?;
976 Ok(Self { inner })
977 }
978
979 async fn build_inner(
980 conf: gaxi::options::ClientConfig,
981 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeGroupController>>
982 {
983 if gaxi::options::tracing_enabled(&conf) {
984 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
985 }
986 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
987 }
988
989 async fn build_transport(
990 conf: gaxi::options::ClientConfig,
991 ) -> crate::ClientBuilderResult<impl super::stub::NodeGroupController> {
992 super::transport::NodeGroupController::new(conf).await
993 }
994
995 async fn build_with_tracing(
996 conf: gaxi::options::ClientConfig,
997 ) -> crate::ClientBuilderResult<impl super::stub::NodeGroupController> {
998 Self::build_transport(conf)
999 .await
1000 .map(super::tracing::NodeGroupController::new)
1001 }
1002
1003 /// Creates a node group in a cluster. The returned
1004 /// [Operation.metadata][google.longrunning.Operation.metadata] is
1005 /// [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata).
1006 ///
1007 /// [google.longrunning.Operation.metadata]: google_cloud_longrunning::model::Operation::metadata
1008 ///
1009 /// # Long running operations
1010 ///
1011 /// This method is used to start, and/or poll a [long-running Operation].
1012 /// The [Working with long-running operations] chapter in the [user guide]
1013 /// covers these operations in detail.
1014 ///
1015 /// [long-running operation]: https://google.aip.dev/151
1016 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1017 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1018 pub fn create_node_group(&self) -> super::builder::node_group_controller::CreateNodeGroup {
1019 super::builder::node_group_controller::CreateNodeGroup::new(self.inner.clone())
1020 }
1021
1022 /// Resizes a node group in a cluster. The returned
1023 /// [Operation.metadata][google.longrunning.Operation.metadata] is
1024 /// [NodeGroupOperationMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#nodegroupoperationmetadata).
1025 ///
1026 /// [google.longrunning.Operation.metadata]: google_cloud_longrunning::model::Operation::metadata
1027 ///
1028 /// # Long running operations
1029 ///
1030 /// This method is used to start, and/or poll a [long-running Operation].
1031 /// The [Working with long-running operations] chapter in the [user guide]
1032 /// covers these operations in detail.
1033 ///
1034 /// [long-running operation]: https://google.aip.dev/151
1035 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1036 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1037 pub fn resize_node_group(&self) -> super::builder::node_group_controller::ResizeNodeGroup {
1038 super::builder::node_group_controller::ResizeNodeGroup::new(self.inner.clone())
1039 }
1040
1041 /// Gets the resource representation for a node group in a
1042 /// cluster.
1043 pub fn get_node_group(&self) -> super::builder::node_group_controller::GetNodeGroup {
1044 super::builder::node_group_controller::GetNodeGroup::new(self.inner.clone())
1045 }
1046
1047 /// Sets the access control policy on the specified resource. Replaces
1048 /// any existing policy.
1049 ///
1050 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1051 /// errors.
1052 pub fn set_iam_policy(&self) -> super::builder::node_group_controller::SetIamPolicy {
1053 super::builder::node_group_controller::SetIamPolicy::new(self.inner.clone())
1054 }
1055
1056 /// Gets the access control policy for a resource. Returns an empty policy
1057 /// if the resource exists and does not have a policy set.
1058 pub fn get_iam_policy(&self) -> super::builder::node_group_controller::GetIamPolicy {
1059 super::builder::node_group_controller::GetIamPolicy::new(self.inner.clone())
1060 }
1061
1062 /// Returns permissions that a caller has on the specified resource. If the
1063 /// resource does not exist, this will return an empty set of
1064 /// permissions, not a `NOT_FOUND` error.
1065 ///
1066 /// Note: This operation is designed to be used for building
1067 /// permission-aware UIs and command-line tools, not for authorization
1068 /// checking. This operation may "fail open" without warning.
1069 pub fn test_iam_permissions(
1070 &self,
1071 ) -> super::builder::node_group_controller::TestIamPermissions {
1072 super::builder::node_group_controller::TestIamPermissions::new(self.inner.clone())
1073 }
1074
1075 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1076 ///
1077 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1078 pub fn list_operations(&self) -> super::builder::node_group_controller::ListOperations {
1079 super::builder::node_group_controller::ListOperations::new(self.inner.clone())
1080 }
1081
1082 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1083 ///
1084 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1085 pub fn get_operation(&self) -> super::builder::node_group_controller::GetOperation {
1086 super::builder::node_group_controller::GetOperation::new(self.inner.clone())
1087 }
1088
1089 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1090 ///
1091 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1092 pub fn delete_operation(&self) -> super::builder::node_group_controller::DeleteOperation {
1093 super::builder::node_group_controller::DeleteOperation::new(self.inner.clone())
1094 }
1095
1096 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1097 ///
1098 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1099 pub fn cancel_operation(&self) -> super::builder::node_group_controller::CancelOperation {
1100 super::builder::node_group_controller::CancelOperation::new(self.inner.clone())
1101 }
1102}
1103
1104/// Implements a client for the Cloud Dataproc API.
1105///
1106/// # Example
1107/// ```
1108/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1109/// # use google_cloud_dataproc_v1::client::SessionTemplateController;
1110/// let client = SessionTemplateController::builder().build().await?;
1111/// // use `client` to make requests to the Cloud Dataproc API.
1112/// # Ok(()) }
1113/// ```
1114///
1115/// # Service Description
1116///
1117/// The SessionTemplateController provides methods to manage session templates.
1118///
1119/// # Configuration
1120///
1121/// To configure `SessionTemplateController` use the `with_*` methods in the type returned
1122/// by [builder()][SessionTemplateController::builder]. The default configuration should
1123/// work for most applications. Common configuration changes include
1124///
1125/// * [with_endpoint()]: by default this client uses the global default endpoint
1126/// (`https://dataproc.googleapis.com`). Applications using regional
1127/// endpoints or running in restricted networks (e.g. a network configured
1128// with [Private Google Access with VPC Service Controls]) may want to
1129/// override this default.
1130/// * [with_credentials()]: by default this client uses
1131/// [Application Default Credentials]. Applications using custom
1132/// authentication may need to override this default.
1133///
1134/// [with_endpoint()]: super::builder::session_template_controller::ClientBuilder::with_endpoint
1135/// [with_credentials()]: super::builder::session_template_controller::ClientBuilder::credentials
1136/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1137/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1138///
1139/// # Pooling and Cloning
1140///
1141/// `SessionTemplateController` holds a connection pool internally, it is advised to
1142/// create one and the reuse it. You do not need to wrap `SessionTemplateController` in
1143/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1144/// already uses an `Arc` internally.
1145#[derive(Clone, Debug)]
1146pub struct SessionTemplateController {
1147 inner: std::sync::Arc<dyn super::stub::dynamic::SessionTemplateController>,
1148}
1149
1150impl SessionTemplateController {
1151 /// Returns a builder for [SessionTemplateController].
1152 ///
1153 /// ```
1154 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1155 /// # use google_cloud_dataproc_v1::client::SessionTemplateController;
1156 /// let client = SessionTemplateController::builder().build().await?;
1157 /// # Ok(()) }
1158 /// ```
1159 pub fn builder() -> super::builder::session_template_controller::ClientBuilder {
1160 crate::new_client_builder(super::builder::session_template_controller::client::Factory)
1161 }
1162
1163 /// Creates a new client from the provided stub.
1164 ///
1165 /// The most common case for calling this function is in tests mocking the
1166 /// client's behavior.
1167 pub fn from_stub<T>(stub: T) -> Self
1168 where
1169 T: super::stub::SessionTemplateController + 'static,
1170 {
1171 Self {
1172 inner: std::sync::Arc::new(stub),
1173 }
1174 }
1175
1176 pub(crate) async fn new(
1177 config: gaxi::options::ClientConfig,
1178 ) -> crate::ClientBuilderResult<Self> {
1179 let inner = Self::build_inner(config).await?;
1180 Ok(Self { inner })
1181 }
1182
1183 async fn build_inner(
1184 conf: gaxi::options::ClientConfig,
1185 ) -> crate::ClientBuilderResult<
1186 std::sync::Arc<dyn super::stub::dynamic::SessionTemplateController>,
1187 > {
1188 if gaxi::options::tracing_enabled(&conf) {
1189 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1190 }
1191 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1192 }
1193
1194 async fn build_transport(
1195 conf: gaxi::options::ClientConfig,
1196 ) -> crate::ClientBuilderResult<impl super::stub::SessionTemplateController> {
1197 super::transport::SessionTemplateController::new(conf).await
1198 }
1199
1200 async fn build_with_tracing(
1201 conf: gaxi::options::ClientConfig,
1202 ) -> crate::ClientBuilderResult<impl super::stub::SessionTemplateController> {
1203 Self::build_transport(conf)
1204 .await
1205 .map(super::tracing::SessionTemplateController::new)
1206 }
1207
1208 /// Create a session template synchronously.
1209 pub fn create_session_template(
1210 &self,
1211 ) -> super::builder::session_template_controller::CreateSessionTemplate {
1212 super::builder::session_template_controller::CreateSessionTemplate::new(self.inner.clone())
1213 }
1214
1215 /// Updates the session template synchronously.
1216 pub fn update_session_template(
1217 &self,
1218 ) -> super::builder::session_template_controller::UpdateSessionTemplate {
1219 super::builder::session_template_controller::UpdateSessionTemplate::new(self.inner.clone())
1220 }
1221
1222 /// Gets the resource representation for a session template.
1223 pub fn get_session_template(
1224 &self,
1225 ) -> super::builder::session_template_controller::GetSessionTemplate {
1226 super::builder::session_template_controller::GetSessionTemplate::new(self.inner.clone())
1227 }
1228
1229 /// Lists session templates.
1230 pub fn list_session_templates(
1231 &self,
1232 ) -> super::builder::session_template_controller::ListSessionTemplates {
1233 super::builder::session_template_controller::ListSessionTemplates::new(self.inner.clone())
1234 }
1235
1236 /// Deletes a session template.
1237 pub fn delete_session_template(
1238 &self,
1239 ) -> super::builder::session_template_controller::DeleteSessionTemplate {
1240 super::builder::session_template_controller::DeleteSessionTemplate::new(self.inner.clone())
1241 }
1242
1243 /// Sets the access control policy on the specified resource. Replaces
1244 /// any existing policy.
1245 ///
1246 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1247 /// errors.
1248 pub fn set_iam_policy(&self) -> super::builder::session_template_controller::SetIamPolicy {
1249 super::builder::session_template_controller::SetIamPolicy::new(self.inner.clone())
1250 }
1251
1252 /// Gets the access control policy for a resource. Returns an empty policy
1253 /// if the resource exists and does not have a policy set.
1254 pub fn get_iam_policy(&self) -> super::builder::session_template_controller::GetIamPolicy {
1255 super::builder::session_template_controller::GetIamPolicy::new(self.inner.clone())
1256 }
1257
1258 /// Returns permissions that a caller has on the specified resource. If the
1259 /// resource does not exist, this will return an empty set of
1260 /// permissions, not a `NOT_FOUND` error.
1261 ///
1262 /// Note: This operation is designed to be used for building
1263 /// permission-aware UIs and command-line tools, not for authorization
1264 /// checking. This operation may "fail open" without warning.
1265 pub fn test_iam_permissions(
1266 &self,
1267 ) -> super::builder::session_template_controller::TestIamPermissions {
1268 super::builder::session_template_controller::TestIamPermissions::new(self.inner.clone())
1269 }
1270
1271 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1272 ///
1273 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1274 pub fn list_operations(&self) -> super::builder::session_template_controller::ListOperations {
1275 super::builder::session_template_controller::ListOperations::new(self.inner.clone())
1276 }
1277
1278 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1279 ///
1280 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1281 pub fn get_operation(&self) -> super::builder::session_template_controller::GetOperation {
1282 super::builder::session_template_controller::GetOperation::new(self.inner.clone())
1283 }
1284
1285 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1286 ///
1287 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1288 pub fn delete_operation(&self) -> super::builder::session_template_controller::DeleteOperation {
1289 super::builder::session_template_controller::DeleteOperation::new(self.inner.clone())
1290 }
1291
1292 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1293 ///
1294 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1295 pub fn cancel_operation(&self) -> super::builder::session_template_controller::CancelOperation {
1296 super::builder::session_template_controller::CancelOperation::new(self.inner.clone())
1297 }
1298}
1299
1300/// Implements a client for the Cloud Dataproc API.
1301///
1302/// # Example
1303/// ```
1304/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1305/// # use google_cloud_dataproc_v1::client::SessionController;
1306/// let client = SessionController::builder().build().await?;
1307/// // use `client` to make requests to the Cloud Dataproc API.
1308/// # Ok(()) }
1309/// ```
1310///
1311/// # Service Description
1312///
1313/// The `SessionController` provides methods to manage interactive sessions.
1314///
1315/// # Configuration
1316///
1317/// To configure `SessionController` use the `with_*` methods in the type returned
1318/// by [builder()][SessionController::builder]. The default configuration should
1319/// work for most applications. Common configuration changes include
1320///
1321/// * [with_endpoint()]: by default this client uses the global default endpoint
1322/// (`https://dataproc.googleapis.com`). Applications using regional
1323/// endpoints or running in restricted networks (e.g. a network configured
1324// with [Private Google Access with VPC Service Controls]) may want to
1325/// override this default.
1326/// * [with_credentials()]: by default this client uses
1327/// [Application Default Credentials]. Applications using custom
1328/// authentication may need to override this default.
1329///
1330/// [with_endpoint()]: super::builder::session_controller::ClientBuilder::with_endpoint
1331/// [with_credentials()]: super::builder::session_controller::ClientBuilder::credentials
1332/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1333/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1334///
1335/// # Pooling and Cloning
1336///
1337/// `SessionController` holds a connection pool internally, it is advised to
1338/// create one and the reuse it. You do not need to wrap `SessionController` in
1339/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1340/// already uses an `Arc` internally.
1341#[derive(Clone, Debug)]
1342pub struct SessionController {
1343 inner: std::sync::Arc<dyn super::stub::dynamic::SessionController>,
1344}
1345
1346impl SessionController {
1347 /// Returns a builder for [SessionController].
1348 ///
1349 /// ```
1350 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1351 /// # use google_cloud_dataproc_v1::client::SessionController;
1352 /// let client = SessionController::builder().build().await?;
1353 /// # Ok(()) }
1354 /// ```
1355 pub fn builder() -> super::builder::session_controller::ClientBuilder {
1356 crate::new_client_builder(super::builder::session_controller::client::Factory)
1357 }
1358
1359 /// Creates a new client from the provided stub.
1360 ///
1361 /// The most common case for calling this function is in tests mocking the
1362 /// client's behavior.
1363 pub fn from_stub<T>(stub: T) -> Self
1364 where
1365 T: super::stub::SessionController + 'static,
1366 {
1367 Self {
1368 inner: std::sync::Arc::new(stub),
1369 }
1370 }
1371
1372 pub(crate) async fn new(
1373 config: gaxi::options::ClientConfig,
1374 ) -> crate::ClientBuilderResult<Self> {
1375 let inner = Self::build_inner(config).await?;
1376 Ok(Self { inner })
1377 }
1378
1379 async fn build_inner(
1380 conf: gaxi::options::ClientConfig,
1381 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SessionController>>
1382 {
1383 if gaxi::options::tracing_enabled(&conf) {
1384 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1385 }
1386 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1387 }
1388
1389 async fn build_transport(
1390 conf: gaxi::options::ClientConfig,
1391 ) -> crate::ClientBuilderResult<impl super::stub::SessionController> {
1392 super::transport::SessionController::new(conf).await
1393 }
1394
1395 async fn build_with_tracing(
1396 conf: gaxi::options::ClientConfig,
1397 ) -> crate::ClientBuilderResult<impl super::stub::SessionController> {
1398 Self::build_transport(conf)
1399 .await
1400 .map(super::tracing::SessionController::new)
1401 }
1402
1403 /// Create an interactive session asynchronously.
1404 ///
1405 /// # Long running operations
1406 ///
1407 /// This method is used to start, and/or poll a [long-running Operation].
1408 /// The [Working with long-running operations] chapter in the [user guide]
1409 /// covers these operations in detail.
1410 ///
1411 /// [long-running operation]: https://google.aip.dev/151
1412 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1413 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1414 pub fn create_session(&self) -> super::builder::session_controller::CreateSession {
1415 super::builder::session_controller::CreateSession::new(self.inner.clone())
1416 }
1417
1418 /// Gets the resource representation for an interactive session.
1419 pub fn get_session(&self) -> super::builder::session_controller::GetSession {
1420 super::builder::session_controller::GetSession::new(self.inner.clone())
1421 }
1422
1423 /// Lists interactive sessions.
1424 pub fn list_sessions(&self) -> super::builder::session_controller::ListSessions {
1425 super::builder::session_controller::ListSessions::new(self.inner.clone())
1426 }
1427
1428 /// Terminates the interactive session.
1429 ///
1430 /// # Long running operations
1431 ///
1432 /// This method is used to start, and/or poll a [long-running Operation].
1433 /// The [Working with long-running operations] chapter in the [user guide]
1434 /// covers these operations in detail.
1435 ///
1436 /// [long-running operation]: https://google.aip.dev/151
1437 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1438 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1439 pub fn terminate_session(&self) -> super::builder::session_controller::TerminateSession {
1440 super::builder::session_controller::TerminateSession::new(self.inner.clone())
1441 }
1442
1443 /// Deletes the interactive session resource. If the session is not in terminal
1444 /// state, it is terminated, and then deleted.
1445 ///
1446 /// # Long running operations
1447 ///
1448 /// This method is used to start, and/or poll a [long-running Operation].
1449 /// The [Working with long-running operations] chapter in the [user guide]
1450 /// covers these operations in detail.
1451 ///
1452 /// [long-running operation]: https://google.aip.dev/151
1453 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1454 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1455 pub fn delete_session(&self) -> super::builder::session_controller::DeleteSession {
1456 super::builder::session_controller::DeleteSession::new(self.inner.clone())
1457 }
1458
1459 /// Sets the access control policy on the specified resource. Replaces
1460 /// any existing policy.
1461 ///
1462 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1463 /// errors.
1464 pub fn set_iam_policy(&self) -> super::builder::session_controller::SetIamPolicy {
1465 super::builder::session_controller::SetIamPolicy::new(self.inner.clone())
1466 }
1467
1468 /// Gets the access control policy for a resource. Returns an empty policy
1469 /// if the resource exists and does not have a policy set.
1470 pub fn get_iam_policy(&self) -> super::builder::session_controller::GetIamPolicy {
1471 super::builder::session_controller::GetIamPolicy::new(self.inner.clone())
1472 }
1473
1474 /// Returns permissions that a caller has on the specified resource. If the
1475 /// resource does not exist, this will return an empty set of
1476 /// permissions, not a `NOT_FOUND` error.
1477 ///
1478 /// Note: This operation is designed to be used for building
1479 /// permission-aware UIs and command-line tools, not for authorization
1480 /// checking. This operation may "fail open" without warning.
1481 pub fn test_iam_permissions(&self) -> super::builder::session_controller::TestIamPermissions {
1482 super::builder::session_controller::TestIamPermissions::new(self.inner.clone())
1483 }
1484
1485 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1486 ///
1487 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1488 pub fn list_operations(&self) -> super::builder::session_controller::ListOperations {
1489 super::builder::session_controller::ListOperations::new(self.inner.clone())
1490 }
1491
1492 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1493 ///
1494 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1495 pub fn get_operation(&self) -> super::builder::session_controller::GetOperation {
1496 super::builder::session_controller::GetOperation::new(self.inner.clone())
1497 }
1498
1499 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1500 ///
1501 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1502 pub fn delete_operation(&self) -> super::builder::session_controller::DeleteOperation {
1503 super::builder::session_controller::DeleteOperation::new(self.inner.clone())
1504 }
1505
1506 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1507 ///
1508 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1509 pub fn cancel_operation(&self) -> super::builder::session_controller::CancelOperation {
1510 super::builder::session_controller::CancelOperation::new(self.inner.clone())
1511 }
1512}
1513
1514/// Implements a client for the Cloud Dataproc API.
1515///
1516/// # Example
1517/// ```
1518/// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1519/// # use google_cloud_dataproc_v1::client::WorkflowTemplateService;
1520/// let client = WorkflowTemplateService::builder().build().await?;
1521/// // use `client` to make requests to the Cloud Dataproc API.
1522/// # Ok(()) }
1523/// ```
1524///
1525/// # Service Description
1526///
1527/// The API interface for managing Workflow Templates in the
1528/// Dataproc API.
1529///
1530/// # Configuration
1531///
1532/// To configure `WorkflowTemplateService` use the `with_*` methods in the type returned
1533/// by [builder()][WorkflowTemplateService::builder]. The default configuration should
1534/// work for most applications. Common configuration changes include
1535///
1536/// * [with_endpoint()]: by default this client uses the global default endpoint
1537/// (`https://dataproc.googleapis.com`). Applications using regional
1538/// endpoints or running in restricted networks (e.g. a network configured
1539// with [Private Google Access with VPC Service Controls]) may want to
1540/// override this default.
1541/// * [with_credentials()]: by default this client uses
1542/// [Application Default Credentials]. Applications using custom
1543/// authentication may need to override this default.
1544///
1545/// [with_endpoint()]: super::builder::workflow_template_service::ClientBuilder::with_endpoint
1546/// [with_credentials()]: super::builder::workflow_template_service::ClientBuilder::credentials
1547/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1548/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1549///
1550/// # Pooling and Cloning
1551///
1552/// `WorkflowTemplateService` holds a connection pool internally, it is advised to
1553/// create one and the reuse it. You do not need to wrap `WorkflowTemplateService` in
1554/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1555/// already uses an `Arc` internally.
1556#[derive(Clone, Debug)]
1557pub struct WorkflowTemplateService {
1558 inner: std::sync::Arc<dyn super::stub::dynamic::WorkflowTemplateService>,
1559}
1560
1561impl WorkflowTemplateService {
1562 /// Returns a builder for [WorkflowTemplateService].
1563 ///
1564 /// ```
1565 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1566 /// # use google_cloud_dataproc_v1::client::WorkflowTemplateService;
1567 /// let client = WorkflowTemplateService::builder().build().await?;
1568 /// # Ok(()) }
1569 /// ```
1570 pub fn builder() -> super::builder::workflow_template_service::ClientBuilder {
1571 crate::new_client_builder(super::builder::workflow_template_service::client::Factory)
1572 }
1573
1574 /// Creates a new client from the provided stub.
1575 ///
1576 /// The most common case for calling this function is in tests mocking the
1577 /// client's behavior.
1578 pub fn from_stub<T>(stub: T) -> Self
1579 where
1580 T: super::stub::WorkflowTemplateService + 'static,
1581 {
1582 Self {
1583 inner: std::sync::Arc::new(stub),
1584 }
1585 }
1586
1587 pub(crate) async fn new(
1588 config: gaxi::options::ClientConfig,
1589 ) -> crate::ClientBuilderResult<Self> {
1590 let inner = Self::build_inner(config).await?;
1591 Ok(Self { inner })
1592 }
1593
1594 async fn build_inner(
1595 conf: gaxi::options::ClientConfig,
1596 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::WorkflowTemplateService>>
1597 {
1598 if gaxi::options::tracing_enabled(&conf) {
1599 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1600 }
1601 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1602 }
1603
1604 async fn build_transport(
1605 conf: gaxi::options::ClientConfig,
1606 ) -> crate::ClientBuilderResult<impl super::stub::WorkflowTemplateService> {
1607 super::transport::WorkflowTemplateService::new(conf).await
1608 }
1609
1610 async fn build_with_tracing(
1611 conf: gaxi::options::ClientConfig,
1612 ) -> crate::ClientBuilderResult<impl super::stub::WorkflowTemplateService> {
1613 Self::build_transport(conf)
1614 .await
1615 .map(super::tracing::WorkflowTemplateService::new)
1616 }
1617
1618 /// Creates new workflow template.
1619 pub fn create_workflow_template(
1620 &self,
1621 ) -> super::builder::workflow_template_service::CreateWorkflowTemplate {
1622 super::builder::workflow_template_service::CreateWorkflowTemplate::new(self.inner.clone())
1623 }
1624
1625 /// Retrieves the latest workflow template.
1626 ///
1627 /// Can retrieve previously instantiated template by specifying optional
1628 /// version parameter.
1629 pub fn get_workflow_template(
1630 &self,
1631 ) -> super::builder::workflow_template_service::GetWorkflowTemplate {
1632 super::builder::workflow_template_service::GetWorkflowTemplate::new(self.inner.clone())
1633 }
1634
1635 /// Instantiates a template and begins execution.
1636 ///
1637 /// The returned Operation can be used to track execution of
1638 /// workflow by polling
1639 /// [operations.get][google.longrunning.Operations.GetOperation].
1640 /// The Operation will complete when entire workflow is finished.
1641 ///
1642 /// The running workflow can be aborted via
1643 /// [operations.cancel][google.longrunning.Operations.CancelOperation].
1644 /// This will cause any inflight jobs to be cancelled and workflow-owned
1645 /// clusters to be deleted.
1646 ///
1647 /// The [Operation.metadata][google.longrunning.Operation.metadata] will be
1648 /// [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
1649 /// Also see [Using
1650 /// WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
1651 ///
1652 /// On successful completion,
1653 /// [Operation.response][google.longrunning.Operation.response] will be
1654 /// [Empty][google.protobuf.Empty].
1655 ///
1656 /// [google.longrunning.Operation.metadata]: google_cloud_longrunning::model::Operation::metadata
1657 /// [google.longrunning.Operation.response]: google_cloud_longrunning::model::Operation::result
1658 /// [google.protobuf.Empty]: wkt::Empty
1659 ///
1660 /// # Long running operations
1661 ///
1662 /// This method is used to start, and/or poll a [long-running Operation].
1663 /// The [Working with long-running operations] chapter in the [user guide]
1664 /// covers these operations in detail.
1665 ///
1666 /// [long-running operation]: https://google.aip.dev/151
1667 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1668 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1669 pub fn instantiate_workflow_template(
1670 &self,
1671 ) -> super::builder::workflow_template_service::InstantiateWorkflowTemplate {
1672 super::builder::workflow_template_service::InstantiateWorkflowTemplate::new(
1673 self.inner.clone(),
1674 )
1675 }
1676
1677 /// Instantiates a template and begins execution.
1678 ///
1679 /// This method is equivalent to executing the sequence
1680 /// [CreateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate],
1681 /// [InstantiateWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate],
1682 /// [DeleteWorkflowTemplate][google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate].
1683 ///
1684 /// The returned Operation can be used to track execution of
1685 /// workflow by polling
1686 /// [operations.get][google.longrunning.Operations.GetOperation].
1687 /// The Operation will complete when entire workflow is finished.
1688 ///
1689 /// The running workflow can be aborted via
1690 /// [operations.cancel][google.longrunning.Operations.CancelOperation].
1691 /// This will cause any inflight jobs to be cancelled and workflow-owned
1692 /// clusters to be deleted.
1693 ///
1694 /// The [Operation.metadata][google.longrunning.Operation.metadata] will be
1695 /// [WorkflowMetadata](https://cloud.google.com/dataproc/docs/reference/rpc/google.cloud.dataproc.v1#workflowmetadata).
1696 /// Also see [Using
1697 /// WorkflowMetadata](https://cloud.google.com/dataproc/docs/concepts/workflows/debugging#using_workflowmetadata).
1698 ///
1699 /// On successful completion,
1700 /// [Operation.response][google.longrunning.Operation.response] will be
1701 /// [Empty][google.protobuf.Empty].
1702 ///
1703 /// [google.cloud.dataproc.v1.WorkflowTemplateService.CreateWorkflowTemplate]: crate::client::WorkflowTemplateService::create_workflow_template
1704 /// [google.cloud.dataproc.v1.WorkflowTemplateService.DeleteWorkflowTemplate]: crate::client::WorkflowTemplateService::delete_workflow_template
1705 /// [google.cloud.dataproc.v1.WorkflowTemplateService.InstantiateWorkflowTemplate]: crate::client::WorkflowTemplateService::instantiate_workflow_template
1706 /// [google.longrunning.Operation.metadata]: google_cloud_longrunning::model::Operation::metadata
1707 /// [google.longrunning.Operation.response]: google_cloud_longrunning::model::Operation::result
1708 /// [google.protobuf.Empty]: wkt::Empty
1709 ///
1710 /// # Long running operations
1711 ///
1712 /// This method is used to start, and/or poll a [long-running Operation].
1713 /// The [Working with long-running operations] chapter in the [user guide]
1714 /// covers these operations in detail.
1715 ///
1716 /// [long-running operation]: https://google.aip.dev/151
1717 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1718 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1719 pub fn instantiate_inline_workflow_template(
1720 &self,
1721 ) -> super::builder::workflow_template_service::InstantiateInlineWorkflowTemplate {
1722 super::builder::workflow_template_service::InstantiateInlineWorkflowTemplate::new(
1723 self.inner.clone(),
1724 )
1725 }
1726
1727 /// Updates (replaces) workflow template. The updated template
1728 /// must contain version that matches the current server version.
1729 pub fn update_workflow_template(
1730 &self,
1731 ) -> super::builder::workflow_template_service::UpdateWorkflowTemplate {
1732 super::builder::workflow_template_service::UpdateWorkflowTemplate::new(self.inner.clone())
1733 }
1734
1735 /// Lists workflows that match the specified filter in the request.
1736 pub fn list_workflow_templates(
1737 &self,
1738 ) -> super::builder::workflow_template_service::ListWorkflowTemplates {
1739 super::builder::workflow_template_service::ListWorkflowTemplates::new(self.inner.clone())
1740 }
1741
1742 /// Deletes a workflow template. It does not cancel in-progress workflows.
1743 pub fn delete_workflow_template(
1744 &self,
1745 ) -> super::builder::workflow_template_service::DeleteWorkflowTemplate {
1746 super::builder::workflow_template_service::DeleteWorkflowTemplate::new(self.inner.clone())
1747 }
1748
1749 /// Sets the access control policy on the specified resource. Replaces
1750 /// any existing policy.
1751 ///
1752 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1753 /// errors.
1754 pub fn set_iam_policy(&self) -> super::builder::workflow_template_service::SetIamPolicy {
1755 super::builder::workflow_template_service::SetIamPolicy::new(self.inner.clone())
1756 }
1757
1758 /// Gets the access control policy for a resource. Returns an empty policy
1759 /// if the resource exists and does not have a policy set.
1760 pub fn get_iam_policy(&self) -> super::builder::workflow_template_service::GetIamPolicy {
1761 super::builder::workflow_template_service::GetIamPolicy::new(self.inner.clone())
1762 }
1763
1764 /// Returns permissions that a caller has on the specified resource. If the
1765 /// resource does not exist, this will return an empty set of
1766 /// permissions, not a `NOT_FOUND` error.
1767 ///
1768 /// Note: This operation is designed to be used for building
1769 /// permission-aware UIs and command-line tools, not for authorization
1770 /// checking. This operation may "fail open" without warning.
1771 pub fn test_iam_permissions(
1772 &self,
1773 ) -> super::builder::workflow_template_service::TestIamPermissions {
1774 super::builder::workflow_template_service::TestIamPermissions::new(self.inner.clone())
1775 }
1776
1777 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1778 ///
1779 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1780 pub fn list_operations(&self) -> super::builder::workflow_template_service::ListOperations {
1781 super::builder::workflow_template_service::ListOperations::new(self.inner.clone())
1782 }
1783
1784 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1785 ///
1786 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1787 pub fn get_operation(&self) -> super::builder::workflow_template_service::GetOperation {
1788 super::builder::workflow_template_service::GetOperation::new(self.inner.clone())
1789 }
1790
1791 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1792 ///
1793 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1794 pub fn delete_operation(&self) -> super::builder::workflow_template_service::DeleteOperation {
1795 super::builder::workflow_template_service::DeleteOperation::new(self.inner.clone())
1796 }
1797
1798 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1799 ///
1800 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1801 pub fn cancel_operation(&self) -> super::builder::workflow_template_service::CancelOperation {
1802 super::builder::workflow_template_service::CancelOperation::new(self.inner.clone())
1803 }
1804}