google_cloud_build_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 Build API.
20///
21/// # Example
22/// ```
23/// # use google_cloud_build_v1::client::CloudBuild;
24/// use google_cloud_gax::paginator::ItemPaginator as _;
25/// # async fn sample() -> Result<(), Box<dyn std::error::Error>> {
26/// let client = CloudBuild::builder().build().await?;
27/// let parent = "parent_value";
28/// let mut list = client.list_builds()
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/// Creates and manages builds on Google Cloud Platform.
40///
41/// The main concept used by this API is a `Build`, which describes the location
42/// of the source to build, how to build the source, and where to store the
43/// built artifacts, if any.
44///
45/// A user can list previously-requested builds or get builds by their ID to
46/// determine the status of the build.
47///
48/// # Configuration
49///
50/// To configure `CloudBuild` use the `with_*` methods in the type returned
51/// by [builder()][CloudBuild::builder]. The default configuration should
52/// work for most applications. Common configuration changes include
53///
54/// * [with_endpoint()]: by default this client uses the global default endpoint
55/// (`https://cloudbuild.googleapis.com`). Applications using regional
56/// endpoints or running in restricted networks (e.g. a network configured
57// with [Private Google Access with VPC Service Controls]) may want to
58/// override this default.
59/// * [with_credentials()]: by default this client uses
60/// [Application Default Credentials]. Applications using custom
61/// authentication may need to override this default.
62///
63/// [with_endpoint()]: super::builder::cloud_build::ClientBuilder::with_endpoint
64/// [with_credentials()]: super::builder::cloud_build::ClientBuilder::with_credentials
65/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
66/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
67///
68/// # Pooling and Cloning
69///
70/// `CloudBuild` holds a connection pool internally, it is advised to
71/// create one and reuse it. You do not need to wrap `CloudBuild` in
72/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
73/// already uses an `Arc` internally.
74#[derive(Clone, Debug)]
75pub struct CloudBuild {
76 inner: std::sync::Arc<dyn super::stub::dynamic::CloudBuild>,
77}
78
79impl CloudBuild {
80 /// Returns a builder for [CloudBuild].
81 ///
82 /// ```
83 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
84 /// # use google_cloud_build_v1::client::CloudBuild;
85 /// let client = CloudBuild::builder().build().await?;
86 /// # Ok(()) }
87 /// ```
88 pub fn builder() -> super::builder::cloud_build::ClientBuilder {
89 crate::new_client_builder(super::builder::cloud_build::client::Factory)
90 }
91
92 /// Creates a new client from the provided stub.
93 ///
94 /// The most common case for calling this function is in tests mocking the
95 /// client's behavior.
96 pub fn from_stub<T>(stub: T) -> Self
97 where
98 T: super::stub::CloudBuild + 'static,
99 {
100 Self {
101 inner: std::sync::Arc::new(stub),
102 }
103 }
104
105 pub(crate) async fn new(
106 config: gaxi::options::ClientConfig,
107 ) -> crate::ClientBuilderResult<Self> {
108 let inner = Self::build_inner(config).await?;
109 Ok(Self { inner })
110 }
111
112 async fn build_inner(
113 conf: gaxi::options::ClientConfig,
114 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::CloudBuild>> {
115 if gaxi::options::tracing_enabled(&conf) {
116 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
117 }
118 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
119 }
120
121 async fn build_transport(
122 conf: gaxi::options::ClientConfig,
123 ) -> crate::ClientBuilderResult<impl super::stub::CloudBuild> {
124 super::transport::CloudBuild::new(conf).await
125 }
126
127 async fn build_with_tracing(
128 conf: gaxi::options::ClientConfig,
129 ) -> crate::ClientBuilderResult<impl super::stub::CloudBuild> {
130 Self::build_transport(conf)
131 .await
132 .map(super::tracing::CloudBuild::new)
133 }
134
135 /// Starts a build with the specified configuration.
136 ///
137 /// This method returns a long-running `Operation`, which includes the build
138 /// ID. Pass the build ID to `GetBuild` to determine the build status (such as
139 /// `SUCCESS` or `FAILURE`).
140 ///
141 /// # Long running operations
142 ///
143 /// This method is used to start, and/or poll a [long-running Operation].
144 /// The [Working with long-running operations] chapter in the [user guide]
145 /// covers these operations in detail.
146 ///
147 /// [long-running operation]: https://google.aip.dev/151
148 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
149 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
150 ///
151 /// # Example
152 /// ```
153 /// # use google_cloud_build_v1::client::CloudBuild;
154 /// use google_cloud_lro::Poller;
155 /// use google_cloud_build_v1::model::Build;
156 /// use google_cloud_build_v1::Result;
157 /// async fn sample(
158 /// client: &CloudBuild, parent: &str
159 /// ) -> Result<()> {
160 /// let response = client.create_build()
161 /// .set_parent(parent)
162 /// .set_build(
163 /// Build::new()/* set fields */
164 /// )
165 /// .poller().until_done().await?;
166 /// println!("response {:?}", response);
167 /// Ok(())
168 /// }
169 /// ```
170 pub fn create_build(&self) -> super::builder::cloud_build::CreateBuild {
171 super::builder::cloud_build::CreateBuild::new(self.inner.clone())
172 }
173
174 /// Returns information about a previously requested build.
175 ///
176 /// The `Build` that is returned includes its status (such as `SUCCESS`,
177 /// `FAILURE`, or `WORKING`), and timing information.
178 ///
179 /// # Example
180 /// ```
181 /// # use google_cloud_build_v1::client::CloudBuild;
182 /// use google_cloud_build_v1::Result;
183 /// async fn sample(
184 /// client: &CloudBuild, name: &str
185 /// ) -> Result<()> {
186 /// let response = client.get_build()
187 /// .set_name(name)
188 /// .send().await?;
189 /// println!("response {:?}", response);
190 /// Ok(())
191 /// }
192 /// ```
193 pub fn get_build(&self) -> super::builder::cloud_build::GetBuild {
194 super::builder::cloud_build::GetBuild::new(self.inner.clone())
195 }
196
197 /// Lists previously requested builds.
198 ///
199 /// Previously requested builds may still be in-progress, or may have finished
200 /// successfully or unsuccessfully.
201 ///
202 /// # Example
203 /// ```
204 /// # use google_cloud_build_v1::client::CloudBuild;
205 /// use google_cloud_gax::paginator::ItemPaginator as _;
206 /// use google_cloud_build_v1::Result;
207 /// async fn sample(
208 /// client: &CloudBuild, parent: &str
209 /// ) -> Result<()> {
210 /// let mut list = client.list_builds()
211 /// .set_parent(parent)
212 /// .by_item();
213 /// while let Some(item) = list.next().await.transpose()? {
214 /// println!("{:?}", item);
215 /// }
216 /// Ok(())
217 /// }
218 /// ```
219 pub fn list_builds(&self) -> super::builder::cloud_build::ListBuilds {
220 super::builder::cloud_build::ListBuilds::new(self.inner.clone())
221 }
222
223 /// Cancels a build in progress.
224 ///
225 /// # Example
226 /// ```
227 /// # use google_cloud_build_v1::client::CloudBuild;
228 /// use google_cloud_build_v1::Result;
229 /// async fn sample(
230 /// client: &CloudBuild
231 /// ) -> Result<()> {
232 /// let response = client.cancel_build()
233 /// /* set fields */
234 /// .send().await?;
235 /// println!("response {:?}", response);
236 /// Ok(())
237 /// }
238 /// ```
239 pub fn cancel_build(&self) -> super::builder::cloud_build::CancelBuild {
240 super::builder::cloud_build::CancelBuild::new(self.inner.clone())
241 }
242
243 /// Creates a new build based on the specified build.
244 ///
245 /// This method creates a new build using the original build request, which may
246 /// or may not result in an identical build.
247 ///
248 /// For triggered builds:
249 ///
250 /// * Triggered builds resolve to a precise revision; therefore a retry of a
251 /// triggered build will result in a build that uses the same revision.
252 ///
253 /// For non-triggered builds that specify `RepoSource`:
254 ///
255 /// * If the original build built from the tip of a branch, the retried build
256 /// will build from the tip of that branch, which may not be the same revision
257 /// as the original build.
258 /// * If the original build specified a commit sha or revision ID, the retried
259 /// build will use the identical source.
260 ///
261 /// For builds that specify `StorageSource`:
262 ///
263 /// * If the original build pulled source from Cloud Storage without
264 /// specifying the generation of the object, the new build will use the current
265 /// object, which may be different from the original build source.
266 /// * If the original build pulled source from Cloud Storage and specified the
267 /// generation of the object, the new build will attempt to use the same
268 /// object, which may or may not be available depending on the bucket's
269 /// lifecycle management settings.
270 ///
271 /// # Long running operations
272 ///
273 /// This method is used to start, and/or poll a [long-running Operation].
274 /// The [Working with long-running operations] chapter in the [user guide]
275 /// covers these operations in detail.
276 ///
277 /// [long-running operation]: https://google.aip.dev/151
278 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
279 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
280 ///
281 /// # Example
282 /// ```
283 /// # use google_cloud_build_v1::client::CloudBuild;
284 /// use google_cloud_lro::Poller;
285 /// use google_cloud_build_v1::Result;
286 /// async fn sample(
287 /// client: &CloudBuild
288 /// ) -> Result<()> {
289 /// let response = client.retry_build()
290 /// /* set fields */
291 /// .poller().until_done().await?;
292 /// println!("response {:?}", response);
293 /// Ok(())
294 /// }
295 /// ```
296 pub fn retry_build(&self) -> super::builder::cloud_build::RetryBuild {
297 super::builder::cloud_build::RetryBuild::new(self.inner.clone())
298 }
299
300 /// Approves or rejects a pending build.
301 ///
302 /// If approved, the returned long-running operation (LRO) will be analogous to
303 /// the LRO returned from a CreateBuild call.
304 ///
305 /// If rejected, the returned LRO will be immediately done.
306 ///
307 /// # Long running operations
308 ///
309 /// This method is used to start, and/or poll a [long-running Operation].
310 /// The [Working with long-running operations] chapter in the [user guide]
311 /// covers these operations in detail.
312 ///
313 /// [long-running operation]: https://google.aip.dev/151
314 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
315 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
316 ///
317 /// # Example
318 /// ```
319 /// # use google_cloud_build_v1::client::CloudBuild;
320 /// use google_cloud_lro::Poller;
321 /// use google_cloud_build_v1::Result;
322 /// async fn sample(
323 /// client: &CloudBuild
324 /// ) -> Result<()> {
325 /// let response = client.approve_build()
326 /// /* set fields */
327 /// .poller().until_done().await?;
328 /// println!("response {:?}", response);
329 /// Ok(())
330 /// }
331 /// ```
332 pub fn approve_build(&self) -> super::builder::cloud_build::ApproveBuild {
333 super::builder::cloud_build::ApproveBuild::new(self.inner.clone())
334 }
335
336 /// Creates a new `BuildTrigger`.
337 ///
338 /// # Example
339 /// ```
340 /// # use google_cloud_build_v1::client::CloudBuild;
341 /// use google_cloud_build_v1::Result;
342 /// async fn sample(
343 /// client: &CloudBuild
344 /// ) -> Result<()> {
345 /// let response = client.create_build_trigger()
346 /// /* set fields */
347 /// .send().await?;
348 /// println!("response {:?}", response);
349 /// Ok(())
350 /// }
351 /// ```
352 pub fn create_build_trigger(&self) -> super::builder::cloud_build::CreateBuildTrigger {
353 super::builder::cloud_build::CreateBuildTrigger::new(self.inner.clone())
354 }
355
356 /// Returns information about a `BuildTrigger`.
357 ///
358 /// # Example
359 /// ```
360 /// # use google_cloud_build_v1::client::CloudBuild;
361 /// use google_cloud_build_v1::Result;
362 /// async fn sample(
363 /// client: &CloudBuild
364 /// ) -> Result<()> {
365 /// let response = client.get_build_trigger()
366 /// /* set fields */
367 /// .send().await?;
368 /// println!("response {:?}", response);
369 /// Ok(())
370 /// }
371 /// ```
372 pub fn get_build_trigger(&self) -> super::builder::cloud_build::GetBuildTrigger {
373 super::builder::cloud_build::GetBuildTrigger::new(self.inner.clone())
374 }
375
376 /// Lists existing `BuildTrigger`s.
377 ///
378 /// # Example
379 /// ```
380 /// # use google_cloud_build_v1::client::CloudBuild;
381 /// use google_cloud_gax::paginator::ItemPaginator as _;
382 /// use google_cloud_build_v1::Result;
383 /// async fn sample(
384 /// client: &CloudBuild, parent: &str
385 /// ) -> Result<()> {
386 /// let mut list = client.list_build_triggers()
387 /// .set_parent(parent)
388 /// .by_item();
389 /// while let Some(item) = list.next().await.transpose()? {
390 /// println!("{:?}", item);
391 /// }
392 /// Ok(())
393 /// }
394 /// ```
395 pub fn list_build_triggers(&self) -> super::builder::cloud_build::ListBuildTriggers {
396 super::builder::cloud_build::ListBuildTriggers::new(self.inner.clone())
397 }
398
399 /// Deletes a `BuildTrigger` by its project ID and trigger ID.
400 ///
401 /// # Example
402 /// ```
403 /// # use google_cloud_build_v1::client::CloudBuild;
404 /// use google_cloud_build_v1::Result;
405 /// async fn sample(
406 /// client: &CloudBuild
407 /// ) -> Result<()> {
408 /// client.delete_build_trigger()
409 /// /* set fields */
410 /// .send().await?;
411 /// Ok(())
412 /// }
413 /// ```
414 pub fn delete_build_trigger(&self) -> super::builder::cloud_build::DeleteBuildTrigger {
415 super::builder::cloud_build::DeleteBuildTrigger::new(self.inner.clone())
416 }
417
418 /// Updates a `BuildTrigger` by its project ID and trigger ID.
419 ///
420 /// # Example
421 /// ```
422 /// # use google_cloud_build_v1::client::CloudBuild;
423 /// use google_cloud_build_v1::Result;
424 /// async fn sample(
425 /// client: &CloudBuild
426 /// ) -> Result<()> {
427 /// let response = client.update_build_trigger()
428 /// /* set fields */
429 /// .send().await?;
430 /// println!("response {:?}", response);
431 /// Ok(())
432 /// }
433 /// ```
434 pub fn update_build_trigger(&self) -> super::builder::cloud_build::UpdateBuildTrigger {
435 super::builder::cloud_build::UpdateBuildTrigger::new(self.inner.clone())
436 }
437
438 /// Runs a `BuildTrigger` at a particular source revision.
439 ///
440 /// To run a regional or global trigger, use the POST request
441 /// that includes the location endpoint in the path (ex.
442 /// v1/projects/{projectId}/locations/{region}/triggers/{triggerId}:run). The
443 /// POST request that does not include the location endpoint in the path can
444 /// only be used when running global triggers.
445 ///
446 /// # Long running operations
447 ///
448 /// This method is used to start, and/or poll a [long-running Operation].
449 /// The [Working with long-running operations] chapter in the [user guide]
450 /// covers these operations in detail.
451 ///
452 /// [long-running operation]: https://google.aip.dev/151
453 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
454 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
455 ///
456 /// # Example
457 /// ```
458 /// # use google_cloud_build_v1::client::CloudBuild;
459 /// use google_cloud_lro::Poller;
460 /// use google_cloud_build_v1::Result;
461 /// async fn sample(
462 /// client: &CloudBuild
463 /// ) -> Result<()> {
464 /// let response = client.run_build_trigger()
465 /// /* set fields */
466 /// .poller().until_done().await?;
467 /// println!("response {:?}", response);
468 /// Ok(())
469 /// }
470 /// ```
471 pub fn run_build_trigger(&self) -> super::builder::cloud_build::RunBuildTrigger {
472 super::builder::cloud_build::RunBuildTrigger::new(self.inner.clone())
473 }
474
475 /// ReceiveTriggerWebhook [Experimental] is called when the API receives a
476 /// webhook request targeted at a specific trigger.
477 ///
478 /// # Example
479 /// ```
480 /// # use google_cloud_build_v1::client::CloudBuild;
481 /// use google_cloud_build_v1::Result;
482 /// async fn sample(
483 /// client: &CloudBuild
484 /// ) -> Result<()> {
485 /// let response = client.receive_trigger_webhook()
486 /// /* set fields */
487 /// .send().await?;
488 /// println!("response {:?}", response);
489 /// Ok(())
490 /// }
491 /// ```
492 pub fn receive_trigger_webhook(&self) -> super::builder::cloud_build::ReceiveTriggerWebhook {
493 super::builder::cloud_build::ReceiveTriggerWebhook::new(self.inner.clone())
494 }
495
496 /// Creates a `WorkerPool`.
497 ///
498 /// # Long running operations
499 ///
500 /// This method is used to start, and/or poll a [long-running Operation].
501 /// The [Working with long-running operations] chapter in the [user guide]
502 /// covers these operations in detail.
503 ///
504 /// [long-running operation]: https://google.aip.dev/151
505 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
506 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
507 ///
508 /// # Example
509 /// ```
510 /// # use google_cloud_build_v1::client::CloudBuild;
511 /// use google_cloud_lro::Poller;
512 /// use google_cloud_build_v1::model::WorkerPool;
513 /// use google_cloud_build_v1::Result;
514 /// async fn sample(
515 /// client: &CloudBuild, parent: &str
516 /// ) -> Result<()> {
517 /// let response = client.create_worker_pool()
518 /// .set_parent(parent)
519 /// .set_worker_pool(
520 /// WorkerPool::new()/* set fields */
521 /// )
522 /// .poller().until_done().await?;
523 /// println!("response {:?}", response);
524 /// Ok(())
525 /// }
526 /// ```
527 pub fn create_worker_pool(&self) -> super::builder::cloud_build::CreateWorkerPool {
528 super::builder::cloud_build::CreateWorkerPool::new(self.inner.clone())
529 }
530
531 /// Returns details of a `WorkerPool`.
532 ///
533 /// # Example
534 /// ```
535 /// # use google_cloud_build_v1::client::CloudBuild;
536 /// use google_cloud_build_v1::Result;
537 /// async fn sample(
538 /// client: &CloudBuild, name: &str
539 /// ) -> Result<()> {
540 /// let response = client.get_worker_pool()
541 /// .set_name(name)
542 /// .send().await?;
543 /// println!("response {:?}", response);
544 /// Ok(())
545 /// }
546 /// ```
547 pub fn get_worker_pool(&self) -> super::builder::cloud_build::GetWorkerPool {
548 super::builder::cloud_build::GetWorkerPool::new(self.inner.clone())
549 }
550
551 /// Deletes a `WorkerPool`.
552 ///
553 /// # Long running operations
554 ///
555 /// This method is used to start, and/or poll a [long-running Operation].
556 /// The [Working with long-running operations] chapter in the [user guide]
557 /// covers these operations in detail.
558 ///
559 /// [long-running operation]: https://google.aip.dev/151
560 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
561 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
562 ///
563 /// # Example
564 /// ```
565 /// # use google_cloud_build_v1::client::CloudBuild;
566 /// use google_cloud_lro::Poller;
567 /// use google_cloud_build_v1::Result;
568 /// async fn sample(
569 /// client: &CloudBuild, name: &str
570 /// ) -> Result<()> {
571 /// client.delete_worker_pool()
572 /// .set_name(name)
573 /// .poller().until_done().await?;
574 /// Ok(())
575 /// }
576 /// ```
577 pub fn delete_worker_pool(&self) -> super::builder::cloud_build::DeleteWorkerPool {
578 super::builder::cloud_build::DeleteWorkerPool::new(self.inner.clone())
579 }
580
581 /// Updates a `WorkerPool`.
582 ///
583 /// # Long running operations
584 ///
585 /// This method is used to start, and/or poll a [long-running Operation].
586 /// The [Working with long-running operations] chapter in the [user guide]
587 /// covers these operations in detail.
588 ///
589 /// [long-running operation]: https://google.aip.dev/151
590 /// [user guide]: https://googleapis.github.io/google-cloud-rust/
591 /// [working with long-running operations]: https://googleapis.github.io/google-cloud-rust/working_with_long_running_operations.html
592 ///
593 /// # Example
594 /// ```
595 /// # use google_cloud_build_v1::client::CloudBuild;
596 /// use google_cloud_lro::Poller;
597 /// # extern crate wkt as google_cloud_wkt;
598 /// use google_cloud_wkt::FieldMask;
599 /// use google_cloud_build_v1::model::WorkerPool;
600 /// use google_cloud_build_v1::Result;
601 /// async fn sample(
602 /// client: &CloudBuild, name: &str
603 /// ) -> Result<()> {
604 /// let response = client.update_worker_pool()
605 /// .set_worker_pool(
606 /// WorkerPool::new().set_name(name)/* set fields */
607 /// )
608 /// .set_update_mask(FieldMask::default().set_paths(["updated.field.path1", "updated.field.path2"]))
609 /// .poller().until_done().await?;
610 /// println!("response {:?}", response);
611 /// Ok(())
612 /// }
613 /// ```
614 pub fn update_worker_pool(&self) -> super::builder::cloud_build::UpdateWorkerPool {
615 super::builder::cloud_build::UpdateWorkerPool::new(self.inner.clone())
616 }
617
618 /// Lists `WorkerPool`s.
619 ///
620 /// # Example
621 /// ```
622 /// # use google_cloud_build_v1::client::CloudBuild;
623 /// use google_cloud_gax::paginator::ItemPaginator as _;
624 /// use google_cloud_build_v1::Result;
625 /// async fn sample(
626 /// client: &CloudBuild, parent: &str
627 /// ) -> Result<()> {
628 /// let mut list = client.list_worker_pools()
629 /// .set_parent(parent)
630 /// .by_item();
631 /// while let Some(item) = list.next().await.transpose()? {
632 /// println!("{:?}", item);
633 /// }
634 /// Ok(())
635 /// }
636 /// ```
637 pub fn list_worker_pools(&self) -> super::builder::cloud_build::ListWorkerPools {
638 super::builder::cloud_build::ListWorkerPools::new(self.inner.clone())
639 }
640
641 /// Returns the `DefaultServiceAccount` used by the project.
642 ///
643 /// # Example
644 /// ```
645 /// # use google_cloud_build_v1::client::CloudBuild;
646 /// use google_cloud_build_v1::Result;
647 /// async fn sample(
648 /// client: &CloudBuild, name: &str
649 /// ) -> Result<()> {
650 /// let response = client.get_default_service_account()
651 /// .set_name(name)
652 /// .send().await?;
653 /// println!("response {:?}", response);
654 /// Ok(())
655 /// }
656 /// ```
657 pub fn get_default_service_account(
658 &self,
659 ) -> super::builder::cloud_build::GetDefaultServiceAccount {
660 super::builder::cloud_build::GetDefaultServiceAccount::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 ///
667 /// # Example
668 /// ```
669 /// # use google_cloud_build_v1::client::CloudBuild;
670 /// use google_cloud_build_v1::Result;
671 /// async fn sample(
672 /// client: &CloudBuild
673 /// ) -> Result<()> {
674 /// let response = client.get_operation()
675 /// /* set fields */
676 /// .send().await?;
677 /// println!("response {:?}", response);
678 /// Ok(())
679 /// }
680 /// ```
681 pub fn get_operation(&self) -> super::builder::cloud_build::GetOperation {
682 super::builder::cloud_build::GetOperation::new(self.inner.clone())
683 }
684
685 /// Provides the [Operations][google.longrunning.Operations] service functionality in this service.
686 ///
687 /// [google.longrunning.Operations]: google-cloud-longrunning::client::Operations
688 ///
689 /// # Example
690 /// ```
691 /// # use google_cloud_build_v1::client::CloudBuild;
692 /// use google_cloud_build_v1::Result;
693 /// async fn sample(
694 /// client: &CloudBuild
695 /// ) -> Result<()> {
696 /// client.cancel_operation()
697 /// /* set fields */
698 /// .send().await?;
699 /// Ok(())
700 /// }
701 /// ```
702 pub fn cancel_operation(&self) -> super::builder::cloud_build::CancelOperation {
703 super::builder::cloud_build::CancelOperation::new(self.inner.clone())
704 }
705}