google_cloud_deploy_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 Deploy API.
20///
21/// # Example
22/// ```
23/// # use google_cloud_deploy_v1::client::CloudDeploy;
24/// use google_cloud_gax::paginator::ItemPaginator as _;
25/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
26/// let client = CloudDeploy::builder().build().await?;
27/// let parent = "parent_value";
28/// let mut list = client.list_delivery_pipelines()
29/// .set_parent(parent)
30/// .by_item();
31/// while let Some(item) = list.next().await.transpose()? {
32/// println!("{:?}", item);
33/// }
34/// # Ok(()) }
35/// ```
36///
37/// # Service Description
38///
39/// CloudDeploy service creates and manages Continuous Delivery operations
40/// on Google Cloud Platform via Skaffold (<https://skaffold.dev>).
41///
42/// # Configuration
43///
44/// To configure `CloudDeploy` use the `with_*` methods in the type returned
45/// by [builder()][CloudDeploy::builder]. The default configuration should
46/// work for most applications. Common configuration changes include
47///
48/// * [with_endpoint()]: by default this client uses the global default endpoint
49/// (`https://clouddeploy.googleapis.com`). Applications using regional
50/// endpoints or running in restricted networks (e.g. a network configured
51// with [Private Google Access with VPC Service Controls]) may want to
52/// override this default.
53/// * [with_credentials()]: by default this client uses
54/// [Application Default Credentials]. Applications using custom
55/// authentication may need to override this default.
56///
57/// [with_endpoint()]: super::builder::cloud_deploy::ClientBuilder::with_endpoint
58/// [with_credentials()]: super::builder::cloud_deploy::ClientBuilder::with_credentials
59/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
60/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
61///
62/// # Pooling and Cloning
63///
64/// `CloudDeploy` holds a connection pool internally, it is advised to
65/// create one and reuse it. You do not need to wrap `CloudDeploy` in
66/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
67/// already uses an `Arc` internally.
68#[derive(Clone, Debug)]
69pub struct CloudDeploy {
70 inner: std::sync::Arc<dyn super::stub::dynamic::CloudDeploy>,
71}
72
73impl CloudDeploy {
74 /// Returns a builder for [CloudDeploy].
75 ///
76 /// ```
77 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
78 /// # use google_cloud_deploy_v1::client::CloudDeploy;
79 /// let client = CloudDeploy::builder().build().await?;
80 /// # Ok(()) }
81 /// ```
82 pub fn builder() -> super::builder::cloud_deploy::ClientBuilder {
83 crate::new_client_builder(super::builder::cloud_deploy::client::Factory)
84 }
85
86 /// Creates a new client from the provided stub.
87 ///
88 /// The most common case for calling this function is in tests mocking the
89 /// client's behavior.
90 pub fn from_stub<T>(stub: T) -> Self
91 where
92 T: super::stub::CloudDeploy + 'static,
93 {
94 Self {
95 inner: std::sync::Arc::new(stub),
96 }
97 }
98
99 pub(crate) async fn new(
100 config: gaxi::options::ClientConfig,
101 ) -> crate::ClientBuilderResult<Self> {
102 let inner = Self::build_inner(config).await?;
103 Ok(Self { inner })
104 }
105
106 async fn build_inner(
107 conf: gaxi::options::ClientConfig,
108 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::CloudDeploy>> {
109 if gaxi::options::tracing_enabled(&conf) {
110 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
111 }
112 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
113 }
114
115 async fn build_transport(
116 conf: gaxi::options::ClientConfig,
117 ) -> crate::ClientBuilderResult<impl super::stub::CloudDeploy> {
118 super::transport::CloudDeploy::new(conf).await
119 }
120
121 async fn build_with_tracing(
122 conf: gaxi::options::ClientConfig,
123 ) -> crate::ClientBuilderResult<impl super::stub::CloudDeploy> {
124 Self::build_transport(conf)
125 .await
126 .map(super::tracing::CloudDeploy::new)
127 }
128
129 /// Lists DeliveryPipelines in a given project and location.
130 ///
131 /// # Example
132 /// ```
133 /// # use google_cloud_deploy_v1::client::CloudDeploy;
134 /// use google_cloud_gax::paginator::ItemPaginator as _;
135 /// use google_cloud_deploy_v1::Result;
136 /// async fn sample(
137 /// client: &CloudDeploy, parent: &str
138 /// ) -> Result<()> {
139 /// let mut list = client.list_delivery_pipelines()
140 /// .set_parent(parent)
141 /// .by_item();
142 /// while let Some(item) = list.next().await.transpose()? {
143 /// println!("{:?}", item);
144 /// }
145 /// Ok(())
146 /// }
147 /// ```
148 pub fn list_delivery_pipelines(&self) -> super::builder::cloud_deploy::ListDeliveryPipelines {
149 super::builder::cloud_deploy::ListDeliveryPipelines::new(self.inner.clone())
150 }
151
152 /// Gets details of a single DeliveryPipeline.
153 ///
154 /// # Example
155 /// ```
156 /// # use google_cloud_deploy_v1::client::CloudDeploy;
157 /// use google_cloud_deploy_v1::Result;
158 /// async fn sample(
159 /// client: &CloudDeploy, name: &str
160 /// ) -> Result<()> {
161 /// let response = client.get_delivery_pipeline()
162 /// .set_name(name)
163 /// .send().await?;
164 /// println!("response {:?}", response);
165 /// Ok(())
166 /// }
167 /// ```
168 pub fn get_delivery_pipeline(&self) -> super::builder::cloud_deploy::GetDeliveryPipeline {
169 super::builder::cloud_deploy::GetDeliveryPipeline::new(self.inner.clone())
170 }
171
172 /// Creates a new DeliveryPipeline in a given project and location.
173 ///
174 /// # Long running operations
175 ///
176 /// This method is used to start, and/or poll a [long-running Operation].
177 /// The [Working with long-running operations] chapter in the [user guide]
178 /// covers these operations in detail.
179 ///
180 /// [long-running operation]: https://google.aip.dev/151
181 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
182 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
183 ///
184 /// # Example
185 /// ```
186 /// # use google_cloud_deploy_v1::client::CloudDeploy;
187 /// use google_cloud_lro::Poller;
188 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
189 /// use google_cloud_deploy_v1::Result;
190 /// async fn sample(
191 /// client: &CloudDeploy, parent: &str
192 /// ) -> Result<()> {
193 /// let response = client.create_delivery_pipeline()
194 /// .set_parent(parent)
195 /// .set_delivery_pipeline(
196 /// DeliveryPipeline::new()/* set fields */
197 /// )
198 /// .poller().until_done().await?;
199 /// println!("response {:?}", response);
200 /// Ok(())
201 /// }
202 /// ```
203 pub fn create_delivery_pipeline(&self) -> super::builder::cloud_deploy::CreateDeliveryPipeline {
204 super::builder::cloud_deploy::CreateDeliveryPipeline::new(self.inner.clone())
205 }
206
207 /// Updates the parameters of a single DeliveryPipeline.
208 ///
209 /// # Long running operations
210 ///
211 /// This method is used to start, and/or poll a [long-running Operation].
212 /// The [Working with long-running operations] chapter in the [user guide]
213 /// covers these operations in detail.
214 ///
215 /// [long-running operation]: https://google.aip.dev/151
216 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
217 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
218 ///
219 /// # Example
220 /// ```
221 /// # use google_cloud_deploy_v1::client::CloudDeploy;
222 /// use google_cloud_lro::Poller;
223 /// # extern crate wkt as google_cloud_wkt;
224 /// use google_cloud_wkt::FieldMask;
225 /// use google_cloud_deploy_v1::model::DeliveryPipeline;
226 /// use google_cloud_deploy_v1::Result;
227 /// async fn sample(
228 /// client: &CloudDeploy, name: &str
229 /// ) -> Result<()> {
230 /// let response = client.update_delivery_pipeline()
231 /// .set_delivery_pipeline(
232 /// DeliveryPipeline::new().set_name(name)/* set fields */
233 /// )
234 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
235 /// .poller().until_done().await?;
236 /// println!("response {:?}", response);
237 /// Ok(())
238 /// }
239 /// ```
240 pub fn update_delivery_pipeline(&self) -> super::builder::cloud_deploy::UpdateDeliveryPipeline {
241 super::builder::cloud_deploy::UpdateDeliveryPipeline::new(self.inner.clone())
242 }
243
244 /// Deletes a single DeliveryPipeline.
245 ///
246 /// # Long running operations
247 ///
248 /// This method is used to start, and/or poll a [long-running Operation].
249 /// The [Working with long-running operations] chapter in the [user guide]
250 /// covers these operations in detail.
251 ///
252 /// [long-running operation]: https://google.aip.dev/151
253 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
254 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
255 ///
256 /// # Example
257 /// ```
258 /// # use google_cloud_deploy_v1::client::CloudDeploy;
259 /// use google_cloud_lro::Poller;
260 /// use google_cloud_deploy_v1::Result;
261 /// async fn sample(
262 /// client: &CloudDeploy, name: &str
263 /// ) -> Result<()> {
264 /// client.delete_delivery_pipeline()
265 /// .set_name(name)
266 /// .poller().until_done().await?;
267 /// Ok(())
268 /// }
269 /// ```
270 pub fn delete_delivery_pipeline(&self) -> super::builder::cloud_deploy::DeleteDeliveryPipeline {
271 super::builder::cloud_deploy::DeleteDeliveryPipeline::new(self.inner.clone())
272 }
273
274 /// Lists Targets in a given project and location.
275 ///
276 /// # Example
277 /// ```
278 /// # use google_cloud_deploy_v1::client::CloudDeploy;
279 /// use google_cloud_gax::paginator::ItemPaginator as _;
280 /// use google_cloud_deploy_v1::Result;
281 /// async fn sample(
282 /// client: &CloudDeploy, parent: &str
283 /// ) -> Result<()> {
284 /// let mut list = client.list_targets()
285 /// .set_parent(parent)
286 /// .by_item();
287 /// while let Some(item) = list.next().await.transpose()? {
288 /// println!("{:?}", item);
289 /// }
290 /// Ok(())
291 /// }
292 /// ```
293 pub fn list_targets(&self) -> super::builder::cloud_deploy::ListTargets {
294 super::builder::cloud_deploy::ListTargets::new(self.inner.clone())
295 }
296
297 /// Creates a `Rollout` to roll back the specified target.
298 ///
299 /// # Example
300 /// ```
301 /// # use google_cloud_deploy_v1::client::CloudDeploy;
302 /// use google_cloud_deploy_v1::Result;
303 /// async fn sample(
304 /// client: &CloudDeploy
305 /// ) -> Result<()> {
306 /// let response = client.rollback_target()
307 /// /* set fields */
308 /// .send().await?;
309 /// println!("response {:?}", response);
310 /// Ok(())
311 /// }
312 /// ```
313 pub fn rollback_target(&self) -> super::builder::cloud_deploy::RollbackTarget {
314 super::builder::cloud_deploy::RollbackTarget::new(self.inner.clone())
315 }
316
317 /// Gets details of a single Target.
318 ///
319 /// # Example
320 /// ```
321 /// # use google_cloud_deploy_v1::client::CloudDeploy;
322 /// use google_cloud_deploy_v1::Result;
323 /// async fn sample(
324 /// client: &CloudDeploy, name: &str
325 /// ) -> Result<()> {
326 /// let response = client.get_target()
327 /// .set_name(name)
328 /// .send().await?;
329 /// println!("response {:?}", response);
330 /// Ok(())
331 /// }
332 /// ```
333 pub fn get_target(&self) -> super::builder::cloud_deploy::GetTarget {
334 super::builder::cloud_deploy::GetTarget::new(self.inner.clone())
335 }
336
337 /// Creates a new Target in a given project and location.
338 ///
339 /// # Long running operations
340 ///
341 /// This method is used to start, and/or poll a [long-running Operation].
342 /// The [Working with long-running operations] chapter in the [user guide]
343 /// covers these operations in detail.
344 ///
345 /// [long-running operation]: https://google.aip.dev/151
346 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
347 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
348 ///
349 /// # Example
350 /// ```
351 /// # use google_cloud_deploy_v1::client::CloudDeploy;
352 /// use google_cloud_lro::Poller;
353 /// use google_cloud_deploy_v1::model::Target;
354 /// use google_cloud_deploy_v1::Result;
355 /// async fn sample(
356 /// client: &CloudDeploy, parent: &str
357 /// ) -> Result<()> {
358 /// let response = client.create_target()
359 /// .set_parent(parent)
360 /// .set_target_id("target_id_value")
361 /// .set_target(
362 /// Target::new()/* set fields */
363 /// )
364 /// .poller().until_done().await?;
365 /// println!("response {:?}", response);
366 /// Ok(())
367 /// }
368 /// ```
369 pub fn create_target(&self) -> super::builder::cloud_deploy::CreateTarget {
370 super::builder::cloud_deploy::CreateTarget::new(self.inner.clone())
371 }
372
373 /// Updates the parameters of a single Target.
374 ///
375 /// # Long running operations
376 ///
377 /// This method is used to start, and/or poll a [long-running Operation].
378 /// The [Working with long-running operations] chapter in the [user guide]
379 /// covers these operations in detail.
380 ///
381 /// [long-running operation]: https://google.aip.dev/151
382 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
383 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
384 ///
385 /// # Example
386 /// ```
387 /// # use google_cloud_deploy_v1::client::CloudDeploy;
388 /// use google_cloud_lro::Poller;
389 /// # extern crate wkt as google_cloud_wkt;
390 /// use google_cloud_wkt::FieldMask;
391 /// use google_cloud_deploy_v1::model::Target;
392 /// use google_cloud_deploy_v1::Result;
393 /// async fn sample(
394 /// client: &CloudDeploy, name: &str
395 /// ) -> Result<()> {
396 /// let response = client.update_target()
397 /// .set_target(
398 /// Target::new().set_name(name)/* set fields */
399 /// )
400 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
401 /// .poller().until_done().await?;
402 /// println!("response {:?}", response);
403 /// Ok(())
404 /// }
405 /// ```
406 pub fn update_target(&self) -> super::builder::cloud_deploy::UpdateTarget {
407 super::builder::cloud_deploy::UpdateTarget::new(self.inner.clone())
408 }
409
410 /// Deletes a single Target.
411 ///
412 /// # Long running operations
413 ///
414 /// This method is used to start, and/or poll a [long-running Operation].
415 /// The [Working with long-running operations] chapter in the [user guide]
416 /// covers these operations in detail.
417 ///
418 /// [long-running operation]: https://google.aip.dev/151
419 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
420 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
421 ///
422 /// # Example
423 /// ```
424 /// # use google_cloud_deploy_v1::client::CloudDeploy;
425 /// use google_cloud_lro::Poller;
426 /// use google_cloud_deploy_v1::Result;
427 /// async fn sample(
428 /// client: &CloudDeploy, name: &str
429 /// ) -> Result<()> {
430 /// client.delete_target()
431 /// .set_name(name)
432 /// .poller().until_done().await?;
433 /// Ok(())
434 /// }
435 /// ```
436 pub fn delete_target(&self) -> super::builder::cloud_deploy::DeleteTarget {
437 super::builder::cloud_deploy::DeleteTarget::new(self.inner.clone())
438 }
439
440 /// Lists CustomTargetTypes in a given project and location.
441 ///
442 /// # Example
443 /// ```
444 /// # use google_cloud_deploy_v1::client::CloudDeploy;
445 /// use google_cloud_gax::paginator::ItemPaginator as _;
446 /// use google_cloud_deploy_v1::Result;
447 /// async fn sample(
448 /// client: &CloudDeploy, parent: &str
449 /// ) -> Result<()> {
450 /// let mut list = client.list_custom_target_types()
451 /// .set_parent(parent)
452 /// .by_item();
453 /// while let Some(item) = list.next().await.transpose()? {
454 /// println!("{:?}", item);
455 /// }
456 /// Ok(())
457 /// }
458 /// ```
459 pub fn list_custom_target_types(&self) -> super::builder::cloud_deploy::ListCustomTargetTypes {
460 super::builder::cloud_deploy::ListCustomTargetTypes::new(self.inner.clone())
461 }
462
463 /// Gets details of a single CustomTargetType.
464 ///
465 /// # Example
466 /// ```
467 /// # use google_cloud_deploy_v1::client::CloudDeploy;
468 /// use google_cloud_deploy_v1::Result;
469 /// async fn sample(
470 /// client: &CloudDeploy, name: &str
471 /// ) -> Result<()> {
472 /// let response = client.get_custom_target_type()
473 /// .set_name(name)
474 /// .send().await?;
475 /// println!("response {:?}", response);
476 /// Ok(())
477 /// }
478 /// ```
479 pub fn get_custom_target_type(&self) -> super::builder::cloud_deploy::GetCustomTargetType {
480 super::builder::cloud_deploy::GetCustomTargetType::new(self.inner.clone())
481 }
482
483 /// Creates a new CustomTargetType in a given project and location.
484 ///
485 /// # Long running operations
486 ///
487 /// This method is used to start, and/or poll a [long-running Operation].
488 /// The [Working with long-running operations] chapter in the [user guide]
489 /// covers these operations in detail.
490 ///
491 /// [long-running operation]: https://google.aip.dev/151
492 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
493 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
494 ///
495 /// # Example
496 /// ```
497 /// # use google_cloud_deploy_v1::client::CloudDeploy;
498 /// use google_cloud_lro::Poller;
499 /// use google_cloud_deploy_v1::model::CustomTargetType;
500 /// use google_cloud_deploy_v1::Result;
501 /// async fn sample(
502 /// client: &CloudDeploy, parent: &str
503 /// ) -> Result<()> {
504 /// let response = client.create_custom_target_type()
505 /// .set_parent(parent)
506 /// .set_custom_target_type(
507 /// CustomTargetType::new()/* set fields */
508 /// )
509 /// .poller().until_done().await?;
510 /// println!("response {:?}", response);
511 /// Ok(())
512 /// }
513 /// ```
514 pub fn create_custom_target_type(
515 &self,
516 ) -> super::builder::cloud_deploy::CreateCustomTargetType {
517 super::builder::cloud_deploy::CreateCustomTargetType::new(self.inner.clone())
518 }
519
520 /// Updates a single CustomTargetType.
521 ///
522 /// # Long running operations
523 ///
524 /// This method is used to start, and/or poll a [long-running Operation].
525 /// The [Working with long-running operations] chapter in the [user guide]
526 /// covers these operations in detail.
527 ///
528 /// [long-running operation]: https://google.aip.dev/151
529 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
530 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
531 ///
532 /// # Example
533 /// ```
534 /// # use google_cloud_deploy_v1::client::CloudDeploy;
535 /// use google_cloud_lro::Poller;
536 /// # extern crate wkt as google_cloud_wkt;
537 /// use google_cloud_wkt::FieldMask;
538 /// use google_cloud_deploy_v1::model::CustomTargetType;
539 /// use google_cloud_deploy_v1::Result;
540 /// async fn sample(
541 /// client: &CloudDeploy, name: &str
542 /// ) -> Result<()> {
543 /// let response = client.update_custom_target_type()
544 /// .set_custom_target_type(
545 /// CustomTargetType::new().set_name(name)/* set fields */
546 /// )
547 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
548 /// .poller().until_done().await?;
549 /// println!("response {:?}", response);
550 /// Ok(())
551 /// }
552 /// ```
553 pub fn update_custom_target_type(
554 &self,
555 ) -> super::builder::cloud_deploy::UpdateCustomTargetType {
556 super::builder::cloud_deploy::UpdateCustomTargetType::new(self.inner.clone())
557 }
558
559 /// Deletes a single CustomTargetType.
560 ///
561 /// # Long running operations
562 ///
563 /// This method is used to start, and/or poll a [long-running Operation].
564 /// The [Working with long-running operations] chapter in the [user guide]
565 /// covers these operations in detail.
566 ///
567 /// [long-running operation]: https://google.aip.dev/151
568 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
569 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
570 ///
571 /// # Example
572 /// ```
573 /// # use google_cloud_deploy_v1::client::CloudDeploy;
574 /// use google_cloud_lro::Poller;
575 /// use google_cloud_deploy_v1::Result;
576 /// async fn sample(
577 /// client: &CloudDeploy, name: &str
578 /// ) -> Result<()> {
579 /// client.delete_custom_target_type()
580 /// .set_name(name)
581 /// .poller().until_done().await?;
582 /// Ok(())
583 /// }
584 /// ```
585 pub fn delete_custom_target_type(
586 &self,
587 ) -> super::builder::cloud_deploy::DeleteCustomTargetType {
588 super::builder::cloud_deploy::DeleteCustomTargetType::new(self.inner.clone())
589 }
590
591 /// Lists Releases in a given project and location.
592 ///
593 /// # Example
594 /// ```
595 /// # use google_cloud_deploy_v1::client::CloudDeploy;
596 /// use google_cloud_gax::paginator::ItemPaginator as _;
597 /// use google_cloud_deploy_v1::Result;
598 /// async fn sample(
599 /// client: &CloudDeploy, parent: &str
600 /// ) -> Result<()> {
601 /// let mut list = client.list_releases()
602 /// .set_parent(parent)
603 /// .by_item();
604 /// while let Some(item) = list.next().await.transpose()? {
605 /// println!("{:?}", item);
606 /// }
607 /// Ok(())
608 /// }
609 /// ```
610 pub fn list_releases(&self) -> super::builder::cloud_deploy::ListReleases {
611 super::builder::cloud_deploy::ListReleases::new(self.inner.clone())
612 }
613
614 /// Gets details of a single Release.
615 ///
616 /// # Example
617 /// ```
618 /// # use google_cloud_deploy_v1::client::CloudDeploy;
619 /// use google_cloud_deploy_v1::Result;
620 /// async fn sample(
621 /// client: &CloudDeploy, name: &str
622 /// ) -> Result<()> {
623 /// let response = client.get_release()
624 /// .set_name(name)
625 /// .send().await?;
626 /// println!("response {:?}", response);
627 /// Ok(())
628 /// }
629 /// ```
630 pub fn get_release(&self) -> super::builder::cloud_deploy::GetRelease {
631 super::builder::cloud_deploy::GetRelease::new(self.inner.clone())
632 }
633
634 /// Creates a new Release in a given project and location.
635 ///
636 /// # Long running operations
637 ///
638 /// This method is used to start, and/or poll a [long-running Operation].
639 /// The [Working with long-running operations] chapter in the [user guide]
640 /// covers these operations in detail.
641 ///
642 /// [long-running operation]: https://google.aip.dev/151
643 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
644 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
645 ///
646 /// # Example
647 /// ```
648 /// # use google_cloud_deploy_v1::client::CloudDeploy;
649 /// use google_cloud_lro::Poller;
650 /// use google_cloud_deploy_v1::model::Release;
651 /// use google_cloud_deploy_v1::Result;
652 /// async fn sample(
653 /// client: &CloudDeploy, parent: &str
654 /// ) -> Result<()> {
655 /// let response = client.create_release()
656 /// .set_parent(parent)
657 /// .set_release_id("release_id_value")
658 /// .set_release(
659 /// Release::new()/* set fields */
660 /// )
661 /// .poller().until_done().await?;
662 /// println!("response {:?}", response);
663 /// Ok(())
664 /// }
665 /// ```
666 pub fn create_release(&self) -> super::builder::cloud_deploy::CreateRelease {
667 super::builder::cloud_deploy::CreateRelease::new(self.inner.clone())
668 }
669
670 /// Abandons a Release in the Delivery Pipeline.
671 ///
672 /// # Example
673 /// ```
674 /// # use google_cloud_deploy_v1::client::CloudDeploy;
675 /// use google_cloud_deploy_v1::Result;
676 /// async fn sample(
677 /// client: &CloudDeploy
678 /// ) -> Result<()> {
679 /// let response = client.abandon_release()
680 /// /* set fields */
681 /// .send().await?;
682 /// println!("response {:?}", response);
683 /// Ok(())
684 /// }
685 /// ```
686 pub fn abandon_release(&self) -> super::builder::cloud_deploy::AbandonRelease {
687 super::builder::cloud_deploy::AbandonRelease::new(self.inner.clone())
688 }
689
690 /// Creates a new DeployPolicy in a given project and location.
691 ///
692 /// # Long running operations
693 ///
694 /// This method is used to start, and/or poll a [long-running Operation].
695 /// The [Working with long-running operations] chapter in the [user guide]
696 /// covers these operations in detail.
697 ///
698 /// [long-running operation]: https://google.aip.dev/151
699 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
700 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
701 ///
702 /// # Example
703 /// ```
704 /// # use google_cloud_deploy_v1::client::CloudDeploy;
705 /// use google_cloud_lro::Poller;
706 /// use google_cloud_deploy_v1::model::DeployPolicy;
707 /// use google_cloud_deploy_v1::Result;
708 /// async fn sample(
709 /// client: &CloudDeploy, parent: &str
710 /// ) -> Result<()> {
711 /// let response = client.create_deploy_policy()
712 /// .set_parent(parent)
713 /// .set_deploy_policy(
714 /// DeployPolicy::new()/* set fields */
715 /// )
716 /// .poller().until_done().await?;
717 /// println!("response {:?}", response);
718 /// Ok(())
719 /// }
720 /// ```
721 pub fn create_deploy_policy(&self) -> super::builder::cloud_deploy::CreateDeployPolicy {
722 super::builder::cloud_deploy::CreateDeployPolicy::new(self.inner.clone())
723 }
724
725 /// Updates the parameters of a single DeployPolicy.
726 ///
727 /// # Long running operations
728 ///
729 /// This method is used to start, and/or poll a [long-running Operation].
730 /// The [Working with long-running operations] chapter in the [user guide]
731 /// covers these operations in detail.
732 ///
733 /// [long-running operation]: https://google.aip.dev/151
734 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
735 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
736 ///
737 /// # Example
738 /// ```
739 /// # use google_cloud_deploy_v1::client::CloudDeploy;
740 /// use google_cloud_lro::Poller;
741 /// # extern crate wkt as google_cloud_wkt;
742 /// use google_cloud_wkt::FieldMask;
743 /// use google_cloud_deploy_v1::model::DeployPolicy;
744 /// use google_cloud_deploy_v1::Result;
745 /// async fn sample(
746 /// client: &CloudDeploy, name: &str
747 /// ) -> Result<()> {
748 /// let response = client.update_deploy_policy()
749 /// .set_deploy_policy(
750 /// DeployPolicy::new().set_name(name)/* set fields */
751 /// )
752 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
753 /// .poller().until_done().await?;
754 /// println!("response {:?}", response);
755 /// Ok(())
756 /// }
757 /// ```
758 pub fn update_deploy_policy(&self) -> super::builder::cloud_deploy::UpdateDeployPolicy {
759 super::builder::cloud_deploy::UpdateDeployPolicy::new(self.inner.clone())
760 }
761
762 /// Deletes a single DeployPolicy.
763 ///
764 /// # Long running operations
765 ///
766 /// This method is used to start, and/or poll a [long-running Operation].
767 /// The [Working with long-running operations] chapter in the [user guide]
768 /// covers these operations in detail.
769 ///
770 /// [long-running operation]: https://google.aip.dev/151
771 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
772 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
773 ///
774 /// # Example
775 /// ```
776 /// # use google_cloud_deploy_v1::client::CloudDeploy;
777 /// use google_cloud_lro::Poller;
778 /// use google_cloud_deploy_v1::Result;
779 /// async fn sample(
780 /// client: &CloudDeploy, name: &str
781 /// ) -> Result<()> {
782 /// client.delete_deploy_policy()
783 /// .set_name(name)
784 /// .poller().until_done().await?;
785 /// Ok(())
786 /// }
787 /// ```
788 pub fn delete_deploy_policy(&self) -> super::builder::cloud_deploy::DeleteDeployPolicy {
789 super::builder::cloud_deploy::DeleteDeployPolicy::new(self.inner.clone())
790 }
791
792 /// Lists DeployPolicies in a given project and location.
793 ///
794 /// # Example
795 /// ```
796 /// # use google_cloud_deploy_v1::client::CloudDeploy;
797 /// use google_cloud_gax::paginator::ItemPaginator as _;
798 /// use google_cloud_deploy_v1::Result;
799 /// async fn sample(
800 /// client: &CloudDeploy, parent: &str
801 /// ) -> Result<()> {
802 /// let mut list = client.list_deploy_policies()
803 /// .set_parent(parent)
804 /// .by_item();
805 /// while let Some(item) = list.next().await.transpose()? {
806 /// println!("{:?}", item);
807 /// }
808 /// Ok(())
809 /// }
810 /// ```
811 pub fn list_deploy_policies(&self) -> super::builder::cloud_deploy::ListDeployPolicies {
812 super::builder::cloud_deploy::ListDeployPolicies::new(self.inner.clone())
813 }
814
815 /// Gets details of a single DeployPolicy.
816 ///
817 /// # Example
818 /// ```
819 /// # use google_cloud_deploy_v1::client::CloudDeploy;
820 /// use google_cloud_deploy_v1::Result;
821 /// async fn sample(
822 /// client: &CloudDeploy, name: &str
823 /// ) -> Result<()> {
824 /// let response = client.get_deploy_policy()
825 /// .set_name(name)
826 /// .send().await?;
827 /// println!("response {:?}", response);
828 /// Ok(())
829 /// }
830 /// ```
831 pub fn get_deploy_policy(&self) -> super::builder::cloud_deploy::GetDeployPolicy {
832 super::builder::cloud_deploy::GetDeployPolicy::new(self.inner.clone())
833 }
834
835 /// Approves a Rollout.
836 ///
837 /// # Example
838 /// ```
839 /// # use google_cloud_deploy_v1::client::CloudDeploy;
840 /// use google_cloud_deploy_v1::Result;
841 /// async fn sample(
842 /// client: &CloudDeploy
843 /// ) -> Result<()> {
844 /// let response = client.approve_rollout()
845 /// /* set fields */
846 /// .send().await?;
847 /// println!("response {:?}", response);
848 /// Ok(())
849 /// }
850 /// ```
851 pub fn approve_rollout(&self) -> super::builder::cloud_deploy::ApproveRollout {
852 super::builder::cloud_deploy::ApproveRollout::new(self.inner.clone())
853 }
854
855 /// Advances a Rollout in a given project and location.
856 ///
857 /// # Example
858 /// ```
859 /// # use google_cloud_deploy_v1::client::CloudDeploy;
860 /// use google_cloud_deploy_v1::Result;
861 /// async fn sample(
862 /// client: &CloudDeploy
863 /// ) -> Result<()> {
864 /// let response = client.advance_rollout()
865 /// /* set fields */
866 /// .send().await?;
867 /// println!("response {:?}", response);
868 /// Ok(())
869 /// }
870 /// ```
871 pub fn advance_rollout(&self) -> super::builder::cloud_deploy::AdvanceRollout {
872 super::builder::cloud_deploy::AdvanceRollout::new(self.inner.clone())
873 }
874
875 /// Cancels a Rollout in a given project and location.
876 ///
877 /// # Example
878 /// ```
879 /// # use google_cloud_deploy_v1::client::CloudDeploy;
880 /// use google_cloud_deploy_v1::Result;
881 /// async fn sample(
882 /// client: &CloudDeploy
883 /// ) -> Result<()> {
884 /// let response = client.cancel_rollout()
885 /// /* set fields */
886 /// .send().await?;
887 /// println!("response {:?}", response);
888 /// Ok(())
889 /// }
890 /// ```
891 pub fn cancel_rollout(&self) -> super::builder::cloud_deploy::CancelRollout {
892 super::builder::cloud_deploy::CancelRollout::new(self.inner.clone())
893 }
894
895 /// Lists Rollouts in a given project and location.
896 ///
897 /// # Example
898 /// ```
899 /// # use google_cloud_deploy_v1::client::CloudDeploy;
900 /// use google_cloud_gax::paginator::ItemPaginator as _;
901 /// use google_cloud_deploy_v1::Result;
902 /// async fn sample(
903 /// client: &CloudDeploy, parent: &str
904 /// ) -> Result<()> {
905 /// let mut list = client.list_rollouts()
906 /// .set_parent(parent)
907 /// .by_item();
908 /// while let Some(item) = list.next().await.transpose()? {
909 /// println!("{:?}", item);
910 /// }
911 /// Ok(())
912 /// }
913 /// ```
914 pub fn list_rollouts(&self) -> super::builder::cloud_deploy::ListRollouts {
915 super::builder::cloud_deploy::ListRollouts::new(self.inner.clone())
916 }
917
918 /// Gets details of a single Rollout.
919 ///
920 /// # Example
921 /// ```
922 /// # use google_cloud_deploy_v1::client::CloudDeploy;
923 /// use google_cloud_deploy_v1::Result;
924 /// async fn sample(
925 /// client: &CloudDeploy, name: &str
926 /// ) -> Result<()> {
927 /// let response = client.get_rollout()
928 /// .set_name(name)
929 /// .send().await?;
930 /// println!("response {:?}", response);
931 /// Ok(())
932 /// }
933 /// ```
934 pub fn get_rollout(&self) -> super::builder::cloud_deploy::GetRollout {
935 super::builder::cloud_deploy::GetRollout::new(self.inner.clone())
936 }
937
938 /// Creates a new Rollout in a given project and location.
939 ///
940 /// # Long running operations
941 ///
942 /// This method is used to start, and/or poll a [long-running Operation].
943 /// The [Working with long-running operations] chapter in the [user guide]
944 /// covers these operations in detail.
945 ///
946 /// [long-running operation]: https://google.aip.dev/151
947 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
948 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
949 ///
950 /// # Example
951 /// ```
952 /// # use google_cloud_deploy_v1::client::CloudDeploy;
953 /// use google_cloud_lro::Poller;
954 /// use google_cloud_deploy_v1::model::Rollout;
955 /// use google_cloud_deploy_v1::Result;
956 /// async fn sample(
957 /// client: &CloudDeploy, parent: &str
958 /// ) -> Result<()> {
959 /// let response = client.create_rollout()
960 /// .set_parent(parent)
961 /// .set_rollout_id("rollout_id_value")
962 /// .set_rollout(
963 /// Rollout::new()/* set fields */
964 /// )
965 /// .poller().until_done().await?;
966 /// println!("response {:?}", response);
967 /// Ok(())
968 /// }
969 /// ```
970 pub fn create_rollout(&self) -> super::builder::cloud_deploy::CreateRollout {
971 super::builder::cloud_deploy::CreateRollout::new(self.inner.clone())
972 }
973
974 /// Ignores the specified Job in a Rollout.
975 ///
976 /// # Example
977 /// ```
978 /// # use google_cloud_deploy_v1::client::CloudDeploy;
979 /// use google_cloud_deploy_v1::Result;
980 /// async fn sample(
981 /// client: &CloudDeploy
982 /// ) -> Result<()> {
983 /// let response = client.ignore_job()
984 /// /* set fields */
985 /// .send().await?;
986 /// println!("response {:?}", response);
987 /// Ok(())
988 /// }
989 /// ```
990 pub fn ignore_job(&self) -> super::builder::cloud_deploy::IgnoreJob {
991 super::builder::cloud_deploy::IgnoreJob::new(self.inner.clone())
992 }
993
994 /// Retries the specified Job in a Rollout.
995 ///
996 /// # Example
997 /// ```
998 /// # use google_cloud_deploy_v1::client::CloudDeploy;
999 /// use google_cloud_deploy_v1::Result;
1000 /// async fn sample(
1001 /// client: &CloudDeploy
1002 /// ) -> Result<()> {
1003 /// let response = client.retry_job()
1004 /// /* set fields */
1005 /// .send().await?;
1006 /// println!("response {:?}", response);
1007 /// Ok(())
1008 /// }
1009 /// ```
1010 pub fn retry_job(&self) -> super::builder::cloud_deploy::RetryJob {
1011 super::builder::cloud_deploy::RetryJob::new(self.inner.clone())
1012 }
1013
1014 /// Lists JobRuns in a given project and location.
1015 ///
1016 /// # Example
1017 /// ```
1018 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1019 /// use google_cloud_gax::paginator::ItemPaginator as _;
1020 /// use google_cloud_deploy_v1::Result;
1021 /// async fn sample(
1022 /// client: &CloudDeploy, parent: &str
1023 /// ) -> Result<()> {
1024 /// let mut list = client.list_job_runs()
1025 /// .set_parent(parent)
1026 /// .by_item();
1027 /// while let Some(item) = list.next().await.transpose()? {
1028 /// println!("{:?}", item);
1029 /// }
1030 /// Ok(())
1031 /// }
1032 /// ```
1033 pub fn list_job_runs(&self) -> super::builder::cloud_deploy::ListJobRuns {
1034 super::builder::cloud_deploy::ListJobRuns::new(self.inner.clone())
1035 }
1036
1037 /// Gets details of a single JobRun.
1038 ///
1039 /// # Example
1040 /// ```
1041 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1042 /// use google_cloud_deploy_v1::Result;
1043 /// async fn sample(
1044 /// client: &CloudDeploy, name: &str
1045 /// ) -> Result<()> {
1046 /// let response = client.get_job_run()
1047 /// .set_name(name)
1048 /// .send().await?;
1049 /// println!("response {:?}", response);
1050 /// Ok(())
1051 /// }
1052 /// ```
1053 pub fn get_job_run(&self) -> super::builder::cloud_deploy::GetJobRun {
1054 super::builder::cloud_deploy::GetJobRun::new(self.inner.clone())
1055 }
1056
1057 /// Terminates a Job Run in a given project and location.
1058 ///
1059 /// # Example
1060 /// ```
1061 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1062 /// use google_cloud_deploy_v1::Result;
1063 /// async fn sample(
1064 /// client: &CloudDeploy
1065 /// ) -> Result<()> {
1066 /// let response = client.terminate_job_run()
1067 /// /* set fields */
1068 /// .send().await?;
1069 /// println!("response {:?}", response);
1070 /// Ok(())
1071 /// }
1072 /// ```
1073 pub fn terminate_job_run(&self) -> super::builder::cloud_deploy::TerminateJobRun {
1074 super::builder::cloud_deploy::TerminateJobRun::new(self.inner.clone())
1075 }
1076
1077 /// Gets the configuration for a location.
1078 ///
1079 /// # Example
1080 /// ```
1081 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1082 /// use google_cloud_deploy_v1::Result;
1083 /// async fn sample(
1084 /// client: &CloudDeploy, name: &str
1085 /// ) -> Result<()> {
1086 /// let response = client.get_config()
1087 /// .set_name(name)
1088 /// .send().await?;
1089 /// println!("response {:?}", response);
1090 /// Ok(())
1091 /// }
1092 /// ```
1093 pub fn get_config(&self) -> super::builder::cloud_deploy::GetConfig {
1094 super::builder::cloud_deploy::GetConfig::new(self.inner.clone())
1095 }
1096
1097 /// Creates a new Automation in a given project and location.
1098 ///
1099 /// # Long running operations
1100 ///
1101 /// This method is used to start, and/or poll a [long-running Operation].
1102 /// The [Working with long-running operations] chapter in the [user guide]
1103 /// covers these operations in detail.
1104 ///
1105 /// [long-running operation]: https://google.aip.dev/151
1106 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1107 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1108 ///
1109 /// # Example
1110 /// ```
1111 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1112 /// use google_cloud_lro::Poller;
1113 /// use google_cloud_deploy_v1::model::Automation;
1114 /// use google_cloud_deploy_v1::Result;
1115 /// async fn sample(
1116 /// client: &CloudDeploy, parent: &str
1117 /// ) -> Result<()> {
1118 /// let response = client.create_automation()
1119 /// .set_parent(parent)
1120 /// .set_automation_id("automation_id_value")
1121 /// .set_automation(
1122 /// Automation::new()/* set fields */
1123 /// )
1124 /// .poller().until_done().await?;
1125 /// println!("response {:?}", response);
1126 /// Ok(())
1127 /// }
1128 /// ```
1129 pub fn create_automation(&self) -> super::builder::cloud_deploy::CreateAutomation {
1130 super::builder::cloud_deploy::CreateAutomation::new(self.inner.clone())
1131 }
1132
1133 /// Updates the parameters of a single Automation resource.
1134 ///
1135 /// # Long running operations
1136 ///
1137 /// This method is used to start, and/or poll a [long-running Operation].
1138 /// The [Working with long-running operations] chapter in the [user guide]
1139 /// covers these operations in detail.
1140 ///
1141 /// [long-running operation]: https://google.aip.dev/151
1142 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1143 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1144 ///
1145 /// # Example
1146 /// ```
1147 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1148 /// use google_cloud_lro::Poller;
1149 /// # extern crate wkt as google_cloud_wkt;
1150 /// use google_cloud_wkt::FieldMask;
1151 /// use google_cloud_deploy_v1::model::Automation;
1152 /// use google_cloud_deploy_v1::Result;
1153 /// async fn sample(
1154 /// client: &CloudDeploy, name: &str
1155 /// ) -> Result<()> {
1156 /// let response = client.update_automation()
1157 /// .set_automation(
1158 /// Automation::new().set_name(name)/* set fields */
1159 /// )
1160 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
1161 /// .poller().until_done().await?;
1162 /// println!("response {:?}", response);
1163 /// Ok(())
1164 /// }
1165 /// ```
1166 pub fn update_automation(&self) -> super::builder::cloud_deploy::UpdateAutomation {
1167 super::builder::cloud_deploy::UpdateAutomation::new(self.inner.clone())
1168 }
1169
1170 /// Deletes a single Automation resource.
1171 ///
1172 /// # Long running operations
1173 ///
1174 /// This method is used to start, and/or poll a [long-running Operation].
1175 /// The [Working with long-running operations] chapter in the [user guide]
1176 /// covers these operations in detail.
1177 ///
1178 /// [long-running operation]: https://google.aip.dev/151
1179 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
1180 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
1181 ///
1182 /// # Example
1183 /// ```
1184 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1185 /// use google_cloud_lro::Poller;
1186 /// use google_cloud_deploy_v1::Result;
1187 /// async fn sample(
1188 /// client: &CloudDeploy, name: &str
1189 /// ) -> Result<()> {
1190 /// client.delete_automation()
1191 /// .set_name(name)
1192 /// .poller().until_done().await?;
1193 /// Ok(())
1194 /// }
1195 /// ```
1196 pub fn delete_automation(&self) -> super::builder::cloud_deploy::DeleteAutomation {
1197 super::builder::cloud_deploy::DeleteAutomation::new(self.inner.clone())
1198 }
1199
1200 /// Gets details of a single Automation.
1201 ///
1202 /// # Example
1203 /// ```
1204 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1205 /// use google_cloud_deploy_v1::Result;
1206 /// async fn sample(
1207 /// client: &CloudDeploy, name: &str
1208 /// ) -> Result<()> {
1209 /// let response = client.get_automation()
1210 /// .set_name(name)
1211 /// .send().await?;
1212 /// println!("response {:?}", response);
1213 /// Ok(())
1214 /// }
1215 /// ```
1216 pub fn get_automation(&self) -> super::builder::cloud_deploy::GetAutomation {
1217 super::builder::cloud_deploy::GetAutomation::new(self.inner.clone())
1218 }
1219
1220 /// Lists Automations in a given project and location.
1221 ///
1222 /// # Example
1223 /// ```
1224 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1225 /// use google_cloud_gax::paginator::ItemPaginator as _;
1226 /// use google_cloud_deploy_v1::Result;
1227 /// async fn sample(
1228 /// client: &CloudDeploy, parent: &str
1229 /// ) -> Result<()> {
1230 /// let mut list = client.list_automations()
1231 /// .set_parent(parent)
1232 /// .by_item();
1233 /// while let Some(item) = list.next().await.transpose()? {
1234 /// println!("{:?}", item);
1235 /// }
1236 /// Ok(())
1237 /// }
1238 /// ```
1239 pub fn list_automations(&self) -> super::builder::cloud_deploy::ListAutomations {
1240 super::builder::cloud_deploy::ListAutomations::new(self.inner.clone())
1241 }
1242
1243 /// Gets details of a single AutomationRun.
1244 ///
1245 /// # Example
1246 /// ```
1247 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1248 /// use google_cloud_deploy_v1::Result;
1249 /// async fn sample(
1250 /// client: &CloudDeploy, name: &str
1251 /// ) -> Result<()> {
1252 /// let response = client.get_automation_run()
1253 /// .set_name(name)
1254 /// .send().await?;
1255 /// println!("response {:?}", response);
1256 /// Ok(())
1257 /// }
1258 /// ```
1259 pub fn get_automation_run(&self) -> super::builder::cloud_deploy::GetAutomationRun {
1260 super::builder::cloud_deploy::GetAutomationRun::new(self.inner.clone())
1261 }
1262
1263 /// Lists AutomationRuns in a given project and location.
1264 ///
1265 /// # Example
1266 /// ```
1267 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1268 /// use google_cloud_gax::paginator::ItemPaginator as _;
1269 /// use google_cloud_deploy_v1::Result;
1270 /// async fn sample(
1271 /// client: &CloudDeploy, parent: &str
1272 /// ) -> Result<()> {
1273 /// let mut list = client.list_automation_runs()
1274 /// .set_parent(parent)
1275 /// .by_item();
1276 /// while let Some(item) = list.next().await.transpose()? {
1277 /// println!("{:?}", item);
1278 /// }
1279 /// Ok(())
1280 /// }
1281 /// ```
1282 pub fn list_automation_runs(&self) -> super::builder::cloud_deploy::ListAutomationRuns {
1283 super::builder::cloud_deploy::ListAutomationRuns::new(self.inner.clone())
1284 }
1285
1286 /// Cancels an AutomationRun. The `state` of the `AutomationRun` after
1287 /// cancelling is `CANCELLED`. `CancelAutomationRun` can be called on
1288 /// AutomationRun in the state `IN_PROGRESS` and `PENDING`; AutomationRun
1289 /// in a different state returns an `FAILED_PRECONDITION` error.
1290 ///
1291 /// # Example
1292 /// ```
1293 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1294 /// use google_cloud_deploy_v1::Result;
1295 /// async fn sample(
1296 /// client: &CloudDeploy
1297 /// ) -> Result<()> {
1298 /// let response = client.cancel_automation_run()
1299 /// /* set fields */
1300 /// .send().await?;
1301 /// println!("response {:?}", response);
1302 /// Ok(())
1303 /// }
1304 /// ```
1305 pub fn cancel_automation_run(&self) -> super::builder::cloud_deploy::CancelAutomationRun {
1306 super::builder::cloud_deploy::CancelAutomationRun::new(self.inner.clone())
1307 }
1308
1309 /// Lists information about the supported locations for this service.
1310 ///
1311 /// # Example
1312 /// ```
1313 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1314 /// use google_cloud_gax::paginator::ItemPaginator as _;
1315 /// use google_cloud_deploy_v1::Result;
1316 /// async fn sample(
1317 /// client: &CloudDeploy
1318 /// ) -> Result<()> {
1319 /// let mut list = client.list_locations()
1320 /// /* set fields */
1321 /// .by_item();
1322 /// while let Some(item) = list.next().await.transpose()? {
1323 /// println!("{:?}", item);
1324 /// }
1325 /// Ok(())
1326 /// }
1327 /// ```
1328 pub fn list_locations(&self) -> super::builder::cloud_deploy::ListLocations {
1329 super::builder::cloud_deploy::ListLocations::new(self.inner.clone())
1330 }
1331
1332 /// Gets information about a location.
1333 ///
1334 /// # Example
1335 /// ```
1336 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1337 /// use google_cloud_deploy_v1::Result;
1338 /// async fn sample(
1339 /// client: &CloudDeploy
1340 /// ) -> Result<()> {
1341 /// let response = client.get_location()
1342 /// /* set fields */
1343 /// .send().await?;
1344 /// println!("response {:?}", response);
1345 /// Ok(())
1346 /// }
1347 /// ```
1348 pub fn get_location(&self) -> super::builder::cloud_deploy::GetLocation {
1349 super::builder::cloud_deploy::GetLocation::new(self.inner.clone())
1350 }
1351
1352 /// Sets the access control policy on the specified resource. Replaces
1353 /// any existing policy.
1354 ///
1355 /// Can return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED`
1356 /// errors.
1357 ///
1358 /// # Example
1359 /// ```
1360 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1361 /// use google_cloud_deploy_v1::Result;
1362 /// async fn sample(
1363 /// client: &CloudDeploy
1364 /// ) -> Result<()> {
1365 /// let response = client.set_iam_policy()
1366 /// /* set fields */
1367 /// .send().await?;
1368 /// println!("response {:?}", response);
1369 /// Ok(())
1370 /// }
1371 /// ```
1372 pub fn set_iam_policy(&self) -> super::builder::cloud_deploy::SetIamPolicy {
1373 super::builder::cloud_deploy::SetIamPolicy::new(self.inner.clone())
1374 }
1375
1376 /// Gets the access control policy for a resource. Returns an empty policy
1377 /// if the resource exists and does not have a policy set.
1378 ///
1379 /// # Example
1380 /// ```
1381 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1382 /// use google_cloud_deploy_v1::Result;
1383 /// async fn sample(
1384 /// client: &CloudDeploy
1385 /// ) -> Result<()> {
1386 /// let response = client.get_iam_policy()
1387 /// /* set fields */
1388 /// .send().await?;
1389 /// println!("response {:?}", response);
1390 /// Ok(())
1391 /// }
1392 /// ```
1393 pub fn get_iam_policy(&self) -> super::builder::cloud_deploy::GetIamPolicy {
1394 super::builder::cloud_deploy::GetIamPolicy::new(self.inner.clone())
1395 }
1396
1397 /// Returns permissions that a caller has on the specified resource. If the
1398 /// resource does not exist, this will return an empty set of
1399 /// permissions, not a `NOT_FOUND` error.
1400 ///
1401 /// Note: This operation is designed to be used for building
1402 /// permission-aware UIs and command-line tools, not for authorization
1403 /// checking. This operation may "fail open" without warning.
1404 ///
1405 /// # Example
1406 /// ```
1407 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1408 /// use google_cloud_deploy_v1::Result;
1409 /// async fn sample(
1410 /// client: &CloudDeploy
1411 /// ) -> Result<()> {
1412 /// let response = client.test_iam_permissions()
1413 /// /* set fields */
1414 /// .send().await?;
1415 /// println!("response {:?}", response);
1416 /// Ok(())
1417 /// }
1418 /// ```
1419 pub fn test_iam_permissions(&self) -> super::builder::cloud_deploy::TestIamPermissions {
1420 super::builder::cloud_deploy::TestIamPermissions::new(self.inner.clone())
1421 }
1422
1423 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1424 ///
1425 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1426 ///
1427 /// # Example
1428 /// ```
1429 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1430 /// use google_cloud_gax::paginator::ItemPaginator as _;
1431 /// use google_cloud_deploy_v1::Result;
1432 /// async fn sample(
1433 /// client: &CloudDeploy
1434 /// ) -> Result<()> {
1435 /// let mut list = client.list_operations()
1436 /// /* set fields */
1437 /// .by_item();
1438 /// while let Some(item) = list.next().await.transpose()? {
1439 /// println!("{:?}", item);
1440 /// }
1441 /// Ok(())
1442 /// }
1443 /// ```
1444 pub fn list_operations(&self) -> super::builder::cloud_deploy::ListOperations {
1445 super::builder::cloud_deploy::ListOperations::new(self.inner.clone())
1446 }
1447
1448 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1449 ///
1450 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1451 ///
1452 /// # Example
1453 /// ```
1454 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1455 /// use google_cloud_deploy_v1::Result;
1456 /// async fn sample(
1457 /// client: &CloudDeploy
1458 /// ) -> Result<()> {
1459 /// let response = client.get_operation()
1460 /// /* set fields */
1461 /// .send().await?;
1462 /// println!("response {:?}", response);
1463 /// Ok(())
1464 /// }
1465 /// ```
1466 pub fn get_operation(&self) -> super::builder::cloud_deploy::GetOperation {
1467 super::builder::cloud_deploy::GetOperation::new(self.inner.clone())
1468 }
1469
1470 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1471 ///
1472 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1473 ///
1474 /// # Example
1475 /// ```
1476 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1477 /// use google_cloud_deploy_v1::Result;
1478 /// async fn sample(
1479 /// client: &CloudDeploy
1480 /// ) -> Result<()> {
1481 /// client.delete_operation()
1482 /// /* set fields */
1483 /// .send().await?;
1484 /// Ok(())
1485 /// }
1486 /// ```
1487 pub fn delete_operation(&self) -> super::builder::cloud_deploy::DeleteOperation {
1488 super::builder::cloud_deploy::DeleteOperation::new(self.inner.clone())
1489 }
1490
1491 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
1492 ///
1493 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
1494 ///
1495 /// # Example
1496 /// ```
1497 /// # use google_cloud_deploy_v1::client::CloudDeploy;
1498 /// use google_cloud_deploy_v1::Result;
1499 /// async fn sample(
1500 /// client: &CloudDeploy
1501 /// ) -> Result<()> {
1502 /// client.cancel_operation()
1503 /// /* set fields */
1504 /// .send().await?;
1505 /// Ok(())
1506 /// }
1507 /// ```
1508 pub fn cancel_operation(&self) -> super::builder::cloud_deploy::CancelOperation {
1509 super::builder::cloud_deploy::CancelOperation::new(self.inner.clone())
1510 }
1511}