google_cloud_compute_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::bare_urls)]
17#![allow(rustdoc::broken_intra_doc_links)]
18#![allow(rustdoc::invalid_html_tags)]
19#![allow(rustdoc::redundant_explicit_links)]
20
21/// Implements a client for the Google Compute Engine API.
22///
23/// # Example
24/// ```
25/// # use google_cloud_compute_v1::client::AcceleratorTypes;
26/// async fn sample(
27/// ) -> anyhow::Result<()> {
28/// let client = AcceleratorTypes::builder().build().await?;
29/// // use `client` to make requests to the Google Compute Engine API.
30/// Ok(())
31/// }
32/// ```
33///
34/// # Service Description
35///
36/// Service for the `acceleratorTypes` resource.
37///
38/// # Configuration
39///
40/// To configure `AcceleratorTypes` use the `with_*` methods in the type returned
41/// by [builder()][AcceleratorTypes::builder]. The default configuration should
42/// work for most applications. Common configuration changes include
43///
44/// * [with_endpoint()]: by default this client uses the global default endpoint
45/// (`https://compute.googleapis.com`). Applications using regional
46/// endpoints or running in restricted networks (e.g. a network configured
47/// with [Private Google Access with VPC Service Controls]) may want to
48/// override this default.
49/// * [with_credentials()]: by default this client uses
50/// [Application Default Credentials]. Applications using custom
51/// authentication may need to override this default.
52///
53/// [with_endpoint()]: super::builder::accelerator_types::ClientBuilder::with_endpoint
54/// [with_credentials()]: super::builder::accelerator_types::ClientBuilder::with_credentials
55/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
56/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
57///
58/// # Pooling and Cloning
59///
60/// `AcceleratorTypes` holds a connection pool internally, it is advised to
61/// create one and reuse it. You do not need to wrap `AcceleratorTypes` in
62/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
63/// already uses an `Arc` internally.
64#[cfg(feature = "accelerator-types")]
65#[cfg_attr(docsrs, doc(cfg(feature = "accelerator-types")))]
66#[derive(Clone, Debug)]
67pub struct AcceleratorTypes {
68 inner: std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>,
69}
70
71#[cfg(feature = "accelerator-types")]
72impl AcceleratorTypes {
73 /// Returns a builder for [AcceleratorTypes].
74 ///
75 /// ```
76 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
77 /// # use google_cloud_compute_v1::client::AcceleratorTypes;
78 /// let client = AcceleratorTypes::builder().build().await?;
79 /// # Ok(()) }
80 /// ```
81 pub fn builder() -> super::builder::accelerator_types::ClientBuilder {
82 crate::new_client_builder(super::builder::accelerator_types::client::Factory)
83 }
84
85 /// Creates a new client from the provided stub.
86 ///
87 /// The most common case for calling this function is in tests mocking the
88 /// client's behavior.
89 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
90 where
91 T: super::stub::AcceleratorTypes + 'static,
92 {
93 Self { inner: stub.into() }
94 }
95
96 pub(crate) async fn new(
97 config: gaxi::options::ClientConfig,
98 ) -> crate::ClientBuilderResult<Self> {
99 let inner = Self::build_inner(config).await?;
100 Ok(Self { inner })
101 }
102
103 async fn build_inner(
104 conf: gaxi::options::ClientConfig,
105 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::AcceleratorTypes>>
106 {
107 if gaxi::options::tracing_enabled(&conf) {
108 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
109 }
110 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
111 }
112
113 async fn build_transport(
114 conf: gaxi::options::ClientConfig,
115 ) -> crate::ClientBuilderResult<impl super::stub::AcceleratorTypes> {
116 super::transport::AcceleratorTypes::new(conf).await
117 }
118
119 async fn build_with_tracing(
120 conf: gaxi::options::ClientConfig,
121 ) -> crate::ClientBuilderResult<impl super::stub::AcceleratorTypes> {
122 Self::build_transport(conf)
123 .await
124 .map(super::tracing::AcceleratorTypes::new)
125 }
126
127 /// Retrieves an aggregated list of accelerator types.
128 ///
129 /// To prevent failure, it is recommended that you set the
130 /// `returnPartialSuccess` parameter to `true`.
131 pub fn aggregated_list(&self) -> super::builder::accelerator_types::AggregatedList {
132 super::builder::accelerator_types::AggregatedList::new(self.inner.clone())
133 }
134
135 /// Returns the specified accelerator type.
136 pub fn get(&self) -> super::builder::accelerator_types::Get {
137 super::builder::accelerator_types::Get::new(self.inner.clone())
138 }
139
140 /// Retrieves a list of accelerator types that are available to the specified
141 /// project.
142 pub fn list(&self) -> super::builder::accelerator_types::List {
143 super::builder::accelerator_types::List::new(self.inner.clone())
144 }
145}
146
147/// Implements a client for the Google Compute Engine API.
148///
149/// # Example
150/// ```
151/// # use google_cloud_compute_v1::client::Addresses;
152/// async fn sample(
153/// ) -> anyhow::Result<()> {
154/// let client = Addresses::builder().build().await?;
155/// // use `client` to make requests to the Google Compute Engine API.
156/// Ok(())
157/// }
158/// ```
159///
160/// # Service Description
161///
162/// Service for the `addresses` resource.
163///
164/// # Configuration
165///
166/// To configure `Addresses` use the `with_*` methods in the type returned
167/// by [builder()][Addresses::builder]. The default configuration should
168/// work for most applications. Common configuration changes include
169///
170/// * [with_endpoint()]: by default this client uses the global default endpoint
171/// (`https://compute.googleapis.com`). Applications using regional
172/// endpoints or running in restricted networks (e.g. a network configured
173/// with [Private Google Access with VPC Service Controls]) may want to
174/// override this default.
175/// * [with_credentials()]: by default this client uses
176/// [Application Default Credentials]. Applications using custom
177/// authentication may need to override this default.
178///
179/// [with_endpoint()]: super::builder::addresses::ClientBuilder::with_endpoint
180/// [with_credentials()]: super::builder::addresses::ClientBuilder::with_credentials
181/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
182/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
183///
184/// # Pooling and Cloning
185///
186/// `Addresses` holds a connection pool internally, it is advised to
187/// create one and reuse it. You do not need to wrap `Addresses` in
188/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
189/// already uses an `Arc` internally.
190#[cfg(feature = "addresses")]
191#[cfg_attr(docsrs, doc(cfg(feature = "addresses")))]
192#[derive(Clone, Debug)]
193pub struct Addresses {
194 inner: std::sync::Arc<dyn super::stub::dynamic::Addresses>,
195}
196
197#[cfg(feature = "addresses")]
198impl Addresses {
199 /// Returns a builder for [Addresses].
200 ///
201 /// ```
202 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
203 /// # use google_cloud_compute_v1::client::Addresses;
204 /// let client = Addresses::builder().build().await?;
205 /// # Ok(()) }
206 /// ```
207 pub fn builder() -> super::builder::addresses::ClientBuilder {
208 crate::new_client_builder(super::builder::addresses::client::Factory)
209 }
210
211 /// Creates a new client from the provided stub.
212 ///
213 /// The most common case for calling this function is in tests mocking the
214 /// client's behavior.
215 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
216 where
217 T: super::stub::Addresses + 'static,
218 {
219 Self { inner: stub.into() }
220 }
221
222 pub(crate) async fn new(
223 config: gaxi::options::ClientConfig,
224 ) -> crate::ClientBuilderResult<Self> {
225 let inner = Self::build_inner(config).await?;
226 Ok(Self { inner })
227 }
228
229 async fn build_inner(
230 conf: gaxi::options::ClientConfig,
231 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Addresses>> {
232 if gaxi::options::tracing_enabled(&conf) {
233 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
234 }
235 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
236 }
237
238 async fn build_transport(
239 conf: gaxi::options::ClientConfig,
240 ) -> crate::ClientBuilderResult<impl super::stub::Addresses> {
241 super::transport::Addresses::new(conf).await
242 }
243
244 async fn build_with_tracing(
245 conf: gaxi::options::ClientConfig,
246 ) -> crate::ClientBuilderResult<impl super::stub::Addresses> {
247 Self::build_transport(conf)
248 .await
249 .map(super::tracing::Addresses::new)
250 }
251
252 /// Retrieves an aggregated list of addresses.
253 ///
254 /// To prevent failure, it is recommended that you set the
255 /// `returnPartialSuccess` parameter to `true`.
256 pub fn aggregated_list(&self) -> super::builder::addresses::AggregatedList {
257 super::builder::addresses::AggregatedList::new(self.inner.clone())
258 }
259
260 /// Deletes the specified address resource.
261 pub fn delete(&self) -> super::builder::addresses::Delete {
262 super::builder::addresses::Delete::new(self.inner.clone())
263 }
264
265 /// Returns the specified address resource.
266 pub fn get(&self) -> super::builder::addresses::Get {
267 super::builder::addresses::Get::new(self.inner.clone())
268 }
269
270 /// Creates an address resource in the specified project by using the data
271 /// included in the request.
272 pub fn insert(&self) -> super::builder::addresses::Insert {
273 super::builder::addresses::Insert::new(self.inner.clone())
274 }
275
276 /// Retrieves a list of addresses contained within
277 /// the specified region.
278 pub fn list(&self) -> super::builder::addresses::List {
279 super::builder::addresses::List::new(self.inner.clone())
280 }
281
282 /// Moves the specified address resource.
283 pub fn r#move(&self) -> super::builder::addresses::Move {
284 super::builder::addresses::Move::new(self.inner.clone())
285 }
286
287 /// Sets the labels on an Address. To learn more about labels, read theLabeling
288 /// Resources documentation.
289 pub fn set_labels(&self) -> super::builder::addresses::SetLabels {
290 super::builder::addresses::SetLabels::new(self.inner.clone())
291 }
292
293 /// Returns permissions that a caller has on the specified resource.
294 pub fn test_iam_permissions(&self) -> super::builder::addresses::TestIamPermissions {
295 super::builder::addresses::TestIamPermissions::new(self.inner.clone())
296 }
297
298 /// Retrieves the specified region-specific Operations resource.
299 pub fn get_operation(&self) -> super::builder::addresses::GetOperation {
300 super::builder::addresses::GetOperation::new(self.inner.clone())
301 }
302}
303
304/// Implements a client for the Google Compute Engine API.
305///
306/// # Example
307/// ```
308/// # use google_cloud_compute_v1::client::Advice;
309/// async fn sample(
310/// ) -> anyhow::Result<()> {
311/// let client = Advice::builder().build().await?;
312/// // use `client` to make requests to the Google Compute Engine API.
313/// Ok(())
314/// }
315/// ```
316///
317/// # Service Description
318///
319/// Service for the `advice` resource.
320///
321/// # Configuration
322///
323/// To configure `Advice` use the `with_*` methods in the type returned
324/// by [builder()][Advice::builder]. The default configuration should
325/// work for most applications. Common configuration changes include
326///
327/// * [with_endpoint()]: by default this client uses the global default endpoint
328/// (`https://compute.googleapis.com`). Applications using regional
329/// endpoints or running in restricted networks (e.g. a network configured
330/// with [Private Google Access with VPC Service Controls]) may want to
331/// override this default.
332/// * [with_credentials()]: by default this client uses
333/// [Application Default Credentials]. Applications using custom
334/// authentication may need to override this default.
335///
336/// [with_endpoint()]: super::builder::advice::ClientBuilder::with_endpoint
337/// [with_credentials()]: super::builder::advice::ClientBuilder::with_credentials
338/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
339/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
340///
341/// # Pooling and Cloning
342///
343/// `Advice` holds a connection pool internally, it is advised to
344/// create one and reuse it. You do not need to wrap `Advice` in
345/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
346/// already uses an `Arc` internally.
347#[cfg(feature = "advice")]
348#[cfg_attr(docsrs, doc(cfg(feature = "advice")))]
349#[derive(Clone, Debug)]
350pub struct Advice {
351 inner: std::sync::Arc<dyn super::stub::dynamic::Advice>,
352}
353
354#[cfg(feature = "advice")]
355impl Advice {
356 /// Returns a builder for [Advice].
357 ///
358 /// ```
359 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
360 /// # use google_cloud_compute_v1::client::Advice;
361 /// let client = Advice::builder().build().await?;
362 /// # Ok(()) }
363 /// ```
364 pub fn builder() -> super::builder::advice::ClientBuilder {
365 crate::new_client_builder(super::builder::advice::client::Factory)
366 }
367
368 /// Creates a new client from the provided stub.
369 ///
370 /// The most common case for calling this function is in tests mocking the
371 /// client's behavior.
372 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
373 where
374 T: super::stub::Advice + 'static,
375 {
376 Self { inner: stub.into() }
377 }
378
379 pub(crate) async fn new(
380 config: gaxi::options::ClientConfig,
381 ) -> crate::ClientBuilderResult<Self> {
382 let inner = Self::build_inner(config).await?;
383 Ok(Self { inner })
384 }
385
386 async fn build_inner(
387 conf: gaxi::options::ClientConfig,
388 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Advice>> {
389 if gaxi::options::tracing_enabled(&conf) {
390 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
391 }
392 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
393 }
394
395 async fn build_transport(
396 conf: gaxi::options::ClientConfig,
397 ) -> crate::ClientBuilderResult<impl super::stub::Advice> {
398 super::transport::Advice::new(conf).await
399 }
400
401 async fn build_with_tracing(
402 conf: gaxi::options::ClientConfig,
403 ) -> crate::ClientBuilderResult<impl super::stub::Advice> {
404 Self::build_transport(conf)
405 .await
406 .map(super::tracing::Advice::new)
407 }
408
409 /// Advise how, where and when to create the requested amount of instances
410 /// with specified accelerators, within the specified time and location limits.
411 /// The method recommends creating future reservations for the requested
412 /// resources.
413 pub fn calendar_mode(&self) -> super::builder::advice::CalendarMode {
414 super::builder::advice::CalendarMode::new(self.inner.clone())
415 }
416}
417
418/// Implements a client for the Google Compute Engine API.
419///
420/// # Example
421/// ```
422/// # use google_cloud_compute_v1::client::Autoscalers;
423/// async fn sample(
424/// ) -> anyhow::Result<()> {
425/// let client = Autoscalers::builder().build().await?;
426/// // use `client` to make requests to the Google Compute Engine API.
427/// Ok(())
428/// }
429/// ```
430///
431/// # Service Description
432///
433/// Service for the `autoscalers` resource.
434///
435/// # Configuration
436///
437/// To configure `Autoscalers` use the `with_*` methods in the type returned
438/// by [builder()][Autoscalers::builder]. The default configuration should
439/// work for most applications. Common configuration changes include
440///
441/// * [with_endpoint()]: by default this client uses the global default endpoint
442/// (`https://compute.googleapis.com`). Applications using regional
443/// endpoints or running in restricted networks (e.g. a network configured
444/// with [Private Google Access with VPC Service Controls]) may want to
445/// override this default.
446/// * [with_credentials()]: by default this client uses
447/// [Application Default Credentials]. Applications using custom
448/// authentication may need to override this default.
449///
450/// [with_endpoint()]: super::builder::autoscalers::ClientBuilder::with_endpoint
451/// [with_credentials()]: super::builder::autoscalers::ClientBuilder::with_credentials
452/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
453/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
454///
455/// # Pooling and Cloning
456///
457/// `Autoscalers` holds a connection pool internally, it is advised to
458/// create one and reuse it. You do not need to wrap `Autoscalers` in
459/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
460/// already uses an `Arc` internally.
461#[cfg(feature = "autoscalers")]
462#[cfg_attr(docsrs, doc(cfg(feature = "autoscalers")))]
463#[derive(Clone, Debug)]
464pub struct Autoscalers {
465 inner: std::sync::Arc<dyn super::stub::dynamic::Autoscalers>,
466}
467
468#[cfg(feature = "autoscalers")]
469impl Autoscalers {
470 /// Returns a builder for [Autoscalers].
471 ///
472 /// ```
473 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
474 /// # use google_cloud_compute_v1::client::Autoscalers;
475 /// let client = Autoscalers::builder().build().await?;
476 /// # Ok(()) }
477 /// ```
478 pub fn builder() -> super::builder::autoscalers::ClientBuilder {
479 crate::new_client_builder(super::builder::autoscalers::client::Factory)
480 }
481
482 /// Creates a new client from the provided stub.
483 ///
484 /// The most common case for calling this function is in tests mocking the
485 /// client's behavior.
486 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
487 where
488 T: super::stub::Autoscalers + 'static,
489 {
490 Self { inner: stub.into() }
491 }
492
493 pub(crate) async fn new(
494 config: gaxi::options::ClientConfig,
495 ) -> crate::ClientBuilderResult<Self> {
496 let inner = Self::build_inner(config).await?;
497 Ok(Self { inner })
498 }
499
500 async fn build_inner(
501 conf: gaxi::options::ClientConfig,
502 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Autoscalers>> {
503 if gaxi::options::tracing_enabled(&conf) {
504 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
505 }
506 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
507 }
508
509 async fn build_transport(
510 conf: gaxi::options::ClientConfig,
511 ) -> crate::ClientBuilderResult<impl super::stub::Autoscalers> {
512 super::transport::Autoscalers::new(conf).await
513 }
514
515 async fn build_with_tracing(
516 conf: gaxi::options::ClientConfig,
517 ) -> crate::ClientBuilderResult<impl super::stub::Autoscalers> {
518 Self::build_transport(conf)
519 .await
520 .map(super::tracing::Autoscalers::new)
521 }
522
523 /// Retrieves an aggregated list of autoscalers.
524 ///
525 /// To prevent failure, it is recommended that you set the
526 /// `returnPartialSuccess` parameter to `true`.
527 pub fn aggregated_list(&self) -> super::builder::autoscalers::AggregatedList {
528 super::builder::autoscalers::AggregatedList::new(self.inner.clone())
529 }
530
531 /// Deletes the specified autoscaler.
532 pub fn delete(&self) -> super::builder::autoscalers::Delete {
533 super::builder::autoscalers::Delete::new(self.inner.clone())
534 }
535
536 /// Returns the specified autoscaler resource.
537 pub fn get(&self) -> super::builder::autoscalers::Get {
538 super::builder::autoscalers::Get::new(self.inner.clone())
539 }
540
541 /// Creates an autoscaler in the specified project using the data
542 /// included in the request.
543 pub fn insert(&self) -> super::builder::autoscalers::Insert {
544 super::builder::autoscalers::Insert::new(self.inner.clone())
545 }
546
547 /// Retrieves a list of autoscalers contained within
548 /// the specified zone.
549 pub fn list(&self) -> super::builder::autoscalers::List {
550 super::builder::autoscalers::List::new(self.inner.clone())
551 }
552
553 /// Updates an autoscaler in the specified project using the data
554 /// included in the request. This method supportsPATCH
555 /// semantics and uses theJSON merge
556 /// patch format and processing rules.
557 pub fn patch(&self) -> super::builder::autoscalers::Patch {
558 super::builder::autoscalers::Patch::new(self.inner.clone())
559 }
560
561 /// Returns permissions that a caller has on the specified resource.
562 pub fn test_iam_permissions(&self) -> super::builder::autoscalers::TestIamPermissions {
563 super::builder::autoscalers::TestIamPermissions::new(self.inner.clone())
564 }
565
566 /// Updates an autoscaler in the specified project using the data
567 /// included in the request.
568 pub fn update(&self) -> super::builder::autoscalers::Update {
569 super::builder::autoscalers::Update::new(self.inner.clone())
570 }
571
572 /// Retrieves the specified zone-specific Operations resource.
573 pub fn get_operation(&self) -> super::builder::autoscalers::GetOperation {
574 super::builder::autoscalers::GetOperation::new(self.inner.clone())
575 }
576}
577
578/// Implements a client for the Google Compute Engine API.
579///
580/// # Example
581/// ```
582/// # use google_cloud_compute_v1::client::BackendBuckets;
583/// async fn sample(
584/// ) -> anyhow::Result<()> {
585/// let client = BackendBuckets::builder().build().await?;
586/// // use `client` to make requests to the Google Compute Engine API.
587/// Ok(())
588/// }
589/// ```
590///
591/// # Service Description
592///
593/// Service for the `backendBuckets` resource.
594///
595/// # Configuration
596///
597/// To configure `BackendBuckets` use the `with_*` methods in the type returned
598/// by [builder()][BackendBuckets::builder]. The default configuration should
599/// work for most applications. Common configuration changes include
600///
601/// * [with_endpoint()]: by default this client uses the global default endpoint
602/// (`https://compute.googleapis.com`). Applications using regional
603/// endpoints or running in restricted networks (e.g. a network configured
604/// with [Private Google Access with VPC Service Controls]) may want to
605/// override this default.
606/// * [with_credentials()]: by default this client uses
607/// [Application Default Credentials]. Applications using custom
608/// authentication may need to override this default.
609///
610/// [with_endpoint()]: super::builder::backend_buckets::ClientBuilder::with_endpoint
611/// [with_credentials()]: super::builder::backend_buckets::ClientBuilder::with_credentials
612/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
613/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
614///
615/// # Pooling and Cloning
616///
617/// `BackendBuckets` holds a connection pool internally, it is advised to
618/// create one and reuse it. You do not need to wrap `BackendBuckets` in
619/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
620/// already uses an `Arc` internally.
621#[cfg(feature = "backend-buckets")]
622#[cfg_attr(docsrs, doc(cfg(feature = "backend-buckets")))]
623#[derive(Clone, Debug)]
624pub struct BackendBuckets {
625 inner: std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>,
626}
627
628#[cfg(feature = "backend-buckets")]
629impl BackendBuckets {
630 /// Returns a builder for [BackendBuckets].
631 ///
632 /// ```
633 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
634 /// # use google_cloud_compute_v1::client::BackendBuckets;
635 /// let client = BackendBuckets::builder().build().await?;
636 /// # Ok(()) }
637 /// ```
638 pub fn builder() -> super::builder::backend_buckets::ClientBuilder {
639 crate::new_client_builder(super::builder::backend_buckets::client::Factory)
640 }
641
642 /// Creates a new client from the provided stub.
643 ///
644 /// The most common case for calling this function is in tests mocking the
645 /// client's behavior.
646 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
647 where
648 T: super::stub::BackendBuckets + 'static,
649 {
650 Self { inner: stub.into() }
651 }
652
653 pub(crate) async fn new(
654 config: gaxi::options::ClientConfig,
655 ) -> crate::ClientBuilderResult<Self> {
656 let inner = Self::build_inner(config).await?;
657 Ok(Self { inner })
658 }
659
660 async fn build_inner(
661 conf: gaxi::options::ClientConfig,
662 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BackendBuckets>> {
663 if gaxi::options::tracing_enabled(&conf) {
664 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
665 }
666 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
667 }
668
669 async fn build_transport(
670 conf: gaxi::options::ClientConfig,
671 ) -> crate::ClientBuilderResult<impl super::stub::BackendBuckets> {
672 super::transport::BackendBuckets::new(conf).await
673 }
674
675 async fn build_with_tracing(
676 conf: gaxi::options::ClientConfig,
677 ) -> crate::ClientBuilderResult<impl super::stub::BackendBuckets> {
678 Self::build_transport(conf)
679 .await
680 .map(super::tracing::BackendBuckets::new)
681 }
682
683 /// Adds a key for validating requests with signed URLs for this backend
684 /// bucket.
685 pub fn add_signed_url_key(&self) -> super::builder::backend_buckets::AddSignedUrlKey {
686 super::builder::backend_buckets::AddSignedUrlKey::new(self.inner.clone())
687 }
688
689 /// Retrieves the list of all BackendBucket resources, regional and global,
690 /// available to the specified project.
691 ///
692 /// To prevent failure, it is recommended that you set the
693 /// `returnPartialSuccess` parameter to `true`.
694 pub fn aggregated_list(&self) -> super::builder::backend_buckets::AggregatedList {
695 super::builder::backend_buckets::AggregatedList::new(self.inner.clone())
696 }
697
698 /// Deletes the specified BackendBucket resource.
699 pub fn delete(&self) -> super::builder::backend_buckets::Delete {
700 super::builder::backend_buckets::Delete::new(self.inner.clone())
701 }
702
703 /// Deletes a key for validating requests with signed URLs for this backend
704 /// bucket.
705 pub fn delete_signed_url_key(&self) -> super::builder::backend_buckets::DeleteSignedUrlKey {
706 super::builder::backend_buckets::DeleteSignedUrlKey::new(self.inner.clone())
707 }
708
709 /// Returns the specified BackendBucket resource.
710 pub fn get(&self) -> super::builder::backend_buckets::Get {
711 super::builder::backend_buckets::Get::new(self.inner.clone())
712 }
713
714 /// Gets the access control policy for a resource. May be empty if no such
715 /// policy or resource exists.
716 pub fn get_iam_policy(&self) -> super::builder::backend_buckets::GetIamPolicy {
717 super::builder::backend_buckets::GetIamPolicy::new(self.inner.clone())
718 }
719
720 /// Creates a BackendBucket resource in the specified project using
721 /// the data included in the request.
722 pub fn insert(&self) -> super::builder::backend_buckets::Insert {
723 super::builder::backend_buckets::Insert::new(self.inner.clone())
724 }
725
726 /// Retrieves the list of BackendBucket resources available to the specified
727 /// project.
728 pub fn list(&self) -> super::builder::backend_buckets::List {
729 super::builder::backend_buckets::List::new(self.inner.clone())
730 }
731
732 /// Retrieves a list of all usable backend buckets in the specified project.
733 pub fn list_usable(&self) -> super::builder::backend_buckets::ListUsable {
734 super::builder::backend_buckets::ListUsable::new(self.inner.clone())
735 }
736
737 /// Updates the specified BackendBucket resource with the data included in the
738 /// request. This method supportsPATCH
739 /// semantics and uses theJSON merge
740 /// patch format and processing rules.
741 pub fn patch(&self) -> super::builder::backend_buckets::Patch {
742 super::builder::backend_buckets::Patch::new(self.inner.clone())
743 }
744
745 /// Sets the edge security policy for the specified backend bucket.
746 pub fn set_edge_security_policy(
747 &self,
748 ) -> super::builder::backend_buckets::SetEdgeSecurityPolicy {
749 super::builder::backend_buckets::SetEdgeSecurityPolicy::new(self.inner.clone())
750 }
751
752 /// Sets the access control policy on the specified resource.
753 /// Replaces any existing policy.
754 pub fn set_iam_policy(&self) -> super::builder::backend_buckets::SetIamPolicy {
755 super::builder::backend_buckets::SetIamPolicy::new(self.inner.clone())
756 }
757
758 /// Returns permissions that a caller has on the specified resource.
759 pub fn test_iam_permissions(&self) -> super::builder::backend_buckets::TestIamPermissions {
760 super::builder::backend_buckets::TestIamPermissions::new(self.inner.clone())
761 }
762
763 /// Updates the specified BackendBucket resource with the data included in the
764 /// request.
765 pub fn update(&self) -> super::builder::backend_buckets::Update {
766 super::builder::backend_buckets::Update::new(self.inner.clone())
767 }
768
769 /// Retrieves the specified Operations resource.
770 pub fn get_operation(&self) -> super::builder::backend_buckets::GetOperation {
771 super::builder::backend_buckets::GetOperation::new(self.inner.clone())
772 }
773}
774
775/// Implements a client for the Google Compute Engine API.
776///
777/// # Example
778/// ```
779/// # use google_cloud_compute_v1::client::BackendServices;
780/// async fn sample(
781/// ) -> anyhow::Result<()> {
782/// let client = BackendServices::builder().build().await?;
783/// // use `client` to make requests to the Google Compute Engine API.
784/// Ok(())
785/// }
786/// ```
787///
788/// # Service Description
789///
790/// Service for the `backendServices` resource.
791///
792/// # Configuration
793///
794/// To configure `BackendServices` use the `with_*` methods in the type returned
795/// by [builder()][BackendServices::builder]. The default configuration should
796/// work for most applications. Common configuration changes include
797///
798/// * [with_endpoint()]: by default this client uses the global default endpoint
799/// (`https://compute.googleapis.com`). Applications using regional
800/// endpoints or running in restricted networks (e.g. a network configured
801/// with [Private Google Access with VPC Service Controls]) may want to
802/// override this default.
803/// * [with_credentials()]: by default this client uses
804/// [Application Default Credentials]. Applications using custom
805/// authentication may need to override this default.
806///
807/// [with_endpoint()]: super::builder::backend_services::ClientBuilder::with_endpoint
808/// [with_credentials()]: super::builder::backend_services::ClientBuilder::with_credentials
809/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
810/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
811///
812/// # Pooling and Cloning
813///
814/// `BackendServices` holds a connection pool internally, it is advised to
815/// create one and reuse it. You do not need to wrap `BackendServices` in
816/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
817/// already uses an `Arc` internally.
818#[cfg(feature = "backend-services")]
819#[cfg_attr(docsrs, doc(cfg(feature = "backend-services")))]
820#[derive(Clone, Debug)]
821pub struct BackendServices {
822 inner: std::sync::Arc<dyn super::stub::dynamic::BackendServices>,
823}
824
825#[cfg(feature = "backend-services")]
826impl BackendServices {
827 /// Returns a builder for [BackendServices].
828 ///
829 /// ```
830 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
831 /// # use google_cloud_compute_v1::client::BackendServices;
832 /// let client = BackendServices::builder().build().await?;
833 /// # Ok(()) }
834 /// ```
835 pub fn builder() -> super::builder::backend_services::ClientBuilder {
836 crate::new_client_builder(super::builder::backend_services::client::Factory)
837 }
838
839 /// Creates a new client from the provided stub.
840 ///
841 /// The most common case for calling this function is in tests mocking the
842 /// client's behavior.
843 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
844 where
845 T: super::stub::BackendServices + 'static,
846 {
847 Self { inner: stub.into() }
848 }
849
850 pub(crate) async fn new(
851 config: gaxi::options::ClientConfig,
852 ) -> crate::ClientBuilderResult<Self> {
853 let inner = Self::build_inner(config).await?;
854 Ok(Self { inner })
855 }
856
857 async fn build_inner(
858 conf: gaxi::options::ClientConfig,
859 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::BackendServices>> {
860 if gaxi::options::tracing_enabled(&conf) {
861 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
862 }
863 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
864 }
865
866 async fn build_transport(
867 conf: gaxi::options::ClientConfig,
868 ) -> crate::ClientBuilderResult<impl super::stub::BackendServices> {
869 super::transport::BackendServices::new(conf).await
870 }
871
872 async fn build_with_tracing(
873 conf: gaxi::options::ClientConfig,
874 ) -> crate::ClientBuilderResult<impl super::stub::BackendServices> {
875 Self::build_transport(conf)
876 .await
877 .map(super::tracing::BackendServices::new)
878 }
879
880 /// Adds a key for validating requests with signed URLs for this backend
881 /// service.
882 pub fn add_signed_url_key(&self) -> super::builder::backend_services::AddSignedUrlKey {
883 super::builder::backend_services::AddSignedUrlKey::new(self.inner.clone())
884 }
885
886 /// Retrieves the list of all BackendService resources, regional and global,
887 /// available to the specified project.
888 ///
889 /// To prevent failure, it is recommended that you set the
890 /// `returnPartialSuccess` parameter to `true`.
891 pub fn aggregated_list(&self) -> super::builder::backend_services::AggregatedList {
892 super::builder::backend_services::AggregatedList::new(self.inner.clone())
893 }
894
895 /// Deletes the specified BackendService resource.
896 pub fn delete(&self) -> super::builder::backend_services::Delete {
897 super::builder::backend_services::Delete::new(self.inner.clone())
898 }
899
900 /// Deletes a key for validating requests with signed URLs for this backend
901 /// service.
902 pub fn delete_signed_url_key(&self) -> super::builder::backend_services::DeleteSignedUrlKey {
903 super::builder::backend_services::DeleteSignedUrlKey::new(self.inner.clone())
904 }
905
906 /// Returns the specified BackendService resource.
907 pub fn get(&self) -> super::builder::backend_services::Get {
908 super::builder::backend_services::Get::new(self.inner.clone())
909 }
910
911 /// Returns effective security policies applied to this backend service.
912 pub fn get_effective_security_policies(
913 &self,
914 ) -> super::builder::backend_services::GetEffectiveSecurityPolicies {
915 super::builder::backend_services::GetEffectiveSecurityPolicies::new(self.inner.clone())
916 }
917
918 /// Gets the most recent health check results for this
919 /// BackendService.
920 ///
921 /// Example request body:
922 ///
923 /// {
924 /// "group": "/zones/us-east1-b/instanceGroups/lb-backend-example"
925 /// }
926 pub fn get_health(&self) -> super::builder::backend_services::GetHealth {
927 super::builder::backend_services::GetHealth::new(self.inner.clone())
928 }
929
930 /// Gets the access control policy for a resource. May be empty if no such
931 /// policy or resource exists.
932 pub fn get_iam_policy(&self) -> super::builder::backend_services::GetIamPolicy {
933 super::builder::backend_services::GetIamPolicy::new(self.inner.clone())
934 }
935
936 /// Creates a BackendService resource in the specified project using
937 /// the data included in the request. For more information, see
938 /// Backend services overview.
939 pub fn insert(&self) -> super::builder::backend_services::Insert {
940 super::builder::backend_services::Insert::new(self.inner.clone())
941 }
942
943 /// Retrieves the list of BackendService resources available to the specified
944 /// project.
945 pub fn list(&self) -> super::builder::backend_services::List {
946 super::builder::backend_services::List::new(self.inner.clone())
947 }
948
949 /// Retrieves a list of all usable backend services for Application Load
950 /// Balancers and Proxy Network Load Balancers in the specified project.
951 /// Backend services for external and internal passthrough Network Load
952 /// Balancers are not included in the response.
953 pub fn list_usable(&self) -> super::builder::backend_services::ListUsable {
954 super::builder::backend_services::ListUsable::new(self.inner.clone())
955 }
956
957 /// Patches the specified BackendService resource with the data included in the
958 /// request. For more information, see
959 /// Backend services overview. This method
960 /// supports PATCH semantics and uses the JSON merge
961 /// patch format and processing rules.
962 pub fn patch(&self) -> super::builder::backend_services::Patch {
963 super::builder::backend_services::Patch::new(self.inner.clone())
964 }
965
966 /// Sets the edge security policy for the specified backend service.
967 pub fn set_edge_security_policy(
968 &self,
969 ) -> super::builder::backend_services::SetEdgeSecurityPolicy {
970 super::builder::backend_services::SetEdgeSecurityPolicy::new(self.inner.clone())
971 }
972
973 /// Sets the access control policy on the specified resource.
974 /// Replaces any existing policy.
975 pub fn set_iam_policy(&self) -> super::builder::backend_services::SetIamPolicy {
976 super::builder::backend_services::SetIamPolicy::new(self.inner.clone())
977 }
978
979 /// Sets the Google Cloud Armor security policy for the specified backend
980 /// service. For more information, seeGoogle
981 /// Cloud Armor Overview
982 pub fn set_security_policy(&self) -> super::builder::backend_services::SetSecurityPolicy {
983 super::builder::backend_services::SetSecurityPolicy::new(self.inner.clone())
984 }
985
986 /// Returns permissions that a caller has on the specified resource.
987 pub fn test_iam_permissions(&self) -> super::builder::backend_services::TestIamPermissions {
988 super::builder::backend_services::TestIamPermissions::new(self.inner.clone())
989 }
990
991 /// Updates the specified BackendService resource with the data included in the
992 /// request. For more information, seeBackend
993 /// services overview.
994 pub fn update(&self) -> super::builder::backend_services::Update {
995 super::builder::backend_services::Update::new(self.inner.clone())
996 }
997
998 /// Retrieves the specified Operations resource.
999 pub fn get_operation(&self) -> super::builder::backend_services::GetOperation {
1000 super::builder::backend_services::GetOperation::new(self.inner.clone())
1001 }
1002}
1003
1004/// Implements a client for the Google Compute Engine API.
1005///
1006/// # Example
1007/// ```
1008/// # use google_cloud_compute_v1::client::CrossSiteNetworks;
1009/// async fn sample(
1010/// ) -> anyhow::Result<()> {
1011/// let client = CrossSiteNetworks::builder().build().await?;
1012/// // use `client` to make requests to the Google Compute Engine API.
1013/// Ok(())
1014/// }
1015/// ```
1016///
1017/// # Service Description
1018///
1019/// Service for the `crossSiteNetworks` resource.
1020///
1021/// # Configuration
1022///
1023/// To configure `CrossSiteNetworks` use the `with_*` methods in the type returned
1024/// by [builder()][CrossSiteNetworks::builder]. The default configuration should
1025/// work for most applications. Common configuration changes include
1026///
1027/// * [with_endpoint()]: by default this client uses the global default endpoint
1028/// (`https://compute.googleapis.com`). Applications using regional
1029/// endpoints or running in restricted networks (e.g. a network configured
1030/// with [Private Google Access with VPC Service Controls]) may want to
1031/// override this default.
1032/// * [with_credentials()]: by default this client uses
1033/// [Application Default Credentials]. Applications using custom
1034/// authentication may need to override this default.
1035///
1036/// [with_endpoint()]: super::builder::cross_site_networks::ClientBuilder::with_endpoint
1037/// [with_credentials()]: super::builder::cross_site_networks::ClientBuilder::with_credentials
1038/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1039/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1040///
1041/// # Pooling and Cloning
1042///
1043/// `CrossSiteNetworks` holds a connection pool internally, it is advised to
1044/// create one and reuse it. You do not need to wrap `CrossSiteNetworks` in
1045/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1046/// already uses an `Arc` internally.
1047#[cfg(feature = "cross-site-networks")]
1048#[cfg_attr(docsrs, doc(cfg(feature = "cross-site-networks")))]
1049#[derive(Clone, Debug)]
1050pub struct CrossSiteNetworks {
1051 inner: std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>,
1052}
1053
1054#[cfg(feature = "cross-site-networks")]
1055impl CrossSiteNetworks {
1056 /// Returns a builder for [CrossSiteNetworks].
1057 ///
1058 /// ```
1059 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1060 /// # use google_cloud_compute_v1::client::CrossSiteNetworks;
1061 /// let client = CrossSiteNetworks::builder().build().await?;
1062 /// # Ok(()) }
1063 /// ```
1064 pub fn builder() -> super::builder::cross_site_networks::ClientBuilder {
1065 crate::new_client_builder(super::builder::cross_site_networks::client::Factory)
1066 }
1067
1068 /// Creates a new client from the provided stub.
1069 ///
1070 /// The most common case for calling this function is in tests mocking the
1071 /// client's behavior.
1072 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1073 where
1074 T: super::stub::CrossSiteNetworks + 'static,
1075 {
1076 Self { inner: stub.into() }
1077 }
1078
1079 pub(crate) async fn new(
1080 config: gaxi::options::ClientConfig,
1081 ) -> crate::ClientBuilderResult<Self> {
1082 let inner = Self::build_inner(config).await?;
1083 Ok(Self { inner })
1084 }
1085
1086 async fn build_inner(
1087 conf: gaxi::options::ClientConfig,
1088 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::CrossSiteNetworks>>
1089 {
1090 if gaxi::options::tracing_enabled(&conf) {
1091 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1092 }
1093 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1094 }
1095
1096 async fn build_transport(
1097 conf: gaxi::options::ClientConfig,
1098 ) -> crate::ClientBuilderResult<impl super::stub::CrossSiteNetworks> {
1099 super::transport::CrossSiteNetworks::new(conf).await
1100 }
1101
1102 async fn build_with_tracing(
1103 conf: gaxi::options::ClientConfig,
1104 ) -> crate::ClientBuilderResult<impl super::stub::CrossSiteNetworks> {
1105 Self::build_transport(conf)
1106 .await
1107 .map(super::tracing::CrossSiteNetworks::new)
1108 }
1109
1110 /// Deletes the specified cross-site network in the given scope.
1111 pub fn delete(&self) -> super::builder::cross_site_networks::Delete {
1112 super::builder::cross_site_networks::Delete::new(self.inner.clone())
1113 }
1114
1115 /// Returns the specified cross-site network in the given scope.
1116 pub fn get(&self) -> super::builder::cross_site_networks::Get {
1117 super::builder::cross_site_networks::Get::new(self.inner.clone())
1118 }
1119
1120 /// Creates a cross-site network in the specified project in the given scope
1121 /// using the parameters that are included in the request.
1122 pub fn insert(&self) -> super::builder::cross_site_networks::Insert {
1123 super::builder::cross_site_networks::Insert::new(self.inner.clone())
1124 }
1125
1126 /// Lists the cross-site networks for a project in the given scope.
1127 pub fn list(&self) -> super::builder::cross_site_networks::List {
1128 super::builder::cross_site_networks::List::new(self.inner.clone())
1129 }
1130
1131 /// Updates the specified cross-site network with the data included in
1132 /// the request. This method supportsPATCH
1133 /// semantics and uses theJSON merge
1134 /// patch format and processing rules.
1135 pub fn patch(&self) -> super::builder::cross_site_networks::Patch {
1136 super::builder::cross_site_networks::Patch::new(self.inner.clone())
1137 }
1138
1139 /// Retrieves the specified Operations resource.
1140 pub fn get_operation(&self) -> super::builder::cross_site_networks::GetOperation {
1141 super::builder::cross_site_networks::GetOperation::new(self.inner.clone())
1142 }
1143}
1144
1145/// Implements a client for the Google Compute Engine API.
1146///
1147/// # Example
1148/// ```
1149/// # use google_cloud_compute_v1::client::DiskTypes;
1150/// async fn sample(
1151/// ) -> anyhow::Result<()> {
1152/// let client = DiskTypes::builder().build().await?;
1153/// // use `client` to make requests to the Google Compute Engine API.
1154/// Ok(())
1155/// }
1156/// ```
1157///
1158/// # Service Description
1159///
1160/// Service for the `diskTypes` resource.
1161///
1162/// # Configuration
1163///
1164/// To configure `DiskTypes` use the `with_*` methods in the type returned
1165/// by [builder()][DiskTypes::builder]. The default configuration should
1166/// work for most applications. Common configuration changes include
1167///
1168/// * [with_endpoint()]: by default this client uses the global default endpoint
1169/// (`https://compute.googleapis.com`). Applications using regional
1170/// endpoints or running in restricted networks (e.g. a network configured
1171/// with [Private Google Access with VPC Service Controls]) may want to
1172/// override this default.
1173/// * [with_credentials()]: by default this client uses
1174/// [Application Default Credentials]. Applications using custom
1175/// authentication may need to override this default.
1176///
1177/// [with_endpoint()]: super::builder::disk_types::ClientBuilder::with_endpoint
1178/// [with_credentials()]: super::builder::disk_types::ClientBuilder::with_credentials
1179/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1180/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1181///
1182/// # Pooling and Cloning
1183///
1184/// `DiskTypes` holds a connection pool internally, it is advised to
1185/// create one and reuse it. You do not need to wrap `DiskTypes` in
1186/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1187/// already uses an `Arc` internally.
1188#[cfg(feature = "disk-types")]
1189#[cfg_attr(docsrs, doc(cfg(feature = "disk-types")))]
1190#[derive(Clone, Debug)]
1191pub struct DiskTypes {
1192 inner: std::sync::Arc<dyn super::stub::dynamic::DiskTypes>,
1193}
1194
1195#[cfg(feature = "disk-types")]
1196impl DiskTypes {
1197 /// Returns a builder for [DiskTypes].
1198 ///
1199 /// ```
1200 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1201 /// # use google_cloud_compute_v1::client::DiskTypes;
1202 /// let client = DiskTypes::builder().build().await?;
1203 /// # Ok(()) }
1204 /// ```
1205 pub fn builder() -> super::builder::disk_types::ClientBuilder {
1206 crate::new_client_builder(super::builder::disk_types::client::Factory)
1207 }
1208
1209 /// Creates a new client from the provided stub.
1210 ///
1211 /// The most common case for calling this function is in tests mocking the
1212 /// client's behavior.
1213 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1214 where
1215 T: super::stub::DiskTypes + 'static,
1216 {
1217 Self { inner: stub.into() }
1218 }
1219
1220 pub(crate) async fn new(
1221 config: gaxi::options::ClientConfig,
1222 ) -> crate::ClientBuilderResult<Self> {
1223 let inner = Self::build_inner(config).await?;
1224 Ok(Self { inner })
1225 }
1226
1227 async fn build_inner(
1228 conf: gaxi::options::ClientConfig,
1229 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::DiskTypes>> {
1230 if gaxi::options::tracing_enabled(&conf) {
1231 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1232 }
1233 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1234 }
1235
1236 async fn build_transport(
1237 conf: gaxi::options::ClientConfig,
1238 ) -> crate::ClientBuilderResult<impl super::stub::DiskTypes> {
1239 super::transport::DiskTypes::new(conf).await
1240 }
1241
1242 async fn build_with_tracing(
1243 conf: gaxi::options::ClientConfig,
1244 ) -> crate::ClientBuilderResult<impl super::stub::DiskTypes> {
1245 Self::build_transport(conf)
1246 .await
1247 .map(super::tracing::DiskTypes::new)
1248 }
1249
1250 /// Retrieves an aggregated list of disk types.
1251 ///
1252 /// To prevent failure, it is recommended that you set the
1253 /// `returnPartialSuccess` parameter to `true`.
1254 pub fn aggregated_list(&self) -> super::builder::disk_types::AggregatedList {
1255 super::builder::disk_types::AggregatedList::new(self.inner.clone())
1256 }
1257
1258 /// Returns the specified disk type.
1259 pub fn get(&self) -> super::builder::disk_types::Get {
1260 super::builder::disk_types::Get::new(self.inner.clone())
1261 }
1262
1263 /// Retrieves a list of disk types available to the specified
1264 /// project.
1265 pub fn list(&self) -> super::builder::disk_types::List {
1266 super::builder::disk_types::List::new(self.inner.clone())
1267 }
1268}
1269
1270/// Implements a client for the Google Compute Engine API.
1271///
1272/// # Example
1273/// ```
1274/// # use google_cloud_compute_v1::client::Disks;
1275/// async fn sample(
1276/// ) -> anyhow::Result<()> {
1277/// let client = Disks::builder().build().await?;
1278/// // use `client` to make requests to the Google Compute Engine API.
1279/// Ok(())
1280/// }
1281/// ```
1282///
1283/// # Service Description
1284///
1285/// Service for the `disks` resource.
1286///
1287/// # Configuration
1288///
1289/// To configure `Disks` use the `with_*` methods in the type returned
1290/// by [builder()][Disks::builder]. The default configuration should
1291/// work for most applications. Common configuration changes include
1292///
1293/// * [with_endpoint()]: by default this client uses the global default endpoint
1294/// (`https://compute.googleapis.com`). Applications using regional
1295/// endpoints or running in restricted networks (e.g. a network configured
1296/// with [Private Google Access with VPC Service Controls]) may want to
1297/// override this default.
1298/// * [with_credentials()]: by default this client uses
1299/// [Application Default Credentials]. Applications using custom
1300/// authentication may need to override this default.
1301///
1302/// [with_endpoint()]: super::builder::disks::ClientBuilder::with_endpoint
1303/// [with_credentials()]: super::builder::disks::ClientBuilder::with_credentials
1304/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1305/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1306///
1307/// # Pooling and Cloning
1308///
1309/// `Disks` holds a connection pool internally, it is advised to
1310/// create one and reuse it. You do not need to wrap `Disks` in
1311/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1312/// already uses an `Arc` internally.
1313#[cfg(feature = "disks")]
1314#[cfg_attr(docsrs, doc(cfg(feature = "disks")))]
1315#[derive(Clone, Debug)]
1316pub struct Disks {
1317 inner: std::sync::Arc<dyn super::stub::dynamic::Disks>,
1318}
1319
1320#[cfg(feature = "disks")]
1321impl Disks {
1322 /// Returns a builder for [Disks].
1323 ///
1324 /// ```
1325 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1326 /// # use google_cloud_compute_v1::client::Disks;
1327 /// let client = Disks::builder().build().await?;
1328 /// # Ok(()) }
1329 /// ```
1330 pub fn builder() -> super::builder::disks::ClientBuilder {
1331 crate::new_client_builder(super::builder::disks::client::Factory)
1332 }
1333
1334 /// Creates a new client from the provided stub.
1335 ///
1336 /// The most common case for calling this function is in tests mocking the
1337 /// client's behavior.
1338 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1339 where
1340 T: super::stub::Disks + 'static,
1341 {
1342 Self { inner: stub.into() }
1343 }
1344
1345 pub(crate) async fn new(
1346 config: gaxi::options::ClientConfig,
1347 ) -> crate::ClientBuilderResult<Self> {
1348 let inner = Self::build_inner(config).await?;
1349 Ok(Self { inner })
1350 }
1351
1352 async fn build_inner(
1353 conf: gaxi::options::ClientConfig,
1354 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Disks>> {
1355 if gaxi::options::tracing_enabled(&conf) {
1356 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1357 }
1358 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1359 }
1360
1361 async fn build_transport(
1362 conf: gaxi::options::ClientConfig,
1363 ) -> crate::ClientBuilderResult<impl super::stub::Disks> {
1364 super::transport::Disks::new(conf).await
1365 }
1366
1367 async fn build_with_tracing(
1368 conf: gaxi::options::ClientConfig,
1369 ) -> crate::ClientBuilderResult<impl super::stub::Disks> {
1370 Self::build_transport(conf)
1371 .await
1372 .map(super::tracing::Disks::new)
1373 }
1374
1375 /// Adds existing resource policies to a disk. You can only add one
1376 /// policy which will be applied to this disk for scheduling snapshot
1377 /// creation.
1378 pub fn add_resource_policies(&self) -> super::builder::disks::AddResourcePolicies {
1379 super::builder::disks::AddResourcePolicies::new(self.inner.clone())
1380 }
1381
1382 /// Retrieves an aggregated list of persistent disks.
1383 ///
1384 /// To prevent failure, it is recommended that you set the
1385 /// `returnPartialSuccess` parameter to `true`.
1386 pub fn aggregated_list(&self) -> super::builder::disks::AggregatedList {
1387 super::builder::disks::AggregatedList::new(self.inner.clone())
1388 }
1389
1390 /// Bulk create a set of disks.
1391 pub fn bulk_insert(&self) -> super::builder::disks::BulkInsert {
1392 super::builder::disks::BulkInsert::new(self.inner.clone())
1393 }
1394
1395 /// Sets the labels on many disks at once. To learn more about labels, read theLabeling
1396 /// Resources documentation.
1397 pub fn bulk_set_labels(&self) -> super::builder::disks::BulkSetLabels {
1398 super::builder::disks::BulkSetLabels::new(self.inner.clone())
1399 }
1400
1401 /// Creates a snapshot of a specified persistent disk. For regular snapshot
1402 /// creation, consider using snapshots.insert
1403 /// instead, as that method supports more features, such as creating snapshots
1404 /// in a project different from the source disk project.
1405 pub fn create_snapshot(&self) -> super::builder::disks::CreateSnapshot {
1406 super::builder::disks::CreateSnapshot::new(self.inner.clone())
1407 }
1408
1409 /// Deletes the specified persistent disk. Deleting a disk removes its data
1410 /// permanently and is irreversible. However, deleting a disk does not
1411 /// delete any snapshots
1412 /// previously made from the disk. You must separatelydelete
1413 /// snapshots.
1414 pub fn delete(&self) -> super::builder::disks::Delete {
1415 super::builder::disks::Delete::new(self.inner.clone())
1416 }
1417
1418 /// Returns the specified persistent disk.
1419 pub fn get(&self) -> super::builder::disks::Get {
1420 super::builder::disks::Get::new(self.inner.clone())
1421 }
1422
1423 /// Gets the access control policy for a resource. May be empty if no such
1424 /// policy or resource exists.
1425 pub fn get_iam_policy(&self) -> super::builder::disks::GetIamPolicy {
1426 super::builder::disks::GetIamPolicy::new(self.inner.clone())
1427 }
1428
1429 /// Creates a persistent disk in the specified project using the data
1430 /// in the request. You can create a disk from a source
1431 /// (sourceImage, sourceSnapshot, orsourceDisk) or create an empty 500 GB data disk by
1432 /// omitting all properties. You can also create a disk that is larger than
1433 /// the default size by specifying the sizeGb property.
1434 pub fn insert(&self) -> super::builder::disks::Insert {
1435 super::builder::disks::Insert::new(self.inner.clone())
1436 }
1437
1438 /// Retrieves a list of persistent disks contained within
1439 /// the specified zone.
1440 pub fn list(&self) -> super::builder::disks::List {
1441 super::builder::disks::List::new(self.inner.clone())
1442 }
1443
1444 /// Removes resource policies from a disk.
1445 pub fn remove_resource_policies(&self) -> super::builder::disks::RemoveResourcePolicies {
1446 super::builder::disks::RemoveResourcePolicies::new(self.inner.clone())
1447 }
1448
1449 /// Resizes the specified persistent disk.
1450 /// You can only increase the size of the disk.
1451 pub fn resize(&self) -> super::builder::disks::Resize {
1452 super::builder::disks::Resize::new(self.inner.clone())
1453 }
1454
1455 /// Sets the access control policy on the specified resource.
1456 /// Replaces any existing policy.
1457 pub fn set_iam_policy(&self) -> super::builder::disks::SetIamPolicy {
1458 super::builder::disks::SetIamPolicy::new(self.inner.clone())
1459 }
1460
1461 /// Sets the labels on a disk. To learn more about labels, read theLabeling
1462 /// Resources documentation.
1463 pub fn set_labels(&self) -> super::builder::disks::SetLabels {
1464 super::builder::disks::SetLabels::new(self.inner.clone())
1465 }
1466
1467 /// Starts asynchronous replication.
1468 /// Must be invoked on the primary disk.
1469 pub fn start_async_replication(&self) -> super::builder::disks::StartAsyncReplication {
1470 super::builder::disks::StartAsyncReplication::new(self.inner.clone())
1471 }
1472
1473 /// Stops asynchronous replication.
1474 /// Can be invoked either on the primary or on the secondary disk.
1475 pub fn stop_async_replication(&self) -> super::builder::disks::StopAsyncReplication {
1476 super::builder::disks::StopAsyncReplication::new(self.inner.clone())
1477 }
1478
1479 /// Stops asynchronous replication for a consistency group of disks.
1480 /// Can be invoked either in the primary or secondary scope.
1481 pub fn stop_group_async_replication(&self) -> super::builder::disks::StopGroupAsyncReplication {
1482 super::builder::disks::StopGroupAsyncReplication::new(self.inner.clone())
1483 }
1484
1485 /// Returns permissions that a caller has on the specified resource.
1486 pub fn test_iam_permissions(&self) -> super::builder::disks::TestIamPermissions {
1487 super::builder::disks::TestIamPermissions::new(self.inner.clone())
1488 }
1489
1490 /// Updates the specified disk with the data included in the request.
1491 /// The update is performed only on selected fields included as part
1492 /// of update-mask.
1493 pub fn update(&self) -> super::builder::disks::Update {
1494 super::builder::disks::Update::new(self.inner.clone())
1495 }
1496
1497 /// Rotates the customer-managed
1498 /// encryption key to the latest version for the specified persistent disk.
1499 pub fn update_kms_key(&self) -> super::builder::disks::UpdateKmsKey {
1500 super::builder::disks::UpdateKmsKey::new(self.inner.clone())
1501 }
1502
1503 /// Retrieves the specified zone-specific Operations resource.
1504 pub fn get_operation(&self) -> super::builder::disks::GetOperation {
1505 super::builder::disks::GetOperation::new(self.inner.clone())
1506 }
1507}
1508
1509/// Implements a client for the Google Compute Engine API.
1510///
1511/// # Example
1512/// ```
1513/// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1514/// async fn sample(
1515/// ) -> anyhow::Result<()> {
1516/// let client = ExternalVpnGateways::builder().build().await?;
1517/// // use `client` to make requests to the Google Compute Engine API.
1518/// Ok(())
1519/// }
1520/// ```
1521///
1522/// # Service Description
1523///
1524/// Service for the `externalVpnGateways` resource.
1525///
1526/// # Configuration
1527///
1528/// To configure `ExternalVpnGateways` use the `with_*` methods in the type returned
1529/// by [builder()][ExternalVpnGateways::builder]. The default configuration should
1530/// work for most applications. Common configuration changes include
1531///
1532/// * [with_endpoint()]: by default this client uses the global default endpoint
1533/// (`https://compute.googleapis.com`). Applications using regional
1534/// endpoints or running in restricted networks (e.g. a network configured
1535/// with [Private Google Access with VPC Service Controls]) may want to
1536/// override this default.
1537/// * [with_credentials()]: by default this client uses
1538/// [Application Default Credentials]. Applications using custom
1539/// authentication may need to override this default.
1540///
1541/// [with_endpoint()]: super::builder::external_vpn_gateways::ClientBuilder::with_endpoint
1542/// [with_credentials()]: super::builder::external_vpn_gateways::ClientBuilder::with_credentials
1543/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1544/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1545///
1546/// # Pooling and Cloning
1547///
1548/// `ExternalVpnGateways` holds a connection pool internally, it is advised to
1549/// create one and reuse it. You do not need to wrap `ExternalVpnGateways` in
1550/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1551/// already uses an `Arc` internally.
1552#[cfg(feature = "external-vpn-gateways")]
1553#[cfg_attr(docsrs, doc(cfg(feature = "external-vpn-gateways")))]
1554#[derive(Clone, Debug)]
1555pub struct ExternalVpnGateways {
1556 inner: std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>,
1557}
1558
1559#[cfg(feature = "external-vpn-gateways")]
1560impl ExternalVpnGateways {
1561 /// Returns a builder for [ExternalVpnGateways].
1562 ///
1563 /// ```
1564 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1565 /// # use google_cloud_compute_v1::client::ExternalVpnGateways;
1566 /// let client = ExternalVpnGateways::builder().build().await?;
1567 /// # Ok(()) }
1568 /// ```
1569 pub fn builder() -> super::builder::external_vpn_gateways::ClientBuilder {
1570 crate::new_client_builder(super::builder::external_vpn_gateways::client::Factory)
1571 }
1572
1573 /// Creates a new client from the provided stub.
1574 ///
1575 /// The most common case for calling this function is in tests mocking the
1576 /// client's behavior.
1577 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1578 where
1579 T: super::stub::ExternalVpnGateways + 'static,
1580 {
1581 Self { inner: stub.into() }
1582 }
1583
1584 pub(crate) async fn new(
1585 config: gaxi::options::ClientConfig,
1586 ) -> crate::ClientBuilderResult<Self> {
1587 let inner = Self::build_inner(config).await?;
1588 Ok(Self { inner })
1589 }
1590
1591 async fn build_inner(
1592 conf: gaxi::options::ClientConfig,
1593 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ExternalVpnGateways>>
1594 {
1595 if gaxi::options::tracing_enabled(&conf) {
1596 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1597 }
1598 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1599 }
1600
1601 async fn build_transport(
1602 conf: gaxi::options::ClientConfig,
1603 ) -> crate::ClientBuilderResult<impl super::stub::ExternalVpnGateways> {
1604 super::transport::ExternalVpnGateways::new(conf).await
1605 }
1606
1607 async fn build_with_tracing(
1608 conf: gaxi::options::ClientConfig,
1609 ) -> crate::ClientBuilderResult<impl super::stub::ExternalVpnGateways> {
1610 Self::build_transport(conf)
1611 .await
1612 .map(super::tracing::ExternalVpnGateways::new)
1613 }
1614
1615 /// Deletes the specified externalVpnGateway.
1616 pub fn delete(&self) -> super::builder::external_vpn_gateways::Delete {
1617 super::builder::external_vpn_gateways::Delete::new(self.inner.clone())
1618 }
1619
1620 /// Returns the specified externalVpnGateway. Get a list of available
1621 /// externalVpnGateways by making a list() request.
1622 pub fn get(&self) -> super::builder::external_vpn_gateways::Get {
1623 super::builder::external_vpn_gateways::Get::new(self.inner.clone())
1624 }
1625
1626 /// Creates a ExternalVpnGateway in the specified project using
1627 /// the data included in the request.
1628 pub fn insert(&self) -> super::builder::external_vpn_gateways::Insert {
1629 super::builder::external_vpn_gateways::Insert::new(self.inner.clone())
1630 }
1631
1632 /// Retrieves the list of ExternalVpnGateway available to the specified
1633 /// project.
1634 pub fn list(&self) -> super::builder::external_vpn_gateways::List {
1635 super::builder::external_vpn_gateways::List::new(self.inner.clone())
1636 }
1637
1638 /// Sets the labels on an ExternalVpnGateway. To learn more about labels,
1639 /// read the Labeling
1640 /// Resources documentation.
1641 pub fn set_labels(&self) -> super::builder::external_vpn_gateways::SetLabels {
1642 super::builder::external_vpn_gateways::SetLabels::new(self.inner.clone())
1643 }
1644
1645 /// Returns permissions that a caller has on the specified resource.
1646 pub fn test_iam_permissions(
1647 &self,
1648 ) -> super::builder::external_vpn_gateways::TestIamPermissions {
1649 super::builder::external_vpn_gateways::TestIamPermissions::new(self.inner.clone())
1650 }
1651
1652 /// Retrieves the specified Operations resource.
1653 pub fn get_operation(&self) -> super::builder::external_vpn_gateways::GetOperation {
1654 super::builder::external_vpn_gateways::GetOperation::new(self.inner.clone())
1655 }
1656}
1657
1658/// Implements a client for the Google Compute Engine API.
1659///
1660/// # Example
1661/// ```
1662/// # use google_cloud_compute_v1::client::FirewallPolicies;
1663/// async fn sample(
1664/// ) -> anyhow::Result<()> {
1665/// let client = FirewallPolicies::builder().build().await?;
1666/// // use `client` to make requests to the Google Compute Engine API.
1667/// Ok(())
1668/// }
1669/// ```
1670///
1671/// # Service Description
1672///
1673/// Service for the `firewallPolicies` resource.
1674///
1675/// # Configuration
1676///
1677/// To configure `FirewallPolicies` use the `with_*` methods in the type returned
1678/// by [builder()][FirewallPolicies::builder]. The default configuration should
1679/// work for most applications. Common configuration changes include
1680///
1681/// * [with_endpoint()]: by default this client uses the global default endpoint
1682/// (`https://compute.googleapis.com`). Applications using regional
1683/// endpoints or running in restricted networks (e.g. a network configured
1684/// with [Private Google Access with VPC Service Controls]) may want to
1685/// override this default.
1686/// * [with_credentials()]: by default this client uses
1687/// [Application Default Credentials]. Applications using custom
1688/// authentication may need to override this default.
1689///
1690/// [with_endpoint()]: super::builder::firewall_policies::ClientBuilder::with_endpoint
1691/// [with_credentials()]: super::builder::firewall_policies::ClientBuilder::with_credentials
1692/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1693/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1694///
1695/// # Pooling and Cloning
1696///
1697/// `FirewallPolicies` holds a connection pool internally, it is advised to
1698/// create one and reuse it. You do not need to wrap `FirewallPolicies` in
1699/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1700/// already uses an `Arc` internally.
1701#[cfg(feature = "firewall-policies")]
1702#[cfg_attr(docsrs, doc(cfg(feature = "firewall-policies")))]
1703#[derive(Clone, Debug)]
1704pub struct FirewallPolicies {
1705 inner: std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>,
1706}
1707
1708#[cfg(feature = "firewall-policies")]
1709impl FirewallPolicies {
1710 /// Returns a builder for [FirewallPolicies].
1711 ///
1712 /// ```
1713 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1714 /// # use google_cloud_compute_v1::client::FirewallPolicies;
1715 /// let client = FirewallPolicies::builder().build().await?;
1716 /// # Ok(()) }
1717 /// ```
1718 pub fn builder() -> super::builder::firewall_policies::ClientBuilder {
1719 crate::new_client_builder(super::builder::firewall_policies::client::Factory)
1720 }
1721
1722 /// Creates a new client from the provided stub.
1723 ///
1724 /// The most common case for calling this function is in tests mocking the
1725 /// client's behavior.
1726 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1727 where
1728 T: super::stub::FirewallPolicies + 'static,
1729 {
1730 Self { inner: stub.into() }
1731 }
1732
1733 pub(crate) async fn new(
1734 config: gaxi::options::ClientConfig,
1735 ) -> crate::ClientBuilderResult<Self> {
1736 let inner = Self::build_inner(config).await?;
1737 Ok(Self { inner })
1738 }
1739
1740 async fn build_inner(
1741 conf: gaxi::options::ClientConfig,
1742 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FirewallPolicies>>
1743 {
1744 if gaxi::options::tracing_enabled(&conf) {
1745 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1746 }
1747 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1748 }
1749
1750 async fn build_transport(
1751 conf: gaxi::options::ClientConfig,
1752 ) -> crate::ClientBuilderResult<impl super::stub::FirewallPolicies> {
1753 super::transport::FirewallPolicies::new(conf).await
1754 }
1755
1756 async fn build_with_tracing(
1757 conf: gaxi::options::ClientConfig,
1758 ) -> crate::ClientBuilderResult<impl super::stub::FirewallPolicies> {
1759 Self::build_transport(conf)
1760 .await
1761 .map(super::tracing::FirewallPolicies::new)
1762 }
1763
1764 /// Inserts an association for the specified firewall policy.
1765 pub fn add_association(&self) -> super::builder::firewall_policies::AddAssociation {
1766 super::builder::firewall_policies::AddAssociation::new(self.inner.clone())
1767 }
1768
1769 /// Inserts a rule into a firewall policy.
1770 pub fn add_rule(&self) -> super::builder::firewall_policies::AddRule {
1771 super::builder::firewall_policies::AddRule::new(self.inner.clone())
1772 }
1773
1774 /// Copies rules to the specified firewall policy.
1775 pub fn clone_rules(&self) -> super::builder::firewall_policies::CloneRules {
1776 super::builder::firewall_policies::CloneRules::new(self.inner.clone())
1777 }
1778
1779 /// Deletes the specified policy.
1780 pub fn delete(&self) -> super::builder::firewall_policies::Delete {
1781 super::builder::firewall_policies::Delete::new(self.inner.clone())
1782 }
1783
1784 /// Returns the specified firewall policy.
1785 pub fn get(&self) -> super::builder::firewall_policies::Get {
1786 super::builder::firewall_policies::Get::new(self.inner.clone())
1787 }
1788
1789 /// Gets an association with the specified name.
1790 pub fn get_association(&self) -> super::builder::firewall_policies::GetAssociation {
1791 super::builder::firewall_policies::GetAssociation::new(self.inner.clone())
1792 }
1793
1794 /// Gets the access control policy for a resource. May be empty if no such
1795 /// policy or resource exists.
1796 pub fn get_iam_policy(&self) -> super::builder::firewall_policies::GetIamPolicy {
1797 super::builder::firewall_policies::GetIamPolicy::new(self.inner.clone())
1798 }
1799
1800 /// Gets a rule of the specified priority.
1801 pub fn get_rule(&self) -> super::builder::firewall_policies::GetRule {
1802 super::builder::firewall_policies::GetRule::new(self.inner.clone())
1803 }
1804
1805 /// Creates a new policy in the specified project using the data included in
1806 /// the request.
1807 pub fn insert(&self) -> super::builder::firewall_policies::Insert {
1808 super::builder::firewall_policies::Insert::new(self.inner.clone())
1809 }
1810
1811 /// Lists all the policies that have been configured for the specified
1812 /// folder or organization.
1813 pub fn list(&self) -> super::builder::firewall_policies::List {
1814 super::builder::firewall_policies::List::new(self.inner.clone())
1815 }
1816
1817 /// Lists associations of a specified target, i.e., organization or folder.
1818 pub fn list_associations(&self) -> super::builder::firewall_policies::ListAssociations {
1819 super::builder::firewall_policies::ListAssociations::new(self.inner.clone())
1820 }
1821
1822 /// Moves the specified firewall policy.
1823 pub fn r#move(&self) -> super::builder::firewall_policies::Move {
1824 super::builder::firewall_policies::Move::new(self.inner.clone())
1825 }
1826
1827 /// Patches the specified policy with the data included in the request.
1828 pub fn patch(&self) -> super::builder::firewall_policies::Patch {
1829 super::builder::firewall_policies::Patch::new(self.inner.clone())
1830 }
1831
1832 /// Patches a rule of the specified priority.
1833 pub fn patch_rule(&self) -> super::builder::firewall_policies::PatchRule {
1834 super::builder::firewall_policies::PatchRule::new(self.inner.clone())
1835 }
1836
1837 /// Removes an association for the specified firewall policy.
1838 pub fn remove_association(&self) -> super::builder::firewall_policies::RemoveAssociation {
1839 super::builder::firewall_policies::RemoveAssociation::new(self.inner.clone())
1840 }
1841
1842 /// Deletes a rule of the specified priority.
1843 pub fn remove_rule(&self) -> super::builder::firewall_policies::RemoveRule {
1844 super::builder::firewall_policies::RemoveRule::new(self.inner.clone())
1845 }
1846
1847 /// Sets the access control policy on the specified resource.
1848 /// Replaces any existing policy.
1849 pub fn set_iam_policy(&self) -> super::builder::firewall_policies::SetIamPolicy {
1850 super::builder::firewall_policies::SetIamPolicy::new(self.inner.clone())
1851 }
1852
1853 /// Returns permissions that a caller has on the specified resource.
1854 pub fn test_iam_permissions(&self) -> super::builder::firewall_policies::TestIamPermissions {
1855 super::builder::firewall_policies::TestIamPermissions::new(self.inner.clone())
1856 }
1857
1858 /// Retrieves the specified Operations resource. Gets a list of operations
1859 /// by making a `list()` request.
1860 pub fn get_operation(&self) -> super::builder::firewall_policies::GetOperation {
1861 super::builder::firewall_policies::GetOperation::new(self.inner.clone())
1862 }
1863}
1864
1865/// Implements a client for the Google Compute Engine API.
1866///
1867/// # Example
1868/// ```
1869/// # use google_cloud_compute_v1::client::Firewalls;
1870/// async fn sample(
1871/// ) -> anyhow::Result<()> {
1872/// let client = Firewalls::builder().build().await?;
1873/// // use `client` to make requests to the Google Compute Engine API.
1874/// Ok(())
1875/// }
1876/// ```
1877///
1878/// # Service Description
1879///
1880/// Service for the `firewalls` resource.
1881///
1882/// # Configuration
1883///
1884/// To configure `Firewalls` use the `with_*` methods in the type returned
1885/// by [builder()][Firewalls::builder]. The default configuration should
1886/// work for most applications. Common configuration changes include
1887///
1888/// * [with_endpoint()]: by default this client uses the global default endpoint
1889/// (`https://compute.googleapis.com`). Applications using regional
1890/// endpoints or running in restricted networks (e.g. a network configured
1891/// with [Private Google Access with VPC Service Controls]) may want to
1892/// override this default.
1893/// * [with_credentials()]: by default this client uses
1894/// [Application Default Credentials]. Applications using custom
1895/// authentication may need to override this default.
1896///
1897/// [with_endpoint()]: super::builder::firewalls::ClientBuilder::with_endpoint
1898/// [with_credentials()]: super::builder::firewalls::ClientBuilder::with_credentials
1899/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
1900/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
1901///
1902/// # Pooling and Cloning
1903///
1904/// `Firewalls` holds a connection pool internally, it is advised to
1905/// create one and reuse it. You do not need to wrap `Firewalls` in
1906/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
1907/// already uses an `Arc` internally.
1908#[cfg(feature = "firewalls")]
1909#[cfg_attr(docsrs, doc(cfg(feature = "firewalls")))]
1910#[derive(Clone, Debug)]
1911pub struct Firewalls {
1912 inner: std::sync::Arc<dyn super::stub::dynamic::Firewalls>,
1913}
1914
1915#[cfg(feature = "firewalls")]
1916impl Firewalls {
1917 /// Returns a builder for [Firewalls].
1918 ///
1919 /// ```
1920 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1921 /// # use google_cloud_compute_v1::client::Firewalls;
1922 /// let client = Firewalls::builder().build().await?;
1923 /// # Ok(()) }
1924 /// ```
1925 pub fn builder() -> super::builder::firewalls::ClientBuilder {
1926 crate::new_client_builder(super::builder::firewalls::client::Factory)
1927 }
1928
1929 /// Creates a new client from the provided stub.
1930 ///
1931 /// The most common case for calling this function is in tests mocking the
1932 /// client's behavior.
1933 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
1934 where
1935 T: super::stub::Firewalls + 'static,
1936 {
1937 Self { inner: stub.into() }
1938 }
1939
1940 pub(crate) async fn new(
1941 config: gaxi::options::ClientConfig,
1942 ) -> crate::ClientBuilderResult<Self> {
1943 let inner = Self::build_inner(config).await?;
1944 Ok(Self { inner })
1945 }
1946
1947 async fn build_inner(
1948 conf: gaxi::options::ClientConfig,
1949 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Firewalls>> {
1950 if gaxi::options::tracing_enabled(&conf) {
1951 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
1952 }
1953 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
1954 }
1955
1956 async fn build_transport(
1957 conf: gaxi::options::ClientConfig,
1958 ) -> crate::ClientBuilderResult<impl super::stub::Firewalls> {
1959 super::transport::Firewalls::new(conf).await
1960 }
1961
1962 async fn build_with_tracing(
1963 conf: gaxi::options::ClientConfig,
1964 ) -> crate::ClientBuilderResult<impl super::stub::Firewalls> {
1965 Self::build_transport(conf)
1966 .await
1967 .map(super::tracing::Firewalls::new)
1968 }
1969
1970 /// Deletes the specified firewall.
1971 pub fn delete(&self) -> super::builder::firewalls::Delete {
1972 super::builder::firewalls::Delete::new(self.inner.clone())
1973 }
1974
1975 /// Returns the specified firewall.
1976 pub fn get(&self) -> super::builder::firewalls::Get {
1977 super::builder::firewalls::Get::new(self.inner.clone())
1978 }
1979
1980 /// Creates a firewall rule in the specified project using the data
1981 /// included in the request.
1982 pub fn insert(&self) -> super::builder::firewalls::Insert {
1983 super::builder::firewalls::Insert::new(self.inner.clone())
1984 }
1985
1986 /// Retrieves the list of firewall rules available to the specified
1987 /// project.
1988 pub fn list(&self) -> super::builder::firewalls::List {
1989 super::builder::firewalls::List::new(self.inner.clone())
1990 }
1991
1992 /// Updates the specified firewall rule with the data included in the
1993 /// request. This method supportsPATCH
1994 /// semantics and uses theJSON merge
1995 /// patch format and processing rules.
1996 pub fn patch(&self) -> super::builder::firewalls::Patch {
1997 super::builder::firewalls::Patch::new(self.inner.clone())
1998 }
1999
2000 /// Returns permissions that a caller has on the specified resource.
2001 pub fn test_iam_permissions(&self) -> super::builder::firewalls::TestIamPermissions {
2002 super::builder::firewalls::TestIamPermissions::new(self.inner.clone())
2003 }
2004
2005 /// Updates the specified firewall rule with the data included in the
2006 /// request.
2007 /// Note that all fields will be updated if using PUT, even fields that are not
2008 /// specified. To update individual fields, please use PATCH instead.
2009 pub fn update(&self) -> super::builder::firewalls::Update {
2010 super::builder::firewalls::Update::new(self.inner.clone())
2011 }
2012
2013 /// Retrieves the specified Operations resource.
2014 pub fn get_operation(&self) -> super::builder::firewalls::GetOperation {
2015 super::builder::firewalls::GetOperation::new(self.inner.clone())
2016 }
2017}
2018
2019/// Implements a client for the Google Compute Engine API.
2020///
2021/// # Example
2022/// ```
2023/// # use google_cloud_compute_v1::client::ForwardingRules;
2024/// async fn sample(
2025/// ) -> anyhow::Result<()> {
2026/// let client = ForwardingRules::builder().build().await?;
2027/// // use `client` to make requests to the Google Compute Engine API.
2028/// Ok(())
2029/// }
2030/// ```
2031///
2032/// # Service Description
2033///
2034/// Service for the `forwardingRules` resource.
2035///
2036/// # Configuration
2037///
2038/// To configure `ForwardingRules` use the `with_*` methods in the type returned
2039/// by [builder()][ForwardingRules::builder]. The default configuration should
2040/// work for most applications. Common configuration changes include
2041///
2042/// * [with_endpoint()]: by default this client uses the global default endpoint
2043/// (`https://compute.googleapis.com`). Applications using regional
2044/// endpoints or running in restricted networks (e.g. a network configured
2045/// with [Private Google Access with VPC Service Controls]) may want to
2046/// override this default.
2047/// * [with_credentials()]: by default this client uses
2048/// [Application Default Credentials]. Applications using custom
2049/// authentication may need to override this default.
2050///
2051/// [with_endpoint()]: super::builder::forwarding_rules::ClientBuilder::with_endpoint
2052/// [with_credentials()]: super::builder::forwarding_rules::ClientBuilder::with_credentials
2053/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2054/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2055///
2056/// # Pooling and Cloning
2057///
2058/// `ForwardingRules` holds a connection pool internally, it is advised to
2059/// create one and reuse it. You do not need to wrap `ForwardingRules` in
2060/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2061/// already uses an `Arc` internally.
2062#[cfg(feature = "forwarding-rules")]
2063#[cfg_attr(docsrs, doc(cfg(feature = "forwarding-rules")))]
2064#[derive(Clone, Debug)]
2065pub struct ForwardingRules {
2066 inner: std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>,
2067}
2068
2069#[cfg(feature = "forwarding-rules")]
2070impl ForwardingRules {
2071 /// Returns a builder for [ForwardingRules].
2072 ///
2073 /// ```
2074 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2075 /// # use google_cloud_compute_v1::client::ForwardingRules;
2076 /// let client = ForwardingRules::builder().build().await?;
2077 /// # Ok(()) }
2078 /// ```
2079 pub fn builder() -> super::builder::forwarding_rules::ClientBuilder {
2080 crate::new_client_builder(super::builder::forwarding_rules::client::Factory)
2081 }
2082
2083 /// Creates a new client from the provided stub.
2084 ///
2085 /// The most common case for calling this function is in tests mocking the
2086 /// client's behavior.
2087 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2088 where
2089 T: super::stub::ForwardingRules + 'static,
2090 {
2091 Self { inner: stub.into() }
2092 }
2093
2094 pub(crate) async fn new(
2095 config: gaxi::options::ClientConfig,
2096 ) -> crate::ClientBuilderResult<Self> {
2097 let inner = Self::build_inner(config).await?;
2098 Ok(Self { inner })
2099 }
2100
2101 async fn build_inner(
2102 conf: gaxi::options::ClientConfig,
2103 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ForwardingRules>> {
2104 if gaxi::options::tracing_enabled(&conf) {
2105 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2106 }
2107 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2108 }
2109
2110 async fn build_transport(
2111 conf: gaxi::options::ClientConfig,
2112 ) -> crate::ClientBuilderResult<impl super::stub::ForwardingRules> {
2113 super::transport::ForwardingRules::new(conf).await
2114 }
2115
2116 async fn build_with_tracing(
2117 conf: gaxi::options::ClientConfig,
2118 ) -> crate::ClientBuilderResult<impl super::stub::ForwardingRules> {
2119 Self::build_transport(conf)
2120 .await
2121 .map(super::tracing::ForwardingRules::new)
2122 }
2123
2124 /// Retrieves an aggregated list of forwarding rules.
2125 ///
2126 /// To prevent failure, it is recommended that you set the
2127 /// `returnPartialSuccess` parameter to `true`.
2128 pub fn aggregated_list(&self) -> super::builder::forwarding_rules::AggregatedList {
2129 super::builder::forwarding_rules::AggregatedList::new(self.inner.clone())
2130 }
2131
2132 /// Deletes the specified ForwardingRule resource.
2133 pub fn delete(&self) -> super::builder::forwarding_rules::Delete {
2134 super::builder::forwarding_rules::Delete::new(self.inner.clone())
2135 }
2136
2137 /// Returns the specified ForwardingRule resource.
2138 pub fn get(&self) -> super::builder::forwarding_rules::Get {
2139 super::builder::forwarding_rules::Get::new(self.inner.clone())
2140 }
2141
2142 /// Creates a ForwardingRule resource in the specified project and region using
2143 /// the data included in the request.
2144 pub fn insert(&self) -> super::builder::forwarding_rules::Insert {
2145 super::builder::forwarding_rules::Insert::new(self.inner.clone())
2146 }
2147
2148 /// Retrieves a list of ForwardingRule resources available to the specified
2149 /// project and region.
2150 pub fn list(&self) -> super::builder::forwarding_rules::List {
2151 super::builder::forwarding_rules::List::new(self.inner.clone())
2152 }
2153
2154 /// Updates the specified forwarding rule with the data included in the
2155 /// request. This method supportsPATCH
2156 /// semantics and uses theJSON merge
2157 /// patch format and processing rules. Currently, you can only
2158 /// patch the network_tier field.
2159 pub fn patch(&self) -> super::builder::forwarding_rules::Patch {
2160 super::builder::forwarding_rules::Patch::new(self.inner.clone())
2161 }
2162
2163 /// Sets the labels on the specified resource. To learn more about labels,
2164 /// read the
2165 /// Labeling Resources documentation.
2166 pub fn set_labels(&self) -> super::builder::forwarding_rules::SetLabels {
2167 super::builder::forwarding_rules::SetLabels::new(self.inner.clone())
2168 }
2169
2170 /// Changes target URL for forwarding rule. The new target should be of the
2171 /// same type as the old target.
2172 pub fn set_target(&self) -> super::builder::forwarding_rules::SetTarget {
2173 super::builder::forwarding_rules::SetTarget::new(self.inner.clone())
2174 }
2175
2176 /// Retrieves the specified region-specific Operations resource.
2177 pub fn get_operation(&self) -> super::builder::forwarding_rules::GetOperation {
2178 super::builder::forwarding_rules::GetOperation::new(self.inner.clone())
2179 }
2180}
2181
2182/// Implements a client for the Google Compute Engine API.
2183///
2184/// # Example
2185/// ```
2186/// # use google_cloud_compute_v1::client::FutureReservations;
2187/// async fn sample(
2188/// ) -> anyhow::Result<()> {
2189/// let client = FutureReservations::builder().build().await?;
2190/// // use `client` to make requests to the Google Compute Engine API.
2191/// Ok(())
2192/// }
2193/// ```
2194///
2195/// # Service Description
2196///
2197/// Service for the `futureReservations` resource.
2198///
2199/// # Configuration
2200///
2201/// To configure `FutureReservations` use the `with_*` methods in the type returned
2202/// by [builder()][FutureReservations::builder]. The default configuration should
2203/// work for most applications. Common configuration changes include
2204///
2205/// * [with_endpoint()]: by default this client uses the global default endpoint
2206/// (`https://compute.googleapis.com`). Applications using regional
2207/// endpoints or running in restricted networks (e.g. a network configured
2208/// with [Private Google Access with VPC Service Controls]) may want to
2209/// override this default.
2210/// * [with_credentials()]: by default this client uses
2211/// [Application Default Credentials]. Applications using custom
2212/// authentication may need to override this default.
2213///
2214/// [with_endpoint()]: super::builder::future_reservations::ClientBuilder::with_endpoint
2215/// [with_credentials()]: super::builder::future_reservations::ClientBuilder::with_credentials
2216/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2217/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2218///
2219/// # Pooling and Cloning
2220///
2221/// `FutureReservations` holds a connection pool internally, it is advised to
2222/// create one and reuse it. You do not need to wrap `FutureReservations` in
2223/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2224/// already uses an `Arc` internally.
2225#[cfg(feature = "future-reservations")]
2226#[cfg_attr(docsrs, doc(cfg(feature = "future-reservations")))]
2227#[derive(Clone, Debug)]
2228pub struct FutureReservations {
2229 inner: std::sync::Arc<dyn super::stub::dynamic::FutureReservations>,
2230}
2231
2232#[cfg(feature = "future-reservations")]
2233impl FutureReservations {
2234 /// Returns a builder for [FutureReservations].
2235 ///
2236 /// ```
2237 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2238 /// # use google_cloud_compute_v1::client::FutureReservations;
2239 /// let client = FutureReservations::builder().build().await?;
2240 /// # Ok(()) }
2241 /// ```
2242 pub fn builder() -> super::builder::future_reservations::ClientBuilder {
2243 crate::new_client_builder(super::builder::future_reservations::client::Factory)
2244 }
2245
2246 /// Creates a new client from the provided stub.
2247 ///
2248 /// The most common case for calling this function is in tests mocking the
2249 /// client's behavior.
2250 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2251 where
2252 T: super::stub::FutureReservations + 'static,
2253 {
2254 Self { inner: stub.into() }
2255 }
2256
2257 pub(crate) async fn new(
2258 config: gaxi::options::ClientConfig,
2259 ) -> crate::ClientBuilderResult<Self> {
2260 let inner = Self::build_inner(config).await?;
2261 Ok(Self { inner })
2262 }
2263
2264 async fn build_inner(
2265 conf: gaxi::options::ClientConfig,
2266 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::FutureReservations>>
2267 {
2268 if gaxi::options::tracing_enabled(&conf) {
2269 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2270 }
2271 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2272 }
2273
2274 async fn build_transport(
2275 conf: gaxi::options::ClientConfig,
2276 ) -> crate::ClientBuilderResult<impl super::stub::FutureReservations> {
2277 super::transport::FutureReservations::new(conf).await
2278 }
2279
2280 async fn build_with_tracing(
2281 conf: gaxi::options::ClientConfig,
2282 ) -> crate::ClientBuilderResult<impl super::stub::FutureReservations> {
2283 Self::build_transport(conf)
2284 .await
2285 .map(super::tracing::FutureReservations::new)
2286 }
2287
2288 /// Retrieves an aggregated list of future reservations.
2289 ///
2290 /// To prevent failure, it is recommended that you set the
2291 /// `returnPartialSuccess` parameter to `true`.
2292 pub fn aggregated_list(&self) -> super::builder::future_reservations::AggregatedList {
2293 super::builder::future_reservations::AggregatedList::new(self.inner.clone())
2294 }
2295
2296 /// Cancel the specified future reservation.
2297 pub fn cancel(&self) -> super::builder::future_reservations::Cancel {
2298 super::builder::future_reservations::Cancel::new(self.inner.clone())
2299 }
2300
2301 /// Deletes the specified future reservation.
2302 pub fn delete(&self) -> super::builder::future_reservations::Delete {
2303 super::builder::future_reservations::Delete::new(self.inner.clone())
2304 }
2305
2306 /// Retrieves information about the specified future reservation.
2307 pub fn get(&self) -> super::builder::future_reservations::Get {
2308 super::builder::future_reservations::Get::new(self.inner.clone())
2309 }
2310
2311 /// Creates a new Future Reservation.
2312 pub fn insert(&self) -> super::builder::future_reservations::Insert {
2313 super::builder::future_reservations::Insert::new(self.inner.clone())
2314 }
2315
2316 /// A list of all the future reservations that have been configured for the
2317 /// specified project in specified zone.
2318 pub fn list(&self) -> super::builder::future_reservations::List {
2319 super::builder::future_reservations::List::new(self.inner.clone())
2320 }
2321
2322 /// Updates the specified future reservation.
2323 pub fn update(&self) -> super::builder::future_reservations::Update {
2324 super::builder::future_reservations::Update::new(self.inner.clone())
2325 }
2326
2327 /// Retrieves the specified zone-specific Operations resource.
2328 pub fn get_operation(&self) -> super::builder::future_reservations::GetOperation {
2329 super::builder::future_reservations::GetOperation::new(self.inner.clone())
2330 }
2331}
2332
2333/// Implements a client for the Google Compute Engine API.
2334///
2335/// # Example
2336/// ```
2337/// # use google_cloud_compute_v1::client::GlobalAddresses;
2338/// async fn sample(
2339/// ) -> anyhow::Result<()> {
2340/// let client = GlobalAddresses::builder().build().await?;
2341/// // use `client` to make requests to the Google Compute Engine API.
2342/// Ok(())
2343/// }
2344/// ```
2345///
2346/// # Service Description
2347///
2348/// Service for the `globalAddresses` resource.
2349///
2350/// # Configuration
2351///
2352/// To configure `GlobalAddresses` use the `with_*` methods in the type returned
2353/// by [builder()][GlobalAddresses::builder]. The default configuration should
2354/// work for most applications. Common configuration changes include
2355///
2356/// * [with_endpoint()]: by default this client uses the global default endpoint
2357/// (`https://compute.googleapis.com`). Applications using regional
2358/// endpoints or running in restricted networks (e.g. a network configured
2359/// with [Private Google Access with VPC Service Controls]) may want to
2360/// override this default.
2361/// * [with_credentials()]: by default this client uses
2362/// [Application Default Credentials]. Applications using custom
2363/// authentication may need to override this default.
2364///
2365/// [with_endpoint()]: super::builder::global_addresses::ClientBuilder::with_endpoint
2366/// [with_credentials()]: super::builder::global_addresses::ClientBuilder::with_credentials
2367/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2368/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2369///
2370/// # Pooling and Cloning
2371///
2372/// `GlobalAddresses` holds a connection pool internally, it is advised to
2373/// create one and reuse it. You do not need to wrap `GlobalAddresses` in
2374/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2375/// already uses an `Arc` internally.
2376#[cfg(feature = "global-addresses")]
2377#[cfg_attr(docsrs, doc(cfg(feature = "global-addresses")))]
2378#[derive(Clone, Debug)]
2379pub struct GlobalAddresses {
2380 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>,
2381}
2382
2383#[cfg(feature = "global-addresses")]
2384impl GlobalAddresses {
2385 /// Returns a builder for [GlobalAddresses].
2386 ///
2387 /// ```
2388 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2389 /// # use google_cloud_compute_v1::client::GlobalAddresses;
2390 /// let client = GlobalAddresses::builder().build().await?;
2391 /// # Ok(()) }
2392 /// ```
2393 pub fn builder() -> super::builder::global_addresses::ClientBuilder {
2394 crate::new_client_builder(super::builder::global_addresses::client::Factory)
2395 }
2396
2397 /// Creates a new client from the provided stub.
2398 ///
2399 /// The most common case for calling this function is in tests mocking the
2400 /// client's behavior.
2401 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2402 where
2403 T: super::stub::GlobalAddresses + 'static,
2404 {
2405 Self { inner: stub.into() }
2406 }
2407
2408 pub(crate) async fn new(
2409 config: gaxi::options::ClientConfig,
2410 ) -> crate::ClientBuilderResult<Self> {
2411 let inner = Self::build_inner(config).await?;
2412 Ok(Self { inner })
2413 }
2414
2415 async fn build_inner(
2416 conf: gaxi::options::ClientConfig,
2417 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalAddresses>> {
2418 if gaxi::options::tracing_enabled(&conf) {
2419 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2420 }
2421 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2422 }
2423
2424 async fn build_transport(
2425 conf: gaxi::options::ClientConfig,
2426 ) -> crate::ClientBuilderResult<impl super::stub::GlobalAddresses> {
2427 super::transport::GlobalAddresses::new(conf).await
2428 }
2429
2430 async fn build_with_tracing(
2431 conf: gaxi::options::ClientConfig,
2432 ) -> crate::ClientBuilderResult<impl super::stub::GlobalAddresses> {
2433 Self::build_transport(conf)
2434 .await
2435 .map(super::tracing::GlobalAddresses::new)
2436 }
2437
2438 /// Deletes the specified address resource.
2439 pub fn delete(&self) -> super::builder::global_addresses::Delete {
2440 super::builder::global_addresses::Delete::new(self.inner.clone())
2441 }
2442
2443 /// Returns the specified address resource.
2444 pub fn get(&self) -> super::builder::global_addresses::Get {
2445 super::builder::global_addresses::Get::new(self.inner.clone())
2446 }
2447
2448 /// Creates an address resource in the specified project by using the data
2449 /// included in the request.
2450 pub fn insert(&self) -> super::builder::global_addresses::Insert {
2451 super::builder::global_addresses::Insert::new(self.inner.clone())
2452 }
2453
2454 /// Retrieves a list of global addresses.
2455 pub fn list(&self) -> super::builder::global_addresses::List {
2456 super::builder::global_addresses::List::new(self.inner.clone())
2457 }
2458
2459 /// Moves the specified address resource from one project to another project.
2460 pub fn r#move(&self) -> super::builder::global_addresses::Move {
2461 super::builder::global_addresses::Move::new(self.inner.clone())
2462 }
2463
2464 /// Sets the labels on a GlobalAddress. To learn more about labels, read theLabeling
2465 /// Resources documentation.
2466 pub fn set_labels(&self) -> super::builder::global_addresses::SetLabels {
2467 super::builder::global_addresses::SetLabels::new(self.inner.clone())
2468 }
2469
2470 /// Returns permissions that a caller has on the specified resource.
2471 pub fn test_iam_permissions(&self) -> super::builder::global_addresses::TestIamPermissions {
2472 super::builder::global_addresses::TestIamPermissions::new(self.inner.clone())
2473 }
2474
2475 /// Retrieves the specified Operations resource.
2476 pub fn get_operation(&self) -> super::builder::global_addresses::GetOperation {
2477 super::builder::global_addresses::GetOperation::new(self.inner.clone())
2478 }
2479}
2480
2481/// Implements a client for the Google Compute Engine API.
2482///
2483/// # Example
2484/// ```
2485/// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2486/// async fn sample(
2487/// ) -> anyhow::Result<()> {
2488/// let client = GlobalForwardingRules::builder().build().await?;
2489/// // use `client` to make requests to the Google Compute Engine API.
2490/// Ok(())
2491/// }
2492/// ```
2493///
2494/// # Service Description
2495///
2496/// Service for the `globalForwardingRules` resource.
2497///
2498/// # Configuration
2499///
2500/// To configure `GlobalForwardingRules` use the `with_*` methods in the type returned
2501/// by [builder()][GlobalForwardingRules::builder]. The default configuration should
2502/// work for most applications. Common configuration changes include
2503///
2504/// * [with_endpoint()]: by default this client uses the global default endpoint
2505/// (`https://compute.googleapis.com`). Applications using regional
2506/// endpoints or running in restricted networks (e.g. a network configured
2507/// with [Private Google Access with VPC Service Controls]) may want to
2508/// override this default.
2509/// * [with_credentials()]: by default this client uses
2510/// [Application Default Credentials]. Applications using custom
2511/// authentication may need to override this default.
2512///
2513/// [with_endpoint()]: super::builder::global_forwarding_rules::ClientBuilder::with_endpoint
2514/// [with_credentials()]: super::builder::global_forwarding_rules::ClientBuilder::with_credentials
2515/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2516/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2517///
2518/// # Pooling and Cloning
2519///
2520/// `GlobalForwardingRules` holds a connection pool internally, it is advised to
2521/// create one and reuse it. You do not need to wrap `GlobalForwardingRules` in
2522/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2523/// already uses an `Arc` internally.
2524#[cfg(feature = "global-forwarding-rules")]
2525#[cfg_attr(docsrs, doc(cfg(feature = "global-forwarding-rules")))]
2526#[derive(Clone, Debug)]
2527pub struct GlobalForwardingRules {
2528 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>,
2529}
2530
2531#[cfg(feature = "global-forwarding-rules")]
2532impl GlobalForwardingRules {
2533 /// Returns a builder for [GlobalForwardingRules].
2534 ///
2535 /// ```
2536 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2537 /// # use google_cloud_compute_v1::client::GlobalForwardingRules;
2538 /// let client = GlobalForwardingRules::builder().build().await?;
2539 /// # Ok(()) }
2540 /// ```
2541 pub fn builder() -> super::builder::global_forwarding_rules::ClientBuilder {
2542 crate::new_client_builder(super::builder::global_forwarding_rules::client::Factory)
2543 }
2544
2545 /// Creates a new client from the provided stub.
2546 ///
2547 /// The most common case for calling this function is in tests mocking the
2548 /// client's behavior.
2549 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2550 where
2551 T: super::stub::GlobalForwardingRules + 'static,
2552 {
2553 Self { inner: stub.into() }
2554 }
2555
2556 pub(crate) async fn new(
2557 config: gaxi::options::ClientConfig,
2558 ) -> crate::ClientBuilderResult<Self> {
2559 let inner = Self::build_inner(config).await?;
2560 Ok(Self { inner })
2561 }
2562
2563 async fn build_inner(
2564 conf: gaxi::options::ClientConfig,
2565 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalForwardingRules>>
2566 {
2567 if gaxi::options::tracing_enabled(&conf) {
2568 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2569 }
2570 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2571 }
2572
2573 async fn build_transport(
2574 conf: gaxi::options::ClientConfig,
2575 ) -> crate::ClientBuilderResult<impl super::stub::GlobalForwardingRules> {
2576 super::transport::GlobalForwardingRules::new(conf).await
2577 }
2578
2579 async fn build_with_tracing(
2580 conf: gaxi::options::ClientConfig,
2581 ) -> crate::ClientBuilderResult<impl super::stub::GlobalForwardingRules> {
2582 Self::build_transport(conf)
2583 .await
2584 .map(super::tracing::GlobalForwardingRules::new)
2585 }
2586
2587 /// Deletes the specified GlobalForwardingRule resource.
2588 pub fn delete(&self) -> super::builder::global_forwarding_rules::Delete {
2589 super::builder::global_forwarding_rules::Delete::new(self.inner.clone())
2590 }
2591
2592 /// Returns the specified GlobalForwardingRule resource. Gets a list of
2593 /// available forwarding rules by making a list() request.
2594 pub fn get(&self) -> super::builder::global_forwarding_rules::Get {
2595 super::builder::global_forwarding_rules::Get::new(self.inner.clone())
2596 }
2597
2598 /// Creates a GlobalForwardingRule resource in the specified project using
2599 /// the data included in the request.
2600 pub fn insert(&self) -> super::builder::global_forwarding_rules::Insert {
2601 super::builder::global_forwarding_rules::Insert::new(self.inner.clone())
2602 }
2603
2604 /// Retrieves a list of GlobalForwardingRule resources available to the
2605 /// specified project.
2606 pub fn list(&self) -> super::builder::global_forwarding_rules::List {
2607 super::builder::global_forwarding_rules::List::new(self.inner.clone())
2608 }
2609
2610 /// Updates the specified forwarding rule with the data included in the
2611 /// request. This method supportsPATCH
2612 /// semantics and uses theJSON merge
2613 /// patch format and processing rules. Currently, you can only
2614 /// patch the network_tier field.
2615 pub fn patch(&self) -> super::builder::global_forwarding_rules::Patch {
2616 super::builder::global_forwarding_rules::Patch::new(self.inner.clone())
2617 }
2618
2619 /// Sets the labels on the specified resource. To learn more about labels,
2620 /// read the
2621 /// Labeling resources documentation.
2622 pub fn set_labels(&self) -> super::builder::global_forwarding_rules::SetLabels {
2623 super::builder::global_forwarding_rules::SetLabels::new(self.inner.clone())
2624 }
2625
2626 /// Changes target URL for the GlobalForwardingRule resource. The new target
2627 /// should be of the same type as the old target.
2628 pub fn set_target(&self) -> super::builder::global_forwarding_rules::SetTarget {
2629 super::builder::global_forwarding_rules::SetTarget::new(self.inner.clone())
2630 }
2631
2632 /// Retrieves the specified Operations resource.
2633 pub fn get_operation(&self) -> super::builder::global_forwarding_rules::GetOperation {
2634 super::builder::global_forwarding_rules::GetOperation::new(self.inner.clone())
2635 }
2636}
2637
2638/// Implements a client for the Google Compute Engine API.
2639///
2640/// # Example
2641/// ```
2642/// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2643/// async fn sample(
2644/// ) -> anyhow::Result<()> {
2645/// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2646/// // use `client` to make requests to the Google Compute Engine API.
2647/// Ok(())
2648/// }
2649/// ```
2650///
2651/// # Service Description
2652///
2653/// Service for the `globalNetworkEndpointGroups` resource.
2654///
2655/// # Configuration
2656///
2657/// To configure `GlobalNetworkEndpointGroups` use the `with_*` methods in the type returned
2658/// by [builder()][GlobalNetworkEndpointGroups::builder]. The default configuration should
2659/// work for most applications. Common configuration changes include
2660///
2661/// * [with_endpoint()]: by default this client uses the global default endpoint
2662/// (`https://compute.googleapis.com`). Applications using regional
2663/// endpoints or running in restricted networks (e.g. a network configured
2664/// with [Private Google Access with VPC Service Controls]) may want to
2665/// override this default.
2666/// * [with_credentials()]: by default this client uses
2667/// [Application Default Credentials]. Applications using custom
2668/// authentication may need to override this default.
2669///
2670/// [with_endpoint()]: super::builder::global_network_endpoint_groups::ClientBuilder::with_endpoint
2671/// [with_credentials()]: super::builder::global_network_endpoint_groups::ClientBuilder::with_credentials
2672/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2673/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2674///
2675/// # Pooling and Cloning
2676///
2677/// `GlobalNetworkEndpointGroups` holds a connection pool internally, it is advised to
2678/// create one and reuse it. You do not need to wrap `GlobalNetworkEndpointGroups` in
2679/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2680/// already uses an `Arc` internally.
2681#[cfg(feature = "global-network-endpoint-groups")]
2682#[cfg_attr(docsrs, doc(cfg(feature = "global-network-endpoint-groups")))]
2683#[derive(Clone, Debug)]
2684pub struct GlobalNetworkEndpointGroups {
2685 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2686}
2687
2688#[cfg(feature = "global-network-endpoint-groups")]
2689impl GlobalNetworkEndpointGroups {
2690 /// Returns a builder for [GlobalNetworkEndpointGroups].
2691 ///
2692 /// ```
2693 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2694 /// # use google_cloud_compute_v1::client::GlobalNetworkEndpointGroups;
2695 /// let client = GlobalNetworkEndpointGroups::builder().build().await?;
2696 /// # Ok(()) }
2697 /// ```
2698 pub fn builder() -> super::builder::global_network_endpoint_groups::ClientBuilder {
2699 crate::new_client_builder(super::builder::global_network_endpoint_groups::client::Factory)
2700 }
2701
2702 /// Creates a new client from the provided stub.
2703 ///
2704 /// The most common case for calling this function is in tests mocking the
2705 /// client's behavior.
2706 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2707 where
2708 T: super::stub::GlobalNetworkEndpointGroups + 'static,
2709 {
2710 Self { inner: stub.into() }
2711 }
2712
2713 pub(crate) async fn new(
2714 config: gaxi::options::ClientConfig,
2715 ) -> crate::ClientBuilderResult<Self> {
2716 let inner = Self::build_inner(config).await?;
2717 Ok(Self { inner })
2718 }
2719
2720 async fn build_inner(
2721 conf: gaxi::options::ClientConfig,
2722 ) -> crate::ClientBuilderResult<
2723 std::sync::Arc<dyn super::stub::dynamic::GlobalNetworkEndpointGroups>,
2724 > {
2725 if gaxi::options::tracing_enabled(&conf) {
2726 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2727 }
2728 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2729 }
2730
2731 async fn build_transport(
2732 conf: gaxi::options::ClientConfig,
2733 ) -> crate::ClientBuilderResult<impl super::stub::GlobalNetworkEndpointGroups> {
2734 super::transport::GlobalNetworkEndpointGroups::new(conf).await
2735 }
2736
2737 async fn build_with_tracing(
2738 conf: gaxi::options::ClientConfig,
2739 ) -> crate::ClientBuilderResult<impl super::stub::GlobalNetworkEndpointGroups> {
2740 Self::build_transport(conf)
2741 .await
2742 .map(super::tracing::GlobalNetworkEndpointGroups::new)
2743 }
2744
2745 /// Attach a network endpoint to the specified network endpoint group.
2746 pub fn attach_network_endpoints(
2747 &self,
2748 ) -> super::builder::global_network_endpoint_groups::AttachNetworkEndpoints {
2749 super::builder::global_network_endpoint_groups::AttachNetworkEndpoints::new(
2750 self.inner.clone(),
2751 )
2752 }
2753
2754 /// Deletes the specified network endpoint group.Note that the NEG cannot be
2755 /// deleted if there are backend services referencing it.
2756 pub fn delete(&self) -> super::builder::global_network_endpoint_groups::Delete {
2757 super::builder::global_network_endpoint_groups::Delete::new(self.inner.clone())
2758 }
2759
2760 /// Detach the network endpoint from the specified network endpoint group.
2761 pub fn detach_network_endpoints(
2762 &self,
2763 ) -> super::builder::global_network_endpoint_groups::DetachNetworkEndpoints {
2764 super::builder::global_network_endpoint_groups::DetachNetworkEndpoints::new(
2765 self.inner.clone(),
2766 )
2767 }
2768
2769 /// Returns the specified network endpoint group.
2770 pub fn get(&self) -> super::builder::global_network_endpoint_groups::Get {
2771 super::builder::global_network_endpoint_groups::Get::new(self.inner.clone())
2772 }
2773
2774 /// Creates a network endpoint group in the specified project using the
2775 /// parameters that are included in the request.
2776 ///
2777 /// Note: Use the following APIs to manage network endpoint groups:
2778 ///
2779 /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
2780 /// NEGs): zonal
2781 /// API
2782 /// - To manage NEGs with regional scope (such as regional internet NEGs,
2783 /// serverless NEGs, Private Service Connect NEGs): regional
2784 /// API
2785 /// - To manage NEGs with global scope (such as global internet NEGs):global
2786 /// API
2787 pub fn insert(&self) -> super::builder::global_network_endpoint_groups::Insert {
2788 super::builder::global_network_endpoint_groups::Insert::new(self.inner.clone())
2789 }
2790
2791 /// Retrieves the list of network endpoint groups that are located in the
2792 /// specified project.
2793 pub fn list(&self) -> super::builder::global_network_endpoint_groups::List {
2794 super::builder::global_network_endpoint_groups::List::new(self.inner.clone())
2795 }
2796
2797 /// Lists the network endpoints in the specified network endpoint group.
2798 pub fn list_network_endpoints(
2799 &self,
2800 ) -> super::builder::global_network_endpoint_groups::ListNetworkEndpoints {
2801 super::builder::global_network_endpoint_groups::ListNetworkEndpoints::new(
2802 self.inner.clone(),
2803 )
2804 }
2805
2806 /// Retrieves the specified Operations resource.
2807 pub fn get_operation(&self) -> super::builder::global_network_endpoint_groups::GetOperation {
2808 super::builder::global_network_endpoint_groups::GetOperation::new(self.inner.clone())
2809 }
2810}
2811
2812/// Implements a client for the Google Compute Engine API.
2813///
2814/// # Example
2815/// ```
2816/// # use google_cloud_compute_v1::client::GlobalOperations;
2817/// async fn sample(
2818/// ) -> anyhow::Result<()> {
2819/// let client = GlobalOperations::builder().build().await?;
2820/// // use `client` to make requests to the Google Compute Engine API.
2821/// Ok(())
2822/// }
2823/// ```
2824///
2825/// # Service Description
2826///
2827/// Service for the `globalOperations` resource.
2828///
2829/// # Configuration
2830///
2831/// To configure `GlobalOperations` use the `with_*` methods in the type returned
2832/// by [builder()][GlobalOperations::builder]. The default configuration should
2833/// work for most applications. Common configuration changes include
2834///
2835/// * [with_endpoint()]: by default this client uses the global default endpoint
2836/// (`https://compute.googleapis.com`). Applications using regional
2837/// endpoints or running in restricted networks (e.g. a network configured
2838/// with [Private Google Access with VPC Service Controls]) may want to
2839/// override this default.
2840/// * [with_credentials()]: by default this client uses
2841/// [Application Default Credentials]. Applications using custom
2842/// authentication may need to override this default.
2843///
2844/// [with_endpoint()]: super::builder::global_operations::ClientBuilder::with_endpoint
2845/// [with_credentials()]: super::builder::global_operations::ClientBuilder::with_credentials
2846/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
2847/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
2848///
2849/// # Pooling and Cloning
2850///
2851/// `GlobalOperations` holds a connection pool internally, it is advised to
2852/// create one and reuse it. You do not need to wrap `GlobalOperations` in
2853/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
2854/// already uses an `Arc` internally.
2855#[cfg(feature = "global-operations")]
2856#[cfg_attr(docsrs, doc(cfg(feature = "global-operations")))]
2857#[derive(Clone, Debug)]
2858pub struct GlobalOperations {
2859 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>,
2860}
2861
2862#[cfg(feature = "global-operations")]
2863impl GlobalOperations {
2864 /// Returns a builder for [GlobalOperations].
2865 ///
2866 /// ```
2867 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2868 /// # use google_cloud_compute_v1::client::GlobalOperations;
2869 /// let client = GlobalOperations::builder().build().await?;
2870 /// # Ok(()) }
2871 /// ```
2872 pub fn builder() -> super::builder::global_operations::ClientBuilder {
2873 crate::new_client_builder(super::builder::global_operations::client::Factory)
2874 }
2875
2876 /// Creates a new client from the provided stub.
2877 ///
2878 /// The most common case for calling this function is in tests mocking the
2879 /// client's behavior.
2880 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
2881 where
2882 T: super::stub::GlobalOperations + 'static,
2883 {
2884 Self { inner: stub.into() }
2885 }
2886
2887 pub(crate) async fn new(
2888 config: gaxi::options::ClientConfig,
2889 ) -> crate::ClientBuilderResult<Self> {
2890 let inner = Self::build_inner(config).await?;
2891 Ok(Self { inner })
2892 }
2893
2894 async fn build_inner(
2895 conf: gaxi::options::ClientConfig,
2896 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::GlobalOperations>>
2897 {
2898 if gaxi::options::tracing_enabled(&conf) {
2899 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
2900 }
2901 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
2902 }
2903
2904 async fn build_transport(
2905 conf: gaxi::options::ClientConfig,
2906 ) -> crate::ClientBuilderResult<impl super::stub::GlobalOperations> {
2907 super::transport::GlobalOperations::new(conf).await
2908 }
2909
2910 async fn build_with_tracing(
2911 conf: gaxi::options::ClientConfig,
2912 ) -> crate::ClientBuilderResult<impl super::stub::GlobalOperations> {
2913 Self::build_transport(conf)
2914 .await
2915 .map(super::tracing::GlobalOperations::new)
2916 }
2917
2918 /// Retrieves an aggregated list of all operations.
2919 ///
2920 /// To prevent failure, Google recommends that you set the
2921 /// `returnPartialSuccess` parameter to `true`.
2922 pub fn aggregated_list(&self) -> super::builder::global_operations::AggregatedList {
2923 super::builder::global_operations::AggregatedList::new(self.inner.clone())
2924 }
2925
2926 /// Deletes the specified Operations resource.
2927 pub fn delete(&self) -> super::builder::global_operations::Delete {
2928 super::builder::global_operations::Delete::new(self.inner.clone())
2929 }
2930
2931 /// Retrieves the specified Operations resource.
2932 pub fn get(&self) -> super::builder::global_operations::Get {
2933 super::builder::global_operations::Get::new(self.inner.clone())
2934 }
2935
2936 /// Retrieves a list of Operation resources contained within the specified
2937 /// project.
2938 pub fn list(&self) -> super::builder::global_operations::List {
2939 super::builder::global_operations::List::new(self.inner.clone())
2940 }
2941
2942 /// Waits for the specified Operation resource to return as `DONE`
2943 /// or for the request to approach the 2 minute deadline, and retrieves the
2944 /// specified Operation resource. This method differs from the
2945 /// `GET` method in that it waits for no more than the default
2946 /// deadline (2 minutes) and then returns the current state of the operation,
2947 /// which might be `DONE` or still in progress.
2948 ///
2949 /// This method is called on a best-effort basis. Specifically:
2950 ///
2951 /// ```norust
2952 /// - In uncommon cases, when the server is overloaded, the request might
2953 /// return before the default deadline is reached, or might return after zero
2954 /// seconds.
2955 /// ```
2956 ///
2957 /// - If the default deadline is reached, there is no guarantee that the
2958 /// operation is actually done when the method returns. Be prepared to retry
2959 /// if the operation is not `DONE`.
2960 pub fn wait(&self) -> super::builder::global_operations::Wait {
2961 super::builder::global_operations::Wait::new(self.inner.clone())
2962 }
2963}
2964
2965/// Implements a client for the Google Compute Engine API.
2966///
2967/// # Example
2968/// ```
2969/// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
2970/// async fn sample(
2971/// ) -> anyhow::Result<()> {
2972/// let client = GlobalOrganizationOperations::builder().build().await?;
2973/// // use `client` to make requests to the Google Compute Engine API.
2974/// Ok(())
2975/// }
2976/// ```
2977///
2978/// # Service Description
2979///
2980/// Service for the `globalOrganizationOperations` resource.
2981///
2982/// # Configuration
2983///
2984/// To configure `GlobalOrganizationOperations` use the `with_*` methods in the type returned
2985/// by [builder()][GlobalOrganizationOperations::builder]. The default configuration should
2986/// work for most applications. Common configuration changes include
2987///
2988/// * [with_endpoint()]: by default this client uses the global default endpoint
2989/// (`https://compute.googleapis.com`). Applications using regional
2990/// endpoints or running in restricted networks (e.g. a network configured
2991/// with [Private Google Access with VPC Service Controls]) may want to
2992/// override this default.
2993/// * [with_credentials()]: by default this client uses
2994/// [Application Default Credentials]. Applications using custom
2995/// authentication may need to override this default.
2996///
2997/// [with_endpoint()]: super::builder::global_organization_operations::ClientBuilder::with_endpoint
2998/// [with_credentials()]: super::builder::global_organization_operations::ClientBuilder::with_credentials
2999/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3000/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3001///
3002/// # Pooling and Cloning
3003///
3004/// `GlobalOrganizationOperations` holds a connection pool internally, it is advised to
3005/// create one and reuse it. You do not need to wrap `GlobalOrganizationOperations` in
3006/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3007/// already uses an `Arc` internally.
3008#[cfg(feature = "global-organization-operations")]
3009#[cfg_attr(docsrs, doc(cfg(feature = "global-organization-operations")))]
3010#[derive(Clone, Debug)]
3011pub struct GlobalOrganizationOperations {
3012 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
3013}
3014
3015#[cfg(feature = "global-organization-operations")]
3016impl GlobalOrganizationOperations {
3017 /// Returns a builder for [GlobalOrganizationOperations].
3018 ///
3019 /// ```
3020 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3021 /// # use google_cloud_compute_v1::client::GlobalOrganizationOperations;
3022 /// let client = GlobalOrganizationOperations::builder().build().await?;
3023 /// # Ok(()) }
3024 /// ```
3025 pub fn builder() -> super::builder::global_organization_operations::ClientBuilder {
3026 crate::new_client_builder(super::builder::global_organization_operations::client::Factory)
3027 }
3028
3029 /// Creates a new client from the provided stub.
3030 ///
3031 /// The most common case for calling this function is in tests mocking the
3032 /// client's behavior.
3033 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3034 where
3035 T: super::stub::GlobalOrganizationOperations + 'static,
3036 {
3037 Self { inner: stub.into() }
3038 }
3039
3040 pub(crate) async fn new(
3041 config: gaxi::options::ClientConfig,
3042 ) -> crate::ClientBuilderResult<Self> {
3043 let inner = Self::build_inner(config).await?;
3044 Ok(Self { inner })
3045 }
3046
3047 async fn build_inner(
3048 conf: gaxi::options::ClientConfig,
3049 ) -> crate::ClientBuilderResult<
3050 std::sync::Arc<dyn super::stub::dynamic::GlobalOrganizationOperations>,
3051 > {
3052 if gaxi::options::tracing_enabled(&conf) {
3053 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3054 }
3055 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3056 }
3057
3058 async fn build_transport(
3059 conf: gaxi::options::ClientConfig,
3060 ) -> crate::ClientBuilderResult<impl super::stub::GlobalOrganizationOperations> {
3061 super::transport::GlobalOrganizationOperations::new(conf).await
3062 }
3063
3064 async fn build_with_tracing(
3065 conf: gaxi::options::ClientConfig,
3066 ) -> crate::ClientBuilderResult<impl super::stub::GlobalOrganizationOperations> {
3067 Self::build_transport(conf)
3068 .await
3069 .map(super::tracing::GlobalOrganizationOperations::new)
3070 }
3071
3072 /// Deletes the specified Operations resource.
3073 pub fn delete(&self) -> super::builder::global_organization_operations::Delete {
3074 super::builder::global_organization_operations::Delete::new(self.inner.clone())
3075 }
3076
3077 /// Retrieves the specified Operations resource. Gets a list of operations
3078 /// by making a `list()` request.
3079 pub fn get(&self) -> super::builder::global_organization_operations::Get {
3080 super::builder::global_organization_operations::Get::new(self.inner.clone())
3081 }
3082
3083 /// Retrieves a list of Operation resources contained within the specified
3084 /// organization.
3085 pub fn list(&self) -> super::builder::global_organization_operations::List {
3086 super::builder::global_organization_operations::List::new(self.inner.clone())
3087 }
3088}
3089
3090/// Implements a client for the Google Compute Engine API.
3091///
3092/// # Example
3093/// ```
3094/// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3095/// async fn sample(
3096/// ) -> anyhow::Result<()> {
3097/// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3098/// // use `client` to make requests to the Google Compute Engine API.
3099/// Ok(())
3100/// }
3101/// ```
3102///
3103/// # Service Description
3104///
3105/// Service for the `globalPublicDelegatedPrefixes` resource.
3106///
3107/// # Configuration
3108///
3109/// To configure `GlobalPublicDelegatedPrefixes` use the `with_*` methods in the type returned
3110/// by [builder()][GlobalPublicDelegatedPrefixes::builder]. The default configuration should
3111/// work for most applications. Common configuration changes include
3112///
3113/// * [with_endpoint()]: by default this client uses the global default endpoint
3114/// (`https://compute.googleapis.com`). Applications using regional
3115/// endpoints or running in restricted networks (e.g. a network configured
3116/// with [Private Google Access with VPC Service Controls]) may want to
3117/// override this default.
3118/// * [with_credentials()]: by default this client uses
3119/// [Application Default Credentials]. Applications using custom
3120/// authentication may need to override this default.
3121///
3122/// [with_endpoint()]: super::builder::global_public_delegated_prefixes::ClientBuilder::with_endpoint
3123/// [with_credentials()]: super::builder::global_public_delegated_prefixes::ClientBuilder::with_credentials
3124/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3125/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3126///
3127/// # Pooling and Cloning
3128///
3129/// `GlobalPublicDelegatedPrefixes` holds a connection pool internally, it is advised to
3130/// create one and reuse it. You do not need to wrap `GlobalPublicDelegatedPrefixes` in
3131/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3132/// already uses an `Arc` internally.
3133#[cfg(feature = "global-public-delegated-prefixes")]
3134#[cfg_attr(docsrs, doc(cfg(feature = "global-public-delegated-prefixes")))]
3135#[derive(Clone, Debug)]
3136pub struct GlobalPublicDelegatedPrefixes {
3137 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3138}
3139
3140#[cfg(feature = "global-public-delegated-prefixes")]
3141impl GlobalPublicDelegatedPrefixes {
3142 /// Returns a builder for [GlobalPublicDelegatedPrefixes].
3143 ///
3144 /// ```
3145 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3146 /// # use google_cloud_compute_v1::client::GlobalPublicDelegatedPrefixes;
3147 /// let client = GlobalPublicDelegatedPrefixes::builder().build().await?;
3148 /// # Ok(()) }
3149 /// ```
3150 pub fn builder() -> super::builder::global_public_delegated_prefixes::ClientBuilder {
3151 crate::new_client_builder(super::builder::global_public_delegated_prefixes::client::Factory)
3152 }
3153
3154 /// Creates a new client from the provided stub.
3155 ///
3156 /// The most common case for calling this function is in tests mocking the
3157 /// client's behavior.
3158 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3159 where
3160 T: super::stub::GlobalPublicDelegatedPrefixes + 'static,
3161 {
3162 Self { inner: stub.into() }
3163 }
3164
3165 pub(crate) async fn new(
3166 config: gaxi::options::ClientConfig,
3167 ) -> crate::ClientBuilderResult<Self> {
3168 let inner = Self::build_inner(config).await?;
3169 Ok(Self { inner })
3170 }
3171
3172 async fn build_inner(
3173 conf: gaxi::options::ClientConfig,
3174 ) -> crate::ClientBuilderResult<
3175 std::sync::Arc<dyn super::stub::dynamic::GlobalPublicDelegatedPrefixes>,
3176 > {
3177 if gaxi::options::tracing_enabled(&conf) {
3178 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3179 }
3180 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3181 }
3182
3183 async fn build_transport(
3184 conf: gaxi::options::ClientConfig,
3185 ) -> crate::ClientBuilderResult<impl super::stub::GlobalPublicDelegatedPrefixes> {
3186 super::transport::GlobalPublicDelegatedPrefixes::new(conf).await
3187 }
3188
3189 async fn build_with_tracing(
3190 conf: gaxi::options::ClientConfig,
3191 ) -> crate::ClientBuilderResult<impl super::stub::GlobalPublicDelegatedPrefixes> {
3192 Self::build_transport(conf)
3193 .await
3194 .map(super::tracing::GlobalPublicDelegatedPrefixes::new)
3195 }
3196
3197 /// Deletes the specified global PublicDelegatedPrefix.
3198 pub fn delete(&self) -> super::builder::global_public_delegated_prefixes::Delete {
3199 super::builder::global_public_delegated_prefixes::Delete::new(self.inner.clone())
3200 }
3201
3202 /// Returns the specified global PublicDelegatedPrefix resource.
3203 pub fn get(&self) -> super::builder::global_public_delegated_prefixes::Get {
3204 super::builder::global_public_delegated_prefixes::Get::new(self.inner.clone())
3205 }
3206
3207 /// Creates a global PublicDelegatedPrefix in the specified project using the
3208 /// parameters that are included in the request.
3209 pub fn insert(&self) -> super::builder::global_public_delegated_prefixes::Insert {
3210 super::builder::global_public_delegated_prefixes::Insert::new(self.inner.clone())
3211 }
3212
3213 /// Lists the global PublicDelegatedPrefixes for a project.
3214 pub fn list(&self) -> super::builder::global_public_delegated_prefixes::List {
3215 super::builder::global_public_delegated_prefixes::List::new(self.inner.clone())
3216 }
3217
3218 /// Patches the specified global PublicDelegatedPrefix resource with the data
3219 /// included in the request. This method supportsPATCH
3220 /// semantics and usesJSON merge
3221 /// patch format and processing rules.
3222 pub fn patch(&self) -> super::builder::global_public_delegated_prefixes::Patch {
3223 super::builder::global_public_delegated_prefixes::Patch::new(self.inner.clone())
3224 }
3225
3226 /// Retrieves the specified Operations resource.
3227 pub fn get_operation(&self) -> super::builder::global_public_delegated_prefixes::GetOperation {
3228 super::builder::global_public_delegated_prefixes::GetOperation::new(self.inner.clone())
3229 }
3230}
3231
3232/// Implements a client for the Google Compute Engine API.
3233///
3234/// # Example
3235/// ```
3236/// # use google_cloud_compute_v1::client::GlobalVmExtensionPolicies;
3237/// async fn sample(
3238/// ) -> anyhow::Result<()> {
3239/// let client = GlobalVmExtensionPolicies::builder().build().await?;
3240/// // use `client` to make requests to the Google Compute Engine API.
3241/// Ok(())
3242/// }
3243/// ```
3244///
3245/// # Service Description
3246///
3247/// Service for the `globalVmExtensionPolicies` resource.
3248///
3249/// # Configuration
3250///
3251/// To configure `GlobalVmExtensionPolicies` use the `with_*` methods in the type returned
3252/// by [builder()][GlobalVmExtensionPolicies::builder]. The default configuration should
3253/// work for most applications. Common configuration changes include
3254///
3255/// * [with_endpoint()]: by default this client uses the global default endpoint
3256/// (`https://compute.googleapis.com`). Applications using regional
3257/// endpoints or running in restricted networks (e.g. a network configured
3258/// with [Private Google Access with VPC Service Controls]) may want to
3259/// override this default.
3260/// * [with_credentials()]: by default this client uses
3261/// [Application Default Credentials]. Applications using custom
3262/// authentication may need to override this default.
3263///
3264/// [with_endpoint()]: super::builder::global_vm_extension_policies::ClientBuilder::with_endpoint
3265/// [with_credentials()]: super::builder::global_vm_extension_policies::ClientBuilder::with_credentials
3266/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3267/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3268///
3269/// # Pooling and Cloning
3270///
3271/// `GlobalVmExtensionPolicies` holds a connection pool internally, it is advised to
3272/// create one and reuse it. You do not need to wrap `GlobalVmExtensionPolicies` in
3273/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3274/// already uses an `Arc` internally.
3275#[cfg(feature = "global-vm-extension-policies")]
3276#[cfg_attr(docsrs, doc(cfg(feature = "global-vm-extension-policies")))]
3277#[derive(Clone, Debug)]
3278pub struct GlobalVmExtensionPolicies {
3279 inner: std::sync::Arc<dyn super::stub::dynamic::GlobalVmExtensionPolicies>,
3280}
3281
3282#[cfg(feature = "global-vm-extension-policies")]
3283impl GlobalVmExtensionPolicies {
3284 /// Returns a builder for [GlobalVmExtensionPolicies].
3285 ///
3286 /// ```
3287 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3288 /// # use google_cloud_compute_v1::client::GlobalVmExtensionPolicies;
3289 /// let client = GlobalVmExtensionPolicies::builder().build().await?;
3290 /// # Ok(()) }
3291 /// ```
3292 pub fn builder() -> super::builder::global_vm_extension_policies::ClientBuilder {
3293 crate::new_client_builder(super::builder::global_vm_extension_policies::client::Factory)
3294 }
3295
3296 /// Creates a new client from the provided stub.
3297 ///
3298 /// The most common case for calling this function is in tests mocking the
3299 /// client's behavior.
3300 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3301 where
3302 T: super::stub::GlobalVmExtensionPolicies + 'static,
3303 {
3304 Self { inner: stub.into() }
3305 }
3306
3307 pub(crate) async fn new(
3308 config: gaxi::options::ClientConfig,
3309 ) -> crate::ClientBuilderResult<Self> {
3310 let inner = Self::build_inner(config).await?;
3311 Ok(Self { inner })
3312 }
3313
3314 async fn build_inner(
3315 conf: gaxi::options::ClientConfig,
3316 ) -> crate::ClientBuilderResult<
3317 std::sync::Arc<dyn super::stub::dynamic::GlobalVmExtensionPolicies>,
3318 > {
3319 if gaxi::options::tracing_enabled(&conf) {
3320 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3321 }
3322 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3323 }
3324
3325 async fn build_transport(
3326 conf: gaxi::options::ClientConfig,
3327 ) -> crate::ClientBuilderResult<impl super::stub::GlobalVmExtensionPolicies> {
3328 super::transport::GlobalVmExtensionPolicies::new(conf).await
3329 }
3330
3331 async fn build_with_tracing(
3332 conf: gaxi::options::ClientConfig,
3333 ) -> crate::ClientBuilderResult<impl super::stub::GlobalVmExtensionPolicies> {
3334 Self::build_transport(conf)
3335 .await
3336 .map(super::tracing::GlobalVmExtensionPolicies::new)
3337 }
3338
3339 /// Retrieves the list of all VM Extension Policy resources
3340 /// available to the specified project.
3341 ///
3342 /// To prevent failure, it's recommended that you set the
3343 /// `returnPartialSuccess` parameter to `true`.
3344 pub fn aggregated_list(&self) -> super::builder::global_vm_extension_policies::AggregatedList {
3345 super::builder::global_vm_extension_policies::AggregatedList::new(self.inner.clone())
3346 }
3347
3348 /// Purge scoped resources (zonal policies) from a global VM extension
3349 /// policy, and then delete the global VM extension policy. Purge of the scoped
3350 /// resources is a pre-condition of the global VM extension policy deletion.
3351 /// The deletion of the global VM extension policy happens after the purge
3352 /// rollout is done, so it's not a part of the LRO. It's an automatic process
3353 /// that triggers in the backend.
3354 pub fn delete(&self) -> super::builder::global_vm_extension_policies::Delete {
3355 super::builder::global_vm_extension_policies::Delete::new(self.inner.clone())
3356 }
3357
3358 /// Gets details of a global VM extension policy.
3359 pub fn get(&self) -> super::builder::global_vm_extension_policies::Get {
3360 super::builder::global_vm_extension_policies::Get::new(self.inner.clone())
3361 }
3362
3363 /// Creates a new project level GlobalVmExtensionPolicy.
3364 pub fn insert(&self) -> super::builder::global_vm_extension_policies::Insert {
3365 super::builder::global_vm_extension_policies::Insert::new(self.inner.clone())
3366 }
3367
3368 /// Lists global VM extension policies.
3369 pub fn list(&self) -> super::builder::global_vm_extension_policies::List {
3370 super::builder::global_vm_extension_policies::List::new(self.inner.clone())
3371 }
3372
3373 /// Updates a global VM extension policy.
3374 pub fn update(&self) -> super::builder::global_vm_extension_policies::Update {
3375 super::builder::global_vm_extension_policies::Update::new(self.inner.clone())
3376 }
3377
3378 /// Retrieves the specified Operations resource.
3379 pub fn get_operation(&self) -> super::builder::global_vm_extension_policies::GetOperation {
3380 super::builder::global_vm_extension_policies::GetOperation::new(self.inner.clone())
3381 }
3382}
3383
3384/// Implements a client for the Google Compute Engine API.
3385///
3386/// # Example
3387/// ```
3388/// # use google_cloud_compute_v1::client::HealthChecks;
3389/// async fn sample(
3390/// ) -> anyhow::Result<()> {
3391/// let client = HealthChecks::builder().build().await?;
3392/// // use `client` to make requests to the Google Compute Engine API.
3393/// Ok(())
3394/// }
3395/// ```
3396///
3397/// # Service Description
3398///
3399/// Service for the `healthChecks` resource.
3400///
3401/// # Configuration
3402///
3403/// To configure `HealthChecks` use the `with_*` methods in the type returned
3404/// by [builder()][HealthChecks::builder]. The default configuration should
3405/// work for most applications. Common configuration changes include
3406///
3407/// * [with_endpoint()]: by default this client uses the global default endpoint
3408/// (`https://compute.googleapis.com`). Applications using regional
3409/// endpoints or running in restricted networks (e.g. a network configured
3410/// with [Private Google Access with VPC Service Controls]) may want to
3411/// override this default.
3412/// * [with_credentials()]: by default this client uses
3413/// [Application Default Credentials]. Applications using custom
3414/// authentication may need to override this default.
3415///
3416/// [with_endpoint()]: super::builder::health_checks::ClientBuilder::with_endpoint
3417/// [with_credentials()]: super::builder::health_checks::ClientBuilder::with_credentials
3418/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3419/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3420///
3421/// # Pooling and Cloning
3422///
3423/// `HealthChecks` holds a connection pool internally, it is advised to
3424/// create one and reuse it. You do not need to wrap `HealthChecks` in
3425/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3426/// already uses an `Arc` internally.
3427#[cfg(feature = "health-checks")]
3428#[cfg_attr(docsrs, doc(cfg(feature = "health-checks")))]
3429#[derive(Clone, Debug)]
3430pub struct HealthChecks {
3431 inner: std::sync::Arc<dyn super::stub::dynamic::HealthChecks>,
3432}
3433
3434#[cfg(feature = "health-checks")]
3435impl HealthChecks {
3436 /// Returns a builder for [HealthChecks].
3437 ///
3438 /// ```
3439 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3440 /// # use google_cloud_compute_v1::client::HealthChecks;
3441 /// let client = HealthChecks::builder().build().await?;
3442 /// # Ok(()) }
3443 /// ```
3444 pub fn builder() -> super::builder::health_checks::ClientBuilder {
3445 crate::new_client_builder(super::builder::health_checks::client::Factory)
3446 }
3447
3448 /// Creates a new client from the provided stub.
3449 ///
3450 /// The most common case for calling this function is in tests mocking the
3451 /// client's behavior.
3452 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3453 where
3454 T: super::stub::HealthChecks + 'static,
3455 {
3456 Self { inner: stub.into() }
3457 }
3458
3459 pub(crate) async fn new(
3460 config: gaxi::options::ClientConfig,
3461 ) -> crate::ClientBuilderResult<Self> {
3462 let inner = Self::build_inner(config).await?;
3463 Ok(Self { inner })
3464 }
3465
3466 async fn build_inner(
3467 conf: gaxi::options::ClientConfig,
3468 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HealthChecks>> {
3469 if gaxi::options::tracing_enabled(&conf) {
3470 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3471 }
3472 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3473 }
3474
3475 async fn build_transport(
3476 conf: gaxi::options::ClientConfig,
3477 ) -> crate::ClientBuilderResult<impl super::stub::HealthChecks> {
3478 super::transport::HealthChecks::new(conf).await
3479 }
3480
3481 async fn build_with_tracing(
3482 conf: gaxi::options::ClientConfig,
3483 ) -> crate::ClientBuilderResult<impl super::stub::HealthChecks> {
3484 Self::build_transport(conf)
3485 .await
3486 .map(super::tracing::HealthChecks::new)
3487 }
3488
3489 /// Retrieves the list of all HealthCheck resources, regional and global,
3490 /// available to the specified project.
3491 ///
3492 /// To prevent failure, Google recommends that you set the
3493 /// `returnPartialSuccess` parameter to `true`.
3494 pub fn aggregated_list(&self) -> super::builder::health_checks::AggregatedList {
3495 super::builder::health_checks::AggregatedList::new(self.inner.clone())
3496 }
3497
3498 /// Deletes the specified HealthCheck resource.
3499 pub fn delete(&self) -> super::builder::health_checks::Delete {
3500 super::builder::health_checks::Delete::new(self.inner.clone())
3501 }
3502
3503 /// Returns the specified HealthCheck resource.
3504 pub fn get(&self) -> super::builder::health_checks::Get {
3505 super::builder::health_checks::Get::new(self.inner.clone())
3506 }
3507
3508 /// Creates a HealthCheck resource in the specified project using the data
3509 /// included in the request.
3510 pub fn insert(&self) -> super::builder::health_checks::Insert {
3511 super::builder::health_checks::Insert::new(self.inner.clone())
3512 }
3513
3514 /// Retrieves the list of HealthCheck resources available to the specified
3515 /// project.
3516 pub fn list(&self) -> super::builder::health_checks::List {
3517 super::builder::health_checks::List::new(self.inner.clone())
3518 }
3519
3520 /// Updates a HealthCheck resource in the specified project using the data
3521 /// included in the request. This method supportsPATCH
3522 /// semantics and uses theJSON merge
3523 /// patch format and processing rules.
3524 pub fn patch(&self) -> super::builder::health_checks::Patch {
3525 super::builder::health_checks::Patch::new(self.inner.clone())
3526 }
3527
3528 /// Returns permissions that a caller has on the specified resource.
3529 pub fn test_iam_permissions(&self) -> super::builder::health_checks::TestIamPermissions {
3530 super::builder::health_checks::TestIamPermissions::new(self.inner.clone())
3531 }
3532
3533 /// Updates a HealthCheck resource in the specified project using the data
3534 /// included in the request.
3535 pub fn update(&self) -> super::builder::health_checks::Update {
3536 super::builder::health_checks::Update::new(self.inner.clone())
3537 }
3538
3539 /// Retrieves the specified Operations resource.
3540 pub fn get_operation(&self) -> super::builder::health_checks::GetOperation {
3541 super::builder::health_checks::GetOperation::new(self.inner.clone())
3542 }
3543}
3544
3545/// Implements a client for the Google Compute Engine API.
3546///
3547/// # Example
3548/// ```
3549/// # use google_cloud_compute_v1::client::Hosts;
3550/// async fn sample(
3551/// ) -> anyhow::Result<()> {
3552/// let client = Hosts::builder().build().await?;
3553/// // use `client` to make requests to the Google Compute Engine API.
3554/// Ok(())
3555/// }
3556/// ```
3557///
3558/// # Service Description
3559///
3560/// Service for the `hosts` resource.
3561///
3562/// # Configuration
3563///
3564/// To configure `Hosts` use the `with_*` methods in the type returned
3565/// by [builder()][Hosts::builder]. The default configuration should
3566/// work for most applications. Common configuration changes include
3567///
3568/// * [with_endpoint()]: by default this client uses the global default endpoint
3569/// (`https://compute.googleapis.com`). Applications using regional
3570/// endpoints or running in restricted networks (e.g. a network configured
3571/// with [Private Google Access with VPC Service Controls]) may want to
3572/// override this default.
3573/// * [with_credentials()]: by default this client uses
3574/// [Application Default Credentials]. Applications using custom
3575/// authentication may need to override this default.
3576///
3577/// [with_endpoint()]: super::builder::hosts::ClientBuilder::with_endpoint
3578/// [with_credentials()]: super::builder::hosts::ClientBuilder::with_credentials
3579/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3580/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3581///
3582/// # Pooling and Cloning
3583///
3584/// `Hosts` holds a connection pool internally, it is advised to
3585/// create one and reuse it. You do not need to wrap `Hosts` in
3586/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3587/// already uses an `Arc` internally.
3588#[cfg(feature = "hosts")]
3589#[cfg_attr(docsrs, doc(cfg(feature = "hosts")))]
3590#[derive(Clone, Debug)]
3591pub struct Hosts {
3592 inner: std::sync::Arc<dyn super::stub::dynamic::Hosts>,
3593}
3594
3595#[cfg(feature = "hosts")]
3596impl Hosts {
3597 /// Returns a builder for [Hosts].
3598 ///
3599 /// ```
3600 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3601 /// # use google_cloud_compute_v1::client::Hosts;
3602 /// let client = Hosts::builder().build().await?;
3603 /// # Ok(()) }
3604 /// ```
3605 pub fn builder() -> super::builder::hosts::ClientBuilder {
3606 crate::new_client_builder(super::builder::hosts::client::Factory)
3607 }
3608
3609 /// Creates a new client from the provided stub.
3610 ///
3611 /// The most common case for calling this function is in tests mocking the
3612 /// client's behavior.
3613 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3614 where
3615 T: super::stub::Hosts + 'static,
3616 {
3617 Self { inner: stub.into() }
3618 }
3619
3620 pub(crate) async fn new(
3621 config: gaxi::options::ClientConfig,
3622 ) -> crate::ClientBuilderResult<Self> {
3623 let inner = Self::build_inner(config).await?;
3624 Ok(Self { inner })
3625 }
3626
3627 async fn build_inner(
3628 conf: gaxi::options::ClientConfig,
3629 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Hosts>> {
3630 if gaxi::options::tracing_enabled(&conf) {
3631 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3632 }
3633 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3634 }
3635
3636 async fn build_transport(
3637 conf: gaxi::options::ClientConfig,
3638 ) -> crate::ClientBuilderResult<impl super::stub::Hosts> {
3639 super::transport::Hosts::new(conf).await
3640 }
3641
3642 async fn build_with_tracing(
3643 conf: gaxi::options::ClientConfig,
3644 ) -> crate::ClientBuilderResult<impl super::stub::Hosts> {
3645 Self::build_transport(conf)
3646 .await
3647 .map(super::tracing::Hosts::new)
3648 }
3649
3650 /// Retrieves information about the specified host.
3651 pub fn get(&self) -> super::builder::hosts::Get {
3652 super::builder::hosts::Get::new(self.inner.clone())
3653 }
3654
3655 /// Allows customers to get SBOM versions of a host.
3656 pub fn get_version(&self) -> super::builder::hosts::GetVersion {
3657 super::builder::hosts::GetVersion::new(self.inner.clone())
3658 }
3659
3660 /// Retrieves a list of hosts.
3661 pub fn list(&self) -> super::builder::hosts::List {
3662 super::builder::hosts::List::new(self.inner.clone())
3663 }
3664
3665 /// Retrieves the specified zone-specific Operations resource.
3666 pub fn get_operation(&self) -> super::builder::hosts::GetOperation {
3667 super::builder::hosts::GetOperation::new(self.inner.clone())
3668 }
3669}
3670
3671/// Implements a client for the Google Compute Engine API.
3672///
3673/// # Example
3674/// ```
3675/// # use google_cloud_compute_v1::client::HttpHealthChecks;
3676/// async fn sample(
3677/// ) -> anyhow::Result<()> {
3678/// let client = HttpHealthChecks::builder().build().await?;
3679/// // use `client` to make requests to the Google Compute Engine API.
3680/// Ok(())
3681/// }
3682/// ```
3683///
3684/// # Service Description
3685///
3686/// Service for the `httpHealthChecks` resource.
3687///
3688/// # Configuration
3689///
3690/// To configure `HttpHealthChecks` use the `with_*` methods in the type returned
3691/// by [builder()][HttpHealthChecks::builder]. The default configuration should
3692/// work for most applications. Common configuration changes include
3693///
3694/// * [with_endpoint()]: by default this client uses the global default endpoint
3695/// (`https://compute.googleapis.com`). Applications using regional
3696/// endpoints or running in restricted networks (e.g. a network configured
3697/// with [Private Google Access with VPC Service Controls]) may want to
3698/// override this default.
3699/// * [with_credentials()]: by default this client uses
3700/// [Application Default Credentials]. Applications using custom
3701/// authentication may need to override this default.
3702///
3703/// [with_endpoint()]: super::builder::http_health_checks::ClientBuilder::with_endpoint
3704/// [with_credentials()]: super::builder::http_health_checks::ClientBuilder::with_credentials
3705/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3706/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3707///
3708/// # Pooling and Cloning
3709///
3710/// `HttpHealthChecks` holds a connection pool internally, it is advised to
3711/// create one and reuse it. You do not need to wrap `HttpHealthChecks` in
3712/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3713/// already uses an `Arc` internally.
3714#[cfg(feature = "http-health-checks")]
3715#[cfg_attr(docsrs, doc(cfg(feature = "http-health-checks")))]
3716#[derive(Clone, Debug)]
3717pub struct HttpHealthChecks {
3718 inner: std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>,
3719}
3720
3721#[cfg(feature = "http-health-checks")]
3722impl HttpHealthChecks {
3723 /// Returns a builder for [HttpHealthChecks].
3724 ///
3725 /// ```
3726 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3727 /// # use google_cloud_compute_v1::client::HttpHealthChecks;
3728 /// let client = HttpHealthChecks::builder().build().await?;
3729 /// # Ok(()) }
3730 /// ```
3731 pub fn builder() -> super::builder::http_health_checks::ClientBuilder {
3732 crate::new_client_builder(super::builder::http_health_checks::client::Factory)
3733 }
3734
3735 /// Creates a new client from the provided stub.
3736 ///
3737 /// The most common case for calling this function is in tests mocking the
3738 /// client's behavior.
3739 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3740 where
3741 T: super::stub::HttpHealthChecks + 'static,
3742 {
3743 Self { inner: stub.into() }
3744 }
3745
3746 pub(crate) async fn new(
3747 config: gaxi::options::ClientConfig,
3748 ) -> crate::ClientBuilderResult<Self> {
3749 let inner = Self::build_inner(config).await?;
3750 Ok(Self { inner })
3751 }
3752
3753 async fn build_inner(
3754 conf: gaxi::options::ClientConfig,
3755 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HttpHealthChecks>>
3756 {
3757 if gaxi::options::tracing_enabled(&conf) {
3758 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3759 }
3760 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3761 }
3762
3763 async fn build_transport(
3764 conf: gaxi::options::ClientConfig,
3765 ) -> crate::ClientBuilderResult<impl super::stub::HttpHealthChecks> {
3766 super::transport::HttpHealthChecks::new(conf).await
3767 }
3768
3769 async fn build_with_tracing(
3770 conf: gaxi::options::ClientConfig,
3771 ) -> crate::ClientBuilderResult<impl super::stub::HttpHealthChecks> {
3772 Self::build_transport(conf)
3773 .await
3774 .map(super::tracing::HttpHealthChecks::new)
3775 }
3776
3777 /// Deletes the specified HttpHealthCheck resource.
3778 pub fn delete(&self) -> super::builder::http_health_checks::Delete {
3779 super::builder::http_health_checks::Delete::new(self.inner.clone())
3780 }
3781
3782 /// Returns the specified HttpHealthCheck resource.
3783 pub fn get(&self) -> super::builder::http_health_checks::Get {
3784 super::builder::http_health_checks::Get::new(self.inner.clone())
3785 }
3786
3787 /// Creates a HttpHealthCheck resource in the specified project using the data
3788 /// included in the request.
3789 pub fn insert(&self) -> super::builder::http_health_checks::Insert {
3790 super::builder::http_health_checks::Insert::new(self.inner.clone())
3791 }
3792
3793 /// Retrieves the list of HttpHealthCheck resources available to the specified
3794 /// project.
3795 pub fn list(&self) -> super::builder::http_health_checks::List {
3796 super::builder::http_health_checks::List::new(self.inner.clone())
3797 }
3798
3799 /// Updates a HttpHealthCheck resource in the specified project using the data
3800 /// included in the request. This method supportsPATCH
3801 /// semantics and uses theJSON merge
3802 /// patch format and processing rules.
3803 pub fn patch(&self) -> super::builder::http_health_checks::Patch {
3804 super::builder::http_health_checks::Patch::new(self.inner.clone())
3805 }
3806
3807 /// Returns permissions that a caller has on the specified resource.
3808 pub fn test_iam_permissions(&self) -> super::builder::http_health_checks::TestIamPermissions {
3809 super::builder::http_health_checks::TestIamPermissions::new(self.inner.clone())
3810 }
3811
3812 /// Updates a HttpHealthCheck resource in the specified project using the data
3813 /// included in the request.
3814 pub fn update(&self) -> super::builder::http_health_checks::Update {
3815 super::builder::http_health_checks::Update::new(self.inner.clone())
3816 }
3817
3818 /// Retrieves the specified Operations resource.
3819 pub fn get_operation(&self) -> super::builder::http_health_checks::GetOperation {
3820 super::builder::http_health_checks::GetOperation::new(self.inner.clone())
3821 }
3822}
3823
3824/// Implements a client for the Google Compute Engine API.
3825///
3826/// # Example
3827/// ```
3828/// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3829/// async fn sample(
3830/// ) -> anyhow::Result<()> {
3831/// let client = HttpsHealthChecks::builder().build().await?;
3832/// // use `client` to make requests to the Google Compute Engine API.
3833/// Ok(())
3834/// }
3835/// ```
3836///
3837/// # Service Description
3838///
3839/// Service for the `httpsHealthChecks` resource.
3840///
3841/// # Configuration
3842///
3843/// To configure `HttpsHealthChecks` use the `with_*` methods in the type returned
3844/// by [builder()][HttpsHealthChecks::builder]. The default configuration should
3845/// work for most applications. Common configuration changes include
3846///
3847/// * [with_endpoint()]: by default this client uses the global default endpoint
3848/// (`https://compute.googleapis.com`). Applications using regional
3849/// endpoints or running in restricted networks (e.g. a network configured
3850/// with [Private Google Access with VPC Service Controls]) may want to
3851/// override this default.
3852/// * [with_credentials()]: by default this client uses
3853/// [Application Default Credentials]. Applications using custom
3854/// authentication may need to override this default.
3855///
3856/// [with_endpoint()]: super::builder::https_health_checks::ClientBuilder::with_endpoint
3857/// [with_credentials()]: super::builder::https_health_checks::ClientBuilder::with_credentials
3858/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
3859/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
3860///
3861/// # Pooling and Cloning
3862///
3863/// `HttpsHealthChecks` holds a connection pool internally, it is advised to
3864/// create one and reuse it. You do not need to wrap `HttpsHealthChecks` in
3865/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
3866/// already uses an `Arc` internally.
3867#[cfg(feature = "https-health-checks")]
3868#[cfg_attr(docsrs, doc(cfg(feature = "https-health-checks")))]
3869#[derive(Clone, Debug)]
3870pub struct HttpsHealthChecks {
3871 inner: std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>,
3872}
3873
3874#[cfg(feature = "https-health-checks")]
3875impl HttpsHealthChecks {
3876 /// Returns a builder for [HttpsHealthChecks].
3877 ///
3878 /// ```
3879 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3880 /// # use google_cloud_compute_v1::client::HttpsHealthChecks;
3881 /// let client = HttpsHealthChecks::builder().build().await?;
3882 /// # Ok(()) }
3883 /// ```
3884 pub fn builder() -> super::builder::https_health_checks::ClientBuilder {
3885 crate::new_client_builder(super::builder::https_health_checks::client::Factory)
3886 }
3887
3888 /// Creates a new client from the provided stub.
3889 ///
3890 /// The most common case for calling this function is in tests mocking the
3891 /// client's behavior.
3892 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
3893 where
3894 T: super::stub::HttpsHealthChecks + 'static,
3895 {
3896 Self { inner: stub.into() }
3897 }
3898
3899 pub(crate) async fn new(
3900 config: gaxi::options::ClientConfig,
3901 ) -> crate::ClientBuilderResult<Self> {
3902 let inner = Self::build_inner(config).await?;
3903 Ok(Self { inner })
3904 }
3905
3906 async fn build_inner(
3907 conf: gaxi::options::ClientConfig,
3908 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::HttpsHealthChecks>>
3909 {
3910 if gaxi::options::tracing_enabled(&conf) {
3911 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
3912 }
3913 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
3914 }
3915
3916 async fn build_transport(
3917 conf: gaxi::options::ClientConfig,
3918 ) -> crate::ClientBuilderResult<impl super::stub::HttpsHealthChecks> {
3919 super::transport::HttpsHealthChecks::new(conf).await
3920 }
3921
3922 async fn build_with_tracing(
3923 conf: gaxi::options::ClientConfig,
3924 ) -> crate::ClientBuilderResult<impl super::stub::HttpsHealthChecks> {
3925 Self::build_transport(conf)
3926 .await
3927 .map(super::tracing::HttpsHealthChecks::new)
3928 }
3929
3930 /// Deletes the specified HttpsHealthCheck resource.
3931 pub fn delete(&self) -> super::builder::https_health_checks::Delete {
3932 super::builder::https_health_checks::Delete::new(self.inner.clone())
3933 }
3934
3935 /// Returns the specified HttpsHealthCheck resource.
3936 pub fn get(&self) -> super::builder::https_health_checks::Get {
3937 super::builder::https_health_checks::Get::new(self.inner.clone())
3938 }
3939
3940 /// Creates a HttpsHealthCheck resource in the specified project using the data
3941 /// included in the request.
3942 pub fn insert(&self) -> super::builder::https_health_checks::Insert {
3943 super::builder::https_health_checks::Insert::new(self.inner.clone())
3944 }
3945
3946 /// Retrieves the list of HttpsHealthCheck resources available to the specified
3947 /// project.
3948 pub fn list(&self) -> super::builder::https_health_checks::List {
3949 super::builder::https_health_checks::List::new(self.inner.clone())
3950 }
3951
3952 /// Updates a HttpsHealthCheck resource in the specified project using the data
3953 /// included in the request. This method supportsPATCH
3954 /// semantics and uses theJSON merge
3955 /// patch format and processing rules.
3956 pub fn patch(&self) -> super::builder::https_health_checks::Patch {
3957 super::builder::https_health_checks::Patch::new(self.inner.clone())
3958 }
3959
3960 /// Returns permissions that a caller has on the specified resource.
3961 pub fn test_iam_permissions(&self) -> super::builder::https_health_checks::TestIamPermissions {
3962 super::builder::https_health_checks::TestIamPermissions::new(self.inner.clone())
3963 }
3964
3965 /// Updates a HttpsHealthCheck resource in the specified project using the data
3966 /// included in the request.
3967 pub fn update(&self) -> super::builder::https_health_checks::Update {
3968 super::builder::https_health_checks::Update::new(self.inner.clone())
3969 }
3970
3971 /// Retrieves the specified Operations resource.
3972 pub fn get_operation(&self) -> super::builder::https_health_checks::GetOperation {
3973 super::builder::https_health_checks::GetOperation::new(self.inner.clone())
3974 }
3975}
3976
3977/// Implements a client for the Google Compute Engine API.
3978///
3979/// # Example
3980/// ```
3981/// # use google_cloud_compute_v1::client::ImageFamilyViews;
3982/// async fn sample(
3983/// ) -> anyhow::Result<()> {
3984/// let client = ImageFamilyViews::builder().build().await?;
3985/// // use `client` to make requests to the Google Compute Engine API.
3986/// Ok(())
3987/// }
3988/// ```
3989///
3990/// # Service Description
3991///
3992/// Service for the `imageFamilyViews` resource.
3993///
3994/// # Configuration
3995///
3996/// To configure `ImageFamilyViews` use the `with_*` methods in the type returned
3997/// by [builder()][ImageFamilyViews::builder]. The default configuration should
3998/// work for most applications. Common configuration changes include
3999///
4000/// * [with_endpoint()]: by default this client uses the global default endpoint
4001/// (`https://compute.googleapis.com`). Applications using regional
4002/// endpoints or running in restricted networks (e.g. a network configured
4003/// with [Private Google Access with VPC Service Controls]) may want to
4004/// override this default.
4005/// * [with_credentials()]: by default this client uses
4006/// [Application Default Credentials]. Applications using custom
4007/// authentication may need to override this default.
4008///
4009/// [with_endpoint()]: super::builder::image_family_views::ClientBuilder::with_endpoint
4010/// [with_credentials()]: super::builder::image_family_views::ClientBuilder::with_credentials
4011/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4012/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4013///
4014/// # Pooling and Cloning
4015///
4016/// `ImageFamilyViews` holds a connection pool internally, it is advised to
4017/// create one and reuse it. You do not need to wrap `ImageFamilyViews` in
4018/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4019/// already uses an `Arc` internally.
4020#[cfg(feature = "image-family-views")]
4021#[cfg_attr(docsrs, doc(cfg(feature = "image-family-views")))]
4022#[derive(Clone, Debug)]
4023pub struct ImageFamilyViews {
4024 inner: std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>,
4025}
4026
4027#[cfg(feature = "image-family-views")]
4028impl ImageFamilyViews {
4029 /// Returns a builder for [ImageFamilyViews].
4030 ///
4031 /// ```
4032 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4033 /// # use google_cloud_compute_v1::client::ImageFamilyViews;
4034 /// let client = ImageFamilyViews::builder().build().await?;
4035 /// # Ok(()) }
4036 /// ```
4037 pub fn builder() -> super::builder::image_family_views::ClientBuilder {
4038 crate::new_client_builder(super::builder::image_family_views::client::Factory)
4039 }
4040
4041 /// Creates a new client from the provided stub.
4042 ///
4043 /// The most common case for calling this function is in tests mocking the
4044 /// client's behavior.
4045 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4046 where
4047 T: super::stub::ImageFamilyViews + 'static,
4048 {
4049 Self { inner: stub.into() }
4050 }
4051
4052 pub(crate) async fn new(
4053 config: gaxi::options::ClientConfig,
4054 ) -> crate::ClientBuilderResult<Self> {
4055 let inner = Self::build_inner(config).await?;
4056 Ok(Self { inner })
4057 }
4058
4059 async fn build_inner(
4060 conf: gaxi::options::ClientConfig,
4061 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ImageFamilyViews>>
4062 {
4063 if gaxi::options::tracing_enabled(&conf) {
4064 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4065 }
4066 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4067 }
4068
4069 async fn build_transport(
4070 conf: gaxi::options::ClientConfig,
4071 ) -> crate::ClientBuilderResult<impl super::stub::ImageFamilyViews> {
4072 super::transport::ImageFamilyViews::new(conf).await
4073 }
4074
4075 async fn build_with_tracing(
4076 conf: gaxi::options::ClientConfig,
4077 ) -> crate::ClientBuilderResult<impl super::stub::ImageFamilyViews> {
4078 Self::build_transport(conf)
4079 .await
4080 .map(super::tracing::ImageFamilyViews::new)
4081 }
4082
4083 /// Returns the latest image that is part of an image family, is not
4084 /// deprecated and is rolled out in the specified zone.
4085 pub fn get(&self) -> super::builder::image_family_views::Get {
4086 super::builder::image_family_views::Get::new(self.inner.clone())
4087 }
4088}
4089
4090/// Implements a client for the Google Compute Engine API.
4091///
4092/// # Example
4093/// ```
4094/// # use google_cloud_compute_v1::client::Images;
4095/// async fn sample(
4096/// ) -> anyhow::Result<()> {
4097/// let client = Images::builder().build().await?;
4098/// // use `client` to make requests to the Google Compute Engine API.
4099/// Ok(())
4100/// }
4101/// ```
4102///
4103/// # Service Description
4104///
4105/// Service for the `images` resource.
4106///
4107/// # Configuration
4108///
4109/// To configure `Images` use the `with_*` methods in the type returned
4110/// by [builder()][Images::builder]. The default configuration should
4111/// work for most applications. Common configuration changes include
4112///
4113/// * [with_endpoint()]: by default this client uses the global default endpoint
4114/// (`https://compute.googleapis.com`). Applications using regional
4115/// endpoints or running in restricted networks (e.g. a network configured
4116/// with [Private Google Access with VPC Service Controls]) may want to
4117/// override this default.
4118/// * [with_credentials()]: by default this client uses
4119/// [Application Default Credentials]. Applications using custom
4120/// authentication may need to override this default.
4121///
4122/// [with_endpoint()]: super::builder::images::ClientBuilder::with_endpoint
4123/// [with_credentials()]: super::builder::images::ClientBuilder::with_credentials
4124/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4125/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4126///
4127/// # Pooling and Cloning
4128///
4129/// `Images` holds a connection pool internally, it is advised to
4130/// create one and reuse it. You do not need to wrap `Images` in
4131/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4132/// already uses an `Arc` internally.
4133#[cfg(feature = "images")]
4134#[cfg_attr(docsrs, doc(cfg(feature = "images")))]
4135#[derive(Clone, Debug)]
4136pub struct Images {
4137 inner: std::sync::Arc<dyn super::stub::dynamic::Images>,
4138}
4139
4140#[cfg(feature = "images")]
4141impl Images {
4142 /// Returns a builder for [Images].
4143 ///
4144 /// ```
4145 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4146 /// # use google_cloud_compute_v1::client::Images;
4147 /// let client = Images::builder().build().await?;
4148 /// # Ok(()) }
4149 /// ```
4150 pub fn builder() -> super::builder::images::ClientBuilder {
4151 crate::new_client_builder(super::builder::images::client::Factory)
4152 }
4153
4154 /// Creates a new client from the provided stub.
4155 ///
4156 /// The most common case for calling this function is in tests mocking the
4157 /// client's behavior.
4158 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4159 where
4160 T: super::stub::Images + 'static,
4161 {
4162 Self { inner: stub.into() }
4163 }
4164
4165 pub(crate) async fn new(
4166 config: gaxi::options::ClientConfig,
4167 ) -> crate::ClientBuilderResult<Self> {
4168 let inner = Self::build_inner(config).await?;
4169 Ok(Self { inner })
4170 }
4171
4172 async fn build_inner(
4173 conf: gaxi::options::ClientConfig,
4174 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Images>> {
4175 if gaxi::options::tracing_enabled(&conf) {
4176 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4177 }
4178 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4179 }
4180
4181 async fn build_transport(
4182 conf: gaxi::options::ClientConfig,
4183 ) -> crate::ClientBuilderResult<impl super::stub::Images> {
4184 super::transport::Images::new(conf).await
4185 }
4186
4187 async fn build_with_tracing(
4188 conf: gaxi::options::ClientConfig,
4189 ) -> crate::ClientBuilderResult<impl super::stub::Images> {
4190 Self::build_transport(conf)
4191 .await
4192 .map(super::tracing::Images::new)
4193 }
4194
4195 /// Deletes the specified image.
4196 pub fn delete(&self) -> super::builder::images::Delete {
4197 super::builder::images::Delete::new(self.inner.clone())
4198 }
4199
4200 /// Sets the deprecation status of an image.
4201 ///
4202 /// If an empty request body is given, clears the deprecation status instead.
4203 pub fn deprecate(&self) -> super::builder::images::Deprecate {
4204 super::builder::images::Deprecate::new(self.inner.clone())
4205 }
4206
4207 /// Returns the specified image.
4208 pub fn get(&self) -> super::builder::images::Get {
4209 super::builder::images::Get::new(self.inner.clone())
4210 }
4211
4212 /// Returns the latest image that is part of an image family and is not
4213 /// deprecated. For more information on image families, seePublic
4214 /// image families documentation.
4215 pub fn get_from_family(&self) -> super::builder::images::GetFromFamily {
4216 super::builder::images::GetFromFamily::new(self.inner.clone())
4217 }
4218
4219 /// Gets the access control policy for a resource. May be empty if no such
4220 /// policy or resource exists.
4221 pub fn get_iam_policy(&self) -> super::builder::images::GetIamPolicy {
4222 super::builder::images::GetIamPolicy::new(self.inner.clone())
4223 }
4224
4225 /// Creates an image in the specified project using the data included
4226 /// in the request.
4227 pub fn insert(&self) -> super::builder::images::Insert {
4228 super::builder::images::Insert::new(self.inner.clone())
4229 }
4230
4231 /// Retrieves the list of custom images
4232 /// available to the specified project. Custom images are images you
4233 /// create that belong to your project. This method does not
4234 /// get any images that belong to other projects, including publicly-available
4235 /// images, like Debian 8. If you want to get a list of publicly-available
4236 /// images, use this method to make a request to the respective image project,
4237 /// such as debian-cloud or windows-cloud.
4238 pub fn list(&self) -> super::builder::images::List {
4239 super::builder::images::List::new(self.inner.clone())
4240 }
4241
4242 /// Patches the specified image with the data included in the request.
4243 /// Only the following fields can be modified: family, description,
4244 /// deprecation status.
4245 pub fn patch(&self) -> super::builder::images::Patch {
4246 super::builder::images::Patch::new(self.inner.clone())
4247 }
4248
4249 /// Sets the access control policy on the specified resource.
4250 /// Replaces any existing policy.
4251 pub fn set_iam_policy(&self) -> super::builder::images::SetIamPolicy {
4252 super::builder::images::SetIamPolicy::new(self.inner.clone())
4253 }
4254
4255 /// Sets the labels on an image. To learn more about labels, read theLabeling
4256 /// Resources documentation.
4257 pub fn set_labels(&self) -> super::builder::images::SetLabels {
4258 super::builder::images::SetLabels::new(self.inner.clone())
4259 }
4260
4261 /// Returns permissions that a caller has on the specified resource.
4262 pub fn test_iam_permissions(&self) -> super::builder::images::TestIamPermissions {
4263 super::builder::images::TestIamPermissions::new(self.inner.clone())
4264 }
4265
4266 /// Retrieves the specified Operations resource.
4267 pub fn get_operation(&self) -> super::builder::images::GetOperation {
4268 super::builder::images::GetOperation::new(self.inner.clone())
4269 }
4270}
4271
4272/// Implements a client for the Google Compute Engine API.
4273///
4274/// # Example
4275/// ```
4276/// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
4277/// async fn sample(
4278/// ) -> anyhow::Result<()> {
4279/// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
4280/// // use `client` to make requests to the Google Compute Engine API.
4281/// Ok(())
4282/// }
4283/// ```
4284///
4285/// # Service Description
4286///
4287/// Service for the `instanceGroupManagerResizeRequests` resource.
4288///
4289/// # Configuration
4290///
4291/// To configure `InstanceGroupManagerResizeRequests` use the `with_*` methods in the type returned
4292/// by [builder()][InstanceGroupManagerResizeRequests::builder]. The default configuration should
4293/// work for most applications. Common configuration changes include
4294///
4295/// * [with_endpoint()]: by default this client uses the global default endpoint
4296/// (`https://compute.googleapis.com`). Applications using regional
4297/// endpoints or running in restricted networks (e.g. a network configured
4298/// with [Private Google Access with VPC Service Controls]) may want to
4299/// override this default.
4300/// * [with_credentials()]: by default this client uses
4301/// [Application Default Credentials]. Applications using custom
4302/// authentication may need to override this default.
4303///
4304/// [with_endpoint()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::with_endpoint
4305/// [with_credentials()]: super::builder::instance_group_manager_resize_requests::ClientBuilder::with_credentials
4306/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4307/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4308///
4309/// # Pooling and Cloning
4310///
4311/// `InstanceGroupManagerResizeRequests` holds a connection pool internally, it is advised to
4312/// create one and reuse it. You do not need to wrap `InstanceGroupManagerResizeRequests` in
4313/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4314/// already uses an `Arc` internally.
4315#[cfg(feature = "instance-group-manager-resize-requests")]
4316#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-manager-resize-requests")))]
4317#[derive(Clone, Debug)]
4318pub struct InstanceGroupManagerResizeRequests {
4319 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4320}
4321
4322#[cfg(feature = "instance-group-manager-resize-requests")]
4323impl InstanceGroupManagerResizeRequests {
4324 /// Returns a builder for [InstanceGroupManagerResizeRequests].
4325 ///
4326 /// ```
4327 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4328 /// # use google_cloud_compute_v1::client::InstanceGroupManagerResizeRequests;
4329 /// let client = InstanceGroupManagerResizeRequests::builder().build().await?;
4330 /// # Ok(()) }
4331 /// ```
4332 pub fn builder() -> super::builder::instance_group_manager_resize_requests::ClientBuilder {
4333 crate::new_client_builder(
4334 super::builder::instance_group_manager_resize_requests::client::Factory,
4335 )
4336 }
4337
4338 /// Creates a new client from the provided stub.
4339 ///
4340 /// The most common case for calling this function is in tests mocking the
4341 /// client's behavior.
4342 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4343 where
4344 T: super::stub::InstanceGroupManagerResizeRequests + 'static,
4345 {
4346 Self { inner: stub.into() }
4347 }
4348
4349 pub(crate) async fn new(
4350 config: gaxi::options::ClientConfig,
4351 ) -> crate::ClientBuilderResult<Self> {
4352 let inner = Self::build_inner(config).await?;
4353 Ok(Self { inner })
4354 }
4355
4356 async fn build_inner(
4357 conf: gaxi::options::ClientConfig,
4358 ) -> crate::ClientBuilderResult<
4359 std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagerResizeRequests>,
4360 > {
4361 if gaxi::options::tracing_enabled(&conf) {
4362 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4363 }
4364 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4365 }
4366
4367 async fn build_transport(
4368 conf: gaxi::options::ClientConfig,
4369 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagerResizeRequests> {
4370 super::transport::InstanceGroupManagerResizeRequests::new(conf).await
4371 }
4372
4373 async fn build_with_tracing(
4374 conf: gaxi::options::ClientConfig,
4375 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagerResizeRequests> {
4376 Self::build_transport(conf)
4377 .await
4378 .map(super::tracing::InstanceGroupManagerResizeRequests::new)
4379 }
4380
4381 /// Cancels the specified resize request and removes it from the queue.
4382 /// Cancelled resize request does no longer wait for the resources to be
4383 /// provisioned. Cancel is only possible for requests that are accepted in the
4384 /// queue.
4385 pub fn cancel(&self) -> super::builder::instance_group_manager_resize_requests::Cancel {
4386 super::builder::instance_group_manager_resize_requests::Cancel::new(self.inner.clone())
4387 }
4388
4389 /// Deletes the specified, inactive resize request. Requests that are still
4390 /// active cannot be deleted. Deleting request does not delete instances that
4391 /// were provisioned previously.
4392 pub fn delete(&self) -> super::builder::instance_group_manager_resize_requests::Delete {
4393 super::builder::instance_group_manager_resize_requests::Delete::new(self.inner.clone())
4394 }
4395
4396 /// Returns all of the details about the specified resize request.
4397 pub fn get(&self) -> super::builder::instance_group_manager_resize_requests::Get {
4398 super::builder::instance_group_manager_resize_requests::Get::new(self.inner.clone())
4399 }
4400
4401 /// Creates a new resize request that starts provisioning VMs immediately
4402 /// or queues VM creation.
4403 pub fn insert(&self) -> super::builder::instance_group_manager_resize_requests::Insert {
4404 super::builder::instance_group_manager_resize_requests::Insert::new(self.inner.clone())
4405 }
4406
4407 /// Retrieves a list of resize requests that are contained in the
4408 /// managed instance group.
4409 pub fn list(&self) -> super::builder::instance_group_manager_resize_requests::List {
4410 super::builder::instance_group_manager_resize_requests::List::new(self.inner.clone())
4411 }
4412
4413 /// Retrieves the specified zone-specific Operations resource.
4414 pub fn get_operation(
4415 &self,
4416 ) -> super::builder::instance_group_manager_resize_requests::GetOperation {
4417 super::builder::instance_group_manager_resize_requests::GetOperation::new(
4418 self.inner.clone(),
4419 )
4420 }
4421}
4422
4423/// Implements a client for the Google Compute Engine API.
4424///
4425/// # Example
4426/// ```
4427/// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4428/// async fn sample(
4429/// ) -> anyhow::Result<()> {
4430/// let client = InstanceGroupManagers::builder().build().await?;
4431/// // use `client` to make requests to the Google Compute Engine API.
4432/// Ok(())
4433/// }
4434/// ```
4435///
4436/// # Service Description
4437///
4438/// Service for the `instanceGroupManagers` resource.
4439///
4440/// # Configuration
4441///
4442/// To configure `InstanceGroupManagers` use the `with_*` methods in the type returned
4443/// by [builder()][InstanceGroupManagers::builder]. The default configuration should
4444/// work for most applications. Common configuration changes include
4445///
4446/// * [with_endpoint()]: by default this client uses the global default endpoint
4447/// (`https://compute.googleapis.com`). Applications using regional
4448/// endpoints or running in restricted networks (e.g. a network configured
4449/// with [Private Google Access with VPC Service Controls]) may want to
4450/// override this default.
4451/// * [with_credentials()]: by default this client uses
4452/// [Application Default Credentials]. Applications using custom
4453/// authentication may need to override this default.
4454///
4455/// [with_endpoint()]: super::builder::instance_group_managers::ClientBuilder::with_endpoint
4456/// [with_credentials()]: super::builder::instance_group_managers::ClientBuilder::with_credentials
4457/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4458/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4459///
4460/// # Pooling and Cloning
4461///
4462/// `InstanceGroupManagers` holds a connection pool internally, it is advised to
4463/// create one and reuse it. You do not need to wrap `InstanceGroupManagers` in
4464/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4465/// already uses an `Arc` internally.
4466#[cfg(feature = "instance-group-managers")]
4467#[cfg_attr(docsrs, doc(cfg(feature = "instance-group-managers")))]
4468#[derive(Clone, Debug)]
4469pub struct InstanceGroupManagers {
4470 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>,
4471}
4472
4473#[cfg(feature = "instance-group-managers")]
4474impl InstanceGroupManagers {
4475 /// Returns a builder for [InstanceGroupManagers].
4476 ///
4477 /// ```
4478 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4479 /// # use google_cloud_compute_v1::client::InstanceGroupManagers;
4480 /// let client = InstanceGroupManagers::builder().build().await?;
4481 /// # Ok(()) }
4482 /// ```
4483 pub fn builder() -> super::builder::instance_group_managers::ClientBuilder {
4484 crate::new_client_builder(super::builder::instance_group_managers::client::Factory)
4485 }
4486
4487 /// Creates a new client from the provided stub.
4488 ///
4489 /// The most common case for calling this function is in tests mocking the
4490 /// client's behavior.
4491 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4492 where
4493 T: super::stub::InstanceGroupManagers + 'static,
4494 {
4495 Self { inner: stub.into() }
4496 }
4497
4498 pub(crate) async fn new(
4499 config: gaxi::options::ClientConfig,
4500 ) -> crate::ClientBuilderResult<Self> {
4501 let inner = Self::build_inner(config).await?;
4502 Ok(Self { inner })
4503 }
4504
4505 async fn build_inner(
4506 conf: gaxi::options::ClientConfig,
4507 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceGroupManagers>>
4508 {
4509 if gaxi::options::tracing_enabled(&conf) {
4510 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4511 }
4512 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4513 }
4514
4515 async fn build_transport(
4516 conf: gaxi::options::ClientConfig,
4517 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagers> {
4518 super::transport::InstanceGroupManagers::new(conf).await
4519 }
4520
4521 async fn build_with_tracing(
4522 conf: gaxi::options::ClientConfig,
4523 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroupManagers> {
4524 Self::build_transport(conf)
4525 .await
4526 .map(super::tracing::InstanceGroupManagers::new)
4527 }
4528
4529 /// Flags the specified instances to be removed from the
4530 /// managed instance group. Abandoning an instance does not delete the
4531 /// instance, but it does remove the instance from any target pools that are
4532 /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
4533 /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
4534 /// not yet been removed from the group. You must separately verify the
4535 /// status of the abandoning action with thelistmanagedinstances
4536 /// method.
4537 ///
4538 /// If the group is part of a backend
4539 /// service that has enabled
4540 /// connection draining, it can take up to 60 seconds after the connection
4541 /// draining duration has elapsed before the VM instance is removed or deleted.
4542 ///
4543 /// You can specify a maximum of 1000 instances with this method per request.
4544 pub fn abandon_instances(&self) -> super::builder::instance_group_managers::AbandonInstances {
4545 super::builder::instance_group_managers::AbandonInstances::new(self.inner.clone())
4546 }
4547
4548 /// Retrieves the list of managed instance groups and groups them by zone.
4549 ///
4550 /// To prevent failure, Google recommends that you set the
4551 /// `returnPartialSuccess` parameter to `true`.
4552 pub fn aggregated_list(&self) -> super::builder::instance_group_managers::AggregatedList {
4553 super::builder::instance_group_managers::AggregatedList::new(self.inner.clone())
4554 }
4555
4556 /// Applies changes to selected instances on the managed instance group.
4557 /// This method can be used to apply new overrides and/or new versions.
4558 pub fn apply_updates_to_instances(
4559 &self,
4560 ) -> super::builder::instance_group_managers::ApplyUpdatesToInstances {
4561 super::builder::instance_group_managers::ApplyUpdatesToInstances::new(self.inner.clone())
4562 }
4563
4564 /// Creates instances with per-instance configurations in this managed instance
4565 /// group. Instances are created using the current instance template. Thecreate instances operation is marked DONE if thecreateInstances request is successful. The underlying actions
4566 /// take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
4567 /// method.
4568 pub fn create_instances(&self) -> super::builder::instance_group_managers::CreateInstances {
4569 super::builder::instance_group_managers::CreateInstances::new(self.inner.clone())
4570 }
4571
4572 /// Deletes the specified managed instance group and all of the instances
4573 /// in that group. Note that the instance group must not belong to a
4574 /// backend service. Read
4575 /// Deleting an instance group for more information.
4576 pub fn delete(&self) -> super::builder::instance_group_managers::Delete {
4577 super::builder::instance_group_managers::Delete::new(self.inner.clone())
4578 }
4579
4580 /// Flags the specified instances in the managed instance group for immediate
4581 /// deletion. The instances are also removed from any target
4582 /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
4583 /// instances that you delete. This operation is marked as DONE
4584 /// when the action is scheduled even if the instances are still being deleted.
4585 /// You must separately verify the status of the deleting action
4586 /// with thelistmanagedinstances
4587 /// method.
4588 ///
4589 /// If the group is part of a backend
4590 /// service that has enabled
4591 /// connection draining, it can take up to 60 seconds after the connection
4592 /// draining duration has elapsed before the VM instance is removed or deleted.
4593 ///
4594 /// You can specify a maximum of 1000 instances with this method per request.
4595 pub fn delete_instances(&self) -> super::builder::instance_group_managers::DeleteInstances {
4596 super::builder::instance_group_managers::DeleteInstances::new(self.inner.clone())
4597 }
4598
4599 /// Deletes selected per-instance configurations for the managed instance
4600 /// group.
4601 pub fn delete_per_instance_configs(
4602 &self,
4603 ) -> super::builder::instance_group_managers::DeletePerInstanceConfigs {
4604 super::builder::instance_group_managers::DeletePerInstanceConfigs::new(self.inner.clone())
4605 }
4606
4607 /// Returns all of the details about the specified managed instance group.
4608 pub fn get(&self) -> super::builder::instance_group_managers::Get {
4609 super::builder::instance_group_managers::Get::new(self.inner.clone())
4610 }
4611
4612 /// Creates a managed instance group using the information that you specify
4613 /// in the request. After the group is created, instances in the group are
4614 /// created using the specified instance template.
4615 /// This operation is marked as DONE when the group is created
4616 /// even if the instances in the group have not yet been created. You
4617 /// must separately verify the status of the individual instances with thelistmanagedinstances
4618 /// method.
4619 ///
4620 /// A managed instance group can have up to 1000 VM instances per group. Please
4621 /// contact Cloud Support if you need an increase in
4622 /// this limit.
4623 pub fn insert(&self) -> super::builder::instance_group_managers::Insert {
4624 super::builder::instance_group_managers::Insert::new(self.inner.clone())
4625 }
4626
4627 /// Retrieves a list of managed instance groups that are contained within the
4628 /// specified project and zone.
4629 pub fn list(&self) -> super::builder::instance_group_managers::List {
4630 super::builder::instance_group_managers::List::new(self.inner.clone())
4631 }
4632
4633 /// Lists all errors thrown by actions on instances for a given managed
4634 /// instance group. The filter and orderBy query
4635 /// parameters are not supported.
4636 pub fn list_errors(&self) -> super::builder::instance_group_managers::ListErrors {
4637 super::builder::instance_group_managers::ListErrors::new(self.inner.clone())
4638 }
4639
4640 /// Lists all of the instances in the managed instance group. Each instance
4641 /// in the list has a currentAction, which indicates the action
4642 /// that the managed instance group is performing on the instance. For example,
4643 /// if the group is still creating an instance, the currentAction
4644 /// is CREATING. If a previous action failed, the
4645 /// list displays the errors for that failed action. The orderBy
4646 /// query parameter is not supported. The `pageToken` query parameter is
4647 /// supported only if the group's `listManagedInstancesResults` field is set
4648 /// to `PAGINATED`.
4649 pub fn list_managed_instances(
4650 &self,
4651 ) -> super::builder::instance_group_managers::ListManagedInstances {
4652 super::builder::instance_group_managers::ListManagedInstances::new(self.inner.clone())
4653 }
4654
4655 /// Lists all of the per-instance configurations defined for the managed
4656 /// instance group. The orderBy query parameter is not supported.
4657 pub fn list_per_instance_configs(
4658 &self,
4659 ) -> super::builder::instance_group_managers::ListPerInstanceConfigs {
4660 super::builder::instance_group_managers::ListPerInstanceConfigs::new(self.inner.clone())
4661 }
4662
4663 /// Updates a managed instance group using the information that you specify
4664 /// in the request.
4665 /// This operation is marked as DONE when the group is patched
4666 /// even if the instances in the group are still in the process of being
4667 /// patched. You must separately verify the status of the individual instances
4668 /// with thelistManagedInstances
4669 /// method. This method supportsPATCH
4670 /// semantics and uses theJSON merge
4671 /// patch format and processing rules.
4672 ///
4673 /// If you update your group to specify a new template or instance
4674 /// configuration, it's possible that your intended specification for each VM
4675 /// in the group is different from the current state of that VM. To learn how
4676 /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
4677 /// a MIG.
4678 pub fn patch(&self) -> super::builder::instance_group_managers::Patch {
4679 super::builder::instance_group_managers::Patch::new(self.inner.clone())
4680 }
4681
4682 /// Inserts or patches per-instance configurations for the managed instance
4683 /// group. perInstanceConfig.name serves as a key used to
4684 /// distinguish whether to perform insert or patch.
4685 pub fn patch_per_instance_configs(
4686 &self,
4687 ) -> super::builder::instance_group_managers::PatchPerInstanceConfigs {
4688 super::builder::instance_group_managers::PatchPerInstanceConfigs::new(self.inner.clone())
4689 }
4690
4691 /// Flags the specified VM instances in the managed instance group to be
4692 /// immediately recreated. Each instance is recreated using the group's current
4693 /// configuration. This operation is marked as DONE when the flag
4694 /// is set even if the instances have not yet been recreated. You must
4695 /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
4696 /// the status of managed instances.
4697 ///
4698 /// If the group is part of a backend
4699 /// service that has enabled
4700 /// connection draining, it can take up to 60 seconds after the connection
4701 /// draining duration has elapsed before the VM instance is removed or deleted.
4702 ///
4703 /// You can specify a maximum of 1000 instances with this method per request.
4704 pub fn recreate_instances(&self) -> super::builder::instance_group_managers::RecreateInstances {
4705 super::builder::instance_group_managers::RecreateInstances::new(self.inner.clone())
4706 }
4707
4708 /// Resizes the managed instance group. If you increase the size, the group
4709 /// creates new instances using the current instance template. If you decrease
4710 /// the size, the group deletes instances. The resize operation is markedDONE when the resize actions are scheduled even if the group
4711 /// has not yet added or deleted any instances. You must separately
4712 /// verify the status of the creating or deleting
4713 /// actions with thelistmanagedinstances
4714 /// method.
4715 ///
4716 /// When resizing down, the instance group arbitrarily chooses the order in
4717 /// which VMs are deleted. The group takes into account some VM attributes when
4718 /// making the selection including:
4719 ///
4720 /// + The status of the VM instance.
4721 /// + The health of the VM instance.
4722 /// + The instance template version the VM is based on.
4723 /// + For regional managed instance groups, the location of the VM instance.
4724 ///
4725 /// This list is subject to change.
4726 ///
4727 /// If the group is part of a backend
4728 /// service that has enabled
4729 /// connection draining, it can take up to 60 seconds after the connection
4730 /// draining duration has elapsed before the VM instance is removed or deleted.
4731 pub fn resize(&self) -> super::builder::instance_group_managers::Resize {
4732 super::builder::instance_group_managers::Resize::new(self.inner.clone())
4733 }
4734
4735 /// Flags the specified instances in the managed instance group to be
4736 /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
4737 /// of the managed instance group by the number of instances that you resume.
4738 /// The resumeInstances operation is marked DONE if
4739 /// the resumeInstances request is successful. The underlying
4740 /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
4741 /// method.
4742 ///
4743 /// In this request, you can only specify instances that are suspended. For
4744 /// example, if an instance was previously suspended using the suspendInstances
4745 /// method, it can be resumed using the resumeInstances method.
4746 ///
4747 /// If a health check is attached to the managed instance group, the specified
4748 /// instances will be verified as healthy after they are resumed.
4749 ///
4750 /// You can specify a maximum of 1000 instances with this method per request.
4751 pub fn resume_instances(&self) -> super::builder::instance_group_managers::ResumeInstances {
4752 super::builder::instance_group_managers::ResumeInstances::new(self.inner.clone())
4753 }
4754
4755 /// Specifies the instance template to use when creating new instances in this
4756 /// group. The templates for existing instances in the group do not change
4757 /// unless you run recreateInstances, runapplyUpdatesToInstances, or set the group'supdatePolicy.type to PROACTIVE.
4758 pub fn set_instance_template(
4759 &self,
4760 ) -> super::builder::instance_group_managers::SetInstanceTemplate {
4761 super::builder::instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
4762 }
4763
4764 /// Modifies the target pools to which all instances in this managed instance
4765 /// group are assigned. The target pools automatically apply to all of the
4766 /// instances in the managed instance group. This operation is markedDONE when you make the request even if the instances have not
4767 /// yet been added to their target pools. The change might take some time to
4768 /// apply to all of the instances in the group depending on the size of the
4769 /// group.
4770 pub fn set_target_pools(&self) -> super::builder::instance_group_managers::SetTargetPools {
4771 super::builder::instance_group_managers::SetTargetPools::new(self.inner.clone())
4772 }
4773
4774 /// Flags the specified instances in the managed instance group to be
4775 /// started. This method increases thetargetSize and decreases the targetStoppedSize
4776 /// of the managed instance group by the number of instances that you start.
4777 /// The startInstances operation is marked DONE if
4778 /// the startInstances request is successful. The underlying
4779 /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
4780 /// method.
4781 ///
4782 /// In this request, you can only specify instances that are stopped. For
4783 /// example, if an instance was previously stopped using the stopInstances
4784 /// method, it can be started using the startInstances method.
4785 ///
4786 /// If a health check is attached to the managed instance group, the specified
4787 /// instances will be verified as healthy after they are started.
4788 ///
4789 /// You can specify a maximum of 1000 instances with this method per request.
4790 pub fn start_instances(&self) -> super::builder::instance_group_managers::StartInstances {
4791 super::builder::instance_group_managers::StartInstances::new(self.inner.clone())
4792 }
4793
4794 /// Flags the specified instances in the managed instance group to be
4795 /// immediately stopped. You can only specify instances that are running in
4796 /// this request. This method reduces thetargetSize and increases the targetStoppedSize
4797 /// of the managed instance group by the number of instances that you stop.
4798 /// The stopInstances operation is marked DONE if
4799 /// the stopInstances request is successful. The underlying
4800 /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
4801 /// method.
4802 ///
4803 /// If the standbyPolicy.initialDelaySec field is set, the group
4804 /// delays stopping the instances until initialDelaySec have
4805 /// passed from instance.creationTimestamp (that is, when the
4806 /// instance was created). This delay gives your application time to
4807 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4808 /// will be zero delay.
4809 ///
4810 /// If the group is part of a backend
4811 /// service that has enabled
4812 /// connection draining, it can take up to 60 seconds after the connection
4813 /// draining duration has elapsed before the VM instance is stopped.
4814 ///
4815 /// Stopped instances can be started using the startInstances
4816 /// method.
4817 ///
4818 /// You can specify a maximum of 1000 instances with this method per request.
4819 pub fn stop_instances(&self) -> super::builder::instance_group_managers::StopInstances {
4820 super::builder::instance_group_managers::StopInstances::new(self.inner.clone())
4821 }
4822
4823 /// Flags the specified instances in the managed instance group to be
4824 /// immediately suspended. You can only specify instances that are running in
4825 /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
4826 /// of the managed instance group by the number of instances that you suspend.
4827 /// The suspendInstances operation is marked DONE if
4828 /// the suspendInstances request is successful. The underlying
4829 /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
4830 /// method.
4831 ///
4832 /// If the standbyPolicy.initialDelaySec field is set, the group
4833 /// delays suspension of the instances until initialDelaySec have
4834 /// passed from instance.creationTimestamp (that is, when the
4835 /// instance was created). This delay gives your application time to
4836 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
4837 /// will be zero delay.
4838 ///
4839 /// If the group is part of a backend
4840 /// service that has enabled
4841 /// connection draining, it can take up to 60 seconds after the connection
4842 /// draining duration has elapsed before the VM instance is suspended.
4843 ///
4844 /// Suspended instances can be resumed using the resumeInstances
4845 /// method.
4846 ///
4847 /// You can specify a maximum of 1000 instances with this method per request.
4848 pub fn suspend_instances(&self) -> super::builder::instance_group_managers::SuspendInstances {
4849 super::builder::instance_group_managers::SuspendInstances::new(self.inner.clone())
4850 }
4851
4852 /// Inserts or updates per-instance configurations for the managed instance
4853 /// group. perInstanceConfig.name serves as a key used to
4854 /// distinguish whether to perform insert or patch.
4855 pub fn update_per_instance_configs(
4856 &self,
4857 ) -> super::builder::instance_group_managers::UpdatePerInstanceConfigs {
4858 super::builder::instance_group_managers::UpdatePerInstanceConfigs::new(self.inner.clone())
4859 }
4860
4861 /// Retrieves the specified zone-specific Operations resource.
4862 pub fn get_operation(&self) -> super::builder::instance_group_managers::GetOperation {
4863 super::builder::instance_group_managers::GetOperation::new(self.inner.clone())
4864 }
4865}
4866
4867/// Implements a client for the Google Compute Engine API.
4868///
4869/// # Example
4870/// ```
4871/// # use google_cloud_compute_v1::client::InstanceGroups;
4872/// async fn sample(
4873/// ) -> anyhow::Result<()> {
4874/// let client = InstanceGroups::builder().build().await?;
4875/// // use `client` to make requests to the Google Compute Engine API.
4876/// Ok(())
4877/// }
4878/// ```
4879///
4880/// # Service Description
4881///
4882/// Service for the `instanceGroups` resource.
4883///
4884/// # Configuration
4885///
4886/// To configure `InstanceGroups` use the `with_*` methods in the type returned
4887/// by [builder()][InstanceGroups::builder]. The default configuration should
4888/// work for most applications. Common configuration changes include
4889///
4890/// * [with_endpoint()]: by default this client uses the global default endpoint
4891/// (`https://compute.googleapis.com`). Applications using regional
4892/// endpoints or running in restricted networks (e.g. a network configured
4893/// with [Private Google Access with VPC Service Controls]) may want to
4894/// override this default.
4895/// * [with_credentials()]: by default this client uses
4896/// [Application Default Credentials]. Applications using custom
4897/// authentication may need to override this default.
4898///
4899/// [with_endpoint()]: super::builder::instance_groups::ClientBuilder::with_endpoint
4900/// [with_credentials()]: super::builder::instance_groups::ClientBuilder::with_credentials
4901/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
4902/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
4903///
4904/// # Pooling and Cloning
4905///
4906/// `InstanceGroups` holds a connection pool internally, it is advised to
4907/// create one and reuse it. You do not need to wrap `InstanceGroups` in
4908/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
4909/// already uses an `Arc` internally.
4910#[cfg(feature = "instance-groups")]
4911#[cfg_attr(docsrs, doc(cfg(feature = "instance-groups")))]
4912#[derive(Clone, Debug)]
4913pub struct InstanceGroups {
4914 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>,
4915}
4916
4917#[cfg(feature = "instance-groups")]
4918impl InstanceGroups {
4919 /// Returns a builder for [InstanceGroups].
4920 ///
4921 /// ```
4922 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4923 /// # use google_cloud_compute_v1::client::InstanceGroups;
4924 /// let client = InstanceGroups::builder().build().await?;
4925 /// # Ok(()) }
4926 /// ```
4927 pub fn builder() -> super::builder::instance_groups::ClientBuilder {
4928 crate::new_client_builder(super::builder::instance_groups::client::Factory)
4929 }
4930
4931 /// Creates a new client from the provided stub.
4932 ///
4933 /// The most common case for calling this function is in tests mocking the
4934 /// client's behavior.
4935 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
4936 where
4937 T: super::stub::InstanceGroups + 'static,
4938 {
4939 Self { inner: stub.into() }
4940 }
4941
4942 pub(crate) async fn new(
4943 config: gaxi::options::ClientConfig,
4944 ) -> crate::ClientBuilderResult<Self> {
4945 let inner = Self::build_inner(config).await?;
4946 Ok(Self { inner })
4947 }
4948
4949 async fn build_inner(
4950 conf: gaxi::options::ClientConfig,
4951 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceGroups>> {
4952 if gaxi::options::tracing_enabled(&conf) {
4953 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
4954 }
4955 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
4956 }
4957
4958 async fn build_transport(
4959 conf: gaxi::options::ClientConfig,
4960 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroups> {
4961 super::transport::InstanceGroups::new(conf).await
4962 }
4963
4964 async fn build_with_tracing(
4965 conf: gaxi::options::ClientConfig,
4966 ) -> crate::ClientBuilderResult<impl super::stub::InstanceGroups> {
4967 Self::build_transport(conf)
4968 .await
4969 .map(super::tracing::InstanceGroups::new)
4970 }
4971
4972 /// Adds a list of instances to the specified instance group. All of the
4973 /// instances in the instance group must be in the same network/subnetwork.
4974 /// Read
4975 /// Adding instances for more information.
4976 pub fn add_instances(&self) -> super::builder::instance_groups::AddInstances {
4977 super::builder::instance_groups::AddInstances::new(self.inner.clone())
4978 }
4979
4980 /// Retrieves the list of instance groups and sorts them by zone.
4981 ///
4982 /// To prevent failure, Google recommends that you set the
4983 /// `returnPartialSuccess` parameter to `true`.
4984 pub fn aggregated_list(&self) -> super::builder::instance_groups::AggregatedList {
4985 super::builder::instance_groups::AggregatedList::new(self.inner.clone())
4986 }
4987
4988 /// Deletes the specified instance group. The instances in the group are not
4989 /// deleted. Note that instance group must not belong to a backend service.
4990 /// Read
4991 /// Deleting an instance group for more information.
4992 pub fn delete(&self) -> super::builder::instance_groups::Delete {
4993 super::builder::instance_groups::Delete::new(self.inner.clone())
4994 }
4995
4996 /// Returns the specified zonal instance group. Get a list of available zonal
4997 /// instance groups by making a list() request.
4998 ///
4999 /// For managed instance groups, use theinstanceGroupManagers
5000 /// or regionInstanceGroupManagers
5001 /// methods instead.
5002 pub fn get(&self) -> super::builder::instance_groups::Get {
5003 super::builder::instance_groups::Get::new(self.inner.clone())
5004 }
5005
5006 /// Creates an instance group in the specified project using the
5007 /// parameters that are included in the request.
5008 pub fn insert(&self) -> super::builder::instance_groups::Insert {
5009 super::builder::instance_groups::Insert::new(self.inner.clone())
5010 }
5011
5012 /// Retrieves the list of zonal instance group resources contained within the
5013 /// specified zone.
5014 ///
5015 /// For managed instance groups, use theinstanceGroupManagers
5016 /// or regionInstanceGroupManagers
5017 /// methods instead.
5018 pub fn list(&self) -> super::builder::instance_groups::List {
5019 super::builder::instance_groups::List::new(self.inner.clone())
5020 }
5021
5022 /// Lists the instances in the specified instance group.
5023 /// The orderBy query parameter is not supported.
5024 /// The filter query parameter is supported, but only for
5025 /// expressions that use `eq` (equal) or `ne` (not equal) operators.
5026 pub fn list_instances(&self) -> super::builder::instance_groups::ListInstances {
5027 super::builder::instance_groups::ListInstances::new(self.inner.clone())
5028 }
5029
5030 /// Removes one or more instances from the specified instance group, but does
5031 /// not delete those instances.
5032 ///
5033 /// If the group is part of a backend
5034 /// service that has enabled
5035 /// connection draining, it can take up to 60 seconds after the connection
5036 /// draining duration before the VM instance is removed or deleted.
5037 pub fn remove_instances(&self) -> super::builder::instance_groups::RemoveInstances {
5038 super::builder::instance_groups::RemoveInstances::new(self.inner.clone())
5039 }
5040
5041 /// Sets the named ports for the specified instance group.
5042 pub fn set_named_ports(&self) -> super::builder::instance_groups::SetNamedPorts {
5043 super::builder::instance_groups::SetNamedPorts::new(self.inner.clone())
5044 }
5045
5046 /// Returns permissions that a caller has on the specified resource.
5047 pub fn test_iam_permissions(&self) -> super::builder::instance_groups::TestIamPermissions {
5048 super::builder::instance_groups::TestIamPermissions::new(self.inner.clone())
5049 }
5050
5051 /// Retrieves the specified zone-specific Operations resource.
5052 pub fn get_operation(&self) -> super::builder::instance_groups::GetOperation {
5053 super::builder::instance_groups::GetOperation::new(self.inner.clone())
5054 }
5055}
5056
5057/// Implements a client for the Google Compute Engine API.
5058///
5059/// # Example
5060/// ```
5061/// # use google_cloud_compute_v1::client::InstanceSettings;
5062/// async fn sample(
5063/// ) -> anyhow::Result<()> {
5064/// let client = InstanceSettings::builder().build().await?;
5065/// // use `client` to make requests to the Google Compute Engine API.
5066/// Ok(())
5067/// }
5068/// ```
5069///
5070/// # Service Description
5071///
5072/// Service for the `instanceSettings` resource.
5073///
5074/// # Configuration
5075///
5076/// To configure `InstanceSettings` use the `with_*` methods in the type returned
5077/// by [builder()][InstanceSettings::builder]. The default configuration should
5078/// work for most applications. Common configuration changes include
5079///
5080/// * [with_endpoint()]: by default this client uses the global default endpoint
5081/// (`https://compute.googleapis.com`). Applications using regional
5082/// endpoints or running in restricted networks (e.g. a network configured
5083/// with [Private Google Access with VPC Service Controls]) may want to
5084/// override this default.
5085/// * [with_credentials()]: by default this client uses
5086/// [Application Default Credentials]. Applications using custom
5087/// authentication may need to override this default.
5088///
5089/// [with_endpoint()]: super::builder::instance_settings::ClientBuilder::with_endpoint
5090/// [with_credentials()]: super::builder::instance_settings::ClientBuilder::with_credentials
5091/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5092/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5093///
5094/// # Pooling and Cloning
5095///
5096/// `InstanceSettings` holds a connection pool internally, it is advised to
5097/// create one and reuse it. You do not need to wrap `InstanceSettings` in
5098/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5099/// already uses an `Arc` internally.
5100#[cfg(feature = "instance-settings")]
5101#[cfg_attr(docsrs, doc(cfg(feature = "instance-settings")))]
5102#[derive(Clone, Debug)]
5103pub struct InstanceSettings {
5104 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>,
5105}
5106
5107#[cfg(feature = "instance-settings")]
5108impl InstanceSettings {
5109 /// Returns a builder for [InstanceSettings].
5110 ///
5111 /// ```
5112 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5113 /// # use google_cloud_compute_v1::client::InstanceSettings;
5114 /// let client = InstanceSettings::builder().build().await?;
5115 /// # Ok(()) }
5116 /// ```
5117 pub fn builder() -> super::builder::instance_settings::ClientBuilder {
5118 crate::new_client_builder(super::builder::instance_settings::client::Factory)
5119 }
5120
5121 /// Creates a new client from the provided stub.
5122 ///
5123 /// The most common case for calling this function is in tests mocking the
5124 /// client's behavior.
5125 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5126 where
5127 T: super::stub::InstanceSettings + 'static,
5128 {
5129 Self { inner: stub.into() }
5130 }
5131
5132 pub(crate) async fn new(
5133 config: gaxi::options::ClientConfig,
5134 ) -> crate::ClientBuilderResult<Self> {
5135 let inner = Self::build_inner(config).await?;
5136 Ok(Self { inner })
5137 }
5138
5139 async fn build_inner(
5140 conf: gaxi::options::ClientConfig,
5141 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceSettings>>
5142 {
5143 if gaxi::options::tracing_enabled(&conf) {
5144 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5145 }
5146 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5147 }
5148
5149 async fn build_transport(
5150 conf: gaxi::options::ClientConfig,
5151 ) -> crate::ClientBuilderResult<impl super::stub::InstanceSettings> {
5152 super::transport::InstanceSettings::new(conf).await
5153 }
5154
5155 async fn build_with_tracing(
5156 conf: gaxi::options::ClientConfig,
5157 ) -> crate::ClientBuilderResult<impl super::stub::InstanceSettings> {
5158 Self::build_transport(conf)
5159 .await
5160 .map(super::tracing::InstanceSettings::new)
5161 }
5162
5163 /// Get Instance settings.
5164 pub fn get(&self) -> super::builder::instance_settings::Get {
5165 super::builder::instance_settings::Get::new(self.inner.clone())
5166 }
5167
5168 /// Patch Instance settings
5169 pub fn patch(&self) -> super::builder::instance_settings::Patch {
5170 super::builder::instance_settings::Patch::new(self.inner.clone())
5171 }
5172
5173 /// Retrieves the specified zone-specific Operations resource.
5174 pub fn get_operation(&self) -> super::builder::instance_settings::GetOperation {
5175 super::builder::instance_settings::GetOperation::new(self.inner.clone())
5176 }
5177}
5178
5179/// Implements a client for the Google Compute Engine API.
5180///
5181/// # Example
5182/// ```
5183/// # use google_cloud_compute_v1::client::InstanceTemplates;
5184/// async fn sample(
5185/// ) -> anyhow::Result<()> {
5186/// let client = InstanceTemplates::builder().build().await?;
5187/// // use `client` to make requests to the Google Compute Engine API.
5188/// Ok(())
5189/// }
5190/// ```
5191///
5192/// # Service Description
5193///
5194/// Service for the `instanceTemplates` resource.
5195///
5196/// # Configuration
5197///
5198/// To configure `InstanceTemplates` use the `with_*` methods in the type returned
5199/// by [builder()][InstanceTemplates::builder]. The default configuration should
5200/// work for most applications. Common configuration changes include
5201///
5202/// * [with_endpoint()]: by default this client uses the global default endpoint
5203/// (`https://compute.googleapis.com`). Applications using regional
5204/// endpoints or running in restricted networks (e.g. a network configured
5205/// with [Private Google Access with VPC Service Controls]) may want to
5206/// override this default.
5207/// * [with_credentials()]: by default this client uses
5208/// [Application Default Credentials]. Applications using custom
5209/// authentication may need to override this default.
5210///
5211/// [with_endpoint()]: super::builder::instance_templates::ClientBuilder::with_endpoint
5212/// [with_credentials()]: super::builder::instance_templates::ClientBuilder::with_credentials
5213/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5214/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5215///
5216/// # Pooling and Cloning
5217///
5218/// `InstanceTemplates` holds a connection pool internally, it is advised to
5219/// create one and reuse it. You do not need to wrap `InstanceTemplates` in
5220/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5221/// already uses an `Arc` internally.
5222#[cfg(feature = "instance-templates")]
5223#[cfg_attr(docsrs, doc(cfg(feature = "instance-templates")))]
5224#[derive(Clone, Debug)]
5225pub struct InstanceTemplates {
5226 inner: std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>,
5227}
5228
5229#[cfg(feature = "instance-templates")]
5230impl InstanceTemplates {
5231 /// Returns a builder for [InstanceTemplates].
5232 ///
5233 /// ```
5234 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5235 /// # use google_cloud_compute_v1::client::InstanceTemplates;
5236 /// let client = InstanceTemplates::builder().build().await?;
5237 /// # Ok(()) }
5238 /// ```
5239 pub fn builder() -> super::builder::instance_templates::ClientBuilder {
5240 crate::new_client_builder(super::builder::instance_templates::client::Factory)
5241 }
5242
5243 /// Creates a new client from the provided stub.
5244 ///
5245 /// The most common case for calling this function is in tests mocking the
5246 /// client's behavior.
5247 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5248 where
5249 T: super::stub::InstanceTemplates + 'static,
5250 {
5251 Self { inner: stub.into() }
5252 }
5253
5254 pub(crate) async fn new(
5255 config: gaxi::options::ClientConfig,
5256 ) -> crate::ClientBuilderResult<Self> {
5257 let inner = Self::build_inner(config).await?;
5258 Ok(Self { inner })
5259 }
5260
5261 async fn build_inner(
5262 conf: gaxi::options::ClientConfig,
5263 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstanceTemplates>>
5264 {
5265 if gaxi::options::tracing_enabled(&conf) {
5266 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5267 }
5268 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5269 }
5270
5271 async fn build_transport(
5272 conf: gaxi::options::ClientConfig,
5273 ) -> crate::ClientBuilderResult<impl super::stub::InstanceTemplates> {
5274 super::transport::InstanceTemplates::new(conf).await
5275 }
5276
5277 async fn build_with_tracing(
5278 conf: gaxi::options::ClientConfig,
5279 ) -> crate::ClientBuilderResult<impl super::stub::InstanceTemplates> {
5280 Self::build_transport(conf)
5281 .await
5282 .map(super::tracing::InstanceTemplates::new)
5283 }
5284
5285 /// Retrieves the list of all InstanceTemplates resources, regional and global,
5286 /// available to the specified project.
5287 ///
5288 /// To prevent failure, Google recommends that you set the
5289 /// `returnPartialSuccess` parameter to `true`.
5290 pub fn aggregated_list(&self) -> super::builder::instance_templates::AggregatedList {
5291 super::builder::instance_templates::AggregatedList::new(self.inner.clone())
5292 }
5293
5294 /// Deletes the specified instance template. Deleting an instance template is
5295 /// permanent and cannot be undone. It is not possible to delete templates
5296 /// that are already in use by a managed instance group.
5297 pub fn delete(&self) -> super::builder::instance_templates::Delete {
5298 super::builder::instance_templates::Delete::new(self.inner.clone())
5299 }
5300
5301 /// Returns the specified instance template.
5302 pub fn get(&self) -> super::builder::instance_templates::Get {
5303 super::builder::instance_templates::Get::new(self.inner.clone())
5304 }
5305
5306 /// Gets the access control policy for a resource. May be empty if no such
5307 /// policy or resource exists.
5308 pub fn get_iam_policy(&self) -> super::builder::instance_templates::GetIamPolicy {
5309 super::builder::instance_templates::GetIamPolicy::new(self.inner.clone())
5310 }
5311
5312 /// Creates an instance template in the specified project using the
5313 /// data that is included in the request. If you are creating a new template to
5314 /// update an existing instance group, your new instance template must use the
5315 /// same network or, if applicable, the same subnetwork as the original
5316 /// template.
5317 pub fn insert(&self) -> super::builder::instance_templates::Insert {
5318 super::builder::instance_templates::Insert::new(self.inner.clone())
5319 }
5320
5321 /// Retrieves a list of instance templates that are contained within
5322 /// the specified project.
5323 pub fn list(&self) -> super::builder::instance_templates::List {
5324 super::builder::instance_templates::List::new(self.inner.clone())
5325 }
5326
5327 /// Sets the access control policy on the specified resource.
5328 /// Replaces any existing policy.
5329 pub fn set_iam_policy(&self) -> super::builder::instance_templates::SetIamPolicy {
5330 super::builder::instance_templates::SetIamPolicy::new(self.inner.clone())
5331 }
5332
5333 /// Returns permissions that a caller has on the specified resource.
5334 pub fn test_iam_permissions(&self) -> super::builder::instance_templates::TestIamPermissions {
5335 super::builder::instance_templates::TestIamPermissions::new(self.inner.clone())
5336 }
5337
5338 /// Retrieves the specified Operations resource.
5339 pub fn get_operation(&self) -> super::builder::instance_templates::GetOperation {
5340 super::builder::instance_templates::GetOperation::new(self.inner.clone())
5341 }
5342}
5343
5344/// Implements a client for the Google Compute Engine API.
5345///
5346/// # Example
5347/// ```
5348/// # use google_cloud_compute_v1::client::Instances;
5349/// async fn sample(
5350/// ) -> anyhow::Result<()> {
5351/// let client = Instances::builder().build().await?;
5352/// // use `client` to make requests to the Google Compute Engine API.
5353/// Ok(())
5354/// }
5355/// ```
5356///
5357/// # Service Description
5358///
5359/// Service for the `instances` resource.
5360///
5361/// # Configuration
5362///
5363/// To configure `Instances` use the `with_*` methods in the type returned
5364/// by [builder()][Instances::builder]. The default configuration should
5365/// work for most applications. Common configuration changes include
5366///
5367/// * [with_endpoint()]: by default this client uses the global default endpoint
5368/// (`https://compute.googleapis.com`). Applications using regional
5369/// endpoints or running in restricted networks (e.g. a network configured
5370/// with [Private Google Access with VPC Service Controls]) may want to
5371/// override this default.
5372/// * [with_credentials()]: by default this client uses
5373/// [Application Default Credentials]. Applications using custom
5374/// authentication may need to override this default.
5375///
5376/// [with_endpoint()]: super::builder::instances::ClientBuilder::with_endpoint
5377/// [with_credentials()]: super::builder::instances::ClientBuilder::with_credentials
5378/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5379/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5380///
5381/// # Pooling and Cloning
5382///
5383/// `Instances` holds a connection pool internally, it is advised to
5384/// create one and reuse it. You do not need to wrap `Instances` in
5385/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5386/// already uses an `Arc` internally.
5387#[cfg(feature = "instances")]
5388#[cfg_attr(docsrs, doc(cfg(feature = "instances")))]
5389#[derive(Clone, Debug)]
5390pub struct Instances {
5391 inner: std::sync::Arc<dyn super::stub::dynamic::Instances>,
5392}
5393
5394#[cfg(feature = "instances")]
5395impl Instances {
5396 /// Returns a builder for [Instances].
5397 ///
5398 /// ```
5399 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5400 /// # use google_cloud_compute_v1::client::Instances;
5401 /// let client = Instances::builder().build().await?;
5402 /// # Ok(()) }
5403 /// ```
5404 pub fn builder() -> super::builder::instances::ClientBuilder {
5405 crate::new_client_builder(super::builder::instances::client::Factory)
5406 }
5407
5408 /// Creates a new client from the provided stub.
5409 ///
5410 /// The most common case for calling this function is in tests mocking the
5411 /// client's behavior.
5412 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5413 where
5414 T: super::stub::Instances + 'static,
5415 {
5416 Self { inner: stub.into() }
5417 }
5418
5419 pub(crate) async fn new(
5420 config: gaxi::options::ClientConfig,
5421 ) -> crate::ClientBuilderResult<Self> {
5422 let inner = Self::build_inner(config).await?;
5423 Ok(Self { inner })
5424 }
5425
5426 async fn build_inner(
5427 conf: gaxi::options::ClientConfig,
5428 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Instances>> {
5429 if gaxi::options::tracing_enabled(&conf) {
5430 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5431 }
5432 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5433 }
5434
5435 async fn build_transport(
5436 conf: gaxi::options::ClientConfig,
5437 ) -> crate::ClientBuilderResult<impl super::stub::Instances> {
5438 super::transport::Instances::new(conf).await
5439 }
5440
5441 async fn build_with_tracing(
5442 conf: gaxi::options::ClientConfig,
5443 ) -> crate::ClientBuilderResult<impl super::stub::Instances> {
5444 Self::build_transport(conf)
5445 .await
5446 .map(super::tracing::Instances::new)
5447 }
5448
5449 /// Adds an access config to an instance's network interface.
5450 pub fn add_access_config(&self) -> super::builder::instances::AddAccessConfig {
5451 super::builder::instances::AddAccessConfig::new(self.inner.clone())
5452 }
5453
5454 /// Adds one dynamic network interface to an active instance.
5455 pub fn add_network_interface(&self) -> super::builder::instances::AddNetworkInterface {
5456 super::builder::instances::AddNetworkInterface::new(self.inner.clone())
5457 }
5458
5459 /// Adds existing resource policies to an instance. You can only add one
5460 /// policy right now which will be applied to this instance for scheduling live
5461 /// migrations.
5462 pub fn add_resource_policies(&self) -> super::builder::instances::AddResourcePolicies {
5463 super::builder::instances::AddResourcePolicies::new(self.inner.clone())
5464 }
5465
5466 /// Retrieves an aggregated list of all of the instances in your project
5467 /// across all regions and zones.
5468 ///
5469 /// The performance of this method degrades when a filter is specified on a
5470 /// project that has a very large number of instances.
5471 ///
5472 /// To prevent failure, Google recommends that you set the
5473 /// `returnPartialSuccess` parameter to `true`.
5474 pub fn aggregated_list(&self) -> super::builder::instances::AggregatedList {
5475 super::builder::instances::AggregatedList::new(self.inner.clone())
5476 }
5477
5478 /// Attaches an existing Disk resource to an instance. You must first
5479 /// create the disk before you can attach it. It is not possible to create
5480 /// and attach a disk at the same time. For more information, readAdding a
5481 /// persistent disk to your instance.
5482 pub fn attach_disk(&self) -> super::builder::instances::AttachDisk {
5483 super::builder::instances::AttachDisk::new(self.inner.clone())
5484 }
5485
5486 /// Creates multiple instances. Count specifies the number of instances to
5487 /// create. For more information, seeAbout bulk
5488 /// creation of VMs.
5489 pub fn bulk_insert(&self) -> super::builder::instances::BulkInsert {
5490 super::builder::instances::BulkInsert::new(self.inner.clone())
5491 }
5492
5493 /// Deletes the specified Instance resource. For more information, seeDeleting
5494 /// an instance.
5495 pub fn delete(&self) -> super::builder::instances::Delete {
5496 super::builder::instances::Delete::new(self.inner.clone())
5497 }
5498
5499 /// Deletes an access config from an instance's network interface.
5500 pub fn delete_access_config(&self) -> super::builder::instances::DeleteAccessConfig {
5501 super::builder::instances::DeleteAccessConfig::new(self.inner.clone())
5502 }
5503
5504 /// Deletes one dynamic network interface from an active instance.
5505 /// InstancesDeleteNetworkInterfaceRequest indicates:
5506 ///
5507 /// - instance from which to delete, using project+zone+resource_id fields;
5508 /// - dynamic network interface to be deleted, using network_interface_name
5509 /// field;
5510 pub fn delete_network_interface(&self) -> super::builder::instances::DeleteNetworkInterface {
5511 super::builder::instances::DeleteNetworkInterface::new(self.inner.clone())
5512 }
5513
5514 /// Detaches a disk from an instance.
5515 pub fn detach_disk(&self) -> super::builder::instances::DetachDisk {
5516 super::builder::instances::DetachDisk::new(self.inner.clone())
5517 }
5518
5519 /// Returns the specified Instance resource.
5520 pub fn get(&self) -> super::builder::instances::Get {
5521 super::builder::instances::Get::new(self.inner.clone())
5522 }
5523
5524 /// Returns effective firewalls applied to an interface of the instance.
5525 pub fn get_effective_firewalls(&self) -> super::builder::instances::GetEffectiveFirewalls {
5526 super::builder::instances::GetEffectiveFirewalls::new(self.inner.clone())
5527 }
5528
5529 /// Returns the specified guest attributes entry.
5530 pub fn get_guest_attributes(&self) -> super::builder::instances::GetGuestAttributes {
5531 super::builder::instances::GetGuestAttributes::new(self.inner.clone())
5532 }
5533
5534 /// Gets the access control policy for a resource. May be empty if no such
5535 /// policy or resource exists.
5536 pub fn get_iam_policy(&self) -> super::builder::instances::GetIamPolicy {
5537 super::builder::instances::GetIamPolicy::new(self.inner.clone())
5538 }
5539
5540 /// Returns the screenshot from the specified instance.
5541 pub fn get_screenshot(&self) -> super::builder::instances::GetScreenshot {
5542 super::builder::instances::GetScreenshot::new(self.inner.clone())
5543 }
5544
5545 /// Returns the last 1 MB of serial port output from the specified instance.
5546 pub fn get_serial_port_output(&self) -> super::builder::instances::GetSerialPortOutput {
5547 super::builder::instances::GetSerialPortOutput::new(self.inner.clone())
5548 }
5549
5550 /// Returns the Shielded Instance Identity of an instance
5551 pub fn get_shielded_instance_identity(
5552 &self,
5553 ) -> super::builder::instances::GetShieldedInstanceIdentity {
5554 super::builder::instances::GetShieldedInstanceIdentity::new(self.inner.clone())
5555 }
5556
5557 /// Creates an instance resource in the specified project using the data
5558 /// included in the request.
5559 pub fn insert(&self) -> super::builder::instances::Insert {
5560 super::builder::instances::Insert::new(self.inner.clone())
5561 }
5562
5563 /// Retrieves the list of instances contained within
5564 /// the specified zone.
5565 pub fn list(&self) -> super::builder::instances::List {
5566 super::builder::instances::List::new(self.inner.clone())
5567 }
5568
5569 /// Retrieves a list of resources that refer to the VM instance specified in
5570 /// the request. For example, if the VM instance is part of a managed or
5571 /// unmanaged instance group, the referrers list includes the instance group.
5572 /// For more information, readViewing
5573 /// referrers to VM instances.
5574 pub fn list_referrers(&self) -> super::builder::instances::ListReferrers {
5575 super::builder::instances::ListReferrers::new(self.inner.clone())
5576 }
5577
5578 /// Perform a manual maintenance on the instance.
5579 pub fn perform_maintenance(&self) -> super::builder::instances::PerformMaintenance {
5580 super::builder::instances::PerformMaintenance::new(self.inner.clone())
5581 }
5582
5583 /// Removes resource policies from an instance.
5584 pub fn remove_resource_policies(&self) -> super::builder::instances::RemoveResourcePolicies {
5585 super::builder::instances::RemoveResourcePolicies::new(self.inner.clone())
5586 }
5587
5588 /// Mark the host as faulty and try to restart the instance on a new host.
5589 pub fn report_host_as_faulty(&self) -> super::builder::instances::ReportHostAsFaulty {
5590 super::builder::instances::ReportHostAsFaulty::new(self.inner.clone())
5591 }
5592
5593 /// Performs a reset on the instance. This is a hard reset. The VM
5594 /// does not do a graceful shutdown. For more information, seeResetting
5595 /// an instance.
5596 pub fn reset(&self) -> super::builder::instances::Reset {
5597 super::builder::instances::Reset::new(self.inner.clone())
5598 }
5599
5600 /// Resumes an instance that was suspended using theinstances().suspend
5601 /// method.
5602 pub fn resume(&self) -> super::builder::instances::Resume {
5603 super::builder::instances::Resume::new(self.inner.clone())
5604 }
5605
5606 /// Sends diagnostic interrupt to the instance.
5607 pub fn send_diagnostic_interrupt(&self) -> super::builder::instances::SendDiagnosticInterrupt {
5608 super::builder::instances::SendDiagnosticInterrupt::new(self.inner.clone())
5609 }
5610
5611 /// Sets deletion protection on the instance.
5612 pub fn set_deletion_protection(&self) -> super::builder::instances::SetDeletionProtection {
5613 super::builder::instances::SetDeletionProtection::new(self.inner.clone())
5614 }
5615
5616 /// Sets the auto-delete flag for a disk attached to an instance.
5617 pub fn set_disk_auto_delete(&self) -> super::builder::instances::SetDiskAutoDelete {
5618 super::builder::instances::SetDiskAutoDelete::new(self.inner.clone())
5619 }
5620
5621 /// Sets the access control policy on the specified resource.
5622 /// Replaces any existing policy.
5623 pub fn set_iam_policy(&self) -> super::builder::instances::SetIamPolicy {
5624 super::builder::instances::SetIamPolicy::new(self.inner.clone())
5625 }
5626
5627 /// Sets labels on an instance. To learn more about labels, read theLabeling
5628 /// Resources documentation.
5629 pub fn set_labels(&self) -> super::builder::instances::SetLabels {
5630 super::builder::instances::SetLabels::new(self.inner.clone())
5631 }
5632
5633 /// Changes the number and/or type of accelerator for a stopped instance to the
5634 /// values specified in the request.
5635 pub fn set_machine_resources(&self) -> super::builder::instances::SetMachineResources {
5636 super::builder::instances::SetMachineResources::new(self.inner.clone())
5637 }
5638
5639 /// Changes the machine type for a stopped instance to the machine
5640 /// type specified in the request.
5641 pub fn set_machine_type(&self) -> super::builder::instances::SetMachineType {
5642 super::builder::instances::SetMachineType::new(self.inner.clone())
5643 }
5644
5645 /// Sets metadata for the specified instance to the data included
5646 /// in the request.
5647 pub fn set_metadata(&self) -> super::builder::instances::SetMetadata {
5648 super::builder::instances::SetMetadata::new(self.inner.clone())
5649 }
5650
5651 /// Changes the minimum CPU platform that this instance should use.
5652 /// This method can only
5653 /// be called on a stopped instance. For more information, readSpecifying a
5654 /// Minimum CPU Platform.
5655 pub fn set_min_cpu_platform(&self) -> super::builder::instances::SetMinCpuPlatform {
5656 super::builder::instances::SetMinCpuPlatform::new(self.inner.clone())
5657 }
5658
5659 /// Sets name of an instance.
5660 pub fn set_name(&self) -> super::builder::instances::SetName {
5661 super::builder::instances::SetName::new(self.inner.clone())
5662 }
5663
5664 /// Sets an instance's scheduling options. You can only call this method on astopped instance,
5665 /// that is, a VM instance that is in a `TERMINATED` state. SeeInstance Life
5666 /// Cycle for more information on the possible instance states.
5667 /// For more information about setting scheduling options for a VM, seeSet
5668 /// VM host maintenance policy.
5669 pub fn set_scheduling(&self) -> super::builder::instances::SetScheduling {
5670 super::builder::instances::SetScheduling::new(self.inner.clone())
5671 }
5672
5673 /// Sets the Google Cloud Armor security policy for the specified instance.
5674 /// For more information, seeGoogle
5675 /// Cloud Armor Overview
5676 pub fn set_security_policy(&self) -> super::builder::instances::SetSecurityPolicy {
5677 super::builder::instances::SetSecurityPolicy::new(self.inner.clone())
5678 }
5679
5680 /// Sets the service account on the instance. For more information,
5681 /// readChanging
5682 /// the service account and access scopes for an instance.
5683 pub fn set_service_account(&self) -> super::builder::instances::SetServiceAccount {
5684 super::builder::instances::SetServiceAccount::new(self.inner.clone())
5685 }
5686
5687 /// Sets the Shielded Instance integrity policy for an instance. You can
5688 /// only use this method on a running instance. This method
5689 /// supports PATCH semantics and uses the JSON merge
5690 /// patch format and processing rules.
5691 pub fn set_shielded_instance_integrity_policy(
5692 &self,
5693 ) -> super::builder::instances::SetShieldedInstanceIntegrityPolicy {
5694 super::builder::instances::SetShieldedInstanceIntegrityPolicy::new(self.inner.clone())
5695 }
5696
5697 /// Sets network tags
5698 /// for the specified instance to the data included in the request.
5699 pub fn set_tags(&self) -> super::builder::instances::SetTags {
5700 super::builder::instances::SetTags::new(self.inner.clone())
5701 }
5702
5703 /// Simulates a host maintenance event on a VM. For more information, see
5704 /// Simulate a host maintenance event.
5705 pub fn simulate_maintenance_event(
5706 &self,
5707 ) -> super::builder::instances::SimulateMaintenanceEvent {
5708 super::builder::instances::SimulateMaintenanceEvent::new(self.inner.clone())
5709 }
5710
5711 /// Starts an instance that was stopped using theinstances().stop
5712 /// method. For more information, seeRestart an
5713 /// instance.
5714 pub fn start(&self) -> super::builder::instances::Start {
5715 super::builder::instances::Start::new(self.inner.clone())
5716 }
5717
5718 /// Starts an instance that was stopped using theinstances().stop
5719 /// method. For more information, seeRestart an
5720 /// instance.
5721 pub fn start_with_encryption_key(&self) -> super::builder::instances::StartWithEncryptionKey {
5722 super::builder::instances::StartWithEncryptionKey::new(self.inner.clone())
5723 }
5724
5725 /// Stops a running instance, shutting it down cleanly, and allows
5726 /// you to restart the instance at a later time. Stopped instances do not incur
5727 /// VM usage charges while they are stopped. However, resources that the VM is
5728 /// using, such as persistent disks and static IP addresses, will continue to
5729 /// be charged until they are deleted. For more information, seeStopping
5730 /// an instance.
5731 pub fn stop(&self) -> super::builder::instances::Stop {
5732 super::builder::instances::Stop::new(self.inner.clone())
5733 }
5734
5735 /// This method suspends a running instance, saving its state to persistent
5736 /// storage, and allows you to resume the instance at a later time. Suspended
5737 /// instances have no compute costs (cores or RAM), and incur only storage
5738 /// charges for the saved VM memory and localSSD data. Any charged resources
5739 /// the virtual machine was using, such as persistent disks and static IP
5740 /// addresses, will continue to be charged while the instance is suspended.
5741 /// For more information, see
5742 /// Suspending and resuming an instance.
5743 pub fn suspend(&self) -> super::builder::instances::Suspend {
5744 super::builder::instances::Suspend::new(self.inner.clone())
5745 }
5746
5747 /// Returns permissions that a caller has on the specified resource.
5748 pub fn test_iam_permissions(&self) -> super::builder::instances::TestIamPermissions {
5749 super::builder::instances::TestIamPermissions::new(self.inner.clone())
5750 }
5751
5752 /// Updates an instance only if the necessary resources are available. This
5753 /// method can update only a specific set of instance properties. See
5754 /// Updating a running instance for a list of updatable instance
5755 /// properties.
5756 pub fn update(&self) -> super::builder::instances::Update {
5757 super::builder::instances::Update::new(self.inner.clone())
5758 }
5759
5760 /// Updates the specified access config from an instance's network interface
5761 /// with the data included in the request. This method supportsPATCH
5762 /// semantics and uses theJSON merge
5763 /// patch format and processing rules.
5764 pub fn update_access_config(&self) -> super::builder::instances::UpdateAccessConfig {
5765 super::builder::instances::UpdateAccessConfig::new(self.inner.clone())
5766 }
5767
5768 /// Updates the Display config for a VM instance. You can
5769 /// only use this method on a stopped VM instance. This method supportsPATCH
5770 /// semantics and uses theJSON merge
5771 /// patch format and processing rules.
5772 pub fn update_display_device(&self) -> super::builder::instances::UpdateDisplayDevice {
5773 super::builder::instances::UpdateDisplayDevice::new(self.inner.clone())
5774 }
5775
5776 /// Updates an instance's network interface. This method can only update an
5777 /// interface's alias IP range and attached network. See Modifying
5778 /// alias IP ranges for an existing instance for instructions on
5779 /// changing alias IP ranges. See Migrating
5780 /// a VM between networks for instructions on migrating an interface.
5781 /// This method follows PATCH semantics.
5782 pub fn update_network_interface(&self) -> super::builder::instances::UpdateNetworkInterface {
5783 super::builder::instances::UpdateNetworkInterface::new(self.inner.clone())
5784 }
5785
5786 /// Updates the Shielded Instance config for an instance. You can
5787 /// only use this method on a stopped instance. This method supportsPATCH
5788 /// semantics and uses theJSON merge
5789 /// patch format and processing rules.
5790 pub fn update_shielded_instance_config(
5791 &self,
5792 ) -> super::builder::instances::UpdateShieldedInstanceConfig {
5793 super::builder::instances::UpdateShieldedInstanceConfig::new(self.inner.clone())
5794 }
5795
5796 /// Retrieves the specified zone-specific Operations resource.
5797 pub fn get_operation(&self) -> super::builder::instances::GetOperation {
5798 super::builder::instances::GetOperation::new(self.inner.clone())
5799 }
5800}
5801
5802/// Implements a client for the Google Compute Engine API.
5803///
5804/// # Example
5805/// ```
5806/// # use google_cloud_compute_v1::client::InstantSnapshotGroups;
5807/// async fn sample(
5808/// ) -> anyhow::Result<()> {
5809/// let client = InstantSnapshotGroups::builder().build().await?;
5810/// // use `client` to make requests to the Google Compute Engine API.
5811/// Ok(())
5812/// }
5813/// ```
5814///
5815/// # Service Description
5816///
5817/// Service for the `instantSnapshotGroups` resource.
5818///
5819/// # Configuration
5820///
5821/// To configure `InstantSnapshotGroups` use the `with_*` methods in the type returned
5822/// by [builder()][InstantSnapshotGroups::builder]. The default configuration should
5823/// work for most applications. Common configuration changes include
5824///
5825/// * [with_endpoint()]: by default this client uses the global default endpoint
5826/// (`https://compute.googleapis.com`). Applications using regional
5827/// endpoints or running in restricted networks (e.g. a network configured
5828/// with [Private Google Access with VPC Service Controls]) may want to
5829/// override this default.
5830/// * [with_credentials()]: by default this client uses
5831/// [Application Default Credentials]. Applications using custom
5832/// authentication may need to override this default.
5833///
5834/// [with_endpoint()]: super::builder::instant_snapshot_groups::ClientBuilder::with_endpoint
5835/// [with_credentials()]: super::builder::instant_snapshot_groups::ClientBuilder::with_credentials
5836/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5837/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5838///
5839/// # Pooling and Cloning
5840///
5841/// `InstantSnapshotGroups` holds a connection pool internally, it is advised to
5842/// create one and reuse it. You do not need to wrap `InstantSnapshotGroups` in
5843/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5844/// already uses an `Arc` internally.
5845#[cfg(feature = "instant-snapshot-groups")]
5846#[cfg_attr(docsrs, doc(cfg(feature = "instant-snapshot-groups")))]
5847#[derive(Clone, Debug)]
5848pub struct InstantSnapshotGroups {
5849 inner: std::sync::Arc<dyn super::stub::dynamic::InstantSnapshotGroups>,
5850}
5851
5852#[cfg(feature = "instant-snapshot-groups")]
5853impl InstantSnapshotGroups {
5854 /// Returns a builder for [InstantSnapshotGroups].
5855 ///
5856 /// ```
5857 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5858 /// # use google_cloud_compute_v1::client::InstantSnapshotGroups;
5859 /// let client = InstantSnapshotGroups::builder().build().await?;
5860 /// # Ok(()) }
5861 /// ```
5862 pub fn builder() -> super::builder::instant_snapshot_groups::ClientBuilder {
5863 crate::new_client_builder(super::builder::instant_snapshot_groups::client::Factory)
5864 }
5865
5866 /// Creates a new client from the provided stub.
5867 ///
5868 /// The most common case for calling this function is in tests mocking the
5869 /// client's behavior.
5870 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
5871 where
5872 T: super::stub::InstantSnapshotGroups + 'static,
5873 {
5874 Self { inner: stub.into() }
5875 }
5876
5877 pub(crate) async fn new(
5878 config: gaxi::options::ClientConfig,
5879 ) -> crate::ClientBuilderResult<Self> {
5880 let inner = Self::build_inner(config).await?;
5881 Ok(Self { inner })
5882 }
5883
5884 async fn build_inner(
5885 conf: gaxi::options::ClientConfig,
5886 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstantSnapshotGroups>>
5887 {
5888 if gaxi::options::tracing_enabled(&conf) {
5889 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
5890 }
5891 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
5892 }
5893
5894 async fn build_transport(
5895 conf: gaxi::options::ClientConfig,
5896 ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshotGroups> {
5897 super::transport::InstantSnapshotGroups::new(conf).await
5898 }
5899
5900 async fn build_with_tracing(
5901 conf: gaxi::options::ClientConfig,
5902 ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshotGroups> {
5903 Self::build_transport(conf)
5904 .await
5905 .map(super::tracing::InstantSnapshotGroups::new)
5906 }
5907
5908 /// deletes a Zonal InstantSnapshotGroup resource
5909 pub fn delete(&self) -> super::builder::instant_snapshot_groups::Delete {
5910 super::builder::instant_snapshot_groups::Delete::new(self.inner.clone())
5911 }
5912
5913 /// returns the specified InstantSnapshotGroup resource in the specified zone.
5914 pub fn get(&self) -> super::builder::instant_snapshot_groups::Get {
5915 super::builder::instant_snapshot_groups::Get::new(self.inner.clone())
5916 }
5917
5918 /// Gets the access control policy for a resource. May be empty if no such
5919 /// policy or resource exists.
5920 pub fn get_iam_policy(&self) -> super::builder::instant_snapshot_groups::GetIamPolicy {
5921 super::builder::instant_snapshot_groups::GetIamPolicy::new(self.inner.clone())
5922 }
5923
5924 /// inserts a Zonal InstantSnapshotGroup resource
5925 pub fn insert(&self) -> super::builder::instant_snapshot_groups::Insert {
5926 super::builder::instant_snapshot_groups::Insert::new(self.inner.clone())
5927 }
5928
5929 /// retrieves the list of InstantSnapshotGroup resources contained within
5930 /// the specified zone.
5931 pub fn list(&self) -> super::builder::instant_snapshot_groups::List {
5932 super::builder::instant_snapshot_groups::List::new(self.inner.clone())
5933 }
5934
5935 /// Sets the access control policy on the specified resource.
5936 /// Replaces any existing policy.
5937 pub fn set_iam_policy(&self) -> super::builder::instant_snapshot_groups::SetIamPolicy {
5938 super::builder::instant_snapshot_groups::SetIamPolicy::new(self.inner.clone())
5939 }
5940
5941 /// Returns permissions that a caller has on the specified resource.
5942 pub fn test_iam_permissions(
5943 &self,
5944 ) -> super::builder::instant_snapshot_groups::TestIamPermissions {
5945 super::builder::instant_snapshot_groups::TestIamPermissions::new(self.inner.clone())
5946 }
5947
5948 /// Retrieves the specified zone-specific Operations resource.
5949 pub fn get_operation(&self) -> super::builder::instant_snapshot_groups::GetOperation {
5950 super::builder::instant_snapshot_groups::GetOperation::new(self.inner.clone())
5951 }
5952}
5953
5954/// Implements a client for the Google Compute Engine API.
5955///
5956/// # Example
5957/// ```
5958/// # use google_cloud_compute_v1::client::InstantSnapshots;
5959/// async fn sample(
5960/// ) -> anyhow::Result<()> {
5961/// let client = InstantSnapshots::builder().build().await?;
5962/// // use `client` to make requests to the Google Compute Engine API.
5963/// Ok(())
5964/// }
5965/// ```
5966///
5967/// # Service Description
5968///
5969/// Service for the `instantSnapshots` resource.
5970///
5971/// # Configuration
5972///
5973/// To configure `InstantSnapshots` use the `with_*` methods in the type returned
5974/// by [builder()][InstantSnapshots::builder]. The default configuration should
5975/// work for most applications. Common configuration changes include
5976///
5977/// * [with_endpoint()]: by default this client uses the global default endpoint
5978/// (`https://compute.googleapis.com`). Applications using regional
5979/// endpoints or running in restricted networks (e.g. a network configured
5980/// with [Private Google Access with VPC Service Controls]) may want to
5981/// override this default.
5982/// * [with_credentials()]: by default this client uses
5983/// [Application Default Credentials]. Applications using custom
5984/// authentication may need to override this default.
5985///
5986/// [with_endpoint()]: super::builder::instant_snapshots::ClientBuilder::with_endpoint
5987/// [with_credentials()]: super::builder::instant_snapshots::ClientBuilder::with_credentials
5988/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
5989/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
5990///
5991/// # Pooling and Cloning
5992///
5993/// `InstantSnapshots` holds a connection pool internally, it is advised to
5994/// create one and reuse it. You do not need to wrap `InstantSnapshots` in
5995/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
5996/// already uses an `Arc` internally.
5997#[cfg(feature = "instant-snapshots")]
5998#[cfg_attr(docsrs, doc(cfg(feature = "instant-snapshots")))]
5999#[derive(Clone, Debug)]
6000pub struct InstantSnapshots {
6001 inner: std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>,
6002}
6003
6004#[cfg(feature = "instant-snapshots")]
6005impl InstantSnapshots {
6006 /// Returns a builder for [InstantSnapshots].
6007 ///
6008 /// ```
6009 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6010 /// # use google_cloud_compute_v1::client::InstantSnapshots;
6011 /// let client = InstantSnapshots::builder().build().await?;
6012 /// # Ok(()) }
6013 /// ```
6014 pub fn builder() -> super::builder::instant_snapshots::ClientBuilder {
6015 crate::new_client_builder(super::builder::instant_snapshots::client::Factory)
6016 }
6017
6018 /// Creates a new client from the provided stub.
6019 ///
6020 /// The most common case for calling this function is in tests mocking the
6021 /// client's behavior.
6022 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6023 where
6024 T: super::stub::InstantSnapshots + 'static,
6025 {
6026 Self { inner: stub.into() }
6027 }
6028
6029 pub(crate) async fn new(
6030 config: gaxi::options::ClientConfig,
6031 ) -> crate::ClientBuilderResult<Self> {
6032 let inner = Self::build_inner(config).await?;
6033 Ok(Self { inner })
6034 }
6035
6036 async fn build_inner(
6037 conf: gaxi::options::ClientConfig,
6038 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InstantSnapshots>>
6039 {
6040 if gaxi::options::tracing_enabled(&conf) {
6041 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6042 }
6043 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6044 }
6045
6046 async fn build_transport(
6047 conf: gaxi::options::ClientConfig,
6048 ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshots> {
6049 super::transport::InstantSnapshots::new(conf).await
6050 }
6051
6052 async fn build_with_tracing(
6053 conf: gaxi::options::ClientConfig,
6054 ) -> crate::ClientBuilderResult<impl super::stub::InstantSnapshots> {
6055 Self::build_transport(conf)
6056 .await
6057 .map(super::tracing::InstantSnapshots::new)
6058 }
6059
6060 /// Retrieves an aggregated list of instantSnapshots.
6061 ///
6062 /// To prevent failure, Google recommends that you set the
6063 /// `returnPartialSuccess` parameter to `true`.
6064 pub fn aggregated_list(&self) -> super::builder::instant_snapshots::AggregatedList {
6065 super::builder::instant_snapshots::AggregatedList::new(self.inner.clone())
6066 }
6067
6068 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
6069 /// a single instantSnapshot might not necessarily delete all the data on that
6070 /// instantSnapshot. If any data on the instantSnapshot that is marked for
6071 /// deletion is needed for subsequent instantSnapshots, the data will be moved
6072 /// to the next corresponding instantSnapshot.
6073 ///
6074 /// For more information, seeDeleting
6075 /// instantSnapshots.
6076 pub fn delete(&self) -> super::builder::instant_snapshots::Delete {
6077 super::builder::instant_snapshots::Delete::new(self.inner.clone())
6078 }
6079
6080 /// Returns the specified InstantSnapshot resource in the specified zone.
6081 pub fn get(&self) -> super::builder::instant_snapshots::Get {
6082 super::builder::instant_snapshots::Get::new(self.inner.clone())
6083 }
6084
6085 /// Gets the access control policy for a resource. May be empty if no such
6086 /// policy or resource exists.
6087 pub fn get_iam_policy(&self) -> super::builder::instant_snapshots::GetIamPolicy {
6088 super::builder::instant_snapshots::GetIamPolicy::new(self.inner.clone())
6089 }
6090
6091 /// Creates an instant snapshot in the specified zone.
6092 pub fn insert(&self) -> super::builder::instant_snapshots::Insert {
6093 super::builder::instant_snapshots::Insert::new(self.inner.clone())
6094 }
6095
6096 /// Retrieves the list of InstantSnapshot resources contained within
6097 /// the specified zone.
6098 pub fn list(&self) -> super::builder::instant_snapshots::List {
6099 super::builder::instant_snapshots::List::new(self.inner.clone())
6100 }
6101
6102 /// Sets the access control policy on the specified resource.
6103 /// Replaces any existing policy.
6104 pub fn set_iam_policy(&self) -> super::builder::instant_snapshots::SetIamPolicy {
6105 super::builder::instant_snapshots::SetIamPolicy::new(self.inner.clone())
6106 }
6107
6108 /// Sets the labels on a instantSnapshot in the given zone. To learn more about
6109 /// labels, read the Labeling
6110 /// Resources documentation.
6111 pub fn set_labels(&self) -> super::builder::instant_snapshots::SetLabels {
6112 super::builder::instant_snapshots::SetLabels::new(self.inner.clone())
6113 }
6114
6115 /// Returns permissions that a caller has on the specified resource.
6116 pub fn test_iam_permissions(&self) -> super::builder::instant_snapshots::TestIamPermissions {
6117 super::builder::instant_snapshots::TestIamPermissions::new(self.inner.clone())
6118 }
6119
6120 /// Retrieves the specified zone-specific Operations resource.
6121 pub fn get_operation(&self) -> super::builder::instant_snapshots::GetOperation {
6122 super::builder::instant_snapshots::GetOperation::new(self.inner.clone())
6123 }
6124}
6125
6126/// Implements a client for the Google Compute Engine API.
6127///
6128/// # Example
6129/// ```
6130/// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
6131/// async fn sample(
6132/// ) -> anyhow::Result<()> {
6133/// let client = InterconnectAttachmentGroups::builder().build().await?;
6134/// // use `client` to make requests to the Google Compute Engine API.
6135/// Ok(())
6136/// }
6137/// ```
6138///
6139/// # Service Description
6140///
6141/// Service for the `interconnectAttachmentGroups` resource.
6142///
6143/// # Configuration
6144///
6145/// To configure `InterconnectAttachmentGroups` use the `with_*` methods in the type returned
6146/// by [builder()][InterconnectAttachmentGroups::builder]. The default configuration should
6147/// work for most applications. Common configuration changes include
6148///
6149/// * [with_endpoint()]: by default this client uses the global default endpoint
6150/// (`https://compute.googleapis.com`). Applications using regional
6151/// endpoints or running in restricted networks (e.g. a network configured
6152/// with [Private Google Access with VPC Service Controls]) may want to
6153/// override this default.
6154/// * [with_credentials()]: by default this client uses
6155/// [Application Default Credentials]. Applications using custom
6156/// authentication may need to override this default.
6157///
6158/// [with_endpoint()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_endpoint
6159/// [with_credentials()]: super::builder::interconnect_attachment_groups::ClientBuilder::with_credentials
6160/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6161/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6162///
6163/// # Pooling and Cloning
6164///
6165/// `InterconnectAttachmentGroups` holds a connection pool internally, it is advised to
6166/// create one and reuse it. You do not need to wrap `InterconnectAttachmentGroups` in
6167/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6168/// already uses an `Arc` internally.
6169#[cfg(feature = "interconnect-attachment-groups")]
6170#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachment-groups")))]
6171#[derive(Clone, Debug)]
6172pub struct InterconnectAttachmentGroups {
6173 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
6174}
6175
6176#[cfg(feature = "interconnect-attachment-groups")]
6177impl InterconnectAttachmentGroups {
6178 /// Returns a builder for [InterconnectAttachmentGroups].
6179 ///
6180 /// ```
6181 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6182 /// # use google_cloud_compute_v1::client::InterconnectAttachmentGroups;
6183 /// let client = InterconnectAttachmentGroups::builder().build().await?;
6184 /// # Ok(()) }
6185 /// ```
6186 pub fn builder() -> super::builder::interconnect_attachment_groups::ClientBuilder {
6187 crate::new_client_builder(super::builder::interconnect_attachment_groups::client::Factory)
6188 }
6189
6190 /// Creates a new client from the provided stub.
6191 ///
6192 /// The most common case for calling this function is in tests mocking the
6193 /// client's behavior.
6194 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6195 where
6196 T: super::stub::InterconnectAttachmentGroups + 'static,
6197 {
6198 Self { inner: stub.into() }
6199 }
6200
6201 pub(crate) async fn new(
6202 config: gaxi::options::ClientConfig,
6203 ) -> crate::ClientBuilderResult<Self> {
6204 let inner = Self::build_inner(config).await?;
6205 Ok(Self { inner })
6206 }
6207
6208 async fn build_inner(
6209 conf: gaxi::options::ClientConfig,
6210 ) -> crate::ClientBuilderResult<
6211 std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachmentGroups>,
6212 > {
6213 if gaxi::options::tracing_enabled(&conf) {
6214 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6215 }
6216 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6217 }
6218
6219 async fn build_transport(
6220 conf: gaxi::options::ClientConfig,
6221 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachmentGroups> {
6222 super::transport::InterconnectAttachmentGroups::new(conf).await
6223 }
6224
6225 async fn build_with_tracing(
6226 conf: gaxi::options::ClientConfig,
6227 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachmentGroups> {
6228 Self::build_transport(conf)
6229 .await
6230 .map(super::tracing::InterconnectAttachmentGroups::new)
6231 }
6232
6233 /// Deletes the specified InterconnectAttachmentGroup in the given scope
6234 pub fn delete(&self) -> super::builder::interconnect_attachment_groups::Delete {
6235 super::builder::interconnect_attachment_groups::Delete::new(self.inner.clone())
6236 }
6237
6238 /// Returns the specified InterconnectAttachmentGroup resource in the given
6239 /// scope.
6240 pub fn get(&self) -> super::builder::interconnect_attachment_groups::Get {
6241 super::builder::interconnect_attachment_groups::Get::new(self.inner.clone())
6242 }
6243
6244 /// Gets the access control policy for a resource. May be empty if no such
6245 /// policy or resource exists.
6246 pub fn get_iam_policy(&self) -> super::builder::interconnect_attachment_groups::GetIamPolicy {
6247 super::builder::interconnect_attachment_groups::GetIamPolicy::new(self.inner.clone())
6248 }
6249
6250 /// Returns the InterconnectAttachmentStatuses for the specified
6251 /// InterconnectAttachmentGroup resource.
6252 pub fn get_operational_status(
6253 &self,
6254 ) -> super::builder::interconnect_attachment_groups::GetOperationalStatus {
6255 super::builder::interconnect_attachment_groups::GetOperationalStatus::new(
6256 self.inner.clone(),
6257 )
6258 }
6259
6260 /// Creates a InterconnectAttachmentGroup in the specified project in the given
6261 /// scope using the parameters that are included in the request.
6262 pub fn insert(&self) -> super::builder::interconnect_attachment_groups::Insert {
6263 super::builder::interconnect_attachment_groups::Insert::new(self.inner.clone())
6264 }
6265
6266 /// Lists the InterconnectAttachmentGroups for a project in the given scope.
6267 pub fn list(&self) -> super::builder::interconnect_attachment_groups::List {
6268 super::builder::interconnect_attachment_groups::List::new(self.inner.clone())
6269 }
6270
6271 /// Patches the specified InterconnectAttachmentGroup resource with the data
6272 /// included in the request. This method supports PATCH
6273 /// semantics and usesJSON merge
6274 /// patch format and processing rules.
6275 pub fn patch(&self) -> super::builder::interconnect_attachment_groups::Patch {
6276 super::builder::interconnect_attachment_groups::Patch::new(self.inner.clone())
6277 }
6278
6279 /// Sets the access control policy on the specified resource.
6280 /// Replaces any existing policy.
6281 pub fn set_iam_policy(&self) -> super::builder::interconnect_attachment_groups::SetIamPolicy {
6282 super::builder::interconnect_attachment_groups::SetIamPolicy::new(self.inner.clone())
6283 }
6284
6285 /// Returns permissions that a caller has on the specified resource.
6286 pub fn test_iam_permissions(
6287 &self,
6288 ) -> super::builder::interconnect_attachment_groups::TestIamPermissions {
6289 super::builder::interconnect_attachment_groups::TestIamPermissions::new(self.inner.clone())
6290 }
6291
6292 /// Retrieves the specified Operations resource.
6293 pub fn get_operation(&self) -> super::builder::interconnect_attachment_groups::GetOperation {
6294 super::builder::interconnect_attachment_groups::GetOperation::new(self.inner.clone())
6295 }
6296}
6297
6298/// Implements a client for the Google Compute Engine API.
6299///
6300/// # Example
6301/// ```
6302/// # use google_cloud_compute_v1::client::InterconnectAttachments;
6303/// async fn sample(
6304/// ) -> anyhow::Result<()> {
6305/// let client = InterconnectAttachments::builder().build().await?;
6306/// // use `client` to make requests to the Google Compute Engine API.
6307/// Ok(())
6308/// }
6309/// ```
6310///
6311/// # Service Description
6312///
6313/// Service for the `interconnectAttachments` resource.
6314///
6315/// # Configuration
6316///
6317/// To configure `InterconnectAttachments` use the `with_*` methods in the type returned
6318/// by [builder()][InterconnectAttachments::builder]. The default configuration should
6319/// work for most applications. Common configuration changes include
6320///
6321/// * [with_endpoint()]: by default this client uses the global default endpoint
6322/// (`https://compute.googleapis.com`). Applications using regional
6323/// endpoints or running in restricted networks (e.g. a network configured
6324/// with [Private Google Access with VPC Service Controls]) may want to
6325/// override this default.
6326/// * [with_credentials()]: by default this client uses
6327/// [Application Default Credentials]. Applications using custom
6328/// authentication may need to override this default.
6329///
6330/// [with_endpoint()]: super::builder::interconnect_attachments::ClientBuilder::with_endpoint
6331/// [with_credentials()]: super::builder::interconnect_attachments::ClientBuilder::with_credentials
6332/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6333/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6334///
6335/// # Pooling and Cloning
6336///
6337/// `InterconnectAttachments` holds a connection pool internally, it is advised to
6338/// create one and reuse it. You do not need to wrap `InterconnectAttachments` in
6339/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6340/// already uses an `Arc` internally.
6341#[cfg(feature = "interconnect-attachments")]
6342#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-attachments")))]
6343#[derive(Clone, Debug)]
6344pub struct InterconnectAttachments {
6345 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>,
6346}
6347
6348#[cfg(feature = "interconnect-attachments")]
6349impl InterconnectAttachments {
6350 /// Returns a builder for [InterconnectAttachments].
6351 ///
6352 /// ```
6353 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6354 /// # use google_cloud_compute_v1::client::InterconnectAttachments;
6355 /// let client = InterconnectAttachments::builder().build().await?;
6356 /// # Ok(()) }
6357 /// ```
6358 pub fn builder() -> super::builder::interconnect_attachments::ClientBuilder {
6359 crate::new_client_builder(super::builder::interconnect_attachments::client::Factory)
6360 }
6361
6362 /// Creates a new client from the provided stub.
6363 ///
6364 /// The most common case for calling this function is in tests mocking the
6365 /// client's behavior.
6366 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6367 where
6368 T: super::stub::InterconnectAttachments + 'static,
6369 {
6370 Self { inner: stub.into() }
6371 }
6372
6373 pub(crate) async fn new(
6374 config: gaxi::options::ClientConfig,
6375 ) -> crate::ClientBuilderResult<Self> {
6376 let inner = Self::build_inner(config).await?;
6377 Ok(Self { inner })
6378 }
6379
6380 async fn build_inner(
6381 conf: gaxi::options::ClientConfig,
6382 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectAttachments>>
6383 {
6384 if gaxi::options::tracing_enabled(&conf) {
6385 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6386 }
6387 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6388 }
6389
6390 async fn build_transport(
6391 conf: gaxi::options::ClientConfig,
6392 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachments> {
6393 super::transport::InterconnectAttachments::new(conf).await
6394 }
6395
6396 async fn build_with_tracing(
6397 conf: gaxi::options::ClientConfig,
6398 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectAttachments> {
6399 Self::build_transport(conf)
6400 .await
6401 .map(super::tracing::InterconnectAttachments::new)
6402 }
6403
6404 /// Retrieves an aggregated list of interconnect attachments.
6405 ///
6406 /// To prevent failure, Google recommends that you set the
6407 /// `returnPartialSuccess` parameter to `true`.
6408 pub fn aggregated_list(&self) -> super::builder::interconnect_attachments::AggregatedList {
6409 super::builder::interconnect_attachments::AggregatedList::new(self.inner.clone())
6410 }
6411
6412 /// Deletes the specified interconnect attachment.
6413 pub fn delete(&self) -> super::builder::interconnect_attachments::Delete {
6414 super::builder::interconnect_attachments::Delete::new(self.inner.clone())
6415 }
6416
6417 /// Returns the specified interconnect attachment.
6418 pub fn get(&self) -> super::builder::interconnect_attachments::Get {
6419 super::builder::interconnect_attachments::Get::new(self.inner.clone())
6420 }
6421
6422 /// Creates an InterconnectAttachment in the specified project using the data
6423 /// included in the request.
6424 pub fn insert(&self) -> super::builder::interconnect_attachments::Insert {
6425 super::builder::interconnect_attachments::Insert::new(self.inner.clone())
6426 }
6427
6428 /// Retrieves the list of interconnect attachments contained within
6429 /// the specified region.
6430 pub fn list(&self) -> super::builder::interconnect_attachments::List {
6431 super::builder::interconnect_attachments::List::new(self.inner.clone())
6432 }
6433
6434 /// Updates the specified interconnect attachment with the data included in the
6435 /// request. This method supportsPATCH
6436 /// semantics and uses theJSON merge
6437 /// patch format and processing rules.
6438 pub fn patch(&self) -> super::builder::interconnect_attachments::Patch {
6439 super::builder::interconnect_attachments::Patch::new(self.inner.clone())
6440 }
6441
6442 /// Sets the labels on an InterconnectAttachment. To learn more about labels,
6443 /// read the Labeling
6444 /// Resources documentation.
6445 pub fn set_labels(&self) -> super::builder::interconnect_attachments::SetLabels {
6446 super::builder::interconnect_attachments::SetLabels::new(self.inner.clone())
6447 }
6448
6449 /// Retrieves the specified region-specific Operations resource.
6450 pub fn get_operation(&self) -> super::builder::interconnect_attachments::GetOperation {
6451 super::builder::interconnect_attachments::GetOperation::new(self.inner.clone())
6452 }
6453}
6454
6455/// Implements a client for the Google Compute Engine API.
6456///
6457/// # Example
6458/// ```
6459/// # use google_cloud_compute_v1::client::InterconnectGroups;
6460/// async fn sample(
6461/// ) -> anyhow::Result<()> {
6462/// let client = InterconnectGroups::builder().build().await?;
6463/// // use `client` to make requests to the Google Compute Engine API.
6464/// Ok(())
6465/// }
6466/// ```
6467///
6468/// # Service Description
6469///
6470/// Service for the `interconnectGroups` resource.
6471///
6472/// # Configuration
6473///
6474/// To configure `InterconnectGroups` use the `with_*` methods in the type returned
6475/// by [builder()][InterconnectGroups::builder]. The default configuration should
6476/// work for most applications. Common configuration changes include
6477///
6478/// * [with_endpoint()]: by default this client uses the global default endpoint
6479/// (`https://compute.googleapis.com`). Applications using regional
6480/// endpoints or running in restricted networks (e.g. a network configured
6481/// with [Private Google Access with VPC Service Controls]) may want to
6482/// override this default.
6483/// * [with_credentials()]: by default this client uses
6484/// [Application Default Credentials]. Applications using custom
6485/// authentication may need to override this default.
6486///
6487/// [with_endpoint()]: super::builder::interconnect_groups::ClientBuilder::with_endpoint
6488/// [with_credentials()]: super::builder::interconnect_groups::ClientBuilder::with_credentials
6489/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6490/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6491///
6492/// # Pooling and Cloning
6493///
6494/// `InterconnectGroups` holds a connection pool internally, it is advised to
6495/// create one and reuse it. You do not need to wrap `InterconnectGroups` in
6496/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6497/// already uses an `Arc` internally.
6498#[cfg(feature = "interconnect-groups")]
6499#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-groups")))]
6500#[derive(Clone, Debug)]
6501pub struct InterconnectGroups {
6502 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>,
6503}
6504
6505#[cfg(feature = "interconnect-groups")]
6506impl InterconnectGroups {
6507 /// Returns a builder for [InterconnectGroups].
6508 ///
6509 /// ```
6510 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6511 /// # use google_cloud_compute_v1::client::InterconnectGroups;
6512 /// let client = InterconnectGroups::builder().build().await?;
6513 /// # Ok(()) }
6514 /// ```
6515 pub fn builder() -> super::builder::interconnect_groups::ClientBuilder {
6516 crate::new_client_builder(super::builder::interconnect_groups::client::Factory)
6517 }
6518
6519 /// Creates a new client from the provided stub.
6520 ///
6521 /// The most common case for calling this function is in tests mocking the
6522 /// client's behavior.
6523 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6524 where
6525 T: super::stub::InterconnectGroups + 'static,
6526 {
6527 Self { inner: stub.into() }
6528 }
6529
6530 pub(crate) async fn new(
6531 config: gaxi::options::ClientConfig,
6532 ) -> crate::ClientBuilderResult<Self> {
6533 let inner = Self::build_inner(config).await?;
6534 Ok(Self { inner })
6535 }
6536
6537 async fn build_inner(
6538 conf: gaxi::options::ClientConfig,
6539 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectGroups>>
6540 {
6541 if gaxi::options::tracing_enabled(&conf) {
6542 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6543 }
6544 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6545 }
6546
6547 async fn build_transport(
6548 conf: gaxi::options::ClientConfig,
6549 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectGroups> {
6550 super::transport::InterconnectGroups::new(conf).await
6551 }
6552
6553 async fn build_with_tracing(
6554 conf: gaxi::options::ClientConfig,
6555 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectGroups> {
6556 Self::build_transport(conf)
6557 .await
6558 .map(super::tracing::InterconnectGroups::new)
6559 }
6560
6561 /// Create Interconnects with redundancy by creating them in a specified
6562 /// interconnect group.
6563 pub fn create_members(&self) -> super::builder::interconnect_groups::CreateMembers {
6564 super::builder::interconnect_groups::CreateMembers::new(self.inner.clone())
6565 }
6566
6567 /// Deletes the specified InterconnectGroup in the given scope
6568 pub fn delete(&self) -> super::builder::interconnect_groups::Delete {
6569 super::builder::interconnect_groups::Delete::new(self.inner.clone())
6570 }
6571
6572 /// Returns the specified InterconnectGroup resource in the given scope.
6573 pub fn get(&self) -> super::builder::interconnect_groups::Get {
6574 super::builder::interconnect_groups::Get::new(self.inner.clone())
6575 }
6576
6577 /// Gets the access control policy for a resource. May be empty if no such
6578 /// policy or resource exists.
6579 pub fn get_iam_policy(&self) -> super::builder::interconnect_groups::GetIamPolicy {
6580 super::builder::interconnect_groups::GetIamPolicy::new(self.inner.clone())
6581 }
6582
6583 /// Returns the interconnectStatuses for the specified
6584 /// InterconnectGroup.
6585 pub fn get_operational_status(
6586 &self,
6587 ) -> super::builder::interconnect_groups::GetOperationalStatus {
6588 super::builder::interconnect_groups::GetOperationalStatus::new(self.inner.clone())
6589 }
6590
6591 /// Creates a InterconnectGroup in the specified project in the given scope
6592 /// using the parameters that are included in the request.
6593 pub fn insert(&self) -> super::builder::interconnect_groups::Insert {
6594 super::builder::interconnect_groups::Insert::new(self.inner.clone())
6595 }
6596
6597 /// Lists the InterconnectGroups for a project in the given scope.
6598 pub fn list(&self) -> super::builder::interconnect_groups::List {
6599 super::builder::interconnect_groups::List::new(self.inner.clone())
6600 }
6601
6602 /// Patches the specified InterconnectGroup resource with the data included in
6603 /// the request. This method supports PATCH
6604 /// semantics and usesJSON merge
6605 /// patch format and processing rules.
6606 pub fn patch(&self) -> super::builder::interconnect_groups::Patch {
6607 super::builder::interconnect_groups::Patch::new(self.inner.clone())
6608 }
6609
6610 /// Sets the access control policy on the specified resource.
6611 /// Replaces any existing policy.
6612 pub fn set_iam_policy(&self) -> super::builder::interconnect_groups::SetIamPolicy {
6613 super::builder::interconnect_groups::SetIamPolicy::new(self.inner.clone())
6614 }
6615
6616 /// Returns permissions that a caller has on the specified resource.
6617 pub fn test_iam_permissions(&self) -> super::builder::interconnect_groups::TestIamPermissions {
6618 super::builder::interconnect_groups::TestIamPermissions::new(self.inner.clone())
6619 }
6620
6621 /// Retrieves the specified Operations resource.
6622 pub fn get_operation(&self) -> super::builder::interconnect_groups::GetOperation {
6623 super::builder::interconnect_groups::GetOperation::new(self.inner.clone())
6624 }
6625}
6626
6627/// Implements a client for the Google Compute Engine API.
6628///
6629/// # Example
6630/// ```
6631/// # use google_cloud_compute_v1::client::InterconnectLocations;
6632/// async fn sample(
6633/// ) -> anyhow::Result<()> {
6634/// let client = InterconnectLocations::builder().build().await?;
6635/// // use `client` to make requests to the Google Compute Engine API.
6636/// Ok(())
6637/// }
6638/// ```
6639///
6640/// # Service Description
6641///
6642/// Service for the `interconnectLocations` resource.
6643///
6644/// # Configuration
6645///
6646/// To configure `InterconnectLocations` use the `with_*` methods in the type returned
6647/// by [builder()][InterconnectLocations::builder]. The default configuration should
6648/// work for most applications. Common configuration changes include
6649///
6650/// * [with_endpoint()]: by default this client uses the global default endpoint
6651/// (`https://compute.googleapis.com`). Applications using regional
6652/// endpoints or running in restricted networks (e.g. a network configured
6653/// with [Private Google Access with VPC Service Controls]) may want to
6654/// override this default.
6655/// * [with_credentials()]: by default this client uses
6656/// [Application Default Credentials]. Applications using custom
6657/// authentication may need to override this default.
6658///
6659/// [with_endpoint()]: super::builder::interconnect_locations::ClientBuilder::with_endpoint
6660/// [with_credentials()]: super::builder::interconnect_locations::ClientBuilder::with_credentials
6661/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6662/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6663///
6664/// # Pooling and Cloning
6665///
6666/// `InterconnectLocations` holds a connection pool internally, it is advised to
6667/// create one and reuse it. You do not need to wrap `InterconnectLocations` in
6668/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6669/// already uses an `Arc` internally.
6670#[cfg(feature = "interconnect-locations")]
6671#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-locations")))]
6672#[derive(Clone, Debug)]
6673pub struct InterconnectLocations {
6674 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>,
6675}
6676
6677#[cfg(feature = "interconnect-locations")]
6678impl InterconnectLocations {
6679 /// Returns a builder for [InterconnectLocations].
6680 ///
6681 /// ```
6682 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6683 /// # use google_cloud_compute_v1::client::InterconnectLocations;
6684 /// let client = InterconnectLocations::builder().build().await?;
6685 /// # Ok(()) }
6686 /// ```
6687 pub fn builder() -> super::builder::interconnect_locations::ClientBuilder {
6688 crate::new_client_builder(super::builder::interconnect_locations::client::Factory)
6689 }
6690
6691 /// Creates a new client from the provided stub.
6692 ///
6693 /// The most common case for calling this function is in tests mocking the
6694 /// client's behavior.
6695 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6696 where
6697 T: super::stub::InterconnectLocations + 'static,
6698 {
6699 Self { inner: stub.into() }
6700 }
6701
6702 pub(crate) async fn new(
6703 config: gaxi::options::ClientConfig,
6704 ) -> crate::ClientBuilderResult<Self> {
6705 let inner = Self::build_inner(config).await?;
6706 Ok(Self { inner })
6707 }
6708
6709 async fn build_inner(
6710 conf: gaxi::options::ClientConfig,
6711 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::InterconnectLocations>>
6712 {
6713 if gaxi::options::tracing_enabled(&conf) {
6714 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6715 }
6716 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6717 }
6718
6719 async fn build_transport(
6720 conf: gaxi::options::ClientConfig,
6721 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectLocations> {
6722 super::transport::InterconnectLocations::new(conf).await
6723 }
6724
6725 async fn build_with_tracing(
6726 conf: gaxi::options::ClientConfig,
6727 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectLocations> {
6728 Self::build_transport(conf)
6729 .await
6730 .map(super::tracing::InterconnectLocations::new)
6731 }
6732
6733 /// Returns the details for the specified interconnect location. Gets a list of
6734 /// available interconnect locations by making a list() request.
6735 pub fn get(&self) -> super::builder::interconnect_locations::Get {
6736 super::builder::interconnect_locations::Get::new(self.inner.clone())
6737 }
6738
6739 /// Retrieves the list of interconnect locations available to the specified
6740 /// project.
6741 pub fn list(&self) -> super::builder::interconnect_locations::List {
6742 super::builder::interconnect_locations::List::new(self.inner.clone())
6743 }
6744}
6745
6746/// Implements a client for the Google Compute Engine API.
6747///
6748/// # Example
6749/// ```
6750/// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6751/// async fn sample(
6752/// ) -> anyhow::Result<()> {
6753/// let client = InterconnectRemoteLocations::builder().build().await?;
6754/// // use `client` to make requests to the Google Compute Engine API.
6755/// Ok(())
6756/// }
6757/// ```
6758///
6759/// # Service Description
6760///
6761/// Service for the `interconnectRemoteLocations` resource.
6762///
6763/// # Configuration
6764///
6765/// To configure `InterconnectRemoteLocations` use the `with_*` methods in the type returned
6766/// by [builder()][InterconnectRemoteLocations::builder]. The default configuration should
6767/// work for most applications. Common configuration changes include
6768///
6769/// * [with_endpoint()]: by default this client uses the global default endpoint
6770/// (`https://compute.googleapis.com`). Applications using regional
6771/// endpoints or running in restricted networks (e.g. a network configured
6772/// with [Private Google Access with VPC Service Controls]) may want to
6773/// override this default.
6774/// * [with_credentials()]: by default this client uses
6775/// [Application Default Credentials]. Applications using custom
6776/// authentication may need to override this default.
6777///
6778/// [with_endpoint()]: super::builder::interconnect_remote_locations::ClientBuilder::with_endpoint
6779/// [with_credentials()]: super::builder::interconnect_remote_locations::ClientBuilder::with_credentials
6780/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6781/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6782///
6783/// # Pooling and Cloning
6784///
6785/// `InterconnectRemoteLocations` holds a connection pool internally, it is advised to
6786/// create one and reuse it. You do not need to wrap `InterconnectRemoteLocations` in
6787/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6788/// already uses an `Arc` internally.
6789#[cfg(feature = "interconnect-remote-locations")]
6790#[cfg_attr(docsrs, doc(cfg(feature = "interconnect-remote-locations")))]
6791#[derive(Clone, Debug)]
6792pub struct InterconnectRemoteLocations {
6793 inner: std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6794}
6795
6796#[cfg(feature = "interconnect-remote-locations")]
6797impl InterconnectRemoteLocations {
6798 /// Returns a builder for [InterconnectRemoteLocations].
6799 ///
6800 /// ```
6801 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6802 /// # use google_cloud_compute_v1::client::InterconnectRemoteLocations;
6803 /// let client = InterconnectRemoteLocations::builder().build().await?;
6804 /// # Ok(()) }
6805 /// ```
6806 pub fn builder() -> super::builder::interconnect_remote_locations::ClientBuilder {
6807 crate::new_client_builder(super::builder::interconnect_remote_locations::client::Factory)
6808 }
6809
6810 /// Creates a new client from the provided stub.
6811 ///
6812 /// The most common case for calling this function is in tests mocking the
6813 /// client's behavior.
6814 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6815 where
6816 T: super::stub::InterconnectRemoteLocations + 'static,
6817 {
6818 Self { inner: stub.into() }
6819 }
6820
6821 pub(crate) async fn new(
6822 config: gaxi::options::ClientConfig,
6823 ) -> crate::ClientBuilderResult<Self> {
6824 let inner = Self::build_inner(config).await?;
6825 Ok(Self { inner })
6826 }
6827
6828 async fn build_inner(
6829 conf: gaxi::options::ClientConfig,
6830 ) -> crate::ClientBuilderResult<
6831 std::sync::Arc<dyn super::stub::dynamic::InterconnectRemoteLocations>,
6832 > {
6833 if gaxi::options::tracing_enabled(&conf) {
6834 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6835 }
6836 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6837 }
6838
6839 async fn build_transport(
6840 conf: gaxi::options::ClientConfig,
6841 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectRemoteLocations> {
6842 super::transport::InterconnectRemoteLocations::new(conf).await
6843 }
6844
6845 async fn build_with_tracing(
6846 conf: gaxi::options::ClientConfig,
6847 ) -> crate::ClientBuilderResult<impl super::stub::InterconnectRemoteLocations> {
6848 Self::build_transport(conf)
6849 .await
6850 .map(super::tracing::InterconnectRemoteLocations::new)
6851 }
6852
6853 /// Returns the details for the specified interconnect remote location. Gets a
6854 /// list of available interconnect remote locations by making alist() request.
6855 pub fn get(&self) -> super::builder::interconnect_remote_locations::Get {
6856 super::builder::interconnect_remote_locations::Get::new(self.inner.clone())
6857 }
6858
6859 /// Retrieves the list of interconnect remote locations available to the
6860 /// specified project.
6861 pub fn list(&self) -> super::builder::interconnect_remote_locations::List {
6862 super::builder::interconnect_remote_locations::List::new(self.inner.clone())
6863 }
6864}
6865
6866/// Implements a client for the Google Compute Engine API.
6867///
6868/// # Example
6869/// ```
6870/// # use google_cloud_compute_v1::client::Interconnects;
6871/// async fn sample(
6872/// ) -> anyhow::Result<()> {
6873/// let client = Interconnects::builder().build().await?;
6874/// // use `client` to make requests to the Google Compute Engine API.
6875/// Ok(())
6876/// }
6877/// ```
6878///
6879/// # Service Description
6880///
6881/// Service for the `interconnects` resource.
6882///
6883/// # Configuration
6884///
6885/// To configure `Interconnects` use the `with_*` methods in the type returned
6886/// by [builder()][Interconnects::builder]. The default configuration should
6887/// work for most applications. Common configuration changes include
6888///
6889/// * [with_endpoint()]: by default this client uses the global default endpoint
6890/// (`https://compute.googleapis.com`). Applications using regional
6891/// endpoints or running in restricted networks (e.g. a network configured
6892/// with [Private Google Access with VPC Service Controls]) may want to
6893/// override this default.
6894/// * [with_credentials()]: by default this client uses
6895/// [Application Default Credentials]. Applications using custom
6896/// authentication may need to override this default.
6897///
6898/// [with_endpoint()]: super::builder::interconnects::ClientBuilder::with_endpoint
6899/// [with_credentials()]: super::builder::interconnects::ClientBuilder::with_credentials
6900/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
6901/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
6902///
6903/// # Pooling and Cloning
6904///
6905/// `Interconnects` holds a connection pool internally, it is advised to
6906/// create one and reuse it. You do not need to wrap `Interconnects` in
6907/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
6908/// already uses an `Arc` internally.
6909#[cfg(feature = "interconnects")]
6910#[cfg_attr(docsrs, doc(cfg(feature = "interconnects")))]
6911#[derive(Clone, Debug)]
6912pub struct Interconnects {
6913 inner: std::sync::Arc<dyn super::stub::dynamic::Interconnects>,
6914}
6915
6916#[cfg(feature = "interconnects")]
6917impl Interconnects {
6918 /// Returns a builder for [Interconnects].
6919 ///
6920 /// ```
6921 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6922 /// # use google_cloud_compute_v1::client::Interconnects;
6923 /// let client = Interconnects::builder().build().await?;
6924 /// # Ok(()) }
6925 /// ```
6926 pub fn builder() -> super::builder::interconnects::ClientBuilder {
6927 crate::new_client_builder(super::builder::interconnects::client::Factory)
6928 }
6929
6930 /// Creates a new client from the provided stub.
6931 ///
6932 /// The most common case for calling this function is in tests mocking the
6933 /// client's behavior.
6934 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
6935 where
6936 T: super::stub::Interconnects + 'static,
6937 {
6938 Self { inner: stub.into() }
6939 }
6940
6941 pub(crate) async fn new(
6942 config: gaxi::options::ClientConfig,
6943 ) -> crate::ClientBuilderResult<Self> {
6944 let inner = Self::build_inner(config).await?;
6945 Ok(Self { inner })
6946 }
6947
6948 async fn build_inner(
6949 conf: gaxi::options::ClientConfig,
6950 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Interconnects>> {
6951 if gaxi::options::tracing_enabled(&conf) {
6952 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
6953 }
6954 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
6955 }
6956
6957 async fn build_transport(
6958 conf: gaxi::options::ClientConfig,
6959 ) -> crate::ClientBuilderResult<impl super::stub::Interconnects> {
6960 super::transport::Interconnects::new(conf).await
6961 }
6962
6963 async fn build_with_tracing(
6964 conf: gaxi::options::ClientConfig,
6965 ) -> crate::ClientBuilderResult<impl super::stub::Interconnects> {
6966 Self::build_transport(conf)
6967 .await
6968 .map(super::tracing::Interconnects::new)
6969 }
6970
6971 /// Deletes the specified Interconnect.
6972 pub fn delete(&self) -> super::builder::interconnects::Delete {
6973 super::builder::interconnects::Delete::new(self.inner.clone())
6974 }
6975
6976 /// Returns the specified Interconnect. Get a list of available Interconnects
6977 /// by making a list() request.
6978 pub fn get(&self) -> super::builder::interconnects::Get {
6979 super::builder::interconnects::Get::new(self.inner.clone())
6980 }
6981
6982 /// Returns the interconnectDiagnostics for the specified
6983 /// Interconnect.
6984 ///
6985 /// In the event of a
6986 /// global outage, do not use this API to make decisions about where to
6987 /// redirect your network traffic.
6988 ///
6989 /// Unlike a VLAN attachment, which is regional, a Cloud Interconnect
6990 /// connection is a global resource. A global outage can prevent this
6991 /// API from functioning properly.
6992 pub fn get_diagnostics(&self) -> super::builder::interconnects::GetDiagnostics {
6993 super::builder::interconnects::GetDiagnostics::new(self.inner.clone())
6994 }
6995
6996 /// Returns the interconnectMacsecConfig for the specified
6997 /// Interconnect.
6998 pub fn get_macsec_config(&self) -> super::builder::interconnects::GetMacsecConfig {
6999 super::builder::interconnects::GetMacsecConfig::new(self.inner.clone())
7000 }
7001
7002 /// Creates an Interconnect in the specified project using
7003 /// the data included in the request.
7004 pub fn insert(&self) -> super::builder::interconnects::Insert {
7005 super::builder::interconnects::Insert::new(self.inner.clone())
7006 }
7007
7008 /// Retrieves the list of Interconnects available to the specified project.
7009 pub fn list(&self) -> super::builder::interconnects::List {
7010 super::builder::interconnects::List::new(self.inner.clone())
7011 }
7012
7013 /// Updates the specified Interconnect with the data included in the request.
7014 /// This method supportsPATCH
7015 /// semantics and uses theJSON merge
7016 /// patch format and processing rules.
7017 pub fn patch(&self) -> super::builder::interconnects::Patch {
7018 super::builder::interconnects::Patch::new(self.inner.clone())
7019 }
7020
7021 /// Sets the labels on an Interconnect. To learn more about labels,
7022 /// read the Labeling
7023 /// Resources documentation.
7024 pub fn set_labels(&self) -> super::builder::interconnects::SetLabels {
7025 super::builder::interconnects::SetLabels::new(self.inner.clone())
7026 }
7027
7028 /// Retrieves the specified Operations resource.
7029 pub fn get_operation(&self) -> super::builder::interconnects::GetOperation {
7030 super::builder::interconnects::GetOperation::new(self.inner.clone())
7031 }
7032}
7033
7034/// Implements a client for the Google Compute Engine API.
7035///
7036/// # Example
7037/// ```
7038/// # use google_cloud_compute_v1::client::LicenseCodes;
7039/// async fn sample(
7040/// ) -> anyhow::Result<()> {
7041/// let client = LicenseCodes::builder().build().await?;
7042/// // use `client` to make requests to the Google Compute Engine API.
7043/// Ok(())
7044/// }
7045/// ```
7046///
7047/// # Service Description
7048///
7049/// Service for the `licenseCodes` resource.
7050///
7051/// # Configuration
7052///
7053/// To configure `LicenseCodes` use the `with_*` methods in the type returned
7054/// by [builder()][LicenseCodes::builder]. The default configuration should
7055/// work for most applications. Common configuration changes include
7056///
7057/// * [with_endpoint()]: by default this client uses the global default endpoint
7058/// (`https://compute.googleapis.com`). Applications using regional
7059/// endpoints or running in restricted networks (e.g. a network configured
7060/// with [Private Google Access with VPC Service Controls]) may want to
7061/// override this default.
7062/// * [with_credentials()]: by default this client uses
7063/// [Application Default Credentials]. Applications using custom
7064/// authentication may need to override this default.
7065///
7066/// [with_endpoint()]: super::builder::license_codes::ClientBuilder::with_endpoint
7067/// [with_credentials()]: super::builder::license_codes::ClientBuilder::with_credentials
7068/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7069/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7070///
7071/// # Pooling and Cloning
7072///
7073/// `LicenseCodes` holds a connection pool internally, it is advised to
7074/// create one and reuse it. You do not need to wrap `LicenseCodes` in
7075/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7076/// already uses an `Arc` internally.
7077#[cfg(feature = "license-codes")]
7078#[cfg_attr(docsrs, doc(cfg(feature = "license-codes")))]
7079#[derive(Clone, Debug)]
7080pub struct LicenseCodes {
7081 inner: std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>,
7082}
7083
7084#[cfg(feature = "license-codes")]
7085impl LicenseCodes {
7086 /// Returns a builder for [LicenseCodes].
7087 ///
7088 /// ```
7089 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7090 /// # use google_cloud_compute_v1::client::LicenseCodes;
7091 /// let client = LicenseCodes::builder().build().await?;
7092 /// # Ok(()) }
7093 /// ```
7094 pub fn builder() -> super::builder::license_codes::ClientBuilder {
7095 crate::new_client_builder(super::builder::license_codes::client::Factory)
7096 }
7097
7098 /// Creates a new client from the provided stub.
7099 ///
7100 /// The most common case for calling this function is in tests mocking the
7101 /// client's behavior.
7102 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7103 where
7104 T: super::stub::LicenseCodes + 'static,
7105 {
7106 Self { inner: stub.into() }
7107 }
7108
7109 pub(crate) async fn new(
7110 config: gaxi::options::ClientConfig,
7111 ) -> crate::ClientBuilderResult<Self> {
7112 let inner = Self::build_inner(config).await?;
7113 Ok(Self { inner })
7114 }
7115
7116 async fn build_inner(
7117 conf: gaxi::options::ClientConfig,
7118 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::LicenseCodes>> {
7119 if gaxi::options::tracing_enabled(&conf) {
7120 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7121 }
7122 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7123 }
7124
7125 async fn build_transport(
7126 conf: gaxi::options::ClientConfig,
7127 ) -> crate::ClientBuilderResult<impl super::stub::LicenseCodes> {
7128 super::transport::LicenseCodes::new(conf).await
7129 }
7130
7131 async fn build_with_tracing(
7132 conf: gaxi::options::ClientConfig,
7133 ) -> crate::ClientBuilderResult<impl super::stub::LicenseCodes> {
7134 Self::build_transport(conf)
7135 .await
7136 .map(super::tracing::LicenseCodes::new)
7137 }
7138
7139 /// Return a specified license code. License codes are mirrored across
7140 /// all projects that have permissions to read the License Code.
7141 /// *Caution* This resource is intended
7142 /// for use only by third-party partners who are creatingCloud Marketplace
7143 /// images.
7144 pub fn get(&self) -> super::builder::license_codes::Get {
7145 super::builder::license_codes::Get::new(self.inner.clone())
7146 }
7147
7148 /// Gets the access control policy for a resource. May be empty if no such
7149 /// policy or resource exists.
7150 /// *Caution* This resource is intended
7151 /// for use only by third-party partners who are creatingCloud Marketplace
7152 /// images.
7153 pub fn get_iam_policy(&self) -> super::builder::license_codes::GetIamPolicy {
7154 super::builder::license_codes::GetIamPolicy::new(self.inner.clone())
7155 }
7156
7157 /// Sets the access control policy on the specified resource.
7158 /// Replaces any existing policy.
7159 /// *Caution* This resource is intended
7160 /// for use only by third-party partners who are creatingCloud Marketplace
7161 /// images.
7162 pub fn set_iam_policy(&self) -> super::builder::license_codes::SetIamPolicy {
7163 super::builder::license_codes::SetIamPolicy::new(self.inner.clone())
7164 }
7165
7166 /// Returns permissions that a caller has on the specified resource.
7167 /// *Caution* This resource is intended
7168 /// for use only by third-party partners who are creatingCloud Marketplace
7169 /// images.
7170 pub fn test_iam_permissions(&self) -> super::builder::license_codes::TestIamPermissions {
7171 super::builder::license_codes::TestIamPermissions::new(self.inner.clone())
7172 }
7173}
7174
7175/// Implements a client for the Google Compute Engine API.
7176///
7177/// # Example
7178/// ```
7179/// # use google_cloud_compute_v1::client::Licenses;
7180/// async fn sample(
7181/// ) -> anyhow::Result<()> {
7182/// let client = Licenses::builder().build().await?;
7183/// // use `client` to make requests to the Google Compute Engine API.
7184/// Ok(())
7185/// }
7186/// ```
7187///
7188/// # Service Description
7189///
7190/// Service for the `licenses` resource.
7191///
7192/// # Configuration
7193///
7194/// To configure `Licenses` use the `with_*` methods in the type returned
7195/// by [builder()][Licenses::builder]. The default configuration should
7196/// work for most applications. Common configuration changes include
7197///
7198/// * [with_endpoint()]: by default this client uses the global default endpoint
7199/// (`https://compute.googleapis.com`). Applications using regional
7200/// endpoints or running in restricted networks (e.g. a network configured
7201/// with [Private Google Access with VPC Service Controls]) may want to
7202/// override this default.
7203/// * [with_credentials()]: by default this client uses
7204/// [Application Default Credentials]. Applications using custom
7205/// authentication may need to override this default.
7206///
7207/// [with_endpoint()]: super::builder::licenses::ClientBuilder::with_endpoint
7208/// [with_credentials()]: super::builder::licenses::ClientBuilder::with_credentials
7209/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7210/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7211///
7212/// # Pooling and Cloning
7213///
7214/// `Licenses` holds a connection pool internally, it is advised to
7215/// create one and reuse it. You do not need to wrap `Licenses` in
7216/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7217/// already uses an `Arc` internally.
7218#[cfg(feature = "licenses")]
7219#[cfg_attr(docsrs, doc(cfg(feature = "licenses")))]
7220#[derive(Clone, Debug)]
7221pub struct Licenses {
7222 inner: std::sync::Arc<dyn super::stub::dynamic::Licenses>,
7223}
7224
7225#[cfg(feature = "licenses")]
7226impl Licenses {
7227 /// Returns a builder for [Licenses].
7228 ///
7229 /// ```
7230 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7231 /// # use google_cloud_compute_v1::client::Licenses;
7232 /// let client = Licenses::builder().build().await?;
7233 /// # Ok(()) }
7234 /// ```
7235 pub fn builder() -> super::builder::licenses::ClientBuilder {
7236 crate::new_client_builder(super::builder::licenses::client::Factory)
7237 }
7238
7239 /// Creates a new client from the provided stub.
7240 ///
7241 /// The most common case for calling this function is in tests mocking the
7242 /// client's behavior.
7243 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7244 where
7245 T: super::stub::Licenses + 'static,
7246 {
7247 Self { inner: stub.into() }
7248 }
7249
7250 pub(crate) async fn new(
7251 config: gaxi::options::ClientConfig,
7252 ) -> crate::ClientBuilderResult<Self> {
7253 let inner = Self::build_inner(config).await?;
7254 Ok(Self { inner })
7255 }
7256
7257 async fn build_inner(
7258 conf: gaxi::options::ClientConfig,
7259 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Licenses>> {
7260 if gaxi::options::tracing_enabled(&conf) {
7261 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7262 }
7263 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7264 }
7265
7266 async fn build_transport(
7267 conf: gaxi::options::ClientConfig,
7268 ) -> crate::ClientBuilderResult<impl super::stub::Licenses> {
7269 super::transport::Licenses::new(conf).await
7270 }
7271
7272 async fn build_with_tracing(
7273 conf: gaxi::options::ClientConfig,
7274 ) -> crate::ClientBuilderResult<impl super::stub::Licenses> {
7275 Self::build_transport(conf)
7276 .await
7277 .map(super::tracing::Licenses::new)
7278 }
7279
7280 /// Deletes the specified license.
7281 /// *Caution* This resource is intended
7282 /// for use only by third-party partners who are creatingCloud Marketplace
7283 /// images.
7284 pub fn delete(&self) -> super::builder::licenses::Delete {
7285 super::builder::licenses::Delete::new(self.inner.clone())
7286 }
7287
7288 /// Returns the specified License resource.
7289 /// *Caution* This resource is intended
7290 /// for use only by third-party partners who are creatingCloud Marketplace
7291 /// images.
7292 pub fn get(&self) -> super::builder::licenses::Get {
7293 super::builder::licenses::Get::new(self.inner.clone())
7294 }
7295
7296 /// Gets the access control policy for a resource. May be empty if no such
7297 /// policy or resource exists.
7298 /// *Caution* This resource is intended
7299 /// for use only by third-party partners who are creatingCloud Marketplace
7300 /// images.
7301 pub fn get_iam_policy(&self) -> super::builder::licenses::GetIamPolicy {
7302 super::builder::licenses::GetIamPolicy::new(self.inner.clone())
7303 }
7304
7305 /// Create a License resource in the specified project.
7306 /// *Caution* This resource is intended
7307 /// for use only by third-party partners who are creatingCloud Marketplace
7308 /// images.
7309 pub fn insert(&self) -> super::builder::licenses::Insert {
7310 super::builder::licenses::Insert::new(self.inner.clone())
7311 }
7312
7313 /// Retrieves the list of licenses
7314 /// available in the specified project. This method does not
7315 /// get any licenses that belong to other projects, including licenses attached
7316 /// to publicly-available images, like Debian 9. If you want to get a list of
7317 /// publicly-available licenses, use this method to make a request to the
7318 /// respective image project, such as debian-cloud orwindows-cloud.
7319 /// *Caution* This resource is intended
7320 /// for use only by third-party partners who are creatingCloud Marketplace
7321 /// images.
7322 pub fn list(&self) -> super::builder::licenses::List {
7323 super::builder::licenses::List::new(self.inner.clone())
7324 }
7325
7326 /// Sets the access control policy on the specified resource.
7327 /// Replaces any existing policy.
7328 /// *Caution* This resource is intended
7329 /// for use only by third-party partners who are creatingCloud Marketplace
7330 /// images.
7331 pub fn set_iam_policy(&self) -> super::builder::licenses::SetIamPolicy {
7332 super::builder::licenses::SetIamPolicy::new(self.inner.clone())
7333 }
7334
7335 /// Returns permissions that a caller has on the specified resource.
7336 /// *Caution* This resource is intended
7337 /// for use only by third-party partners who are creatingCloud Marketplace
7338 /// images.
7339 pub fn test_iam_permissions(&self) -> super::builder::licenses::TestIamPermissions {
7340 super::builder::licenses::TestIamPermissions::new(self.inner.clone())
7341 }
7342
7343 /// Updates a License resource in the specified project.
7344 /// *Caution* This resource is intended
7345 /// for use only by third-party partners who are creatingCloud Marketplace
7346 /// images.
7347 pub fn update(&self) -> super::builder::licenses::Update {
7348 super::builder::licenses::Update::new(self.inner.clone())
7349 }
7350
7351 /// Retrieves the specified Operations resource.
7352 pub fn get_operation(&self) -> super::builder::licenses::GetOperation {
7353 super::builder::licenses::GetOperation::new(self.inner.clone())
7354 }
7355}
7356
7357/// Implements a client for the Google Compute Engine API.
7358///
7359/// # Example
7360/// ```
7361/// # use google_cloud_compute_v1::client::MachineImages;
7362/// async fn sample(
7363/// ) -> anyhow::Result<()> {
7364/// let client = MachineImages::builder().build().await?;
7365/// // use `client` to make requests to the Google Compute Engine API.
7366/// Ok(())
7367/// }
7368/// ```
7369///
7370/// # Service Description
7371///
7372/// Service for the `machineImages` resource.
7373///
7374/// # Configuration
7375///
7376/// To configure `MachineImages` use the `with_*` methods in the type returned
7377/// by [builder()][MachineImages::builder]. The default configuration should
7378/// work for most applications. Common configuration changes include
7379///
7380/// * [with_endpoint()]: by default this client uses the global default endpoint
7381/// (`https://compute.googleapis.com`). Applications using regional
7382/// endpoints or running in restricted networks (e.g. a network configured
7383/// with [Private Google Access with VPC Service Controls]) may want to
7384/// override this default.
7385/// * [with_credentials()]: by default this client uses
7386/// [Application Default Credentials]. Applications using custom
7387/// authentication may need to override this default.
7388///
7389/// [with_endpoint()]: super::builder::machine_images::ClientBuilder::with_endpoint
7390/// [with_credentials()]: super::builder::machine_images::ClientBuilder::with_credentials
7391/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7392/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7393///
7394/// # Pooling and Cloning
7395///
7396/// `MachineImages` holds a connection pool internally, it is advised to
7397/// create one and reuse it. You do not need to wrap `MachineImages` in
7398/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7399/// already uses an `Arc` internally.
7400#[cfg(feature = "machine-images")]
7401#[cfg_attr(docsrs, doc(cfg(feature = "machine-images")))]
7402#[derive(Clone, Debug)]
7403pub struct MachineImages {
7404 inner: std::sync::Arc<dyn super::stub::dynamic::MachineImages>,
7405}
7406
7407#[cfg(feature = "machine-images")]
7408impl MachineImages {
7409 /// Returns a builder for [MachineImages].
7410 ///
7411 /// ```
7412 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7413 /// # use google_cloud_compute_v1::client::MachineImages;
7414 /// let client = MachineImages::builder().build().await?;
7415 /// # Ok(()) }
7416 /// ```
7417 pub fn builder() -> super::builder::machine_images::ClientBuilder {
7418 crate::new_client_builder(super::builder::machine_images::client::Factory)
7419 }
7420
7421 /// Creates a new client from the provided stub.
7422 ///
7423 /// The most common case for calling this function is in tests mocking the
7424 /// client's behavior.
7425 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7426 where
7427 T: super::stub::MachineImages + 'static,
7428 {
7429 Self { inner: stub.into() }
7430 }
7431
7432 pub(crate) async fn new(
7433 config: gaxi::options::ClientConfig,
7434 ) -> crate::ClientBuilderResult<Self> {
7435 let inner = Self::build_inner(config).await?;
7436 Ok(Self { inner })
7437 }
7438
7439 async fn build_inner(
7440 conf: gaxi::options::ClientConfig,
7441 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MachineImages>> {
7442 if gaxi::options::tracing_enabled(&conf) {
7443 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7444 }
7445 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7446 }
7447
7448 async fn build_transport(
7449 conf: gaxi::options::ClientConfig,
7450 ) -> crate::ClientBuilderResult<impl super::stub::MachineImages> {
7451 super::transport::MachineImages::new(conf).await
7452 }
7453
7454 async fn build_with_tracing(
7455 conf: gaxi::options::ClientConfig,
7456 ) -> crate::ClientBuilderResult<impl super::stub::MachineImages> {
7457 Self::build_transport(conf)
7458 .await
7459 .map(super::tracing::MachineImages::new)
7460 }
7461
7462 /// Deletes the specified machine image. Deleting a machine image is permanent
7463 /// and cannot be undone.
7464 pub fn delete(&self) -> super::builder::machine_images::Delete {
7465 super::builder::machine_images::Delete::new(self.inner.clone())
7466 }
7467
7468 /// Returns the specified machine image.
7469 pub fn get(&self) -> super::builder::machine_images::Get {
7470 super::builder::machine_images::Get::new(self.inner.clone())
7471 }
7472
7473 /// Gets the access control policy for a resource. May be empty if no such
7474 /// policy or resource exists.
7475 pub fn get_iam_policy(&self) -> super::builder::machine_images::GetIamPolicy {
7476 super::builder::machine_images::GetIamPolicy::new(self.inner.clone())
7477 }
7478
7479 /// Creates a machine image in the specified project using the
7480 /// data that is included in the request. If you are creating a new machine
7481 /// image to update an existing instance, your new machine image should use the
7482 /// same network or, if applicable, the same subnetwork as the original
7483 /// instance.
7484 pub fn insert(&self) -> super::builder::machine_images::Insert {
7485 super::builder::machine_images::Insert::new(self.inner.clone())
7486 }
7487
7488 /// Retrieves a list of machine images that are contained within
7489 /// the specified project.
7490 pub fn list(&self) -> super::builder::machine_images::List {
7491 super::builder::machine_images::List::new(self.inner.clone())
7492 }
7493
7494 /// Sets the access control policy on the specified resource.
7495 /// Replaces any existing policy.
7496 pub fn set_iam_policy(&self) -> super::builder::machine_images::SetIamPolicy {
7497 super::builder::machine_images::SetIamPolicy::new(self.inner.clone())
7498 }
7499
7500 /// Sets the labels on a machine image. To learn more about labels, read theLabeling
7501 /// Resources documentation.
7502 pub fn set_labels(&self) -> super::builder::machine_images::SetLabels {
7503 super::builder::machine_images::SetLabels::new(self.inner.clone())
7504 }
7505
7506 /// Returns permissions that a caller has on the specified resource.
7507 pub fn test_iam_permissions(&self) -> super::builder::machine_images::TestIamPermissions {
7508 super::builder::machine_images::TestIamPermissions::new(self.inner.clone())
7509 }
7510
7511 /// Retrieves the specified Operations resource.
7512 pub fn get_operation(&self) -> super::builder::machine_images::GetOperation {
7513 super::builder::machine_images::GetOperation::new(self.inner.clone())
7514 }
7515}
7516
7517/// Implements a client for the Google Compute Engine API.
7518///
7519/// # Example
7520/// ```
7521/// # use google_cloud_compute_v1::client::MachineTypes;
7522/// async fn sample(
7523/// ) -> anyhow::Result<()> {
7524/// let client = MachineTypes::builder().build().await?;
7525/// // use `client` to make requests to the Google Compute Engine API.
7526/// Ok(())
7527/// }
7528/// ```
7529///
7530/// # Service Description
7531///
7532/// Service for the `machineTypes` resource.
7533///
7534/// # Configuration
7535///
7536/// To configure `MachineTypes` use the `with_*` methods in the type returned
7537/// by [builder()][MachineTypes::builder]. The default configuration should
7538/// work for most applications. Common configuration changes include
7539///
7540/// * [with_endpoint()]: by default this client uses the global default endpoint
7541/// (`https://compute.googleapis.com`). Applications using regional
7542/// endpoints or running in restricted networks (e.g. a network configured
7543/// with [Private Google Access with VPC Service Controls]) may want to
7544/// override this default.
7545/// * [with_credentials()]: by default this client uses
7546/// [Application Default Credentials]. Applications using custom
7547/// authentication may need to override this default.
7548///
7549/// [with_endpoint()]: super::builder::machine_types::ClientBuilder::with_endpoint
7550/// [with_credentials()]: super::builder::machine_types::ClientBuilder::with_credentials
7551/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7552/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7553///
7554/// # Pooling and Cloning
7555///
7556/// `MachineTypes` holds a connection pool internally, it is advised to
7557/// create one and reuse it. You do not need to wrap `MachineTypes` in
7558/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7559/// already uses an `Arc` internally.
7560#[cfg(feature = "machine-types")]
7561#[cfg_attr(docsrs, doc(cfg(feature = "machine-types")))]
7562#[derive(Clone, Debug)]
7563pub struct MachineTypes {
7564 inner: std::sync::Arc<dyn super::stub::dynamic::MachineTypes>,
7565}
7566
7567#[cfg(feature = "machine-types")]
7568impl MachineTypes {
7569 /// Returns a builder for [MachineTypes].
7570 ///
7571 /// ```
7572 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7573 /// # use google_cloud_compute_v1::client::MachineTypes;
7574 /// let client = MachineTypes::builder().build().await?;
7575 /// # Ok(()) }
7576 /// ```
7577 pub fn builder() -> super::builder::machine_types::ClientBuilder {
7578 crate::new_client_builder(super::builder::machine_types::client::Factory)
7579 }
7580
7581 /// Creates a new client from the provided stub.
7582 ///
7583 /// The most common case for calling this function is in tests mocking the
7584 /// client's behavior.
7585 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7586 where
7587 T: super::stub::MachineTypes + 'static,
7588 {
7589 Self { inner: stub.into() }
7590 }
7591
7592 pub(crate) async fn new(
7593 config: gaxi::options::ClientConfig,
7594 ) -> crate::ClientBuilderResult<Self> {
7595 let inner = Self::build_inner(config).await?;
7596 Ok(Self { inner })
7597 }
7598
7599 async fn build_inner(
7600 conf: gaxi::options::ClientConfig,
7601 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::MachineTypes>> {
7602 if gaxi::options::tracing_enabled(&conf) {
7603 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7604 }
7605 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7606 }
7607
7608 async fn build_transport(
7609 conf: gaxi::options::ClientConfig,
7610 ) -> crate::ClientBuilderResult<impl super::stub::MachineTypes> {
7611 super::transport::MachineTypes::new(conf).await
7612 }
7613
7614 async fn build_with_tracing(
7615 conf: gaxi::options::ClientConfig,
7616 ) -> crate::ClientBuilderResult<impl super::stub::MachineTypes> {
7617 Self::build_transport(conf)
7618 .await
7619 .map(super::tracing::MachineTypes::new)
7620 }
7621
7622 /// Retrieves an aggregated list of machine types.
7623 ///
7624 /// To prevent failure, Google recommends that you set the
7625 /// `returnPartialSuccess` parameter to `true`.
7626 pub fn aggregated_list(&self) -> super::builder::machine_types::AggregatedList {
7627 super::builder::machine_types::AggregatedList::new(self.inner.clone())
7628 }
7629
7630 /// Returns the specified machine type.
7631 pub fn get(&self) -> super::builder::machine_types::Get {
7632 super::builder::machine_types::Get::new(self.inner.clone())
7633 }
7634
7635 /// Retrieves a list of machine types available to the specified
7636 /// project.
7637 pub fn list(&self) -> super::builder::machine_types::List {
7638 super::builder::machine_types::List::new(self.inner.clone())
7639 }
7640}
7641
7642/// Implements a client for the Google Compute Engine API.
7643///
7644/// # Example
7645/// ```
7646/// # use google_cloud_compute_v1::client::NetworkAttachments;
7647/// async fn sample(
7648/// ) -> anyhow::Result<()> {
7649/// let client = NetworkAttachments::builder().build().await?;
7650/// // use `client` to make requests to the Google Compute Engine API.
7651/// Ok(())
7652/// }
7653/// ```
7654///
7655/// # Service Description
7656///
7657/// Service for the `networkAttachments` resource.
7658///
7659/// # Configuration
7660///
7661/// To configure `NetworkAttachments` use the `with_*` methods in the type returned
7662/// by [builder()][NetworkAttachments::builder]. The default configuration should
7663/// work for most applications. Common configuration changes include
7664///
7665/// * [with_endpoint()]: by default this client uses the global default endpoint
7666/// (`https://compute.googleapis.com`). Applications using regional
7667/// endpoints or running in restricted networks (e.g. a network configured
7668/// with [Private Google Access with VPC Service Controls]) may want to
7669/// override this default.
7670/// * [with_credentials()]: by default this client uses
7671/// [Application Default Credentials]. Applications using custom
7672/// authentication may need to override this default.
7673///
7674/// [with_endpoint()]: super::builder::network_attachments::ClientBuilder::with_endpoint
7675/// [with_credentials()]: super::builder::network_attachments::ClientBuilder::with_credentials
7676/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7677/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7678///
7679/// # Pooling and Cloning
7680///
7681/// `NetworkAttachments` holds a connection pool internally, it is advised to
7682/// create one and reuse it. You do not need to wrap `NetworkAttachments` in
7683/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7684/// already uses an `Arc` internally.
7685#[cfg(feature = "network-attachments")]
7686#[cfg_attr(docsrs, doc(cfg(feature = "network-attachments")))]
7687#[derive(Clone, Debug)]
7688pub struct NetworkAttachments {
7689 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>,
7690}
7691
7692#[cfg(feature = "network-attachments")]
7693impl NetworkAttachments {
7694 /// Returns a builder for [NetworkAttachments].
7695 ///
7696 /// ```
7697 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7698 /// # use google_cloud_compute_v1::client::NetworkAttachments;
7699 /// let client = NetworkAttachments::builder().build().await?;
7700 /// # Ok(()) }
7701 /// ```
7702 pub fn builder() -> super::builder::network_attachments::ClientBuilder {
7703 crate::new_client_builder(super::builder::network_attachments::client::Factory)
7704 }
7705
7706 /// Creates a new client from the provided stub.
7707 ///
7708 /// The most common case for calling this function is in tests mocking the
7709 /// client's behavior.
7710 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7711 where
7712 T: super::stub::NetworkAttachments + 'static,
7713 {
7714 Self { inner: stub.into() }
7715 }
7716
7717 pub(crate) async fn new(
7718 config: gaxi::options::ClientConfig,
7719 ) -> crate::ClientBuilderResult<Self> {
7720 let inner = Self::build_inner(config).await?;
7721 Ok(Self { inner })
7722 }
7723
7724 async fn build_inner(
7725 conf: gaxi::options::ClientConfig,
7726 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkAttachments>>
7727 {
7728 if gaxi::options::tracing_enabled(&conf) {
7729 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7730 }
7731 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7732 }
7733
7734 async fn build_transport(
7735 conf: gaxi::options::ClientConfig,
7736 ) -> crate::ClientBuilderResult<impl super::stub::NetworkAttachments> {
7737 super::transport::NetworkAttachments::new(conf).await
7738 }
7739
7740 async fn build_with_tracing(
7741 conf: gaxi::options::ClientConfig,
7742 ) -> crate::ClientBuilderResult<impl super::stub::NetworkAttachments> {
7743 Self::build_transport(conf)
7744 .await
7745 .map(super::tracing::NetworkAttachments::new)
7746 }
7747
7748 /// Retrieves the list of all NetworkAttachment resources,
7749 /// regional and global, available to the specified project.
7750 ///
7751 /// To prevent failure, Google recommends that you set the
7752 /// `returnPartialSuccess` parameter to `true`.
7753 pub fn aggregated_list(&self) -> super::builder::network_attachments::AggregatedList {
7754 super::builder::network_attachments::AggregatedList::new(self.inner.clone())
7755 }
7756
7757 /// Deletes the specified NetworkAttachment in the given scope
7758 pub fn delete(&self) -> super::builder::network_attachments::Delete {
7759 super::builder::network_attachments::Delete::new(self.inner.clone())
7760 }
7761
7762 /// Returns the specified NetworkAttachment resource in the given scope.
7763 pub fn get(&self) -> super::builder::network_attachments::Get {
7764 super::builder::network_attachments::Get::new(self.inner.clone())
7765 }
7766
7767 /// Gets the access control policy for a resource. May be empty if no such
7768 /// policy or resource exists.
7769 pub fn get_iam_policy(&self) -> super::builder::network_attachments::GetIamPolicy {
7770 super::builder::network_attachments::GetIamPolicy::new(self.inner.clone())
7771 }
7772
7773 /// Creates a NetworkAttachment in the specified project in the given scope
7774 /// using the parameters that are included in the request.
7775 pub fn insert(&self) -> super::builder::network_attachments::Insert {
7776 super::builder::network_attachments::Insert::new(self.inner.clone())
7777 }
7778
7779 /// Lists the NetworkAttachments for a project in the given scope.
7780 pub fn list(&self) -> super::builder::network_attachments::List {
7781 super::builder::network_attachments::List::new(self.inner.clone())
7782 }
7783
7784 /// Patches the specified NetworkAttachment resource with the data included in
7785 /// the request. This method supports PATCH
7786 /// semantics and usesJSON merge
7787 /// patch format and processing rules.
7788 pub fn patch(&self) -> super::builder::network_attachments::Patch {
7789 super::builder::network_attachments::Patch::new(self.inner.clone())
7790 }
7791
7792 /// Sets the access control policy on the specified resource.
7793 /// Replaces any existing policy.
7794 pub fn set_iam_policy(&self) -> super::builder::network_attachments::SetIamPolicy {
7795 super::builder::network_attachments::SetIamPolicy::new(self.inner.clone())
7796 }
7797
7798 /// Returns permissions that a caller has on the specified resource.
7799 pub fn test_iam_permissions(&self) -> super::builder::network_attachments::TestIamPermissions {
7800 super::builder::network_attachments::TestIamPermissions::new(self.inner.clone())
7801 }
7802
7803 /// Retrieves the specified region-specific Operations resource.
7804 pub fn get_operation(&self) -> super::builder::network_attachments::GetOperation {
7805 super::builder::network_attachments::GetOperation::new(self.inner.clone())
7806 }
7807}
7808
7809/// Implements a client for the Google Compute Engine API.
7810///
7811/// # Example
7812/// ```
7813/// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7814/// async fn sample(
7815/// ) -> anyhow::Result<()> {
7816/// let client = NetworkEdgeSecurityServices::builder().build().await?;
7817/// // use `client` to make requests to the Google Compute Engine API.
7818/// Ok(())
7819/// }
7820/// ```
7821///
7822/// # Service Description
7823///
7824/// Service for the `networkEdgeSecurityServices` resource.
7825///
7826/// # Configuration
7827///
7828/// To configure `NetworkEdgeSecurityServices` use the `with_*` methods in the type returned
7829/// by [builder()][NetworkEdgeSecurityServices::builder]. The default configuration should
7830/// work for most applications. Common configuration changes include
7831///
7832/// * [with_endpoint()]: by default this client uses the global default endpoint
7833/// (`https://compute.googleapis.com`). Applications using regional
7834/// endpoints or running in restricted networks (e.g. a network configured
7835/// with [Private Google Access with VPC Service Controls]) may want to
7836/// override this default.
7837/// * [with_credentials()]: by default this client uses
7838/// [Application Default Credentials]. Applications using custom
7839/// authentication may need to override this default.
7840///
7841/// [with_endpoint()]: super::builder::network_edge_security_services::ClientBuilder::with_endpoint
7842/// [with_credentials()]: super::builder::network_edge_security_services::ClientBuilder::with_credentials
7843/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7844/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7845///
7846/// # Pooling and Cloning
7847///
7848/// `NetworkEdgeSecurityServices` holds a connection pool internally, it is advised to
7849/// create one and reuse it. You do not need to wrap `NetworkEdgeSecurityServices` in
7850/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7851/// already uses an `Arc` internally.
7852#[cfg(feature = "network-edge-security-services")]
7853#[cfg_attr(docsrs, doc(cfg(feature = "network-edge-security-services")))]
7854#[derive(Clone, Debug)]
7855pub struct NetworkEdgeSecurityServices {
7856 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7857}
7858
7859#[cfg(feature = "network-edge-security-services")]
7860impl NetworkEdgeSecurityServices {
7861 /// Returns a builder for [NetworkEdgeSecurityServices].
7862 ///
7863 /// ```
7864 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7865 /// # use google_cloud_compute_v1::client::NetworkEdgeSecurityServices;
7866 /// let client = NetworkEdgeSecurityServices::builder().build().await?;
7867 /// # Ok(()) }
7868 /// ```
7869 pub fn builder() -> super::builder::network_edge_security_services::ClientBuilder {
7870 crate::new_client_builder(super::builder::network_edge_security_services::client::Factory)
7871 }
7872
7873 /// Creates a new client from the provided stub.
7874 ///
7875 /// The most common case for calling this function is in tests mocking the
7876 /// client's behavior.
7877 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
7878 where
7879 T: super::stub::NetworkEdgeSecurityServices + 'static,
7880 {
7881 Self { inner: stub.into() }
7882 }
7883
7884 pub(crate) async fn new(
7885 config: gaxi::options::ClientConfig,
7886 ) -> crate::ClientBuilderResult<Self> {
7887 let inner = Self::build_inner(config).await?;
7888 Ok(Self { inner })
7889 }
7890
7891 async fn build_inner(
7892 conf: gaxi::options::ClientConfig,
7893 ) -> crate::ClientBuilderResult<
7894 std::sync::Arc<dyn super::stub::dynamic::NetworkEdgeSecurityServices>,
7895 > {
7896 if gaxi::options::tracing_enabled(&conf) {
7897 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
7898 }
7899 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
7900 }
7901
7902 async fn build_transport(
7903 conf: gaxi::options::ClientConfig,
7904 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEdgeSecurityServices> {
7905 super::transport::NetworkEdgeSecurityServices::new(conf).await
7906 }
7907
7908 async fn build_with_tracing(
7909 conf: gaxi::options::ClientConfig,
7910 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEdgeSecurityServices> {
7911 Self::build_transport(conf)
7912 .await
7913 .map(super::tracing::NetworkEdgeSecurityServices::new)
7914 }
7915
7916 /// Retrieves the list of all NetworkEdgeSecurityService resources available to
7917 /// the specified project.
7918 ///
7919 /// To prevent failure, Google recommends that you set the
7920 /// `returnPartialSuccess` parameter to `true`.
7921 pub fn aggregated_list(
7922 &self,
7923 ) -> super::builder::network_edge_security_services::AggregatedList {
7924 super::builder::network_edge_security_services::AggregatedList::new(self.inner.clone())
7925 }
7926
7927 /// Deletes the specified service.
7928 pub fn delete(&self) -> super::builder::network_edge_security_services::Delete {
7929 super::builder::network_edge_security_services::Delete::new(self.inner.clone())
7930 }
7931
7932 /// Gets a specified NetworkEdgeSecurityService.
7933 pub fn get(&self) -> super::builder::network_edge_security_services::Get {
7934 super::builder::network_edge_security_services::Get::new(self.inner.clone())
7935 }
7936
7937 /// Creates a new service in the specified project using the data included in
7938 /// the request.
7939 pub fn insert(&self) -> super::builder::network_edge_security_services::Insert {
7940 super::builder::network_edge_security_services::Insert::new(self.inner.clone())
7941 }
7942
7943 /// Patches the specified policy with the data included in the request.
7944 pub fn patch(&self) -> super::builder::network_edge_security_services::Patch {
7945 super::builder::network_edge_security_services::Patch::new(self.inner.clone())
7946 }
7947
7948 /// Retrieves the specified region-specific Operations resource.
7949 pub fn get_operation(&self) -> super::builder::network_edge_security_services::GetOperation {
7950 super::builder::network_edge_security_services::GetOperation::new(self.inner.clone())
7951 }
7952}
7953
7954/// Implements a client for the Google Compute Engine API.
7955///
7956/// # Example
7957/// ```
7958/// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
7959/// async fn sample(
7960/// ) -> anyhow::Result<()> {
7961/// let client = NetworkEndpointGroups::builder().build().await?;
7962/// // use `client` to make requests to the Google Compute Engine API.
7963/// Ok(())
7964/// }
7965/// ```
7966///
7967/// # Service Description
7968///
7969/// Service for the `networkEndpointGroups` resource.
7970///
7971/// # Configuration
7972///
7973/// To configure `NetworkEndpointGroups` use the `with_*` methods in the type returned
7974/// by [builder()][NetworkEndpointGroups::builder]. The default configuration should
7975/// work for most applications. Common configuration changes include
7976///
7977/// * [with_endpoint()]: by default this client uses the global default endpoint
7978/// (`https://compute.googleapis.com`). Applications using regional
7979/// endpoints or running in restricted networks (e.g. a network configured
7980/// with [Private Google Access with VPC Service Controls]) may want to
7981/// override this default.
7982/// * [with_credentials()]: by default this client uses
7983/// [Application Default Credentials]. Applications using custom
7984/// authentication may need to override this default.
7985///
7986/// [with_endpoint()]: super::builder::network_endpoint_groups::ClientBuilder::with_endpoint
7987/// [with_credentials()]: super::builder::network_endpoint_groups::ClientBuilder::with_credentials
7988/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
7989/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
7990///
7991/// # Pooling and Cloning
7992///
7993/// `NetworkEndpointGroups` holds a connection pool internally, it is advised to
7994/// create one and reuse it. You do not need to wrap `NetworkEndpointGroups` in
7995/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
7996/// already uses an `Arc` internally.
7997#[cfg(feature = "network-endpoint-groups")]
7998#[cfg_attr(docsrs, doc(cfg(feature = "network-endpoint-groups")))]
7999#[derive(Clone, Debug)]
8000pub struct NetworkEndpointGroups {
8001 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>,
8002}
8003
8004#[cfg(feature = "network-endpoint-groups")]
8005impl NetworkEndpointGroups {
8006 /// Returns a builder for [NetworkEndpointGroups].
8007 ///
8008 /// ```
8009 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8010 /// # use google_cloud_compute_v1::client::NetworkEndpointGroups;
8011 /// let client = NetworkEndpointGroups::builder().build().await?;
8012 /// # Ok(()) }
8013 /// ```
8014 pub fn builder() -> super::builder::network_endpoint_groups::ClientBuilder {
8015 crate::new_client_builder(super::builder::network_endpoint_groups::client::Factory)
8016 }
8017
8018 /// Creates a new client from the provided stub.
8019 ///
8020 /// The most common case for calling this function is in tests mocking the
8021 /// client's behavior.
8022 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8023 where
8024 T: super::stub::NetworkEndpointGroups + 'static,
8025 {
8026 Self { inner: stub.into() }
8027 }
8028
8029 pub(crate) async fn new(
8030 config: gaxi::options::ClientConfig,
8031 ) -> crate::ClientBuilderResult<Self> {
8032 let inner = Self::build_inner(config).await?;
8033 Ok(Self { inner })
8034 }
8035
8036 async fn build_inner(
8037 conf: gaxi::options::ClientConfig,
8038 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkEndpointGroups>>
8039 {
8040 if gaxi::options::tracing_enabled(&conf) {
8041 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8042 }
8043 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8044 }
8045
8046 async fn build_transport(
8047 conf: gaxi::options::ClientConfig,
8048 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEndpointGroups> {
8049 super::transport::NetworkEndpointGroups::new(conf).await
8050 }
8051
8052 async fn build_with_tracing(
8053 conf: gaxi::options::ClientConfig,
8054 ) -> crate::ClientBuilderResult<impl super::stub::NetworkEndpointGroups> {
8055 Self::build_transport(conf)
8056 .await
8057 .map(super::tracing::NetworkEndpointGroups::new)
8058 }
8059
8060 /// Retrieves the list of network endpoint groups and sorts them by zone.
8061 ///
8062 /// To prevent failure, Google recommends that you set the
8063 /// `returnPartialSuccess` parameter to `true`.
8064 pub fn aggregated_list(&self) -> super::builder::network_endpoint_groups::AggregatedList {
8065 super::builder::network_endpoint_groups::AggregatedList::new(self.inner.clone())
8066 }
8067
8068 /// Attach a list of network endpoints to the specified network endpoint group.
8069 pub fn attach_network_endpoints(
8070 &self,
8071 ) -> super::builder::network_endpoint_groups::AttachNetworkEndpoints {
8072 super::builder::network_endpoint_groups::AttachNetworkEndpoints::new(self.inner.clone())
8073 }
8074
8075 /// Deletes the specified network endpoint group. The network endpoints in the
8076 /// NEG and the VM instances they belong to are not terminated when the NEG is
8077 /// deleted. Note that the NEG cannot be deleted if there are backend services
8078 /// referencing it.
8079 pub fn delete(&self) -> super::builder::network_endpoint_groups::Delete {
8080 super::builder::network_endpoint_groups::Delete::new(self.inner.clone())
8081 }
8082
8083 /// Detach a list of network endpoints from the specified network endpoint
8084 /// group.
8085 pub fn detach_network_endpoints(
8086 &self,
8087 ) -> super::builder::network_endpoint_groups::DetachNetworkEndpoints {
8088 super::builder::network_endpoint_groups::DetachNetworkEndpoints::new(self.inner.clone())
8089 }
8090
8091 /// Returns the specified network endpoint group.
8092 pub fn get(&self) -> super::builder::network_endpoint_groups::Get {
8093 super::builder::network_endpoint_groups::Get::new(self.inner.clone())
8094 }
8095
8096 /// Creates a network endpoint group in the specified project using the
8097 /// parameters that are included in the request.
8098 ///
8099 /// Note: Use the following APIs to manage network endpoint groups:
8100 ///
8101 /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
8102 /// NEGs): zonal
8103 /// API
8104 /// - To manage NEGs with regional scope (such as regional internet NEGs,
8105 /// serverless NEGs, Private Service Connect NEGs): regional
8106 /// API
8107 /// - To manage NEGs with global scope (such as global internet NEGs):global
8108 /// API
8109 pub fn insert(&self) -> super::builder::network_endpoint_groups::Insert {
8110 super::builder::network_endpoint_groups::Insert::new(self.inner.clone())
8111 }
8112
8113 /// Retrieves the list of network endpoint groups that are located in the
8114 /// specified project and zone.
8115 pub fn list(&self) -> super::builder::network_endpoint_groups::List {
8116 super::builder::network_endpoint_groups::List::new(self.inner.clone())
8117 }
8118
8119 /// Lists the network endpoints in the specified network endpoint group.
8120 pub fn list_network_endpoints(
8121 &self,
8122 ) -> super::builder::network_endpoint_groups::ListNetworkEndpoints {
8123 super::builder::network_endpoint_groups::ListNetworkEndpoints::new(self.inner.clone())
8124 }
8125
8126 /// Returns permissions that a caller has on the specified resource.
8127 pub fn test_iam_permissions(
8128 &self,
8129 ) -> super::builder::network_endpoint_groups::TestIamPermissions {
8130 super::builder::network_endpoint_groups::TestIamPermissions::new(self.inner.clone())
8131 }
8132
8133 /// Retrieves the specified zone-specific Operations resource.
8134 pub fn get_operation(&self) -> super::builder::network_endpoint_groups::GetOperation {
8135 super::builder::network_endpoint_groups::GetOperation::new(self.inner.clone())
8136 }
8137}
8138
8139/// Implements a client for the Google Compute Engine API.
8140///
8141/// # Example
8142/// ```
8143/// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
8144/// async fn sample(
8145/// ) -> anyhow::Result<()> {
8146/// let client = NetworkFirewallPolicies::builder().build().await?;
8147/// // use `client` to make requests to the Google Compute Engine API.
8148/// Ok(())
8149/// }
8150/// ```
8151///
8152/// # Service Description
8153///
8154/// Service for the `networkFirewallPolicies` resource.
8155///
8156/// # Configuration
8157///
8158/// To configure `NetworkFirewallPolicies` use the `with_*` methods in the type returned
8159/// by [builder()][NetworkFirewallPolicies::builder]. The default configuration should
8160/// work for most applications. Common configuration changes include
8161///
8162/// * [with_endpoint()]: by default this client uses the global default endpoint
8163/// (`https://compute.googleapis.com`). Applications using regional
8164/// endpoints or running in restricted networks (e.g. a network configured
8165/// with [Private Google Access with VPC Service Controls]) may want to
8166/// override this default.
8167/// * [with_credentials()]: by default this client uses
8168/// [Application Default Credentials]. Applications using custom
8169/// authentication may need to override this default.
8170///
8171/// [with_endpoint()]: super::builder::network_firewall_policies::ClientBuilder::with_endpoint
8172/// [with_credentials()]: super::builder::network_firewall_policies::ClientBuilder::with_credentials
8173/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8174/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8175///
8176/// # Pooling and Cloning
8177///
8178/// `NetworkFirewallPolicies` holds a connection pool internally, it is advised to
8179/// create one and reuse it. You do not need to wrap `NetworkFirewallPolicies` in
8180/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8181/// already uses an `Arc` internally.
8182#[cfg(feature = "network-firewall-policies")]
8183#[cfg_attr(docsrs, doc(cfg(feature = "network-firewall-policies")))]
8184#[derive(Clone, Debug)]
8185pub struct NetworkFirewallPolicies {
8186 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>,
8187}
8188
8189#[cfg(feature = "network-firewall-policies")]
8190impl NetworkFirewallPolicies {
8191 /// Returns a builder for [NetworkFirewallPolicies].
8192 ///
8193 /// ```
8194 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8195 /// # use google_cloud_compute_v1::client::NetworkFirewallPolicies;
8196 /// let client = NetworkFirewallPolicies::builder().build().await?;
8197 /// # Ok(()) }
8198 /// ```
8199 pub fn builder() -> super::builder::network_firewall_policies::ClientBuilder {
8200 crate::new_client_builder(super::builder::network_firewall_policies::client::Factory)
8201 }
8202
8203 /// Creates a new client from the provided stub.
8204 ///
8205 /// The most common case for calling this function is in tests mocking the
8206 /// client's behavior.
8207 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8208 where
8209 T: super::stub::NetworkFirewallPolicies + 'static,
8210 {
8211 Self { inner: stub.into() }
8212 }
8213
8214 pub(crate) async fn new(
8215 config: gaxi::options::ClientConfig,
8216 ) -> crate::ClientBuilderResult<Self> {
8217 let inner = Self::build_inner(config).await?;
8218 Ok(Self { inner })
8219 }
8220
8221 async fn build_inner(
8222 conf: gaxi::options::ClientConfig,
8223 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkFirewallPolicies>>
8224 {
8225 if gaxi::options::tracing_enabled(&conf) {
8226 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8227 }
8228 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8229 }
8230
8231 async fn build_transport(
8232 conf: gaxi::options::ClientConfig,
8233 ) -> crate::ClientBuilderResult<impl super::stub::NetworkFirewallPolicies> {
8234 super::transport::NetworkFirewallPolicies::new(conf).await
8235 }
8236
8237 async fn build_with_tracing(
8238 conf: gaxi::options::ClientConfig,
8239 ) -> crate::ClientBuilderResult<impl super::stub::NetworkFirewallPolicies> {
8240 Self::build_transport(conf)
8241 .await
8242 .map(super::tracing::NetworkFirewallPolicies::new)
8243 }
8244
8245 /// Inserts an association for the specified firewall policy.
8246 pub fn add_association(&self) -> super::builder::network_firewall_policies::AddAssociation {
8247 super::builder::network_firewall_policies::AddAssociation::new(self.inner.clone())
8248 }
8249
8250 /// Inserts a packet mirroring rule into a firewall policy.
8251 pub fn add_packet_mirroring_rule(
8252 &self,
8253 ) -> super::builder::network_firewall_policies::AddPacketMirroringRule {
8254 super::builder::network_firewall_policies::AddPacketMirroringRule::new(self.inner.clone())
8255 }
8256
8257 /// Inserts a rule into a firewall policy.
8258 pub fn add_rule(&self) -> super::builder::network_firewall_policies::AddRule {
8259 super::builder::network_firewall_policies::AddRule::new(self.inner.clone())
8260 }
8261
8262 /// Retrieves an aggregated list of network firewall policies, listing network
8263 /// firewall policies from all applicable scopes (global and regional) and
8264 /// grouping the results per scope.
8265 ///
8266 /// To prevent failure, it is recommended that you set the
8267 /// `returnPartialSuccess` parameter to `true`.
8268 pub fn aggregated_list(&self) -> super::builder::network_firewall_policies::AggregatedList {
8269 super::builder::network_firewall_policies::AggregatedList::new(self.inner.clone())
8270 }
8271
8272 /// Copies rules to the specified firewall policy.
8273 pub fn clone_rules(&self) -> super::builder::network_firewall_policies::CloneRules {
8274 super::builder::network_firewall_policies::CloneRules::new(self.inner.clone())
8275 }
8276
8277 /// Deletes the specified policy.
8278 pub fn delete(&self) -> super::builder::network_firewall_policies::Delete {
8279 super::builder::network_firewall_policies::Delete::new(self.inner.clone())
8280 }
8281
8282 /// Returns the specified network firewall policy.
8283 pub fn get(&self) -> super::builder::network_firewall_policies::Get {
8284 super::builder::network_firewall_policies::Get::new(self.inner.clone())
8285 }
8286
8287 /// Gets an association with the specified name.
8288 pub fn get_association(&self) -> super::builder::network_firewall_policies::GetAssociation {
8289 super::builder::network_firewall_policies::GetAssociation::new(self.inner.clone())
8290 }
8291
8292 /// Gets the access control policy for a resource. May be empty if no such
8293 /// policy or resource exists.
8294 pub fn get_iam_policy(&self) -> super::builder::network_firewall_policies::GetIamPolicy {
8295 super::builder::network_firewall_policies::GetIamPolicy::new(self.inner.clone())
8296 }
8297
8298 /// Gets a packet mirroring rule of the specified priority.
8299 pub fn get_packet_mirroring_rule(
8300 &self,
8301 ) -> super::builder::network_firewall_policies::GetPacketMirroringRule {
8302 super::builder::network_firewall_policies::GetPacketMirroringRule::new(self.inner.clone())
8303 }
8304
8305 /// Gets a rule of the specified priority.
8306 pub fn get_rule(&self) -> super::builder::network_firewall_policies::GetRule {
8307 super::builder::network_firewall_policies::GetRule::new(self.inner.clone())
8308 }
8309
8310 /// Creates a new policy in the specified project using the data included in
8311 /// the request.
8312 pub fn insert(&self) -> super::builder::network_firewall_policies::Insert {
8313 super::builder::network_firewall_policies::Insert::new(self.inner.clone())
8314 }
8315
8316 /// Lists all the policies that have been configured for the specified project.
8317 pub fn list(&self) -> super::builder::network_firewall_policies::List {
8318 super::builder::network_firewall_policies::List::new(self.inner.clone())
8319 }
8320
8321 /// Patches the specified policy with the data included in the request.
8322 pub fn patch(&self) -> super::builder::network_firewall_policies::Patch {
8323 super::builder::network_firewall_policies::Patch::new(self.inner.clone())
8324 }
8325
8326 /// Patches a packet mirroring rule of the specified priority.
8327 pub fn patch_packet_mirroring_rule(
8328 &self,
8329 ) -> super::builder::network_firewall_policies::PatchPacketMirroringRule {
8330 super::builder::network_firewall_policies::PatchPacketMirroringRule::new(self.inner.clone())
8331 }
8332
8333 /// Patches a rule of the specified priority.
8334 pub fn patch_rule(&self) -> super::builder::network_firewall_policies::PatchRule {
8335 super::builder::network_firewall_policies::PatchRule::new(self.inner.clone())
8336 }
8337
8338 /// Removes an association for the specified firewall policy.
8339 pub fn remove_association(
8340 &self,
8341 ) -> super::builder::network_firewall_policies::RemoveAssociation {
8342 super::builder::network_firewall_policies::RemoveAssociation::new(self.inner.clone())
8343 }
8344
8345 /// Deletes a packet mirroring rule of the specified priority.
8346 pub fn remove_packet_mirroring_rule(
8347 &self,
8348 ) -> super::builder::network_firewall_policies::RemovePacketMirroringRule {
8349 super::builder::network_firewall_policies::RemovePacketMirroringRule::new(
8350 self.inner.clone(),
8351 )
8352 }
8353
8354 /// Deletes a rule of the specified priority.
8355 pub fn remove_rule(&self) -> super::builder::network_firewall_policies::RemoveRule {
8356 super::builder::network_firewall_policies::RemoveRule::new(self.inner.clone())
8357 }
8358
8359 /// Sets the access control policy on the specified resource.
8360 /// Replaces any existing policy.
8361 pub fn set_iam_policy(&self) -> super::builder::network_firewall_policies::SetIamPolicy {
8362 super::builder::network_firewall_policies::SetIamPolicy::new(self.inner.clone())
8363 }
8364
8365 /// Returns permissions that a caller has on the specified resource.
8366 pub fn test_iam_permissions(
8367 &self,
8368 ) -> super::builder::network_firewall_policies::TestIamPermissions {
8369 super::builder::network_firewall_policies::TestIamPermissions::new(self.inner.clone())
8370 }
8371
8372 /// Retrieves the specified Operations resource.
8373 pub fn get_operation(&self) -> super::builder::network_firewall_policies::GetOperation {
8374 super::builder::network_firewall_policies::GetOperation::new(self.inner.clone())
8375 }
8376}
8377
8378/// Implements a client for the Google Compute Engine API.
8379///
8380/// # Example
8381/// ```
8382/// # use google_cloud_compute_v1::client::NetworkProfiles;
8383/// async fn sample(
8384/// ) -> anyhow::Result<()> {
8385/// let client = NetworkProfiles::builder().build().await?;
8386/// // use `client` to make requests to the Google Compute Engine API.
8387/// Ok(())
8388/// }
8389/// ```
8390///
8391/// # Service Description
8392///
8393/// Service for the `networkProfiles` resource.
8394///
8395/// # Configuration
8396///
8397/// To configure `NetworkProfiles` use the `with_*` methods in the type returned
8398/// by [builder()][NetworkProfiles::builder]. The default configuration should
8399/// work for most applications. Common configuration changes include
8400///
8401/// * [with_endpoint()]: by default this client uses the global default endpoint
8402/// (`https://compute.googleapis.com`). Applications using regional
8403/// endpoints or running in restricted networks (e.g. a network configured
8404/// with [Private Google Access with VPC Service Controls]) may want to
8405/// override this default.
8406/// * [with_credentials()]: by default this client uses
8407/// [Application Default Credentials]. Applications using custom
8408/// authentication may need to override this default.
8409///
8410/// [with_endpoint()]: super::builder::network_profiles::ClientBuilder::with_endpoint
8411/// [with_credentials()]: super::builder::network_profiles::ClientBuilder::with_credentials
8412/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8413/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8414///
8415/// # Pooling and Cloning
8416///
8417/// `NetworkProfiles` holds a connection pool internally, it is advised to
8418/// create one and reuse it. You do not need to wrap `NetworkProfiles` in
8419/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8420/// already uses an `Arc` internally.
8421#[cfg(feature = "network-profiles")]
8422#[cfg_attr(docsrs, doc(cfg(feature = "network-profiles")))]
8423#[derive(Clone, Debug)]
8424pub struct NetworkProfiles {
8425 inner: std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>,
8426}
8427
8428#[cfg(feature = "network-profiles")]
8429impl NetworkProfiles {
8430 /// Returns a builder for [NetworkProfiles].
8431 ///
8432 /// ```
8433 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8434 /// # use google_cloud_compute_v1::client::NetworkProfiles;
8435 /// let client = NetworkProfiles::builder().build().await?;
8436 /// # Ok(()) }
8437 /// ```
8438 pub fn builder() -> super::builder::network_profiles::ClientBuilder {
8439 crate::new_client_builder(super::builder::network_profiles::client::Factory)
8440 }
8441
8442 /// Creates a new client from the provided stub.
8443 ///
8444 /// The most common case for calling this function is in tests mocking the
8445 /// client's behavior.
8446 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8447 where
8448 T: super::stub::NetworkProfiles + 'static,
8449 {
8450 Self { inner: stub.into() }
8451 }
8452
8453 pub(crate) async fn new(
8454 config: gaxi::options::ClientConfig,
8455 ) -> crate::ClientBuilderResult<Self> {
8456 let inner = Self::build_inner(config).await?;
8457 Ok(Self { inner })
8458 }
8459
8460 async fn build_inner(
8461 conf: gaxi::options::ClientConfig,
8462 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NetworkProfiles>> {
8463 if gaxi::options::tracing_enabled(&conf) {
8464 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8465 }
8466 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8467 }
8468
8469 async fn build_transport(
8470 conf: gaxi::options::ClientConfig,
8471 ) -> crate::ClientBuilderResult<impl super::stub::NetworkProfiles> {
8472 super::transport::NetworkProfiles::new(conf).await
8473 }
8474
8475 async fn build_with_tracing(
8476 conf: gaxi::options::ClientConfig,
8477 ) -> crate::ClientBuilderResult<impl super::stub::NetworkProfiles> {
8478 Self::build_transport(conf)
8479 .await
8480 .map(super::tracing::NetworkProfiles::new)
8481 }
8482
8483 /// Returns the specified network profile.
8484 pub fn get(&self) -> super::builder::network_profiles::Get {
8485 super::builder::network_profiles::Get::new(self.inner.clone())
8486 }
8487
8488 /// Retrieves a list of network profiles available to the specified
8489 /// project.
8490 pub fn list(&self) -> super::builder::network_profiles::List {
8491 super::builder::network_profiles::List::new(self.inner.clone())
8492 }
8493}
8494
8495/// Implements a client for the Google Compute Engine API.
8496///
8497/// # Example
8498/// ```
8499/// # use google_cloud_compute_v1::client::Networks;
8500/// async fn sample(
8501/// ) -> anyhow::Result<()> {
8502/// let client = Networks::builder().build().await?;
8503/// // use `client` to make requests to the Google Compute Engine API.
8504/// Ok(())
8505/// }
8506/// ```
8507///
8508/// # Service Description
8509///
8510/// Service for the `networks` resource.
8511///
8512/// # Configuration
8513///
8514/// To configure `Networks` use the `with_*` methods in the type returned
8515/// by [builder()][Networks::builder]. The default configuration should
8516/// work for most applications. Common configuration changes include
8517///
8518/// * [with_endpoint()]: by default this client uses the global default endpoint
8519/// (`https://compute.googleapis.com`). Applications using regional
8520/// endpoints or running in restricted networks (e.g. a network configured
8521/// with [Private Google Access with VPC Service Controls]) may want to
8522/// override this default.
8523/// * [with_credentials()]: by default this client uses
8524/// [Application Default Credentials]. Applications using custom
8525/// authentication may need to override this default.
8526///
8527/// [with_endpoint()]: super::builder::networks::ClientBuilder::with_endpoint
8528/// [with_credentials()]: super::builder::networks::ClientBuilder::with_credentials
8529/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8530/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8531///
8532/// # Pooling and Cloning
8533///
8534/// `Networks` holds a connection pool internally, it is advised to
8535/// create one and reuse it. You do not need to wrap `Networks` in
8536/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8537/// already uses an `Arc` internally.
8538#[cfg(feature = "networks")]
8539#[cfg_attr(docsrs, doc(cfg(feature = "networks")))]
8540#[derive(Clone, Debug)]
8541pub struct Networks {
8542 inner: std::sync::Arc<dyn super::stub::dynamic::Networks>,
8543}
8544
8545#[cfg(feature = "networks")]
8546impl Networks {
8547 /// Returns a builder for [Networks].
8548 ///
8549 /// ```
8550 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8551 /// # use google_cloud_compute_v1::client::Networks;
8552 /// let client = Networks::builder().build().await?;
8553 /// # Ok(()) }
8554 /// ```
8555 pub fn builder() -> super::builder::networks::ClientBuilder {
8556 crate::new_client_builder(super::builder::networks::client::Factory)
8557 }
8558
8559 /// Creates a new client from the provided stub.
8560 ///
8561 /// The most common case for calling this function is in tests mocking the
8562 /// client's behavior.
8563 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8564 where
8565 T: super::stub::Networks + 'static,
8566 {
8567 Self { inner: stub.into() }
8568 }
8569
8570 pub(crate) async fn new(
8571 config: gaxi::options::ClientConfig,
8572 ) -> crate::ClientBuilderResult<Self> {
8573 let inner = Self::build_inner(config).await?;
8574 Ok(Self { inner })
8575 }
8576
8577 async fn build_inner(
8578 conf: gaxi::options::ClientConfig,
8579 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Networks>> {
8580 if gaxi::options::tracing_enabled(&conf) {
8581 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8582 }
8583 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8584 }
8585
8586 async fn build_transport(
8587 conf: gaxi::options::ClientConfig,
8588 ) -> crate::ClientBuilderResult<impl super::stub::Networks> {
8589 super::transport::Networks::new(conf).await
8590 }
8591
8592 async fn build_with_tracing(
8593 conf: gaxi::options::ClientConfig,
8594 ) -> crate::ClientBuilderResult<impl super::stub::Networks> {
8595 Self::build_transport(conf)
8596 .await
8597 .map(super::tracing::Networks::new)
8598 }
8599
8600 /// Adds a peering to the specified network.
8601 pub fn add_peering(&self) -> super::builder::networks::AddPeering {
8602 super::builder::networks::AddPeering::new(self.inner.clone())
8603 }
8604
8605 /// Cancel requests to remove a peering from the specified network. Applicable
8606 /// only for PeeringConnection with update_strategy=CONSENSUS. Cancels a
8607 /// request to remove a peering from the specified network.
8608 pub fn cancel_request_remove_peering(
8609 &self,
8610 ) -> super::builder::networks::CancelRequestRemovePeering {
8611 super::builder::networks::CancelRequestRemovePeering::new(self.inner.clone())
8612 }
8613
8614 /// Deletes the specified network.
8615 pub fn delete(&self) -> super::builder::networks::Delete {
8616 super::builder::networks::Delete::new(self.inner.clone())
8617 }
8618
8619 /// Returns the specified network.
8620 pub fn get(&self) -> super::builder::networks::Get {
8621 super::builder::networks::Get::new(self.inner.clone())
8622 }
8623
8624 /// Returns the effective firewalls on a given network.
8625 pub fn get_effective_firewalls(&self) -> super::builder::networks::GetEffectiveFirewalls {
8626 super::builder::networks::GetEffectiveFirewalls::new(self.inner.clone())
8627 }
8628
8629 /// Creates a network in the specified project using the data included
8630 /// in the request.
8631 pub fn insert(&self) -> super::builder::networks::Insert {
8632 super::builder::networks::Insert::new(self.inner.clone())
8633 }
8634
8635 /// Retrieves the list of networks available to the specified project.
8636 pub fn list(&self) -> super::builder::networks::List {
8637 super::builder::networks::List::new(self.inner.clone())
8638 }
8639
8640 /// Lists the peering routes exchanged over peering connection.
8641 pub fn list_peering_routes(&self) -> super::builder::networks::ListPeeringRoutes {
8642 super::builder::networks::ListPeeringRoutes::new(self.inner.clone())
8643 }
8644
8645 /// Patches the specified network with the data included in the request.
8646 /// Only routingConfig can be modified.
8647 pub fn patch(&self) -> super::builder::networks::Patch {
8648 super::builder::networks::Patch::new(self.inner.clone())
8649 }
8650
8651 /// Removes a peering from the specified network.
8652 pub fn remove_peering(&self) -> super::builder::networks::RemovePeering {
8653 super::builder::networks::RemovePeering::new(self.inner.clone())
8654 }
8655
8656 /// Requests to remove a peering from the specified network. Applicable only
8657 /// for PeeringConnection with update_strategy=CONSENSUS.
8658 pub fn request_remove_peering(&self) -> super::builder::networks::RequestRemovePeering {
8659 super::builder::networks::RequestRemovePeering::new(self.inner.clone())
8660 }
8661
8662 /// Switches the network mode from auto subnet mode to custom subnet mode.
8663 pub fn switch_to_custom_mode(&self) -> super::builder::networks::SwitchToCustomMode {
8664 super::builder::networks::SwitchToCustomMode::new(self.inner.clone())
8665 }
8666
8667 /// Updates the specified network peering with the data included in the
8668 /// request. You can only modify the NetworkPeering.export_custom_routes field
8669 /// and the NetworkPeering.import_custom_routes field.
8670 pub fn update_peering(&self) -> super::builder::networks::UpdatePeering {
8671 super::builder::networks::UpdatePeering::new(self.inner.clone())
8672 }
8673
8674 /// Retrieves the specified Operations resource.
8675 pub fn get_operation(&self) -> super::builder::networks::GetOperation {
8676 super::builder::networks::GetOperation::new(self.inner.clone())
8677 }
8678}
8679
8680/// Implements a client for the Google Compute Engine API.
8681///
8682/// # Example
8683/// ```
8684/// # use google_cloud_compute_v1::client::NodeGroups;
8685/// async fn sample(
8686/// ) -> anyhow::Result<()> {
8687/// let client = NodeGroups::builder().build().await?;
8688/// // use `client` to make requests to the Google Compute Engine API.
8689/// Ok(())
8690/// }
8691/// ```
8692///
8693/// # Service Description
8694///
8695/// Service for the `nodeGroups` resource.
8696///
8697/// # Configuration
8698///
8699/// To configure `NodeGroups` use the `with_*` methods in the type returned
8700/// by [builder()][NodeGroups::builder]. The default configuration should
8701/// work for most applications. Common configuration changes include
8702///
8703/// * [with_endpoint()]: by default this client uses the global default endpoint
8704/// (`https://compute.googleapis.com`). Applications using regional
8705/// endpoints or running in restricted networks (e.g. a network configured
8706/// with [Private Google Access with VPC Service Controls]) may want to
8707/// override this default.
8708/// * [with_credentials()]: by default this client uses
8709/// [Application Default Credentials]. Applications using custom
8710/// authentication may need to override this default.
8711///
8712/// [with_endpoint()]: super::builder::node_groups::ClientBuilder::with_endpoint
8713/// [with_credentials()]: super::builder::node_groups::ClientBuilder::with_credentials
8714/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8715/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8716///
8717/// # Pooling and Cloning
8718///
8719/// `NodeGroups` holds a connection pool internally, it is advised to
8720/// create one and reuse it. You do not need to wrap `NodeGroups` in
8721/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8722/// already uses an `Arc` internally.
8723#[cfg(feature = "node-groups")]
8724#[cfg_attr(docsrs, doc(cfg(feature = "node-groups")))]
8725#[derive(Clone, Debug)]
8726pub struct NodeGroups {
8727 inner: std::sync::Arc<dyn super::stub::dynamic::NodeGroups>,
8728}
8729
8730#[cfg(feature = "node-groups")]
8731impl NodeGroups {
8732 /// Returns a builder for [NodeGroups].
8733 ///
8734 /// ```
8735 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8736 /// # use google_cloud_compute_v1::client::NodeGroups;
8737 /// let client = NodeGroups::builder().build().await?;
8738 /// # Ok(()) }
8739 /// ```
8740 pub fn builder() -> super::builder::node_groups::ClientBuilder {
8741 crate::new_client_builder(super::builder::node_groups::client::Factory)
8742 }
8743
8744 /// Creates a new client from the provided stub.
8745 ///
8746 /// The most common case for calling this function is in tests mocking the
8747 /// client's behavior.
8748 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8749 where
8750 T: super::stub::NodeGroups + 'static,
8751 {
8752 Self { inner: stub.into() }
8753 }
8754
8755 pub(crate) async fn new(
8756 config: gaxi::options::ClientConfig,
8757 ) -> crate::ClientBuilderResult<Self> {
8758 let inner = Self::build_inner(config).await?;
8759 Ok(Self { inner })
8760 }
8761
8762 async fn build_inner(
8763 conf: gaxi::options::ClientConfig,
8764 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeGroups>> {
8765 if gaxi::options::tracing_enabled(&conf) {
8766 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8767 }
8768 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8769 }
8770
8771 async fn build_transport(
8772 conf: gaxi::options::ClientConfig,
8773 ) -> crate::ClientBuilderResult<impl super::stub::NodeGroups> {
8774 super::transport::NodeGroups::new(conf).await
8775 }
8776
8777 async fn build_with_tracing(
8778 conf: gaxi::options::ClientConfig,
8779 ) -> crate::ClientBuilderResult<impl super::stub::NodeGroups> {
8780 Self::build_transport(conf)
8781 .await
8782 .map(super::tracing::NodeGroups::new)
8783 }
8784
8785 /// Adds specified number of nodes to the node group.
8786 pub fn add_nodes(&self) -> super::builder::node_groups::AddNodes {
8787 super::builder::node_groups::AddNodes::new(self.inner.clone())
8788 }
8789
8790 /// Retrieves an aggregated list of node groups.
8791 /// Note: use nodeGroups.listNodes for more details about each group.
8792 ///
8793 /// To prevent failure, Google recommends that you set the
8794 /// `returnPartialSuccess` parameter to `true`.
8795 pub fn aggregated_list(&self) -> super::builder::node_groups::AggregatedList {
8796 super::builder::node_groups::AggregatedList::new(self.inner.clone())
8797 }
8798
8799 /// Deletes the specified NodeGroup resource.
8800 pub fn delete(&self) -> super::builder::node_groups::Delete {
8801 super::builder::node_groups::Delete::new(self.inner.clone())
8802 }
8803
8804 /// Deletes specified nodes from the node group.
8805 pub fn delete_nodes(&self) -> super::builder::node_groups::DeleteNodes {
8806 super::builder::node_groups::DeleteNodes::new(self.inner.clone())
8807 }
8808
8809 /// Returns the specified NodeGroup. Get a list of available NodeGroups
8810 /// by making a list() request.
8811 /// Note: the "nodes" field should not be used. Use nodeGroups.listNodes
8812 /// instead.
8813 pub fn get(&self) -> super::builder::node_groups::Get {
8814 super::builder::node_groups::Get::new(self.inner.clone())
8815 }
8816
8817 /// Gets the access control policy for a resource. May be empty if no such
8818 /// policy or resource exists.
8819 pub fn get_iam_policy(&self) -> super::builder::node_groups::GetIamPolicy {
8820 super::builder::node_groups::GetIamPolicy::new(self.inner.clone())
8821 }
8822
8823 /// Creates a NodeGroup resource in the specified project using the data
8824 /// included in the request.
8825 pub fn insert(&self) -> super::builder::node_groups::Insert {
8826 super::builder::node_groups::Insert::new(self.inner.clone())
8827 }
8828
8829 /// Retrieves a list of node groups available to the specified project.
8830 /// Note: use nodeGroups.listNodes for more details about each group.
8831 pub fn list(&self) -> super::builder::node_groups::List {
8832 super::builder::node_groups::List::new(self.inner.clone())
8833 }
8834
8835 /// Lists nodes in the node group.
8836 pub fn list_nodes(&self) -> super::builder::node_groups::ListNodes {
8837 super::builder::node_groups::ListNodes::new(self.inner.clone())
8838 }
8839
8840 /// Updates the specified node group.
8841 pub fn patch(&self) -> super::builder::node_groups::Patch {
8842 super::builder::node_groups::Patch::new(self.inner.clone())
8843 }
8844
8845 /// Perform maintenance on a subset of nodes in the node group.
8846 pub fn perform_maintenance(&self) -> super::builder::node_groups::PerformMaintenance {
8847 super::builder::node_groups::PerformMaintenance::new(self.inner.clone())
8848 }
8849
8850 /// Sets the access control policy on the specified resource.
8851 /// Replaces any existing policy.
8852 pub fn set_iam_policy(&self) -> super::builder::node_groups::SetIamPolicy {
8853 super::builder::node_groups::SetIamPolicy::new(self.inner.clone())
8854 }
8855
8856 /// Updates the node template of the node group.
8857 pub fn set_node_template(&self) -> super::builder::node_groups::SetNodeTemplate {
8858 super::builder::node_groups::SetNodeTemplate::new(self.inner.clone())
8859 }
8860
8861 /// Simulates maintenance event on specified nodes from the node group.
8862 pub fn simulate_maintenance_event(
8863 &self,
8864 ) -> super::builder::node_groups::SimulateMaintenanceEvent {
8865 super::builder::node_groups::SimulateMaintenanceEvent::new(self.inner.clone())
8866 }
8867
8868 /// Returns permissions that a caller has on the specified resource.
8869 pub fn test_iam_permissions(&self) -> super::builder::node_groups::TestIamPermissions {
8870 super::builder::node_groups::TestIamPermissions::new(self.inner.clone())
8871 }
8872
8873 /// Retrieves the specified zone-specific Operations resource.
8874 pub fn get_operation(&self) -> super::builder::node_groups::GetOperation {
8875 super::builder::node_groups::GetOperation::new(self.inner.clone())
8876 }
8877}
8878
8879/// Implements a client for the Google Compute Engine API.
8880///
8881/// # Example
8882/// ```
8883/// # use google_cloud_compute_v1::client::NodeTemplates;
8884/// async fn sample(
8885/// ) -> anyhow::Result<()> {
8886/// let client = NodeTemplates::builder().build().await?;
8887/// // use `client` to make requests to the Google Compute Engine API.
8888/// Ok(())
8889/// }
8890/// ```
8891///
8892/// # Service Description
8893///
8894/// Service for the `nodeTemplates` resource.
8895///
8896/// # Configuration
8897///
8898/// To configure `NodeTemplates` use the `with_*` methods in the type returned
8899/// by [builder()][NodeTemplates::builder]. The default configuration should
8900/// work for most applications. Common configuration changes include
8901///
8902/// * [with_endpoint()]: by default this client uses the global default endpoint
8903/// (`https://compute.googleapis.com`). Applications using regional
8904/// endpoints or running in restricted networks (e.g. a network configured
8905/// with [Private Google Access with VPC Service Controls]) may want to
8906/// override this default.
8907/// * [with_credentials()]: by default this client uses
8908/// [Application Default Credentials]. Applications using custom
8909/// authentication may need to override this default.
8910///
8911/// [with_endpoint()]: super::builder::node_templates::ClientBuilder::with_endpoint
8912/// [with_credentials()]: super::builder::node_templates::ClientBuilder::with_credentials
8913/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
8914/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
8915///
8916/// # Pooling and Cloning
8917///
8918/// `NodeTemplates` holds a connection pool internally, it is advised to
8919/// create one and reuse it. You do not need to wrap `NodeTemplates` in
8920/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
8921/// already uses an `Arc` internally.
8922#[cfg(feature = "node-templates")]
8923#[cfg_attr(docsrs, doc(cfg(feature = "node-templates")))]
8924#[derive(Clone, Debug)]
8925pub struct NodeTemplates {
8926 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>,
8927}
8928
8929#[cfg(feature = "node-templates")]
8930impl NodeTemplates {
8931 /// Returns a builder for [NodeTemplates].
8932 ///
8933 /// ```
8934 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8935 /// # use google_cloud_compute_v1::client::NodeTemplates;
8936 /// let client = NodeTemplates::builder().build().await?;
8937 /// # Ok(()) }
8938 /// ```
8939 pub fn builder() -> super::builder::node_templates::ClientBuilder {
8940 crate::new_client_builder(super::builder::node_templates::client::Factory)
8941 }
8942
8943 /// Creates a new client from the provided stub.
8944 ///
8945 /// The most common case for calling this function is in tests mocking the
8946 /// client's behavior.
8947 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
8948 where
8949 T: super::stub::NodeTemplates + 'static,
8950 {
8951 Self { inner: stub.into() }
8952 }
8953
8954 pub(crate) async fn new(
8955 config: gaxi::options::ClientConfig,
8956 ) -> crate::ClientBuilderResult<Self> {
8957 let inner = Self::build_inner(config).await?;
8958 Ok(Self { inner })
8959 }
8960
8961 async fn build_inner(
8962 conf: gaxi::options::ClientConfig,
8963 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeTemplates>> {
8964 if gaxi::options::tracing_enabled(&conf) {
8965 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
8966 }
8967 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
8968 }
8969
8970 async fn build_transport(
8971 conf: gaxi::options::ClientConfig,
8972 ) -> crate::ClientBuilderResult<impl super::stub::NodeTemplates> {
8973 super::transport::NodeTemplates::new(conf).await
8974 }
8975
8976 async fn build_with_tracing(
8977 conf: gaxi::options::ClientConfig,
8978 ) -> crate::ClientBuilderResult<impl super::stub::NodeTemplates> {
8979 Self::build_transport(conf)
8980 .await
8981 .map(super::tracing::NodeTemplates::new)
8982 }
8983
8984 /// Retrieves an aggregated list of node templates.
8985 ///
8986 /// To prevent failure, Google recommends that you set the
8987 /// `returnPartialSuccess` parameter to `true`.
8988 pub fn aggregated_list(&self) -> super::builder::node_templates::AggregatedList {
8989 super::builder::node_templates::AggregatedList::new(self.inner.clone())
8990 }
8991
8992 /// Deletes the specified NodeTemplate resource.
8993 pub fn delete(&self) -> super::builder::node_templates::Delete {
8994 super::builder::node_templates::Delete::new(self.inner.clone())
8995 }
8996
8997 /// Returns the specified node template.
8998 pub fn get(&self) -> super::builder::node_templates::Get {
8999 super::builder::node_templates::Get::new(self.inner.clone())
9000 }
9001
9002 /// Gets the access control policy for a resource. May be empty if no such
9003 /// policy or resource exists.
9004 pub fn get_iam_policy(&self) -> super::builder::node_templates::GetIamPolicy {
9005 super::builder::node_templates::GetIamPolicy::new(self.inner.clone())
9006 }
9007
9008 /// Creates a NodeTemplate resource in the specified project using the data
9009 /// included in the request.
9010 pub fn insert(&self) -> super::builder::node_templates::Insert {
9011 super::builder::node_templates::Insert::new(self.inner.clone())
9012 }
9013
9014 /// Retrieves a list of node templates available to the specified
9015 /// project.
9016 pub fn list(&self) -> super::builder::node_templates::List {
9017 super::builder::node_templates::List::new(self.inner.clone())
9018 }
9019
9020 /// Sets the access control policy on the specified resource.
9021 /// Replaces any existing policy.
9022 pub fn set_iam_policy(&self) -> super::builder::node_templates::SetIamPolicy {
9023 super::builder::node_templates::SetIamPolicy::new(self.inner.clone())
9024 }
9025
9026 /// Returns permissions that a caller has on the specified resource.
9027 pub fn test_iam_permissions(&self) -> super::builder::node_templates::TestIamPermissions {
9028 super::builder::node_templates::TestIamPermissions::new(self.inner.clone())
9029 }
9030
9031 /// Retrieves the specified region-specific Operations resource.
9032 pub fn get_operation(&self) -> super::builder::node_templates::GetOperation {
9033 super::builder::node_templates::GetOperation::new(self.inner.clone())
9034 }
9035}
9036
9037/// Implements a client for the Google Compute Engine API.
9038///
9039/// # Example
9040/// ```
9041/// # use google_cloud_compute_v1::client::NodeTypes;
9042/// async fn sample(
9043/// ) -> anyhow::Result<()> {
9044/// let client = NodeTypes::builder().build().await?;
9045/// // use `client` to make requests to the Google Compute Engine API.
9046/// Ok(())
9047/// }
9048/// ```
9049///
9050/// # Service Description
9051///
9052/// Service for the `nodeTypes` resource.
9053///
9054/// # Configuration
9055///
9056/// To configure `NodeTypes` use the `with_*` methods in the type returned
9057/// by [builder()][NodeTypes::builder]. The default configuration should
9058/// work for most applications. Common configuration changes include
9059///
9060/// * [with_endpoint()]: by default this client uses the global default endpoint
9061/// (`https://compute.googleapis.com`). Applications using regional
9062/// endpoints or running in restricted networks (e.g. a network configured
9063/// with [Private Google Access with VPC Service Controls]) may want to
9064/// override this default.
9065/// * [with_credentials()]: by default this client uses
9066/// [Application Default Credentials]. Applications using custom
9067/// authentication may need to override this default.
9068///
9069/// [with_endpoint()]: super::builder::node_types::ClientBuilder::with_endpoint
9070/// [with_credentials()]: super::builder::node_types::ClientBuilder::with_credentials
9071/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9072/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9073///
9074/// # Pooling and Cloning
9075///
9076/// `NodeTypes` holds a connection pool internally, it is advised to
9077/// create one and reuse it. You do not need to wrap `NodeTypes` in
9078/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9079/// already uses an `Arc` internally.
9080#[cfg(feature = "node-types")]
9081#[cfg_attr(docsrs, doc(cfg(feature = "node-types")))]
9082#[derive(Clone, Debug)]
9083pub struct NodeTypes {
9084 inner: std::sync::Arc<dyn super::stub::dynamic::NodeTypes>,
9085}
9086
9087#[cfg(feature = "node-types")]
9088impl NodeTypes {
9089 /// Returns a builder for [NodeTypes].
9090 ///
9091 /// ```
9092 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9093 /// # use google_cloud_compute_v1::client::NodeTypes;
9094 /// let client = NodeTypes::builder().build().await?;
9095 /// # Ok(()) }
9096 /// ```
9097 pub fn builder() -> super::builder::node_types::ClientBuilder {
9098 crate::new_client_builder(super::builder::node_types::client::Factory)
9099 }
9100
9101 /// Creates a new client from the provided stub.
9102 ///
9103 /// The most common case for calling this function is in tests mocking the
9104 /// client's behavior.
9105 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9106 where
9107 T: super::stub::NodeTypes + 'static,
9108 {
9109 Self { inner: stub.into() }
9110 }
9111
9112 pub(crate) async fn new(
9113 config: gaxi::options::ClientConfig,
9114 ) -> crate::ClientBuilderResult<Self> {
9115 let inner = Self::build_inner(config).await?;
9116 Ok(Self { inner })
9117 }
9118
9119 async fn build_inner(
9120 conf: gaxi::options::ClientConfig,
9121 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::NodeTypes>> {
9122 if gaxi::options::tracing_enabled(&conf) {
9123 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9124 }
9125 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9126 }
9127
9128 async fn build_transport(
9129 conf: gaxi::options::ClientConfig,
9130 ) -> crate::ClientBuilderResult<impl super::stub::NodeTypes> {
9131 super::transport::NodeTypes::new(conf).await
9132 }
9133
9134 async fn build_with_tracing(
9135 conf: gaxi::options::ClientConfig,
9136 ) -> crate::ClientBuilderResult<impl super::stub::NodeTypes> {
9137 Self::build_transport(conf)
9138 .await
9139 .map(super::tracing::NodeTypes::new)
9140 }
9141
9142 /// Retrieves an aggregated list of node types.
9143 ///
9144 /// To prevent failure, Google recommends that you set the
9145 /// `returnPartialSuccess` parameter to `true`.
9146 pub fn aggregated_list(&self) -> super::builder::node_types::AggregatedList {
9147 super::builder::node_types::AggregatedList::new(self.inner.clone())
9148 }
9149
9150 /// Returns the specified node type.
9151 pub fn get(&self) -> super::builder::node_types::Get {
9152 super::builder::node_types::Get::new(self.inner.clone())
9153 }
9154
9155 /// Retrieves a list of node types available to the specified
9156 /// project.
9157 pub fn list(&self) -> super::builder::node_types::List {
9158 super::builder::node_types::List::new(self.inner.clone())
9159 }
9160}
9161
9162/// Implements a client for the Google Compute Engine API.
9163///
9164/// # Example
9165/// ```
9166/// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
9167/// async fn sample(
9168/// ) -> anyhow::Result<()> {
9169/// let client = OrganizationSecurityPolicies::builder().build().await?;
9170/// // use `client` to make requests to the Google Compute Engine API.
9171/// Ok(())
9172/// }
9173/// ```
9174///
9175/// # Service Description
9176///
9177/// Service for the `organizationSecurityPolicies` resource.
9178///
9179/// # Configuration
9180///
9181/// To configure `OrganizationSecurityPolicies` use the `with_*` methods in the type returned
9182/// by [builder()][OrganizationSecurityPolicies::builder]. The default configuration should
9183/// work for most applications. Common configuration changes include
9184///
9185/// * [with_endpoint()]: by default this client uses the global default endpoint
9186/// (`https://compute.googleapis.com`). Applications using regional
9187/// endpoints or running in restricted networks (e.g. a network configured
9188/// with [Private Google Access with VPC Service Controls]) may want to
9189/// override this default.
9190/// * [with_credentials()]: by default this client uses
9191/// [Application Default Credentials]. Applications using custom
9192/// authentication may need to override this default.
9193///
9194/// [with_endpoint()]: super::builder::organization_security_policies::ClientBuilder::with_endpoint
9195/// [with_credentials()]: super::builder::organization_security_policies::ClientBuilder::with_credentials
9196/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9197/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9198///
9199/// # Pooling and Cloning
9200///
9201/// `OrganizationSecurityPolicies` holds a connection pool internally, it is advised to
9202/// create one and reuse it. You do not need to wrap `OrganizationSecurityPolicies` in
9203/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9204/// already uses an `Arc` internally.
9205#[cfg(feature = "organization-security-policies")]
9206#[cfg_attr(docsrs, doc(cfg(feature = "organization-security-policies")))]
9207#[derive(Clone, Debug)]
9208pub struct OrganizationSecurityPolicies {
9209 inner: std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
9210}
9211
9212#[cfg(feature = "organization-security-policies")]
9213impl OrganizationSecurityPolicies {
9214 /// Returns a builder for [OrganizationSecurityPolicies].
9215 ///
9216 /// ```
9217 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9218 /// # use google_cloud_compute_v1::client::OrganizationSecurityPolicies;
9219 /// let client = OrganizationSecurityPolicies::builder().build().await?;
9220 /// # Ok(()) }
9221 /// ```
9222 pub fn builder() -> super::builder::organization_security_policies::ClientBuilder {
9223 crate::new_client_builder(super::builder::organization_security_policies::client::Factory)
9224 }
9225
9226 /// Creates a new client from the provided stub.
9227 ///
9228 /// The most common case for calling this function is in tests mocking the
9229 /// client's behavior.
9230 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9231 where
9232 T: super::stub::OrganizationSecurityPolicies + 'static,
9233 {
9234 Self { inner: stub.into() }
9235 }
9236
9237 pub(crate) async fn new(
9238 config: gaxi::options::ClientConfig,
9239 ) -> crate::ClientBuilderResult<Self> {
9240 let inner = Self::build_inner(config).await?;
9241 Ok(Self { inner })
9242 }
9243
9244 async fn build_inner(
9245 conf: gaxi::options::ClientConfig,
9246 ) -> crate::ClientBuilderResult<
9247 std::sync::Arc<dyn super::stub::dynamic::OrganizationSecurityPolicies>,
9248 > {
9249 if gaxi::options::tracing_enabled(&conf) {
9250 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9251 }
9252 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9253 }
9254
9255 async fn build_transport(
9256 conf: gaxi::options::ClientConfig,
9257 ) -> crate::ClientBuilderResult<impl super::stub::OrganizationSecurityPolicies> {
9258 super::transport::OrganizationSecurityPolicies::new(conf).await
9259 }
9260
9261 async fn build_with_tracing(
9262 conf: gaxi::options::ClientConfig,
9263 ) -> crate::ClientBuilderResult<impl super::stub::OrganizationSecurityPolicies> {
9264 Self::build_transport(conf)
9265 .await
9266 .map(super::tracing::OrganizationSecurityPolicies::new)
9267 }
9268
9269 /// Inserts an association for the specified security policy.
9270 ///
9271 /// This has billing implications. Projects in the hierarchy with effective
9272 /// hierarchical security policies will be automatically enrolled into Cloud
9273 /// Armor Enterprise if not already enrolled.
9274 ///
9275 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9276 /// versions of this API were used to modify firewall policies. This usage is
9277 /// now disabled for most organizations. Use firewallPolicies.addAssociation
9278 /// instead.
9279 pub fn add_association(
9280 &self,
9281 ) -> super::builder::organization_security_policies::AddAssociation {
9282 super::builder::organization_security_policies::AddAssociation::new(self.inner.clone())
9283 }
9284
9285 /// Inserts a rule into a security policy.
9286 ///
9287 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9288 /// versions of this API were used to modify firewall policies. This usage is
9289 /// now disabled for most organizations. Use firewallPolicies.addRule instead.
9290 pub fn add_rule(&self) -> super::builder::organization_security_policies::AddRule {
9291 super::builder::organization_security_policies::AddRule::new(self.inner.clone())
9292 }
9293
9294 /// Copies rules to the specified security policy.
9295 ///
9296 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9297 /// versions of this API were used to modify firewall policies. This usage is
9298 /// now disabled for most organizations. Use firewallPolicies.cloneRules
9299 /// instead.
9300 pub fn copy_rules(&self) -> super::builder::organization_security_policies::CopyRules {
9301 super::builder::organization_security_policies::CopyRules::new(self.inner.clone())
9302 }
9303
9304 /// Deletes the specified policy.
9305 ///
9306 /// Use this API to remove Cloud Armor policies. Previously, alpha and beta
9307 /// versions of this API were used to remove firewall policies. This usage is
9308 /// now disabled for most organizations. Use firewallPolicies.delete instead.
9309 pub fn delete(&self) -> super::builder::organization_security_policies::Delete {
9310 super::builder::organization_security_policies::Delete::new(self.inner.clone())
9311 }
9312
9313 /// List all of the ordered rules present in a single specified policy.
9314 ///
9315 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9316 /// versions of this API were used to read firewall policies. This usage is now
9317 /// disabled for most organizations. Use firewallPolicies.get instead.
9318 pub fn get(&self) -> super::builder::organization_security_policies::Get {
9319 super::builder::organization_security_policies::Get::new(self.inner.clone())
9320 }
9321
9322 /// Gets an association with the specified name.
9323 ///
9324 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9325 /// versions of this API were used to read firewall policies. This usage is
9326 /// now disabled for most organizations. Use firewallPolicies.getAssociation
9327 /// instead.
9328 pub fn get_association(
9329 &self,
9330 ) -> super::builder::organization_security_policies::GetAssociation {
9331 super::builder::organization_security_policies::GetAssociation::new(self.inner.clone())
9332 }
9333
9334 /// Gets a rule at the specified priority.
9335 ///
9336 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9337 /// versions of this API were used to read firewall policies. This usage is now
9338 /// disabled for most organizations. Use firewallPolicies.getRule instead.
9339 pub fn get_rule(&self) -> super::builder::organization_security_policies::GetRule {
9340 super::builder::organization_security_policies::GetRule::new(self.inner.clone())
9341 }
9342
9343 /// Creates a new policy in the specified organization using the data included
9344 /// in the request.
9345 ///
9346 /// Use this API to add Cloud Armor policies. Previously, alpha and beta
9347 /// versions of this API were used to add firewall policies. This usage is now
9348 /// disabled for most organizations. Use firewallPolicies.insert instead.
9349 pub fn insert(&self) -> super::builder::organization_security_policies::Insert {
9350 super::builder::organization_security_policies::Insert::new(self.inner.clone())
9351 }
9352
9353 /// List all the policies that have been configured for the specified
9354 /// organization.
9355 ///
9356 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9357 /// versions of this API were used to read firewall policies. This usage is now
9358 /// disabled for most organizations. Use firewallPolicies.list instead.
9359 pub fn list(&self) -> super::builder::organization_security_policies::List {
9360 super::builder::organization_security_policies::List::new(self.inner.clone())
9361 }
9362
9363 /// Lists associations of a specified target, i.e., organization or folder.
9364 ///
9365 /// Use this API to read Cloud Armor policies. Previously, alpha and beta
9366 /// versions of this API were used to read firewall policies. This usage is
9367 /// now disabled for most organizations. Use firewallPolicies.listAssociations
9368 /// instead.
9369 pub fn list_associations(
9370 &self,
9371 ) -> super::builder::organization_security_policies::ListAssociations {
9372 super::builder::organization_security_policies::ListAssociations::new(self.inner.clone())
9373 }
9374
9375 /// Gets the current list of preconfigured Web Application Firewall (WAF)
9376 /// expressions.
9377 pub fn list_preconfigured_expression_sets(
9378 &self,
9379 ) -> super::builder::organization_security_policies::ListPreconfiguredExpressionSets {
9380 super::builder::organization_security_policies::ListPreconfiguredExpressionSets::new(
9381 self.inner.clone(),
9382 )
9383 }
9384
9385 /// Moves the specified security policy.
9386 ///
9387 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9388 /// versions of this API were used to modify firewall policies. This usage is
9389 /// now disabled for most organizations. Use firewallPolicies.move instead.
9390 pub fn r#move(&self) -> super::builder::organization_security_policies::Move {
9391 super::builder::organization_security_policies::Move::new(self.inner.clone())
9392 }
9393
9394 /// Patches the specified policy with the data included in the request.
9395 ///
9396 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9397 /// versions of this API were used to modify firewall policies. This usage is
9398 /// now disabled for most organizations. Use firewallPolicies.patch instead.
9399 pub fn patch(&self) -> super::builder::organization_security_policies::Patch {
9400 super::builder::organization_security_policies::Patch::new(self.inner.clone())
9401 }
9402
9403 /// Patches a rule at the specified priority.
9404 ///
9405 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9406 /// versions of this API were used to modify firewall policies. This usage is
9407 /// now disabled for most organizations. Use firewallPolicies.patchRule
9408 /// instead.
9409 pub fn patch_rule(&self) -> super::builder::organization_security_policies::PatchRule {
9410 super::builder::organization_security_policies::PatchRule::new(self.inner.clone())
9411 }
9412
9413 /// Removes an association for the specified security policy.
9414 ///
9415 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9416 /// versions of this API were used to modify firewall policies. This usage is
9417 /// now disabled for most organizations. Use firewallPolicies.removeAssociation
9418 /// instead.
9419 pub fn remove_association(
9420 &self,
9421 ) -> super::builder::organization_security_policies::RemoveAssociation {
9422 super::builder::organization_security_policies::RemoveAssociation::new(self.inner.clone())
9423 }
9424
9425 /// Deletes a rule at the specified priority.
9426 ///
9427 /// Use this API to modify Cloud Armor policies. Previously, alpha and beta
9428 /// versions of this API were used to modify firewall policies. This usage is
9429 /// now disabled for most organizations. Use firewallPolicies.removeRule
9430 /// instead.
9431 pub fn remove_rule(&self) -> super::builder::organization_security_policies::RemoveRule {
9432 super::builder::organization_security_policies::RemoveRule::new(self.inner.clone())
9433 }
9434
9435 /// Retrieves the specified Operations resource. Gets a list of operations
9436 /// by making a `list()` request.
9437 pub fn get_operation(&self) -> super::builder::organization_security_policies::GetOperation {
9438 super::builder::organization_security_policies::GetOperation::new(self.inner.clone())
9439 }
9440}
9441
9442/// Implements a client for the Google Compute Engine API.
9443///
9444/// # Example
9445/// ```
9446/// # use google_cloud_compute_v1::client::PacketMirrorings;
9447/// async fn sample(
9448/// ) -> anyhow::Result<()> {
9449/// let client = PacketMirrorings::builder().build().await?;
9450/// // use `client` to make requests to the Google Compute Engine API.
9451/// Ok(())
9452/// }
9453/// ```
9454///
9455/// # Service Description
9456///
9457/// Service for the `packetMirrorings` resource.
9458///
9459/// # Configuration
9460///
9461/// To configure `PacketMirrorings` use the `with_*` methods in the type returned
9462/// by [builder()][PacketMirrorings::builder]. The default configuration should
9463/// work for most applications. Common configuration changes include
9464///
9465/// * [with_endpoint()]: by default this client uses the global default endpoint
9466/// (`https://compute.googleapis.com`). Applications using regional
9467/// endpoints or running in restricted networks (e.g. a network configured
9468/// with [Private Google Access with VPC Service Controls]) may want to
9469/// override this default.
9470/// * [with_credentials()]: by default this client uses
9471/// [Application Default Credentials]. Applications using custom
9472/// authentication may need to override this default.
9473///
9474/// [with_endpoint()]: super::builder::packet_mirrorings::ClientBuilder::with_endpoint
9475/// [with_credentials()]: super::builder::packet_mirrorings::ClientBuilder::with_credentials
9476/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9477/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9478///
9479/// # Pooling and Cloning
9480///
9481/// `PacketMirrorings` holds a connection pool internally, it is advised to
9482/// create one and reuse it. You do not need to wrap `PacketMirrorings` in
9483/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9484/// already uses an `Arc` internally.
9485#[cfg(feature = "packet-mirrorings")]
9486#[cfg_attr(docsrs, doc(cfg(feature = "packet-mirrorings")))]
9487#[derive(Clone, Debug)]
9488pub struct PacketMirrorings {
9489 inner: std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>,
9490}
9491
9492#[cfg(feature = "packet-mirrorings")]
9493impl PacketMirrorings {
9494 /// Returns a builder for [PacketMirrorings].
9495 ///
9496 /// ```
9497 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9498 /// # use google_cloud_compute_v1::client::PacketMirrorings;
9499 /// let client = PacketMirrorings::builder().build().await?;
9500 /// # Ok(()) }
9501 /// ```
9502 pub fn builder() -> super::builder::packet_mirrorings::ClientBuilder {
9503 crate::new_client_builder(super::builder::packet_mirrorings::client::Factory)
9504 }
9505
9506 /// Creates a new client from the provided stub.
9507 ///
9508 /// The most common case for calling this function is in tests mocking the
9509 /// client's behavior.
9510 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9511 where
9512 T: super::stub::PacketMirrorings + 'static,
9513 {
9514 Self { inner: stub.into() }
9515 }
9516
9517 pub(crate) async fn new(
9518 config: gaxi::options::ClientConfig,
9519 ) -> crate::ClientBuilderResult<Self> {
9520 let inner = Self::build_inner(config).await?;
9521 Ok(Self { inner })
9522 }
9523
9524 async fn build_inner(
9525 conf: gaxi::options::ClientConfig,
9526 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PacketMirrorings>>
9527 {
9528 if gaxi::options::tracing_enabled(&conf) {
9529 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9530 }
9531 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9532 }
9533
9534 async fn build_transport(
9535 conf: gaxi::options::ClientConfig,
9536 ) -> crate::ClientBuilderResult<impl super::stub::PacketMirrorings> {
9537 super::transport::PacketMirrorings::new(conf).await
9538 }
9539
9540 async fn build_with_tracing(
9541 conf: gaxi::options::ClientConfig,
9542 ) -> crate::ClientBuilderResult<impl super::stub::PacketMirrorings> {
9543 Self::build_transport(conf)
9544 .await
9545 .map(super::tracing::PacketMirrorings::new)
9546 }
9547
9548 /// Retrieves an aggregated list of packetMirrorings.
9549 ///
9550 /// To prevent failure, Google recommends that you set the
9551 /// `returnPartialSuccess` parameter to `true`.
9552 pub fn aggregated_list(&self) -> super::builder::packet_mirrorings::AggregatedList {
9553 super::builder::packet_mirrorings::AggregatedList::new(self.inner.clone())
9554 }
9555
9556 /// Deletes the specified PacketMirroring resource.
9557 pub fn delete(&self) -> super::builder::packet_mirrorings::Delete {
9558 super::builder::packet_mirrorings::Delete::new(self.inner.clone())
9559 }
9560
9561 /// Returns the specified PacketMirroring resource.
9562 pub fn get(&self) -> super::builder::packet_mirrorings::Get {
9563 super::builder::packet_mirrorings::Get::new(self.inner.clone())
9564 }
9565
9566 /// Creates a PacketMirroring resource in the specified project and region
9567 /// using the data included in the request.
9568 pub fn insert(&self) -> super::builder::packet_mirrorings::Insert {
9569 super::builder::packet_mirrorings::Insert::new(self.inner.clone())
9570 }
9571
9572 /// Retrieves a list of PacketMirroring resources available to the specified
9573 /// project and region.
9574 pub fn list(&self) -> super::builder::packet_mirrorings::List {
9575 super::builder::packet_mirrorings::List::new(self.inner.clone())
9576 }
9577
9578 /// Patches the specified PacketMirroring resource with the data included in
9579 /// the request. This method supportsPATCH
9580 /// semantics and usesJSON merge
9581 /// patch format and processing rules.
9582 pub fn patch(&self) -> super::builder::packet_mirrorings::Patch {
9583 super::builder::packet_mirrorings::Patch::new(self.inner.clone())
9584 }
9585
9586 /// Returns permissions that a caller has on the specified resource.
9587 pub fn test_iam_permissions(&self) -> super::builder::packet_mirrorings::TestIamPermissions {
9588 super::builder::packet_mirrorings::TestIamPermissions::new(self.inner.clone())
9589 }
9590
9591 /// Retrieves the specified region-specific Operations resource.
9592 pub fn get_operation(&self) -> super::builder::packet_mirrorings::GetOperation {
9593 super::builder::packet_mirrorings::GetOperation::new(self.inner.clone())
9594 }
9595}
9596
9597/// Implements a client for the Google Compute Engine API.
9598///
9599/// # Example
9600/// ```
9601/// # use google_cloud_compute_v1::client::PreviewFeatures;
9602/// async fn sample(
9603/// ) -> anyhow::Result<()> {
9604/// let client = PreviewFeatures::builder().build().await?;
9605/// // use `client` to make requests to the Google Compute Engine API.
9606/// Ok(())
9607/// }
9608/// ```
9609///
9610/// # Service Description
9611///
9612/// Service for the `previewFeatures` resource.
9613///
9614/// # Configuration
9615///
9616/// To configure `PreviewFeatures` use the `with_*` methods in the type returned
9617/// by [builder()][PreviewFeatures::builder]. The default configuration should
9618/// work for most applications. Common configuration changes include
9619///
9620/// * [with_endpoint()]: by default this client uses the global default endpoint
9621/// (`https://compute.googleapis.com`). Applications using regional
9622/// endpoints or running in restricted networks (e.g. a network configured
9623/// with [Private Google Access with VPC Service Controls]) may want to
9624/// override this default.
9625/// * [with_credentials()]: by default this client uses
9626/// [Application Default Credentials]. Applications using custom
9627/// authentication may need to override this default.
9628///
9629/// [with_endpoint()]: super::builder::preview_features::ClientBuilder::with_endpoint
9630/// [with_credentials()]: super::builder::preview_features::ClientBuilder::with_credentials
9631/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9632/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9633///
9634/// # Pooling and Cloning
9635///
9636/// `PreviewFeatures` holds a connection pool internally, it is advised to
9637/// create one and reuse it. You do not need to wrap `PreviewFeatures` in
9638/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9639/// already uses an `Arc` internally.
9640#[cfg(feature = "preview-features")]
9641#[cfg_attr(docsrs, doc(cfg(feature = "preview-features")))]
9642#[derive(Clone, Debug)]
9643pub struct PreviewFeatures {
9644 inner: std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>,
9645}
9646
9647#[cfg(feature = "preview-features")]
9648impl PreviewFeatures {
9649 /// Returns a builder for [PreviewFeatures].
9650 ///
9651 /// ```
9652 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9653 /// # use google_cloud_compute_v1::client::PreviewFeatures;
9654 /// let client = PreviewFeatures::builder().build().await?;
9655 /// # Ok(()) }
9656 /// ```
9657 pub fn builder() -> super::builder::preview_features::ClientBuilder {
9658 crate::new_client_builder(super::builder::preview_features::client::Factory)
9659 }
9660
9661 /// Creates a new client from the provided stub.
9662 ///
9663 /// The most common case for calling this function is in tests mocking the
9664 /// client's behavior.
9665 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9666 where
9667 T: super::stub::PreviewFeatures + 'static,
9668 {
9669 Self { inner: stub.into() }
9670 }
9671
9672 pub(crate) async fn new(
9673 config: gaxi::options::ClientConfig,
9674 ) -> crate::ClientBuilderResult<Self> {
9675 let inner = Self::build_inner(config).await?;
9676 Ok(Self { inner })
9677 }
9678
9679 async fn build_inner(
9680 conf: gaxi::options::ClientConfig,
9681 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PreviewFeatures>> {
9682 if gaxi::options::tracing_enabled(&conf) {
9683 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9684 }
9685 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9686 }
9687
9688 async fn build_transport(
9689 conf: gaxi::options::ClientConfig,
9690 ) -> crate::ClientBuilderResult<impl super::stub::PreviewFeatures> {
9691 super::transport::PreviewFeatures::new(conf).await
9692 }
9693
9694 async fn build_with_tracing(
9695 conf: gaxi::options::ClientConfig,
9696 ) -> crate::ClientBuilderResult<impl super::stub::PreviewFeatures> {
9697 Self::build_transport(conf)
9698 .await
9699 .map(super::tracing::PreviewFeatures::new)
9700 }
9701
9702 /// Returns the details of the given PreviewFeature.
9703 pub fn get(&self) -> super::builder::preview_features::Get {
9704 super::builder::preview_features::Get::new(self.inner.clone())
9705 }
9706
9707 /// Returns the details of the given PreviewFeature.
9708 pub fn list(&self) -> super::builder::preview_features::List {
9709 super::builder::preview_features::List::new(self.inner.clone())
9710 }
9711
9712 /// Patches the given PreviewFeature. This method is used to enable or disable
9713 /// a PreviewFeature.
9714 pub fn update(&self) -> super::builder::preview_features::Update {
9715 super::builder::preview_features::Update::new(self.inner.clone())
9716 }
9717
9718 /// Retrieves the specified Operations resource.
9719 pub fn get_operation(&self) -> super::builder::preview_features::GetOperation {
9720 super::builder::preview_features::GetOperation::new(self.inner.clone())
9721 }
9722}
9723
9724/// Implements a client for the Google Compute Engine API.
9725///
9726/// # Example
9727/// ```
9728/// # use google_cloud_compute_v1::client::Projects;
9729/// async fn sample(
9730/// ) -> anyhow::Result<()> {
9731/// let client = Projects::builder().build().await?;
9732/// // use `client` to make requests to the Google Compute Engine API.
9733/// Ok(())
9734/// }
9735/// ```
9736///
9737/// # Service Description
9738///
9739/// Service for the `projects` resource.
9740///
9741/// # Configuration
9742///
9743/// To configure `Projects` use the `with_*` methods in the type returned
9744/// by [builder()][Projects::builder]. The default configuration should
9745/// work for most applications. Common configuration changes include
9746///
9747/// * [with_endpoint()]: by default this client uses the global default endpoint
9748/// (`https://compute.googleapis.com`). Applications using regional
9749/// endpoints or running in restricted networks (e.g. a network configured
9750/// with [Private Google Access with VPC Service Controls]) may want to
9751/// override this default.
9752/// * [with_credentials()]: by default this client uses
9753/// [Application Default Credentials]. Applications using custom
9754/// authentication may need to override this default.
9755///
9756/// [with_endpoint()]: super::builder::projects::ClientBuilder::with_endpoint
9757/// [with_credentials()]: super::builder::projects::ClientBuilder::with_credentials
9758/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9759/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9760///
9761/// # Pooling and Cloning
9762///
9763/// `Projects` holds a connection pool internally, it is advised to
9764/// create one and reuse it. You do not need to wrap `Projects` in
9765/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9766/// already uses an `Arc` internally.
9767#[cfg(feature = "projects")]
9768#[cfg_attr(docsrs, doc(cfg(feature = "projects")))]
9769#[derive(Clone, Debug)]
9770pub struct Projects {
9771 inner: std::sync::Arc<dyn super::stub::dynamic::Projects>,
9772}
9773
9774#[cfg(feature = "projects")]
9775impl Projects {
9776 /// Returns a builder for [Projects].
9777 ///
9778 /// ```
9779 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9780 /// # use google_cloud_compute_v1::client::Projects;
9781 /// let client = Projects::builder().build().await?;
9782 /// # Ok(()) }
9783 /// ```
9784 pub fn builder() -> super::builder::projects::ClientBuilder {
9785 crate::new_client_builder(super::builder::projects::client::Factory)
9786 }
9787
9788 /// Creates a new client from the provided stub.
9789 ///
9790 /// The most common case for calling this function is in tests mocking the
9791 /// client's behavior.
9792 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
9793 where
9794 T: super::stub::Projects + 'static,
9795 {
9796 Self { inner: stub.into() }
9797 }
9798
9799 pub(crate) async fn new(
9800 config: gaxi::options::ClientConfig,
9801 ) -> crate::ClientBuilderResult<Self> {
9802 let inner = Self::build_inner(config).await?;
9803 Ok(Self { inner })
9804 }
9805
9806 async fn build_inner(
9807 conf: gaxi::options::ClientConfig,
9808 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Projects>> {
9809 if gaxi::options::tracing_enabled(&conf) {
9810 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
9811 }
9812 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
9813 }
9814
9815 async fn build_transport(
9816 conf: gaxi::options::ClientConfig,
9817 ) -> crate::ClientBuilderResult<impl super::stub::Projects> {
9818 super::transport::Projects::new(conf).await
9819 }
9820
9821 async fn build_with_tracing(
9822 conf: gaxi::options::ClientConfig,
9823 ) -> crate::ClientBuilderResult<impl super::stub::Projects> {
9824 Self::build_transport(conf)
9825 .await
9826 .map(super::tracing::Projects::new)
9827 }
9828
9829 /// Disable this project as a shared VPC host project.
9830 pub fn disable_xpn_host(&self) -> super::builder::projects::DisableXpnHost {
9831 super::builder::projects::DisableXpnHost::new(self.inner.clone())
9832 }
9833
9834 /// Disable a service resource (also known as service project) associated with
9835 /// this host project.
9836 pub fn disable_xpn_resource(&self) -> super::builder::projects::DisableXpnResource {
9837 super::builder::projects::DisableXpnResource::new(self.inner.clone())
9838 }
9839
9840 /// Enable this project as a shared VPC host project.
9841 pub fn enable_xpn_host(&self) -> super::builder::projects::EnableXpnHost {
9842 super::builder::projects::EnableXpnHost::new(self.inner.clone())
9843 }
9844
9845 /// Enable service resource (a.k.a service project) for a host project, so that
9846 /// subnets in the host project can be used by instances in the service
9847 /// project.
9848 pub fn enable_xpn_resource(&self) -> super::builder::projects::EnableXpnResource {
9849 super::builder::projects::EnableXpnResource::new(self.inner.clone())
9850 }
9851
9852 /// Returns the specified Project resource.
9853 ///
9854 /// To decrease latency for this method, you can optionally omit any unneeded
9855 /// information from the response by using a field mask. This practice is
9856 /// especially recommended for unused quota information (the `quotas` field).
9857 /// To exclude one or more fields, set your request's `fields` query parameter
9858 /// to only include the fields you need. For example, to only include the `id`
9859 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
9860 /// your request.
9861 pub fn get(&self) -> super::builder::projects::Get {
9862 super::builder::projects::Get::new(self.inner.clone())
9863 }
9864
9865 /// Gets the shared VPC host project that this project links to. May be empty
9866 /// if no link exists.
9867 pub fn get_xpn_host(&self) -> super::builder::projects::GetXpnHost {
9868 super::builder::projects::GetXpnHost::new(self.inner.clone())
9869 }
9870
9871 /// Gets service resources (a.k.a service project) associated with this host
9872 /// project.
9873 pub fn get_xpn_resources(&self) -> super::builder::projects::GetXpnResources {
9874 super::builder::projects::GetXpnResources::new(self.inner.clone())
9875 }
9876
9877 /// Lists all shared VPC host projects visible to the user in an organization.
9878 pub fn list_xpn_hosts(&self) -> super::builder::projects::ListXpnHosts {
9879 super::builder::projects::ListXpnHosts::new(self.inner.clone())
9880 }
9881
9882 /// Moves a persistent disk from one zone to another.
9883 /// *Note*: The moveDisk API will be deprecated on September 29, 2026.
9884 ///
9885 /// Starting September 29, 2025, you can't use the moveDisk API on new
9886 /// projects. To move a disk to a different region or zone, follow the steps in
9887 /// [Change the location of a
9888 /// disk](https://cloud.google.com/compute/docs/disks/migrate-to-hyperdisk#migrate-to-hd).
9889 ///
9890 /// Projects that already use the moveDisk API can continue usage until
9891 /// September 29, 2026.
9892 ///
9893 /// Starting November 1, 2025, API responses will include a warning message in
9894 /// the response body about the upcoming deprecation. You can skip the message
9895 /// to continue using the service without interruption.
9896 #[deprecated]
9897 pub fn move_disk(&self) -> super::builder::projects::MoveDisk {
9898 super::builder::projects::MoveDisk::new(self.inner.clone())
9899 }
9900
9901 /// Moves an instance and its attached persistent disks from one zone to
9902 /// another.
9903 /// *Note*: Moving VMs or disks by using this method might
9904 /// cause unexpected behavior. For more information, see the [known
9905 /// issue](/compute/docs/troubleshooting/known-issues#moving_vms_or_disks_using_the_moveinstance_api_or_the_causes_unexpected_behavior).
9906 /// [Deprecated] This method is deprecated. See [moving instance across
9907 /// zones](/compute/docs/instances/moving-instance-across-zones) instead.
9908 #[deprecated]
9909 pub fn move_instance(&self) -> super::builder::projects::MoveInstance {
9910 super::builder::projects::MoveInstance::new(self.inner.clone())
9911 }
9912
9913 /// Sets the Cloud Armor tier of the project. To set ENTERPRISE or above the
9914 /// billing account of the project must be subscribed to Cloud Armor
9915 /// Enterprise. See Subscribing
9916 /// to Cloud Armor Enterprise for more information.
9917 pub fn set_cloud_armor_tier(&self) -> super::builder::projects::SetCloudArmorTier {
9918 super::builder::projects::SetCloudArmorTier::new(self.inner.clone())
9919 }
9920
9921 /// Sets metadata common to all instances within the specified project using
9922 /// the data included in the request.
9923 pub fn set_common_instance_metadata(
9924 &self,
9925 ) -> super::builder::projects::SetCommonInstanceMetadata {
9926 super::builder::projects::SetCommonInstanceMetadata::new(self.inner.clone())
9927 }
9928
9929 /// Sets the default network tier of the project. The default network tier is
9930 /// used when an address/forwardingRule/instance is created without specifying
9931 /// the network tier field.
9932 pub fn set_default_network_tier(&self) -> super::builder::projects::SetDefaultNetworkTier {
9933 super::builder::projects::SetDefaultNetworkTier::new(self.inner.clone())
9934 }
9935
9936 /// Enables the usage export feature and sets theusage export bucket
9937 /// where reports are stored. If you provide an empty request body using this
9938 /// method, the usage export feature will be disabled.
9939 pub fn set_usage_export_bucket(&self) -> super::builder::projects::SetUsageExportBucket {
9940 super::builder::projects::SetUsageExportBucket::new(self.inner.clone())
9941 }
9942
9943 /// Retrieves the specified Operations resource.
9944 pub fn get_operation(&self) -> super::builder::projects::GetOperation {
9945 super::builder::projects::GetOperation::new(self.inner.clone())
9946 }
9947}
9948
9949/// Implements a client for the Google Compute Engine API.
9950///
9951/// # Example
9952/// ```
9953/// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
9954/// async fn sample(
9955/// ) -> anyhow::Result<()> {
9956/// let client = PublicAdvertisedPrefixes::builder().build().await?;
9957/// // use `client` to make requests to the Google Compute Engine API.
9958/// Ok(())
9959/// }
9960/// ```
9961///
9962/// # Service Description
9963///
9964/// Service for the `publicAdvertisedPrefixes` resource.
9965///
9966/// # Configuration
9967///
9968/// To configure `PublicAdvertisedPrefixes` use the `with_*` methods in the type returned
9969/// by [builder()][PublicAdvertisedPrefixes::builder]. The default configuration should
9970/// work for most applications. Common configuration changes include
9971///
9972/// * [with_endpoint()]: by default this client uses the global default endpoint
9973/// (`https://compute.googleapis.com`). Applications using regional
9974/// endpoints or running in restricted networks (e.g. a network configured
9975/// with [Private Google Access with VPC Service Controls]) may want to
9976/// override this default.
9977/// * [with_credentials()]: by default this client uses
9978/// [Application Default Credentials]. Applications using custom
9979/// authentication may need to override this default.
9980///
9981/// [with_endpoint()]: super::builder::public_advertised_prefixes::ClientBuilder::with_endpoint
9982/// [with_credentials()]: super::builder::public_advertised_prefixes::ClientBuilder::with_credentials
9983/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
9984/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
9985///
9986/// # Pooling and Cloning
9987///
9988/// `PublicAdvertisedPrefixes` holds a connection pool internally, it is advised to
9989/// create one and reuse it. You do not need to wrap `PublicAdvertisedPrefixes` in
9990/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
9991/// already uses an `Arc` internally.
9992#[cfg(feature = "public-advertised-prefixes")]
9993#[cfg_attr(docsrs, doc(cfg(feature = "public-advertised-prefixes")))]
9994#[derive(Clone, Debug)]
9995pub struct PublicAdvertisedPrefixes {
9996 inner: std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
9997}
9998
9999#[cfg(feature = "public-advertised-prefixes")]
10000impl PublicAdvertisedPrefixes {
10001 /// Returns a builder for [PublicAdvertisedPrefixes].
10002 ///
10003 /// ```
10004 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10005 /// # use google_cloud_compute_v1::client::PublicAdvertisedPrefixes;
10006 /// let client = PublicAdvertisedPrefixes::builder().build().await?;
10007 /// # Ok(()) }
10008 /// ```
10009 pub fn builder() -> super::builder::public_advertised_prefixes::ClientBuilder {
10010 crate::new_client_builder(super::builder::public_advertised_prefixes::client::Factory)
10011 }
10012
10013 /// Creates a new client from the provided stub.
10014 ///
10015 /// The most common case for calling this function is in tests mocking the
10016 /// client's behavior.
10017 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10018 where
10019 T: super::stub::PublicAdvertisedPrefixes + 'static,
10020 {
10021 Self { inner: stub.into() }
10022 }
10023
10024 pub(crate) async fn new(
10025 config: gaxi::options::ClientConfig,
10026 ) -> crate::ClientBuilderResult<Self> {
10027 let inner = Self::build_inner(config).await?;
10028 Ok(Self { inner })
10029 }
10030
10031 async fn build_inner(
10032 conf: gaxi::options::ClientConfig,
10033 ) -> crate::ClientBuilderResult<
10034 std::sync::Arc<dyn super::stub::dynamic::PublicAdvertisedPrefixes>,
10035 > {
10036 if gaxi::options::tracing_enabled(&conf) {
10037 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10038 }
10039 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10040 }
10041
10042 async fn build_transport(
10043 conf: gaxi::options::ClientConfig,
10044 ) -> crate::ClientBuilderResult<impl super::stub::PublicAdvertisedPrefixes> {
10045 super::transport::PublicAdvertisedPrefixes::new(conf).await
10046 }
10047
10048 async fn build_with_tracing(
10049 conf: gaxi::options::ClientConfig,
10050 ) -> crate::ClientBuilderResult<impl super::stub::PublicAdvertisedPrefixes> {
10051 Self::build_transport(conf)
10052 .await
10053 .map(super::tracing::PublicAdvertisedPrefixes::new)
10054 }
10055
10056 /// Announces the specified PublicAdvertisedPrefix
10057 pub fn announce(&self) -> super::builder::public_advertised_prefixes::Announce {
10058 super::builder::public_advertised_prefixes::Announce::new(self.inner.clone())
10059 }
10060
10061 /// Deletes the specified PublicAdvertisedPrefix
10062 pub fn delete(&self) -> super::builder::public_advertised_prefixes::Delete {
10063 super::builder::public_advertised_prefixes::Delete::new(self.inner.clone())
10064 }
10065
10066 /// Returns the specified PublicAdvertisedPrefix resource.
10067 pub fn get(&self) -> super::builder::public_advertised_prefixes::Get {
10068 super::builder::public_advertised_prefixes::Get::new(self.inner.clone())
10069 }
10070
10071 /// Creates a PublicAdvertisedPrefix in the specified project
10072 /// using the parameters that are included in the request.
10073 pub fn insert(&self) -> super::builder::public_advertised_prefixes::Insert {
10074 super::builder::public_advertised_prefixes::Insert::new(self.inner.clone())
10075 }
10076
10077 /// Lists the PublicAdvertisedPrefixes for a project.
10078 pub fn list(&self) -> super::builder::public_advertised_prefixes::List {
10079 super::builder::public_advertised_prefixes::List::new(self.inner.clone())
10080 }
10081
10082 /// Patches the specified Router resource with the data included in the
10083 /// request. This method supportsPATCH
10084 /// semantics and usesJSON merge
10085 /// patch format and processing rules.
10086 pub fn patch(&self) -> super::builder::public_advertised_prefixes::Patch {
10087 super::builder::public_advertised_prefixes::Patch::new(self.inner.clone())
10088 }
10089
10090 /// Withdraws the specified PublicAdvertisedPrefix
10091 pub fn withdraw(&self) -> super::builder::public_advertised_prefixes::Withdraw {
10092 super::builder::public_advertised_prefixes::Withdraw::new(self.inner.clone())
10093 }
10094
10095 /// Retrieves the specified Operations resource.
10096 pub fn get_operation(&self) -> super::builder::public_advertised_prefixes::GetOperation {
10097 super::builder::public_advertised_prefixes::GetOperation::new(self.inner.clone())
10098 }
10099}
10100
10101/// Implements a client for the Google Compute Engine API.
10102///
10103/// # Example
10104/// ```
10105/// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
10106/// async fn sample(
10107/// ) -> anyhow::Result<()> {
10108/// let client = PublicDelegatedPrefixes::builder().build().await?;
10109/// // use `client` to make requests to the Google Compute Engine API.
10110/// Ok(())
10111/// }
10112/// ```
10113///
10114/// # Service Description
10115///
10116/// Service for the `publicDelegatedPrefixes` resource.
10117///
10118/// # Configuration
10119///
10120/// To configure `PublicDelegatedPrefixes` use the `with_*` methods in the type returned
10121/// by [builder()][PublicDelegatedPrefixes::builder]. The default configuration should
10122/// work for most applications. Common configuration changes include
10123///
10124/// * [with_endpoint()]: by default this client uses the global default endpoint
10125/// (`https://compute.googleapis.com`). Applications using regional
10126/// endpoints or running in restricted networks (e.g. a network configured
10127/// with [Private Google Access with VPC Service Controls]) may want to
10128/// override this default.
10129/// * [with_credentials()]: by default this client uses
10130/// [Application Default Credentials]. Applications using custom
10131/// authentication may need to override this default.
10132///
10133/// [with_endpoint()]: super::builder::public_delegated_prefixes::ClientBuilder::with_endpoint
10134/// [with_credentials()]: super::builder::public_delegated_prefixes::ClientBuilder::with_credentials
10135/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10136/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10137///
10138/// # Pooling and Cloning
10139///
10140/// `PublicDelegatedPrefixes` holds a connection pool internally, it is advised to
10141/// create one and reuse it. You do not need to wrap `PublicDelegatedPrefixes` in
10142/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10143/// already uses an `Arc` internally.
10144#[cfg(feature = "public-delegated-prefixes")]
10145#[cfg_attr(docsrs, doc(cfg(feature = "public-delegated-prefixes")))]
10146#[derive(Clone, Debug)]
10147pub struct PublicDelegatedPrefixes {
10148 inner: std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>,
10149}
10150
10151#[cfg(feature = "public-delegated-prefixes")]
10152impl PublicDelegatedPrefixes {
10153 /// Returns a builder for [PublicDelegatedPrefixes].
10154 ///
10155 /// ```
10156 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10157 /// # use google_cloud_compute_v1::client::PublicDelegatedPrefixes;
10158 /// let client = PublicDelegatedPrefixes::builder().build().await?;
10159 /// # Ok(()) }
10160 /// ```
10161 pub fn builder() -> super::builder::public_delegated_prefixes::ClientBuilder {
10162 crate::new_client_builder(super::builder::public_delegated_prefixes::client::Factory)
10163 }
10164
10165 /// Creates a new client from the provided stub.
10166 ///
10167 /// The most common case for calling this function is in tests mocking the
10168 /// client's behavior.
10169 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10170 where
10171 T: super::stub::PublicDelegatedPrefixes + 'static,
10172 {
10173 Self { inner: stub.into() }
10174 }
10175
10176 pub(crate) async fn new(
10177 config: gaxi::options::ClientConfig,
10178 ) -> crate::ClientBuilderResult<Self> {
10179 let inner = Self::build_inner(config).await?;
10180 Ok(Self { inner })
10181 }
10182
10183 async fn build_inner(
10184 conf: gaxi::options::ClientConfig,
10185 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::PublicDelegatedPrefixes>>
10186 {
10187 if gaxi::options::tracing_enabled(&conf) {
10188 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10189 }
10190 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10191 }
10192
10193 async fn build_transport(
10194 conf: gaxi::options::ClientConfig,
10195 ) -> crate::ClientBuilderResult<impl super::stub::PublicDelegatedPrefixes> {
10196 super::transport::PublicDelegatedPrefixes::new(conf).await
10197 }
10198
10199 async fn build_with_tracing(
10200 conf: gaxi::options::ClientConfig,
10201 ) -> crate::ClientBuilderResult<impl super::stub::PublicDelegatedPrefixes> {
10202 Self::build_transport(conf)
10203 .await
10204 .map(super::tracing::PublicDelegatedPrefixes::new)
10205 }
10206
10207 /// Lists all PublicDelegatedPrefix resources owned by the specific project
10208 /// across all scopes.
10209 ///
10210 /// To prevent failure, Google recommends that you set the
10211 /// `returnPartialSuccess` parameter to `true`.
10212 pub fn aggregated_list(&self) -> super::builder::public_delegated_prefixes::AggregatedList {
10213 super::builder::public_delegated_prefixes::AggregatedList::new(self.inner.clone())
10214 }
10215
10216 /// Announces the specified PublicDelegatedPrefix in the given region.
10217 pub fn announce(&self) -> super::builder::public_delegated_prefixes::Announce {
10218 super::builder::public_delegated_prefixes::Announce::new(self.inner.clone())
10219 }
10220
10221 /// Deletes the specified PublicDelegatedPrefix in the given region.
10222 pub fn delete(&self) -> super::builder::public_delegated_prefixes::Delete {
10223 super::builder::public_delegated_prefixes::Delete::new(self.inner.clone())
10224 }
10225
10226 /// Returns the specified PublicDelegatedPrefix resource in the given region.
10227 pub fn get(&self) -> super::builder::public_delegated_prefixes::Get {
10228 super::builder::public_delegated_prefixes::Get::new(self.inner.clone())
10229 }
10230
10231 /// Creates a PublicDelegatedPrefix in the specified project in the given
10232 /// region using the parameters that are included in the request.
10233 pub fn insert(&self) -> super::builder::public_delegated_prefixes::Insert {
10234 super::builder::public_delegated_prefixes::Insert::new(self.inner.clone())
10235 }
10236
10237 /// Lists the PublicDelegatedPrefixes for a project in the given region.
10238 pub fn list(&self) -> super::builder::public_delegated_prefixes::List {
10239 super::builder::public_delegated_prefixes::List::new(self.inner.clone())
10240 }
10241
10242 /// Patches the specified PublicDelegatedPrefix resource with the data included
10243 /// in the request. This method supportsPATCH
10244 /// semantics and usesJSON merge
10245 /// patch format and processing rules.
10246 pub fn patch(&self) -> super::builder::public_delegated_prefixes::Patch {
10247 super::builder::public_delegated_prefixes::Patch::new(self.inner.clone())
10248 }
10249
10250 /// Withdraws the specified PublicDelegatedPrefix in the given region.
10251 pub fn withdraw(&self) -> super::builder::public_delegated_prefixes::Withdraw {
10252 super::builder::public_delegated_prefixes::Withdraw::new(self.inner.clone())
10253 }
10254
10255 /// Retrieves the specified region-specific Operations resource.
10256 pub fn get_operation(&self) -> super::builder::public_delegated_prefixes::GetOperation {
10257 super::builder::public_delegated_prefixes::GetOperation::new(self.inner.clone())
10258 }
10259}
10260
10261/// Implements a client for the Google Compute Engine API.
10262///
10263/// # Example
10264/// ```
10265/// # use google_cloud_compute_v1::client::RegionAutoscalers;
10266/// async fn sample(
10267/// ) -> anyhow::Result<()> {
10268/// let client = RegionAutoscalers::builder().build().await?;
10269/// // use `client` to make requests to the Google Compute Engine API.
10270/// Ok(())
10271/// }
10272/// ```
10273///
10274/// # Service Description
10275///
10276/// Service for the `regionAutoscalers` resource.
10277///
10278/// # Configuration
10279///
10280/// To configure `RegionAutoscalers` use the `with_*` methods in the type returned
10281/// by [builder()][RegionAutoscalers::builder]. The default configuration should
10282/// work for most applications. Common configuration changes include
10283///
10284/// * [with_endpoint()]: by default this client uses the global default endpoint
10285/// (`https://compute.googleapis.com`). Applications using regional
10286/// endpoints or running in restricted networks (e.g. a network configured
10287/// with [Private Google Access with VPC Service Controls]) may want to
10288/// override this default.
10289/// * [with_credentials()]: by default this client uses
10290/// [Application Default Credentials]. Applications using custom
10291/// authentication may need to override this default.
10292///
10293/// [with_endpoint()]: super::builder::region_autoscalers::ClientBuilder::with_endpoint
10294/// [with_credentials()]: super::builder::region_autoscalers::ClientBuilder::with_credentials
10295/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10296/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10297///
10298/// # Pooling and Cloning
10299///
10300/// `RegionAutoscalers` holds a connection pool internally, it is advised to
10301/// create one and reuse it. You do not need to wrap `RegionAutoscalers` in
10302/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10303/// already uses an `Arc` internally.
10304#[cfg(feature = "region-autoscalers")]
10305#[cfg_attr(docsrs, doc(cfg(feature = "region-autoscalers")))]
10306#[derive(Clone, Debug)]
10307pub struct RegionAutoscalers {
10308 inner: std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>,
10309}
10310
10311#[cfg(feature = "region-autoscalers")]
10312impl RegionAutoscalers {
10313 /// Returns a builder for [RegionAutoscalers].
10314 ///
10315 /// ```
10316 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10317 /// # use google_cloud_compute_v1::client::RegionAutoscalers;
10318 /// let client = RegionAutoscalers::builder().build().await?;
10319 /// # Ok(()) }
10320 /// ```
10321 pub fn builder() -> super::builder::region_autoscalers::ClientBuilder {
10322 crate::new_client_builder(super::builder::region_autoscalers::client::Factory)
10323 }
10324
10325 /// Creates a new client from the provided stub.
10326 ///
10327 /// The most common case for calling this function is in tests mocking the
10328 /// client's behavior.
10329 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10330 where
10331 T: super::stub::RegionAutoscalers + 'static,
10332 {
10333 Self { inner: stub.into() }
10334 }
10335
10336 pub(crate) async fn new(
10337 config: gaxi::options::ClientConfig,
10338 ) -> crate::ClientBuilderResult<Self> {
10339 let inner = Self::build_inner(config).await?;
10340 Ok(Self { inner })
10341 }
10342
10343 async fn build_inner(
10344 conf: gaxi::options::ClientConfig,
10345 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionAutoscalers>>
10346 {
10347 if gaxi::options::tracing_enabled(&conf) {
10348 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10349 }
10350 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10351 }
10352
10353 async fn build_transport(
10354 conf: gaxi::options::ClientConfig,
10355 ) -> crate::ClientBuilderResult<impl super::stub::RegionAutoscalers> {
10356 super::transport::RegionAutoscalers::new(conf).await
10357 }
10358
10359 async fn build_with_tracing(
10360 conf: gaxi::options::ClientConfig,
10361 ) -> crate::ClientBuilderResult<impl super::stub::RegionAutoscalers> {
10362 Self::build_transport(conf)
10363 .await
10364 .map(super::tracing::RegionAutoscalers::new)
10365 }
10366
10367 /// Deletes the specified autoscaler.
10368 pub fn delete(&self) -> super::builder::region_autoscalers::Delete {
10369 super::builder::region_autoscalers::Delete::new(self.inner.clone())
10370 }
10371
10372 /// Returns the specified autoscaler.
10373 pub fn get(&self) -> super::builder::region_autoscalers::Get {
10374 super::builder::region_autoscalers::Get::new(self.inner.clone())
10375 }
10376
10377 /// Creates an autoscaler in the specified project using
10378 /// the data included in the request.
10379 pub fn insert(&self) -> super::builder::region_autoscalers::Insert {
10380 super::builder::region_autoscalers::Insert::new(self.inner.clone())
10381 }
10382
10383 /// Retrieves a list of autoscalers contained within
10384 /// the specified region.
10385 pub fn list(&self) -> super::builder::region_autoscalers::List {
10386 super::builder::region_autoscalers::List::new(self.inner.clone())
10387 }
10388
10389 /// Updates an autoscaler in the specified project using
10390 /// the data included in the request. This method supportsPATCH
10391 /// semantics and uses theJSON merge
10392 /// patch format and processing rules.
10393 pub fn patch(&self) -> super::builder::region_autoscalers::Patch {
10394 super::builder::region_autoscalers::Patch::new(self.inner.clone())
10395 }
10396
10397 /// Returns permissions that a caller has on the specified resource.
10398 pub fn test_iam_permissions(&self) -> super::builder::region_autoscalers::TestIamPermissions {
10399 super::builder::region_autoscalers::TestIamPermissions::new(self.inner.clone())
10400 }
10401
10402 /// Updates an autoscaler in the specified project using
10403 /// the data included in the request.
10404 pub fn update(&self) -> super::builder::region_autoscalers::Update {
10405 super::builder::region_autoscalers::Update::new(self.inner.clone())
10406 }
10407
10408 /// Retrieves the specified region-specific Operations resource.
10409 pub fn get_operation(&self) -> super::builder::region_autoscalers::GetOperation {
10410 super::builder::region_autoscalers::GetOperation::new(self.inner.clone())
10411 }
10412}
10413
10414/// Implements a client for the Google Compute Engine API.
10415///
10416/// # Example
10417/// ```
10418/// # use google_cloud_compute_v1::client::RegionBackendBuckets;
10419/// async fn sample(
10420/// ) -> anyhow::Result<()> {
10421/// let client = RegionBackendBuckets::builder().build().await?;
10422/// // use `client` to make requests to the Google Compute Engine API.
10423/// Ok(())
10424/// }
10425/// ```
10426///
10427/// # Service Description
10428///
10429/// Service for the `regionBackendBuckets` resource.
10430///
10431/// # Configuration
10432///
10433/// To configure `RegionBackendBuckets` use the `with_*` methods in the type returned
10434/// by [builder()][RegionBackendBuckets::builder]. The default configuration should
10435/// work for most applications. Common configuration changes include
10436///
10437/// * [with_endpoint()]: by default this client uses the global default endpoint
10438/// (`https://compute.googleapis.com`). Applications using regional
10439/// endpoints or running in restricted networks (e.g. a network configured
10440/// with [Private Google Access with VPC Service Controls]) may want to
10441/// override this default.
10442/// * [with_credentials()]: by default this client uses
10443/// [Application Default Credentials]. Applications using custom
10444/// authentication may need to override this default.
10445///
10446/// [with_endpoint()]: super::builder::region_backend_buckets::ClientBuilder::with_endpoint
10447/// [with_credentials()]: super::builder::region_backend_buckets::ClientBuilder::with_credentials
10448/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10449/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10450///
10451/// # Pooling and Cloning
10452///
10453/// `RegionBackendBuckets` holds a connection pool internally, it is advised to
10454/// create one and reuse it. You do not need to wrap `RegionBackendBuckets` in
10455/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10456/// already uses an `Arc` internally.
10457#[cfg(feature = "region-backend-buckets")]
10458#[cfg_attr(docsrs, doc(cfg(feature = "region-backend-buckets")))]
10459#[derive(Clone, Debug)]
10460pub struct RegionBackendBuckets {
10461 inner: std::sync::Arc<dyn super::stub::dynamic::RegionBackendBuckets>,
10462}
10463
10464#[cfg(feature = "region-backend-buckets")]
10465impl RegionBackendBuckets {
10466 /// Returns a builder for [RegionBackendBuckets].
10467 ///
10468 /// ```
10469 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10470 /// # use google_cloud_compute_v1::client::RegionBackendBuckets;
10471 /// let client = RegionBackendBuckets::builder().build().await?;
10472 /// # Ok(()) }
10473 /// ```
10474 pub fn builder() -> super::builder::region_backend_buckets::ClientBuilder {
10475 crate::new_client_builder(super::builder::region_backend_buckets::client::Factory)
10476 }
10477
10478 /// Creates a new client from the provided stub.
10479 ///
10480 /// The most common case for calling this function is in tests mocking the
10481 /// client's behavior.
10482 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10483 where
10484 T: super::stub::RegionBackendBuckets + 'static,
10485 {
10486 Self { inner: stub.into() }
10487 }
10488
10489 pub(crate) async fn new(
10490 config: gaxi::options::ClientConfig,
10491 ) -> crate::ClientBuilderResult<Self> {
10492 let inner = Self::build_inner(config).await?;
10493 Ok(Self { inner })
10494 }
10495
10496 async fn build_inner(
10497 conf: gaxi::options::ClientConfig,
10498 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionBackendBuckets>>
10499 {
10500 if gaxi::options::tracing_enabled(&conf) {
10501 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10502 }
10503 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10504 }
10505
10506 async fn build_transport(
10507 conf: gaxi::options::ClientConfig,
10508 ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendBuckets> {
10509 super::transport::RegionBackendBuckets::new(conf).await
10510 }
10511
10512 async fn build_with_tracing(
10513 conf: gaxi::options::ClientConfig,
10514 ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendBuckets> {
10515 Self::build_transport(conf)
10516 .await
10517 .map(super::tracing::RegionBackendBuckets::new)
10518 }
10519
10520 /// Deletes the specified regional BackendBucket resource.
10521 pub fn delete(&self) -> super::builder::region_backend_buckets::Delete {
10522 super::builder::region_backend_buckets::Delete::new(self.inner.clone())
10523 }
10524
10525 /// Returns the specified regional BackendBucket resource.
10526 pub fn get(&self) -> super::builder::region_backend_buckets::Get {
10527 super::builder::region_backend_buckets::Get::new(self.inner.clone())
10528 }
10529
10530 /// Gets the access control policy for a resource. May be empty if no such
10531 /// policy or resource exists.
10532 pub fn get_iam_policy(&self) -> super::builder::region_backend_buckets::GetIamPolicy {
10533 super::builder::region_backend_buckets::GetIamPolicy::new(self.inner.clone())
10534 }
10535
10536 /// Creates a RegionBackendBucket in the specified project in the given scope
10537 /// using the parameters that are included in the request.
10538 pub fn insert(&self) -> super::builder::region_backend_buckets::Insert {
10539 super::builder::region_backend_buckets::Insert::new(self.inner.clone())
10540 }
10541
10542 /// Retrieves the list of BackendBucket resources available to the specified
10543 /// project in the given region.
10544 pub fn list(&self) -> super::builder::region_backend_buckets::List {
10545 super::builder::region_backend_buckets::List::new(self.inner.clone())
10546 }
10547
10548 /// Retrieves a list of all usable backend buckets in the specified project in
10549 /// the given region.
10550 pub fn list_usable(&self) -> super::builder::region_backend_buckets::ListUsable {
10551 super::builder::region_backend_buckets::ListUsable::new(self.inner.clone())
10552 }
10553
10554 /// Updates the specified BackendBucket resource with the data included in the
10555 /// request. This method supportsPATCH
10556 /// semantics and uses theJSON merge
10557 /// patch format and processing rules.
10558 pub fn patch(&self) -> super::builder::region_backend_buckets::Patch {
10559 super::builder::region_backend_buckets::Patch::new(self.inner.clone())
10560 }
10561
10562 /// Sets the access control policy on the specified resource.
10563 /// Replaces any existing policy.
10564 pub fn set_iam_policy(&self) -> super::builder::region_backend_buckets::SetIamPolicy {
10565 super::builder::region_backend_buckets::SetIamPolicy::new(self.inner.clone())
10566 }
10567
10568 /// Returns permissions that a caller has on the specified resource.
10569 pub fn test_iam_permissions(
10570 &self,
10571 ) -> super::builder::region_backend_buckets::TestIamPermissions {
10572 super::builder::region_backend_buckets::TestIamPermissions::new(self.inner.clone())
10573 }
10574
10575 /// Retrieves the specified region-specific Operations resource.
10576 pub fn get_operation(&self) -> super::builder::region_backend_buckets::GetOperation {
10577 super::builder::region_backend_buckets::GetOperation::new(self.inner.clone())
10578 }
10579}
10580
10581/// Implements a client for the Google Compute Engine API.
10582///
10583/// # Example
10584/// ```
10585/// # use google_cloud_compute_v1::client::RegionBackendServices;
10586/// async fn sample(
10587/// ) -> anyhow::Result<()> {
10588/// let client = RegionBackendServices::builder().build().await?;
10589/// // use `client` to make requests to the Google Compute Engine API.
10590/// Ok(())
10591/// }
10592/// ```
10593///
10594/// # Service Description
10595///
10596/// Service for the `regionBackendServices` resource.
10597///
10598/// # Configuration
10599///
10600/// To configure `RegionBackendServices` use the `with_*` methods in the type returned
10601/// by [builder()][RegionBackendServices::builder]. The default configuration should
10602/// work for most applications. Common configuration changes include
10603///
10604/// * [with_endpoint()]: by default this client uses the global default endpoint
10605/// (`https://compute.googleapis.com`). Applications using regional
10606/// endpoints or running in restricted networks (e.g. a network configured
10607/// with [Private Google Access with VPC Service Controls]) may want to
10608/// override this default.
10609/// * [with_credentials()]: by default this client uses
10610/// [Application Default Credentials]. Applications using custom
10611/// authentication may need to override this default.
10612///
10613/// [with_endpoint()]: super::builder::region_backend_services::ClientBuilder::with_endpoint
10614/// [with_credentials()]: super::builder::region_backend_services::ClientBuilder::with_credentials
10615/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10616/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10617///
10618/// # Pooling and Cloning
10619///
10620/// `RegionBackendServices` holds a connection pool internally, it is advised to
10621/// create one and reuse it. You do not need to wrap `RegionBackendServices` in
10622/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10623/// already uses an `Arc` internally.
10624#[cfg(feature = "region-backend-services")]
10625#[cfg_attr(docsrs, doc(cfg(feature = "region-backend-services")))]
10626#[derive(Clone, Debug)]
10627pub struct RegionBackendServices {
10628 inner: std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>,
10629}
10630
10631#[cfg(feature = "region-backend-services")]
10632impl RegionBackendServices {
10633 /// Returns a builder for [RegionBackendServices].
10634 ///
10635 /// ```
10636 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10637 /// # use google_cloud_compute_v1::client::RegionBackendServices;
10638 /// let client = RegionBackendServices::builder().build().await?;
10639 /// # Ok(()) }
10640 /// ```
10641 pub fn builder() -> super::builder::region_backend_services::ClientBuilder {
10642 crate::new_client_builder(super::builder::region_backend_services::client::Factory)
10643 }
10644
10645 /// Creates a new client from the provided stub.
10646 ///
10647 /// The most common case for calling this function is in tests mocking the
10648 /// client's behavior.
10649 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10650 where
10651 T: super::stub::RegionBackendServices + 'static,
10652 {
10653 Self { inner: stub.into() }
10654 }
10655
10656 pub(crate) async fn new(
10657 config: gaxi::options::ClientConfig,
10658 ) -> crate::ClientBuilderResult<Self> {
10659 let inner = Self::build_inner(config).await?;
10660 Ok(Self { inner })
10661 }
10662
10663 async fn build_inner(
10664 conf: gaxi::options::ClientConfig,
10665 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionBackendServices>>
10666 {
10667 if gaxi::options::tracing_enabled(&conf) {
10668 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10669 }
10670 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10671 }
10672
10673 async fn build_transport(
10674 conf: gaxi::options::ClientConfig,
10675 ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendServices> {
10676 super::transport::RegionBackendServices::new(conf).await
10677 }
10678
10679 async fn build_with_tracing(
10680 conf: gaxi::options::ClientConfig,
10681 ) -> crate::ClientBuilderResult<impl super::stub::RegionBackendServices> {
10682 Self::build_transport(conf)
10683 .await
10684 .map(super::tracing::RegionBackendServices::new)
10685 }
10686
10687 /// Deletes the specified regional BackendService resource.
10688 pub fn delete(&self) -> super::builder::region_backend_services::Delete {
10689 super::builder::region_backend_services::Delete::new(self.inner.clone())
10690 }
10691
10692 /// Returns the specified regional BackendService resource.
10693 pub fn get(&self) -> super::builder::region_backend_services::Get {
10694 super::builder::region_backend_services::Get::new(self.inner.clone())
10695 }
10696
10697 /// Gets the most recent health check results for this
10698 /// regional BackendService.
10699 pub fn get_health(&self) -> super::builder::region_backend_services::GetHealth {
10700 super::builder::region_backend_services::GetHealth::new(self.inner.clone())
10701 }
10702
10703 /// Gets the access control policy for a resource. May be empty if no such
10704 /// policy or resource exists.
10705 pub fn get_iam_policy(&self) -> super::builder::region_backend_services::GetIamPolicy {
10706 super::builder::region_backend_services::GetIamPolicy::new(self.inner.clone())
10707 }
10708
10709 /// Creates a regional BackendService resource in the specified project using
10710 /// the data included in the request. For more information, see
10711 /// Backend services overview.
10712 pub fn insert(&self) -> super::builder::region_backend_services::Insert {
10713 super::builder::region_backend_services::Insert::new(self.inner.clone())
10714 }
10715
10716 /// Retrieves the list of regional BackendService resources available to the
10717 /// specified project in the given region.
10718 pub fn list(&self) -> super::builder::region_backend_services::List {
10719 super::builder::region_backend_services::List::new(self.inner.clone())
10720 }
10721
10722 /// Retrieves a list of all usable backend services for Application Load
10723 /// Balancers and Proxy Network Load Balancers in the specified project in the
10724 /// given region. Backend services for external and internal passthrough
10725 /// Network Load Balancers are not included in the response.
10726 pub fn list_usable(&self) -> super::builder::region_backend_services::ListUsable {
10727 super::builder::region_backend_services::ListUsable::new(self.inner.clone())
10728 }
10729
10730 /// Updates the specified regional BackendService resource with the data
10731 /// included in the request. For more information, see
10732 /// Understanding backend services This method
10733 /// supports PATCH semantics and uses the JSON merge
10734 /// patch format and processing rules.
10735 pub fn patch(&self) -> super::builder::region_backend_services::Patch {
10736 super::builder::region_backend_services::Patch::new(self.inner.clone())
10737 }
10738
10739 /// Sets the access control policy on the specified resource.
10740 /// Replaces any existing policy.
10741 pub fn set_iam_policy(&self) -> super::builder::region_backend_services::SetIamPolicy {
10742 super::builder::region_backend_services::SetIamPolicy::new(self.inner.clone())
10743 }
10744
10745 /// Sets the Google Cloud Armor security policy for the specified backend
10746 /// service. For more information, seeGoogle
10747 /// Cloud Armor Overview
10748 pub fn set_security_policy(
10749 &self,
10750 ) -> super::builder::region_backend_services::SetSecurityPolicy {
10751 super::builder::region_backend_services::SetSecurityPolicy::new(self.inner.clone())
10752 }
10753
10754 /// Returns permissions that a caller has on the specified resource.
10755 pub fn test_iam_permissions(
10756 &self,
10757 ) -> super::builder::region_backend_services::TestIamPermissions {
10758 super::builder::region_backend_services::TestIamPermissions::new(self.inner.clone())
10759 }
10760
10761 /// Updates the specified regional BackendService resource with the data
10762 /// included in the request. For more information,
10763 /// see
10764 /// Backend services overview.
10765 pub fn update(&self) -> super::builder::region_backend_services::Update {
10766 super::builder::region_backend_services::Update::new(self.inner.clone())
10767 }
10768
10769 /// Retrieves the specified region-specific Operations resource.
10770 pub fn get_operation(&self) -> super::builder::region_backend_services::GetOperation {
10771 super::builder::region_backend_services::GetOperation::new(self.inner.clone())
10772 }
10773}
10774
10775/// Implements a client for the Google Compute Engine API.
10776///
10777/// # Example
10778/// ```
10779/// # use google_cloud_compute_v1::client::RegionCommitments;
10780/// async fn sample(
10781/// ) -> anyhow::Result<()> {
10782/// let client = RegionCommitments::builder().build().await?;
10783/// // use `client` to make requests to the Google Compute Engine API.
10784/// Ok(())
10785/// }
10786/// ```
10787///
10788/// # Service Description
10789///
10790/// Service for the `regionCommitments` resource.
10791///
10792/// # Configuration
10793///
10794/// To configure `RegionCommitments` use the `with_*` methods in the type returned
10795/// by [builder()][RegionCommitments::builder]. The default configuration should
10796/// work for most applications. Common configuration changes include
10797///
10798/// * [with_endpoint()]: by default this client uses the global default endpoint
10799/// (`https://compute.googleapis.com`). Applications using regional
10800/// endpoints or running in restricted networks (e.g. a network configured
10801/// with [Private Google Access with VPC Service Controls]) may want to
10802/// override this default.
10803/// * [with_credentials()]: by default this client uses
10804/// [Application Default Credentials]. Applications using custom
10805/// authentication may need to override this default.
10806///
10807/// [with_endpoint()]: super::builder::region_commitments::ClientBuilder::with_endpoint
10808/// [with_credentials()]: super::builder::region_commitments::ClientBuilder::with_credentials
10809/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10810/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10811///
10812/// # Pooling and Cloning
10813///
10814/// `RegionCommitments` holds a connection pool internally, it is advised to
10815/// create one and reuse it. You do not need to wrap `RegionCommitments` in
10816/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10817/// already uses an `Arc` internally.
10818#[cfg(feature = "region-commitments")]
10819#[cfg_attr(docsrs, doc(cfg(feature = "region-commitments")))]
10820#[derive(Clone, Debug)]
10821pub struct RegionCommitments {
10822 inner: std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>,
10823}
10824
10825#[cfg(feature = "region-commitments")]
10826impl RegionCommitments {
10827 /// Returns a builder for [RegionCommitments].
10828 ///
10829 /// ```
10830 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10831 /// # use google_cloud_compute_v1::client::RegionCommitments;
10832 /// let client = RegionCommitments::builder().build().await?;
10833 /// # Ok(()) }
10834 /// ```
10835 pub fn builder() -> super::builder::region_commitments::ClientBuilder {
10836 crate::new_client_builder(super::builder::region_commitments::client::Factory)
10837 }
10838
10839 /// Creates a new client from the provided stub.
10840 ///
10841 /// The most common case for calling this function is in tests mocking the
10842 /// client's behavior.
10843 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10844 where
10845 T: super::stub::RegionCommitments + 'static,
10846 {
10847 Self { inner: stub.into() }
10848 }
10849
10850 pub(crate) async fn new(
10851 config: gaxi::options::ClientConfig,
10852 ) -> crate::ClientBuilderResult<Self> {
10853 let inner = Self::build_inner(config).await?;
10854 Ok(Self { inner })
10855 }
10856
10857 async fn build_inner(
10858 conf: gaxi::options::ClientConfig,
10859 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionCommitments>>
10860 {
10861 if gaxi::options::tracing_enabled(&conf) {
10862 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
10863 }
10864 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
10865 }
10866
10867 async fn build_transport(
10868 conf: gaxi::options::ClientConfig,
10869 ) -> crate::ClientBuilderResult<impl super::stub::RegionCommitments> {
10870 super::transport::RegionCommitments::new(conf).await
10871 }
10872
10873 async fn build_with_tracing(
10874 conf: gaxi::options::ClientConfig,
10875 ) -> crate::ClientBuilderResult<impl super::stub::RegionCommitments> {
10876 Self::build_transport(conf)
10877 .await
10878 .map(super::tracing::RegionCommitments::new)
10879 }
10880
10881 /// Retrieves an aggregated list of commitments by region.
10882 ///
10883 /// To prevent failure, it is recommended that you set the
10884 /// `returnPartialSuccess` parameter to `true`.
10885 pub fn aggregated_list(&self) -> super::builder::region_commitments::AggregatedList {
10886 super::builder::region_commitments::AggregatedList::new(self.inner.clone())
10887 }
10888
10889 /// Returns the specified commitment resource.
10890 pub fn get(&self) -> super::builder::region_commitments::Get {
10891 super::builder::region_commitments::Get::new(self.inner.clone())
10892 }
10893
10894 /// Creates a commitment in the specified project using the data
10895 /// included in the request.
10896 pub fn insert(&self) -> super::builder::region_commitments::Insert {
10897 super::builder::region_commitments::Insert::new(self.inner.clone())
10898 }
10899
10900 /// Retrieves a list of commitments contained within
10901 /// the specified region.
10902 pub fn list(&self) -> super::builder::region_commitments::List {
10903 super::builder::region_commitments::List::new(self.inner.clone())
10904 }
10905
10906 /// Updates the specified commitment with the data included in the request.
10907 /// Update is performed only on selected fields included as part of
10908 /// update-mask. Only the following fields can be updated: auto_renew and plan.
10909 pub fn update(&self) -> super::builder::region_commitments::Update {
10910 super::builder::region_commitments::Update::new(self.inner.clone())
10911 }
10912
10913 /// Retrieves the specified region-specific Operations resource.
10914 pub fn get_operation(&self) -> super::builder::region_commitments::GetOperation {
10915 super::builder::region_commitments::GetOperation::new(self.inner.clone())
10916 }
10917}
10918
10919/// Implements a client for the Google Compute Engine API.
10920///
10921/// # Example
10922/// ```
10923/// # use google_cloud_compute_v1::client::RegionCompositeHealthChecks;
10924/// async fn sample(
10925/// ) -> anyhow::Result<()> {
10926/// let client = RegionCompositeHealthChecks::builder().build().await?;
10927/// // use `client` to make requests to the Google Compute Engine API.
10928/// Ok(())
10929/// }
10930/// ```
10931///
10932/// # Service Description
10933///
10934/// Service for the `regionCompositeHealthChecks` resource.
10935///
10936/// # Configuration
10937///
10938/// To configure `RegionCompositeHealthChecks` use the `with_*` methods in the type returned
10939/// by [builder()][RegionCompositeHealthChecks::builder]. The default configuration should
10940/// work for most applications. Common configuration changes include
10941///
10942/// * [with_endpoint()]: by default this client uses the global default endpoint
10943/// (`https://compute.googleapis.com`). Applications using regional
10944/// endpoints or running in restricted networks (e.g. a network configured
10945/// with [Private Google Access with VPC Service Controls]) may want to
10946/// override this default.
10947/// * [with_credentials()]: by default this client uses
10948/// [Application Default Credentials]. Applications using custom
10949/// authentication may need to override this default.
10950///
10951/// [with_endpoint()]: super::builder::region_composite_health_checks::ClientBuilder::with_endpoint
10952/// [with_credentials()]: super::builder::region_composite_health_checks::ClientBuilder::with_credentials
10953/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
10954/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
10955///
10956/// # Pooling and Cloning
10957///
10958/// `RegionCompositeHealthChecks` holds a connection pool internally, it is advised to
10959/// create one and reuse it. You do not need to wrap `RegionCompositeHealthChecks` in
10960/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
10961/// already uses an `Arc` internally.
10962#[cfg(feature = "region-composite-health-checks")]
10963#[cfg_attr(docsrs, doc(cfg(feature = "region-composite-health-checks")))]
10964#[derive(Clone, Debug)]
10965pub struct RegionCompositeHealthChecks {
10966 inner: std::sync::Arc<dyn super::stub::dynamic::RegionCompositeHealthChecks>,
10967}
10968
10969#[cfg(feature = "region-composite-health-checks")]
10970impl RegionCompositeHealthChecks {
10971 /// Returns a builder for [RegionCompositeHealthChecks].
10972 ///
10973 /// ```
10974 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
10975 /// # use google_cloud_compute_v1::client::RegionCompositeHealthChecks;
10976 /// let client = RegionCompositeHealthChecks::builder().build().await?;
10977 /// # Ok(()) }
10978 /// ```
10979 pub fn builder() -> super::builder::region_composite_health_checks::ClientBuilder {
10980 crate::new_client_builder(super::builder::region_composite_health_checks::client::Factory)
10981 }
10982
10983 /// Creates a new client from the provided stub.
10984 ///
10985 /// The most common case for calling this function is in tests mocking the
10986 /// client's behavior.
10987 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
10988 where
10989 T: super::stub::RegionCompositeHealthChecks + 'static,
10990 {
10991 Self { inner: stub.into() }
10992 }
10993
10994 pub(crate) async fn new(
10995 config: gaxi::options::ClientConfig,
10996 ) -> crate::ClientBuilderResult<Self> {
10997 let inner = Self::build_inner(config).await?;
10998 Ok(Self { inner })
10999 }
11000
11001 async fn build_inner(
11002 conf: gaxi::options::ClientConfig,
11003 ) -> crate::ClientBuilderResult<
11004 std::sync::Arc<dyn super::stub::dynamic::RegionCompositeHealthChecks>,
11005 > {
11006 if gaxi::options::tracing_enabled(&conf) {
11007 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11008 }
11009 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11010 }
11011
11012 async fn build_transport(
11013 conf: gaxi::options::ClientConfig,
11014 ) -> crate::ClientBuilderResult<impl super::stub::RegionCompositeHealthChecks> {
11015 super::transport::RegionCompositeHealthChecks::new(conf).await
11016 }
11017
11018 async fn build_with_tracing(
11019 conf: gaxi::options::ClientConfig,
11020 ) -> crate::ClientBuilderResult<impl super::stub::RegionCompositeHealthChecks> {
11021 Self::build_transport(conf)
11022 .await
11023 .map(super::tracing::RegionCompositeHealthChecks::new)
11024 }
11025
11026 /// Retrieves the list of all CompositeHealthCheck resources (all
11027 /// regional) available to the specified project.
11028 ///
11029 /// To prevent failure, it is recommended that you set the
11030 /// `returnPartialSuccess` parameter to `true`.
11031 pub fn aggregated_list(
11032 &self,
11033 ) -> super::builder::region_composite_health_checks::AggregatedList {
11034 super::builder::region_composite_health_checks::AggregatedList::new(self.inner.clone())
11035 }
11036
11037 /// Deletes the specified CompositeHealthCheck in the given region
11038 pub fn delete(&self) -> super::builder::region_composite_health_checks::Delete {
11039 super::builder::region_composite_health_checks::Delete::new(self.inner.clone())
11040 }
11041
11042 /// Returns the specified CompositeHealthCheck resource in the given region.
11043 pub fn get(&self) -> super::builder::region_composite_health_checks::Get {
11044 super::builder::region_composite_health_checks::Get::new(self.inner.clone())
11045 }
11046
11047 /// Gets the most recent health check results for this
11048 /// regional CompositeHealthCheck.
11049 pub fn get_health(&self) -> super::builder::region_composite_health_checks::GetHealth {
11050 super::builder::region_composite_health_checks::GetHealth::new(self.inner.clone())
11051 }
11052
11053 /// Create a CompositeHealthCheck in the specified project in the given region
11054 /// using the parameters that are included in the request.
11055 pub fn insert(&self) -> super::builder::region_composite_health_checks::Insert {
11056 super::builder::region_composite_health_checks::Insert::new(self.inner.clone())
11057 }
11058
11059 /// Lists the CompositeHealthChecks for a project in the given region.
11060 pub fn list(&self) -> super::builder::region_composite_health_checks::List {
11061 super::builder::region_composite_health_checks::List::new(self.inner.clone())
11062 }
11063
11064 /// Updates the specified regional CompositeHealthCheck resource
11065 /// with the data included in the request. This method supportsPATCH
11066 /// semantics and uses theJSON merge
11067 /// patch format and processing rules.
11068 pub fn patch(&self) -> super::builder::region_composite_health_checks::Patch {
11069 super::builder::region_composite_health_checks::Patch::new(self.inner.clone())
11070 }
11071
11072 /// Returns permissions that a caller has on the specified resource.
11073 pub fn test_iam_permissions(
11074 &self,
11075 ) -> super::builder::region_composite_health_checks::TestIamPermissions {
11076 super::builder::region_composite_health_checks::TestIamPermissions::new(self.inner.clone())
11077 }
11078
11079 /// Retrieves the specified region-specific Operations resource.
11080 pub fn get_operation(&self) -> super::builder::region_composite_health_checks::GetOperation {
11081 super::builder::region_composite_health_checks::GetOperation::new(self.inner.clone())
11082 }
11083}
11084
11085/// Implements a client for the Google Compute Engine API.
11086///
11087/// # Example
11088/// ```
11089/// # use google_cloud_compute_v1::client::RegionDiskTypes;
11090/// async fn sample(
11091/// ) -> anyhow::Result<()> {
11092/// let client = RegionDiskTypes::builder().build().await?;
11093/// // use `client` to make requests to the Google Compute Engine API.
11094/// Ok(())
11095/// }
11096/// ```
11097///
11098/// # Service Description
11099///
11100/// Service for the `regionDiskTypes` resource.
11101///
11102/// # Configuration
11103///
11104/// To configure `RegionDiskTypes` use the `with_*` methods in the type returned
11105/// by [builder()][RegionDiskTypes::builder]. The default configuration should
11106/// work for most applications. Common configuration changes include
11107///
11108/// * [with_endpoint()]: by default this client uses the global default endpoint
11109/// (`https://compute.googleapis.com`). Applications using regional
11110/// endpoints or running in restricted networks (e.g. a network configured
11111/// with [Private Google Access with VPC Service Controls]) may want to
11112/// override this default.
11113/// * [with_credentials()]: by default this client uses
11114/// [Application Default Credentials]. Applications using custom
11115/// authentication may need to override this default.
11116///
11117/// [with_endpoint()]: super::builder::region_disk_types::ClientBuilder::with_endpoint
11118/// [with_credentials()]: super::builder::region_disk_types::ClientBuilder::with_credentials
11119/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11120/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11121///
11122/// # Pooling and Cloning
11123///
11124/// `RegionDiskTypes` holds a connection pool internally, it is advised to
11125/// create one and reuse it. You do not need to wrap `RegionDiskTypes` in
11126/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11127/// already uses an `Arc` internally.
11128#[cfg(feature = "region-disk-types")]
11129#[cfg_attr(docsrs, doc(cfg(feature = "region-disk-types")))]
11130#[derive(Clone, Debug)]
11131pub struct RegionDiskTypes {
11132 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>,
11133}
11134
11135#[cfg(feature = "region-disk-types")]
11136impl RegionDiskTypes {
11137 /// Returns a builder for [RegionDiskTypes].
11138 ///
11139 /// ```
11140 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11141 /// # use google_cloud_compute_v1::client::RegionDiskTypes;
11142 /// let client = RegionDiskTypes::builder().build().await?;
11143 /// # Ok(()) }
11144 /// ```
11145 pub fn builder() -> super::builder::region_disk_types::ClientBuilder {
11146 crate::new_client_builder(super::builder::region_disk_types::client::Factory)
11147 }
11148
11149 /// Creates a new client from the provided stub.
11150 ///
11151 /// The most common case for calling this function is in tests mocking the
11152 /// client's behavior.
11153 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11154 where
11155 T: super::stub::RegionDiskTypes + 'static,
11156 {
11157 Self { inner: stub.into() }
11158 }
11159
11160 pub(crate) async fn new(
11161 config: gaxi::options::ClientConfig,
11162 ) -> crate::ClientBuilderResult<Self> {
11163 let inner = Self::build_inner(config).await?;
11164 Ok(Self { inner })
11165 }
11166
11167 async fn build_inner(
11168 conf: gaxi::options::ClientConfig,
11169 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionDiskTypes>> {
11170 if gaxi::options::tracing_enabled(&conf) {
11171 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11172 }
11173 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11174 }
11175
11176 async fn build_transport(
11177 conf: gaxi::options::ClientConfig,
11178 ) -> crate::ClientBuilderResult<impl super::stub::RegionDiskTypes> {
11179 super::transport::RegionDiskTypes::new(conf).await
11180 }
11181
11182 async fn build_with_tracing(
11183 conf: gaxi::options::ClientConfig,
11184 ) -> crate::ClientBuilderResult<impl super::stub::RegionDiskTypes> {
11185 Self::build_transport(conf)
11186 .await
11187 .map(super::tracing::RegionDiskTypes::new)
11188 }
11189
11190 /// Returns the specified regional disk type.
11191 pub fn get(&self) -> super::builder::region_disk_types::Get {
11192 super::builder::region_disk_types::Get::new(self.inner.clone())
11193 }
11194
11195 /// Retrieves a list of regional disk types available to the specified project.
11196 pub fn list(&self) -> super::builder::region_disk_types::List {
11197 super::builder::region_disk_types::List::new(self.inner.clone())
11198 }
11199}
11200
11201/// Implements a client for the Google Compute Engine API.
11202///
11203/// # Example
11204/// ```
11205/// # use google_cloud_compute_v1::client::RegionDisks;
11206/// async fn sample(
11207/// ) -> anyhow::Result<()> {
11208/// let client = RegionDisks::builder().build().await?;
11209/// // use `client` to make requests to the Google Compute Engine API.
11210/// Ok(())
11211/// }
11212/// ```
11213///
11214/// # Service Description
11215///
11216/// Service for the `regionDisks` resource.
11217///
11218/// # Configuration
11219///
11220/// To configure `RegionDisks` use the `with_*` methods in the type returned
11221/// by [builder()][RegionDisks::builder]. The default configuration should
11222/// work for most applications. Common configuration changes include
11223///
11224/// * [with_endpoint()]: by default this client uses the global default endpoint
11225/// (`https://compute.googleapis.com`). Applications using regional
11226/// endpoints or running in restricted networks (e.g. a network configured
11227/// with [Private Google Access with VPC Service Controls]) may want to
11228/// override this default.
11229/// * [with_credentials()]: by default this client uses
11230/// [Application Default Credentials]. Applications using custom
11231/// authentication may need to override this default.
11232///
11233/// [with_endpoint()]: super::builder::region_disks::ClientBuilder::with_endpoint
11234/// [with_credentials()]: super::builder::region_disks::ClientBuilder::with_credentials
11235/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11236/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11237///
11238/// # Pooling and Cloning
11239///
11240/// `RegionDisks` holds a connection pool internally, it is advised to
11241/// create one and reuse it. You do not need to wrap `RegionDisks` in
11242/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11243/// already uses an `Arc` internally.
11244#[cfg(feature = "region-disks")]
11245#[cfg_attr(docsrs, doc(cfg(feature = "region-disks")))]
11246#[derive(Clone, Debug)]
11247pub struct RegionDisks {
11248 inner: std::sync::Arc<dyn super::stub::dynamic::RegionDisks>,
11249}
11250
11251#[cfg(feature = "region-disks")]
11252impl RegionDisks {
11253 /// Returns a builder for [RegionDisks].
11254 ///
11255 /// ```
11256 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11257 /// # use google_cloud_compute_v1::client::RegionDisks;
11258 /// let client = RegionDisks::builder().build().await?;
11259 /// # Ok(()) }
11260 /// ```
11261 pub fn builder() -> super::builder::region_disks::ClientBuilder {
11262 crate::new_client_builder(super::builder::region_disks::client::Factory)
11263 }
11264
11265 /// Creates a new client from the provided stub.
11266 ///
11267 /// The most common case for calling this function is in tests mocking the
11268 /// client's behavior.
11269 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11270 where
11271 T: super::stub::RegionDisks + 'static,
11272 {
11273 Self { inner: stub.into() }
11274 }
11275
11276 pub(crate) async fn new(
11277 config: gaxi::options::ClientConfig,
11278 ) -> crate::ClientBuilderResult<Self> {
11279 let inner = Self::build_inner(config).await?;
11280 Ok(Self { inner })
11281 }
11282
11283 async fn build_inner(
11284 conf: gaxi::options::ClientConfig,
11285 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionDisks>> {
11286 if gaxi::options::tracing_enabled(&conf) {
11287 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11288 }
11289 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11290 }
11291
11292 async fn build_transport(
11293 conf: gaxi::options::ClientConfig,
11294 ) -> crate::ClientBuilderResult<impl super::stub::RegionDisks> {
11295 super::transport::RegionDisks::new(conf).await
11296 }
11297
11298 async fn build_with_tracing(
11299 conf: gaxi::options::ClientConfig,
11300 ) -> crate::ClientBuilderResult<impl super::stub::RegionDisks> {
11301 Self::build_transport(conf)
11302 .await
11303 .map(super::tracing::RegionDisks::new)
11304 }
11305
11306 /// Adds existing resource policies to a regional disk. You can only add one
11307 /// policy which will be applied to this disk for scheduling snapshot
11308 /// creation.
11309 pub fn add_resource_policies(&self) -> super::builder::region_disks::AddResourcePolicies {
11310 super::builder::region_disks::AddResourcePolicies::new(self.inner.clone())
11311 }
11312
11313 /// Bulk create a set of disks.
11314 pub fn bulk_insert(&self) -> super::builder::region_disks::BulkInsert {
11315 super::builder::region_disks::BulkInsert::new(self.inner.clone())
11316 }
11317
11318 /// Creates a snapshot of a specified persistent disk. For regular snapshot
11319 /// creation, consider using snapshots.insert
11320 /// instead, as that method supports more features, such as creating snapshots
11321 /// in a project different from the source disk project.
11322 pub fn create_snapshot(&self) -> super::builder::region_disks::CreateSnapshot {
11323 super::builder::region_disks::CreateSnapshot::new(self.inner.clone())
11324 }
11325
11326 /// Deletes the specified regional persistent disk. Deleting a regional disk
11327 /// removes all the replicas of its data permanently and is irreversible.
11328 /// However, deleting a disk does not delete anysnapshots
11329 /// previously made from the disk. You must separatelydelete
11330 /// snapshots.
11331 pub fn delete(&self) -> super::builder::region_disks::Delete {
11332 super::builder::region_disks::Delete::new(self.inner.clone())
11333 }
11334
11335 /// Returns a specified regional persistent disk.
11336 pub fn get(&self) -> super::builder::region_disks::Get {
11337 super::builder::region_disks::Get::new(self.inner.clone())
11338 }
11339
11340 /// Gets the access control policy for a resource. May be empty if no such
11341 /// policy or resource exists.
11342 pub fn get_iam_policy(&self) -> super::builder::region_disks::GetIamPolicy {
11343 super::builder::region_disks::GetIamPolicy::new(self.inner.clone())
11344 }
11345
11346 /// Creates a persistent regional disk in the specified project using the data
11347 /// included in the request.
11348 pub fn insert(&self) -> super::builder::region_disks::Insert {
11349 super::builder::region_disks::Insert::new(self.inner.clone())
11350 }
11351
11352 /// Retrieves the list of persistent disks contained within
11353 /// the specified region.
11354 pub fn list(&self) -> super::builder::region_disks::List {
11355 super::builder::region_disks::List::new(self.inner.clone())
11356 }
11357
11358 /// Removes resource policies from a regional disk.
11359 pub fn remove_resource_policies(&self) -> super::builder::region_disks::RemoveResourcePolicies {
11360 super::builder::region_disks::RemoveResourcePolicies::new(self.inner.clone())
11361 }
11362
11363 /// Resizes the specified regional persistent disk.
11364 pub fn resize(&self) -> super::builder::region_disks::Resize {
11365 super::builder::region_disks::Resize::new(self.inner.clone())
11366 }
11367
11368 /// Sets the access control policy on the specified resource.
11369 /// Replaces any existing policy.
11370 pub fn set_iam_policy(&self) -> super::builder::region_disks::SetIamPolicy {
11371 super::builder::region_disks::SetIamPolicy::new(self.inner.clone())
11372 }
11373
11374 /// Sets the labels on the target regional disk.
11375 pub fn set_labels(&self) -> super::builder::region_disks::SetLabels {
11376 super::builder::region_disks::SetLabels::new(self.inner.clone())
11377 }
11378
11379 /// Starts asynchronous replication.
11380 /// Must be invoked on the primary disk.
11381 pub fn start_async_replication(&self) -> super::builder::region_disks::StartAsyncReplication {
11382 super::builder::region_disks::StartAsyncReplication::new(self.inner.clone())
11383 }
11384
11385 /// Stops asynchronous replication.
11386 /// Can be invoked either on the primary or on the secondary disk.
11387 pub fn stop_async_replication(&self) -> super::builder::region_disks::StopAsyncReplication {
11388 super::builder::region_disks::StopAsyncReplication::new(self.inner.clone())
11389 }
11390
11391 /// Stops asynchronous replication for a consistency group of disks.
11392 /// Can be invoked either in the primary or secondary scope.
11393 pub fn stop_group_async_replication(
11394 &self,
11395 ) -> super::builder::region_disks::StopGroupAsyncReplication {
11396 super::builder::region_disks::StopGroupAsyncReplication::new(self.inner.clone())
11397 }
11398
11399 /// Returns permissions that a caller has on the specified resource.
11400 pub fn test_iam_permissions(&self) -> super::builder::region_disks::TestIamPermissions {
11401 super::builder::region_disks::TestIamPermissions::new(self.inner.clone())
11402 }
11403
11404 /// Update the specified disk with the data included in the request. Update is
11405 /// performed only on selected fields included as part of update-mask.
11406 pub fn update(&self) -> super::builder::region_disks::Update {
11407 super::builder::region_disks::Update::new(self.inner.clone())
11408 }
11409
11410 /// Rotates the customer-managed
11411 /// encryption key to the latest version for the specified persistent disk.
11412 pub fn update_kms_key(&self) -> super::builder::region_disks::UpdateKmsKey {
11413 super::builder::region_disks::UpdateKmsKey::new(self.inner.clone())
11414 }
11415
11416 /// Retrieves the specified region-specific Operations resource.
11417 pub fn get_operation(&self) -> super::builder::region_disks::GetOperation {
11418 super::builder::region_disks::GetOperation::new(self.inner.clone())
11419 }
11420}
11421
11422/// Implements a client for the Google Compute Engine API.
11423///
11424/// # Example
11425/// ```
11426/// # use google_cloud_compute_v1::client::RegionHealthAggregationPolicies;
11427/// async fn sample(
11428/// ) -> anyhow::Result<()> {
11429/// let client = RegionHealthAggregationPolicies::builder().build().await?;
11430/// // use `client` to make requests to the Google Compute Engine API.
11431/// Ok(())
11432/// }
11433/// ```
11434///
11435/// # Service Description
11436///
11437/// Service for the `regionHealthAggregationPolicies` resource.
11438///
11439/// # Configuration
11440///
11441/// To configure `RegionHealthAggregationPolicies` use the `with_*` methods in the type returned
11442/// by [builder()][RegionHealthAggregationPolicies::builder]. The default configuration should
11443/// work for most applications. Common configuration changes include
11444///
11445/// * [with_endpoint()]: by default this client uses the global default endpoint
11446/// (`https://compute.googleapis.com`). Applications using regional
11447/// endpoints or running in restricted networks (e.g. a network configured
11448/// with [Private Google Access with VPC Service Controls]) may want to
11449/// override this default.
11450/// * [with_credentials()]: by default this client uses
11451/// [Application Default Credentials]. Applications using custom
11452/// authentication may need to override this default.
11453///
11454/// [with_endpoint()]: super::builder::region_health_aggregation_policies::ClientBuilder::with_endpoint
11455/// [with_credentials()]: super::builder::region_health_aggregation_policies::ClientBuilder::with_credentials
11456/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11457/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11458///
11459/// # Pooling and Cloning
11460///
11461/// `RegionHealthAggregationPolicies` holds a connection pool internally, it is advised to
11462/// create one and reuse it. You do not need to wrap `RegionHealthAggregationPolicies` in
11463/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11464/// already uses an `Arc` internally.
11465#[cfg(feature = "region-health-aggregation-policies")]
11466#[cfg_attr(docsrs, doc(cfg(feature = "region-health-aggregation-policies")))]
11467#[derive(Clone, Debug)]
11468pub struct RegionHealthAggregationPolicies {
11469 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthAggregationPolicies>,
11470}
11471
11472#[cfg(feature = "region-health-aggregation-policies")]
11473impl RegionHealthAggregationPolicies {
11474 /// Returns a builder for [RegionHealthAggregationPolicies].
11475 ///
11476 /// ```
11477 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11478 /// # use google_cloud_compute_v1::client::RegionHealthAggregationPolicies;
11479 /// let client = RegionHealthAggregationPolicies::builder().build().await?;
11480 /// # Ok(()) }
11481 /// ```
11482 pub fn builder() -> super::builder::region_health_aggregation_policies::ClientBuilder {
11483 crate::new_client_builder(
11484 super::builder::region_health_aggregation_policies::client::Factory,
11485 )
11486 }
11487
11488 /// Creates a new client from the provided stub.
11489 ///
11490 /// The most common case for calling this function is in tests mocking the
11491 /// client's behavior.
11492 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11493 where
11494 T: super::stub::RegionHealthAggregationPolicies + 'static,
11495 {
11496 Self { inner: stub.into() }
11497 }
11498
11499 pub(crate) async fn new(
11500 config: gaxi::options::ClientConfig,
11501 ) -> crate::ClientBuilderResult<Self> {
11502 let inner = Self::build_inner(config).await?;
11503 Ok(Self { inner })
11504 }
11505
11506 async fn build_inner(
11507 conf: gaxi::options::ClientConfig,
11508 ) -> crate::ClientBuilderResult<
11509 std::sync::Arc<dyn super::stub::dynamic::RegionHealthAggregationPolicies>,
11510 > {
11511 if gaxi::options::tracing_enabled(&conf) {
11512 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11513 }
11514 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11515 }
11516
11517 async fn build_transport(
11518 conf: gaxi::options::ClientConfig,
11519 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthAggregationPolicies> {
11520 super::transport::RegionHealthAggregationPolicies::new(conf).await
11521 }
11522
11523 async fn build_with_tracing(
11524 conf: gaxi::options::ClientConfig,
11525 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthAggregationPolicies> {
11526 Self::build_transport(conf)
11527 .await
11528 .map(super::tracing::RegionHealthAggregationPolicies::new)
11529 }
11530
11531 /// Retrieves the list of all HealthAggregationPolicy resources,
11532 /// regional and global, available to the specified project.
11533 ///
11534 /// To prevent failure, it is recommended that you set the
11535 /// `returnPartialSuccess` parameter to `true`.
11536 pub fn aggregated_list(
11537 &self,
11538 ) -> super::builder::region_health_aggregation_policies::AggregatedList {
11539 super::builder::region_health_aggregation_policies::AggregatedList::new(self.inner.clone())
11540 }
11541
11542 /// Deletes the specified HealthAggregationPolicy in the given region.
11543 pub fn delete(&self) -> super::builder::region_health_aggregation_policies::Delete {
11544 super::builder::region_health_aggregation_policies::Delete::new(self.inner.clone())
11545 }
11546
11547 /// Returns the specified HealthAggregationPolicy resource in the given region.
11548 pub fn get(&self) -> super::builder::region_health_aggregation_policies::Get {
11549 super::builder::region_health_aggregation_policies::Get::new(self.inner.clone())
11550 }
11551
11552 /// Create a HealthAggregationPolicy in the specified project in the given
11553 /// region using the parameters that are included in the request.
11554 pub fn insert(&self) -> super::builder::region_health_aggregation_policies::Insert {
11555 super::builder::region_health_aggregation_policies::Insert::new(self.inner.clone())
11556 }
11557
11558 /// Lists the HealthAggregationPolicies for a project in the given region.
11559 pub fn list(&self) -> super::builder::region_health_aggregation_policies::List {
11560 super::builder::region_health_aggregation_policies::List::new(self.inner.clone())
11561 }
11562
11563 /// Updates the specified regional HealthAggregationPolicy
11564 /// resource with the data included in the request. This method supportsPATCH
11565 /// semantics and uses theJSON merge
11566 /// patch format and processing rules.
11567 pub fn patch(&self) -> super::builder::region_health_aggregation_policies::Patch {
11568 super::builder::region_health_aggregation_policies::Patch::new(self.inner.clone())
11569 }
11570
11571 /// Returns permissions that a caller has on the specified resource.
11572 pub fn test_iam_permissions(
11573 &self,
11574 ) -> super::builder::region_health_aggregation_policies::TestIamPermissions {
11575 super::builder::region_health_aggregation_policies::TestIamPermissions::new(
11576 self.inner.clone(),
11577 )
11578 }
11579
11580 /// Retrieves the specified region-specific Operations resource.
11581 pub fn get_operation(
11582 &self,
11583 ) -> super::builder::region_health_aggregation_policies::GetOperation {
11584 super::builder::region_health_aggregation_policies::GetOperation::new(self.inner.clone())
11585 }
11586}
11587
11588/// Implements a client for the Google Compute Engine API.
11589///
11590/// # Example
11591/// ```
11592/// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
11593/// async fn sample(
11594/// ) -> anyhow::Result<()> {
11595/// let client = RegionHealthCheckServices::builder().build().await?;
11596/// // use `client` to make requests to the Google Compute Engine API.
11597/// Ok(())
11598/// }
11599/// ```
11600///
11601/// # Service Description
11602///
11603/// Service for the `regionHealthCheckServices` resource.
11604///
11605/// # Configuration
11606///
11607/// To configure `RegionHealthCheckServices` use the `with_*` methods in the type returned
11608/// by [builder()][RegionHealthCheckServices::builder]. The default configuration should
11609/// work for most applications. Common configuration changes include
11610///
11611/// * [with_endpoint()]: by default this client uses the global default endpoint
11612/// (`https://compute.googleapis.com`). Applications using regional
11613/// endpoints or running in restricted networks (e.g. a network configured
11614/// with [Private Google Access with VPC Service Controls]) may want to
11615/// override this default.
11616/// * [with_credentials()]: by default this client uses
11617/// [Application Default Credentials]. Applications using custom
11618/// authentication may need to override this default.
11619///
11620/// [with_endpoint()]: super::builder::region_health_check_services::ClientBuilder::with_endpoint
11621/// [with_credentials()]: super::builder::region_health_check_services::ClientBuilder::with_credentials
11622/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11623/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11624///
11625/// # Pooling and Cloning
11626///
11627/// `RegionHealthCheckServices` holds a connection pool internally, it is advised to
11628/// create one and reuse it. You do not need to wrap `RegionHealthCheckServices` in
11629/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11630/// already uses an `Arc` internally.
11631#[cfg(feature = "region-health-check-services")]
11632#[cfg_attr(docsrs, doc(cfg(feature = "region-health-check-services")))]
11633#[derive(Clone, Debug)]
11634pub struct RegionHealthCheckServices {
11635 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
11636}
11637
11638#[cfg(feature = "region-health-check-services")]
11639impl RegionHealthCheckServices {
11640 /// Returns a builder for [RegionHealthCheckServices].
11641 ///
11642 /// ```
11643 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11644 /// # use google_cloud_compute_v1::client::RegionHealthCheckServices;
11645 /// let client = RegionHealthCheckServices::builder().build().await?;
11646 /// # Ok(()) }
11647 /// ```
11648 pub fn builder() -> super::builder::region_health_check_services::ClientBuilder {
11649 crate::new_client_builder(super::builder::region_health_check_services::client::Factory)
11650 }
11651
11652 /// Creates a new client from the provided stub.
11653 ///
11654 /// The most common case for calling this function is in tests mocking the
11655 /// client's behavior.
11656 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11657 where
11658 T: super::stub::RegionHealthCheckServices + 'static,
11659 {
11660 Self { inner: stub.into() }
11661 }
11662
11663 pub(crate) async fn new(
11664 config: gaxi::options::ClientConfig,
11665 ) -> crate::ClientBuilderResult<Self> {
11666 let inner = Self::build_inner(config).await?;
11667 Ok(Self { inner })
11668 }
11669
11670 async fn build_inner(
11671 conf: gaxi::options::ClientConfig,
11672 ) -> crate::ClientBuilderResult<
11673 std::sync::Arc<dyn super::stub::dynamic::RegionHealthCheckServices>,
11674 > {
11675 if gaxi::options::tracing_enabled(&conf) {
11676 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11677 }
11678 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11679 }
11680
11681 async fn build_transport(
11682 conf: gaxi::options::ClientConfig,
11683 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthCheckServices> {
11684 super::transport::RegionHealthCheckServices::new(conf).await
11685 }
11686
11687 async fn build_with_tracing(
11688 conf: gaxi::options::ClientConfig,
11689 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthCheckServices> {
11690 Self::build_transport(conf)
11691 .await
11692 .map(super::tracing::RegionHealthCheckServices::new)
11693 }
11694
11695 /// Retrieves the list of all HealthCheckService resources,
11696 /// regional and global, available to the specified project.
11697 ///
11698 /// To prevent failure, it is recommended that you set the
11699 /// `returnPartialSuccess` parameter to `true`.
11700 pub fn aggregated_list(&self) -> super::builder::region_health_check_services::AggregatedList {
11701 super::builder::region_health_check_services::AggregatedList::new(self.inner.clone())
11702 }
11703
11704 /// Deletes the specified regional HealthCheckService.
11705 pub fn delete(&self) -> super::builder::region_health_check_services::Delete {
11706 super::builder::region_health_check_services::Delete::new(self.inner.clone())
11707 }
11708
11709 /// Returns the specified regional HealthCheckService resource.
11710 pub fn get(&self) -> super::builder::region_health_check_services::Get {
11711 super::builder::region_health_check_services::Get::new(self.inner.clone())
11712 }
11713
11714 /// Creates a regional HealthCheckService resource in the
11715 /// specified project and region using the data included in the request.
11716 pub fn insert(&self) -> super::builder::region_health_check_services::Insert {
11717 super::builder::region_health_check_services::Insert::new(self.inner.clone())
11718 }
11719
11720 /// Lists all the HealthCheckService resources that have been
11721 /// configured for the specified project in the given region.
11722 pub fn list(&self) -> super::builder::region_health_check_services::List {
11723 super::builder::region_health_check_services::List::new(self.inner.clone())
11724 }
11725
11726 /// Updates the specified regional HealthCheckService resource
11727 /// with the data included in the request. This method supportsPATCH
11728 /// semantics and uses theJSON merge
11729 /// patch format and processing rules.
11730 pub fn patch(&self) -> super::builder::region_health_check_services::Patch {
11731 super::builder::region_health_check_services::Patch::new(self.inner.clone())
11732 }
11733
11734 /// Returns permissions that a caller has on the specified resource.
11735 pub fn test_iam_permissions(
11736 &self,
11737 ) -> super::builder::region_health_check_services::TestIamPermissions {
11738 super::builder::region_health_check_services::TestIamPermissions::new(self.inner.clone())
11739 }
11740
11741 /// Retrieves the specified region-specific Operations resource.
11742 pub fn get_operation(&self) -> super::builder::region_health_check_services::GetOperation {
11743 super::builder::region_health_check_services::GetOperation::new(self.inner.clone())
11744 }
11745}
11746
11747/// Implements a client for the Google Compute Engine API.
11748///
11749/// # Example
11750/// ```
11751/// # use google_cloud_compute_v1::client::RegionHealthChecks;
11752/// async fn sample(
11753/// ) -> anyhow::Result<()> {
11754/// let client = RegionHealthChecks::builder().build().await?;
11755/// // use `client` to make requests to the Google Compute Engine API.
11756/// Ok(())
11757/// }
11758/// ```
11759///
11760/// # Service Description
11761///
11762/// Service for the `regionHealthChecks` resource.
11763///
11764/// # Configuration
11765///
11766/// To configure `RegionHealthChecks` use the `with_*` methods in the type returned
11767/// by [builder()][RegionHealthChecks::builder]. The default configuration should
11768/// work for most applications. Common configuration changes include
11769///
11770/// * [with_endpoint()]: by default this client uses the global default endpoint
11771/// (`https://compute.googleapis.com`). Applications using regional
11772/// endpoints or running in restricted networks (e.g. a network configured
11773/// with [Private Google Access with VPC Service Controls]) may want to
11774/// override this default.
11775/// * [with_credentials()]: by default this client uses
11776/// [Application Default Credentials]. Applications using custom
11777/// authentication may need to override this default.
11778///
11779/// [with_endpoint()]: super::builder::region_health_checks::ClientBuilder::with_endpoint
11780/// [with_credentials()]: super::builder::region_health_checks::ClientBuilder::with_credentials
11781/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11782/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11783///
11784/// # Pooling and Cloning
11785///
11786/// `RegionHealthChecks` holds a connection pool internally, it is advised to
11787/// create one and reuse it. You do not need to wrap `RegionHealthChecks` in
11788/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11789/// already uses an `Arc` internally.
11790#[cfg(feature = "region-health-checks")]
11791#[cfg_attr(docsrs, doc(cfg(feature = "region-health-checks")))]
11792#[derive(Clone, Debug)]
11793pub struct RegionHealthChecks {
11794 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>,
11795}
11796
11797#[cfg(feature = "region-health-checks")]
11798impl RegionHealthChecks {
11799 /// Returns a builder for [RegionHealthChecks].
11800 ///
11801 /// ```
11802 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11803 /// # use google_cloud_compute_v1::client::RegionHealthChecks;
11804 /// let client = RegionHealthChecks::builder().build().await?;
11805 /// # Ok(()) }
11806 /// ```
11807 pub fn builder() -> super::builder::region_health_checks::ClientBuilder {
11808 crate::new_client_builder(super::builder::region_health_checks::client::Factory)
11809 }
11810
11811 /// Creates a new client from the provided stub.
11812 ///
11813 /// The most common case for calling this function is in tests mocking the
11814 /// client's behavior.
11815 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11816 where
11817 T: super::stub::RegionHealthChecks + 'static,
11818 {
11819 Self { inner: stub.into() }
11820 }
11821
11822 pub(crate) async fn new(
11823 config: gaxi::options::ClientConfig,
11824 ) -> crate::ClientBuilderResult<Self> {
11825 let inner = Self::build_inner(config).await?;
11826 Ok(Self { inner })
11827 }
11828
11829 async fn build_inner(
11830 conf: gaxi::options::ClientConfig,
11831 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionHealthChecks>>
11832 {
11833 if gaxi::options::tracing_enabled(&conf) {
11834 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11835 }
11836 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11837 }
11838
11839 async fn build_transport(
11840 conf: gaxi::options::ClientConfig,
11841 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthChecks> {
11842 super::transport::RegionHealthChecks::new(conf).await
11843 }
11844
11845 async fn build_with_tracing(
11846 conf: gaxi::options::ClientConfig,
11847 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthChecks> {
11848 Self::build_transport(conf)
11849 .await
11850 .map(super::tracing::RegionHealthChecks::new)
11851 }
11852
11853 /// Deletes the specified HealthCheck resource.
11854 pub fn delete(&self) -> super::builder::region_health_checks::Delete {
11855 super::builder::region_health_checks::Delete::new(self.inner.clone())
11856 }
11857
11858 /// Returns the specified HealthCheck resource.
11859 pub fn get(&self) -> super::builder::region_health_checks::Get {
11860 super::builder::region_health_checks::Get::new(self.inner.clone())
11861 }
11862
11863 /// Creates a HealthCheck resource in the specified project using the data
11864 /// included in the request.
11865 pub fn insert(&self) -> super::builder::region_health_checks::Insert {
11866 super::builder::region_health_checks::Insert::new(self.inner.clone())
11867 }
11868
11869 /// Retrieves the list of HealthCheck resources available to the specified
11870 /// project.
11871 pub fn list(&self) -> super::builder::region_health_checks::List {
11872 super::builder::region_health_checks::List::new(self.inner.clone())
11873 }
11874
11875 /// Updates a HealthCheck resource in the specified project using the data
11876 /// included in the request. This method supportsPATCH
11877 /// semantics and uses theJSON merge
11878 /// patch format and processing rules.
11879 pub fn patch(&self) -> super::builder::region_health_checks::Patch {
11880 super::builder::region_health_checks::Patch::new(self.inner.clone())
11881 }
11882
11883 /// Returns permissions that a caller has on the specified resource.
11884 pub fn test_iam_permissions(&self) -> super::builder::region_health_checks::TestIamPermissions {
11885 super::builder::region_health_checks::TestIamPermissions::new(self.inner.clone())
11886 }
11887
11888 /// Updates a HealthCheck resource in the specified project using the data
11889 /// included in the request.
11890 pub fn update(&self) -> super::builder::region_health_checks::Update {
11891 super::builder::region_health_checks::Update::new(self.inner.clone())
11892 }
11893
11894 /// Retrieves the specified region-specific Operations resource.
11895 pub fn get_operation(&self) -> super::builder::region_health_checks::GetOperation {
11896 super::builder::region_health_checks::GetOperation::new(self.inner.clone())
11897 }
11898}
11899
11900/// Implements a client for the Google Compute Engine API.
11901///
11902/// # Example
11903/// ```
11904/// # use google_cloud_compute_v1::client::RegionHealthSources;
11905/// async fn sample(
11906/// ) -> anyhow::Result<()> {
11907/// let client = RegionHealthSources::builder().build().await?;
11908/// // use `client` to make requests to the Google Compute Engine API.
11909/// Ok(())
11910/// }
11911/// ```
11912///
11913/// # Service Description
11914///
11915/// Service for the `regionHealthSources` resource.
11916///
11917/// # Configuration
11918///
11919/// To configure `RegionHealthSources` use the `with_*` methods in the type returned
11920/// by [builder()][RegionHealthSources::builder]. The default configuration should
11921/// work for most applications. Common configuration changes include
11922///
11923/// * [with_endpoint()]: by default this client uses the global default endpoint
11924/// (`https://compute.googleapis.com`). Applications using regional
11925/// endpoints or running in restricted networks (e.g. a network configured
11926/// with [Private Google Access with VPC Service Controls]) may want to
11927/// override this default.
11928/// * [with_credentials()]: by default this client uses
11929/// [Application Default Credentials]. Applications using custom
11930/// authentication may need to override this default.
11931///
11932/// [with_endpoint()]: super::builder::region_health_sources::ClientBuilder::with_endpoint
11933/// [with_credentials()]: super::builder::region_health_sources::ClientBuilder::with_credentials
11934/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
11935/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
11936///
11937/// # Pooling and Cloning
11938///
11939/// `RegionHealthSources` holds a connection pool internally, it is advised to
11940/// create one and reuse it. You do not need to wrap `RegionHealthSources` in
11941/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
11942/// already uses an `Arc` internally.
11943#[cfg(feature = "region-health-sources")]
11944#[cfg_attr(docsrs, doc(cfg(feature = "region-health-sources")))]
11945#[derive(Clone, Debug)]
11946pub struct RegionHealthSources {
11947 inner: std::sync::Arc<dyn super::stub::dynamic::RegionHealthSources>,
11948}
11949
11950#[cfg(feature = "region-health-sources")]
11951impl RegionHealthSources {
11952 /// Returns a builder for [RegionHealthSources].
11953 ///
11954 /// ```
11955 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11956 /// # use google_cloud_compute_v1::client::RegionHealthSources;
11957 /// let client = RegionHealthSources::builder().build().await?;
11958 /// # Ok(()) }
11959 /// ```
11960 pub fn builder() -> super::builder::region_health_sources::ClientBuilder {
11961 crate::new_client_builder(super::builder::region_health_sources::client::Factory)
11962 }
11963
11964 /// Creates a new client from the provided stub.
11965 ///
11966 /// The most common case for calling this function is in tests mocking the
11967 /// client's behavior.
11968 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
11969 where
11970 T: super::stub::RegionHealthSources + 'static,
11971 {
11972 Self { inner: stub.into() }
11973 }
11974
11975 pub(crate) async fn new(
11976 config: gaxi::options::ClientConfig,
11977 ) -> crate::ClientBuilderResult<Self> {
11978 let inner = Self::build_inner(config).await?;
11979 Ok(Self { inner })
11980 }
11981
11982 async fn build_inner(
11983 conf: gaxi::options::ClientConfig,
11984 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionHealthSources>>
11985 {
11986 if gaxi::options::tracing_enabled(&conf) {
11987 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
11988 }
11989 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
11990 }
11991
11992 async fn build_transport(
11993 conf: gaxi::options::ClientConfig,
11994 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthSources> {
11995 super::transport::RegionHealthSources::new(conf).await
11996 }
11997
11998 async fn build_with_tracing(
11999 conf: gaxi::options::ClientConfig,
12000 ) -> crate::ClientBuilderResult<impl super::stub::RegionHealthSources> {
12001 Self::build_transport(conf)
12002 .await
12003 .map(super::tracing::RegionHealthSources::new)
12004 }
12005
12006 /// Retrieves the list of all HealthSource resources (all
12007 /// regional) available to the specified project.
12008 ///
12009 /// To prevent failure, Google recommends that you set the
12010 /// `returnPartialSuccess` parameter to `true`.
12011 pub fn aggregated_list(&self) -> super::builder::region_health_sources::AggregatedList {
12012 super::builder::region_health_sources::AggregatedList::new(self.inner.clone())
12013 }
12014
12015 /// Deletes the specified HealthSource in the given region
12016 pub fn delete(&self) -> super::builder::region_health_sources::Delete {
12017 super::builder::region_health_sources::Delete::new(self.inner.clone())
12018 }
12019
12020 /// Returns the specified HealthSource resource in the given region.
12021 pub fn get(&self) -> super::builder::region_health_sources::Get {
12022 super::builder::region_health_sources::Get::new(self.inner.clone())
12023 }
12024
12025 /// Gets the most recent health check results for this
12026 /// regional HealthSource.
12027 pub fn get_health(&self) -> super::builder::region_health_sources::GetHealth {
12028 super::builder::region_health_sources::GetHealth::new(self.inner.clone())
12029 }
12030
12031 /// Create a HealthSource in the specified project in the given region
12032 /// using the parameters that are included in the request.
12033 pub fn insert(&self) -> super::builder::region_health_sources::Insert {
12034 super::builder::region_health_sources::Insert::new(self.inner.clone())
12035 }
12036
12037 /// Lists the HealthSources for a project in the given region.
12038 pub fn list(&self) -> super::builder::region_health_sources::List {
12039 super::builder::region_health_sources::List::new(self.inner.clone())
12040 }
12041
12042 /// Updates the specified regional HealthSource resource
12043 /// with the data included in the request. This method supportsPATCH
12044 /// semantics and uses theJSON merge
12045 /// patch format and processing rules.
12046 pub fn patch(&self) -> super::builder::region_health_sources::Patch {
12047 super::builder::region_health_sources::Patch::new(self.inner.clone())
12048 }
12049
12050 /// Returns permissions that a caller has on the specified resource.
12051 pub fn test_iam_permissions(
12052 &self,
12053 ) -> super::builder::region_health_sources::TestIamPermissions {
12054 super::builder::region_health_sources::TestIamPermissions::new(self.inner.clone())
12055 }
12056
12057 /// Retrieves the specified region-specific Operations resource.
12058 pub fn get_operation(&self) -> super::builder::region_health_sources::GetOperation {
12059 super::builder::region_health_sources::GetOperation::new(self.inner.clone())
12060 }
12061}
12062
12063/// Implements a client for the Google Compute Engine API.
12064///
12065/// # Example
12066/// ```
12067/// # use google_cloud_compute_v1::client::RegionInstanceGroupManagerResizeRequests;
12068/// async fn sample(
12069/// ) -> anyhow::Result<()> {
12070/// let client = RegionInstanceGroupManagerResizeRequests::builder().build().await?;
12071/// // use `client` to make requests to the Google Compute Engine API.
12072/// Ok(())
12073/// }
12074/// ```
12075///
12076/// # Service Description
12077///
12078/// Service for the `regionInstanceGroupManagerResizeRequests` resource.
12079///
12080/// # Configuration
12081///
12082/// To configure `RegionInstanceGroupManagerResizeRequests` use the `with_*` methods in the type returned
12083/// by [builder()][RegionInstanceGroupManagerResizeRequests::builder]. The default configuration should
12084/// work for most applications. Common configuration changes include
12085///
12086/// * [with_endpoint()]: by default this client uses the global default endpoint
12087/// (`https://compute.googleapis.com`). Applications using regional
12088/// endpoints or running in restricted networks (e.g. a network configured
12089/// with [Private Google Access with VPC Service Controls]) may want to
12090/// override this default.
12091/// * [with_credentials()]: by default this client uses
12092/// [Application Default Credentials]. Applications using custom
12093/// authentication may need to override this default.
12094///
12095/// [with_endpoint()]: super::builder::region_instance_group_manager_resize_requests::ClientBuilder::with_endpoint
12096/// [with_credentials()]: super::builder::region_instance_group_manager_resize_requests::ClientBuilder::with_credentials
12097/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12098/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12099///
12100/// # Pooling and Cloning
12101///
12102/// `RegionInstanceGroupManagerResizeRequests` holds a connection pool internally, it is advised to
12103/// create one and reuse it. You do not need to wrap `RegionInstanceGroupManagerResizeRequests` in
12104/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12105/// already uses an `Arc` internally.
12106#[cfg(feature = "region-instance-group-manager-resize-requests")]
12107#[cfg_attr(
12108 docsrs,
12109 doc(cfg(feature = "region-instance-group-manager-resize-requests"))
12110)]
12111#[derive(Clone, Debug)]
12112pub struct RegionInstanceGroupManagerResizeRequests {
12113 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagerResizeRequests>,
12114}
12115
12116#[cfg(feature = "region-instance-group-manager-resize-requests")]
12117impl RegionInstanceGroupManagerResizeRequests {
12118 /// Returns a builder for [RegionInstanceGroupManagerResizeRequests].
12119 ///
12120 /// ```
12121 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12122 /// # use google_cloud_compute_v1::client::RegionInstanceGroupManagerResizeRequests;
12123 /// let client = RegionInstanceGroupManagerResizeRequests::builder().build().await?;
12124 /// # Ok(()) }
12125 /// ```
12126 pub fn builder() -> super::builder::region_instance_group_manager_resize_requests::ClientBuilder
12127 {
12128 crate::new_client_builder(
12129 super::builder::region_instance_group_manager_resize_requests::client::Factory,
12130 )
12131 }
12132
12133 /// Creates a new client from the provided stub.
12134 ///
12135 /// The most common case for calling this function is in tests mocking the
12136 /// client's behavior.
12137 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12138 where
12139 T: super::stub::RegionInstanceGroupManagerResizeRequests + 'static,
12140 {
12141 Self { inner: stub.into() }
12142 }
12143
12144 pub(crate) async fn new(
12145 config: gaxi::options::ClientConfig,
12146 ) -> crate::ClientBuilderResult<Self> {
12147 let inner = Self::build_inner(config).await?;
12148 Ok(Self { inner })
12149 }
12150
12151 async fn build_inner(
12152 conf: gaxi::options::ClientConfig,
12153 ) -> crate::ClientBuilderResult<
12154 std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagerResizeRequests>,
12155 > {
12156 if gaxi::options::tracing_enabled(&conf) {
12157 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12158 }
12159 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12160 }
12161
12162 async fn build_transport(
12163 conf: gaxi::options::ClientConfig,
12164 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagerResizeRequests>
12165 {
12166 super::transport::RegionInstanceGroupManagerResizeRequests::new(conf).await
12167 }
12168
12169 async fn build_with_tracing(
12170 conf: gaxi::options::ClientConfig,
12171 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagerResizeRequests>
12172 {
12173 Self::build_transport(conf)
12174 .await
12175 .map(super::tracing::RegionInstanceGroupManagerResizeRequests::new)
12176 }
12177
12178 /// Cancels the specified resize request.
12179 /// Cancelled resize request no longer waits for the resources to be
12180 /// provisioned. Cancel is only possible for requests that are in accepted
12181 /// state.
12182 pub fn cancel(&self) -> super::builder::region_instance_group_manager_resize_requests::Cancel {
12183 super::builder::region_instance_group_manager_resize_requests::Cancel::new(
12184 self.inner.clone(),
12185 )
12186 }
12187
12188 /// Deletes the specified, inactive resize request. Requests that are still
12189 /// active cannot be deleted. Deleting request does not delete instances that
12190 /// were provisioned previously.
12191 pub fn delete(&self) -> super::builder::region_instance_group_manager_resize_requests::Delete {
12192 super::builder::region_instance_group_manager_resize_requests::Delete::new(
12193 self.inner.clone(),
12194 )
12195 }
12196
12197 /// Returns all of the details about the specified resize request.
12198 pub fn get(&self) -> super::builder::region_instance_group_manager_resize_requests::Get {
12199 super::builder::region_instance_group_manager_resize_requests::Get::new(self.inner.clone())
12200 }
12201
12202 /// Creates a new Resize Request that starts provisioning VMs immediately
12203 /// or queues VM creation.
12204 pub fn insert(&self) -> super::builder::region_instance_group_manager_resize_requests::Insert {
12205 super::builder::region_instance_group_manager_resize_requests::Insert::new(
12206 self.inner.clone(),
12207 )
12208 }
12209
12210 /// Retrieves a list of Resize Requests that are contained in the
12211 /// managed instance group.
12212 pub fn list(&self) -> super::builder::region_instance_group_manager_resize_requests::List {
12213 super::builder::region_instance_group_manager_resize_requests::List::new(self.inner.clone())
12214 }
12215
12216 /// Retrieves the specified region-specific Operations resource.
12217 pub fn get_operation(
12218 &self,
12219 ) -> super::builder::region_instance_group_manager_resize_requests::GetOperation {
12220 super::builder::region_instance_group_manager_resize_requests::GetOperation::new(
12221 self.inner.clone(),
12222 )
12223 }
12224}
12225
12226/// Implements a client for the Google Compute Engine API.
12227///
12228/// # Example
12229/// ```
12230/// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
12231/// async fn sample(
12232/// ) -> anyhow::Result<()> {
12233/// let client = RegionInstanceGroupManagers::builder().build().await?;
12234/// // use `client` to make requests to the Google Compute Engine API.
12235/// Ok(())
12236/// }
12237/// ```
12238///
12239/// # Service Description
12240///
12241/// Service for the `regionInstanceGroupManagers` resource.
12242///
12243/// # Configuration
12244///
12245/// To configure `RegionInstanceGroupManagers` use the `with_*` methods in the type returned
12246/// by [builder()][RegionInstanceGroupManagers::builder]. The default configuration should
12247/// work for most applications. Common configuration changes include
12248///
12249/// * [with_endpoint()]: by default this client uses the global default endpoint
12250/// (`https://compute.googleapis.com`). Applications using regional
12251/// endpoints or running in restricted networks (e.g. a network configured
12252/// with [Private Google Access with VPC Service Controls]) may want to
12253/// override this default.
12254/// * [with_credentials()]: by default this client uses
12255/// [Application Default Credentials]. Applications using custom
12256/// authentication may need to override this default.
12257///
12258/// [with_endpoint()]: super::builder::region_instance_group_managers::ClientBuilder::with_endpoint
12259/// [with_credentials()]: super::builder::region_instance_group_managers::ClientBuilder::with_credentials
12260/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12261/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12262///
12263/// # Pooling and Cloning
12264///
12265/// `RegionInstanceGroupManagers` holds a connection pool internally, it is advised to
12266/// create one and reuse it. You do not need to wrap `RegionInstanceGroupManagers` in
12267/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12268/// already uses an `Arc` internally.
12269#[cfg(feature = "region-instance-group-managers")]
12270#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-group-managers")))]
12271#[derive(Clone, Debug)]
12272pub struct RegionInstanceGroupManagers {
12273 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
12274}
12275
12276#[cfg(feature = "region-instance-group-managers")]
12277impl RegionInstanceGroupManagers {
12278 /// Returns a builder for [RegionInstanceGroupManagers].
12279 ///
12280 /// ```
12281 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12282 /// # use google_cloud_compute_v1::client::RegionInstanceGroupManagers;
12283 /// let client = RegionInstanceGroupManagers::builder().build().await?;
12284 /// # Ok(()) }
12285 /// ```
12286 pub fn builder() -> super::builder::region_instance_group_managers::ClientBuilder {
12287 crate::new_client_builder(super::builder::region_instance_group_managers::client::Factory)
12288 }
12289
12290 /// Creates a new client from the provided stub.
12291 ///
12292 /// The most common case for calling this function is in tests mocking the
12293 /// client's behavior.
12294 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12295 where
12296 T: super::stub::RegionInstanceGroupManagers + 'static,
12297 {
12298 Self { inner: stub.into() }
12299 }
12300
12301 pub(crate) async fn new(
12302 config: gaxi::options::ClientConfig,
12303 ) -> crate::ClientBuilderResult<Self> {
12304 let inner = Self::build_inner(config).await?;
12305 Ok(Self { inner })
12306 }
12307
12308 async fn build_inner(
12309 conf: gaxi::options::ClientConfig,
12310 ) -> crate::ClientBuilderResult<
12311 std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroupManagers>,
12312 > {
12313 if gaxi::options::tracing_enabled(&conf) {
12314 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12315 }
12316 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12317 }
12318
12319 async fn build_transport(
12320 conf: gaxi::options::ClientConfig,
12321 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagers> {
12322 super::transport::RegionInstanceGroupManagers::new(conf).await
12323 }
12324
12325 async fn build_with_tracing(
12326 conf: gaxi::options::ClientConfig,
12327 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroupManagers> {
12328 Self::build_transport(conf)
12329 .await
12330 .map(super::tracing::RegionInstanceGroupManagers::new)
12331 }
12332
12333 /// Flags the specified instances to be immediately removed from the managed
12334 /// instance group. Abandoning an instance does not delete the
12335 /// instance, but it does remove the instance from any target pools that are
12336 /// applied by the managed instance group. This method reduces thetargetSize of the managed instance group by the
12337 /// number of instances that you abandon. This operation is marked asDONE when the action is scheduled even if the instances have
12338 /// not yet been removed from the group. You must separately verify the
12339 /// status of the abandoning action with thelistmanagedinstances
12340 /// method.
12341 ///
12342 /// If the group is part of a backend
12343 /// service that has enabled
12344 /// connection draining, it can take up to 60 seconds after the connection
12345 /// draining duration has elapsed before the VM instance is removed or deleted.
12346 ///
12347 /// You can specify a maximum of 1000 instances with this method per request.
12348 pub fn abandon_instances(
12349 &self,
12350 ) -> super::builder::region_instance_group_managers::AbandonInstances {
12351 super::builder::region_instance_group_managers::AbandonInstances::new(self.inner.clone())
12352 }
12353
12354 /// Apply updates to selected instances the managed instance group.
12355 pub fn apply_updates_to_instances(
12356 &self,
12357 ) -> super::builder::region_instance_group_managers::ApplyUpdatesToInstances {
12358 super::builder::region_instance_group_managers::ApplyUpdatesToInstances::new(
12359 self.inner.clone(),
12360 )
12361 }
12362
12363 /// Creates instances with per-instance configurations in this regional managed
12364 /// instance group. Instances are created using the current instance template.
12365 /// The create instances operation is marked DONE if
12366 /// the createInstances request is successful. The underlying
12367 /// actions take additional time. You must separately verify the status of thecreating or actions with the listmanagedinstances
12368 /// method.
12369 pub fn create_instances(
12370 &self,
12371 ) -> super::builder::region_instance_group_managers::CreateInstances {
12372 super::builder::region_instance_group_managers::CreateInstances::new(self.inner.clone())
12373 }
12374
12375 /// Deletes the specified managed instance group and all of the instances
12376 /// in that group.
12377 pub fn delete(&self) -> super::builder::region_instance_group_managers::Delete {
12378 super::builder::region_instance_group_managers::Delete::new(self.inner.clone())
12379 }
12380
12381 /// Flags the specified instances in the managed instance group to be
12382 /// immediately deleted. The instances are also removed from any target
12383 /// pools of which they were a member. This method reduces thetargetSize of the managed instance group by the number of
12384 /// instances that you delete.
12385 /// The deleteInstances operation is marked DONE if
12386 /// the deleteInstances request is successful. The underlying
12387 /// actions take additional time. You must separately verify the status of thedeleting action with thelistmanagedinstances
12388 /// method.
12389 ///
12390 /// If the group is part of a backend
12391 /// service that has enabled
12392 /// connection draining, it can take up to 60 seconds after the connection
12393 /// draining duration has elapsed before the VM instance is removed or deleted.
12394 ///
12395 /// You can specify a maximum of 1000 instances with this method per request.
12396 pub fn delete_instances(
12397 &self,
12398 ) -> super::builder::region_instance_group_managers::DeleteInstances {
12399 super::builder::region_instance_group_managers::DeleteInstances::new(self.inner.clone())
12400 }
12401
12402 /// Deletes selected per-instance configurations for the managed instance
12403 /// group.
12404 pub fn delete_per_instance_configs(
12405 &self,
12406 ) -> super::builder::region_instance_group_managers::DeletePerInstanceConfigs {
12407 super::builder::region_instance_group_managers::DeletePerInstanceConfigs::new(
12408 self.inner.clone(),
12409 )
12410 }
12411
12412 /// Returns all of the details about the specified managed instance group.
12413 pub fn get(&self) -> super::builder::region_instance_group_managers::Get {
12414 super::builder::region_instance_group_managers::Get::new(self.inner.clone())
12415 }
12416
12417 /// Creates a managed instance group using the information that you specify
12418 /// in the request. After the group is created, instances in the group are
12419 /// created using the specified instance template.
12420 /// This operation is marked as DONE when the group is created
12421 /// even if the instances in the group have not yet been created. You must
12422 /// separately verify the status of the individual instances with thelistmanagedinstances
12423 /// method.
12424 ///
12425 /// A regional managed instance group can contain up to 2000 instances.
12426 pub fn insert(&self) -> super::builder::region_instance_group_managers::Insert {
12427 super::builder::region_instance_group_managers::Insert::new(self.inner.clone())
12428 }
12429
12430 /// Retrieves the list of managed instance groups that are contained
12431 /// within the specified region.
12432 pub fn list(&self) -> super::builder::region_instance_group_managers::List {
12433 super::builder::region_instance_group_managers::List::new(self.inner.clone())
12434 }
12435
12436 /// Lists all errors thrown by actions on instances for a given regional
12437 /// managed instance group. The filter andorderBy query parameters are not supported.
12438 pub fn list_errors(&self) -> super::builder::region_instance_group_managers::ListErrors {
12439 super::builder::region_instance_group_managers::ListErrors::new(self.inner.clone())
12440 }
12441
12442 /// Lists the instances in the managed instance group and instances that are
12443 /// scheduled to be created. The list includes any current actions
12444 /// that the group has scheduled for its instances. The orderBy
12445 /// query parameter is not supported. The `pageToken` query parameter is
12446 /// supported only if the group's `listManagedInstancesResults` field is set
12447 /// to `PAGINATED`.
12448 pub fn list_managed_instances(
12449 &self,
12450 ) -> super::builder::region_instance_group_managers::ListManagedInstances {
12451 super::builder::region_instance_group_managers::ListManagedInstances::new(
12452 self.inner.clone(),
12453 )
12454 }
12455
12456 /// Lists all of the per-instance configurations defined for the managed
12457 /// instance group. The orderBy query parameter is not supported.
12458 pub fn list_per_instance_configs(
12459 &self,
12460 ) -> super::builder::region_instance_group_managers::ListPerInstanceConfigs {
12461 super::builder::region_instance_group_managers::ListPerInstanceConfigs::new(
12462 self.inner.clone(),
12463 )
12464 }
12465
12466 /// Updates a managed instance group using the information that you specify
12467 /// in the request.
12468 /// This operation is marked as DONE when the group is patched
12469 /// even if the instances in the group are still in the process of being
12470 /// patched. You must separately verify the status of the individual instances
12471 /// with the listmanagedinstances
12472 /// method. This method supportsPATCH
12473 /// semantics and uses theJSON merge
12474 /// patch format and processing rules.
12475 ///
12476 /// If you update your group to specify a new template or instance
12477 /// configuration, it's possible that your intended specification for each VM
12478 /// in the group is different from the current state of that VM. To learn how
12479 /// to apply an updated configuration to the VMs in a MIG, seeUpdating instances in
12480 /// a MIG.
12481 pub fn patch(&self) -> super::builder::region_instance_group_managers::Patch {
12482 super::builder::region_instance_group_managers::Patch::new(self.inner.clone())
12483 }
12484
12485 /// Inserts or patches per-instance configurations for the managed instance
12486 /// group. perInstanceConfig.name serves as a key used to
12487 /// distinguish whether to perform insert or patch.
12488 pub fn patch_per_instance_configs(
12489 &self,
12490 ) -> super::builder::region_instance_group_managers::PatchPerInstanceConfigs {
12491 super::builder::region_instance_group_managers::PatchPerInstanceConfigs::new(
12492 self.inner.clone(),
12493 )
12494 }
12495
12496 /// Flags the specified VM instances in the managed instance group to be
12497 /// immediately recreated. Each instance is recreated using the group's current
12498 /// configuration. This operation is marked as DONE when the flag
12499 /// is set even if the instances have not yet been recreated. You must
12500 /// separately verify the status of each instance by checking itscurrentAction field; for more information, see Checking
12501 /// the status of managed instances.
12502 ///
12503 /// If the group is part of a backend
12504 /// service that has enabled
12505 /// connection draining, it can take up to 60 seconds after the connection
12506 /// draining duration has elapsed before the VM instance is removed or deleted.
12507 ///
12508 /// You can specify a maximum of 1000 instances with this method per request.
12509 pub fn recreate_instances(
12510 &self,
12511 ) -> super::builder::region_instance_group_managers::RecreateInstances {
12512 super::builder::region_instance_group_managers::RecreateInstances::new(self.inner.clone())
12513 }
12514
12515 /// Changes the intended size of the managed instance group. If you increase
12516 /// the size, the group creates new instances using the current instance
12517 /// template. If you decrease the size, the group deletes one or more
12518 /// instances.
12519 ///
12520 /// The resize operation is marked DONE if theresize request is successful. The underlying actions take
12521 /// additional time. You must separately verify the status of thecreating or deleting actions with thelistmanagedinstances
12522 /// method.
12523 ///
12524 /// If the group is part of a backend
12525 /// service that has enabled
12526 /// connection draining, it can take up to 60 seconds after the connection
12527 /// draining duration has elapsed before the VM instance is removed or deleted.
12528 pub fn resize(&self) -> super::builder::region_instance_group_managers::Resize {
12529 super::builder::region_instance_group_managers::Resize::new(self.inner.clone())
12530 }
12531
12532 /// Flags the specified instances in the managed instance group to be
12533 /// resumed. This method increases thetargetSize and decreases the targetSuspendedSize
12534 /// of the managed instance group by the number of instances that you resume.
12535 /// The resumeInstances operation is marked DONE if
12536 /// the resumeInstances request is successful. The underlying
12537 /// actions take additional time. You must separately verify the status of theRESUMING action with thelistmanagedinstances
12538 /// method.
12539 ///
12540 /// In this request, you can only specify instances that are suspended. For
12541 /// example, if an instance was previously suspended using the suspendInstances
12542 /// method, it can be resumed using the resumeInstances method.
12543 ///
12544 /// If a health check is attached to the managed instance group, the specified
12545 /// instances will be verified as healthy after they are resumed.
12546 ///
12547 /// You can specify a maximum of 1000 instances with this method per request.
12548 pub fn resume_instances(
12549 &self,
12550 ) -> super::builder::region_instance_group_managers::ResumeInstances {
12551 super::builder::region_instance_group_managers::ResumeInstances::new(self.inner.clone())
12552 }
12553
12554 /// Sets the instance template to use when creating new instances or recreating
12555 /// instances in this group. Existing instances are not affected.
12556 pub fn set_instance_template(
12557 &self,
12558 ) -> super::builder::region_instance_group_managers::SetInstanceTemplate {
12559 super::builder::region_instance_group_managers::SetInstanceTemplate::new(self.inner.clone())
12560 }
12561
12562 /// Modifies the target pools to which all new instances in this group are
12563 /// assigned. Existing instances in the group are not affected.
12564 pub fn set_target_pools(
12565 &self,
12566 ) -> super::builder::region_instance_group_managers::SetTargetPools {
12567 super::builder::region_instance_group_managers::SetTargetPools::new(self.inner.clone())
12568 }
12569
12570 /// Flags the specified instances in the managed instance group to be
12571 /// started. This method increases thetargetSize and decreases the targetStoppedSize
12572 /// of the managed instance group by the number of instances that you start.
12573 /// The startInstances operation is marked DONE if
12574 /// the startInstances request is successful. The underlying
12575 /// actions take additional time. You must separately verify the status of theSTARTING action with thelistmanagedinstances
12576 /// method.
12577 ///
12578 /// In this request, you can only specify instances that are stopped. For
12579 /// example, if an instance was previously stopped using the stopInstances
12580 /// method, it can be started using the startInstances method.
12581 ///
12582 /// If a health check is attached to the managed instance group, the specified
12583 /// instances will be verified as healthy after they are started.
12584 ///
12585 /// You can specify a maximum of 1000 instances with this method per request.
12586 pub fn start_instances(
12587 &self,
12588 ) -> super::builder::region_instance_group_managers::StartInstances {
12589 super::builder::region_instance_group_managers::StartInstances::new(self.inner.clone())
12590 }
12591
12592 /// Flags the specified instances in the managed instance group to be
12593 /// immediately stopped. You can only specify instances that are running in
12594 /// this request. This method reduces thetargetSize and increases the targetStoppedSize
12595 /// of the managed instance group by the number of instances that you stop.
12596 /// The stopInstances operation is marked DONE if
12597 /// the stopInstances request is successful. The underlying
12598 /// actions take additional time. You must separately verify the status of theSTOPPING action with thelistmanagedinstances
12599 /// method.
12600 ///
12601 /// If the standbyPolicy.initialDelaySec field is set, the group
12602 /// delays stopping the instances until initialDelaySec have
12603 /// passed from instance.creationTimestamp (that is, when the
12604 /// instance was created). This delay gives your application time to
12605 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
12606 /// will be zero delay.
12607 ///
12608 /// If the group is part of a backend
12609 /// service that has enabled
12610 /// connection draining, it can take up to 60 seconds after the connection
12611 /// draining duration has elapsed before the VM instance is stopped.
12612 ///
12613 /// Stopped instances can be started using the startInstances
12614 /// method.
12615 ///
12616 /// You can specify a maximum of 1000 instances with this method per request.
12617 pub fn stop_instances(&self) -> super::builder::region_instance_group_managers::StopInstances {
12618 super::builder::region_instance_group_managers::StopInstances::new(self.inner.clone())
12619 }
12620
12621 /// Flags the specified instances in the managed instance group to be
12622 /// immediately suspended. You can only specify instances that are running in
12623 /// this request. This method reduces thetargetSize and increases the targetSuspendedSize
12624 /// of the managed instance group by the number of instances that you suspend.
12625 /// The suspendInstances operation is marked DONE if
12626 /// the suspendInstances request is successful. The underlying
12627 /// actions take additional time. You must separately verify the status of theSUSPENDING action with thelistmanagedinstances
12628 /// method.
12629 ///
12630 /// If the standbyPolicy.initialDelaySec field is set, the group
12631 /// delays suspension of the instances until initialDelaySec have
12632 /// passed from instance.creationTimestamp (that is, when the
12633 /// instance was created). This delay gives your application time to
12634 /// set itself up and initialize on the instance. If more thaninitialDelaySec seconds have passed sinceinstance.creationTimestamp when this method is called, there
12635 /// will be zero delay.
12636 ///
12637 /// If the group is part of a backend
12638 /// service that has enabled
12639 /// connection draining, it can take up to 60 seconds after the connection
12640 /// draining duration has elapsed before the VM instance is suspended.
12641 ///
12642 /// Suspended instances can be resumed using the resumeInstances
12643 /// method.
12644 ///
12645 /// You can specify a maximum of 1000 instances with this method per request.
12646 pub fn suspend_instances(
12647 &self,
12648 ) -> super::builder::region_instance_group_managers::SuspendInstances {
12649 super::builder::region_instance_group_managers::SuspendInstances::new(self.inner.clone())
12650 }
12651
12652 /// Inserts or updates per-instance configurations for the managed instance
12653 /// group. perInstanceConfig.name serves as a key used to
12654 /// distinguish whether to perform insert or patch.
12655 pub fn update_per_instance_configs(
12656 &self,
12657 ) -> super::builder::region_instance_group_managers::UpdatePerInstanceConfigs {
12658 super::builder::region_instance_group_managers::UpdatePerInstanceConfigs::new(
12659 self.inner.clone(),
12660 )
12661 }
12662
12663 /// Retrieves the specified region-specific Operations resource.
12664 pub fn get_operation(&self) -> super::builder::region_instance_group_managers::GetOperation {
12665 super::builder::region_instance_group_managers::GetOperation::new(self.inner.clone())
12666 }
12667}
12668
12669/// Implements a client for the Google Compute Engine API.
12670///
12671/// # Example
12672/// ```
12673/// # use google_cloud_compute_v1::client::RegionInstanceGroups;
12674/// async fn sample(
12675/// ) -> anyhow::Result<()> {
12676/// let client = RegionInstanceGroups::builder().build().await?;
12677/// // use `client` to make requests to the Google Compute Engine API.
12678/// Ok(())
12679/// }
12680/// ```
12681///
12682/// # Service Description
12683///
12684/// Service for the `regionInstanceGroups` resource.
12685///
12686/// # Configuration
12687///
12688/// To configure `RegionInstanceGroups` use the `with_*` methods in the type returned
12689/// by [builder()][RegionInstanceGroups::builder]. The default configuration should
12690/// work for most applications. Common configuration changes include
12691///
12692/// * [with_endpoint()]: by default this client uses the global default endpoint
12693/// (`https://compute.googleapis.com`). Applications using regional
12694/// endpoints or running in restricted networks (e.g. a network configured
12695/// with [Private Google Access with VPC Service Controls]) may want to
12696/// override this default.
12697/// * [with_credentials()]: by default this client uses
12698/// [Application Default Credentials]. Applications using custom
12699/// authentication may need to override this default.
12700///
12701/// [with_endpoint()]: super::builder::region_instance_groups::ClientBuilder::with_endpoint
12702/// [with_credentials()]: super::builder::region_instance_groups::ClientBuilder::with_credentials
12703/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12704/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12705///
12706/// # Pooling and Cloning
12707///
12708/// `RegionInstanceGroups` holds a connection pool internally, it is advised to
12709/// create one and reuse it. You do not need to wrap `RegionInstanceGroups` in
12710/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12711/// already uses an `Arc` internally.
12712#[cfg(feature = "region-instance-groups")]
12713#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-groups")))]
12714#[derive(Clone, Debug)]
12715pub struct RegionInstanceGroups {
12716 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>,
12717}
12718
12719#[cfg(feature = "region-instance-groups")]
12720impl RegionInstanceGroups {
12721 /// Returns a builder for [RegionInstanceGroups].
12722 ///
12723 /// ```
12724 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12725 /// # use google_cloud_compute_v1::client::RegionInstanceGroups;
12726 /// let client = RegionInstanceGroups::builder().build().await?;
12727 /// # Ok(()) }
12728 /// ```
12729 pub fn builder() -> super::builder::region_instance_groups::ClientBuilder {
12730 crate::new_client_builder(super::builder::region_instance_groups::client::Factory)
12731 }
12732
12733 /// Creates a new client from the provided stub.
12734 ///
12735 /// The most common case for calling this function is in tests mocking the
12736 /// client's behavior.
12737 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12738 where
12739 T: super::stub::RegionInstanceGroups + 'static,
12740 {
12741 Self { inner: stub.into() }
12742 }
12743
12744 pub(crate) async fn new(
12745 config: gaxi::options::ClientConfig,
12746 ) -> crate::ClientBuilderResult<Self> {
12747 let inner = Self::build_inner(config).await?;
12748 Ok(Self { inner })
12749 }
12750
12751 async fn build_inner(
12752 conf: gaxi::options::ClientConfig,
12753 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceGroups>>
12754 {
12755 if gaxi::options::tracing_enabled(&conf) {
12756 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12757 }
12758 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12759 }
12760
12761 async fn build_transport(
12762 conf: gaxi::options::ClientConfig,
12763 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroups> {
12764 super::transport::RegionInstanceGroups::new(conf).await
12765 }
12766
12767 async fn build_with_tracing(
12768 conf: gaxi::options::ClientConfig,
12769 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceGroups> {
12770 Self::build_transport(conf)
12771 .await
12772 .map(super::tracing::RegionInstanceGroups::new)
12773 }
12774
12775 /// Returns the specified instance group resource.
12776 pub fn get(&self) -> super::builder::region_instance_groups::Get {
12777 super::builder::region_instance_groups::Get::new(self.inner.clone())
12778 }
12779
12780 /// Retrieves the list of instance group resources contained within
12781 /// the specified region.
12782 pub fn list(&self) -> super::builder::region_instance_groups::List {
12783 super::builder::region_instance_groups::List::new(self.inner.clone())
12784 }
12785
12786 /// Lists the instances in the specified instance group and displays
12787 /// information about the named ports. Depending on the specified options, this
12788 /// method can list all instances or only the instances that are running.
12789 /// The orderBy query parameter is not supported.
12790 pub fn list_instances(&self) -> super::builder::region_instance_groups::ListInstances {
12791 super::builder::region_instance_groups::ListInstances::new(self.inner.clone())
12792 }
12793
12794 /// Sets the named ports for the specified regional instance group.
12795 pub fn set_named_ports(&self) -> super::builder::region_instance_groups::SetNamedPorts {
12796 super::builder::region_instance_groups::SetNamedPorts::new(self.inner.clone())
12797 }
12798
12799 /// Returns permissions that a caller has on the specified resource.
12800 pub fn test_iam_permissions(
12801 &self,
12802 ) -> super::builder::region_instance_groups::TestIamPermissions {
12803 super::builder::region_instance_groups::TestIamPermissions::new(self.inner.clone())
12804 }
12805
12806 /// Retrieves the specified region-specific Operations resource.
12807 pub fn get_operation(&self) -> super::builder::region_instance_groups::GetOperation {
12808 super::builder::region_instance_groups::GetOperation::new(self.inner.clone())
12809 }
12810}
12811
12812/// Implements a client for the Google Compute Engine API.
12813///
12814/// # Example
12815/// ```
12816/// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
12817/// async fn sample(
12818/// ) -> anyhow::Result<()> {
12819/// let client = RegionInstanceTemplates::builder().build().await?;
12820/// // use `client` to make requests to the Google Compute Engine API.
12821/// Ok(())
12822/// }
12823/// ```
12824///
12825/// # Service Description
12826///
12827/// Service for the `regionInstanceTemplates` resource.
12828///
12829/// # Configuration
12830///
12831/// To configure `RegionInstanceTemplates` use the `with_*` methods in the type returned
12832/// by [builder()][RegionInstanceTemplates::builder]. The default configuration should
12833/// work for most applications. Common configuration changes include
12834///
12835/// * [with_endpoint()]: by default this client uses the global default endpoint
12836/// (`https://compute.googleapis.com`). Applications using regional
12837/// endpoints or running in restricted networks (e.g. a network configured
12838/// with [Private Google Access with VPC Service Controls]) may want to
12839/// override this default.
12840/// * [with_credentials()]: by default this client uses
12841/// [Application Default Credentials]. Applications using custom
12842/// authentication may need to override this default.
12843///
12844/// [with_endpoint()]: super::builder::region_instance_templates::ClientBuilder::with_endpoint
12845/// [with_credentials()]: super::builder::region_instance_templates::ClientBuilder::with_credentials
12846/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12847/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12848///
12849/// # Pooling and Cloning
12850///
12851/// `RegionInstanceTemplates` holds a connection pool internally, it is advised to
12852/// create one and reuse it. You do not need to wrap `RegionInstanceTemplates` in
12853/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12854/// already uses an `Arc` internally.
12855#[cfg(feature = "region-instance-templates")]
12856#[cfg_attr(docsrs, doc(cfg(feature = "region-instance-templates")))]
12857#[derive(Clone, Debug)]
12858pub struct RegionInstanceTemplates {
12859 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>,
12860}
12861
12862#[cfg(feature = "region-instance-templates")]
12863impl RegionInstanceTemplates {
12864 /// Returns a builder for [RegionInstanceTemplates].
12865 ///
12866 /// ```
12867 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
12868 /// # use google_cloud_compute_v1::client::RegionInstanceTemplates;
12869 /// let client = RegionInstanceTemplates::builder().build().await?;
12870 /// # Ok(()) }
12871 /// ```
12872 pub fn builder() -> super::builder::region_instance_templates::ClientBuilder {
12873 crate::new_client_builder(super::builder::region_instance_templates::client::Factory)
12874 }
12875
12876 /// Creates a new client from the provided stub.
12877 ///
12878 /// The most common case for calling this function is in tests mocking the
12879 /// client's behavior.
12880 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
12881 where
12882 T: super::stub::RegionInstanceTemplates + 'static,
12883 {
12884 Self { inner: stub.into() }
12885 }
12886
12887 pub(crate) async fn new(
12888 config: gaxi::options::ClientConfig,
12889 ) -> crate::ClientBuilderResult<Self> {
12890 let inner = Self::build_inner(config).await?;
12891 Ok(Self { inner })
12892 }
12893
12894 async fn build_inner(
12895 conf: gaxi::options::ClientConfig,
12896 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstanceTemplates>>
12897 {
12898 if gaxi::options::tracing_enabled(&conf) {
12899 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
12900 }
12901 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
12902 }
12903
12904 async fn build_transport(
12905 conf: gaxi::options::ClientConfig,
12906 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceTemplates> {
12907 super::transport::RegionInstanceTemplates::new(conf).await
12908 }
12909
12910 async fn build_with_tracing(
12911 conf: gaxi::options::ClientConfig,
12912 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstanceTemplates> {
12913 Self::build_transport(conf)
12914 .await
12915 .map(super::tracing::RegionInstanceTemplates::new)
12916 }
12917
12918 /// Deletes the specified instance template. Deleting an instance template is
12919 /// permanent and cannot be undone.
12920 pub fn delete(&self) -> super::builder::region_instance_templates::Delete {
12921 super::builder::region_instance_templates::Delete::new(self.inner.clone())
12922 }
12923
12924 /// Returns the specified instance template.
12925 pub fn get(&self) -> super::builder::region_instance_templates::Get {
12926 super::builder::region_instance_templates::Get::new(self.inner.clone())
12927 }
12928
12929 /// Creates an instance template in the specified project and region using the
12930 /// global instance template whose URL is included in the request.
12931 pub fn insert(&self) -> super::builder::region_instance_templates::Insert {
12932 super::builder::region_instance_templates::Insert::new(self.inner.clone())
12933 }
12934
12935 /// Retrieves a list of instance templates that are contained within the
12936 /// specified project and region.
12937 pub fn list(&self) -> super::builder::region_instance_templates::List {
12938 super::builder::region_instance_templates::List::new(self.inner.clone())
12939 }
12940
12941 /// Retrieves the specified region-specific Operations resource.
12942 pub fn get_operation(&self) -> super::builder::region_instance_templates::GetOperation {
12943 super::builder::region_instance_templates::GetOperation::new(self.inner.clone())
12944 }
12945}
12946
12947/// Implements a client for the Google Compute Engine API.
12948///
12949/// # Example
12950/// ```
12951/// # use google_cloud_compute_v1::client::RegionInstances;
12952/// async fn sample(
12953/// ) -> anyhow::Result<()> {
12954/// let client = RegionInstances::builder().build().await?;
12955/// // use `client` to make requests to the Google Compute Engine API.
12956/// Ok(())
12957/// }
12958/// ```
12959///
12960/// # Service Description
12961///
12962/// Service for the `regionInstances` resource.
12963///
12964/// # Configuration
12965///
12966/// To configure `RegionInstances` use the `with_*` methods in the type returned
12967/// by [builder()][RegionInstances::builder]. The default configuration should
12968/// work for most applications. Common configuration changes include
12969///
12970/// * [with_endpoint()]: by default this client uses the global default endpoint
12971/// (`https://compute.googleapis.com`). Applications using regional
12972/// endpoints or running in restricted networks (e.g. a network configured
12973/// with [Private Google Access with VPC Service Controls]) may want to
12974/// override this default.
12975/// * [with_credentials()]: by default this client uses
12976/// [Application Default Credentials]. Applications using custom
12977/// authentication may need to override this default.
12978///
12979/// [with_endpoint()]: super::builder::region_instances::ClientBuilder::with_endpoint
12980/// [with_credentials()]: super::builder::region_instances::ClientBuilder::with_credentials
12981/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
12982/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
12983///
12984/// # Pooling and Cloning
12985///
12986/// `RegionInstances` holds a connection pool internally, it is advised to
12987/// create one and reuse it. You do not need to wrap `RegionInstances` in
12988/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
12989/// already uses an `Arc` internally.
12990#[cfg(feature = "region-instances")]
12991#[cfg_attr(docsrs, doc(cfg(feature = "region-instances")))]
12992#[derive(Clone, Debug)]
12993pub struct RegionInstances {
12994 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstances>,
12995}
12996
12997#[cfg(feature = "region-instances")]
12998impl RegionInstances {
12999 /// Returns a builder for [RegionInstances].
13000 ///
13001 /// ```
13002 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13003 /// # use google_cloud_compute_v1::client::RegionInstances;
13004 /// let client = RegionInstances::builder().build().await?;
13005 /// # Ok(()) }
13006 /// ```
13007 pub fn builder() -> super::builder::region_instances::ClientBuilder {
13008 crate::new_client_builder(super::builder::region_instances::client::Factory)
13009 }
13010
13011 /// Creates a new client from the provided stub.
13012 ///
13013 /// The most common case for calling this function is in tests mocking the
13014 /// client's behavior.
13015 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13016 where
13017 T: super::stub::RegionInstances + 'static,
13018 {
13019 Self { inner: stub.into() }
13020 }
13021
13022 pub(crate) async fn new(
13023 config: gaxi::options::ClientConfig,
13024 ) -> crate::ClientBuilderResult<Self> {
13025 let inner = Self::build_inner(config).await?;
13026 Ok(Self { inner })
13027 }
13028
13029 async fn build_inner(
13030 conf: gaxi::options::ClientConfig,
13031 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstances>> {
13032 if gaxi::options::tracing_enabled(&conf) {
13033 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13034 }
13035 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13036 }
13037
13038 async fn build_transport(
13039 conf: gaxi::options::ClientConfig,
13040 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstances> {
13041 super::transport::RegionInstances::new(conf).await
13042 }
13043
13044 async fn build_with_tracing(
13045 conf: gaxi::options::ClientConfig,
13046 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstances> {
13047 Self::build_transport(conf)
13048 .await
13049 .map(super::tracing::RegionInstances::new)
13050 }
13051
13052 /// Creates multiple instances in a given region. Count specifies the number of
13053 /// instances to create.
13054 pub fn bulk_insert(&self) -> super::builder::region_instances::BulkInsert {
13055 super::builder::region_instances::BulkInsert::new(self.inner.clone())
13056 }
13057
13058 /// Retrieves the specified region-specific Operations resource.
13059 pub fn get_operation(&self) -> super::builder::region_instances::GetOperation {
13060 super::builder::region_instances::GetOperation::new(self.inner.clone())
13061 }
13062}
13063
13064/// Implements a client for the Google Compute Engine API.
13065///
13066/// # Example
13067/// ```
13068/// # use google_cloud_compute_v1::client::RegionInstantSnapshotGroups;
13069/// async fn sample(
13070/// ) -> anyhow::Result<()> {
13071/// let client = RegionInstantSnapshotGroups::builder().build().await?;
13072/// // use `client` to make requests to the Google Compute Engine API.
13073/// Ok(())
13074/// }
13075/// ```
13076///
13077/// # Service Description
13078///
13079/// Service for the `regionInstantSnapshotGroups` resource.
13080///
13081/// # Configuration
13082///
13083/// To configure `RegionInstantSnapshotGroups` use the `with_*` methods in the type returned
13084/// by [builder()][RegionInstantSnapshotGroups::builder]. The default configuration should
13085/// work for most applications. Common configuration changes include
13086///
13087/// * [with_endpoint()]: by default this client uses the global default endpoint
13088/// (`https://compute.googleapis.com`). Applications using regional
13089/// endpoints or running in restricted networks (e.g. a network configured
13090/// with [Private Google Access with VPC Service Controls]) may want to
13091/// override this default.
13092/// * [with_credentials()]: by default this client uses
13093/// [Application Default Credentials]. Applications using custom
13094/// authentication may need to override this default.
13095///
13096/// [with_endpoint()]: super::builder::region_instant_snapshot_groups::ClientBuilder::with_endpoint
13097/// [with_credentials()]: super::builder::region_instant_snapshot_groups::ClientBuilder::with_credentials
13098/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13099/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13100///
13101/// # Pooling and Cloning
13102///
13103/// `RegionInstantSnapshotGroups` holds a connection pool internally, it is advised to
13104/// create one and reuse it. You do not need to wrap `RegionInstantSnapshotGroups` in
13105/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13106/// already uses an `Arc` internally.
13107#[cfg(feature = "region-instant-snapshot-groups")]
13108#[cfg_attr(docsrs, doc(cfg(feature = "region-instant-snapshot-groups")))]
13109#[derive(Clone, Debug)]
13110pub struct RegionInstantSnapshotGroups {
13111 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshotGroups>,
13112}
13113
13114#[cfg(feature = "region-instant-snapshot-groups")]
13115impl RegionInstantSnapshotGroups {
13116 /// Returns a builder for [RegionInstantSnapshotGroups].
13117 ///
13118 /// ```
13119 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13120 /// # use google_cloud_compute_v1::client::RegionInstantSnapshotGroups;
13121 /// let client = RegionInstantSnapshotGroups::builder().build().await?;
13122 /// # Ok(()) }
13123 /// ```
13124 pub fn builder() -> super::builder::region_instant_snapshot_groups::ClientBuilder {
13125 crate::new_client_builder(super::builder::region_instant_snapshot_groups::client::Factory)
13126 }
13127
13128 /// Creates a new client from the provided stub.
13129 ///
13130 /// The most common case for calling this function is in tests mocking the
13131 /// client's behavior.
13132 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13133 where
13134 T: super::stub::RegionInstantSnapshotGroups + 'static,
13135 {
13136 Self { inner: stub.into() }
13137 }
13138
13139 pub(crate) async fn new(
13140 config: gaxi::options::ClientConfig,
13141 ) -> crate::ClientBuilderResult<Self> {
13142 let inner = Self::build_inner(config).await?;
13143 Ok(Self { inner })
13144 }
13145
13146 async fn build_inner(
13147 conf: gaxi::options::ClientConfig,
13148 ) -> crate::ClientBuilderResult<
13149 std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshotGroups>,
13150 > {
13151 if gaxi::options::tracing_enabled(&conf) {
13152 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13153 }
13154 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13155 }
13156
13157 async fn build_transport(
13158 conf: gaxi::options::ClientConfig,
13159 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshotGroups> {
13160 super::transport::RegionInstantSnapshotGroups::new(conf).await
13161 }
13162
13163 async fn build_with_tracing(
13164 conf: gaxi::options::ClientConfig,
13165 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshotGroups> {
13166 Self::build_transport(conf)
13167 .await
13168 .map(super::tracing::RegionInstantSnapshotGroups::new)
13169 }
13170
13171 /// deletes a Regional InstantSnapshotGroup resource
13172 pub fn delete(&self) -> super::builder::region_instant_snapshot_groups::Delete {
13173 super::builder::region_instant_snapshot_groups::Delete::new(self.inner.clone())
13174 }
13175
13176 /// returns the specified InstantSnapshotGroup resource in the specified
13177 /// region.
13178 pub fn get(&self) -> super::builder::region_instant_snapshot_groups::Get {
13179 super::builder::region_instant_snapshot_groups::Get::new(self.inner.clone())
13180 }
13181
13182 /// Gets the access control policy for a resource. May be empty if no such
13183 /// policy or resource exists.
13184 pub fn get_iam_policy(&self) -> super::builder::region_instant_snapshot_groups::GetIamPolicy {
13185 super::builder::region_instant_snapshot_groups::GetIamPolicy::new(self.inner.clone())
13186 }
13187
13188 /// creates a Regional InstantSnapshotGroup resource
13189 pub fn insert(&self) -> super::builder::region_instant_snapshot_groups::Insert {
13190 super::builder::region_instant_snapshot_groups::Insert::new(self.inner.clone())
13191 }
13192
13193 /// retrieves the list of InstantSnapshotGroup resources contained within
13194 /// the specified region.
13195 pub fn list(&self) -> super::builder::region_instant_snapshot_groups::List {
13196 super::builder::region_instant_snapshot_groups::List::new(self.inner.clone())
13197 }
13198
13199 /// Sets the access control policy on the specified resource.
13200 /// Replaces any existing policy.
13201 pub fn set_iam_policy(&self) -> super::builder::region_instant_snapshot_groups::SetIamPolicy {
13202 super::builder::region_instant_snapshot_groups::SetIamPolicy::new(self.inner.clone())
13203 }
13204
13205 /// Returns permissions that a caller has on the specified resource.
13206 pub fn test_iam_permissions(
13207 &self,
13208 ) -> super::builder::region_instant_snapshot_groups::TestIamPermissions {
13209 super::builder::region_instant_snapshot_groups::TestIamPermissions::new(self.inner.clone())
13210 }
13211
13212 /// Retrieves the specified region-specific Operations resource.
13213 pub fn get_operation(&self) -> super::builder::region_instant_snapshot_groups::GetOperation {
13214 super::builder::region_instant_snapshot_groups::GetOperation::new(self.inner.clone())
13215 }
13216}
13217
13218/// Implements a client for the Google Compute Engine API.
13219///
13220/// # Example
13221/// ```
13222/// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
13223/// async fn sample(
13224/// ) -> anyhow::Result<()> {
13225/// let client = RegionInstantSnapshots::builder().build().await?;
13226/// // use `client` to make requests to the Google Compute Engine API.
13227/// Ok(())
13228/// }
13229/// ```
13230///
13231/// # Service Description
13232///
13233/// Service for the `regionInstantSnapshots` resource.
13234///
13235/// # Configuration
13236///
13237/// To configure `RegionInstantSnapshots` use the `with_*` methods in the type returned
13238/// by [builder()][RegionInstantSnapshots::builder]. The default configuration should
13239/// work for most applications. Common configuration changes include
13240///
13241/// * [with_endpoint()]: by default this client uses the global default endpoint
13242/// (`https://compute.googleapis.com`). Applications using regional
13243/// endpoints or running in restricted networks (e.g. a network configured
13244/// with [Private Google Access with VPC Service Controls]) may want to
13245/// override this default.
13246/// * [with_credentials()]: by default this client uses
13247/// [Application Default Credentials]. Applications using custom
13248/// authentication may need to override this default.
13249///
13250/// [with_endpoint()]: super::builder::region_instant_snapshots::ClientBuilder::with_endpoint
13251/// [with_credentials()]: super::builder::region_instant_snapshots::ClientBuilder::with_credentials
13252/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13253/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13254///
13255/// # Pooling and Cloning
13256///
13257/// `RegionInstantSnapshots` holds a connection pool internally, it is advised to
13258/// create one and reuse it. You do not need to wrap `RegionInstantSnapshots` in
13259/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13260/// already uses an `Arc` internally.
13261#[cfg(feature = "region-instant-snapshots")]
13262#[cfg_attr(docsrs, doc(cfg(feature = "region-instant-snapshots")))]
13263#[derive(Clone, Debug)]
13264pub struct RegionInstantSnapshots {
13265 inner: std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>,
13266}
13267
13268#[cfg(feature = "region-instant-snapshots")]
13269impl RegionInstantSnapshots {
13270 /// Returns a builder for [RegionInstantSnapshots].
13271 ///
13272 /// ```
13273 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13274 /// # use google_cloud_compute_v1::client::RegionInstantSnapshots;
13275 /// let client = RegionInstantSnapshots::builder().build().await?;
13276 /// # Ok(()) }
13277 /// ```
13278 pub fn builder() -> super::builder::region_instant_snapshots::ClientBuilder {
13279 crate::new_client_builder(super::builder::region_instant_snapshots::client::Factory)
13280 }
13281
13282 /// Creates a new client from the provided stub.
13283 ///
13284 /// The most common case for calling this function is in tests mocking the
13285 /// client's behavior.
13286 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13287 where
13288 T: super::stub::RegionInstantSnapshots + 'static,
13289 {
13290 Self { inner: stub.into() }
13291 }
13292
13293 pub(crate) async fn new(
13294 config: gaxi::options::ClientConfig,
13295 ) -> crate::ClientBuilderResult<Self> {
13296 let inner = Self::build_inner(config).await?;
13297 Ok(Self { inner })
13298 }
13299
13300 async fn build_inner(
13301 conf: gaxi::options::ClientConfig,
13302 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionInstantSnapshots>>
13303 {
13304 if gaxi::options::tracing_enabled(&conf) {
13305 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13306 }
13307 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13308 }
13309
13310 async fn build_transport(
13311 conf: gaxi::options::ClientConfig,
13312 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshots> {
13313 super::transport::RegionInstantSnapshots::new(conf).await
13314 }
13315
13316 async fn build_with_tracing(
13317 conf: gaxi::options::ClientConfig,
13318 ) -> crate::ClientBuilderResult<impl super::stub::RegionInstantSnapshots> {
13319 Self::build_transport(conf)
13320 .await
13321 .map(super::tracing::RegionInstantSnapshots::new)
13322 }
13323
13324 /// Deletes the specified InstantSnapshot resource. Keep in mind that deleting
13325 /// a single instantSnapshot might not necessarily delete all the data on that
13326 /// instantSnapshot. If any data on the instantSnapshot that is marked for
13327 /// deletion is needed for subsequent instantSnapshots, the data will be moved
13328 /// to the next corresponding instantSnapshot.
13329 ///
13330 /// For more information, seeDeleting
13331 /// instantSnapshots.
13332 pub fn delete(&self) -> super::builder::region_instant_snapshots::Delete {
13333 super::builder::region_instant_snapshots::Delete::new(self.inner.clone())
13334 }
13335
13336 /// Returns the specified InstantSnapshot resource in the specified region.
13337 pub fn get(&self) -> super::builder::region_instant_snapshots::Get {
13338 super::builder::region_instant_snapshots::Get::new(self.inner.clone())
13339 }
13340
13341 /// Gets the access control policy for a resource. May be empty if no such
13342 /// policy or resource exists.
13343 pub fn get_iam_policy(&self) -> super::builder::region_instant_snapshots::GetIamPolicy {
13344 super::builder::region_instant_snapshots::GetIamPolicy::new(self.inner.clone())
13345 }
13346
13347 /// Creates an instant snapshot in the specified region.
13348 pub fn insert(&self) -> super::builder::region_instant_snapshots::Insert {
13349 super::builder::region_instant_snapshots::Insert::new(self.inner.clone())
13350 }
13351
13352 /// Retrieves the list of InstantSnapshot resources contained within
13353 /// the specified region.
13354 pub fn list(&self) -> super::builder::region_instant_snapshots::List {
13355 super::builder::region_instant_snapshots::List::new(self.inner.clone())
13356 }
13357
13358 /// Sets the access control policy on the specified resource.
13359 /// Replaces any existing policy.
13360 pub fn set_iam_policy(&self) -> super::builder::region_instant_snapshots::SetIamPolicy {
13361 super::builder::region_instant_snapshots::SetIamPolicy::new(self.inner.clone())
13362 }
13363
13364 /// Sets the labels on a instantSnapshot in the given region. To learn more
13365 /// about labels, read the Labeling
13366 /// Resources documentation.
13367 pub fn set_labels(&self) -> super::builder::region_instant_snapshots::SetLabels {
13368 super::builder::region_instant_snapshots::SetLabels::new(self.inner.clone())
13369 }
13370
13371 /// Returns permissions that a caller has on the specified resource.
13372 pub fn test_iam_permissions(
13373 &self,
13374 ) -> super::builder::region_instant_snapshots::TestIamPermissions {
13375 super::builder::region_instant_snapshots::TestIamPermissions::new(self.inner.clone())
13376 }
13377
13378 /// Retrieves the specified region-specific Operations resource.
13379 pub fn get_operation(&self) -> super::builder::region_instant_snapshots::GetOperation {
13380 super::builder::region_instant_snapshots::GetOperation::new(self.inner.clone())
13381 }
13382}
13383
13384/// Implements a client for the Google Compute Engine API.
13385///
13386/// # Example
13387/// ```
13388/// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
13389/// async fn sample(
13390/// ) -> anyhow::Result<()> {
13391/// let client = RegionNetworkEndpointGroups::builder().build().await?;
13392/// // use `client` to make requests to the Google Compute Engine API.
13393/// Ok(())
13394/// }
13395/// ```
13396///
13397/// # Service Description
13398///
13399/// Service for the `regionNetworkEndpointGroups` resource.
13400///
13401/// # Configuration
13402///
13403/// To configure `RegionNetworkEndpointGroups` use the `with_*` methods in the type returned
13404/// by [builder()][RegionNetworkEndpointGroups::builder]. The default configuration should
13405/// work for most applications. Common configuration changes include
13406///
13407/// * [with_endpoint()]: by default this client uses the global default endpoint
13408/// (`https://compute.googleapis.com`). Applications using regional
13409/// endpoints or running in restricted networks (e.g. a network configured
13410/// with [Private Google Access with VPC Service Controls]) may want to
13411/// override this default.
13412/// * [with_credentials()]: by default this client uses
13413/// [Application Default Credentials]. Applications using custom
13414/// authentication may need to override this default.
13415///
13416/// [with_endpoint()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_endpoint
13417/// [with_credentials()]: super::builder::region_network_endpoint_groups::ClientBuilder::with_credentials
13418/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13419/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13420///
13421/// # Pooling and Cloning
13422///
13423/// `RegionNetworkEndpointGroups` holds a connection pool internally, it is advised to
13424/// create one and reuse it. You do not need to wrap `RegionNetworkEndpointGroups` in
13425/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13426/// already uses an `Arc` internally.
13427#[cfg(feature = "region-network-endpoint-groups")]
13428#[cfg_attr(docsrs, doc(cfg(feature = "region-network-endpoint-groups")))]
13429#[derive(Clone, Debug)]
13430pub struct RegionNetworkEndpointGroups {
13431 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
13432}
13433
13434#[cfg(feature = "region-network-endpoint-groups")]
13435impl RegionNetworkEndpointGroups {
13436 /// Returns a builder for [RegionNetworkEndpointGroups].
13437 ///
13438 /// ```
13439 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13440 /// # use google_cloud_compute_v1::client::RegionNetworkEndpointGroups;
13441 /// let client = RegionNetworkEndpointGroups::builder().build().await?;
13442 /// # Ok(()) }
13443 /// ```
13444 pub fn builder() -> super::builder::region_network_endpoint_groups::ClientBuilder {
13445 crate::new_client_builder(super::builder::region_network_endpoint_groups::client::Factory)
13446 }
13447
13448 /// Creates a new client from the provided stub.
13449 ///
13450 /// The most common case for calling this function is in tests mocking the
13451 /// client's behavior.
13452 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13453 where
13454 T: super::stub::RegionNetworkEndpointGroups + 'static,
13455 {
13456 Self { inner: stub.into() }
13457 }
13458
13459 pub(crate) async fn new(
13460 config: gaxi::options::ClientConfig,
13461 ) -> crate::ClientBuilderResult<Self> {
13462 let inner = Self::build_inner(config).await?;
13463 Ok(Self { inner })
13464 }
13465
13466 async fn build_inner(
13467 conf: gaxi::options::ClientConfig,
13468 ) -> crate::ClientBuilderResult<
13469 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkEndpointGroups>,
13470 > {
13471 if gaxi::options::tracing_enabled(&conf) {
13472 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13473 }
13474 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13475 }
13476
13477 async fn build_transport(
13478 conf: gaxi::options::ClientConfig,
13479 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkEndpointGroups> {
13480 super::transport::RegionNetworkEndpointGroups::new(conf).await
13481 }
13482
13483 async fn build_with_tracing(
13484 conf: gaxi::options::ClientConfig,
13485 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkEndpointGroups> {
13486 Self::build_transport(conf)
13487 .await
13488 .map(super::tracing::RegionNetworkEndpointGroups::new)
13489 }
13490
13491 /// Attach a list of network endpoints to the specified network endpoint group.
13492 pub fn attach_network_endpoints(
13493 &self,
13494 ) -> super::builder::region_network_endpoint_groups::AttachNetworkEndpoints {
13495 super::builder::region_network_endpoint_groups::AttachNetworkEndpoints::new(
13496 self.inner.clone(),
13497 )
13498 }
13499
13500 /// Deletes the specified network endpoint group. Note that the NEG cannot be
13501 /// deleted if it is configured as a backend of a backend service.
13502 pub fn delete(&self) -> super::builder::region_network_endpoint_groups::Delete {
13503 super::builder::region_network_endpoint_groups::Delete::new(self.inner.clone())
13504 }
13505
13506 /// Detach the network endpoint from the specified network endpoint group.
13507 pub fn detach_network_endpoints(
13508 &self,
13509 ) -> super::builder::region_network_endpoint_groups::DetachNetworkEndpoints {
13510 super::builder::region_network_endpoint_groups::DetachNetworkEndpoints::new(
13511 self.inner.clone(),
13512 )
13513 }
13514
13515 /// Returns the specified network endpoint group.
13516 pub fn get(&self) -> super::builder::region_network_endpoint_groups::Get {
13517 super::builder::region_network_endpoint_groups::Get::new(self.inner.clone())
13518 }
13519
13520 /// Creates a network endpoint group in the specified project using the
13521 /// parameters that are included in the request.
13522 ///
13523 /// Note: Use the following APIs to manage network endpoint groups:
13524 ///
13525 /// - To manage NEGs with zonal scope (such as zonal NEGs, hybrid connectivity
13526 /// NEGs): zonal
13527 /// API
13528 /// - To manage NEGs with regional scope (such as regional internet NEGs,
13529 /// serverless NEGs, Private Service Connect NEGs): regional
13530 /// API
13531 /// - To manage NEGs with global scope (such as global internet NEGs):global
13532 /// API
13533 pub fn insert(&self) -> super::builder::region_network_endpoint_groups::Insert {
13534 super::builder::region_network_endpoint_groups::Insert::new(self.inner.clone())
13535 }
13536
13537 /// Retrieves the list of regional network endpoint groups available to the
13538 /// specified project in the given region.
13539 pub fn list(&self) -> super::builder::region_network_endpoint_groups::List {
13540 super::builder::region_network_endpoint_groups::List::new(self.inner.clone())
13541 }
13542
13543 /// Lists the network endpoints in the specified network endpoint group.
13544 pub fn list_network_endpoints(
13545 &self,
13546 ) -> super::builder::region_network_endpoint_groups::ListNetworkEndpoints {
13547 super::builder::region_network_endpoint_groups::ListNetworkEndpoints::new(
13548 self.inner.clone(),
13549 )
13550 }
13551
13552 /// Retrieves the specified region-specific Operations resource.
13553 pub fn get_operation(&self) -> super::builder::region_network_endpoint_groups::GetOperation {
13554 super::builder::region_network_endpoint_groups::GetOperation::new(self.inner.clone())
13555 }
13556}
13557
13558/// Implements a client for the Google Compute Engine API.
13559///
13560/// # Example
13561/// ```
13562/// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
13563/// async fn sample(
13564/// ) -> anyhow::Result<()> {
13565/// let client = RegionNetworkFirewallPolicies::builder().build().await?;
13566/// // use `client` to make requests to the Google Compute Engine API.
13567/// Ok(())
13568/// }
13569/// ```
13570///
13571/// # Service Description
13572///
13573/// Service for the `regionNetworkFirewallPolicies` resource.
13574///
13575/// # Configuration
13576///
13577/// To configure `RegionNetworkFirewallPolicies` use the `with_*` methods in the type returned
13578/// by [builder()][RegionNetworkFirewallPolicies::builder]. The default configuration should
13579/// work for most applications. Common configuration changes include
13580///
13581/// * [with_endpoint()]: by default this client uses the global default endpoint
13582/// (`https://compute.googleapis.com`). Applications using regional
13583/// endpoints or running in restricted networks (e.g. a network configured
13584/// with [Private Google Access with VPC Service Controls]) may want to
13585/// override this default.
13586/// * [with_credentials()]: by default this client uses
13587/// [Application Default Credentials]. Applications using custom
13588/// authentication may need to override this default.
13589///
13590/// [with_endpoint()]: super::builder::region_network_firewall_policies::ClientBuilder::with_endpoint
13591/// [with_credentials()]: super::builder::region_network_firewall_policies::ClientBuilder::with_credentials
13592/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13593/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13594///
13595/// # Pooling and Cloning
13596///
13597/// `RegionNetworkFirewallPolicies` holds a connection pool internally, it is advised to
13598/// create one and reuse it. You do not need to wrap `RegionNetworkFirewallPolicies` in
13599/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13600/// already uses an `Arc` internally.
13601#[cfg(feature = "region-network-firewall-policies")]
13602#[cfg_attr(docsrs, doc(cfg(feature = "region-network-firewall-policies")))]
13603#[derive(Clone, Debug)]
13604pub struct RegionNetworkFirewallPolicies {
13605 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
13606}
13607
13608#[cfg(feature = "region-network-firewall-policies")]
13609impl RegionNetworkFirewallPolicies {
13610 /// Returns a builder for [RegionNetworkFirewallPolicies].
13611 ///
13612 /// ```
13613 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13614 /// # use google_cloud_compute_v1::client::RegionNetworkFirewallPolicies;
13615 /// let client = RegionNetworkFirewallPolicies::builder().build().await?;
13616 /// # Ok(()) }
13617 /// ```
13618 pub fn builder() -> super::builder::region_network_firewall_policies::ClientBuilder {
13619 crate::new_client_builder(super::builder::region_network_firewall_policies::client::Factory)
13620 }
13621
13622 /// Creates a new client from the provided stub.
13623 ///
13624 /// The most common case for calling this function is in tests mocking the
13625 /// client's behavior.
13626 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13627 where
13628 T: super::stub::RegionNetworkFirewallPolicies + 'static,
13629 {
13630 Self { inner: stub.into() }
13631 }
13632
13633 pub(crate) async fn new(
13634 config: gaxi::options::ClientConfig,
13635 ) -> crate::ClientBuilderResult<Self> {
13636 let inner = Self::build_inner(config).await?;
13637 Ok(Self { inner })
13638 }
13639
13640 async fn build_inner(
13641 conf: gaxi::options::ClientConfig,
13642 ) -> crate::ClientBuilderResult<
13643 std::sync::Arc<dyn super::stub::dynamic::RegionNetworkFirewallPolicies>,
13644 > {
13645 if gaxi::options::tracing_enabled(&conf) {
13646 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13647 }
13648 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13649 }
13650
13651 async fn build_transport(
13652 conf: gaxi::options::ClientConfig,
13653 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkFirewallPolicies> {
13654 super::transport::RegionNetworkFirewallPolicies::new(conf).await
13655 }
13656
13657 async fn build_with_tracing(
13658 conf: gaxi::options::ClientConfig,
13659 ) -> crate::ClientBuilderResult<impl super::stub::RegionNetworkFirewallPolicies> {
13660 Self::build_transport(conf)
13661 .await
13662 .map(super::tracing::RegionNetworkFirewallPolicies::new)
13663 }
13664
13665 /// Inserts an association for the specified network firewall policy.
13666 pub fn add_association(
13667 &self,
13668 ) -> super::builder::region_network_firewall_policies::AddAssociation {
13669 super::builder::region_network_firewall_policies::AddAssociation::new(self.inner.clone())
13670 }
13671
13672 /// Inserts a rule into a network firewall policy.
13673 pub fn add_rule(&self) -> super::builder::region_network_firewall_policies::AddRule {
13674 super::builder::region_network_firewall_policies::AddRule::new(self.inner.clone())
13675 }
13676
13677 /// Copies rules to the specified network firewall policy.
13678 pub fn clone_rules(&self) -> super::builder::region_network_firewall_policies::CloneRules {
13679 super::builder::region_network_firewall_policies::CloneRules::new(self.inner.clone())
13680 }
13681
13682 /// Deletes the specified network firewall policy.
13683 pub fn delete(&self) -> super::builder::region_network_firewall_policies::Delete {
13684 super::builder::region_network_firewall_policies::Delete::new(self.inner.clone())
13685 }
13686
13687 /// Returns the specified network firewall policy.
13688 pub fn get(&self) -> super::builder::region_network_firewall_policies::Get {
13689 super::builder::region_network_firewall_policies::Get::new(self.inner.clone())
13690 }
13691
13692 /// Gets an association with the specified name.
13693 pub fn get_association(
13694 &self,
13695 ) -> super::builder::region_network_firewall_policies::GetAssociation {
13696 super::builder::region_network_firewall_policies::GetAssociation::new(self.inner.clone())
13697 }
13698
13699 /// Returns the effective firewalls on a given network.
13700 pub fn get_effective_firewalls(
13701 &self,
13702 ) -> super::builder::region_network_firewall_policies::GetEffectiveFirewalls {
13703 super::builder::region_network_firewall_policies::GetEffectiveFirewalls::new(
13704 self.inner.clone(),
13705 )
13706 }
13707
13708 /// Gets the access control policy for a resource. May be empty if no such
13709 /// policy or resource exists.
13710 pub fn get_iam_policy(&self) -> super::builder::region_network_firewall_policies::GetIamPolicy {
13711 super::builder::region_network_firewall_policies::GetIamPolicy::new(self.inner.clone())
13712 }
13713
13714 /// Gets a rule of the specified priority.
13715 pub fn get_rule(&self) -> super::builder::region_network_firewall_policies::GetRule {
13716 super::builder::region_network_firewall_policies::GetRule::new(self.inner.clone())
13717 }
13718
13719 /// Creates a new network firewall policy in the specified project and region.
13720 pub fn insert(&self) -> super::builder::region_network_firewall_policies::Insert {
13721 super::builder::region_network_firewall_policies::Insert::new(self.inner.clone())
13722 }
13723
13724 /// Lists all the network firewall policies that have been configured
13725 /// for the specified project in the given region.
13726 pub fn list(&self) -> super::builder::region_network_firewall_policies::List {
13727 super::builder::region_network_firewall_policies::List::new(self.inner.clone())
13728 }
13729
13730 /// Patches the specified network firewall policy.
13731 pub fn patch(&self) -> super::builder::region_network_firewall_policies::Patch {
13732 super::builder::region_network_firewall_policies::Patch::new(self.inner.clone())
13733 }
13734
13735 /// Patches a rule of the specified priority.
13736 pub fn patch_rule(&self) -> super::builder::region_network_firewall_policies::PatchRule {
13737 super::builder::region_network_firewall_policies::PatchRule::new(self.inner.clone())
13738 }
13739
13740 /// Removes an association for the specified network firewall policy.
13741 pub fn remove_association(
13742 &self,
13743 ) -> super::builder::region_network_firewall_policies::RemoveAssociation {
13744 super::builder::region_network_firewall_policies::RemoveAssociation::new(self.inner.clone())
13745 }
13746
13747 /// Deletes a rule of the specified priority.
13748 pub fn remove_rule(&self) -> super::builder::region_network_firewall_policies::RemoveRule {
13749 super::builder::region_network_firewall_policies::RemoveRule::new(self.inner.clone())
13750 }
13751
13752 /// Sets the access control policy on the specified resource.
13753 /// Replaces any existing policy.
13754 pub fn set_iam_policy(&self) -> super::builder::region_network_firewall_policies::SetIamPolicy {
13755 super::builder::region_network_firewall_policies::SetIamPolicy::new(self.inner.clone())
13756 }
13757
13758 /// Returns permissions that a caller has on the specified resource.
13759 pub fn test_iam_permissions(
13760 &self,
13761 ) -> super::builder::region_network_firewall_policies::TestIamPermissions {
13762 super::builder::region_network_firewall_policies::TestIamPermissions::new(
13763 self.inner.clone(),
13764 )
13765 }
13766
13767 /// Retrieves the specified region-specific Operations resource.
13768 pub fn get_operation(&self) -> super::builder::region_network_firewall_policies::GetOperation {
13769 super::builder::region_network_firewall_policies::GetOperation::new(self.inner.clone())
13770 }
13771}
13772
13773/// Implements a client for the Google Compute Engine API.
13774///
13775/// # Example
13776/// ```
13777/// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
13778/// async fn sample(
13779/// ) -> anyhow::Result<()> {
13780/// let client = RegionNotificationEndpoints::builder().build().await?;
13781/// // use `client` to make requests to the Google Compute Engine API.
13782/// Ok(())
13783/// }
13784/// ```
13785///
13786/// # Service Description
13787///
13788/// Service for the `regionNotificationEndpoints` resource.
13789///
13790/// # Configuration
13791///
13792/// To configure `RegionNotificationEndpoints` use the `with_*` methods in the type returned
13793/// by [builder()][RegionNotificationEndpoints::builder]. The default configuration should
13794/// work for most applications. Common configuration changes include
13795///
13796/// * [with_endpoint()]: by default this client uses the global default endpoint
13797/// (`https://compute.googleapis.com`). Applications using regional
13798/// endpoints or running in restricted networks (e.g. a network configured
13799/// with [Private Google Access with VPC Service Controls]) may want to
13800/// override this default.
13801/// * [with_credentials()]: by default this client uses
13802/// [Application Default Credentials]. Applications using custom
13803/// authentication may need to override this default.
13804///
13805/// [with_endpoint()]: super::builder::region_notification_endpoints::ClientBuilder::with_endpoint
13806/// [with_credentials()]: super::builder::region_notification_endpoints::ClientBuilder::with_credentials
13807/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13808/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13809///
13810/// # Pooling and Cloning
13811///
13812/// `RegionNotificationEndpoints` holds a connection pool internally, it is advised to
13813/// create one and reuse it. You do not need to wrap `RegionNotificationEndpoints` in
13814/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13815/// already uses an `Arc` internally.
13816#[cfg(feature = "region-notification-endpoints")]
13817#[cfg_attr(docsrs, doc(cfg(feature = "region-notification-endpoints")))]
13818#[derive(Clone, Debug)]
13819pub struct RegionNotificationEndpoints {
13820 inner: std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
13821}
13822
13823#[cfg(feature = "region-notification-endpoints")]
13824impl RegionNotificationEndpoints {
13825 /// Returns a builder for [RegionNotificationEndpoints].
13826 ///
13827 /// ```
13828 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13829 /// # use google_cloud_compute_v1::client::RegionNotificationEndpoints;
13830 /// let client = RegionNotificationEndpoints::builder().build().await?;
13831 /// # Ok(()) }
13832 /// ```
13833 pub fn builder() -> super::builder::region_notification_endpoints::ClientBuilder {
13834 crate::new_client_builder(super::builder::region_notification_endpoints::client::Factory)
13835 }
13836
13837 /// Creates a new client from the provided stub.
13838 ///
13839 /// The most common case for calling this function is in tests mocking the
13840 /// client's behavior.
13841 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13842 where
13843 T: super::stub::RegionNotificationEndpoints + 'static,
13844 {
13845 Self { inner: stub.into() }
13846 }
13847
13848 pub(crate) async fn new(
13849 config: gaxi::options::ClientConfig,
13850 ) -> crate::ClientBuilderResult<Self> {
13851 let inner = Self::build_inner(config).await?;
13852 Ok(Self { inner })
13853 }
13854
13855 async fn build_inner(
13856 conf: gaxi::options::ClientConfig,
13857 ) -> crate::ClientBuilderResult<
13858 std::sync::Arc<dyn super::stub::dynamic::RegionNotificationEndpoints>,
13859 > {
13860 if gaxi::options::tracing_enabled(&conf) {
13861 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
13862 }
13863 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
13864 }
13865
13866 async fn build_transport(
13867 conf: gaxi::options::ClientConfig,
13868 ) -> crate::ClientBuilderResult<impl super::stub::RegionNotificationEndpoints> {
13869 super::transport::RegionNotificationEndpoints::new(conf).await
13870 }
13871
13872 async fn build_with_tracing(
13873 conf: gaxi::options::ClientConfig,
13874 ) -> crate::ClientBuilderResult<impl super::stub::RegionNotificationEndpoints> {
13875 Self::build_transport(conf)
13876 .await
13877 .map(super::tracing::RegionNotificationEndpoints::new)
13878 }
13879
13880 /// Retrieves the list of all NotificationEndpoint resources,
13881 /// regional and global, available to the specified project.
13882 pub fn aggregated_list(&self) -> super::builder::region_notification_endpoints::AggregatedList {
13883 super::builder::region_notification_endpoints::AggregatedList::new(self.inner.clone())
13884 }
13885
13886 /// Deletes the specified NotificationEndpoint in the given region
13887 pub fn delete(&self) -> super::builder::region_notification_endpoints::Delete {
13888 super::builder::region_notification_endpoints::Delete::new(self.inner.clone())
13889 }
13890
13891 /// Returns the specified NotificationEndpoint resource in the given region.
13892 pub fn get(&self) -> super::builder::region_notification_endpoints::Get {
13893 super::builder::region_notification_endpoints::Get::new(self.inner.clone())
13894 }
13895
13896 /// Create a NotificationEndpoint in the specified project in the given region
13897 /// using the parameters that are included in the request.
13898 pub fn insert(&self) -> super::builder::region_notification_endpoints::Insert {
13899 super::builder::region_notification_endpoints::Insert::new(self.inner.clone())
13900 }
13901
13902 /// Lists the NotificationEndpoints for a project in the given region.
13903 pub fn list(&self) -> super::builder::region_notification_endpoints::List {
13904 super::builder::region_notification_endpoints::List::new(self.inner.clone())
13905 }
13906
13907 /// Returns permissions that a caller has on the specified resource.
13908 pub fn test_iam_permissions(
13909 &self,
13910 ) -> super::builder::region_notification_endpoints::TestIamPermissions {
13911 super::builder::region_notification_endpoints::TestIamPermissions::new(self.inner.clone())
13912 }
13913
13914 /// Retrieves the specified region-specific Operations resource.
13915 pub fn get_operation(&self) -> super::builder::region_notification_endpoints::GetOperation {
13916 super::builder::region_notification_endpoints::GetOperation::new(self.inner.clone())
13917 }
13918}
13919
13920/// Implements a client for the Google Compute Engine API.
13921///
13922/// # Example
13923/// ```
13924/// # use google_cloud_compute_v1::client::RegionOperations;
13925/// async fn sample(
13926/// ) -> anyhow::Result<()> {
13927/// let client = RegionOperations::builder().build().await?;
13928/// // use `client` to make requests to the Google Compute Engine API.
13929/// Ok(())
13930/// }
13931/// ```
13932///
13933/// # Service Description
13934///
13935/// Service for the `regionOperations` resource.
13936///
13937/// # Configuration
13938///
13939/// To configure `RegionOperations` use the `with_*` methods in the type returned
13940/// by [builder()][RegionOperations::builder]. The default configuration should
13941/// work for most applications. Common configuration changes include
13942///
13943/// * [with_endpoint()]: by default this client uses the global default endpoint
13944/// (`https://compute.googleapis.com`). Applications using regional
13945/// endpoints or running in restricted networks (e.g. a network configured
13946/// with [Private Google Access with VPC Service Controls]) may want to
13947/// override this default.
13948/// * [with_credentials()]: by default this client uses
13949/// [Application Default Credentials]. Applications using custom
13950/// authentication may need to override this default.
13951///
13952/// [with_endpoint()]: super::builder::region_operations::ClientBuilder::with_endpoint
13953/// [with_credentials()]: super::builder::region_operations::ClientBuilder::with_credentials
13954/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
13955/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
13956///
13957/// # Pooling and Cloning
13958///
13959/// `RegionOperations` holds a connection pool internally, it is advised to
13960/// create one and reuse it. You do not need to wrap `RegionOperations` in
13961/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
13962/// already uses an `Arc` internally.
13963#[cfg(feature = "region-operations")]
13964#[cfg_attr(docsrs, doc(cfg(feature = "region-operations")))]
13965#[derive(Clone, Debug)]
13966pub struct RegionOperations {
13967 inner: std::sync::Arc<dyn super::stub::dynamic::RegionOperations>,
13968}
13969
13970#[cfg(feature = "region-operations")]
13971impl RegionOperations {
13972 /// Returns a builder for [RegionOperations].
13973 ///
13974 /// ```
13975 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13976 /// # use google_cloud_compute_v1::client::RegionOperations;
13977 /// let client = RegionOperations::builder().build().await?;
13978 /// # Ok(()) }
13979 /// ```
13980 pub fn builder() -> super::builder::region_operations::ClientBuilder {
13981 crate::new_client_builder(super::builder::region_operations::client::Factory)
13982 }
13983
13984 /// Creates a new client from the provided stub.
13985 ///
13986 /// The most common case for calling this function is in tests mocking the
13987 /// client's behavior.
13988 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
13989 where
13990 T: super::stub::RegionOperations + 'static,
13991 {
13992 Self { inner: stub.into() }
13993 }
13994
13995 pub(crate) async fn new(
13996 config: gaxi::options::ClientConfig,
13997 ) -> crate::ClientBuilderResult<Self> {
13998 let inner = Self::build_inner(config).await?;
13999 Ok(Self { inner })
14000 }
14001
14002 async fn build_inner(
14003 conf: gaxi::options::ClientConfig,
14004 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionOperations>>
14005 {
14006 if gaxi::options::tracing_enabled(&conf) {
14007 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14008 }
14009 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14010 }
14011
14012 async fn build_transport(
14013 conf: gaxi::options::ClientConfig,
14014 ) -> crate::ClientBuilderResult<impl super::stub::RegionOperations> {
14015 super::transport::RegionOperations::new(conf).await
14016 }
14017
14018 async fn build_with_tracing(
14019 conf: gaxi::options::ClientConfig,
14020 ) -> crate::ClientBuilderResult<impl super::stub::RegionOperations> {
14021 Self::build_transport(conf)
14022 .await
14023 .map(super::tracing::RegionOperations::new)
14024 }
14025
14026 /// Deletes the specified region-specific Operations resource.
14027 pub fn delete(&self) -> super::builder::region_operations::Delete {
14028 super::builder::region_operations::Delete::new(self.inner.clone())
14029 }
14030
14031 /// Retrieves the specified region-specific Operations resource.
14032 pub fn get(&self) -> super::builder::region_operations::Get {
14033 super::builder::region_operations::Get::new(self.inner.clone())
14034 }
14035
14036 /// Retrieves a list of Operation resources contained within
14037 /// the specified region.
14038 pub fn list(&self) -> super::builder::region_operations::List {
14039 super::builder::region_operations::List::new(self.inner.clone())
14040 }
14041
14042 /// Waits for the specified Operation resource to return as `DONE`
14043 /// or for the request to approach the 2 minute deadline, and retrieves the
14044 /// specified Operation resource. This method differs from the
14045 /// `GET` method in that it waits for no more than the default
14046 /// deadline (2 minutes) and then returns the current state of the operation,
14047 /// which might be `DONE` or still in progress.
14048 ///
14049 /// This method is called on a best-effort basis. Specifically:
14050 ///
14051 /// ```norust
14052 /// - In uncommon cases, when the server is overloaded, the request might
14053 /// return before the default deadline is reached, or might return after zero
14054 /// seconds.
14055 /// ```
14056 ///
14057 /// - If the default deadline is reached, there is no guarantee that the
14058 /// operation is actually done when the method returns. Be prepared to retry
14059 /// if the operation is not `DONE`.
14060 pub fn wait(&self) -> super::builder::region_operations::Wait {
14061 super::builder::region_operations::Wait::new(self.inner.clone())
14062 }
14063}
14064
14065/// Implements a client for the Google Compute Engine API.
14066///
14067/// # Example
14068/// ```
14069/// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
14070/// async fn sample(
14071/// ) -> anyhow::Result<()> {
14072/// let client = RegionSecurityPolicies::builder().build().await?;
14073/// // use `client` to make requests to the Google Compute Engine API.
14074/// Ok(())
14075/// }
14076/// ```
14077///
14078/// # Service Description
14079///
14080/// Service for the `regionSecurityPolicies` resource.
14081///
14082/// # Configuration
14083///
14084/// To configure `RegionSecurityPolicies` use the `with_*` methods in the type returned
14085/// by [builder()][RegionSecurityPolicies::builder]. The default configuration should
14086/// work for most applications. Common configuration changes include
14087///
14088/// * [with_endpoint()]: by default this client uses the global default endpoint
14089/// (`https://compute.googleapis.com`). Applications using regional
14090/// endpoints or running in restricted networks (e.g. a network configured
14091/// with [Private Google Access with VPC Service Controls]) may want to
14092/// override this default.
14093/// * [with_credentials()]: by default this client uses
14094/// [Application Default Credentials]. Applications using custom
14095/// authentication may need to override this default.
14096///
14097/// [with_endpoint()]: super::builder::region_security_policies::ClientBuilder::with_endpoint
14098/// [with_credentials()]: super::builder::region_security_policies::ClientBuilder::with_credentials
14099/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14100/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14101///
14102/// # Pooling and Cloning
14103///
14104/// `RegionSecurityPolicies` holds a connection pool internally, it is advised to
14105/// create one and reuse it. You do not need to wrap `RegionSecurityPolicies` in
14106/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14107/// already uses an `Arc` internally.
14108#[cfg(feature = "region-security-policies")]
14109#[cfg_attr(docsrs, doc(cfg(feature = "region-security-policies")))]
14110#[derive(Clone, Debug)]
14111pub struct RegionSecurityPolicies {
14112 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>,
14113}
14114
14115#[cfg(feature = "region-security-policies")]
14116impl RegionSecurityPolicies {
14117 /// Returns a builder for [RegionSecurityPolicies].
14118 ///
14119 /// ```
14120 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14121 /// # use google_cloud_compute_v1::client::RegionSecurityPolicies;
14122 /// let client = RegionSecurityPolicies::builder().build().await?;
14123 /// # Ok(()) }
14124 /// ```
14125 pub fn builder() -> super::builder::region_security_policies::ClientBuilder {
14126 crate::new_client_builder(super::builder::region_security_policies::client::Factory)
14127 }
14128
14129 /// Creates a new client from the provided stub.
14130 ///
14131 /// The most common case for calling this function is in tests mocking the
14132 /// client's behavior.
14133 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14134 where
14135 T: super::stub::RegionSecurityPolicies + 'static,
14136 {
14137 Self { inner: stub.into() }
14138 }
14139
14140 pub(crate) async fn new(
14141 config: gaxi::options::ClientConfig,
14142 ) -> crate::ClientBuilderResult<Self> {
14143 let inner = Self::build_inner(config).await?;
14144 Ok(Self { inner })
14145 }
14146
14147 async fn build_inner(
14148 conf: gaxi::options::ClientConfig,
14149 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSecurityPolicies>>
14150 {
14151 if gaxi::options::tracing_enabled(&conf) {
14152 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14153 }
14154 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14155 }
14156
14157 async fn build_transport(
14158 conf: gaxi::options::ClientConfig,
14159 ) -> crate::ClientBuilderResult<impl super::stub::RegionSecurityPolicies> {
14160 super::transport::RegionSecurityPolicies::new(conf).await
14161 }
14162
14163 async fn build_with_tracing(
14164 conf: gaxi::options::ClientConfig,
14165 ) -> crate::ClientBuilderResult<impl super::stub::RegionSecurityPolicies> {
14166 Self::build_transport(conf)
14167 .await
14168 .map(super::tracing::RegionSecurityPolicies::new)
14169 }
14170
14171 /// Inserts a rule into a security policy.
14172 pub fn add_rule(&self) -> super::builder::region_security_policies::AddRule {
14173 super::builder::region_security_policies::AddRule::new(self.inner.clone())
14174 }
14175
14176 /// Deletes the specified policy.
14177 pub fn delete(&self) -> super::builder::region_security_policies::Delete {
14178 super::builder::region_security_policies::Delete::new(self.inner.clone())
14179 }
14180
14181 /// List all of the ordered rules present in a single specified policy.
14182 pub fn get(&self) -> super::builder::region_security_policies::Get {
14183 super::builder::region_security_policies::Get::new(self.inner.clone())
14184 }
14185
14186 /// Gets a rule at the specified priority.
14187 pub fn get_rule(&self) -> super::builder::region_security_policies::GetRule {
14188 super::builder::region_security_policies::GetRule::new(self.inner.clone())
14189 }
14190
14191 /// Creates a new policy in the specified project using the data included in
14192 /// the request.
14193 pub fn insert(&self) -> super::builder::region_security_policies::Insert {
14194 super::builder::region_security_policies::Insert::new(self.inner.clone())
14195 }
14196
14197 /// List all the policies that have been configured for the specified project
14198 /// and region.
14199 pub fn list(&self) -> super::builder::region_security_policies::List {
14200 super::builder::region_security_policies::List::new(self.inner.clone())
14201 }
14202
14203 /// Patches the specified policy with the data included in the request. To
14204 /// clear fields in the policy, leave the fields empty and specify them in the
14205 /// updateMask. This cannot be used to be update the rules in the policy.
14206 /// Please use the per rule methods like addRule, patchRule, and removeRule
14207 /// instead.
14208 pub fn patch(&self) -> super::builder::region_security_policies::Patch {
14209 super::builder::region_security_policies::Patch::new(self.inner.clone())
14210 }
14211
14212 /// Patches a rule at the specified priority. To clear fields in the rule,
14213 /// leave the fields empty and specify them in the updateMask.
14214 pub fn patch_rule(&self) -> super::builder::region_security_policies::PatchRule {
14215 super::builder::region_security_policies::PatchRule::new(self.inner.clone())
14216 }
14217
14218 /// Deletes a rule at the specified priority.
14219 pub fn remove_rule(&self) -> super::builder::region_security_policies::RemoveRule {
14220 super::builder::region_security_policies::RemoveRule::new(self.inner.clone())
14221 }
14222
14223 /// Sets the labels on a security policy. To learn more about labels,
14224 /// read the Labeling Resources
14225 /// documentation.
14226 pub fn set_labels(&self) -> super::builder::region_security_policies::SetLabels {
14227 super::builder::region_security_policies::SetLabels::new(self.inner.clone())
14228 }
14229
14230 /// Retrieves the specified region-specific Operations resource.
14231 pub fn get_operation(&self) -> super::builder::region_security_policies::GetOperation {
14232 super::builder::region_security_policies::GetOperation::new(self.inner.clone())
14233 }
14234}
14235
14236/// Implements a client for the Google Compute Engine API.
14237///
14238/// # Example
14239/// ```
14240/// # use google_cloud_compute_v1::client::RegionSnapshotSettings;
14241/// async fn sample(
14242/// ) -> anyhow::Result<()> {
14243/// let client = RegionSnapshotSettings::builder().build().await?;
14244/// // use `client` to make requests to the Google Compute Engine API.
14245/// Ok(())
14246/// }
14247/// ```
14248///
14249/// # Service Description
14250///
14251/// Service for the `regionSnapshotSettings` resource.
14252///
14253/// # Configuration
14254///
14255/// To configure `RegionSnapshotSettings` use the `with_*` methods in the type returned
14256/// by [builder()][RegionSnapshotSettings::builder]. The default configuration should
14257/// work for most applications. Common configuration changes include
14258///
14259/// * [with_endpoint()]: by default this client uses the global default endpoint
14260/// (`https://compute.googleapis.com`). Applications using regional
14261/// endpoints or running in restricted networks (e.g. a network configured
14262/// with [Private Google Access with VPC Service Controls]) may want to
14263/// override this default.
14264/// * [with_credentials()]: by default this client uses
14265/// [Application Default Credentials]. Applications using custom
14266/// authentication may need to override this default.
14267///
14268/// [with_endpoint()]: super::builder::region_snapshot_settings::ClientBuilder::with_endpoint
14269/// [with_credentials()]: super::builder::region_snapshot_settings::ClientBuilder::with_credentials
14270/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14271/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14272///
14273/// # Pooling and Cloning
14274///
14275/// `RegionSnapshotSettings` holds a connection pool internally, it is advised to
14276/// create one and reuse it. You do not need to wrap `RegionSnapshotSettings` in
14277/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14278/// already uses an `Arc` internally.
14279#[cfg(feature = "region-snapshot-settings")]
14280#[cfg_attr(docsrs, doc(cfg(feature = "region-snapshot-settings")))]
14281#[derive(Clone, Debug)]
14282pub struct RegionSnapshotSettings {
14283 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSnapshotSettings>,
14284}
14285
14286#[cfg(feature = "region-snapshot-settings")]
14287impl RegionSnapshotSettings {
14288 /// Returns a builder for [RegionSnapshotSettings].
14289 ///
14290 /// ```
14291 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14292 /// # use google_cloud_compute_v1::client::RegionSnapshotSettings;
14293 /// let client = RegionSnapshotSettings::builder().build().await?;
14294 /// # Ok(()) }
14295 /// ```
14296 pub fn builder() -> super::builder::region_snapshot_settings::ClientBuilder {
14297 crate::new_client_builder(super::builder::region_snapshot_settings::client::Factory)
14298 }
14299
14300 /// Creates a new client from the provided stub.
14301 ///
14302 /// The most common case for calling this function is in tests mocking the
14303 /// client's behavior.
14304 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14305 where
14306 T: super::stub::RegionSnapshotSettings + 'static,
14307 {
14308 Self { inner: stub.into() }
14309 }
14310
14311 pub(crate) async fn new(
14312 config: gaxi::options::ClientConfig,
14313 ) -> crate::ClientBuilderResult<Self> {
14314 let inner = Self::build_inner(config).await?;
14315 Ok(Self { inner })
14316 }
14317
14318 async fn build_inner(
14319 conf: gaxi::options::ClientConfig,
14320 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSnapshotSettings>>
14321 {
14322 if gaxi::options::tracing_enabled(&conf) {
14323 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14324 }
14325 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14326 }
14327
14328 async fn build_transport(
14329 conf: gaxi::options::ClientConfig,
14330 ) -> crate::ClientBuilderResult<impl super::stub::RegionSnapshotSettings> {
14331 super::transport::RegionSnapshotSettings::new(conf).await
14332 }
14333
14334 async fn build_with_tracing(
14335 conf: gaxi::options::ClientConfig,
14336 ) -> crate::ClientBuilderResult<impl super::stub::RegionSnapshotSettings> {
14337 Self::build_transport(conf)
14338 .await
14339 .map(super::tracing::RegionSnapshotSettings::new)
14340 }
14341
14342 /// Get region snapshot settings.
14343 pub fn get(&self) -> super::builder::region_snapshot_settings::Get {
14344 super::builder::region_snapshot_settings::Get::new(self.inner.clone())
14345 }
14346
14347 /// Patch region snapshot settings.
14348 pub fn patch(&self) -> super::builder::region_snapshot_settings::Patch {
14349 super::builder::region_snapshot_settings::Patch::new(self.inner.clone())
14350 }
14351
14352 /// Retrieves the specified region-specific Operations resource.
14353 pub fn get_operation(&self) -> super::builder::region_snapshot_settings::GetOperation {
14354 super::builder::region_snapshot_settings::GetOperation::new(self.inner.clone())
14355 }
14356}
14357
14358/// Implements a client for the Google Compute Engine API.
14359///
14360/// # Example
14361/// ```
14362/// # use google_cloud_compute_v1::client::RegionSnapshots;
14363/// async fn sample(
14364/// ) -> anyhow::Result<()> {
14365/// let client = RegionSnapshots::builder().build().await?;
14366/// // use `client` to make requests to the Google Compute Engine API.
14367/// Ok(())
14368/// }
14369/// ```
14370///
14371/// # Service Description
14372///
14373/// Service for the `regionSnapshots` resource.
14374///
14375/// # Configuration
14376///
14377/// To configure `RegionSnapshots` use the `with_*` methods in the type returned
14378/// by [builder()][RegionSnapshots::builder]. The default configuration should
14379/// work for most applications. Common configuration changes include
14380///
14381/// * [with_endpoint()]: by default this client uses the global default endpoint
14382/// (`https://compute.googleapis.com`). Applications using regional
14383/// endpoints or running in restricted networks (e.g. a network configured
14384/// with [Private Google Access with VPC Service Controls]) may want to
14385/// override this default.
14386/// * [with_credentials()]: by default this client uses
14387/// [Application Default Credentials]. Applications using custom
14388/// authentication may need to override this default.
14389///
14390/// [with_endpoint()]: super::builder::region_snapshots::ClientBuilder::with_endpoint
14391/// [with_credentials()]: super::builder::region_snapshots::ClientBuilder::with_credentials
14392/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14393/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14394///
14395/// # Pooling and Cloning
14396///
14397/// `RegionSnapshots` holds a connection pool internally, it is advised to
14398/// create one and reuse it. You do not need to wrap `RegionSnapshots` in
14399/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14400/// already uses an `Arc` internally.
14401#[cfg(feature = "region-snapshots")]
14402#[cfg_attr(docsrs, doc(cfg(feature = "region-snapshots")))]
14403#[derive(Clone, Debug)]
14404pub struct RegionSnapshots {
14405 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSnapshots>,
14406}
14407
14408#[cfg(feature = "region-snapshots")]
14409impl RegionSnapshots {
14410 /// Returns a builder for [RegionSnapshots].
14411 ///
14412 /// ```
14413 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14414 /// # use google_cloud_compute_v1::client::RegionSnapshots;
14415 /// let client = RegionSnapshots::builder().build().await?;
14416 /// # Ok(()) }
14417 /// ```
14418 pub fn builder() -> super::builder::region_snapshots::ClientBuilder {
14419 crate::new_client_builder(super::builder::region_snapshots::client::Factory)
14420 }
14421
14422 /// Creates a new client from the provided stub.
14423 ///
14424 /// The most common case for calling this function is in tests mocking the
14425 /// client's behavior.
14426 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14427 where
14428 T: super::stub::RegionSnapshots + 'static,
14429 {
14430 Self { inner: stub.into() }
14431 }
14432
14433 pub(crate) async fn new(
14434 config: gaxi::options::ClientConfig,
14435 ) -> crate::ClientBuilderResult<Self> {
14436 let inner = Self::build_inner(config).await?;
14437 Ok(Self { inner })
14438 }
14439
14440 async fn build_inner(
14441 conf: gaxi::options::ClientConfig,
14442 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSnapshots>> {
14443 if gaxi::options::tracing_enabled(&conf) {
14444 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14445 }
14446 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14447 }
14448
14449 async fn build_transport(
14450 conf: gaxi::options::ClientConfig,
14451 ) -> crate::ClientBuilderResult<impl super::stub::RegionSnapshots> {
14452 super::transport::RegionSnapshots::new(conf).await
14453 }
14454
14455 async fn build_with_tracing(
14456 conf: gaxi::options::ClientConfig,
14457 ) -> crate::ClientBuilderResult<impl super::stub::RegionSnapshots> {
14458 Self::build_transport(conf)
14459 .await
14460 .map(super::tracing::RegionSnapshots::new)
14461 }
14462
14463 /// Deletes the specified Snapshot resource. Keep in mind that deleting
14464 /// a single snapshot might not necessarily delete all the data on that
14465 /// snapshot. If any data on the snapshot that is marked for deletion is
14466 /// needed for subsequent snapshots, the data will be moved to the next
14467 /// corresponding snapshot.
14468 ///
14469 /// For more information, seeDeleting
14470 /// snapshots.
14471 pub fn delete(&self) -> super::builder::region_snapshots::Delete {
14472 super::builder::region_snapshots::Delete::new(self.inner.clone())
14473 }
14474
14475 /// Returns the specified Snapshot resource.
14476 pub fn get(&self) -> super::builder::region_snapshots::Get {
14477 super::builder::region_snapshots::Get::new(self.inner.clone())
14478 }
14479
14480 /// Gets the access control policy for a resource. May be empty if no such
14481 /// policy or resource exists.
14482 pub fn get_iam_policy(&self) -> super::builder::region_snapshots::GetIamPolicy {
14483 super::builder::region_snapshots::GetIamPolicy::new(self.inner.clone())
14484 }
14485
14486 /// Creates a snapshot in the specified region using the data included
14487 /// in the request.
14488 pub fn insert(&self) -> super::builder::region_snapshots::Insert {
14489 super::builder::region_snapshots::Insert::new(self.inner.clone())
14490 }
14491
14492 /// Retrieves the list of Snapshot resources contained within
14493 /// the specified region.
14494 pub fn list(&self) -> super::builder::region_snapshots::List {
14495 super::builder::region_snapshots::List::new(self.inner.clone())
14496 }
14497
14498 /// Sets the access control policy on the specified resource.
14499 /// Replaces any existing policy.
14500 pub fn set_iam_policy(&self) -> super::builder::region_snapshots::SetIamPolicy {
14501 super::builder::region_snapshots::SetIamPolicy::new(self.inner.clone())
14502 }
14503
14504 /// Sets the labels on a regional snapshot. To learn more about labels, read
14505 /// the Labeling Resources
14506 /// documentation.
14507 pub fn set_labels(&self) -> super::builder::region_snapshots::SetLabels {
14508 super::builder::region_snapshots::SetLabels::new(self.inner.clone())
14509 }
14510
14511 /// Returns permissions that a caller has on the specified resource.
14512 pub fn test_iam_permissions(&self) -> super::builder::region_snapshots::TestIamPermissions {
14513 super::builder::region_snapshots::TestIamPermissions::new(self.inner.clone())
14514 }
14515
14516 /// Rotates the customer-managed
14517 /// encryption key to the latest version for the specified snapshot.
14518 pub fn update_kms_key(&self) -> super::builder::region_snapshots::UpdateKmsKey {
14519 super::builder::region_snapshots::UpdateKmsKey::new(self.inner.clone())
14520 }
14521
14522 /// Retrieves the specified region-specific Operations resource.
14523 pub fn get_operation(&self) -> super::builder::region_snapshots::GetOperation {
14524 super::builder::region_snapshots::GetOperation::new(self.inner.clone())
14525 }
14526}
14527
14528/// Implements a client for the Google Compute Engine API.
14529///
14530/// # Example
14531/// ```
14532/// # use google_cloud_compute_v1::client::RegionSslCertificates;
14533/// async fn sample(
14534/// ) -> anyhow::Result<()> {
14535/// let client = RegionSslCertificates::builder().build().await?;
14536/// // use `client` to make requests to the Google Compute Engine API.
14537/// Ok(())
14538/// }
14539/// ```
14540///
14541/// # Service Description
14542///
14543/// Service for the `regionSslCertificates` resource.
14544///
14545/// # Configuration
14546///
14547/// To configure `RegionSslCertificates` use the `with_*` methods in the type returned
14548/// by [builder()][RegionSslCertificates::builder]. The default configuration should
14549/// work for most applications. Common configuration changes include
14550///
14551/// * [with_endpoint()]: by default this client uses the global default endpoint
14552/// (`https://compute.googleapis.com`). Applications using regional
14553/// endpoints or running in restricted networks (e.g. a network configured
14554/// with [Private Google Access with VPC Service Controls]) may want to
14555/// override this default.
14556/// * [with_credentials()]: by default this client uses
14557/// [Application Default Credentials]. Applications using custom
14558/// authentication may need to override this default.
14559///
14560/// [with_endpoint()]: super::builder::region_ssl_certificates::ClientBuilder::with_endpoint
14561/// [with_credentials()]: super::builder::region_ssl_certificates::ClientBuilder::with_credentials
14562/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14563/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14564///
14565/// # Pooling and Cloning
14566///
14567/// `RegionSslCertificates` holds a connection pool internally, it is advised to
14568/// create one and reuse it. You do not need to wrap `RegionSslCertificates` in
14569/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14570/// already uses an `Arc` internally.
14571#[cfg(feature = "region-ssl-certificates")]
14572#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-certificates")))]
14573#[derive(Clone, Debug)]
14574pub struct RegionSslCertificates {
14575 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>,
14576}
14577
14578#[cfg(feature = "region-ssl-certificates")]
14579impl RegionSslCertificates {
14580 /// Returns a builder for [RegionSslCertificates].
14581 ///
14582 /// ```
14583 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14584 /// # use google_cloud_compute_v1::client::RegionSslCertificates;
14585 /// let client = RegionSslCertificates::builder().build().await?;
14586 /// # Ok(()) }
14587 /// ```
14588 pub fn builder() -> super::builder::region_ssl_certificates::ClientBuilder {
14589 crate::new_client_builder(super::builder::region_ssl_certificates::client::Factory)
14590 }
14591
14592 /// Creates a new client from the provided stub.
14593 ///
14594 /// The most common case for calling this function is in tests mocking the
14595 /// client's behavior.
14596 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14597 where
14598 T: super::stub::RegionSslCertificates + 'static,
14599 {
14600 Self { inner: stub.into() }
14601 }
14602
14603 pub(crate) async fn new(
14604 config: gaxi::options::ClientConfig,
14605 ) -> crate::ClientBuilderResult<Self> {
14606 let inner = Self::build_inner(config).await?;
14607 Ok(Self { inner })
14608 }
14609
14610 async fn build_inner(
14611 conf: gaxi::options::ClientConfig,
14612 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSslCertificates>>
14613 {
14614 if gaxi::options::tracing_enabled(&conf) {
14615 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14616 }
14617 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14618 }
14619
14620 async fn build_transport(
14621 conf: gaxi::options::ClientConfig,
14622 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslCertificates> {
14623 super::transport::RegionSslCertificates::new(conf).await
14624 }
14625
14626 async fn build_with_tracing(
14627 conf: gaxi::options::ClientConfig,
14628 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslCertificates> {
14629 Self::build_transport(conf)
14630 .await
14631 .map(super::tracing::RegionSslCertificates::new)
14632 }
14633
14634 /// Deletes the specified SslCertificate resource in the region.
14635 pub fn delete(&self) -> super::builder::region_ssl_certificates::Delete {
14636 super::builder::region_ssl_certificates::Delete::new(self.inner.clone())
14637 }
14638
14639 /// Returns the specified SslCertificate resource in the specified region. Get
14640 /// a list of available SSL certificates by making a list()
14641 /// request.
14642 pub fn get(&self) -> super::builder::region_ssl_certificates::Get {
14643 super::builder::region_ssl_certificates::Get::new(self.inner.clone())
14644 }
14645
14646 /// Creates a SslCertificate resource in the specified project and region using
14647 /// the data included in the request
14648 pub fn insert(&self) -> super::builder::region_ssl_certificates::Insert {
14649 super::builder::region_ssl_certificates::Insert::new(self.inner.clone())
14650 }
14651
14652 /// Retrieves the list of SslCertificate resources available to the specified
14653 /// project in the specified region.
14654 pub fn list(&self) -> super::builder::region_ssl_certificates::List {
14655 super::builder::region_ssl_certificates::List::new(self.inner.clone())
14656 }
14657
14658 /// Retrieves the specified region-specific Operations resource.
14659 pub fn get_operation(&self) -> super::builder::region_ssl_certificates::GetOperation {
14660 super::builder::region_ssl_certificates::GetOperation::new(self.inner.clone())
14661 }
14662}
14663
14664/// Implements a client for the Google Compute Engine API.
14665///
14666/// # Example
14667/// ```
14668/// # use google_cloud_compute_v1::client::RegionSslPolicies;
14669/// async fn sample(
14670/// ) -> anyhow::Result<()> {
14671/// let client = RegionSslPolicies::builder().build().await?;
14672/// // use `client` to make requests to the Google Compute Engine API.
14673/// Ok(())
14674/// }
14675/// ```
14676///
14677/// # Service Description
14678///
14679/// Service for the `regionSslPolicies` resource.
14680///
14681/// # Configuration
14682///
14683/// To configure `RegionSslPolicies` use the `with_*` methods in the type returned
14684/// by [builder()][RegionSslPolicies::builder]. The default configuration should
14685/// work for most applications. Common configuration changes include
14686///
14687/// * [with_endpoint()]: by default this client uses the global default endpoint
14688/// (`https://compute.googleapis.com`). Applications using regional
14689/// endpoints or running in restricted networks (e.g. a network configured
14690/// with [Private Google Access with VPC Service Controls]) may want to
14691/// override this default.
14692/// * [with_credentials()]: by default this client uses
14693/// [Application Default Credentials]. Applications using custom
14694/// authentication may need to override this default.
14695///
14696/// [with_endpoint()]: super::builder::region_ssl_policies::ClientBuilder::with_endpoint
14697/// [with_credentials()]: super::builder::region_ssl_policies::ClientBuilder::with_credentials
14698/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14699/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14700///
14701/// # Pooling and Cloning
14702///
14703/// `RegionSslPolicies` holds a connection pool internally, it is advised to
14704/// create one and reuse it. You do not need to wrap `RegionSslPolicies` in
14705/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14706/// already uses an `Arc` internally.
14707#[cfg(feature = "region-ssl-policies")]
14708#[cfg_attr(docsrs, doc(cfg(feature = "region-ssl-policies")))]
14709#[derive(Clone, Debug)]
14710pub struct RegionSslPolicies {
14711 inner: std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>,
14712}
14713
14714#[cfg(feature = "region-ssl-policies")]
14715impl RegionSslPolicies {
14716 /// Returns a builder for [RegionSslPolicies].
14717 ///
14718 /// ```
14719 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14720 /// # use google_cloud_compute_v1::client::RegionSslPolicies;
14721 /// let client = RegionSslPolicies::builder().build().await?;
14722 /// # Ok(()) }
14723 /// ```
14724 pub fn builder() -> super::builder::region_ssl_policies::ClientBuilder {
14725 crate::new_client_builder(super::builder::region_ssl_policies::client::Factory)
14726 }
14727
14728 /// Creates a new client from the provided stub.
14729 ///
14730 /// The most common case for calling this function is in tests mocking the
14731 /// client's behavior.
14732 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14733 where
14734 T: super::stub::RegionSslPolicies + 'static,
14735 {
14736 Self { inner: stub.into() }
14737 }
14738
14739 pub(crate) async fn new(
14740 config: gaxi::options::ClientConfig,
14741 ) -> crate::ClientBuilderResult<Self> {
14742 let inner = Self::build_inner(config).await?;
14743 Ok(Self { inner })
14744 }
14745
14746 async fn build_inner(
14747 conf: gaxi::options::ClientConfig,
14748 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionSslPolicies>>
14749 {
14750 if gaxi::options::tracing_enabled(&conf) {
14751 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14752 }
14753 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14754 }
14755
14756 async fn build_transport(
14757 conf: gaxi::options::ClientConfig,
14758 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslPolicies> {
14759 super::transport::RegionSslPolicies::new(conf).await
14760 }
14761
14762 async fn build_with_tracing(
14763 conf: gaxi::options::ClientConfig,
14764 ) -> crate::ClientBuilderResult<impl super::stub::RegionSslPolicies> {
14765 Self::build_transport(conf)
14766 .await
14767 .map(super::tracing::RegionSslPolicies::new)
14768 }
14769
14770 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
14771 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
14772 /// resources.
14773 pub fn delete(&self) -> super::builder::region_ssl_policies::Delete {
14774 super::builder::region_ssl_policies::Delete::new(self.inner.clone())
14775 }
14776
14777 /// Lists all of the ordered rules present in a single specified policy.
14778 pub fn get(&self) -> super::builder::region_ssl_policies::Get {
14779 super::builder::region_ssl_policies::Get::new(self.inner.clone())
14780 }
14781
14782 /// Creates a new policy in the specified project and region using the data
14783 /// included in the request.
14784 pub fn insert(&self) -> super::builder::region_ssl_policies::Insert {
14785 super::builder::region_ssl_policies::Insert::new(self.inner.clone())
14786 }
14787
14788 /// Lists all the SSL policies that have been configured for the specified
14789 /// project and region.
14790 pub fn list(&self) -> super::builder::region_ssl_policies::List {
14791 super::builder::region_ssl_policies::List::new(self.inner.clone())
14792 }
14793
14794 /// Lists all features that can be specified in the SSL policy when using
14795 /// custom profile.
14796 pub fn list_available_features(
14797 &self,
14798 ) -> super::builder::region_ssl_policies::ListAvailableFeatures {
14799 super::builder::region_ssl_policies::ListAvailableFeatures::new(self.inner.clone())
14800 }
14801
14802 /// Patches the specified SSL policy with the data included in the request.
14803 pub fn patch(&self) -> super::builder::region_ssl_policies::Patch {
14804 super::builder::region_ssl_policies::Patch::new(self.inner.clone())
14805 }
14806
14807 /// Retrieves the specified region-specific Operations resource.
14808 pub fn get_operation(&self) -> super::builder::region_ssl_policies::GetOperation {
14809 super::builder::region_ssl_policies::GetOperation::new(self.inner.clone())
14810 }
14811}
14812
14813/// Implements a client for the Google Compute Engine API.
14814///
14815/// # Example
14816/// ```
14817/// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
14818/// async fn sample(
14819/// ) -> anyhow::Result<()> {
14820/// let client = RegionTargetHttpProxies::builder().build().await?;
14821/// // use `client` to make requests to the Google Compute Engine API.
14822/// Ok(())
14823/// }
14824/// ```
14825///
14826/// # Service Description
14827///
14828/// Service for the `regionTargetHttpProxies` resource.
14829///
14830/// # Configuration
14831///
14832/// To configure `RegionTargetHttpProxies` use the `with_*` methods in the type returned
14833/// by [builder()][RegionTargetHttpProxies::builder]. The default configuration should
14834/// work for most applications. Common configuration changes include
14835///
14836/// * [with_endpoint()]: by default this client uses the global default endpoint
14837/// (`https://compute.googleapis.com`). Applications using regional
14838/// endpoints or running in restricted networks (e.g. a network configured
14839/// with [Private Google Access with VPC Service Controls]) may want to
14840/// override this default.
14841/// * [with_credentials()]: by default this client uses
14842/// [Application Default Credentials]. Applications using custom
14843/// authentication may need to override this default.
14844///
14845/// [with_endpoint()]: super::builder::region_target_http_proxies::ClientBuilder::with_endpoint
14846/// [with_credentials()]: super::builder::region_target_http_proxies::ClientBuilder::with_credentials
14847/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14848/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14849///
14850/// # Pooling and Cloning
14851///
14852/// `RegionTargetHttpProxies` holds a connection pool internally, it is advised to
14853/// create one and reuse it. You do not need to wrap `RegionTargetHttpProxies` in
14854/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14855/// already uses an `Arc` internally.
14856#[cfg(feature = "region-target-http-proxies")]
14857#[cfg_attr(docsrs, doc(cfg(feature = "region-target-http-proxies")))]
14858#[derive(Clone, Debug)]
14859pub struct RegionTargetHttpProxies {
14860 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>,
14861}
14862
14863#[cfg(feature = "region-target-http-proxies")]
14864impl RegionTargetHttpProxies {
14865 /// Returns a builder for [RegionTargetHttpProxies].
14866 ///
14867 /// ```
14868 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14869 /// # use google_cloud_compute_v1::client::RegionTargetHttpProxies;
14870 /// let client = RegionTargetHttpProxies::builder().build().await?;
14871 /// # Ok(()) }
14872 /// ```
14873 pub fn builder() -> super::builder::region_target_http_proxies::ClientBuilder {
14874 crate::new_client_builder(super::builder::region_target_http_proxies::client::Factory)
14875 }
14876
14877 /// Creates a new client from the provided stub.
14878 ///
14879 /// The most common case for calling this function is in tests mocking the
14880 /// client's behavior.
14881 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
14882 where
14883 T: super::stub::RegionTargetHttpProxies + 'static,
14884 {
14885 Self { inner: stub.into() }
14886 }
14887
14888 pub(crate) async fn new(
14889 config: gaxi::options::ClientConfig,
14890 ) -> crate::ClientBuilderResult<Self> {
14891 let inner = Self::build_inner(config).await?;
14892 Ok(Self { inner })
14893 }
14894
14895 async fn build_inner(
14896 conf: gaxi::options::ClientConfig,
14897 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpProxies>>
14898 {
14899 if gaxi::options::tracing_enabled(&conf) {
14900 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
14901 }
14902 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
14903 }
14904
14905 async fn build_transport(
14906 conf: gaxi::options::ClientConfig,
14907 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpProxies> {
14908 super::transport::RegionTargetHttpProxies::new(conf).await
14909 }
14910
14911 async fn build_with_tracing(
14912 conf: gaxi::options::ClientConfig,
14913 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpProxies> {
14914 Self::build_transport(conf)
14915 .await
14916 .map(super::tracing::RegionTargetHttpProxies::new)
14917 }
14918
14919 /// Deletes the specified TargetHttpProxy resource.
14920 pub fn delete(&self) -> super::builder::region_target_http_proxies::Delete {
14921 super::builder::region_target_http_proxies::Delete::new(self.inner.clone())
14922 }
14923
14924 /// Returns the specified TargetHttpProxy resource in the specified region.
14925 pub fn get(&self) -> super::builder::region_target_http_proxies::Get {
14926 super::builder::region_target_http_proxies::Get::new(self.inner.clone())
14927 }
14928
14929 /// Creates a TargetHttpProxy resource in the specified project and region
14930 /// using the data included in the request.
14931 pub fn insert(&self) -> super::builder::region_target_http_proxies::Insert {
14932 super::builder::region_target_http_proxies::Insert::new(self.inner.clone())
14933 }
14934
14935 /// Retrieves the list of TargetHttpProxy resources available
14936 /// to the specified project in the specified region.
14937 pub fn list(&self) -> super::builder::region_target_http_proxies::List {
14938 super::builder::region_target_http_proxies::List::new(self.inner.clone())
14939 }
14940
14941 /// Changes the URL map for TargetHttpProxy.
14942 pub fn set_url_map(&self) -> super::builder::region_target_http_proxies::SetUrlMap {
14943 super::builder::region_target_http_proxies::SetUrlMap::new(self.inner.clone())
14944 }
14945
14946 /// Retrieves the specified region-specific Operations resource.
14947 pub fn get_operation(&self) -> super::builder::region_target_http_proxies::GetOperation {
14948 super::builder::region_target_http_proxies::GetOperation::new(self.inner.clone())
14949 }
14950}
14951
14952/// Implements a client for the Google Compute Engine API.
14953///
14954/// # Example
14955/// ```
14956/// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
14957/// async fn sample(
14958/// ) -> anyhow::Result<()> {
14959/// let client = RegionTargetHttpsProxies::builder().build().await?;
14960/// // use `client` to make requests to the Google Compute Engine API.
14961/// Ok(())
14962/// }
14963/// ```
14964///
14965/// # Service Description
14966///
14967/// Service for the `regionTargetHttpsProxies` resource.
14968///
14969/// # Configuration
14970///
14971/// To configure `RegionTargetHttpsProxies` use the `with_*` methods in the type returned
14972/// by [builder()][RegionTargetHttpsProxies::builder]. The default configuration should
14973/// work for most applications. Common configuration changes include
14974///
14975/// * [with_endpoint()]: by default this client uses the global default endpoint
14976/// (`https://compute.googleapis.com`). Applications using regional
14977/// endpoints or running in restricted networks (e.g. a network configured
14978/// with [Private Google Access with VPC Service Controls]) may want to
14979/// override this default.
14980/// * [with_credentials()]: by default this client uses
14981/// [Application Default Credentials]. Applications using custom
14982/// authentication may need to override this default.
14983///
14984/// [with_endpoint()]: super::builder::region_target_https_proxies::ClientBuilder::with_endpoint
14985/// [with_credentials()]: super::builder::region_target_https_proxies::ClientBuilder::with_credentials
14986/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
14987/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
14988///
14989/// # Pooling and Cloning
14990///
14991/// `RegionTargetHttpsProxies` holds a connection pool internally, it is advised to
14992/// create one and reuse it. You do not need to wrap `RegionTargetHttpsProxies` in
14993/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
14994/// already uses an `Arc` internally.
14995#[cfg(feature = "region-target-https-proxies")]
14996#[cfg_attr(docsrs, doc(cfg(feature = "region-target-https-proxies")))]
14997#[derive(Clone, Debug)]
14998pub struct RegionTargetHttpsProxies {
14999 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
15000}
15001
15002#[cfg(feature = "region-target-https-proxies")]
15003impl RegionTargetHttpsProxies {
15004 /// Returns a builder for [RegionTargetHttpsProxies].
15005 ///
15006 /// ```
15007 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15008 /// # use google_cloud_compute_v1::client::RegionTargetHttpsProxies;
15009 /// let client = RegionTargetHttpsProxies::builder().build().await?;
15010 /// # Ok(()) }
15011 /// ```
15012 pub fn builder() -> super::builder::region_target_https_proxies::ClientBuilder {
15013 crate::new_client_builder(super::builder::region_target_https_proxies::client::Factory)
15014 }
15015
15016 /// Creates a new client from the provided stub.
15017 ///
15018 /// The most common case for calling this function is in tests mocking the
15019 /// client's behavior.
15020 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15021 where
15022 T: super::stub::RegionTargetHttpsProxies + 'static,
15023 {
15024 Self { inner: stub.into() }
15025 }
15026
15027 pub(crate) async fn new(
15028 config: gaxi::options::ClientConfig,
15029 ) -> crate::ClientBuilderResult<Self> {
15030 let inner = Self::build_inner(config).await?;
15031 Ok(Self { inner })
15032 }
15033
15034 async fn build_inner(
15035 conf: gaxi::options::ClientConfig,
15036 ) -> crate::ClientBuilderResult<
15037 std::sync::Arc<dyn super::stub::dynamic::RegionTargetHttpsProxies>,
15038 > {
15039 if gaxi::options::tracing_enabled(&conf) {
15040 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15041 }
15042 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15043 }
15044
15045 async fn build_transport(
15046 conf: gaxi::options::ClientConfig,
15047 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpsProxies> {
15048 super::transport::RegionTargetHttpsProxies::new(conf).await
15049 }
15050
15051 async fn build_with_tracing(
15052 conf: gaxi::options::ClientConfig,
15053 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetHttpsProxies> {
15054 Self::build_transport(conf)
15055 .await
15056 .map(super::tracing::RegionTargetHttpsProxies::new)
15057 }
15058
15059 /// Deletes the specified TargetHttpsProxy resource.
15060 pub fn delete(&self) -> super::builder::region_target_https_proxies::Delete {
15061 super::builder::region_target_https_proxies::Delete::new(self.inner.clone())
15062 }
15063
15064 /// Returns the specified TargetHttpsProxy resource in the specified region.
15065 pub fn get(&self) -> super::builder::region_target_https_proxies::Get {
15066 super::builder::region_target_https_proxies::Get::new(self.inner.clone())
15067 }
15068
15069 /// Creates a TargetHttpsProxy resource in the specified project and region
15070 /// using the data included in the request.
15071 pub fn insert(&self) -> super::builder::region_target_https_proxies::Insert {
15072 super::builder::region_target_https_proxies::Insert::new(self.inner.clone())
15073 }
15074
15075 /// Retrieves the list of TargetHttpsProxy resources available
15076 /// to the specified project in the specified region.
15077 pub fn list(&self) -> super::builder::region_target_https_proxies::List {
15078 super::builder::region_target_https_proxies::List::new(self.inner.clone())
15079 }
15080
15081 /// Patches the specified regional TargetHttpsProxy resource with the data
15082 /// included in the request. This method supports PATCH
15083 /// semantics and usesJSON merge
15084 /// patch format and processing rules.
15085 pub fn patch(&self) -> super::builder::region_target_https_proxies::Patch {
15086 super::builder::region_target_https_proxies::Patch::new(self.inner.clone())
15087 }
15088
15089 /// Replaces SslCertificates for TargetHttpsProxy.
15090 pub fn set_ssl_certificates(
15091 &self,
15092 ) -> super::builder::region_target_https_proxies::SetSslCertificates {
15093 super::builder::region_target_https_proxies::SetSslCertificates::new(self.inner.clone())
15094 }
15095
15096 /// Changes the URL map for TargetHttpsProxy.
15097 pub fn set_url_map(&self) -> super::builder::region_target_https_proxies::SetUrlMap {
15098 super::builder::region_target_https_proxies::SetUrlMap::new(self.inner.clone())
15099 }
15100
15101 /// Retrieves the specified region-specific Operations resource.
15102 pub fn get_operation(&self) -> super::builder::region_target_https_proxies::GetOperation {
15103 super::builder::region_target_https_proxies::GetOperation::new(self.inner.clone())
15104 }
15105}
15106
15107/// Implements a client for the Google Compute Engine API.
15108///
15109/// # Example
15110/// ```
15111/// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
15112/// async fn sample(
15113/// ) -> anyhow::Result<()> {
15114/// let client = RegionTargetTcpProxies::builder().build().await?;
15115/// // use `client` to make requests to the Google Compute Engine API.
15116/// Ok(())
15117/// }
15118/// ```
15119///
15120/// # Service Description
15121///
15122/// Service for the `regionTargetTcpProxies` resource.
15123///
15124/// # Configuration
15125///
15126/// To configure `RegionTargetTcpProxies` use the `with_*` methods in the type returned
15127/// by [builder()][RegionTargetTcpProxies::builder]. The default configuration should
15128/// work for most applications. Common configuration changes include
15129///
15130/// * [with_endpoint()]: by default this client uses the global default endpoint
15131/// (`https://compute.googleapis.com`). Applications using regional
15132/// endpoints or running in restricted networks (e.g. a network configured
15133/// with [Private Google Access with VPC Service Controls]) may want to
15134/// override this default.
15135/// * [with_credentials()]: by default this client uses
15136/// [Application Default Credentials]. Applications using custom
15137/// authentication may need to override this default.
15138///
15139/// [with_endpoint()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_endpoint
15140/// [with_credentials()]: super::builder::region_target_tcp_proxies::ClientBuilder::with_credentials
15141/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15142/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15143///
15144/// # Pooling and Cloning
15145///
15146/// `RegionTargetTcpProxies` holds a connection pool internally, it is advised to
15147/// create one and reuse it. You do not need to wrap `RegionTargetTcpProxies` in
15148/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15149/// already uses an `Arc` internally.
15150#[cfg(feature = "region-target-tcp-proxies")]
15151#[cfg_attr(docsrs, doc(cfg(feature = "region-target-tcp-proxies")))]
15152#[derive(Clone, Debug)]
15153pub struct RegionTargetTcpProxies {
15154 inner: std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>,
15155}
15156
15157#[cfg(feature = "region-target-tcp-proxies")]
15158impl RegionTargetTcpProxies {
15159 /// Returns a builder for [RegionTargetTcpProxies].
15160 ///
15161 /// ```
15162 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15163 /// # use google_cloud_compute_v1::client::RegionTargetTcpProxies;
15164 /// let client = RegionTargetTcpProxies::builder().build().await?;
15165 /// # Ok(()) }
15166 /// ```
15167 pub fn builder() -> super::builder::region_target_tcp_proxies::ClientBuilder {
15168 crate::new_client_builder(super::builder::region_target_tcp_proxies::client::Factory)
15169 }
15170
15171 /// Creates a new client from the provided stub.
15172 ///
15173 /// The most common case for calling this function is in tests mocking the
15174 /// client's behavior.
15175 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15176 where
15177 T: super::stub::RegionTargetTcpProxies + 'static,
15178 {
15179 Self { inner: stub.into() }
15180 }
15181
15182 pub(crate) async fn new(
15183 config: gaxi::options::ClientConfig,
15184 ) -> crate::ClientBuilderResult<Self> {
15185 let inner = Self::build_inner(config).await?;
15186 Ok(Self { inner })
15187 }
15188
15189 async fn build_inner(
15190 conf: gaxi::options::ClientConfig,
15191 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionTargetTcpProxies>>
15192 {
15193 if gaxi::options::tracing_enabled(&conf) {
15194 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15195 }
15196 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15197 }
15198
15199 async fn build_transport(
15200 conf: gaxi::options::ClientConfig,
15201 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetTcpProxies> {
15202 super::transport::RegionTargetTcpProxies::new(conf).await
15203 }
15204
15205 async fn build_with_tracing(
15206 conf: gaxi::options::ClientConfig,
15207 ) -> crate::ClientBuilderResult<impl super::stub::RegionTargetTcpProxies> {
15208 Self::build_transport(conf)
15209 .await
15210 .map(super::tracing::RegionTargetTcpProxies::new)
15211 }
15212
15213 /// Deletes the specified TargetTcpProxy resource.
15214 pub fn delete(&self) -> super::builder::region_target_tcp_proxies::Delete {
15215 super::builder::region_target_tcp_proxies::Delete::new(self.inner.clone())
15216 }
15217
15218 /// Returns the specified TargetTcpProxy resource.
15219 pub fn get(&self) -> super::builder::region_target_tcp_proxies::Get {
15220 super::builder::region_target_tcp_proxies::Get::new(self.inner.clone())
15221 }
15222
15223 /// Creates a TargetTcpProxy resource in the specified project and region using
15224 /// the data included in the request.
15225 pub fn insert(&self) -> super::builder::region_target_tcp_proxies::Insert {
15226 super::builder::region_target_tcp_proxies::Insert::new(self.inner.clone())
15227 }
15228
15229 /// Retrieves a list of TargetTcpProxy resources
15230 /// available to the specified project in a given region.
15231 pub fn list(&self) -> super::builder::region_target_tcp_proxies::List {
15232 super::builder::region_target_tcp_proxies::List::new(self.inner.clone())
15233 }
15234
15235 /// Retrieves the specified region-specific Operations resource.
15236 pub fn get_operation(&self) -> super::builder::region_target_tcp_proxies::GetOperation {
15237 super::builder::region_target_tcp_proxies::GetOperation::new(self.inner.clone())
15238 }
15239}
15240
15241/// Implements a client for the Google Compute Engine API.
15242///
15243/// # Example
15244/// ```
15245/// # use google_cloud_compute_v1::client::RegionUrlMaps;
15246/// async fn sample(
15247/// ) -> anyhow::Result<()> {
15248/// let client = RegionUrlMaps::builder().build().await?;
15249/// // use `client` to make requests to the Google Compute Engine API.
15250/// Ok(())
15251/// }
15252/// ```
15253///
15254/// # Service Description
15255///
15256/// Service for the `regionUrlMaps` resource.
15257///
15258/// # Configuration
15259///
15260/// To configure `RegionUrlMaps` use the `with_*` methods in the type returned
15261/// by [builder()][RegionUrlMaps::builder]. The default configuration should
15262/// work for most applications. Common configuration changes include
15263///
15264/// * [with_endpoint()]: by default this client uses the global default endpoint
15265/// (`https://compute.googleapis.com`). Applications using regional
15266/// endpoints or running in restricted networks (e.g. a network configured
15267/// with [Private Google Access with VPC Service Controls]) may want to
15268/// override this default.
15269/// * [with_credentials()]: by default this client uses
15270/// [Application Default Credentials]. Applications using custom
15271/// authentication may need to override this default.
15272///
15273/// [with_endpoint()]: super::builder::region_url_maps::ClientBuilder::with_endpoint
15274/// [with_credentials()]: super::builder::region_url_maps::ClientBuilder::with_credentials
15275/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15276/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15277///
15278/// # Pooling and Cloning
15279///
15280/// `RegionUrlMaps` holds a connection pool internally, it is advised to
15281/// create one and reuse it. You do not need to wrap `RegionUrlMaps` in
15282/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15283/// already uses an `Arc` internally.
15284#[cfg(feature = "region-url-maps")]
15285#[cfg_attr(docsrs, doc(cfg(feature = "region-url-maps")))]
15286#[derive(Clone, Debug)]
15287pub struct RegionUrlMaps {
15288 inner: std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>,
15289}
15290
15291#[cfg(feature = "region-url-maps")]
15292impl RegionUrlMaps {
15293 /// Returns a builder for [RegionUrlMaps].
15294 ///
15295 /// ```
15296 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15297 /// # use google_cloud_compute_v1::client::RegionUrlMaps;
15298 /// let client = RegionUrlMaps::builder().build().await?;
15299 /// # Ok(()) }
15300 /// ```
15301 pub fn builder() -> super::builder::region_url_maps::ClientBuilder {
15302 crate::new_client_builder(super::builder::region_url_maps::client::Factory)
15303 }
15304
15305 /// Creates a new client from the provided stub.
15306 ///
15307 /// The most common case for calling this function is in tests mocking the
15308 /// client's behavior.
15309 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15310 where
15311 T: super::stub::RegionUrlMaps + 'static,
15312 {
15313 Self { inner: stub.into() }
15314 }
15315
15316 pub(crate) async fn new(
15317 config: gaxi::options::ClientConfig,
15318 ) -> crate::ClientBuilderResult<Self> {
15319 let inner = Self::build_inner(config).await?;
15320 Ok(Self { inner })
15321 }
15322
15323 async fn build_inner(
15324 conf: gaxi::options::ClientConfig,
15325 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionUrlMaps>> {
15326 if gaxi::options::tracing_enabled(&conf) {
15327 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15328 }
15329 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15330 }
15331
15332 async fn build_transport(
15333 conf: gaxi::options::ClientConfig,
15334 ) -> crate::ClientBuilderResult<impl super::stub::RegionUrlMaps> {
15335 super::transport::RegionUrlMaps::new(conf).await
15336 }
15337
15338 async fn build_with_tracing(
15339 conf: gaxi::options::ClientConfig,
15340 ) -> crate::ClientBuilderResult<impl super::stub::RegionUrlMaps> {
15341 Self::build_transport(conf)
15342 .await
15343 .map(super::tracing::RegionUrlMaps::new)
15344 }
15345
15346 /// Deletes the specified UrlMap resource.
15347 pub fn delete(&self) -> super::builder::region_url_maps::Delete {
15348 super::builder::region_url_maps::Delete::new(self.inner.clone())
15349 }
15350
15351 /// Returns the specified UrlMap resource.
15352 pub fn get(&self) -> super::builder::region_url_maps::Get {
15353 super::builder::region_url_maps::Get::new(self.inner.clone())
15354 }
15355
15356 /// Creates a UrlMap resource in the specified project using
15357 /// the data included in the request.
15358 pub fn insert(&self) -> super::builder::region_url_maps::Insert {
15359 super::builder::region_url_maps::Insert::new(self.inner.clone())
15360 }
15361
15362 /// Retrieves the list of UrlMap resources available to the specified
15363 /// project in the specified region.
15364 pub fn list(&self) -> super::builder::region_url_maps::List {
15365 super::builder::region_url_maps::List::new(self.inner.clone())
15366 }
15367
15368 /// Patches the specified UrlMap resource with the data included in the
15369 /// request. This method supportsPATCH
15370 /// semantics and usesJSON merge
15371 /// patch format and processing rules.
15372 pub fn patch(&self) -> super::builder::region_url_maps::Patch {
15373 super::builder::region_url_maps::Patch::new(self.inner.clone())
15374 }
15375
15376 /// Updates the specified UrlMap resource with the data included in the
15377 /// request.
15378 pub fn update(&self) -> super::builder::region_url_maps::Update {
15379 super::builder::region_url_maps::Update::new(self.inner.clone())
15380 }
15381
15382 /// Runs static validation for the UrlMap. In particular, the tests of the
15383 /// provided UrlMap will be run. Calling this method does NOT create the
15384 /// UrlMap.
15385 pub fn validate(&self) -> super::builder::region_url_maps::Validate {
15386 super::builder::region_url_maps::Validate::new(self.inner.clone())
15387 }
15388
15389 /// Retrieves the specified region-specific Operations resource.
15390 pub fn get_operation(&self) -> super::builder::region_url_maps::GetOperation {
15391 super::builder::region_url_maps::GetOperation::new(self.inner.clone())
15392 }
15393}
15394
15395/// Implements a client for the Google Compute Engine API.
15396///
15397/// # Example
15398/// ```
15399/// # use google_cloud_compute_v1::client::RegionZones;
15400/// async fn sample(
15401/// ) -> anyhow::Result<()> {
15402/// let client = RegionZones::builder().build().await?;
15403/// // use `client` to make requests to the Google Compute Engine API.
15404/// Ok(())
15405/// }
15406/// ```
15407///
15408/// # Service Description
15409///
15410/// Service for the `regionZones` resource.
15411///
15412/// # Configuration
15413///
15414/// To configure `RegionZones` use the `with_*` methods in the type returned
15415/// by [builder()][RegionZones::builder]. The default configuration should
15416/// work for most applications. Common configuration changes include
15417///
15418/// * [with_endpoint()]: by default this client uses the global default endpoint
15419/// (`https://compute.googleapis.com`). Applications using regional
15420/// endpoints or running in restricted networks (e.g. a network configured
15421/// with [Private Google Access with VPC Service Controls]) may want to
15422/// override this default.
15423/// * [with_credentials()]: by default this client uses
15424/// [Application Default Credentials]. Applications using custom
15425/// authentication may need to override this default.
15426///
15427/// [with_endpoint()]: super::builder::region_zones::ClientBuilder::with_endpoint
15428/// [with_credentials()]: super::builder::region_zones::ClientBuilder::with_credentials
15429/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15430/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15431///
15432/// # Pooling and Cloning
15433///
15434/// `RegionZones` holds a connection pool internally, it is advised to
15435/// create one and reuse it. You do not need to wrap `RegionZones` in
15436/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15437/// already uses an `Arc` internally.
15438#[cfg(feature = "region-zones")]
15439#[cfg_attr(docsrs, doc(cfg(feature = "region-zones")))]
15440#[derive(Clone, Debug)]
15441pub struct RegionZones {
15442 inner: std::sync::Arc<dyn super::stub::dynamic::RegionZones>,
15443}
15444
15445#[cfg(feature = "region-zones")]
15446impl RegionZones {
15447 /// Returns a builder for [RegionZones].
15448 ///
15449 /// ```
15450 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15451 /// # use google_cloud_compute_v1::client::RegionZones;
15452 /// let client = RegionZones::builder().build().await?;
15453 /// # Ok(()) }
15454 /// ```
15455 pub fn builder() -> super::builder::region_zones::ClientBuilder {
15456 crate::new_client_builder(super::builder::region_zones::client::Factory)
15457 }
15458
15459 /// Creates a new client from the provided stub.
15460 ///
15461 /// The most common case for calling this function is in tests mocking the
15462 /// client's behavior.
15463 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15464 where
15465 T: super::stub::RegionZones + 'static,
15466 {
15467 Self { inner: stub.into() }
15468 }
15469
15470 pub(crate) async fn new(
15471 config: gaxi::options::ClientConfig,
15472 ) -> crate::ClientBuilderResult<Self> {
15473 let inner = Self::build_inner(config).await?;
15474 Ok(Self { inner })
15475 }
15476
15477 async fn build_inner(
15478 conf: gaxi::options::ClientConfig,
15479 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RegionZones>> {
15480 if gaxi::options::tracing_enabled(&conf) {
15481 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15482 }
15483 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15484 }
15485
15486 async fn build_transport(
15487 conf: gaxi::options::ClientConfig,
15488 ) -> crate::ClientBuilderResult<impl super::stub::RegionZones> {
15489 super::transport::RegionZones::new(conf).await
15490 }
15491
15492 async fn build_with_tracing(
15493 conf: gaxi::options::ClientConfig,
15494 ) -> crate::ClientBuilderResult<impl super::stub::RegionZones> {
15495 Self::build_transport(conf)
15496 .await
15497 .map(super::tracing::RegionZones::new)
15498 }
15499
15500 /// Retrieves the list of Zone resources under the specific region available to
15501 /// the specified project.
15502 pub fn list(&self) -> super::builder::region_zones::List {
15503 super::builder::region_zones::List::new(self.inner.clone())
15504 }
15505}
15506
15507/// Implements a client for the Google Compute Engine API.
15508///
15509/// # Example
15510/// ```
15511/// # use google_cloud_compute_v1::client::Regions;
15512/// async fn sample(
15513/// ) -> anyhow::Result<()> {
15514/// let client = Regions::builder().build().await?;
15515/// // use `client` to make requests to the Google Compute Engine API.
15516/// Ok(())
15517/// }
15518/// ```
15519///
15520/// # Service Description
15521///
15522/// Service for the `regions` resource.
15523///
15524/// # Configuration
15525///
15526/// To configure `Regions` use the `with_*` methods in the type returned
15527/// by [builder()][Regions::builder]. The default configuration should
15528/// work for most applications. Common configuration changes include
15529///
15530/// * [with_endpoint()]: by default this client uses the global default endpoint
15531/// (`https://compute.googleapis.com`). Applications using regional
15532/// endpoints or running in restricted networks (e.g. a network configured
15533/// with [Private Google Access with VPC Service Controls]) may want to
15534/// override this default.
15535/// * [with_credentials()]: by default this client uses
15536/// [Application Default Credentials]. Applications using custom
15537/// authentication may need to override this default.
15538///
15539/// [with_endpoint()]: super::builder::regions::ClientBuilder::with_endpoint
15540/// [with_credentials()]: super::builder::regions::ClientBuilder::with_credentials
15541/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15542/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15543///
15544/// # Pooling and Cloning
15545///
15546/// `Regions` holds a connection pool internally, it is advised to
15547/// create one and reuse it. You do not need to wrap `Regions` in
15548/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15549/// already uses an `Arc` internally.
15550#[cfg(feature = "regions")]
15551#[cfg_attr(docsrs, doc(cfg(feature = "regions")))]
15552#[derive(Clone, Debug)]
15553pub struct Regions {
15554 inner: std::sync::Arc<dyn super::stub::dynamic::Regions>,
15555}
15556
15557#[cfg(feature = "regions")]
15558impl Regions {
15559 /// Returns a builder for [Regions].
15560 ///
15561 /// ```
15562 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15563 /// # use google_cloud_compute_v1::client::Regions;
15564 /// let client = Regions::builder().build().await?;
15565 /// # Ok(()) }
15566 /// ```
15567 pub fn builder() -> super::builder::regions::ClientBuilder {
15568 crate::new_client_builder(super::builder::regions::client::Factory)
15569 }
15570
15571 /// Creates a new client from the provided stub.
15572 ///
15573 /// The most common case for calling this function is in tests mocking the
15574 /// client's behavior.
15575 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15576 where
15577 T: super::stub::Regions + 'static,
15578 {
15579 Self { inner: stub.into() }
15580 }
15581
15582 pub(crate) async fn new(
15583 config: gaxi::options::ClientConfig,
15584 ) -> crate::ClientBuilderResult<Self> {
15585 let inner = Self::build_inner(config).await?;
15586 Ok(Self { inner })
15587 }
15588
15589 async fn build_inner(
15590 conf: gaxi::options::ClientConfig,
15591 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Regions>> {
15592 if gaxi::options::tracing_enabled(&conf) {
15593 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15594 }
15595 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15596 }
15597
15598 async fn build_transport(
15599 conf: gaxi::options::ClientConfig,
15600 ) -> crate::ClientBuilderResult<impl super::stub::Regions> {
15601 super::transport::Regions::new(conf).await
15602 }
15603
15604 async fn build_with_tracing(
15605 conf: gaxi::options::ClientConfig,
15606 ) -> crate::ClientBuilderResult<impl super::stub::Regions> {
15607 Self::build_transport(conf)
15608 .await
15609 .map(super::tracing::Regions::new)
15610 }
15611
15612 /// Returns the specified Region resource.
15613 ///
15614 /// To decrease latency for this method, you can optionally omit any unneeded
15615 /// information from the response by using a field mask. This practice is
15616 /// especially recommended for unused quota information (the `quotas` field).
15617 /// To exclude one or more fields, set your request's `fields` query parameter
15618 /// to only include the fields you need. For example, to only include the `id`
15619 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
15620 /// your request.
15621 ///
15622 /// This method fails if the quota information is unavailable for the region
15623 /// and if the organization policy constraint
15624 /// compute.requireBasicQuotaInResponse is enforced. This
15625 /// constraint, when enforced, disables the fail-open behaviour when quota
15626 /// information (the `items.quotas` field) is unavailable for the region.
15627 /// It is recommended to use the default setting
15628 /// for the constraint unless your application requires the fail-closed
15629 /// behaviour for this method.
15630 pub fn get(&self) -> super::builder::regions::Get {
15631 super::builder::regions::Get::new(self.inner.clone())
15632 }
15633
15634 /// Retrieves the list of region resources available to the specified project.
15635 ///
15636 /// To decrease latency for this method, you can optionally omit any unneeded
15637 /// information from the response by using a field mask. This practice is
15638 /// especially recommended for unused quota information
15639 /// (the `items.quotas` field).
15640 /// To exclude one or more fields, set your request's `fields` query parameter
15641 /// to only include the fields you need. For example, to only include the `id`
15642 /// and `selfLink` fields, add the query parameter `?fields=id,selfLink` to
15643 /// your request.
15644 ///
15645 /// This method fails if the quota information is unavailable for the region
15646 /// and if the organization policy constraint
15647 /// compute.requireBasicQuotaInResponse is enforced. This
15648 /// constraint, when enforced, disables the fail-open behaviour when quota
15649 /// information (the `items.quotas` field) is unavailable for the region.
15650 /// It is recommended to use the default setting
15651 /// for the constraint unless your application requires the fail-closed
15652 /// behaviour for this method.
15653 pub fn list(&self) -> super::builder::regions::List {
15654 super::builder::regions::List::new(self.inner.clone())
15655 }
15656}
15657
15658/// Implements a client for the Google Compute Engine API.
15659///
15660/// # Example
15661/// ```
15662/// # use google_cloud_compute_v1::client::ReliabilityRisks;
15663/// async fn sample(
15664/// ) -> anyhow::Result<()> {
15665/// let client = ReliabilityRisks::builder().build().await?;
15666/// // use `client` to make requests to the Google Compute Engine API.
15667/// Ok(())
15668/// }
15669/// ```
15670///
15671/// # Service Description
15672///
15673/// Service for the `reliabilityRisks` resource.
15674///
15675/// # Configuration
15676///
15677/// To configure `ReliabilityRisks` use the `with_*` methods in the type returned
15678/// by [builder()][ReliabilityRisks::builder]. The default configuration should
15679/// work for most applications. Common configuration changes include
15680///
15681/// * [with_endpoint()]: by default this client uses the global default endpoint
15682/// (`https://compute.googleapis.com`). Applications using regional
15683/// endpoints or running in restricted networks (e.g. a network configured
15684/// with [Private Google Access with VPC Service Controls]) may want to
15685/// override this default.
15686/// * [with_credentials()]: by default this client uses
15687/// [Application Default Credentials]. Applications using custom
15688/// authentication may need to override this default.
15689///
15690/// [with_endpoint()]: super::builder::reliability_risks::ClientBuilder::with_endpoint
15691/// [with_credentials()]: super::builder::reliability_risks::ClientBuilder::with_credentials
15692/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15693/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15694///
15695/// # Pooling and Cloning
15696///
15697/// `ReliabilityRisks` holds a connection pool internally, it is advised to
15698/// create one and reuse it. You do not need to wrap `ReliabilityRisks` in
15699/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15700/// already uses an `Arc` internally.
15701#[cfg(feature = "reliability-risks")]
15702#[cfg_attr(docsrs, doc(cfg(feature = "reliability-risks")))]
15703#[derive(Clone, Debug)]
15704pub struct ReliabilityRisks {
15705 inner: std::sync::Arc<dyn super::stub::dynamic::ReliabilityRisks>,
15706}
15707
15708#[cfg(feature = "reliability-risks")]
15709impl ReliabilityRisks {
15710 /// Returns a builder for [ReliabilityRisks].
15711 ///
15712 /// ```
15713 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15714 /// # use google_cloud_compute_v1::client::ReliabilityRisks;
15715 /// let client = ReliabilityRisks::builder().build().await?;
15716 /// # Ok(()) }
15717 /// ```
15718 pub fn builder() -> super::builder::reliability_risks::ClientBuilder {
15719 crate::new_client_builder(super::builder::reliability_risks::client::Factory)
15720 }
15721
15722 /// Creates a new client from the provided stub.
15723 ///
15724 /// The most common case for calling this function is in tests mocking the
15725 /// client's behavior.
15726 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15727 where
15728 T: super::stub::ReliabilityRisks + 'static,
15729 {
15730 Self { inner: stub.into() }
15731 }
15732
15733 pub(crate) async fn new(
15734 config: gaxi::options::ClientConfig,
15735 ) -> crate::ClientBuilderResult<Self> {
15736 let inner = Self::build_inner(config).await?;
15737 Ok(Self { inner })
15738 }
15739
15740 async fn build_inner(
15741 conf: gaxi::options::ClientConfig,
15742 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReliabilityRisks>>
15743 {
15744 if gaxi::options::tracing_enabled(&conf) {
15745 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15746 }
15747 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15748 }
15749
15750 async fn build_transport(
15751 conf: gaxi::options::ClientConfig,
15752 ) -> crate::ClientBuilderResult<impl super::stub::ReliabilityRisks> {
15753 super::transport::ReliabilityRisks::new(conf).await
15754 }
15755
15756 async fn build_with_tracing(
15757 conf: gaxi::options::ClientConfig,
15758 ) -> crate::ClientBuilderResult<impl super::stub::ReliabilityRisks> {
15759 Self::build_transport(conf)
15760 .await
15761 .map(super::tracing::ReliabilityRisks::new)
15762 }
15763
15764 /// Returns the specified ReliabilityRisk resource.
15765 pub fn get(&self) -> super::builder::reliability_risks::Get {
15766 super::builder::reliability_risks::Get::new(self.inner.clone())
15767 }
15768
15769 /// Retrieves the list of reliabilityRisks available in the specified project.
15770 pub fn list(&self) -> super::builder::reliability_risks::List {
15771 super::builder::reliability_risks::List::new(self.inner.clone())
15772 }
15773}
15774
15775/// Implements a client for the Google Compute Engine API.
15776///
15777/// # Example
15778/// ```
15779/// # use google_cloud_compute_v1::client::ReservationBlocks;
15780/// async fn sample(
15781/// ) -> anyhow::Result<()> {
15782/// let client = ReservationBlocks::builder().build().await?;
15783/// // use `client` to make requests to the Google Compute Engine API.
15784/// Ok(())
15785/// }
15786/// ```
15787///
15788/// # Service Description
15789///
15790/// Service for the `reservationBlocks` resource.
15791///
15792/// # Configuration
15793///
15794/// To configure `ReservationBlocks` use the `with_*` methods in the type returned
15795/// by [builder()][ReservationBlocks::builder]. The default configuration should
15796/// work for most applications. Common configuration changes include
15797///
15798/// * [with_endpoint()]: by default this client uses the global default endpoint
15799/// (`https://compute.googleapis.com`). Applications using regional
15800/// endpoints or running in restricted networks (e.g. a network configured
15801/// with [Private Google Access with VPC Service Controls]) may want to
15802/// override this default.
15803/// * [with_credentials()]: by default this client uses
15804/// [Application Default Credentials]. Applications using custom
15805/// authentication may need to override this default.
15806///
15807/// [with_endpoint()]: super::builder::reservation_blocks::ClientBuilder::with_endpoint
15808/// [with_credentials()]: super::builder::reservation_blocks::ClientBuilder::with_credentials
15809/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15810/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15811///
15812/// # Pooling and Cloning
15813///
15814/// `ReservationBlocks` holds a connection pool internally, it is advised to
15815/// create one and reuse it. You do not need to wrap `ReservationBlocks` in
15816/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15817/// already uses an `Arc` internally.
15818#[cfg(feature = "reservation-blocks")]
15819#[cfg_attr(docsrs, doc(cfg(feature = "reservation-blocks")))]
15820#[derive(Clone, Debug)]
15821pub struct ReservationBlocks {
15822 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>,
15823}
15824
15825#[cfg(feature = "reservation-blocks")]
15826impl ReservationBlocks {
15827 /// Returns a builder for [ReservationBlocks].
15828 ///
15829 /// ```
15830 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15831 /// # use google_cloud_compute_v1::client::ReservationBlocks;
15832 /// let client = ReservationBlocks::builder().build().await?;
15833 /// # Ok(()) }
15834 /// ```
15835 pub fn builder() -> super::builder::reservation_blocks::ClientBuilder {
15836 crate::new_client_builder(super::builder::reservation_blocks::client::Factory)
15837 }
15838
15839 /// Creates a new client from the provided stub.
15840 ///
15841 /// The most common case for calling this function is in tests mocking the
15842 /// client's behavior.
15843 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15844 where
15845 T: super::stub::ReservationBlocks + 'static,
15846 {
15847 Self { inner: stub.into() }
15848 }
15849
15850 pub(crate) async fn new(
15851 config: gaxi::options::ClientConfig,
15852 ) -> crate::ClientBuilderResult<Self> {
15853 let inner = Self::build_inner(config).await?;
15854 Ok(Self { inner })
15855 }
15856
15857 async fn build_inner(
15858 conf: gaxi::options::ClientConfig,
15859 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationBlocks>>
15860 {
15861 if gaxi::options::tracing_enabled(&conf) {
15862 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
15863 }
15864 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
15865 }
15866
15867 async fn build_transport(
15868 conf: gaxi::options::ClientConfig,
15869 ) -> crate::ClientBuilderResult<impl super::stub::ReservationBlocks> {
15870 super::transport::ReservationBlocks::new(conf).await
15871 }
15872
15873 async fn build_with_tracing(
15874 conf: gaxi::options::ClientConfig,
15875 ) -> crate::ClientBuilderResult<impl super::stub::ReservationBlocks> {
15876 Self::build_transport(conf)
15877 .await
15878 .map(super::tracing::ReservationBlocks::new)
15879 }
15880
15881 /// Retrieves information about the specified reservation block.
15882 pub fn get(&self) -> super::builder::reservation_blocks::Get {
15883 super::builder::reservation_blocks::Get::new(self.inner.clone())
15884 }
15885
15886 /// Gets the access control policy for a resource. May be empty if no such
15887 /// policy or resource exists.
15888 pub fn get_iam_policy(&self) -> super::builder::reservation_blocks::GetIamPolicy {
15889 super::builder::reservation_blocks::GetIamPolicy::new(self.inner.clone())
15890 }
15891
15892 /// Retrieves a list of reservation blocks under a single reservation.
15893 pub fn list(&self) -> super::builder::reservation_blocks::List {
15894 super::builder::reservation_blocks::List::new(self.inner.clone())
15895 }
15896
15897 /// Allows customers to perform maintenance on a reservation block
15898 pub fn perform_maintenance(&self) -> super::builder::reservation_blocks::PerformMaintenance {
15899 super::builder::reservation_blocks::PerformMaintenance::new(self.inner.clone())
15900 }
15901
15902 /// Sets the access control policy on the specified resource.
15903 /// Replaces any existing policy.
15904 pub fn set_iam_policy(&self) -> super::builder::reservation_blocks::SetIamPolicy {
15905 super::builder::reservation_blocks::SetIamPolicy::new(self.inner.clone())
15906 }
15907
15908 /// Returns permissions that a caller has on the specified resource.
15909 pub fn test_iam_permissions(&self) -> super::builder::reservation_blocks::TestIamPermissions {
15910 super::builder::reservation_blocks::TestIamPermissions::new(self.inner.clone())
15911 }
15912
15913 /// Retrieves the specified zone-specific Operations resource.
15914 pub fn get_operation(&self) -> super::builder::reservation_blocks::GetOperation {
15915 super::builder::reservation_blocks::GetOperation::new(self.inner.clone())
15916 }
15917}
15918
15919/// Implements a client for the Google Compute Engine API.
15920///
15921/// # Example
15922/// ```
15923/// # use google_cloud_compute_v1::client::ReservationSlots;
15924/// async fn sample(
15925/// ) -> anyhow::Result<()> {
15926/// let client = ReservationSlots::builder().build().await?;
15927/// // use `client` to make requests to the Google Compute Engine API.
15928/// Ok(())
15929/// }
15930/// ```
15931///
15932/// # Service Description
15933///
15934/// Service for the `reservationSlots` resource.
15935///
15936/// # Configuration
15937///
15938/// To configure `ReservationSlots` use the `with_*` methods in the type returned
15939/// by [builder()][ReservationSlots::builder]. The default configuration should
15940/// work for most applications. Common configuration changes include
15941///
15942/// * [with_endpoint()]: by default this client uses the global default endpoint
15943/// (`https://compute.googleapis.com`). Applications using regional
15944/// endpoints or running in restricted networks (e.g. a network configured
15945/// with [Private Google Access with VPC Service Controls]) may want to
15946/// override this default.
15947/// * [with_credentials()]: by default this client uses
15948/// [Application Default Credentials]. Applications using custom
15949/// authentication may need to override this default.
15950///
15951/// [with_endpoint()]: super::builder::reservation_slots::ClientBuilder::with_endpoint
15952/// [with_credentials()]: super::builder::reservation_slots::ClientBuilder::with_credentials
15953/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
15954/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
15955///
15956/// # Pooling and Cloning
15957///
15958/// `ReservationSlots` holds a connection pool internally, it is advised to
15959/// create one and reuse it. You do not need to wrap `ReservationSlots` in
15960/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
15961/// already uses an `Arc` internally.
15962#[cfg(feature = "reservation-slots")]
15963#[cfg_attr(docsrs, doc(cfg(feature = "reservation-slots")))]
15964#[derive(Clone, Debug)]
15965pub struct ReservationSlots {
15966 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>,
15967}
15968
15969#[cfg(feature = "reservation-slots")]
15970impl ReservationSlots {
15971 /// Returns a builder for [ReservationSlots].
15972 ///
15973 /// ```
15974 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15975 /// # use google_cloud_compute_v1::client::ReservationSlots;
15976 /// let client = ReservationSlots::builder().build().await?;
15977 /// # Ok(()) }
15978 /// ```
15979 pub fn builder() -> super::builder::reservation_slots::ClientBuilder {
15980 crate::new_client_builder(super::builder::reservation_slots::client::Factory)
15981 }
15982
15983 /// Creates a new client from the provided stub.
15984 ///
15985 /// The most common case for calling this function is in tests mocking the
15986 /// client's behavior.
15987 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
15988 where
15989 T: super::stub::ReservationSlots + 'static,
15990 {
15991 Self { inner: stub.into() }
15992 }
15993
15994 pub(crate) async fn new(
15995 config: gaxi::options::ClientConfig,
15996 ) -> crate::ClientBuilderResult<Self> {
15997 let inner = Self::build_inner(config).await?;
15998 Ok(Self { inner })
15999 }
16000
16001 async fn build_inner(
16002 conf: gaxi::options::ClientConfig,
16003 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationSlots>>
16004 {
16005 if gaxi::options::tracing_enabled(&conf) {
16006 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16007 }
16008 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16009 }
16010
16011 async fn build_transport(
16012 conf: gaxi::options::ClientConfig,
16013 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSlots> {
16014 super::transport::ReservationSlots::new(conf).await
16015 }
16016
16017 async fn build_with_tracing(
16018 conf: gaxi::options::ClientConfig,
16019 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSlots> {
16020 Self::build_transport(conf)
16021 .await
16022 .map(super::tracing::ReservationSlots::new)
16023 }
16024
16025 /// Retrieves information about the specified reservation slot.
16026 pub fn get(&self) -> super::builder::reservation_slots::Get {
16027 super::builder::reservation_slots::Get::new(self.inner.clone())
16028 }
16029
16030 /// Allows customers to get SBOM versions of a reservation slot.
16031 pub fn get_version(&self) -> super::builder::reservation_slots::GetVersion {
16032 super::builder::reservation_slots::GetVersion::new(self.inner.clone())
16033 }
16034
16035 /// Retrieves a list of reservation slots under a single reservation.
16036 pub fn list(&self) -> super::builder::reservation_slots::List {
16037 super::builder::reservation_slots::List::new(self.inner.clone())
16038 }
16039
16040 /// Update a reservation slot in the specified sub-block.
16041 pub fn update(&self) -> super::builder::reservation_slots::Update {
16042 super::builder::reservation_slots::Update::new(self.inner.clone())
16043 }
16044
16045 /// Retrieves the specified zone-specific Operations resource.
16046 pub fn get_operation(&self) -> super::builder::reservation_slots::GetOperation {
16047 super::builder::reservation_slots::GetOperation::new(self.inner.clone())
16048 }
16049}
16050
16051/// Implements a client for the Google Compute Engine API.
16052///
16053/// # Example
16054/// ```
16055/// # use google_cloud_compute_v1::client::ReservationSubBlocks;
16056/// async fn sample(
16057/// ) -> anyhow::Result<()> {
16058/// let client = ReservationSubBlocks::builder().build().await?;
16059/// // use `client` to make requests to the Google Compute Engine API.
16060/// Ok(())
16061/// }
16062/// ```
16063///
16064/// # Service Description
16065///
16066/// Service for the `reservationSubBlocks` resource.
16067///
16068/// # Configuration
16069///
16070/// To configure `ReservationSubBlocks` use the `with_*` methods in the type returned
16071/// by [builder()][ReservationSubBlocks::builder]. The default configuration should
16072/// work for most applications. Common configuration changes include
16073///
16074/// * [with_endpoint()]: by default this client uses the global default endpoint
16075/// (`https://compute.googleapis.com`). Applications using regional
16076/// endpoints or running in restricted networks (e.g. a network configured
16077/// with [Private Google Access with VPC Service Controls]) may want to
16078/// override this default.
16079/// * [with_credentials()]: by default this client uses
16080/// [Application Default Credentials]. Applications using custom
16081/// authentication may need to override this default.
16082///
16083/// [with_endpoint()]: super::builder::reservation_sub_blocks::ClientBuilder::with_endpoint
16084/// [with_credentials()]: super::builder::reservation_sub_blocks::ClientBuilder::with_credentials
16085/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16086/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16087///
16088/// # Pooling and Cloning
16089///
16090/// `ReservationSubBlocks` holds a connection pool internally, it is advised to
16091/// create one and reuse it. You do not need to wrap `ReservationSubBlocks` in
16092/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16093/// already uses an `Arc` internally.
16094#[cfg(feature = "reservation-sub-blocks")]
16095#[cfg_attr(docsrs, doc(cfg(feature = "reservation-sub-blocks")))]
16096#[derive(Clone, Debug)]
16097pub struct ReservationSubBlocks {
16098 inner: std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>,
16099}
16100
16101#[cfg(feature = "reservation-sub-blocks")]
16102impl ReservationSubBlocks {
16103 /// Returns a builder for [ReservationSubBlocks].
16104 ///
16105 /// ```
16106 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16107 /// # use google_cloud_compute_v1::client::ReservationSubBlocks;
16108 /// let client = ReservationSubBlocks::builder().build().await?;
16109 /// # Ok(()) }
16110 /// ```
16111 pub fn builder() -> super::builder::reservation_sub_blocks::ClientBuilder {
16112 crate::new_client_builder(super::builder::reservation_sub_blocks::client::Factory)
16113 }
16114
16115 /// Creates a new client from the provided stub.
16116 ///
16117 /// The most common case for calling this function is in tests mocking the
16118 /// client's behavior.
16119 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16120 where
16121 T: super::stub::ReservationSubBlocks + 'static,
16122 {
16123 Self { inner: stub.into() }
16124 }
16125
16126 pub(crate) async fn new(
16127 config: gaxi::options::ClientConfig,
16128 ) -> crate::ClientBuilderResult<Self> {
16129 let inner = Self::build_inner(config).await?;
16130 Ok(Self { inner })
16131 }
16132
16133 async fn build_inner(
16134 conf: gaxi::options::ClientConfig,
16135 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ReservationSubBlocks>>
16136 {
16137 if gaxi::options::tracing_enabled(&conf) {
16138 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16139 }
16140 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16141 }
16142
16143 async fn build_transport(
16144 conf: gaxi::options::ClientConfig,
16145 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSubBlocks> {
16146 super::transport::ReservationSubBlocks::new(conf).await
16147 }
16148
16149 async fn build_with_tracing(
16150 conf: gaxi::options::ClientConfig,
16151 ) -> crate::ClientBuilderResult<impl super::stub::ReservationSubBlocks> {
16152 Self::build_transport(conf)
16153 .await
16154 .map(super::tracing::ReservationSubBlocks::new)
16155 }
16156
16157 /// Retrieves information about the specified reservation subBlock.
16158 pub fn get(&self) -> super::builder::reservation_sub_blocks::Get {
16159 super::builder::reservation_sub_blocks::Get::new(self.inner.clone())
16160 }
16161
16162 /// Gets the access control policy for a resource. May be empty if no such
16163 /// policy or resource exists.
16164 pub fn get_iam_policy(&self) -> super::builder::reservation_sub_blocks::GetIamPolicy {
16165 super::builder::reservation_sub_blocks::GetIamPolicy::new(self.inner.clone())
16166 }
16167
16168 /// Allows customers to get SBOM versions of a reservation subBlock.
16169 pub fn get_version(&self) -> super::builder::reservation_sub_blocks::GetVersion {
16170 super::builder::reservation_sub_blocks::GetVersion::new(self.inner.clone())
16171 }
16172
16173 /// Retrieves a list of reservation subBlocks under a single reservation.
16174 pub fn list(&self) -> super::builder::reservation_sub_blocks::List {
16175 super::builder::reservation_sub_blocks::List::new(self.inner.clone())
16176 }
16177
16178 /// Allows customers to perform maintenance on a reservation subBlock
16179 pub fn perform_maintenance(
16180 &self,
16181 ) -> super::builder::reservation_sub_blocks::PerformMaintenance {
16182 super::builder::reservation_sub_blocks::PerformMaintenance::new(self.inner.clone())
16183 }
16184
16185 /// Allows customers to report a faulty subBlock.
16186 pub fn report_faulty(&self) -> super::builder::reservation_sub_blocks::ReportFaulty {
16187 super::builder::reservation_sub_blocks::ReportFaulty::new(self.inner.clone())
16188 }
16189
16190 /// Sets the access control policy on the specified resource.
16191 /// Replaces any existing policy.
16192 pub fn set_iam_policy(&self) -> super::builder::reservation_sub_blocks::SetIamPolicy {
16193 super::builder::reservation_sub_blocks::SetIamPolicy::new(self.inner.clone())
16194 }
16195
16196 /// Returns permissions that a caller has on the specified resource.
16197 pub fn test_iam_permissions(
16198 &self,
16199 ) -> super::builder::reservation_sub_blocks::TestIamPermissions {
16200 super::builder::reservation_sub_blocks::TestIamPermissions::new(self.inner.clone())
16201 }
16202
16203 /// Retrieves the specified zone-specific Operations resource.
16204 pub fn get_operation(&self) -> super::builder::reservation_sub_blocks::GetOperation {
16205 super::builder::reservation_sub_blocks::GetOperation::new(self.inner.clone())
16206 }
16207}
16208
16209/// Implements a client for the Google Compute Engine API.
16210///
16211/// # Example
16212/// ```
16213/// # use google_cloud_compute_v1::client::Reservations;
16214/// async fn sample(
16215/// ) -> anyhow::Result<()> {
16216/// let client = Reservations::builder().build().await?;
16217/// // use `client` to make requests to the Google Compute Engine API.
16218/// Ok(())
16219/// }
16220/// ```
16221///
16222/// # Service Description
16223///
16224/// Service for the `reservations` resource.
16225///
16226/// # Configuration
16227///
16228/// To configure `Reservations` use the `with_*` methods in the type returned
16229/// by [builder()][Reservations::builder]. The default configuration should
16230/// work for most applications. Common configuration changes include
16231///
16232/// * [with_endpoint()]: by default this client uses the global default endpoint
16233/// (`https://compute.googleapis.com`). Applications using regional
16234/// endpoints or running in restricted networks (e.g. a network configured
16235/// with [Private Google Access with VPC Service Controls]) may want to
16236/// override this default.
16237/// * [with_credentials()]: by default this client uses
16238/// [Application Default Credentials]. Applications using custom
16239/// authentication may need to override this default.
16240///
16241/// [with_endpoint()]: super::builder::reservations::ClientBuilder::with_endpoint
16242/// [with_credentials()]: super::builder::reservations::ClientBuilder::with_credentials
16243/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16244/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16245///
16246/// # Pooling and Cloning
16247///
16248/// `Reservations` holds a connection pool internally, it is advised to
16249/// create one and reuse it. You do not need to wrap `Reservations` in
16250/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16251/// already uses an `Arc` internally.
16252#[cfg(feature = "reservations")]
16253#[cfg_attr(docsrs, doc(cfg(feature = "reservations")))]
16254#[derive(Clone, Debug)]
16255pub struct Reservations {
16256 inner: std::sync::Arc<dyn super::stub::dynamic::Reservations>,
16257}
16258
16259#[cfg(feature = "reservations")]
16260impl Reservations {
16261 /// Returns a builder for [Reservations].
16262 ///
16263 /// ```
16264 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16265 /// # use google_cloud_compute_v1::client::Reservations;
16266 /// let client = Reservations::builder().build().await?;
16267 /// # Ok(()) }
16268 /// ```
16269 pub fn builder() -> super::builder::reservations::ClientBuilder {
16270 crate::new_client_builder(super::builder::reservations::client::Factory)
16271 }
16272
16273 /// Creates a new client from the provided stub.
16274 ///
16275 /// The most common case for calling this function is in tests mocking the
16276 /// client's behavior.
16277 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16278 where
16279 T: super::stub::Reservations + 'static,
16280 {
16281 Self { inner: stub.into() }
16282 }
16283
16284 pub(crate) async fn new(
16285 config: gaxi::options::ClientConfig,
16286 ) -> crate::ClientBuilderResult<Self> {
16287 let inner = Self::build_inner(config).await?;
16288 Ok(Self { inner })
16289 }
16290
16291 async fn build_inner(
16292 conf: gaxi::options::ClientConfig,
16293 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Reservations>> {
16294 if gaxi::options::tracing_enabled(&conf) {
16295 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16296 }
16297 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16298 }
16299
16300 async fn build_transport(
16301 conf: gaxi::options::ClientConfig,
16302 ) -> crate::ClientBuilderResult<impl super::stub::Reservations> {
16303 super::transport::Reservations::new(conf).await
16304 }
16305
16306 async fn build_with_tracing(
16307 conf: gaxi::options::ClientConfig,
16308 ) -> crate::ClientBuilderResult<impl super::stub::Reservations> {
16309 Self::build_transport(conf)
16310 .await
16311 .map(super::tracing::Reservations::new)
16312 }
16313
16314 /// Retrieves an aggregated list of reservations.
16315 ///
16316 /// To prevent failure, it is recommended that you set the
16317 /// `returnPartialSuccess` parameter to `true`.
16318 pub fn aggregated_list(&self) -> super::builder::reservations::AggregatedList {
16319 super::builder::reservations::AggregatedList::new(self.inner.clone())
16320 }
16321
16322 /// Deletes the specified reservation.
16323 pub fn delete(&self) -> super::builder::reservations::Delete {
16324 super::builder::reservations::Delete::new(self.inner.clone())
16325 }
16326
16327 /// Retrieves information about the specified reservation.
16328 pub fn get(&self) -> super::builder::reservations::Get {
16329 super::builder::reservations::Get::new(self.inner.clone())
16330 }
16331
16332 /// Gets the access control policy for a resource. May be empty if no such
16333 /// policy or resource exists.
16334 pub fn get_iam_policy(&self) -> super::builder::reservations::GetIamPolicy {
16335 super::builder::reservations::GetIamPolicy::new(self.inner.clone())
16336 }
16337
16338 /// Creates a new reservation. For more information, readReserving zonal
16339 /// resources.
16340 pub fn insert(&self) -> super::builder::reservations::Insert {
16341 super::builder::reservations::Insert::new(self.inner.clone())
16342 }
16343
16344 /// A list of all the reservations that have been configured for the
16345 /// specified project in specified zone.
16346 pub fn list(&self) -> super::builder::reservations::List {
16347 super::builder::reservations::List::new(self.inner.clone())
16348 }
16349
16350 /// Perform maintenance on an extended reservation
16351 pub fn perform_maintenance(&self) -> super::builder::reservations::PerformMaintenance {
16352 super::builder::reservations::PerformMaintenance::new(self.inner.clone())
16353 }
16354
16355 /// Resizes the reservation (applicable to standalone reservations only). For
16356 /// more information, readModifying
16357 /// reservations.
16358 pub fn resize(&self) -> super::builder::reservations::Resize {
16359 super::builder::reservations::Resize::new(self.inner.clone())
16360 }
16361
16362 /// Sets the access control policy on the specified resource.
16363 /// Replaces any existing policy.
16364 pub fn set_iam_policy(&self) -> super::builder::reservations::SetIamPolicy {
16365 super::builder::reservations::SetIamPolicy::new(self.inner.clone())
16366 }
16367
16368 /// Returns permissions that a caller has on the specified resource.
16369 pub fn test_iam_permissions(&self) -> super::builder::reservations::TestIamPermissions {
16370 super::builder::reservations::TestIamPermissions::new(self.inner.clone())
16371 }
16372
16373 /// Update share settings of the reservation.
16374 pub fn update(&self) -> super::builder::reservations::Update {
16375 super::builder::reservations::Update::new(self.inner.clone())
16376 }
16377
16378 /// Retrieves the specified zone-specific Operations resource.
16379 pub fn get_operation(&self) -> super::builder::reservations::GetOperation {
16380 super::builder::reservations::GetOperation::new(self.inner.clone())
16381 }
16382}
16383
16384/// Implements a client for the Google Compute Engine API.
16385///
16386/// # Example
16387/// ```
16388/// # use google_cloud_compute_v1::client::ResourcePolicies;
16389/// async fn sample(
16390/// ) -> anyhow::Result<()> {
16391/// let client = ResourcePolicies::builder().build().await?;
16392/// // use `client` to make requests to the Google Compute Engine API.
16393/// Ok(())
16394/// }
16395/// ```
16396///
16397/// # Service Description
16398///
16399/// Service for the `resourcePolicies` resource.
16400///
16401/// # Configuration
16402///
16403/// To configure `ResourcePolicies` use the `with_*` methods in the type returned
16404/// by [builder()][ResourcePolicies::builder]. The default configuration should
16405/// work for most applications. Common configuration changes include
16406///
16407/// * [with_endpoint()]: by default this client uses the global default endpoint
16408/// (`https://compute.googleapis.com`). Applications using regional
16409/// endpoints or running in restricted networks (e.g. a network configured
16410/// with [Private Google Access with VPC Service Controls]) may want to
16411/// override this default.
16412/// * [with_credentials()]: by default this client uses
16413/// [Application Default Credentials]. Applications using custom
16414/// authentication may need to override this default.
16415///
16416/// [with_endpoint()]: super::builder::resource_policies::ClientBuilder::with_endpoint
16417/// [with_credentials()]: super::builder::resource_policies::ClientBuilder::with_credentials
16418/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16419/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16420///
16421/// # Pooling and Cloning
16422///
16423/// `ResourcePolicies` holds a connection pool internally, it is advised to
16424/// create one and reuse it. You do not need to wrap `ResourcePolicies` in
16425/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16426/// already uses an `Arc` internally.
16427#[cfg(feature = "resource-policies")]
16428#[cfg_attr(docsrs, doc(cfg(feature = "resource-policies")))]
16429#[derive(Clone, Debug)]
16430pub struct ResourcePolicies {
16431 inner: std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>,
16432}
16433
16434#[cfg(feature = "resource-policies")]
16435impl ResourcePolicies {
16436 /// Returns a builder for [ResourcePolicies].
16437 ///
16438 /// ```
16439 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16440 /// # use google_cloud_compute_v1::client::ResourcePolicies;
16441 /// let client = ResourcePolicies::builder().build().await?;
16442 /// # Ok(()) }
16443 /// ```
16444 pub fn builder() -> super::builder::resource_policies::ClientBuilder {
16445 crate::new_client_builder(super::builder::resource_policies::client::Factory)
16446 }
16447
16448 /// Creates a new client from the provided stub.
16449 ///
16450 /// The most common case for calling this function is in tests mocking the
16451 /// client's behavior.
16452 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16453 where
16454 T: super::stub::ResourcePolicies + 'static,
16455 {
16456 Self { inner: stub.into() }
16457 }
16458
16459 pub(crate) async fn new(
16460 config: gaxi::options::ClientConfig,
16461 ) -> crate::ClientBuilderResult<Self> {
16462 let inner = Self::build_inner(config).await?;
16463 Ok(Self { inner })
16464 }
16465
16466 async fn build_inner(
16467 conf: gaxi::options::ClientConfig,
16468 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ResourcePolicies>>
16469 {
16470 if gaxi::options::tracing_enabled(&conf) {
16471 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16472 }
16473 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16474 }
16475
16476 async fn build_transport(
16477 conf: gaxi::options::ClientConfig,
16478 ) -> crate::ClientBuilderResult<impl super::stub::ResourcePolicies> {
16479 super::transport::ResourcePolicies::new(conf).await
16480 }
16481
16482 async fn build_with_tracing(
16483 conf: gaxi::options::ClientConfig,
16484 ) -> crate::ClientBuilderResult<impl super::stub::ResourcePolicies> {
16485 Self::build_transport(conf)
16486 .await
16487 .map(super::tracing::ResourcePolicies::new)
16488 }
16489
16490 /// Retrieves an aggregated list of resource policies.
16491 ///
16492 /// To prevent failure, Google recommends that you set the
16493 /// `returnPartialSuccess` parameter to `true`.
16494 pub fn aggregated_list(&self) -> super::builder::resource_policies::AggregatedList {
16495 super::builder::resource_policies::AggregatedList::new(self.inner.clone())
16496 }
16497
16498 /// Deletes the specified resource policy.
16499 pub fn delete(&self) -> super::builder::resource_policies::Delete {
16500 super::builder::resource_policies::Delete::new(self.inner.clone())
16501 }
16502
16503 /// Retrieves all information of the specified resource policy.
16504 pub fn get(&self) -> super::builder::resource_policies::Get {
16505 super::builder::resource_policies::Get::new(self.inner.clone())
16506 }
16507
16508 /// Gets the access control policy for a resource. May be empty if no such
16509 /// policy or resource exists.
16510 pub fn get_iam_policy(&self) -> super::builder::resource_policies::GetIamPolicy {
16511 super::builder::resource_policies::GetIamPolicy::new(self.inner.clone())
16512 }
16513
16514 /// Creates a new resource policy.
16515 pub fn insert(&self) -> super::builder::resource_policies::Insert {
16516 super::builder::resource_policies::Insert::new(self.inner.clone())
16517 }
16518
16519 /// A list all the resource policies that have been configured for the
16520 /// specified project in specified region.
16521 pub fn list(&self) -> super::builder::resource_policies::List {
16522 super::builder::resource_policies::List::new(self.inner.clone())
16523 }
16524
16525 /// Modify the specified resource policy.
16526 pub fn patch(&self) -> super::builder::resource_policies::Patch {
16527 super::builder::resource_policies::Patch::new(self.inner.clone())
16528 }
16529
16530 /// Sets the access control policy on the specified resource.
16531 /// Replaces any existing policy.
16532 pub fn set_iam_policy(&self) -> super::builder::resource_policies::SetIamPolicy {
16533 super::builder::resource_policies::SetIamPolicy::new(self.inner.clone())
16534 }
16535
16536 /// Returns permissions that a caller has on the specified resource.
16537 pub fn test_iam_permissions(&self) -> super::builder::resource_policies::TestIamPermissions {
16538 super::builder::resource_policies::TestIamPermissions::new(self.inner.clone())
16539 }
16540
16541 /// Retrieves the specified region-specific Operations resource.
16542 pub fn get_operation(&self) -> super::builder::resource_policies::GetOperation {
16543 super::builder::resource_policies::GetOperation::new(self.inner.clone())
16544 }
16545}
16546
16547/// Implements a client for the Google Compute Engine API.
16548///
16549/// # Example
16550/// ```
16551/// # use google_cloud_compute_v1::client::RolloutPlans;
16552/// async fn sample(
16553/// ) -> anyhow::Result<()> {
16554/// let client = RolloutPlans::builder().build().await?;
16555/// // use `client` to make requests to the Google Compute Engine API.
16556/// Ok(())
16557/// }
16558/// ```
16559///
16560/// # Service Description
16561///
16562/// Service for the `rolloutPlans` resource.
16563///
16564/// # Configuration
16565///
16566/// To configure `RolloutPlans` use the `with_*` methods in the type returned
16567/// by [builder()][RolloutPlans::builder]. The default configuration should
16568/// work for most applications. Common configuration changes include
16569///
16570/// * [with_endpoint()]: by default this client uses the global default endpoint
16571/// (`https://compute.googleapis.com`). Applications using regional
16572/// endpoints or running in restricted networks (e.g. a network configured
16573/// with [Private Google Access with VPC Service Controls]) may want to
16574/// override this default.
16575/// * [with_credentials()]: by default this client uses
16576/// [Application Default Credentials]. Applications using custom
16577/// authentication may need to override this default.
16578///
16579/// [with_endpoint()]: super::builder::rollout_plans::ClientBuilder::with_endpoint
16580/// [with_credentials()]: super::builder::rollout_plans::ClientBuilder::with_credentials
16581/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16582/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16583///
16584/// # Pooling and Cloning
16585///
16586/// `RolloutPlans` holds a connection pool internally, it is advised to
16587/// create one and reuse it. You do not need to wrap `RolloutPlans` in
16588/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16589/// already uses an `Arc` internally.
16590#[cfg(feature = "rollout-plans")]
16591#[cfg_attr(docsrs, doc(cfg(feature = "rollout-plans")))]
16592#[derive(Clone, Debug)]
16593pub struct RolloutPlans {
16594 inner: std::sync::Arc<dyn super::stub::dynamic::RolloutPlans>,
16595}
16596
16597#[cfg(feature = "rollout-plans")]
16598impl RolloutPlans {
16599 /// Returns a builder for [RolloutPlans].
16600 ///
16601 /// ```
16602 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16603 /// # use google_cloud_compute_v1::client::RolloutPlans;
16604 /// let client = RolloutPlans::builder().build().await?;
16605 /// # Ok(()) }
16606 /// ```
16607 pub fn builder() -> super::builder::rollout_plans::ClientBuilder {
16608 crate::new_client_builder(super::builder::rollout_plans::client::Factory)
16609 }
16610
16611 /// Creates a new client from the provided stub.
16612 ///
16613 /// The most common case for calling this function is in tests mocking the
16614 /// client's behavior.
16615 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16616 where
16617 T: super::stub::RolloutPlans + 'static,
16618 {
16619 Self { inner: stub.into() }
16620 }
16621
16622 pub(crate) async fn new(
16623 config: gaxi::options::ClientConfig,
16624 ) -> crate::ClientBuilderResult<Self> {
16625 let inner = Self::build_inner(config).await?;
16626 Ok(Self { inner })
16627 }
16628
16629 async fn build_inner(
16630 conf: gaxi::options::ClientConfig,
16631 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::RolloutPlans>> {
16632 if gaxi::options::tracing_enabled(&conf) {
16633 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16634 }
16635 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16636 }
16637
16638 async fn build_transport(
16639 conf: gaxi::options::ClientConfig,
16640 ) -> crate::ClientBuilderResult<impl super::stub::RolloutPlans> {
16641 super::transport::RolloutPlans::new(conf).await
16642 }
16643
16644 async fn build_with_tracing(
16645 conf: gaxi::options::ClientConfig,
16646 ) -> crate::ClientBuilderResult<impl super::stub::RolloutPlans> {
16647 Self::build_transport(conf)
16648 .await
16649 .map(super::tracing::RolloutPlans::new)
16650 }
16651
16652 /// Deletes a RolloutPlan.
16653 pub fn delete(&self) -> super::builder::rollout_plans::Delete {
16654 super::builder::rollout_plans::Delete::new(self.inner.clone())
16655 }
16656
16657 /// Gets details of a single project-scoped RolloutPlan.
16658 pub fn get(&self) -> super::builder::rollout_plans::Get {
16659 super::builder::rollout_plans::Get::new(self.inner.clone())
16660 }
16661
16662 /// Creates a new RolloutPlan in a given project and location.
16663 pub fn insert(&self) -> super::builder::rollout_plans::Insert {
16664 super::builder::rollout_plans::Insert::new(self.inner.clone())
16665 }
16666
16667 /// Lists RolloutPlans in a given project and location.
16668 pub fn list(&self) -> super::builder::rollout_plans::List {
16669 super::builder::rollout_plans::List::new(self.inner.clone())
16670 }
16671
16672 /// Retrieves the specified Operations resource.
16673 pub fn get_operation(&self) -> super::builder::rollout_plans::GetOperation {
16674 super::builder::rollout_plans::GetOperation::new(self.inner.clone())
16675 }
16676}
16677
16678/// Implements a client for the Google Compute Engine API.
16679///
16680/// # Example
16681/// ```
16682/// # use google_cloud_compute_v1::client::Rollouts;
16683/// async fn sample(
16684/// ) -> anyhow::Result<()> {
16685/// let client = Rollouts::builder().build().await?;
16686/// // use `client` to make requests to the Google Compute Engine API.
16687/// Ok(())
16688/// }
16689/// ```
16690///
16691/// # Service Description
16692///
16693/// Service for the `rollouts` resource.
16694///
16695/// # Configuration
16696///
16697/// To configure `Rollouts` use the `with_*` methods in the type returned
16698/// by [builder()][Rollouts::builder]. The default configuration should
16699/// work for most applications. Common configuration changes include
16700///
16701/// * [with_endpoint()]: by default this client uses the global default endpoint
16702/// (`https://compute.googleapis.com`). Applications using regional
16703/// endpoints or running in restricted networks (e.g. a network configured
16704/// with [Private Google Access with VPC Service Controls]) may want to
16705/// override this default.
16706/// * [with_credentials()]: by default this client uses
16707/// [Application Default Credentials]. Applications using custom
16708/// authentication may need to override this default.
16709///
16710/// [with_endpoint()]: super::builder::rollouts::ClientBuilder::with_endpoint
16711/// [with_credentials()]: super::builder::rollouts::ClientBuilder::with_credentials
16712/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16713/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16714///
16715/// # Pooling and Cloning
16716///
16717/// `Rollouts` holds a connection pool internally, it is advised to
16718/// create one and reuse it. You do not need to wrap `Rollouts` in
16719/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16720/// already uses an `Arc` internally.
16721#[cfg(feature = "rollouts")]
16722#[cfg_attr(docsrs, doc(cfg(feature = "rollouts")))]
16723#[derive(Clone, Debug)]
16724pub struct Rollouts {
16725 inner: std::sync::Arc<dyn super::stub::dynamic::Rollouts>,
16726}
16727
16728#[cfg(feature = "rollouts")]
16729impl Rollouts {
16730 /// Returns a builder for [Rollouts].
16731 ///
16732 /// ```
16733 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16734 /// # use google_cloud_compute_v1::client::Rollouts;
16735 /// let client = Rollouts::builder().build().await?;
16736 /// # Ok(()) }
16737 /// ```
16738 pub fn builder() -> super::builder::rollouts::ClientBuilder {
16739 crate::new_client_builder(super::builder::rollouts::client::Factory)
16740 }
16741
16742 /// Creates a new client from the provided stub.
16743 ///
16744 /// The most common case for calling this function is in tests mocking the
16745 /// client's behavior.
16746 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16747 where
16748 T: super::stub::Rollouts + 'static,
16749 {
16750 Self { inner: stub.into() }
16751 }
16752
16753 pub(crate) async fn new(
16754 config: gaxi::options::ClientConfig,
16755 ) -> crate::ClientBuilderResult<Self> {
16756 let inner = Self::build_inner(config).await?;
16757 Ok(Self { inner })
16758 }
16759
16760 async fn build_inner(
16761 conf: gaxi::options::ClientConfig,
16762 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Rollouts>> {
16763 if gaxi::options::tracing_enabled(&conf) {
16764 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16765 }
16766 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16767 }
16768
16769 async fn build_transport(
16770 conf: gaxi::options::ClientConfig,
16771 ) -> crate::ClientBuilderResult<impl super::stub::Rollouts> {
16772 super::transport::Rollouts::new(conf).await
16773 }
16774
16775 async fn build_with_tracing(
16776 conf: gaxi::options::ClientConfig,
16777 ) -> crate::ClientBuilderResult<impl super::stub::Rollouts> {
16778 Self::build_transport(conf)
16779 .await
16780 .map(super::tracing::Rollouts::new)
16781 }
16782
16783 /// Advances a Rollout to the next wave, or completes it if no waves remain.
16784 pub fn advance(&self) -> super::builder::rollouts::Advance {
16785 super::builder::rollouts::Advance::new(self.inner.clone())
16786 }
16787
16788 /// Cancels a Rollout.
16789 pub fn cancel(&self) -> super::builder::rollouts::Cancel {
16790 super::builder::rollouts::Cancel::new(self.inner.clone())
16791 }
16792
16793 /// Deletes a Rollout.
16794 pub fn delete(&self) -> super::builder::rollouts::Delete {
16795 super::builder::rollouts::Delete::new(self.inner.clone())
16796 }
16797
16798 /// Gets details of a single project-scoped Rollout.
16799 pub fn get(&self) -> super::builder::rollouts::Get {
16800 super::builder::rollouts::Get::new(self.inner.clone())
16801 }
16802
16803 /// Lists Rollouts in a given project and location.
16804 pub fn list(&self) -> super::builder::rollouts::List {
16805 super::builder::rollouts::List::new(self.inner.clone())
16806 }
16807
16808 /// Pauses a Rollout.
16809 pub fn pause(&self) -> super::builder::rollouts::Pause {
16810 super::builder::rollouts::Pause::new(self.inner.clone())
16811 }
16812
16813 /// Resumes a Rollout.
16814 pub fn resume(&self) -> super::builder::rollouts::Resume {
16815 super::builder::rollouts::Resume::new(self.inner.clone())
16816 }
16817
16818 /// Retrieves the specified Operations resource.
16819 pub fn get_operation(&self) -> super::builder::rollouts::GetOperation {
16820 super::builder::rollouts::GetOperation::new(self.inner.clone())
16821 }
16822}
16823
16824/// Implements a client for the Google Compute Engine API.
16825///
16826/// # Example
16827/// ```
16828/// # use google_cloud_compute_v1::client::Routers;
16829/// async fn sample(
16830/// ) -> anyhow::Result<()> {
16831/// let client = Routers::builder().build().await?;
16832/// // use `client` to make requests to the Google Compute Engine API.
16833/// Ok(())
16834/// }
16835/// ```
16836///
16837/// # Service Description
16838///
16839/// Service for the `routers` resource.
16840///
16841/// # Configuration
16842///
16843/// To configure `Routers` use the `with_*` methods in the type returned
16844/// by [builder()][Routers::builder]. The default configuration should
16845/// work for most applications. Common configuration changes include
16846///
16847/// * [with_endpoint()]: by default this client uses the global default endpoint
16848/// (`https://compute.googleapis.com`). Applications using regional
16849/// endpoints or running in restricted networks (e.g. a network configured
16850/// with [Private Google Access with VPC Service Controls]) may want to
16851/// override this default.
16852/// * [with_credentials()]: by default this client uses
16853/// [Application Default Credentials]. Applications using custom
16854/// authentication may need to override this default.
16855///
16856/// [with_endpoint()]: super::builder::routers::ClientBuilder::with_endpoint
16857/// [with_credentials()]: super::builder::routers::ClientBuilder::with_credentials
16858/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
16859/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
16860///
16861/// # Pooling and Cloning
16862///
16863/// `Routers` holds a connection pool internally, it is advised to
16864/// create one and reuse it. You do not need to wrap `Routers` in
16865/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
16866/// already uses an `Arc` internally.
16867#[cfg(feature = "routers")]
16868#[cfg_attr(docsrs, doc(cfg(feature = "routers")))]
16869#[derive(Clone, Debug)]
16870pub struct Routers {
16871 inner: std::sync::Arc<dyn super::stub::dynamic::Routers>,
16872}
16873
16874#[cfg(feature = "routers")]
16875impl Routers {
16876 /// Returns a builder for [Routers].
16877 ///
16878 /// ```
16879 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16880 /// # use google_cloud_compute_v1::client::Routers;
16881 /// let client = Routers::builder().build().await?;
16882 /// # Ok(()) }
16883 /// ```
16884 pub fn builder() -> super::builder::routers::ClientBuilder {
16885 crate::new_client_builder(super::builder::routers::client::Factory)
16886 }
16887
16888 /// Creates a new client from the provided stub.
16889 ///
16890 /// The most common case for calling this function is in tests mocking the
16891 /// client's behavior.
16892 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
16893 where
16894 T: super::stub::Routers + 'static,
16895 {
16896 Self { inner: stub.into() }
16897 }
16898
16899 pub(crate) async fn new(
16900 config: gaxi::options::ClientConfig,
16901 ) -> crate::ClientBuilderResult<Self> {
16902 let inner = Self::build_inner(config).await?;
16903 Ok(Self { inner })
16904 }
16905
16906 async fn build_inner(
16907 conf: gaxi::options::ClientConfig,
16908 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Routers>> {
16909 if gaxi::options::tracing_enabled(&conf) {
16910 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
16911 }
16912 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
16913 }
16914
16915 async fn build_transport(
16916 conf: gaxi::options::ClientConfig,
16917 ) -> crate::ClientBuilderResult<impl super::stub::Routers> {
16918 super::transport::Routers::new(conf).await
16919 }
16920
16921 async fn build_with_tracing(
16922 conf: gaxi::options::ClientConfig,
16923 ) -> crate::ClientBuilderResult<impl super::stub::Routers> {
16924 Self::build_transport(conf)
16925 .await
16926 .map(super::tracing::Routers::new)
16927 }
16928
16929 /// Retrieves an aggregated list of routers.
16930 ///
16931 /// To prevent failure, Google recommends that you set the
16932 /// `returnPartialSuccess` parameter to `true`.
16933 pub fn aggregated_list(&self) -> super::builder::routers::AggregatedList {
16934 super::builder::routers::AggregatedList::new(self.inner.clone())
16935 }
16936
16937 /// Deletes the specified Router resource.
16938 pub fn delete(&self) -> super::builder::routers::Delete {
16939 super::builder::routers::Delete::new(self.inner.clone())
16940 }
16941
16942 /// Deletes Named Set
16943 pub fn delete_named_set(&self) -> super::builder::routers::DeleteNamedSet {
16944 super::builder::routers::DeleteNamedSet::new(self.inner.clone())
16945 }
16946
16947 /// Deletes Route Policy
16948 pub fn delete_route_policy(&self) -> super::builder::routers::DeleteRoutePolicy {
16949 super::builder::routers::DeleteRoutePolicy::new(self.inner.clone())
16950 }
16951
16952 /// Returns the specified Router resource.
16953 pub fn get(&self) -> super::builder::routers::Get {
16954 super::builder::routers::Get::new(self.inner.clone())
16955 }
16956
16957 /// Returns specified Named Set
16958 pub fn get_named_set(&self) -> super::builder::routers::GetNamedSet {
16959 super::builder::routers::GetNamedSet::new(self.inner.clone())
16960 }
16961
16962 /// Retrieves runtime NAT IP information.
16963 pub fn get_nat_ip_info(&self) -> super::builder::routers::GetNatIpInfo {
16964 super::builder::routers::GetNatIpInfo::new(self.inner.clone())
16965 }
16966
16967 /// Retrieves runtime Nat mapping information of VM endpoints.
16968 pub fn get_nat_mapping_info(&self) -> super::builder::routers::GetNatMappingInfo {
16969 super::builder::routers::GetNatMappingInfo::new(self.inner.clone())
16970 }
16971
16972 /// Returns specified Route Policy
16973 pub fn get_route_policy(&self) -> super::builder::routers::GetRoutePolicy {
16974 super::builder::routers::GetRoutePolicy::new(self.inner.clone())
16975 }
16976
16977 /// Retrieves runtime information of the specified router.
16978 pub fn get_router_status(&self) -> super::builder::routers::GetRouterStatus {
16979 super::builder::routers::GetRouterStatus::new(self.inner.clone())
16980 }
16981
16982 /// Creates a Router resource in the specified project and region using
16983 /// the data included in the request.
16984 pub fn insert(&self) -> super::builder::routers::Insert {
16985 super::builder::routers::Insert::new(self.inner.clone())
16986 }
16987
16988 /// Retrieves a list of Router resources available to the specified project.
16989 pub fn list(&self) -> super::builder::routers::List {
16990 super::builder::routers::List::new(self.inner.clone())
16991 }
16992
16993 /// Retrieves a list of router bgp routes available to the specified project.
16994 pub fn list_bgp_routes(&self) -> super::builder::routers::ListBgpRoutes {
16995 super::builder::routers::ListBgpRoutes::new(self.inner.clone())
16996 }
16997
16998 /// Retrieves a list of router named set subresources available to the
16999 /// specified project.
17000 pub fn list_named_sets(&self) -> super::builder::routers::ListNamedSets {
17001 super::builder::routers::ListNamedSets::new(self.inner.clone())
17002 }
17003
17004 /// Retrieves a list of router route policy subresources available to the
17005 /// specified project.
17006 pub fn list_route_policies(&self) -> super::builder::routers::ListRoutePolicies {
17007 super::builder::routers::ListRoutePolicies::new(self.inner.clone())
17008 }
17009
17010 /// Patches the specified Router resource with the data included in the
17011 /// request. This method supportsPATCH
17012 /// semantics and usesJSON merge
17013 /// patch format and processing rules.
17014 pub fn patch(&self) -> super::builder::routers::Patch {
17015 super::builder::routers::Patch::new(self.inner.clone())
17016 }
17017
17018 /// Patches Named Set
17019 pub fn patch_named_set(&self) -> super::builder::routers::PatchNamedSet {
17020 super::builder::routers::PatchNamedSet::new(self.inner.clone())
17021 }
17022
17023 /// Patches Route Policy
17024 pub fn patch_route_policy(&self) -> super::builder::routers::PatchRoutePolicy {
17025 super::builder::routers::PatchRoutePolicy::new(self.inner.clone())
17026 }
17027
17028 /// Preview fields auto-generated during router create andupdate operations.
17029 /// Calling this method does NOT create or update the router.
17030 pub fn preview(&self) -> super::builder::routers::Preview {
17031 super::builder::routers::Preview::new(self.inner.clone())
17032 }
17033
17034 /// Updates the specified Router resource with the data included in the
17035 /// request. This method conforms toPUT semantics, which requests that the state of the
17036 /// target resource be created or replaced with the state defined by the
17037 /// representation enclosed in the request message payload.
17038 pub fn update(&self) -> super::builder::routers::Update {
17039 super::builder::routers::Update::new(self.inner.clone())
17040 }
17041
17042 /// Updates or creates new Named Set
17043 pub fn update_named_set(&self) -> super::builder::routers::UpdateNamedSet {
17044 super::builder::routers::UpdateNamedSet::new(self.inner.clone())
17045 }
17046
17047 /// Updates or creates new Route Policy
17048 pub fn update_route_policy(&self) -> super::builder::routers::UpdateRoutePolicy {
17049 super::builder::routers::UpdateRoutePolicy::new(self.inner.clone())
17050 }
17051
17052 /// Retrieves the specified region-specific Operations resource.
17053 pub fn get_operation(&self) -> super::builder::routers::GetOperation {
17054 super::builder::routers::GetOperation::new(self.inner.clone())
17055 }
17056}
17057
17058/// Implements a client for the Google Compute Engine API.
17059///
17060/// # Example
17061/// ```
17062/// # use google_cloud_compute_v1::client::Routes;
17063/// async fn sample(
17064/// ) -> anyhow::Result<()> {
17065/// let client = Routes::builder().build().await?;
17066/// // use `client` to make requests to the Google Compute Engine API.
17067/// Ok(())
17068/// }
17069/// ```
17070///
17071/// # Service Description
17072///
17073/// Service for the `routes` resource.
17074///
17075/// # Configuration
17076///
17077/// To configure `Routes` use the `with_*` methods in the type returned
17078/// by [builder()][Routes::builder]. The default configuration should
17079/// work for most applications. Common configuration changes include
17080///
17081/// * [with_endpoint()]: by default this client uses the global default endpoint
17082/// (`https://compute.googleapis.com`). Applications using regional
17083/// endpoints or running in restricted networks (e.g. a network configured
17084/// with [Private Google Access with VPC Service Controls]) may want to
17085/// override this default.
17086/// * [with_credentials()]: by default this client uses
17087/// [Application Default Credentials]. Applications using custom
17088/// authentication may need to override this default.
17089///
17090/// [with_endpoint()]: super::builder::routes::ClientBuilder::with_endpoint
17091/// [with_credentials()]: super::builder::routes::ClientBuilder::with_credentials
17092/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17093/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17094///
17095/// # Pooling and Cloning
17096///
17097/// `Routes` holds a connection pool internally, it is advised to
17098/// create one and reuse it. You do not need to wrap `Routes` in
17099/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17100/// already uses an `Arc` internally.
17101#[cfg(feature = "routes")]
17102#[cfg_attr(docsrs, doc(cfg(feature = "routes")))]
17103#[derive(Clone, Debug)]
17104pub struct Routes {
17105 inner: std::sync::Arc<dyn super::stub::dynamic::Routes>,
17106}
17107
17108#[cfg(feature = "routes")]
17109impl Routes {
17110 /// Returns a builder for [Routes].
17111 ///
17112 /// ```
17113 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17114 /// # use google_cloud_compute_v1::client::Routes;
17115 /// let client = Routes::builder().build().await?;
17116 /// # Ok(()) }
17117 /// ```
17118 pub fn builder() -> super::builder::routes::ClientBuilder {
17119 crate::new_client_builder(super::builder::routes::client::Factory)
17120 }
17121
17122 /// Creates a new client from the provided stub.
17123 ///
17124 /// The most common case for calling this function is in tests mocking the
17125 /// client's behavior.
17126 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17127 where
17128 T: super::stub::Routes + 'static,
17129 {
17130 Self { inner: stub.into() }
17131 }
17132
17133 pub(crate) async fn new(
17134 config: gaxi::options::ClientConfig,
17135 ) -> crate::ClientBuilderResult<Self> {
17136 let inner = Self::build_inner(config).await?;
17137 Ok(Self { inner })
17138 }
17139
17140 async fn build_inner(
17141 conf: gaxi::options::ClientConfig,
17142 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Routes>> {
17143 if gaxi::options::tracing_enabled(&conf) {
17144 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17145 }
17146 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17147 }
17148
17149 async fn build_transport(
17150 conf: gaxi::options::ClientConfig,
17151 ) -> crate::ClientBuilderResult<impl super::stub::Routes> {
17152 super::transport::Routes::new(conf).await
17153 }
17154
17155 async fn build_with_tracing(
17156 conf: gaxi::options::ClientConfig,
17157 ) -> crate::ClientBuilderResult<impl super::stub::Routes> {
17158 Self::build_transport(conf)
17159 .await
17160 .map(super::tracing::Routes::new)
17161 }
17162
17163 /// Deletes the specified Route resource.
17164 pub fn delete(&self) -> super::builder::routes::Delete {
17165 super::builder::routes::Delete::new(self.inner.clone())
17166 }
17167
17168 /// Returns the specified Route resource.
17169 pub fn get(&self) -> super::builder::routes::Get {
17170 super::builder::routes::Get::new(self.inner.clone())
17171 }
17172
17173 /// Creates a Route resource in the specified project using the data included
17174 /// in the request.
17175 pub fn insert(&self) -> super::builder::routes::Insert {
17176 super::builder::routes::Insert::new(self.inner.clone())
17177 }
17178
17179 /// Retrieves the list of Route resources available to the specified project.
17180 pub fn list(&self) -> super::builder::routes::List {
17181 super::builder::routes::List::new(self.inner.clone())
17182 }
17183
17184 /// Returns permissions that a caller has on the specified resource.
17185 pub fn test_iam_permissions(&self) -> super::builder::routes::TestIamPermissions {
17186 super::builder::routes::TestIamPermissions::new(self.inner.clone())
17187 }
17188
17189 /// Retrieves the specified Operations resource.
17190 pub fn get_operation(&self) -> super::builder::routes::GetOperation {
17191 super::builder::routes::GetOperation::new(self.inner.clone())
17192 }
17193}
17194
17195/// Implements a client for the Google Compute Engine API.
17196///
17197/// # Example
17198/// ```
17199/// # use google_cloud_compute_v1::client::SecurityPolicies;
17200/// async fn sample(
17201/// ) -> anyhow::Result<()> {
17202/// let client = SecurityPolicies::builder().build().await?;
17203/// // use `client` to make requests to the Google Compute Engine API.
17204/// Ok(())
17205/// }
17206/// ```
17207///
17208/// # Service Description
17209///
17210/// Service for the `securityPolicies` resource.
17211///
17212/// # Configuration
17213///
17214/// To configure `SecurityPolicies` use the `with_*` methods in the type returned
17215/// by [builder()][SecurityPolicies::builder]. The default configuration should
17216/// work for most applications. Common configuration changes include
17217///
17218/// * [with_endpoint()]: by default this client uses the global default endpoint
17219/// (`https://compute.googleapis.com`). Applications using regional
17220/// endpoints or running in restricted networks (e.g. a network configured
17221/// with [Private Google Access with VPC Service Controls]) may want to
17222/// override this default.
17223/// * [with_credentials()]: by default this client uses
17224/// [Application Default Credentials]. Applications using custom
17225/// authentication may need to override this default.
17226///
17227/// [with_endpoint()]: super::builder::security_policies::ClientBuilder::with_endpoint
17228/// [with_credentials()]: super::builder::security_policies::ClientBuilder::with_credentials
17229/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17230/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17231///
17232/// # Pooling and Cloning
17233///
17234/// `SecurityPolicies` holds a connection pool internally, it is advised to
17235/// create one and reuse it. You do not need to wrap `SecurityPolicies` in
17236/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17237/// already uses an `Arc` internally.
17238#[cfg(feature = "security-policies")]
17239#[cfg_attr(docsrs, doc(cfg(feature = "security-policies")))]
17240#[derive(Clone, Debug)]
17241pub struct SecurityPolicies {
17242 inner: std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>,
17243}
17244
17245#[cfg(feature = "security-policies")]
17246impl SecurityPolicies {
17247 /// Returns a builder for [SecurityPolicies].
17248 ///
17249 /// ```
17250 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17251 /// # use google_cloud_compute_v1::client::SecurityPolicies;
17252 /// let client = SecurityPolicies::builder().build().await?;
17253 /// # Ok(()) }
17254 /// ```
17255 pub fn builder() -> super::builder::security_policies::ClientBuilder {
17256 crate::new_client_builder(super::builder::security_policies::client::Factory)
17257 }
17258
17259 /// Creates a new client from the provided stub.
17260 ///
17261 /// The most common case for calling this function is in tests mocking the
17262 /// client's behavior.
17263 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17264 where
17265 T: super::stub::SecurityPolicies + 'static,
17266 {
17267 Self { inner: stub.into() }
17268 }
17269
17270 pub(crate) async fn new(
17271 config: gaxi::options::ClientConfig,
17272 ) -> crate::ClientBuilderResult<Self> {
17273 let inner = Self::build_inner(config).await?;
17274 Ok(Self { inner })
17275 }
17276
17277 async fn build_inner(
17278 conf: gaxi::options::ClientConfig,
17279 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SecurityPolicies>>
17280 {
17281 if gaxi::options::tracing_enabled(&conf) {
17282 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17283 }
17284 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17285 }
17286
17287 async fn build_transport(
17288 conf: gaxi::options::ClientConfig,
17289 ) -> crate::ClientBuilderResult<impl super::stub::SecurityPolicies> {
17290 super::transport::SecurityPolicies::new(conf).await
17291 }
17292
17293 async fn build_with_tracing(
17294 conf: gaxi::options::ClientConfig,
17295 ) -> crate::ClientBuilderResult<impl super::stub::SecurityPolicies> {
17296 Self::build_transport(conf)
17297 .await
17298 .map(super::tracing::SecurityPolicies::new)
17299 }
17300
17301 /// Inserts a rule into a security policy.
17302 pub fn add_rule(&self) -> super::builder::security_policies::AddRule {
17303 super::builder::security_policies::AddRule::new(self.inner.clone())
17304 }
17305
17306 /// Retrieves the list of all SecurityPolicy resources, regional and global,
17307 /// available to the specified project.
17308 ///
17309 /// To prevent failure, Google recommends that you set the
17310 /// `returnPartialSuccess` parameter to `true`.
17311 pub fn aggregated_list(&self) -> super::builder::security_policies::AggregatedList {
17312 super::builder::security_policies::AggregatedList::new(self.inner.clone())
17313 }
17314
17315 /// Deletes the specified policy.
17316 pub fn delete(&self) -> super::builder::security_policies::Delete {
17317 super::builder::security_policies::Delete::new(self.inner.clone())
17318 }
17319
17320 /// List all of the ordered rules present in a single specified policy.
17321 pub fn get(&self) -> super::builder::security_policies::Get {
17322 super::builder::security_policies::Get::new(self.inner.clone())
17323 }
17324
17325 /// Gets a rule at the specified priority.
17326 pub fn get_rule(&self) -> super::builder::security_policies::GetRule {
17327 super::builder::security_policies::GetRule::new(self.inner.clone())
17328 }
17329
17330 /// Creates a new policy in the specified project using the data included in
17331 /// the request.
17332 pub fn insert(&self) -> super::builder::security_policies::Insert {
17333 super::builder::security_policies::Insert::new(self.inner.clone())
17334 }
17335
17336 /// List all the policies that have been configured for the specified project.
17337 pub fn list(&self) -> super::builder::security_policies::List {
17338 super::builder::security_policies::List::new(self.inner.clone())
17339 }
17340
17341 /// Gets the current list of preconfigured Web Application Firewall (WAF)
17342 /// expressions.
17343 pub fn list_preconfigured_expression_sets(
17344 &self,
17345 ) -> super::builder::security_policies::ListPreconfiguredExpressionSets {
17346 super::builder::security_policies::ListPreconfiguredExpressionSets::new(self.inner.clone())
17347 }
17348
17349 /// Patches the specified policy with the data included in the request. To
17350 /// clear fields in the policy, leave the fields empty and specify them in the
17351 /// updateMask. This cannot be used to be update the rules in the policy.
17352 /// Please use the per rule methods like addRule, patchRule, and removeRule
17353 /// instead.
17354 pub fn patch(&self) -> super::builder::security_policies::Patch {
17355 super::builder::security_policies::Patch::new(self.inner.clone())
17356 }
17357
17358 /// Patches a rule at the specified priority. To clear fields in the rule,
17359 /// leave the fields empty and specify them in the updateMask.
17360 pub fn patch_rule(&self) -> super::builder::security_policies::PatchRule {
17361 super::builder::security_policies::PatchRule::new(self.inner.clone())
17362 }
17363
17364 /// Deletes a rule at the specified priority.
17365 pub fn remove_rule(&self) -> super::builder::security_policies::RemoveRule {
17366 super::builder::security_policies::RemoveRule::new(self.inner.clone())
17367 }
17368
17369 /// Sets the labels on a security policy. To learn more about labels,
17370 /// read the Labeling Resources
17371 /// documentation.
17372 pub fn set_labels(&self) -> super::builder::security_policies::SetLabels {
17373 super::builder::security_policies::SetLabels::new(self.inner.clone())
17374 }
17375
17376 /// Retrieves the specified Operations resource.
17377 pub fn get_operation(&self) -> super::builder::security_policies::GetOperation {
17378 super::builder::security_policies::GetOperation::new(self.inner.clone())
17379 }
17380}
17381
17382/// Implements a client for the Google Compute Engine API.
17383///
17384/// # Example
17385/// ```
17386/// # use google_cloud_compute_v1::client::ServiceAttachments;
17387/// async fn sample(
17388/// ) -> anyhow::Result<()> {
17389/// let client = ServiceAttachments::builder().build().await?;
17390/// // use `client` to make requests to the Google Compute Engine API.
17391/// Ok(())
17392/// }
17393/// ```
17394///
17395/// # Service Description
17396///
17397/// Service for the `serviceAttachments` resource.
17398///
17399/// # Configuration
17400///
17401/// To configure `ServiceAttachments` use the `with_*` methods in the type returned
17402/// by [builder()][ServiceAttachments::builder]. The default configuration should
17403/// work for most applications. Common configuration changes include
17404///
17405/// * [with_endpoint()]: by default this client uses the global default endpoint
17406/// (`https://compute.googleapis.com`). Applications using regional
17407/// endpoints or running in restricted networks (e.g. a network configured
17408/// with [Private Google Access with VPC Service Controls]) may want to
17409/// override this default.
17410/// * [with_credentials()]: by default this client uses
17411/// [Application Default Credentials]. Applications using custom
17412/// authentication may need to override this default.
17413///
17414/// [with_endpoint()]: super::builder::service_attachments::ClientBuilder::with_endpoint
17415/// [with_credentials()]: super::builder::service_attachments::ClientBuilder::with_credentials
17416/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17417/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17418///
17419/// # Pooling and Cloning
17420///
17421/// `ServiceAttachments` holds a connection pool internally, it is advised to
17422/// create one and reuse it. You do not need to wrap `ServiceAttachments` in
17423/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17424/// already uses an `Arc` internally.
17425#[cfg(feature = "service-attachments")]
17426#[cfg_attr(docsrs, doc(cfg(feature = "service-attachments")))]
17427#[derive(Clone, Debug)]
17428pub struct ServiceAttachments {
17429 inner: std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>,
17430}
17431
17432#[cfg(feature = "service-attachments")]
17433impl ServiceAttachments {
17434 /// Returns a builder for [ServiceAttachments].
17435 ///
17436 /// ```
17437 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17438 /// # use google_cloud_compute_v1::client::ServiceAttachments;
17439 /// let client = ServiceAttachments::builder().build().await?;
17440 /// # Ok(()) }
17441 /// ```
17442 pub fn builder() -> super::builder::service_attachments::ClientBuilder {
17443 crate::new_client_builder(super::builder::service_attachments::client::Factory)
17444 }
17445
17446 /// Creates a new client from the provided stub.
17447 ///
17448 /// The most common case for calling this function is in tests mocking the
17449 /// client's behavior.
17450 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17451 where
17452 T: super::stub::ServiceAttachments + 'static,
17453 {
17454 Self { inner: stub.into() }
17455 }
17456
17457 pub(crate) async fn new(
17458 config: gaxi::options::ClientConfig,
17459 ) -> crate::ClientBuilderResult<Self> {
17460 let inner = Self::build_inner(config).await?;
17461 Ok(Self { inner })
17462 }
17463
17464 async fn build_inner(
17465 conf: gaxi::options::ClientConfig,
17466 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ServiceAttachments>>
17467 {
17468 if gaxi::options::tracing_enabled(&conf) {
17469 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17470 }
17471 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17472 }
17473
17474 async fn build_transport(
17475 conf: gaxi::options::ClientConfig,
17476 ) -> crate::ClientBuilderResult<impl super::stub::ServiceAttachments> {
17477 super::transport::ServiceAttachments::new(conf).await
17478 }
17479
17480 async fn build_with_tracing(
17481 conf: gaxi::options::ClientConfig,
17482 ) -> crate::ClientBuilderResult<impl super::stub::ServiceAttachments> {
17483 Self::build_transport(conf)
17484 .await
17485 .map(super::tracing::ServiceAttachments::new)
17486 }
17487
17488 /// Retrieves the list of all ServiceAttachment resources,
17489 /// regional and global, available to the specified project.
17490 ///
17491 /// To prevent failure, Google recommends that you set the
17492 /// `returnPartialSuccess` parameter to `true`.
17493 pub fn aggregated_list(&self) -> super::builder::service_attachments::AggregatedList {
17494 super::builder::service_attachments::AggregatedList::new(self.inner.clone())
17495 }
17496
17497 /// Deletes the specified ServiceAttachment in the given scope
17498 pub fn delete(&self) -> super::builder::service_attachments::Delete {
17499 super::builder::service_attachments::Delete::new(self.inner.clone())
17500 }
17501
17502 /// Returns the specified ServiceAttachment resource in the given scope.
17503 pub fn get(&self) -> super::builder::service_attachments::Get {
17504 super::builder::service_attachments::Get::new(self.inner.clone())
17505 }
17506
17507 /// Gets the access control policy for a resource. May be empty if no such
17508 /// policy or resource exists.
17509 pub fn get_iam_policy(&self) -> super::builder::service_attachments::GetIamPolicy {
17510 super::builder::service_attachments::GetIamPolicy::new(self.inner.clone())
17511 }
17512
17513 /// Creates a ServiceAttachment in the specified project in the given scope
17514 /// using the parameters that are included in the request.
17515 pub fn insert(&self) -> super::builder::service_attachments::Insert {
17516 super::builder::service_attachments::Insert::new(self.inner.clone())
17517 }
17518
17519 /// Lists the ServiceAttachments for a project in the given scope.
17520 pub fn list(&self) -> super::builder::service_attachments::List {
17521 super::builder::service_attachments::List::new(self.inner.clone())
17522 }
17523
17524 /// Patches the specified ServiceAttachment resource with the data included in
17525 /// the request. This method supports PATCH
17526 /// semantics and usesJSON merge
17527 /// patch format and processing rules.
17528 pub fn patch(&self) -> super::builder::service_attachments::Patch {
17529 super::builder::service_attachments::Patch::new(self.inner.clone())
17530 }
17531
17532 /// Sets the access control policy on the specified resource.
17533 /// Replaces any existing policy.
17534 pub fn set_iam_policy(&self) -> super::builder::service_attachments::SetIamPolicy {
17535 super::builder::service_attachments::SetIamPolicy::new(self.inner.clone())
17536 }
17537
17538 /// Returns permissions that a caller has on the specified resource.
17539 pub fn test_iam_permissions(&self) -> super::builder::service_attachments::TestIamPermissions {
17540 super::builder::service_attachments::TestIamPermissions::new(self.inner.clone())
17541 }
17542
17543 /// Retrieves the specified region-specific Operations resource.
17544 pub fn get_operation(&self) -> super::builder::service_attachments::GetOperation {
17545 super::builder::service_attachments::GetOperation::new(self.inner.clone())
17546 }
17547}
17548
17549/// Implements a client for the Google Compute Engine API.
17550///
17551/// # Example
17552/// ```
17553/// # use google_cloud_compute_v1::client::SnapshotSettings;
17554/// async fn sample(
17555/// ) -> anyhow::Result<()> {
17556/// let client = SnapshotSettings::builder().build().await?;
17557/// // use `client` to make requests to the Google Compute Engine API.
17558/// Ok(())
17559/// }
17560/// ```
17561///
17562/// # Service Description
17563///
17564/// Service for the `snapshotSettings` resource.
17565///
17566/// # Configuration
17567///
17568/// To configure `SnapshotSettings` use the `with_*` methods in the type returned
17569/// by [builder()][SnapshotSettings::builder]. The default configuration should
17570/// work for most applications. Common configuration changes include
17571///
17572/// * [with_endpoint()]: by default this client uses the global default endpoint
17573/// (`https://compute.googleapis.com`). Applications using regional
17574/// endpoints or running in restricted networks (e.g. a network configured
17575/// with [Private Google Access with VPC Service Controls]) may want to
17576/// override this default.
17577/// * [with_credentials()]: by default this client uses
17578/// [Application Default Credentials]. Applications using custom
17579/// authentication may need to override this default.
17580///
17581/// [with_endpoint()]: super::builder::snapshot_settings::ClientBuilder::with_endpoint
17582/// [with_credentials()]: super::builder::snapshot_settings::ClientBuilder::with_credentials
17583/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17584/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17585///
17586/// # Pooling and Cloning
17587///
17588/// `SnapshotSettings` holds a connection pool internally, it is advised to
17589/// create one and reuse it. You do not need to wrap `SnapshotSettings` in
17590/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17591/// already uses an `Arc` internally.
17592#[cfg(feature = "snapshot-settings")]
17593#[cfg_attr(docsrs, doc(cfg(feature = "snapshot-settings")))]
17594#[derive(Clone, Debug)]
17595pub struct SnapshotSettings {
17596 inner: std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>,
17597}
17598
17599#[cfg(feature = "snapshot-settings")]
17600impl SnapshotSettings {
17601 /// Returns a builder for [SnapshotSettings].
17602 ///
17603 /// ```
17604 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17605 /// # use google_cloud_compute_v1::client::SnapshotSettings;
17606 /// let client = SnapshotSettings::builder().build().await?;
17607 /// # Ok(()) }
17608 /// ```
17609 pub fn builder() -> super::builder::snapshot_settings::ClientBuilder {
17610 crate::new_client_builder(super::builder::snapshot_settings::client::Factory)
17611 }
17612
17613 /// Creates a new client from the provided stub.
17614 ///
17615 /// The most common case for calling this function is in tests mocking the
17616 /// client's behavior.
17617 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17618 where
17619 T: super::stub::SnapshotSettings + 'static,
17620 {
17621 Self { inner: stub.into() }
17622 }
17623
17624 pub(crate) async fn new(
17625 config: gaxi::options::ClientConfig,
17626 ) -> crate::ClientBuilderResult<Self> {
17627 let inner = Self::build_inner(config).await?;
17628 Ok(Self { inner })
17629 }
17630
17631 async fn build_inner(
17632 conf: gaxi::options::ClientConfig,
17633 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SnapshotSettings>>
17634 {
17635 if gaxi::options::tracing_enabled(&conf) {
17636 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17637 }
17638 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17639 }
17640
17641 async fn build_transport(
17642 conf: gaxi::options::ClientConfig,
17643 ) -> crate::ClientBuilderResult<impl super::stub::SnapshotSettings> {
17644 super::transport::SnapshotSettings::new(conf).await
17645 }
17646
17647 async fn build_with_tracing(
17648 conf: gaxi::options::ClientConfig,
17649 ) -> crate::ClientBuilderResult<impl super::stub::SnapshotSettings> {
17650 Self::build_transport(conf)
17651 .await
17652 .map(super::tracing::SnapshotSettings::new)
17653 }
17654
17655 /// Get snapshot settings.
17656 pub fn get(&self) -> super::builder::snapshot_settings::Get {
17657 super::builder::snapshot_settings::Get::new(self.inner.clone())
17658 }
17659
17660 /// Patch snapshot settings.
17661 pub fn patch(&self) -> super::builder::snapshot_settings::Patch {
17662 super::builder::snapshot_settings::Patch::new(self.inner.clone())
17663 }
17664
17665 /// Retrieves the specified Operations resource.
17666 pub fn get_operation(&self) -> super::builder::snapshot_settings::GetOperation {
17667 super::builder::snapshot_settings::GetOperation::new(self.inner.clone())
17668 }
17669}
17670
17671/// Implements a client for the Google Compute Engine API.
17672///
17673/// # Example
17674/// ```
17675/// # use google_cloud_compute_v1::client::Snapshots;
17676/// async fn sample(
17677/// ) -> anyhow::Result<()> {
17678/// let client = Snapshots::builder().build().await?;
17679/// // use `client` to make requests to the Google Compute Engine API.
17680/// Ok(())
17681/// }
17682/// ```
17683///
17684/// # Service Description
17685///
17686/// Service for the `snapshots` resource.
17687///
17688/// # Configuration
17689///
17690/// To configure `Snapshots` use the `with_*` methods in the type returned
17691/// by [builder()][Snapshots::builder]. The default configuration should
17692/// work for most applications. Common configuration changes include
17693///
17694/// * [with_endpoint()]: by default this client uses the global default endpoint
17695/// (`https://compute.googleapis.com`). Applications using regional
17696/// endpoints or running in restricted networks (e.g. a network configured
17697/// with [Private Google Access with VPC Service Controls]) may want to
17698/// override this default.
17699/// * [with_credentials()]: by default this client uses
17700/// [Application Default Credentials]. Applications using custom
17701/// authentication may need to override this default.
17702///
17703/// [with_endpoint()]: super::builder::snapshots::ClientBuilder::with_endpoint
17704/// [with_credentials()]: super::builder::snapshots::ClientBuilder::with_credentials
17705/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17706/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17707///
17708/// # Pooling and Cloning
17709///
17710/// `Snapshots` holds a connection pool internally, it is advised to
17711/// create one and reuse it. You do not need to wrap `Snapshots` in
17712/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17713/// already uses an `Arc` internally.
17714#[cfg(feature = "snapshots")]
17715#[cfg_attr(docsrs, doc(cfg(feature = "snapshots")))]
17716#[derive(Clone, Debug)]
17717pub struct Snapshots {
17718 inner: std::sync::Arc<dyn super::stub::dynamic::Snapshots>,
17719}
17720
17721#[cfg(feature = "snapshots")]
17722impl Snapshots {
17723 /// Returns a builder for [Snapshots].
17724 ///
17725 /// ```
17726 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17727 /// # use google_cloud_compute_v1::client::Snapshots;
17728 /// let client = Snapshots::builder().build().await?;
17729 /// # Ok(()) }
17730 /// ```
17731 pub fn builder() -> super::builder::snapshots::ClientBuilder {
17732 crate::new_client_builder(super::builder::snapshots::client::Factory)
17733 }
17734
17735 /// Creates a new client from the provided stub.
17736 ///
17737 /// The most common case for calling this function is in tests mocking the
17738 /// client's behavior.
17739 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17740 where
17741 T: super::stub::Snapshots + 'static,
17742 {
17743 Self { inner: stub.into() }
17744 }
17745
17746 pub(crate) async fn new(
17747 config: gaxi::options::ClientConfig,
17748 ) -> crate::ClientBuilderResult<Self> {
17749 let inner = Self::build_inner(config).await?;
17750 Ok(Self { inner })
17751 }
17752
17753 async fn build_inner(
17754 conf: gaxi::options::ClientConfig,
17755 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Snapshots>> {
17756 if gaxi::options::tracing_enabled(&conf) {
17757 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17758 }
17759 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17760 }
17761
17762 async fn build_transport(
17763 conf: gaxi::options::ClientConfig,
17764 ) -> crate::ClientBuilderResult<impl super::stub::Snapshots> {
17765 super::transport::Snapshots::new(conf).await
17766 }
17767
17768 async fn build_with_tracing(
17769 conf: gaxi::options::ClientConfig,
17770 ) -> crate::ClientBuilderResult<impl super::stub::Snapshots> {
17771 Self::build_transport(conf)
17772 .await
17773 .map(super::tracing::Snapshots::new)
17774 }
17775
17776 /// Deletes the specified Snapshot resource. Keep in mind that deleting
17777 /// a single snapshot might not necessarily delete all the data on that
17778 /// snapshot. If any data on the snapshot that is marked for deletion is
17779 /// needed for subsequent snapshots, the data will be moved to the next
17780 /// corresponding snapshot.
17781 ///
17782 /// For more information, seeDeleting
17783 /// snapshots.
17784 pub fn delete(&self) -> super::builder::snapshots::Delete {
17785 super::builder::snapshots::Delete::new(self.inner.clone())
17786 }
17787
17788 /// Returns the specified Snapshot resource.
17789 pub fn get(&self) -> super::builder::snapshots::Get {
17790 super::builder::snapshots::Get::new(self.inner.clone())
17791 }
17792
17793 /// Gets the access control policy for a resource. May be empty if no such
17794 /// policy or resource exists.
17795 pub fn get_iam_policy(&self) -> super::builder::snapshots::GetIamPolicy {
17796 super::builder::snapshots::GetIamPolicy::new(self.inner.clone())
17797 }
17798
17799 /// Creates a snapshot in the specified project using the data included
17800 /// in the request. For regular snapshot creation, consider using this method
17801 /// instead of disks.createSnapshot,
17802 /// as this method supports more features, such as creating snapshots in a
17803 /// project different from the source disk project.
17804 pub fn insert(&self) -> super::builder::snapshots::Insert {
17805 super::builder::snapshots::Insert::new(self.inner.clone())
17806 }
17807
17808 /// Retrieves the list of Snapshot resources contained within
17809 /// the specified project.
17810 pub fn list(&self) -> super::builder::snapshots::List {
17811 super::builder::snapshots::List::new(self.inner.clone())
17812 }
17813
17814 /// Sets the access control policy on the specified resource.
17815 /// Replaces any existing policy.
17816 pub fn set_iam_policy(&self) -> super::builder::snapshots::SetIamPolicy {
17817 super::builder::snapshots::SetIamPolicy::new(self.inner.clone())
17818 }
17819
17820 /// Sets the labels on a snapshot. To learn more about labels, read theLabeling
17821 /// Resources documentation.
17822 pub fn set_labels(&self) -> super::builder::snapshots::SetLabels {
17823 super::builder::snapshots::SetLabels::new(self.inner.clone())
17824 }
17825
17826 /// Returns permissions that a caller has on the specified resource.
17827 pub fn test_iam_permissions(&self) -> super::builder::snapshots::TestIamPermissions {
17828 super::builder::snapshots::TestIamPermissions::new(self.inner.clone())
17829 }
17830
17831 /// Rotates the customer-managed
17832 /// encryption key to the latest version for the specified snapshot.
17833 pub fn update_kms_key(&self) -> super::builder::snapshots::UpdateKmsKey {
17834 super::builder::snapshots::UpdateKmsKey::new(self.inner.clone())
17835 }
17836
17837 /// Retrieves the specified Operations resource.
17838 pub fn get_operation(&self) -> super::builder::snapshots::GetOperation {
17839 super::builder::snapshots::GetOperation::new(self.inner.clone())
17840 }
17841}
17842
17843/// Implements a client for the Google Compute Engine API.
17844///
17845/// # Example
17846/// ```
17847/// # use google_cloud_compute_v1::client::SslCertificates;
17848/// async fn sample(
17849/// ) -> anyhow::Result<()> {
17850/// let client = SslCertificates::builder().build().await?;
17851/// // use `client` to make requests to the Google Compute Engine API.
17852/// Ok(())
17853/// }
17854/// ```
17855///
17856/// # Service Description
17857///
17858/// Service for the `sslCertificates` resource.
17859///
17860/// # Configuration
17861///
17862/// To configure `SslCertificates` use the `with_*` methods in the type returned
17863/// by [builder()][SslCertificates::builder]. The default configuration should
17864/// work for most applications. Common configuration changes include
17865///
17866/// * [with_endpoint()]: by default this client uses the global default endpoint
17867/// (`https://compute.googleapis.com`). Applications using regional
17868/// endpoints or running in restricted networks (e.g. a network configured
17869/// with [Private Google Access with VPC Service Controls]) may want to
17870/// override this default.
17871/// * [with_credentials()]: by default this client uses
17872/// [Application Default Credentials]. Applications using custom
17873/// authentication may need to override this default.
17874///
17875/// [with_endpoint()]: super::builder::ssl_certificates::ClientBuilder::with_endpoint
17876/// [with_credentials()]: super::builder::ssl_certificates::ClientBuilder::with_credentials
17877/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
17878/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
17879///
17880/// # Pooling and Cloning
17881///
17882/// `SslCertificates` holds a connection pool internally, it is advised to
17883/// create one and reuse it. You do not need to wrap `SslCertificates` in
17884/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
17885/// already uses an `Arc` internally.
17886#[cfg(feature = "ssl-certificates")]
17887#[cfg_attr(docsrs, doc(cfg(feature = "ssl-certificates")))]
17888#[derive(Clone, Debug)]
17889pub struct SslCertificates {
17890 inner: std::sync::Arc<dyn super::stub::dynamic::SslCertificates>,
17891}
17892
17893#[cfg(feature = "ssl-certificates")]
17894impl SslCertificates {
17895 /// Returns a builder for [SslCertificates].
17896 ///
17897 /// ```
17898 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17899 /// # use google_cloud_compute_v1::client::SslCertificates;
17900 /// let client = SslCertificates::builder().build().await?;
17901 /// # Ok(()) }
17902 /// ```
17903 pub fn builder() -> super::builder::ssl_certificates::ClientBuilder {
17904 crate::new_client_builder(super::builder::ssl_certificates::client::Factory)
17905 }
17906
17907 /// Creates a new client from the provided stub.
17908 ///
17909 /// The most common case for calling this function is in tests mocking the
17910 /// client's behavior.
17911 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
17912 where
17913 T: super::stub::SslCertificates + 'static,
17914 {
17915 Self { inner: stub.into() }
17916 }
17917
17918 pub(crate) async fn new(
17919 config: gaxi::options::ClientConfig,
17920 ) -> crate::ClientBuilderResult<Self> {
17921 let inner = Self::build_inner(config).await?;
17922 Ok(Self { inner })
17923 }
17924
17925 async fn build_inner(
17926 conf: gaxi::options::ClientConfig,
17927 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SslCertificates>> {
17928 if gaxi::options::tracing_enabled(&conf) {
17929 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
17930 }
17931 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
17932 }
17933
17934 async fn build_transport(
17935 conf: gaxi::options::ClientConfig,
17936 ) -> crate::ClientBuilderResult<impl super::stub::SslCertificates> {
17937 super::transport::SslCertificates::new(conf).await
17938 }
17939
17940 async fn build_with_tracing(
17941 conf: gaxi::options::ClientConfig,
17942 ) -> crate::ClientBuilderResult<impl super::stub::SslCertificates> {
17943 Self::build_transport(conf)
17944 .await
17945 .map(super::tracing::SslCertificates::new)
17946 }
17947
17948 /// Retrieves the list of all SslCertificate resources, regional and global,
17949 /// available to the specified project.
17950 ///
17951 /// To prevent failure, Google recommends that you set the
17952 /// `returnPartialSuccess` parameter to `true`.
17953 pub fn aggregated_list(&self) -> super::builder::ssl_certificates::AggregatedList {
17954 super::builder::ssl_certificates::AggregatedList::new(self.inner.clone())
17955 }
17956
17957 /// Deletes the specified SslCertificate resource.
17958 pub fn delete(&self) -> super::builder::ssl_certificates::Delete {
17959 super::builder::ssl_certificates::Delete::new(self.inner.clone())
17960 }
17961
17962 /// Returns the specified SslCertificate resource.
17963 pub fn get(&self) -> super::builder::ssl_certificates::Get {
17964 super::builder::ssl_certificates::Get::new(self.inner.clone())
17965 }
17966
17967 /// Creates a SslCertificate resource in the specified project using the data
17968 /// included in the request.
17969 pub fn insert(&self) -> super::builder::ssl_certificates::Insert {
17970 super::builder::ssl_certificates::Insert::new(self.inner.clone())
17971 }
17972
17973 /// Retrieves the list of SslCertificate resources available to the specified
17974 /// project.
17975 pub fn list(&self) -> super::builder::ssl_certificates::List {
17976 super::builder::ssl_certificates::List::new(self.inner.clone())
17977 }
17978
17979 /// Retrieves the specified Operations resource.
17980 pub fn get_operation(&self) -> super::builder::ssl_certificates::GetOperation {
17981 super::builder::ssl_certificates::GetOperation::new(self.inner.clone())
17982 }
17983}
17984
17985/// Implements a client for the Google Compute Engine API.
17986///
17987/// # Example
17988/// ```
17989/// # use google_cloud_compute_v1::client::SslPolicies;
17990/// async fn sample(
17991/// ) -> anyhow::Result<()> {
17992/// let client = SslPolicies::builder().build().await?;
17993/// // use `client` to make requests to the Google Compute Engine API.
17994/// Ok(())
17995/// }
17996/// ```
17997///
17998/// # Service Description
17999///
18000/// Service for the `sslPolicies` resource.
18001///
18002/// # Configuration
18003///
18004/// To configure `SslPolicies` use the `with_*` methods in the type returned
18005/// by [builder()][SslPolicies::builder]. The default configuration should
18006/// work for most applications. Common configuration changes include
18007///
18008/// * [with_endpoint()]: by default this client uses the global default endpoint
18009/// (`https://compute.googleapis.com`). Applications using regional
18010/// endpoints or running in restricted networks (e.g. a network configured
18011/// with [Private Google Access with VPC Service Controls]) may want to
18012/// override this default.
18013/// * [with_credentials()]: by default this client uses
18014/// [Application Default Credentials]. Applications using custom
18015/// authentication may need to override this default.
18016///
18017/// [with_endpoint()]: super::builder::ssl_policies::ClientBuilder::with_endpoint
18018/// [with_credentials()]: super::builder::ssl_policies::ClientBuilder::with_credentials
18019/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18020/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18021///
18022/// # Pooling and Cloning
18023///
18024/// `SslPolicies` holds a connection pool internally, it is advised to
18025/// create one and reuse it. You do not need to wrap `SslPolicies` in
18026/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18027/// already uses an `Arc` internally.
18028#[cfg(feature = "ssl-policies")]
18029#[cfg_attr(docsrs, doc(cfg(feature = "ssl-policies")))]
18030#[derive(Clone, Debug)]
18031pub struct SslPolicies {
18032 inner: std::sync::Arc<dyn super::stub::dynamic::SslPolicies>,
18033}
18034
18035#[cfg(feature = "ssl-policies")]
18036impl SslPolicies {
18037 /// Returns a builder for [SslPolicies].
18038 ///
18039 /// ```
18040 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18041 /// # use google_cloud_compute_v1::client::SslPolicies;
18042 /// let client = SslPolicies::builder().build().await?;
18043 /// # Ok(()) }
18044 /// ```
18045 pub fn builder() -> super::builder::ssl_policies::ClientBuilder {
18046 crate::new_client_builder(super::builder::ssl_policies::client::Factory)
18047 }
18048
18049 /// Creates a new client from the provided stub.
18050 ///
18051 /// The most common case for calling this function is in tests mocking the
18052 /// client's behavior.
18053 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18054 where
18055 T: super::stub::SslPolicies + 'static,
18056 {
18057 Self { inner: stub.into() }
18058 }
18059
18060 pub(crate) async fn new(
18061 config: gaxi::options::ClientConfig,
18062 ) -> crate::ClientBuilderResult<Self> {
18063 let inner = Self::build_inner(config).await?;
18064 Ok(Self { inner })
18065 }
18066
18067 async fn build_inner(
18068 conf: gaxi::options::ClientConfig,
18069 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::SslPolicies>> {
18070 if gaxi::options::tracing_enabled(&conf) {
18071 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18072 }
18073 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18074 }
18075
18076 async fn build_transport(
18077 conf: gaxi::options::ClientConfig,
18078 ) -> crate::ClientBuilderResult<impl super::stub::SslPolicies> {
18079 super::transport::SslPolicies::new(conf).await
18080 }
18081
18082 async fn build_with_tracing(
18083 conf: gaxi::options::ClientConfig,
18084 ) -> crate::ClientBuilderResult<impl super::stub::SslPolicies> {
18085 Self::build_transport(conf)
18086 .await
18087 .map(super::tracing::SslPolicies::new)
18088 }
18089
18090 /// Retrieves the list of all SslPolicy resources, regional and global,
18091 /// available to the specified project.
18092 ///
18093 /// To prevent failure, Google recommends that you set the
18094 /// `returnPartialSuccess` parameter to `true`.
18095 pub fn aggregated_list(&self) -> super::builder::ssl_policies::AggregatedList {
18096 super::builder::ssl_policies::AggregatedList::new(self.inner.clone())
18097 }
18098
18099 /// Deletes the specified SSL policy. The SSL policy resource can be deleted
18100 /// only if it is not in use by any TargetHttpsProxy or TargetSslProxy
18101 /// resources.
18102 pub fn delete(&self) -> super::builder::ssl_policies::Delete {
18103 super::builder::ssl_policies::Delete::new(self.inner.clone())
18104 }
18105
18106 /// Lists all of the ordered rules present in a single specified policy.
18107 pub fn get(&self) -> super::builder::ssl_policies::Get {
18108 super::builder::ssl_policies::Get::new(self.inner.clone())
18109 }
18110
18111 /// Returns the specified SSL policy resource.
18112 pub fn insert(&self) -> super::builder::ssl_policies::Insert {
18113 super::builder::ssl_policies::Insert::new(self.inner.clone())
18114 }
18115
18116 /// Lists all the SSL policies that have been configured for the specified
18117 /// project.
18118 pub fn list(&self) -> super::builder::ssl_policies::List {
18119 super::builder::ssl_policies::List::new(self.inner.clone())
18120 }
18121
18122 /// Lists all features that can be specified in the SSL policy when using
18123 /// custom profile.
18124 pub fn list_available_features(&self) -> super::builder::ssl_policies::ListAvailableFeatures {
18125 super::builder::ssl_policies::ListAvailableFeatures::new(self.inner.clone())
18126 }
18127
18128 /// Patches the specified SSL policy with the data included in the request.
18129 pub fn patch(&self) -> super::builder::ssl_policies::Patch {
18130 super::builder::ssl_policies::Patch::new(self.inner.clone())
18131 }
18132
18133 /// Retrieves the specified Operations resource.
18134 pub fn get_operation(&self) -> super::builder::ssl_policies::GetOperation {
18135 super::builder::ssl_policies::GetOperation::new(self.inner.clone())
18136 }
18137}
18138
18139/// Implements a client for the Google Compute Engine API.
18140///
18141/// # Example
18142/// ```
18143/// # use google_cloud_compute_v1::client::StoragePoolTypes;
18144/// async fn sample(
18145/// ) -> anyhow::Result<()> {
18146/// let client = StoragePoolTypes::builder().build().await?;
18147/// // use `client` to make requests to the Google Compute Engine API.
18148/// Ok(())
18149/// }
18150/// ```
18151///
18152/// # Service Description
18153///
18154/// Service for the `storagePoolTypes` resource.
18155///
18156/// # Configuration
18157///
18158/// To configure `StoragePoolTypes` use the `with_*` methods in the type returned
18159/// by [builder()][StoragePoolTypes::builder]. The default configuration should
18160/// work for most applications. Common configuration changes include
18161///
18162/// * [with_endpoint()]: by default this client uses the global default endpoint
18163/// (`https://compute.googleapis.com`). Applications using regional
18164/// endpoints or running in restricted networks (e.g. a network configured
18165/// with [Private Google Access with VPC Service Controls]) may want to
18166/// override this default.
18167/// * [with_credentials()]: by default this client uses
18168/// [Application Default Credentials]. Applications using custom
18169/// authentication may need to override this default.
18170///
18171/// [with_endpoint()]: super::builder::storage_pool_types::ClientBuilder::with_endpoint
18172/// [with_credentials()]: super::builder::storage_pool_types::ClientBuilder::with_credentials
18173/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18174/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18175///
18176/// # Pooling and Cloning
18177///
18178/// `StoragePoolTypes` holds a connection pool internally, it is advised to
18179/// create one and reuse it. You do not need to wrap `StoragePoolTypes` in
18180/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18181/// already uses an `Arc` internally.
18182#[cfg(feature = "storage-pool-types")]
18183#[cfg_attr(docsrs, doc(cfg(feature = "storage-pool-types")))]
18184#[derive(Clone, Debug)]
18185pub struct StoragePoolTypes {
18186 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>,
18187}
18188
18189#[cfg(feature = "storage-pool-types")]
18190impl StoragePoolTypes {
18191 /// Returns a builder for [StoragePoolTypes].
18192 ///
18193 /// ```
18194 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18195 /// # use google_cloud_compute_v1::client::StoragePoolTypes;
18196 /// let client = StoragePoolTypes::builder().build().await?;
18197 /// # Ok(()) }
18198 /// ```
18199 pub fn builder() -> super::builder::storage_pool_types::ClientBuilder {
18200 crate::new_client_builder(super::builder::storage_pool_types::client::Factory)
18201 }
18202
18203 /// Creates a new client from the provided stub.
18204 ///
18205 /// The most common case for calling this function is in tests mocking the
18206 /// client's behavior.
18207 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18208 where
18209 T: super::stub::StoragePoolTypes + 'static,
18210 {
18211 Self { inner: stub.into() }
18212 }
18213
18214 pub(crate) async fn new(
18215 config: gaxi::options::ClientConfig,
18216 ) -> crate::ClientBuilderResult<Self> {
18217 let inner = Self::build_inner(config).await?;
18218 Ok(Self { inner })
18219 }
18220
18221 async fn build_inner(
18222 conf: gaxi::options::ClientConfig,
18223 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::StoragePoolTypes>>
18224 {
18225 if gaxi::options::tracing_enabled(&conf) {
18226 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18227 }
18228 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18229 }
18230
18231 async fn build_transport(
18232 conf: gaxi::options::ClientConfig,
18233 ) -> crate::ClientBuilderResult<impl super::stub::StoragePoolTypes> {
18234 super::transport::StoragePoolTypes::new(conf).await
18235 }
18236
18237 async fn build_with_tracing(
18238 conf: gaxi::options::ClientConfig,
18239 ) -> crate::ClientBuilderResult<impl super::stub::StoragePoolTypes> {
18240 Self::build_transport(conf)
18241 .await
18242 .map(super::tracing::StoragePoolTypes::new)
18243 }
18244
18245 /// Retrieves an aggregated list of storage pool types.
18246 ///
18247 /// To prevent failure, Google recommends that you set the
18248 /// `returnPartialSuccess` parameter to `true`.
18249 pub fn aggregated_list(&self) -> super::builder::storage_pool_types::AggregatedList {
18250 super::builder::storage_pool_types::AggregatedList::new(self.inner.clone())
18251 }
18252
18253 /// Returns the specified storage pool type.
18254 pub fn get(&self) -> super::builder::storage_pool_types::Get {
18255 super::builder::storage_pool_types::Get::new(self.inner.clone())
18256 }
18257
18258 /// Retrieves a list of storage pool types available to the specified
18259 /// project.
18260 pub fn list(&self) -> super::builder::storage_pool_types::List {
18261 super::builder::storage_pool_types::List::new(self.inner.clone())
18262 }
18263}
18264
18265/// Implements a client for the Google Compute Engine API.
18266///
18267/// # Example
18268/// ```
18269/// # use google_cloud_compute_v1::client::StoragePools;
18270/// async fn sample(
18271/// ) -> anyhow::Result<()> {
18272/// let client = StoragePools::builder().build().await?;
18273/// // use `client` to make requests to the Google Compute Engine API.
18274/// Ok(())
18275/// }
18276/// ```
18277///
18278/// # Service Description
18279///
18280/// Service for the `storagePools` resource.
18281///
18282/// # Configuration
18283///
18284/// To configure `StoragePools` use the `with_*` methods in the type returned
18285/// by [builder()][StoragePools::builder]. The default configuration should
18286/// work for most applications. Common configuration changes include
18287///
18288/// * [with_endpoint()]: by default this client uses the global default endpoint
18289/// (`https://compute.googleapis.com`). Applications using regional
18290/// endpoints or running in restricted networks (e.g. a network configured
18291/// with [Private Google Access with VPC Service Controls]) may want to
18292/// override this default.
18293/// * [with_credentials()]: by default this client uses
18294/// [Application Default Credentials]. Applications using custom
18295/// authentication may need to override this default.
18296///
18297/// [with_endpoint()]: super::builder::storage_pools::ClientBuilder::with_endpoint
18298/// [with_credentials()]: super::builder::storage_pools::ClientBuilder::with_credentials
18299/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18300/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18301///
18302/// # Pooling and Cloning
18303///
18304/// `StoragePools` holds a connection pool internally, it is advised to
18305/// create one and reuse it. You do not need to wrap `StoragePools` in
18306/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18307/// already uses an `Arc` internally.
18308#[cfg(feature = "storage-pools")]
18309#[cfg_attr(docsrs, doc(cfg(feature = "storage-pools")))]
18310#[derive(Clone, Debug)]
18311pub struct StoragePools {
18312 inner: std::sync::Arc<dyn super::stub::dynamic::StoragePools>,
18313}
18314
18315#[cfg(feature = "storage-pools")]
18316impl StoragePools {
18317 /// Returns a builder for [StoragePools].
18318 ///
18319 /// ```
18320 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18321 /// # use google_cloud_compute_v1::client::StoragePools;
18322 /// let client = StoragePools::builder().build().await?;
18323 /// # Ok(()) }
18324 /// ```
18325 pub fn builder() -> super::builder::storage_pools::ClientBuilder {
18326 crate::new_client_builder(super::builder::storage_pools::client::Factory)
18327 }
18328
18329 /// Creates a new client from the provided stub.
18330 ///
18331 /// The most common case for calling this function is in tests mocking the
18332 /// client's behavior.
18333 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18334 where
18335 T: super::stub::StoragePools + 'static,
18336 {
18337 Self { inner: stub.into() }
18338 }
18339
18340 pub(crate) async fn new(
18341 config: gaxi::options::ClientConfig,
18342 ) -> crate::ClientBuilderResult<Self> {
18343 let inner = Self::build_inner(config).await?;
18344 Ok(Self { inner })
18345 }
18346
18347 async fn build_inner(
18348 conf: gaxi::options::ClientConfig,
18349 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::StoragePools>> {
18350 if gaxi::options::tracing_enabled(&conf) {
18351 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18352 }
18353 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18354 }
18355
18356 async fn build_transport(
18357 conf: gaxi::options::ClientConfig,
18358 ) -> crate::ClientBuilderResult<impl super::stub::StoragePools> {
18359 super::transport::StoragePools::new(conf).await
18360 }
18361
18362 async fn build_with_tracing(
18363 conf: gaxi::options::ClientConfig,
18364 ) -> crate::ClientBuilderResult<impl super::stub::StoragePools> {
18365 Self::build_transport(conf)
18366 .await
18367 .map(super::tracing::StoragePools::new)
18368 }
18369
18370 /// Retrieves an aggregated list of storage pools.
18371 ///
18372 /// To prevent failure, Google recommends that you set the
18373 /// `returnPartialSuccess` parameter to `true`.
18374 pub fn aggregated_list(&self) -> super::builder::storage_pools::AggregatedList {
18375 super::builder::storage_pools::AggregatedList::new(self.inner.clone())
18376 }
18377
18378 /// Deletes the specified storage pool. Deleting a storagePool
18379 /// removes its data permanently and is irreversible. However, deleting a
18380 /// storagePool does not delete any snapshots previously
18381 /// made from the storagePool. You must separately delete
18382 /// snapshots.
18383 pub fn delete(&self) -> super::builder::storage_pools::Delete {
18384 super::builder::storage_pools::Delete::new(self.inner.clone())
18385 }
18386
18387 /// Returns a specified storage pool. Gets a list of available
18388 /// storage pools by making a list() request.
18389 pub fn get(&self) -> super::builder::storage_pools::Get {
18390 super::builder::storage_pools::Get::new(self.inner.clone())
18391 }
18392
18393 /// Gets the access control policy for a resource. May be empty if no such
18394 /// policy or resource exists.
18395 pub fn get_iam_policy(&self) -> super::builder::storage_pools::GetIamPolicy {
18396 super::builder::storage_pools::GetIamPolicy::new(self.inner.clone())
18397 }
18398
18399 /// Creates a storage pool in the specified project using the data
18400 /// in the request.
18401 pub fn insert(&self) -> super::builder::storage_pools::Insert {
18402 super::builder::storage_pools::Insert::new(self.inner.clone())
18403 }
18404
18405 /// Retrieves a list of storage pools contained within
18406 /// the specified zone.
18407 pub fn list(&self) -> super::builder::storage_pools::List {
18408 super::builder::storage_pools::List::new(self.inner.clone())
18409 }
18410
18411 /// Lists the disks in a specified storage pool.
18412 pub fn list_disks(&self) -> super::builder::storage_pools::ListDisks {
18413 super::builder::storage_pools::ListDisks::new(self.inner.clone())
18414 }
18415
18416 /// Sets the access control policy on the specified resource.
18417 /// Replaces any existing policy.
18418 pub fn set_iam_policy(&self) -> super::builder::storage_pools::SetIamPolicy {
18419 super::builder::storage_pools::SetIamPolicy::new(self.inner.clone())
18420 }
18421
18422 /// Returns permissions that a caller has on the specified resource.
18423 pub fn test_iam_permissions(&self) -> super::builder::storage_pools::TestIamPermissions {
18424 super::builder::storage_pools::TestIamPermissions::new(self.inner.clone())
18425 }
18426
18427 /// Updates the specified storagePool with the data included in the request.
18428 /// The update is performed only on selected fields included as part
18429 /// of update-mask. Only the following fields can be modified:
18430 /// pool_provisioned_capacity_gb, pool_provisioned_iops and
18431 /// pool_provisioned_throughput.
18432 pub fn update(&self) -> super::builder::storage_pools::Update {
18433 super::builder::storage_pools::Update::new(self.inner.clone())
18434 }
18435
18436 /// Retrieves the specified zone-specific Operations resource.
18437 pub fn get_operation(&self) -> super::builder::storage_pools::GetOperation {
18438 super::builder::storage_pools::GetOperation::new(self.inner.clone())
18439 }
18440}
18441
18442/// Implements a client for the Google Compute Engine API.
18443///
18444/// # Example
18445/// ```
18446/// # use google_cloud_compute_v1::client::Subnetworks;
18447/// async fn sample(
18448/// ) -> anyhow::Result<()> {
18449/// let client = Subnetworks::builder().build().await?;
18450/// // use `client` to make requests to the Google Compute Engine API.
18451/// Ok(())
18452/// }
18453/// ```
18454///
18455/// # Service Description
18456///
18457/// Service for the `subnetworks` resource.
18458///
18459/// # Configuration
18460///
18461/// To configure `Subnetworks` use the `with_*` methods in the type returned
18462/// by [builder()][Subnetworks::builder]. The default configuration should
18463/// work for most applications. Common configuration changes include
18464///
18465/// * [with_endpoint()]: by default this client uses the global default endpoint
18466/// (`https://compute.googleapis.com`). Applications using regional
18467/// endpoints or running in restricted networks (e.g. a network configured
18468/// with [Private Google Access with VPC Service Controls]) may want to
18469/// override this default.
18470/// * [with_credentials()]: by default this client uses
18471/// [Application Default Credentials]. Applications using custom
18472/// authentication may need to override this default.
18473///
18474/// [with_endpoint()]: super::builder::subnetworks::ClientBuilder::with_endpoint
18475/// [with_credentials()]: super::builder::subnetworks::ClientBuilder::with_credentials
18476/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18477/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18478///
18479/// # Pooling and Cloning
18480///
18481/// `Subnetworks` holds a connection pool internally, it is advised to
18482/// create one and reuse it. You do not need to wrap `Subnetworks` in
18483/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18484/// already uses an `Arc` internally.
18485#[cfg(feature = "subnetworks")]
18486#[cfg_attr(docsrs, doc(cfg(feature = "subnetworks")))]
18487#[derive(Clone, Debug)]
18488pub struct Subnetworks {
18489 inner: std::sync::Arc<dyn super::stub::dynamic::Subnetworks>,
18490}
18491
18492#[cfg(feature = "subnetworks")]
18493impl Subnetworks {
18494 /// Returns a builder for [Subnetworks].
18495 ///
18496 /// ```
18497 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18498 /// # use google_cloud_compute_v1::client::Subnetworks;
18499 /// let client = Subnetworks::builder().build().await?;
18500 /// # Ok(()) }
18501 /// ```
18502 pub fn builder() -> super::builder::subnetworks::ClientBuilder {
18503 crate::new_client_builder(super::builder::subnetworks::client::Factory)
18504 }
18505
18506 /// Creates a new client from the provided stub.
18507 ///
18508 /// The most common case for calling this function is in tests mocking the
18509 /// client's behavior.
18510 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18511 where
18512 T: super::stub::Subnetworks + 'static,
18513 {
18514 Self { inner: stub.into() }
18515 }
18516
18517 pub(crate) async fn new(
18518 config: gaxi::options::ClientConfig,
18519 ) -> crate::ClientBuilderResult<Self> {
18520 let inner = Self::build_inner(config).await?;
18521 Ok(Self { inner })
18522 }
18523
18524 async fn build_inner(
18525 conf: gaxi::options::ClientConfig,
18526 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Subnetworks>> {
18527 if gaxi::options::tracing_enabled(&conf) {
18528 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18529 }
18530 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18531 }
18532
18533 async fn build_transport(
18534 conf: gaxi::options::ClientConfig,
18535 ) -> crate::ClientBuilderResult<impl super::stub::Subnetworks> {
18536 super::transport::Subnetworks::new(conf).await
18537 }
18538
18539 async fn build_with_tracing(
18540 conf: gaxi::options::ClientConfig,
18541 ) -> crate::ClientBuilderResult<impl super::stub::Subnetworks> {
18542 Self::build_transport(conf)
18543 .await
18544 .map(super::tracing::Subnetworks::new)
18545 }
18546
18547 /// Retrieves an aggregated list of subnetworks.
18548 ///
18549 /// To prevent failure, Google recommends that you set the
18550 /// `returnPartialSuccess` parameter to `true`.
18551 pub fn aggregated_list(&self) -> super::builder::subnetworks::AggregatedList {
18552 super::builder::subnetworks::AggregatedList::new(self.inner.clone())
18553 }
18554
18555 /// Deletes the specified subnetwork.
18556 pub fn delete(&self) -> super::builder::subnetworks::Delete {
18557 super::builder::subnetworks::Delete::new(self.inner.clone())
18558 }
18559
18560 /// Expands the IP CIDR range of the subnetwork to a specified value.
18561 pub fn expand_ip_cidr_range(&self) -> super::builder::subnetworks::ExpandIpCidrRange {
18562 super::builder::subnetworks::ExpandIpCidrRange::new(self.inner.clone())
18563 }
18564
18565 /// Returns the specified subnetwork.
18566 pub fn get(&self) -> super::builder::subnetworks::Get {
18567 super::builder::subnetworks::Get::new(self.inner.clone())
18568 }
18569
18570 /// Gets the access control policy for a resource. May be empty if no such
18571 /// policy or resource exists.
18572 pub fn get_iam_policy(&self) -> super::builder::subnetworks::GetIamPolicy {
18573 super::builder::subnetworks::GetIamPolicy::new(self.inner.clone())
18574 }
18575
18576 /// Creates a subnetwork in the specified project using the data
18577 /// included in the request.
18578 pub fn insert(&self) -> super::builder::subnetworks::Insert {
18579 super::builder::subnetworks::Insert::new(self.inner.clone())
18580 }
18581
18582 /// Retrieves a list of subnetworks available to the specified
18583 /// project.
18584 pub fn list(&self) -> super::builder::subnetworks::List {
18585 super::builder::subnetworks::List::new(self.inner.clone())
18586 }
18587
18588 /// Retrieves an aggregated list of all usable subnetworks in the project.
18589 pub fn list_usable(&self) -> super::builder::subnetworks::ListUsable {
18590 super::builder::subnetworks::ListUsable::new(self.inner.clone())
18591 }
18592
18593 /// Patches the specified subnetwork with the data included in the request.
18594 /// Only certain fields can be updated with a patch request
18595 /// as indicated in the field descriptions.
18596 /// You must specify the current fingerprint of the
18597 /// subnetwork resource being patched.
18598 pub fn patch(&self) -> super::builder::subnetworks::Patch {
18599 super::builder::subnetworks::Patch::new(self.inner.clone())
18600 }
18601
18602 /// Sets the access control policy on the specified resource.
18603 /// Replaces any existing policy.
18604 pub fn set_iam_policy(&self) -> super::builder::subnetworks::SetIamPolicy {
18605 super::builder::subnetworks::SetIamPolicy::new(self.inner.clone())
18606 }
18607
18608 /// Set whether VMs in this subnet can access Google services without assigning
18609 /// external IP addresses through Private Google Access.
18610 pub fn set_private_ip_google_access(
18611 &self,
18612 ) -> super::builder::subnetworks::SetPrivateIpGoogleAccess {
18613 super::builder::subnetworks::SetPrivateIpGoogleAccess::new(self.inner.clone())
18614 }
18615
18616 /// Returns permissions that a caller has on the specified resource.
18617 pub fn test_iam_permissions(&self) -> super::builder::subnetworks::TestIamPermissions {
18618 super::builder::subnetworks::TestIamPermissions::new(self.inner.clone())
18619 }
18620
18621 /// Retrieves the specified region-specific Operations resource.
18622 pub fn get_operation(&self) -> super::builder::subnetworks::GetOperation {
18623 super::builder::subnetworks::GetOperation::new(self.inner.clone())
18624 }
18625}
18626
18627/// Implements a client for the Google Compute Engine API.
18628///
18629/// # Example
18630/// ```
18631/// # use google_cloud_compute_v1::client::TargetGrpcProxies;
18632/// async fn sample(
18633/// ) -> anyhow::Result<()> {
18634/// let client = TargetGrpcProxies::builder().build().await?;
18635/// // use `client` to make requests to the Google Compute Engine API.
18636/// Ok(())
18637/// }
18638/// ```
18639///
18640/// # Service Description
18641///
18642/// Service for the `targetGrpcProxies` resource.
18643///
18644/// # Configuration
18645///
18646/// To configure `TargetGrpcProxies` use the `with_*` methods in the type returned
18647/// by [builder()][TargetGrpcProxies::builder]. The default configuration should
18648/// work for most applications. Common configuration changes include
18649///
18650/// * [with_endpoint()]: by default this client uses the global default endpoint
18651/// (`https://compute.googleapis.com`). Applications using regional
18652/// endpoints or running in restricted networks (e.g. a network configured
18653/// with [Private Google Access with VPC Service Controls]) may want to
18654/// override this default.
18655/// * [with_credentials()]: by default this client uses
18656/// [Application Default Credentials]. Applications using custom
18657/// authentication may need to override this default.
18658///
18659/// [with_endpoint()]: super::builder::target_grpc_proxies::ClientBuilder::with_endpoint
18660/// [with_credentials()]: super::builder::target_grpc_proxies::ClientBuilder::with_credentials
18661/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18662/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18663///
18664/// # Pooling and Cloning
18665///
18666/// `TargetGrpcProxies` holds a connection pool internally, it is advised to
18667/// create one and reuse it. You do not need to wrap `TargetGrpcProxies` in
18668/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18669/// already uses an `Arc` internally.
18670#[cfg(feature = "target-grpc-proxies")]
18671#[cfg_attr(docsrs, doc(cfg(feature = "target-grpc-proxies")))]
18672#[derive(Clone, Debug)]
18673pub struct TargetGrpcProxies {
18674 inner: std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>,
18675}
18676
18677#[cfg(feature = "target-grpc-proxies")]
18678impl TargetGrpcProxies {
18679 /// Returns a builder for [TargetGrpcProxies].
18680 ///
18681 /// ```
18682 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18683 /// # use google_cloud_compute_v1::client::TargetGrpcProxies;
18684 /// let client = TargetGrpcProxies::builder().build().await?;
18685 /// # Ok(()) }
18686 /// ```
18687 pub fn builder() -> super::builder::target_grpc_proxies::ClientBuilder {
18688 crate::new_client_builder(super::builder::target_grpc_proxies::client::Factory)
18689 }
18690
18691 /// Creates a new client from the provided stub.
18692 ///
18693 /// The most common case for calling this function is in tests mocking the
18694 /// client's behavior.
18695 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18696 where
18697 T: super::stub::TargetGrpcProxies + 'static,
18698 {
18699 Self { inner: stub.into() }
18700 }
18701
18702 pub(crate) async fn new(
18703 config: gaxi::options::ClientConfig,
18704 ) -> crate::ClientBuilderResult<Self> {
18705 let inner = Self::build_inner(config).await?;
18706 Ok(Self { inner })
18707 }
18708
18709 async fn build_inner(
18710 conf: gaxi::options::ClientConfig,
18711 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetGrpcProxies>>
18712 {
18713 if gaxi::options::tracing_enabled(&conf) {
18714 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18715 }
18716 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18717 }
18718
18719 async fn build_transport(
18720 conf: gaxi::options::ClientConfig,
18721 ) -> crate::ClientBuilderResult<impl super::stub::TargetGrpcProxies> {
18722 super::transport::TargetGrpcProxies::new(conf).await
18723 }
18724
18725 async fn build_with_tracing(
18726 conf: gaxi::options::ClientConfig,
18727 ) -> crate::ClientBuilderResult<impl super::stub::TargetGrpcProxies> {
18728 Self::build_transport(conf)
18729 .await
18730 .map(super::tracing::TargetGrpcProxies::new)
18731 }
18732
18733 /// Deletes the specified TargetGrpcProxy in the given scope
18734 pub fn delete(&self) -> super::builder::target_grpc_proxies::Delete {
18735 super::builder::target_grpc_proxies::Delete::new(self.inner.clone())
18736 }
18737
18738 /// Returns the specified TargetGrpcProxy resource in the given scope.
18739 pub fn get(&self) -> super::builder::target_grpc_proxies::Get {
18740 super::builder::target_grpc_proxies::Get::new(self.inner.clone())
18741 }
18742
18743 /// Creates a TargetGrpcProxy in the specified project in the given scope
18744 /// using the parameters that are included in the request.
18745 pub fn insert(&self) -> super::builder::target_grpc_proxies::Insert {
18746 super::builder::target_grpc_proxies::Insert::new(self.inner.clone())
18747 }
18748
18749 /// Lists the TargetGrpcProxies for a project in the given scope.
18750 pub fn list(&self) -> super::builder::target_grpc_proxies::List {
18751 super::builder::target_grpc_proxies::List::new(self.inner.clone())
18752 }
18753
18754 /// Patches the specified TargetGrpcProxy resource with the data included in
18755 /// the request. This method supports PATCH
18756 /// semantics and usesJSON merge
18757 /// patch format and processing rules.
18758 pub fn patch(&self) -> super::builder::target_grpc_proxies::Patch {
18759 super::builder::target_grpc_proxies::Patch::new(self.inner.clone())
18760 }
18761
18762 /// Retrieves the specified Operations resource.
18763 pub fn get_operation(&self) -> super::builder::target_grpc_proxies::GetOperation {
18764 super::builder::target_grpc_proxies::GetOperation::new(self.inner.clone())
18765 }
18766}
18767
18768/// Implements a client for the Google Compute Engine API.
18769///
18770/// # Example
18771/// ```
18772/// # use google_cloud_compute_v1::client::TargetHttpProxies;
18773/// async fn sample(
18774/// ) -> anyhow::Result<()> {
18775/// let client = TargetHttpProxies::builder().build().await?;
18776/// // use `client` to make requests to the Google Compute Engine API.
18777/// Ok(())
18778/// }
18779/// ```
18780///
18781/// # Service Description
18782///
18783/// Service for the `targetHttpProxies` resource.
18784///
18785/// # Configuration
18786///
18787/// To configure `TargetHttpProxies` use the `with_*` methods in the type returned
18788/// by [builder()][TargetHttpProxies::builder]. The default configuration should
18789/// work for most applications. Common configuration changes include
18790///
18791/// * [with_endpoint()]: by default this client uses the global default endpoint
18792/// (`https://compute.googleapis.com`). Applications using regional
18793/// endpoints or running in restricted networks (e.g. a network configured
18794/// with [Private Google Access with VPC Service Controls]) may want to
18795/// override this default.
18796/// * [with_credentials()]: by default this client uses
18797/// [Application Default Credentials]. Applications using custom
18798/// authentication may need to override this default.
18799///
18800/// [with_endpoint()]: super::builder::target_http_proxies::ClientBuilder::with_endpoint
18801/// [with_credentials()]: super::builder::target_http_proxies::ClientBuilder::with_credentials
18802/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18803/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18804///
18805/// # Pooling and Cloning
18806///
18807/// `TargetHttpProxies` holds a connection pool internally, it is advised to
18808/// create one and reuse it. You do not need to wrap `TargetHttpProxies` in
18809/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18810/// already uses an `Arc` internally.
18811#[cfg(feature = "target-http-proxies")]
18812#[cfg_attr(docsrs, doc(cfg(feature = "target-http-proxies")))]
18813#[derive(Clone, Debug)]
18814pub struct TargetHttpProxies {
18815 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>,
18816}
18817
18818#[cfg(feature = "target-http-proxies")]
18819impl TargetHttpProxies {
18820 /// Returns a builder for [TargetHttpProxies].
18821 ///
18822 /// ```
18823 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18824 /// # use google_cloud_compute_v1::client::TargetHttpProxies;
18825 /// let client = TargetHttpProxies::builder().build().await?;
18826 /// # Ok(()) }
18827 /// ```
18828 pub fn builder() -> super::builder::target_http_proxies::ClientBuilder {
18829 crate::new_client_builder(super::builder::target_http_proxies::client::Factory)
18830 }
18831
18832 /// Creates a new client from the provided stub.
18833 ///
18834 /// The most common case for calling this function is in tests mocking the
18835 /// client's behavior.
18836 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18837 where
18838 T: super::stub::TargetHttpProxies + 'static,
18839 {
18840 Self { inner: stub.into() }
18841 }
18842
18843 pub(crate) async fn new(
18844 config: gaxi::options::ClientConfig,
18845 ) -> crate::ClientBuilderResult<Self> {
18846 let inner = Self::build_inner(config).await?;
18847 Ok(Self { inner })
18848 }
18849
18850 async fn build_inner(
18851 conf: gaxi::options::ClientConfig,
18852 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetHttpProxies>>
18853 {
18854 if gaxi::options::tracing_enabled(&conf) {
18855 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
18856 }
18857 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
18858 }
18859
18860 async fn build_transport(
18861 conf: gaxi::options::ClientConfig,
18862 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpProxies> {
18863 super::transport::TargetHttpProxies::new(conf).await
18864 }
18865
18866 async fn build_with_tracing(
18867 conf: gaxi::options::ClientConfig,
18868 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpProxies> {
18869 Self::build_transport(conf)
18870 .await
18871 .map(super::tracing::TargetHttpProxies::new)
18872 }
18873
18874 /// Retrieves the list of all TargetHttpProxy resources, regional and global,
18875 /// available to the specified project.
18876 ///
18877 /// To prevent failure, Google recommends that you set the
18878 /// `returnPartialSuccess` parameter to `true`.
18879 pub fn aggregated_list(&self) -> super::builder::target_http_proxies::AggregatedList {
18880 super::builder::target_http_proxies::AggregatedList::new(self.inner.clone())
18881 }
18882
18883 /// Deletes the specified TargetHttpProxy resource.
18884 pub fn delete(&self) -> super::builder::target_http_proxies::Delete {
18885 super::builder::target_http_proxies::Delete::new(self.inner.clone())
18886 }
18887
18888 /// Returns the specified TargetHttpProxy resource.
18889 pub fn get(&self) -> super::builder::target_http_proxies::Get {
18890 super::builder::target_http_proxies::Get::new(self.inner.clone())
18891 }
18892
18893 /// Creates a TargetHttpProxy resource in the specified
18894 /// project using the data included in the request.
18895 pub fn insert(&self) -> super::builder::target_http_proxies::Insert {
18896 super::builder::target_http_proxies::Insert::new(self.inner.clone())
18897 }
18898
18899 /// Retrieves the list of TargetHttpProxy resources available
18900 /// to the specified project.
18901 pub fn list(&self) -> super::builder::target_http_proxies::List {
18902 super::builder::target_http_proxies::List::new(self.inner.clone())
18903 }
18904
18905 /// Patches the specified TargetHttpProxy resource with the data included in
18906 /// the request. This method supports PATCH
18907 /// semantics and usesJSON merge
18908 /// patch format and processing rules.
18909 pub fn patch(&self) -> super::builder::target_http_proxies::Patch {
18910 super::builder::target_http_proxies::Patch::new(self.inner.clone())
18911 }
18912
18913 /// Changes the URL map for TargetHttpProxy.
18914 pub fn set_url_map(&self) -> super::builder::target_http_proxies::SetUrlMap {
18915 super::builder::target_http_proxies::SetUrlMap::new(self.inner.clone())
18916 }
18917
18918 /// Retrieves the specified Operations resource.
18919 pub fn get_operation(&self) -> super::builder::target_http_proxies::GetOperation {
18920 super::builder::target_http_proxies::GetOperation::new(self.inner.clone())
18921 }
18922}
18923
18924/// Implements a client for the Google Compute Engine API.
18925///
18926/// # Example
18927/// ```
18928/// # use google_cloud_compute_v1::client::TargetHttpsProxies;
18929/// async fn sample(
18930/// ) -> anyhow::Result<()> {
18931/// let client = TargetHttpsProxies::builder().build().await?;
18932/// // use `client` to make requests to the Google Compute Engine API.
18933/// Ok(())
18934/// }
18935/// ```
18936///
18937/// # Service Description
18938///
18939/// Service for the `targetHttpsProxies` resource.
18940///
18941/// # Configuration
18942///
18943/// To configure `TargetHttpsProxies` use the `with_*` methods in the type returned
18944/// by [builder()][TargetHttpsProxies::builder]. The default configuration should
18945/// work for most applications. Common configuration changes include
18946///
18947/// * [with_endpoint()]: by default this client uses the global default endpoint
18948/// (`https://compute.googleapis.com`). Applications using regional
18949/// endpoints or running in restricted networks (e.g. a network configured
18950/// with [Private Google Access with VPC Service Controls]) may want to
18951/// override this default.
18952/// * [with_credentials()]: by default this client uses
18953/// [Application Default Credentials]. Applications using custom
18954/// authentication may need to override this default.
18955///
18956/// [with_endpoint()]: super::builder::target_https_proxies::ClientBuilder::with_endpoint
18957/// [with_credentials()]: super::builder::target_https_proxies::ClientBuilder::with_credentials
18958/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
18959/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
18960///
18961/// # Pooling and Cloning
18962///
18963/// `TargetHttpsProxies` holds a connection pool internally, it is advised to
18964/// create one and reuse it. You do not need to wrap `TargetHttpsProxies` in
18965/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
18966/// already uses an `Arc` internally.
18967#[cfg(feature = "target-https-proxies")]
18968#[cfg_attr(docsrs, doc(cfg(feature = "target-https-proxies")))]
18969#[derive(Clone, Debug)]
18970pub struct TargetHttpsProxies {
18971 inner: std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>,
18972}
18973
18974#[cfg(feature = "target-https-proxies")]
18975impl TargetHttpsProxies {
18976 /// Returns a builder for [TargetHttpsProxies].
18977 ///
18978 /// ```
18979 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
18980 /// # use google_cloud_compute_v1::client::TargetHttpsProxies;
18981 /// let client = TargetHttpsProxies::builder().build().await?;
18982 /// # Ok(()) }
18983 /// ```
18984 pub fn builder() -> super::builder::target_https_proxies::ClientBuilder {
18985 crate::new_client_builder(super::builder::target_https_proxies::client::Factory)
18986 }
18987
18988 /// Creates a new client from the provided stub.
18989 ///
18990 /// The most common case for calling this function is in tests mocking the
18991 /// client's behavior.
18992 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
18993 where
18994 T: super::stub::TargetHttpsProxies + 'static,
18995 {
18996 Self { inner: stub.into() }
18997 }
18998
18999 pub(crate) async fn new(
19000 config: gaxi::options::ClientConfig,
19001 ) -> crate::ClientBuilderResult<Self> {
19002 let inner = Self::build_inner(config).await?;
19003 Ok(Self { inner })
19004 }
19005
19006 async fn build_inner(
19007 conf: gaxi::options::ClientConfig,
19008 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetHttpsProxies>>
19009 {
19010 if gaxi::options::tracing_enabled(&conf) {
19011 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19012 }
19013 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19014 }
19015
19016 async fn build_transport(
19017 conf: gaxi::options::ClientConfig,
19018 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpsProxies> {
19019 super::transport::TargetHttpsProxies::new(conf).await
19020 }
19021
19022 async fn build_with_tracing(
19023 conf: gaxi::options::ClientConfig,
19024 ) -> crate::ClientBuilderResult<impl super::stub::TargetHttpsProxies> {
19025 Self::build_transport(conf)
19026 .await
19027 .map(super::tracing::TargetHttpsProxies::new)
19028 }
19029
19030 /// Retrieves the list of all TargetHttpsProxy resources, regional and global,
19031 /// available to the specified project.
19032 ///
19033 /// To prevent failure, Google recommends that you set the
19034 /// `returnPartialSuccess` parameter to `true`.
19035 pub fn aggregated_list(&self) -> super::builder::target_https_proxies::AggregatedList {
19036 super::builder::target_https_proxies::AggregatedList::new(self.inner.clone())
19037 }
19038
19039 /// Deletes the specified TargetHttpsProxy resource.
19040 pub fn delete(&self) -> super::builder::target_https_proxies::Delete {
19041 super::builder::target_https_proxies::Delete::new(self.inner.clone())
19042 }
19043
19044 /// Returns the specified TargetHttpsProxy resource.
19045 pub fn get(&self) -> super::builder::target_https_proxies::Get {
19046 super::builder::target_https_proxies::Get::new(self.inner.clone())
19047 }
19048
19049 /// Creates a TargetHttpsProxy resource in the specified
19050 /// project using the data included in the request.
19051 pub fn insert(&self) -> super::builder::target_https_proxies::Insert {
19052 super::builder::target_https_proxies::Insert::new(self.inner.clone())
19053 }
19054
19055 /// Retrieves the list of TargetHttpsProxy resources
19056 /// available to the specified project.
19057 pub fn list(&self) -> super::builder::target_https_proxies::List {
19058 super::builder::target_https_proxies::List::new(self.inner.clone())
19059 }
19060
19061 /// Patches the specified TargetHttpsProxy resource with the data included in
19062 /// the request. This method supports PATCH
19063 /// semantics and usesJSON merge
19064 /// patch format and processing rules.
19065 pub fn patch(&self) -> super::builder::target_https_proxies::Patch {
19066 super::builder::target_https_proxies::Patch::new(self.inner.clone())
19067 }
19068
19069 /// Changes the Certificate Map for TargetHttpsProxy.
19070 pub fn set_certificate_map(&self) -> super::builder::target_https_proxies::SetCertificateMap {
19071 super::builder::target_https_proxies::SetCertificateMap::new(self.inner.clone())
19072 }
19073
19074 /// Sets the QUIC override policy for TargetHttpsProxy.
19075 pub fn set_quic_override(&self) -> super::builder::target_https_proxies::SetQuicOverride {
19076 super::builder::target_https_proxies::SetQuicOverride::new(self.inner.clone())
19077 }
19078
19079 /// Replaces SslCertificates for TargetHttpsProxy.
19080 pub fn set_ssl_certificates(&self) -> super::builder::target_https_proxies::SetSslCertificates {
19081 super::builder::target_https_proxies::SetSslCertificates::new(self.inner.clone())
19082 }
19083
19084 /// Sets the SSL policy for TargetHttpsProxy. The SSL policy specifies the
19085 /// server-side support for SSL features. This affects connections between
19086 /// clients and the HTTPS proxy load balancer. They do not affect the
19087 /// connection between the load balancer and the backends.
19088 pub fn set_ssl_policy(&self) -> super::builder::target_https_proxies::SetSslPolicy {
19089 super::builder::target_https_proxies::SetSslPolicy::new(self.inner.clone())
19090 }
19091
19092 /// Changes the URL map for TargetHttpsProxy.
19093 pub fn set_url_map(&self) -> super::builder::target_https_proxies::SetUrlMap {
19094 super::builder::target_https_proxies::SetUrlMap::new(self.inner.clone())
19095 }
19096
19097 /// Retrieves the specified Operations resource.
19098 pub fn get_operation(&self) -> super::builder::target_https_proxies::GetOperation {
19099 super::builder::target_https_proxies::GetOperation::new(self.inner.clone())
19100 }
19101}
19102
19103/// Implements a client for the Google Compute Engine API.
19104///
19105/// # Example
19106/// ```
19107/// # use google_cloud_compute_v1::client::TargetInstances;
19108/// async fn sample(
19109/// ) -> anyhow::Result<()> {
19110/// let client = TargetInstances::builder().build().await?;
19111/// // use `client` to make requests to the Google Compute Engine API.
19112/// Ok(())
19113/// }
19114/// ```
19115///
19116/// # Service Description
19117///
19118/// Service for the `targetInstances` resource.
19119///
19120/// # Configuration
19121///
19122/// To configure `TargetInstances` use the `with_*` methods in the type returned
19123/// by [builder()][TargetInstances::builder]. The default configuration should
19124/// work for most applications. Common configuration changes include
19125///
19126/// * [with_endpoint()]: by default this client uses the global default endpoint
19127/// (`https://compute.googleapis.com`). Applications using regional
19128/// endpoints or running in restricted networks (e.g. a network configured
19129/// with [Private Google Access with VPC Service Controls]) may want to
19130/// override this default.
19131/// * [with_credentials()]: by default this client uses
19132/// [Application Default Credentials]. Applications using custom
19133/// authentication may need to override this default.
19134///
19135/// [with_endpoint()]: super::builder::target_instances::ClientBuilder::with_endpoint
19136/// [with_credentials()]: super::builder::target_instances::ClientBuilder::with_credentials
19137/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19138/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19139///
19140/// # Pooling and Cloning
19141///
19142/// `TargetInstances` holds a connection pool internally, it is advised to
19143/// create one and reuse it. You do not need to wrap `TargetInstances` in
19144/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19145/// already uses an `Arc` internally.
19146#[cfg(feature = "target-instances")]
19147#[cfg_attr(docsrs, doc(cfg(feature = "target-instances")))]
19148#[derive(Clone, Debug)]
19149pub struct TargetInstances {
19150 inner: std::sync::Arc<dyn super::stub::dynamic::TargetInstances>,
19151}
19152
19153#[cfg(feature = "target-instances")]
19154impl TargetInstances {
19155 /// Returns a builder for [TargetInstances].
19156 ///
19157 /// ```
19158 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19159 /// # use google_cloud_compute_v1::client::TargetInstances;
19160 /// let client = TargetInstances::builder().build().await?;
19161 /// # Ok(()) }
19162 /// ```
19163 pub fn builder() -> super::builder::target_instances::ClientBuilder {
19164 crate::new_client_builder(super::builder::target_instances::client::Factory)
19165 }
19166
19167 /// Creates a new client from the provided stub.
19168 ///
19169 /// The most common case for calling this function is in tests mocking the
19170 /// client's behavior.
19171 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19172 where
19173 T: super::stub::TargetInstances + 'static,
19174 {
19175 Self { inner: stub.into() }
19176 }
19177
19178 pub(crate) async fn new(
19179 config: gaxi::options::ClientConfig,
19180 ) -> crate::ClientBuilderResult<Self> {
19181 let inner = Self::build_inner(config).await?;
19182 Ok(Self { inner })
19183 }
19184
19185 async fn build_inner(
19186 conf: gaxi::options::ClientConfig,
19187 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetInstances>> {
19188 if gaxi::options::tracing_enabled(&conf) {
19189 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19190 }
19191 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19192 }
19193
19194 async fn build_transport(
19195 conf: gaxi::options::ClientConfig,
19196 ) -> crate::ClientBuilderResult<impl super::stub::TargetInstances> {
19197 super::transport::TargetInstances::new(conf).await
19198 }
19199
19200 async fn build_with_tracing(
19201 conf: gaxi::options::ClientConfig,
19202 ) -> crate::ClientBuilderResult<impl super::stub::TargetInstances> {
19203 Self::build_transport(conf)
19204 .await
19205 .map(super::tracing::TargetInstances::new)
19206 }
19207
19208 /// Retrieves an aggregated list of target instances.
19209 ///
19210 /// To prevent failure, Google recommends that you set the
19211 /// `returnPartialSuccess` parameter to `true`.
19212 pub fn aggregated_list(&self) -> super::builder::target_instances::AggregatedList {
19213 super::builder::target_instances::AggregatedList::new(self.inner.clone())
19214 }
19215
19216 /// Deletes the specified TargetInstance resource.
19217 pub fn delete(&self) -> super::builder::target_instances::Delete {
19218 super::builder::target_instances::Delete::new(self.inner.clone())
19219 }
19220
19221 /// Returns the specified TargetInstance resource.
19222 pub fn get(&self) -> super::builder::target_instances::Get {
19223 super::builder::target_instances::Get::new(self.inner.clone())
19224 }
19225
19226 /// Creates a TargetInstance resource in the specified project and zone using
19227 /// the data included in the request.
19228 pub fn insert(&self) -> super::builder::target_instances::Insert {
19229 super::builder::target_instances::Insert::new(self.inner.clone())
19230 }
19231
19232 /// Retrieves a list of TargetInstance resources available to the specified
19233 /// project and zone.
19234 pub fn list(&self) -> super::builder::target_instances::List {
19235 super::builder::target_instances::List::new(self.inner.clone())
19236 }
19237
19238 /// Sets the Google Cloud Armor security policy for the specified target
19239 /// instance. For more information, seeGoogle
19240 /// Cloud Armor Overview
19241 pub fn set_security_policy(&self) -> super::builder::target_instances::SetSecurityPolicy {
19242 super::builder::target_instances::SetSecurityPolicy::new(self.inner.clone())
19243 }
19244
19245 /// Returns permissions that a caller has on the specified resource.
19246 pub fn test_iam_permissions(&self) -> super::builder::target_instances::TestIamPermissions {
19247 super::builder::target_instances::TestIamPermissions::new(self.inner.clone())
19248 }
19249
19250 /// Retrieves the specified zone-specific Operations resource.
19251 pub fn get_operation(&self) -> super::builder::target_instances::GetOperation {
19252 super::builder::target_instances::GetOperation::new(self.inner.clone())
19253 }
19254}
19255
19256/// Implements a client for the Google Compute Engine API.
19257///
19258/// # Example
19259/// ```
19260/// # use google_cloud_compute_v1::client::TargetPools;
19261/// async fn sample(
19262/// ) -> anyhow::Result<()> {
19263/// let client = TargetPools::builder().build().await?;
19264/// // use `client` to make requests to the Google Compute Engine API.
19265/// Ok(())
19266/// }
19267/// ```
19268///
19269/// # Service Description
19270///
19271/// Service for the `targetPools` resource.
19272///
19273/// # Configuration
19274///
19275/// To configure `TargetPools` use the `with_*` methods in the type returned
19276/// by [builder()][TargetPools::builder]. The default configuration should
19277/// work for most applications. Common configuration changes include
19278///
19279/// * [with_endpoint()]: by default this client uses the global default endpoint
19280/// (`https://compute.googleapis.com`). Applications using regional
19281/// endpoints or running in restricted networks (e.g. a network configured
19282/// with [Private Google Access with VPC Service Controls]) may want to
19283/// override this default.
19284/// * [with_credentials()]: by default this client uses
19285/// [Application Default Credentials]. Applications using custom
19286/// authentication may need to override this default.
19287///
19288/// [with_endpoint()]: super::builder::target_pools::ClientBuilder::with_endpoint
19289/// [with_credentials()]: super::builder::target_pools::ClientBuilder::with_credentials
19290/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19291/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19292///
19293/// # Pooling and Cloning
19294///
19295/// `TargetPools` holds a connection pool internally, it is advised to
19296/// create one and reuse it. You do not need to wrap `TargetPools` in
19297/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19298/// already uses an `Arc` internally.
19299#[cfg(feature = "target-pools")]
19300#[cfg_attr(docsrs, doc(cfg(feature = "target-pools")))]
19301#[derive(Clone, Debug)]
19302pub struct TargetPools {
19303 inner: std::sync::Arc<dyn super::stub::dynamic::TargetPools>,
19304}
19305
19306#[cfg(feature = "target-pools")]
19307impl TargetPools {
19308 /// Returns a builder for [TargetPools].
19309 ///
19310 /// ```
19311 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19312 /// # use google_cloud_compute_v1::client::TargetPools;
19313 /// let client = TargetPools::builder().build().await?;
19314 /// # Ok(()) }
19315 /// ```
19316 pub fn builder() -> super::builder::target_pools::ClientBuilder {
19317 crate::new_client_builder(super::builder::target_pools::client::Factory)
19318 }
19319
19320 /// Creates a new client from the provided stub.
19321 ///
19322 /// The most common case for calling this function is in tests mocking the
19323 /// client's behavior.
19324 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19325 where
19326 T: super::stub::TargetPools + 'static,
19327 {
19328 Self { inner: stub.into() }
19329 }
19330
19331 pub(crate) async fn new(
19332 config: gaxi::options::ClientConfig,
19333 ) -> crate::ClientBuilderResult<Self> {
19334 let inner = Self::build_inner(config).await?;
19335 Ok(Self { inner })
19336 }
19337
19338 async fn build_inner(
19339 conf: gaxi::options::ClientConfig,
19340 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetPools>> {
19341 if gaxi::options::tracing_enabled(&conf) {
19342 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19343 }
19344 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19345 }
19346
19347 async fn build_transport(
19348 conf: gaxi::options::ClientConfig,
19349 ) -> crate::ClientBuilderResult<impl super::stub::TargetPools> {
19350 super::transport::TargetPools::new(conf).await
19351 }
19352
19353 async fn build_with_tracing(
19354 conf: gaxi::options::ClientConfig,
19355 ) -> crate::ClientBuilderResult<impl super::stub::TargetPools> {
19356 Self::build_transport(conf)
19357 .await
19358 .map(super::tracing::TargetPools::new)
19359 }
19360
19361 /// Adds health check URLs to a target pool.
19362 pub fn add_health_check(&self) -> super::builder::target_pools::AddHealthCheck {
19363 super::builder::target_pools::AddHealthCheck::new(self.inner.clone())
19364 }
19365
19366 /// Adds an instance to a target pool.
19367 pub fn add_instance(&self) -> super::builder::target_pools::AddInstance {
19368 super::builder::target_pools::AddInstance::new(self.inner.clone())
19369 }
19370
19371 /// Retrieves an aggregated list of target pools.
19372 ///
19373 /// To prevent failure, Google recommends that you set the
19374 /// `returnPartialSuccess` parameter to `true`.
19375 pub fn aggregated_list(&self) -> super::builder::target_pools::AggregatedList {
19376 super::builder::target_pools::AggregatedList::new(self.inner.clone())
19377 }
19378
19379 /// Deletes the specified target pool.
19380 pub fn delete(&self) -> super::builder::target_pools::Delete {
19381 super::builder::target_pools::Delete::new(self.inner.clone())
19382 }
19383
19384 /// Returns the specified target pool.
19385 pub fn get(&self) -> super::builder::target_pools::Get {
19386 super::builder::target_pools::Get::new(self.inner.clone())
19387 }
19388
19389 /// Gets the most recent health check results for each IP for the
19390 /// instance that is referenced by the given target pool.
19391 pub fn get_health(&self) -> super::builder::target_pools::GetHealth {
19392 super::builder::target_pools::GetHealth::new(self.inner.clone())
19393 }
19394
19395 /// Creates a target pool in the specified project and region using
19396 /// the data included in the request.
19397 pub fn insert(&self) -> super::builder::target_pools::Insert {
19398 super::builder::target_pools::Insert::new(self.inner.clone())
19399 }
19400
19401 /// Retrieves a list of target pools available to the specified
19402 /// project and region.
19403 pub fn list(&self) -> super::builder::target_pools::List {
19404 super::builder::target_pools::List::new(self.inner.clone())
19405 }
19406
19407 /// Removes health check URL from a target pool.
19408 pub fn remove_health_check(&self) -> super::builder::target_pools::RemoveHealthCheck {
19409 super::builder::target_pools::RemoveHealthCheck::new(self.inner.clone())
19410 }
19411
19412 /// Removes instance URL from a target pool.
19413 pub fn remove_instance(&self) -> super::builder::target_pools::RemoveInstance {
19414 super::builder::target_pools::RemoveInstance::new(self.inner.clone())
19415 }
19416
19417 /// Changes a backup target pool's configurations.
19418 pub fn set_backup(&self) -> super::builder::target_pools::SetBackup {
19419 super::builder::target_pools::SetBackup::new(self.inner.clone())
19420 }
19421
19422 /// Sets the Google Cloud Armor security policy for the specified target pool.
19423 /// For more information, seeGoogle
19424 /// Cloud Armor Overview
19425 pub fn set_security_policy(&self) -> super::builder::target_pools::SetSecurityPolicy {
19426 super::builder::target_pools::SetSecurityPolicy::new(self.inner.clone())
19427 }
19428
19429 /// Returns permissions that a caller has on the specified resource.
19430 pub fn test_iam_permissions(&self) -> super::builder::target_pools::TestIamPermissions {
19431 super::builder::target_pools::TestIamPermissions::new(self.inner.clone())
19432 }
19433
19434 /// Retrieves the specified region-specific Operations resource.
19435 pub fn get_operation(&self) -> super::builder::target_pools::GetOperation {
19436 super::builder::target_pools::GetOperation::new(self.inner.clone())
19437 }
19438}
19439
19440/// Implements a client for the Google Compute Engine API.
19441///
19442/// # Example
19443/// ```
19444/// # use google_cloud_compute_v1::client::TargetSslProxies;
19445/// async fn sample(
19446/// ) -> anyhow::Result<()> {
19447/// let client = TargetSslProxies::builder().build().await?;
19448/// // use `client` to make requests to the Google Compute Engine API.
19449/// Ok(())
19450/// }
19451/// ```
19452///
19453/// # Service Description
19454///
19455/// Service for the `targetSslProxies` resource.
19456///
19457/// # Configuration
19458///
19459/// To configure `TargetSslProxies` use the `with_*` methods in the type returned
19460/// by [builder()][TargetSslProxies::builder]. The default configuration should
19461/// work for most applications. Common configuration changes include
19462///
19463/// * [with_endpoint()]: by default this client uses the global default endpoint
19464/// (`https://compute.googleapis.com`). Applications using regional
19465/// endpoints or running in restricted networks (e.g. a network configured
19466/// with [Private Google Access with VPC Service Controls]) may want to
19467/// override this default.
19468/// * [with_credentials()]: by default this client uses
19469/// [Application Default Credentials]. Applications using custom
19470/// authentication may need to override this default.
19471///
19472/// [with_endpoint()]: super::builder::target_ssl_proxies::ClientBuilder::with_endpoint
19473/// [with_credentials()]: super::builder::target_ssl_proxies::ClientBuilder::with_credentials
19474/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19475/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19476///
19477/// # Pooling and Cloning
19478///
19479/// `TargetSslProxies` holds a connection pool internally, it is advised to
19480/// create one and reuse it. You do not need to wrap `TargetSslProxies` in
19481/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19482/// already uses an `Arc` internally.
19483#[cfg(feature = "target-ssl-proxies")]
19484#[cfg_attr(docsrs, doc(cfg(feature = "target-ssl-proxies")))]
19485#[derive(Clone, Debug)]
19486pub struct TargetSslProxies {
19487 inner: std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>,
19488}
19489
19490#[cfg(feature = "target-ssl-proxies")]
19491impl TargetSslProxies {
19492 /// Returns a builder for [TargetSslProxies].
19493 ///
19494 /// ```
19495 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19496 /// # use google_cloud_compute_v1::client::TargetSslProxies;
19497 /// let client = TargetSslProxies::builder().build().await?;
19498 /// # Ok(()) }
19499 /// ```
19500 pub fn builder() -> super::builder::target_ssl_proxies::ClientBuilder {
19501 crate::new_client_builder(super::builder::target_ssl_proxies::client::Factory)
19502 }
19503
19504 /// Creates a new client from the provided stub.
19505 ///
19506 /// The most common case for calling this function is in tests mocking the
19507 /// client's behavior.
19508 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19509 where
19510 T: super::stub::TargetSslProxies + 'static,
19511 {
19512 Self { inner: stub.into() }
19513 }
19514
19515 pub(crate) async fn new(
19516 config: gaxi::options::ClientConfig,
19517 ) -> crate::ClientBuilderResult<Self> {
19518 let inner = Self::build_inner(config).await?;
19519 Ok(Self { inner })
19520 }
19521
19522 async fn build_inner(
19523 conf: gaxi::options::ClientConfig,
19524 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetSslProxies>>
19525 {
19526 if gaxi::options::tracing_enabled(&conf) {
19527 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19528 }
19529 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19530 }
19531
19532 async fn build_transport(
19533 conf: gaxi::options::ClientConfig,
19534 ) -> crate::ClientBuilderResult<impl super::stub::TargetSslProxies> {
19535 super::transport::TargetSslProxies::new(conf).await
19536 }
19537
19538 async fn build_with_tracing(
19539 conf: gaxi::options::ClientConfig,
19540 ) -> crate::ClientBuilderResult<impl super::stub::TargetSslProxies> {
19541 Self::build_transport(conf)
19542 .await
19543 .map(super::tracing::TargetSslProxies::new)
19544 }
19545
19546 /// Deletes the specified TargetSslProxy resource.
19547 pub fn delete(&self) -> super::builder::target_ssl_proxies::Delete {
19548 super::builder::target_ssl_proxies::Delete::new(self.inner.clone())
19549 }
19550
19551 /// Returns the specified TargetSslProxy resource.
19552 pub fn get(&self) -> super::builder::target_ssl_proxies::Get {
19553 super::builder::target_ssl_proxies::Get::new(self.inner.clone())
19554 }
19555
19556 /// Creates a TargetSslProxy resource in the specified project using
19557 /// the data included in the request.
19558 pub fn insert(&self) -> super::builder::target_ssl_proxies::Insert {
19559 super::builder::target_ssl_proxies::Insert::new(self.inner.clone())
19560 }
19561
19562 /// Retrieves the list of TargetSslProxy resources
19563 /// available to the specified project.
19564 pub fn list(&self) -> super::builder::target_ssl_proxies::List {
19565 super::builder::target_ssl_proxies::List::new(self.inner.clone())
19566 }
19567
19568 /// Changes the BackendService for TargetSslProxy.
19569 pub fn set_backend_service(&self) -> super::builder::target_ssl_proxies::SetBackendService {
19570 super::builder::target_ssl_proxies::SetBackendService::new(self.inner.clone())
19571 }
19572
19573 /// Changes the Certificate Map for TargetSslProxy.
19574 pub fn set_certificate_map(&self) -> super::builder::target_ssl_proxies::SetCertificateMap {
19575 super::builder::target_ssl_proxies::SetCertificateMap::new(self.inner.clone())
19576 }
19577
19578 /// Changes the ProxyHeaderType for TargetSslProxy.
19579 pub fn set_proxy_header(&self) -> super::builder::target_ssl_proxies::SetProxyHeader {
19580 super::builder::target_ssl_proxies::SetProxyHeader::new(self.inner.clone())
19581 }
19582
19583 /// Changes SslCertificates for TargetSslProxy.
19584 pub fn set_ssl_certificates(&self) -> super::builder::target_ssl_proxies::SetSslCertificates {
19585 super::builder::target_ssl_proxies::SetSslCertificates::new(self.inner.clone())
19586 }
19587
19588 /// Sets the SSL policy for TargetSslProxy. The SSL policy specifies the
19589 /// server-side support for SSL features. This affects connections between
19590 /// clients and the load balancer. They do not affect the
19591 /// connection between the load balancer and the backends.
19592 pub fn set_ssl_policy(&self) -> super::builder::target_ssl_proxies::SetSslPolicy {
19593 super::builder::target_ssl_proxies::SetSslPolicy::new(self.inner.clone())
19594 }
19595
19596 /// Returns permissions that a caller has on the specified resource.
19597 pub fn test_iam_permissions(&self) -> super::builder::target_ssl_proxies::TestIamPermissions {
19598 super::builder::target_ssl_proxies::TestIamPermissions::new(self.inner.clone())
19599 }
19600
19601 /// Retrieves the specified Operations resource.
19602 pub fn get_operation(&self) -> super::builder::target_ssl_proxies::GetOperation {
19603 super::builder::target_ssl_proxies::GetOperation::new(self.inner.clone())
19604 }
19605}
19606
19607/// Implements a client for the Google Compute Engine API.
19608///
19609/// # Example
19610/// ```
19611/// # use google_cloud_compute_v1::client::TargetTcpProxies;
19612/// async fn sample(
19613/// ) -> anyhow::Result<()> {
19614/// let client = TargetTcpProxies::builder().build().await?;
19615/// // use `client` to make requests to the Google Compute Engine API.
19616/// Ok(())
19617/// }
19618/// ```
19619///
19620/// # Service Description
19621///
19622/// Service for the `targetTcpProxies` resource.
19623///
19624/// # Configuration
19625///
19626/// To configure `TargetTcpProxies` use the `with_*` methods in the type returned
19627/// by [builder()][TargetTcpProxies::builder]. The default configuration should
19628/// work for most applications. Common configuration changes include
19629///
19630/// * [with_endpoint()]: by default this client uses the global default endpoint
19631/// (`https://compute.googleapis.com`). Applications using regional
19632/// endpoints or running in restricted networks (e.g. a network configured
19633/// with [Private Google Access with VPC Service Controls]) may want to
19634/// override this default.
19635/// * [with_credentials()]: by default this client uses
19636/// [Application Default Credentials]. Applications using custom
19637/// authentication may need to override this default.
19638///
19639/// [with_endpoint()]: super::builder::target_tcp_proxies::ClientBuilder::with_endpoint
19640/// [with_credentials()]: super::builder::target_tcp_proxies::ClientBuilder::with_credentials
19641/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19642/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19643///
19644/// # Pooling and Cloning
19645///
19646/// `TargetTcpProxies` holds a connection pool internally, it is advised to
19647/// create one and reuse it. You do not need to wrap `TargetTcpProxies` in
19648/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19649/// already uses an `Arc` internally.
19650#[cfg(feature = "target-tcp-proxies")]
19651#[cfg_attr(docsrs, doc(cfg(feature = "target-tcp-proxies")))]
19652#[derive(Clone, Debug)]
19653pub struct TargetTcpProxies {
19654 inner: std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>,
19655}
19656
19657#[cfg(feature = "target-tcp-proxies")]
19658impl TargetTcpProxies {
19659 /// Returns a builder for [TargetTcpProxies].
19660 ///
19661 /// ```
19662 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19663 /// # use google_cloud_compute_v1::client::TargetTcpProxies;
19664 /// let client = TargetTcpProxies::builder().build().await?;
19665 /// # Ok(()) }
19666 /// ```
19667 pub fn builder() -> super::builder::target_tcp_proxies::ClientBuilder {
19668 crate::new_client_builder(super::builder::target_tcp_proxies::client::Factory)
19669 }
19670
19671 /// Creates a new client from the provided stub.
19672 ///
19673 /// The most common case for calling this function is in tests mocking the
19674 /// client's behavior.
19675 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19676 where
19677 T: super::stub::TargetTcpProxies + 'static,
19678 {
19679 Self { inner: stub.into() }
19680 }
19681
19682 pub(crate) async fn new(
19683 config: gaxi::options::ClientConfig,
19684 ) -> crate::ClientBuilderResult<Self> {
19685 let inner = Self::build_inner(config).await?;
19686 Ok(Self { inner })
19687 }
19688
19689 async fn build_inner(
19690 conf: gaxi::options::ClientConfig,
19691 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetTcpProxies>>
19692 {
19693 if gaxi::options::tracing_enabled(&conf) {
19694 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19695 }
19696 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19697 }
19698
19699 async fn build_transport(
19700 conf: gaxi::options::ClientConfig,
19701 ) -> crate::ClientBuilderResult<impl super::stub::TargetTcpProxies> {
19702 super::transport::TargetTcpProxies::new(conf).await
19703 }
19704
19705 async fn build_with_tracing(
19706 conf: gaxi::options::ClientConfig,
19707 ) -> crate::ClientBuilderResult<impl super::stub::TargetTcpProxies> {
19708 Self::build_transport(conf)
19709 .await
19710 .map(super::tracing::TargetTcpProxies::new)
19711 }
19712
19713 /// Retrieves the list of all TargetTcpProxy resources, regional and global,
19714 /// available to the specified project.
19715 ///
19716 /// To prevent failure, Google recommends that you set the
19717 /// `returnPartialSuccess` parameter to `true`.
19718 pub fn aggregated_list(&self) -> super::builder::target_tcp_proxies::AggregatedList {
19719 super::builder::target_tcp_proxies::AggregatedList::new(self.inner.clone())
19720 }
19721
19722 /// Deletes the specified TargetTcpProxy resource.
19723 pub fn delete(&self) -> super::builder::target_tcp_proxies::Delete {
19724 super::builder::target_tcp_proxies::Delete::new(self.inner.clone())
19725 }
19726
19727 /// Returns the specified TargetTcpProxy resource.
19728 pub fn get(&self) -> super::builder::target_tcp_proxies::Get {
19729 super::builder::target_tcp_proxies::Get::new(self.inner.clone())
19730 }
19731
19732 /// Creates a TargetTcpProxy resource in the specified project using
19733 /// the data included in the request.
19734 pub fn insert(&self) -> super::builder::target_tcp_proxies::Insert {
19735 super::builder::target_tcp_proxies::Insert::new(self.inner.clone())
19736 }
19737
19738 /// Retrieves the list of TargetTcpProxy resources
19739 /// available to the specified project.
19740 pub fn list(&self) -> super::builder::target_tcp_proxies::List {
19741 super::builder::target_tcp_proxies::List::new(self.inner.clone())
19742 }
19743
19744 /// Changes the BackendService for TargetTcpProxy.
19745 pub fn set_backend_service(&self) -> super::builder::target_tcp_proxies::SetBackendService {
19746 super::builder::target_tcp_proxies::SetBackendService::new(self.inner.clone())
19747 }
19748
19749 /// Changes the ProxyHeaderType for TargetTcpProxy.
19750 pub fn set_proxy_header(&self) -> super::builder::target_tcp_proxies::SetProxyHeader {
19751 super::builder::target_tcp_proxies::SetProxyHeader::new(self.inner.clone())
19752 }
19753
19754 /// Returns permissions that a caller has on the specified resource.
19755 pub fn test_iam_permissions(&self) -> super::builder::target_tcp_proxies::TestIamPermissions {
19756 super::builder::target_tcp_proxies::TestIamPermissions::new(self.inner.clone())
19757 }
19758
19759 /// Retrieves the specified Operations resource.
19760 pub fn get_operation(&self) -> super::builder::target_tcp_proxies::GetOperation {
19761 super::builder::target_tcp_proxies::GetOperation::new(self.inner.clone())
19762 }
19763}
19764
19765/// Implements a client for the Google Compute Engine API.
19766///
19767/// # Example
19768/// ```
19769/// # use google_cloud_compute_v1::client::TargetVpnGateways;
19770/// async fn sample(
19771/// ) -> anyhow::Result<()> {
19772/// let client = TargetVpnGateways::builder().build().await?;
19773/// // use `client` to make requests to the Google Compute Engine API.
19774/// Ok(())
19775/// }
19776/// ```
19777///
19778/// # Service Description
19779///
19780/// Service for the `targetVpnGateways` resource.
19781///
19782/// # Configuration
19783///
19784/// To configure `TargetVpnGateways` use the `with_*` methods in the type returned
19785/// by [builder()][TargetVpnGateways::builder]. The default configuration should
19786/// work for most applications. Common configuration changes include
19787///
19788/// * [with_endpoint()]: by default this client uses the global default endpoint
19789/// (`https://compute.googleapis.com`). Applications using regional
19790/// endpoints or running in restricted networks (e.g. a network configured
19791/// with [Private Google Access with VPC Service Controls]) may want to
19792/// override this default.
19793/// * [with_credentials()]: by default this client uses
19794/// [Application Default Credentials]. Applications using custom
19795/// authentication may need to override this default.
19796///
19797/// [with_endpoint()]: super::builder::target_vpn_gateways::ClientBuilder::with_endpoint
19798/// [with_credentials()]: super::builder::target_vpn_gateways::ClientBuilder::with_credentials
19799/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19800/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19801///
19802/// # Pooling and Cloning
19803///
19804/// `TargetVpnGateways` holds a connection pool internally, it is advised to
19805/// create one and reuse it. You do not need to wrap `TargetVpnGateways` in
19806/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19807/// already uses an `Arc` internally.
19808#[cfg(feature = "target-vpn-gateways")]
19809#[cfg_attr(docsrs, doc(cfg(feature = "target-vpn-gateways")))]
19810#[derive(Clone, Debug)]
19811pub struct TargetVpnGateways {
19812 inner: std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>,
19813}
19814
19815#[cfg(feature = "target-vpn-gateways")]
19816impl TargetVpnGateways {
19817 /// Returns a builder for [TargetVpnGateways].
19818 ///
19819 /// ```
19820 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19821 /// # use google_cloud_compute_v1::client::TargetVpnGateways;
19822 /// let client = TargetVpnGateways::builder().build().await?;
19823 /// # Ok(()) }
19824 /// ```
19825 pub fn builder() -> super::builder::target_vpn_gateways::ClientBuilder {
19826 crate::new_client_builder(super::builder::target_vpn_gateways::client::Factory)
19827 }
19828
19829 /// Creates a new client from the provided stub.
19830 ///
19831 /// The most common case for calling this function is in tests mocking the
19832 /// client's behavior.
19833 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19834 where
19835 T: super::stub::TargetVpnGateways + 'static,
19836 {
19837 Self { inner: stub.into() }
19838 }
19839
19840 pub(crate) async fn new(
19841 config: gaxi::options::ClientConfig,
19842 ) -> crate::ClientBuilderResult<Self> {
19843 let inner = Self::build_inner(config).await?;
19844 Ok(Self { inner })
19845 }
19846
19847 async fn build_inner(
19848 conf: gaxi::options::ClientConfig,
19849 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::TargetVpnGateways>>
19850 {
19851 if gaxi::options::tracing_enabled(&conf) {
19852 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
19853 }
19854 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
19855 }
19856
19857 async fn build_transport(
19858 conf: gaxi::options::ClientConfig,
19859 ) -> crate::ClientBuilderResult<impl super::stub::TargetVpnGateways> {
19860 super::transport::TargetVpnGateways::new(conf).await
19861 }
19862
19863 async fn build_with_tracing(
19864 conf: gaxi::options::ClientConfig,
19865 ) -> crate::ClientBuilderResult<impl super::stub::TargetVpnGateways> {
19866 Self::build_transport(conf)
19867 .await
19868 .map(super::tracing::TargetVpnGateways::new)
19869 }
19870
19871 /// Retrieves an aggregated list of target VPN gateways.
19872 ///
19873 /// To prevent failure, Google recommends that you set the
19874 /// `returnPartialSuccess` parameter to `true`.
19875 pub fn aggregated_list(&self) -> super::builder::target_vpn_gateways::AggregatedList {
19876 super::builder::target_vpn_gateways::AggregatedList::new(self.inner.clone())
19877 }
19878
19879 /// Deletes the specified target VPN gateway.
19880 pub fn delete(&self) -> super::builder::target_vpn_gateways::Delete {
19881 super::builder::target_vpn_gateways::Delete::new(self.inner.clone())
19882 }
19883
19884 /// Returns the specified target VPN gateway.
19885 pub fn get(&self) -> super::builder::target_vpn_gateways::Get {
19886 super::builder::target_vpn_gateways::Get::new(self.inner.clone())
19887 }
19888
19889 /// Creates a target VPN gateway in the specified project and region using
19890 /// the data included in the request.
19891 pub fn insert(&self) -> super::builder::target_vpn_gateways::Insert {
19892 super::builder::target_vpn_gateways::Insert::new(self.inner.clone())
19893 }
19894
19895 /// Retrieves a list of target VPN gateways available to the specified
19896 /// project and region.
19897 pub fn list(&self) -> super::builder::target_vpn_gateways::List {
19898 super::builder::target_vpn_gateways::List::new(self.inner.clone())
19899 }
19900
19901 /// Sets the labels on a TargetVpnGateway. To learn more about labels, read theLabeling
19902 /// Resources documentation.
19903 pub fn set_labels(&self) -> super::builder::target_vpn_gateways::SetLabels {
19904 super::builder::target_vpn_gateways::SetLabels::new(self.inner.clone())
19905 }
19906
19907 /// Retrieves the specified region-specific Operations resource.
19908 pub fn get_operation(&self) -> super::builder::target_vpn_gateways::GetOperation {
19909 super::builder::target_vpn_gateways::GetOperation::new(self.inner.clone())
19910 }
19911}
19912
19913/// Implements a client for the Google Compute Engine API.
19914///
19915/// # Example
19916/// ```
19917/// # use google_cloud_compute_v1::client::UrlMaps;
19918/// async fn sample(
19919/// ) -> anyhow::Result<()> {
19920/// let client = UrlMaps::builder().build().await?;
19921/// // use `client` to make requests to the Google Compute Engine API.
19922/// Ok(())
19923/// }
19924/// ```
19925///
19926/// # Service Description
19927///
19928/// Service for the `urlMaps` resource.
19929///
19930/// # Configuration
19931///
19932/// To configure `UrlMaps` use the `with_*` methods in the type returned
19933/// by [builder()][UrlMaps::builder]. The default configuration should
19934/// work for most applications. Common configuration changes include
19935///
19936/// * [with_endpoint()]: by default this client uses the global default endpoint
19937/// (`https://compute.googleapis.com`). Applications using regional
19938/// endpoints or running in restricted networks (e.g. a network configured
19939/// with [Private Google Access with VPC Service Controls]) may want to
19940/// override this default.
19941/// * [with_credentials()]: by default this client uses
19942/// [Application Default Credentials]. Applications using custom
19943/// authentication may need to override this default.
19944///
19945/// [with_endpoint()]: super::builder::url_maps::ClientBuilder::with_endpoint
19946/// [with_credentials()]: super::builder::url_maps::ClientBuilder::with_credentials
19947/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
19948/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
19949///
19950/// # Pooling and Cloning
19951///
19952/// `UrlMaps` holds a connection pool internally, it is advised to
19953/// create one and reuse it. You do not need to wrap `UrlMaps` in
19954/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
19955/// already uses an `Arc` internally.
19956#[cfg(feature = "url-maps")]
19957#[cfg_attr(docsrs, doc(cfg(feature = "url-maps")))]
19958#[derive(Clone, Debug)]
19959pub struct UrlMaps {
19960 inner: std::sync::Arc<dyn super::stub::dynamic::UrlMaps>,
19961}
19962
19963#[cfg(feature = "url-maps")]
19964impl UrlMaps {
19965 /// Returns a builder for [UrlMaps].
19966 ///
19967 /// ```
19968 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19969 /// # use google_cloud_compute_v1::client::UrlMaps;
19970 /// let client = UrlMaps::builder().build().await?;
19971 /// # Ok(()) }
19972 /// ```
19973 pub fn builder() -> super::builder::url_maps::ClientBuilder {
19974 crate::new_client_builder(super::builder::url_maps::client::Factory)
19975 }
19976
19977 /// Creates a new client from the provided stub.
19978 ///
19979 /// The most common case for calling this function is in tests mocking the
19980 /// client's behavior.
19981 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
19982 where
19983 T: super::stub::UrlMaps + 'static,
19984 {
19985 Self { inner: stub.into() }
19986 }
19987
19988 pub(crate) async fn new(
19989 config: gaxi::options::ClientConfig,
19990 ) -> crate::ClientBuilderResult<Self> {
19991 let inner = Self::build_inner(config).await?;
19992 Ok(Self { inner })
19993 }
19994
19995 async fn build_inner(
19996 conf: gaxi::options::ClientConfig,
19997 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::UrlMaps>> {
19998 if gaxi::options::tracing_enabled(&conf) {
19999 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20000 }
20001 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20002 }
20003
20004 async fn build_transport(
20005 conf: gaxi::options::ClientConfig,
20006 ) -> crate::ClientBuilderResult<impl super::stub::UrlMaps> {
20007 super::transport::UrlMaps::new(conf).await
20008 }
20009
20010 async fn build_with_tracing(
20011 conf: gaxi::options::ClientConfig,
20012 ) -> crate::ClientBuilderResult<impl super::stub::UrlMaps> {
20013 Self::build_transport(conf)
20014 .await
20015 .map(super::tracing::UrlMaps::new)
20016 }
20017
20018 /// Retrieves the list of all UrlMap resources, regional and global,
20019 /// available to the specified project.
20020 ///
20021 /// To prevent failure, Google recommends that you set the
20022 /// `returnPartialSuccess` parameter to `true`.
20023 pub fn aggregated_list(&self) -> super::builder::url_maps::AggregatedList {
20024 super::builder::url_maps::AggregatedList::new(self.inner.clone())
20025 }
20026
20027 /// Deletes the specified UrlMap resource.
20028 pub fn delete(&self) -> super::builder::url_maps::Delete {
20029 super::builder::url_maps::Delete::new(self.inner.clone())
20030 }
20031
20032 /// Returns the specified UrlMap resource.
20033 pub fn get(&self) -> super::builder::url_maps::Get {
20034 super::builder::url_maps::Get::new(self.inner.clone())
20035 }
20036
20037 /// Creates a UrlMap resource in the specified project using
20038 /// the data included in the request.
20039 pub fn insert(&self) -> super::builder::url_maps::Insert {
20040 super::builder::url_maps::Insert::new(self.inner.clone())
20041 }
20042
20043 /// Initiates a cache invalidation operation, invalidating the specified path,
20044 /// scoped to the specified UrlMap.
20045 ///
20046 /// For more information, see [Invalidating cached
20047 /// content](/cdn/docs/invalidating-cached-content).
20048 pub fn invalidate_cache(&self) -> super::builder::url_maps::InvalidateCache {
20049 super::builder::url_maps::InvalidateCache::new(self.inner.clone())
20050 }
20051
20052 /// Retrieves the list of UrlMap resources available to the specified
20053 /// project.
20054 pub fn list(&self) -> super::builder::url_maps::List {
20055 super::builder::url_maps::List::new(self.inner.clone())
20056 }
20057
20058 /// Patches the specified UrlMap resource with the data included in the
20059 /// request. This method supportsPATCH
20060 /// semantics and uses theJSON merge
20061 /// patch format and processing rules.
20062 pub fn patch(&self) -> super::builder::url_maps::Patch {
20063 super::builder::url_maps::Patch::new(self.inner.clone())
20064 }
20065
20066 /// Returns permissions that a caller has on the specified resource.
20067 pub fn test_iam_permissions(&self) -> super::builder::url_maps::TestIamPermissions {
20068 super::builder::url_maps::TestIamPermissions::new(self.inner.clone())
20069 }
20070
20071 /// Updates the specified UrlMap resource with the data included in the
20072 /// request.
20073 pub fn update(&self) -> super::builder::url_maps::Update {
20074 super::builder::url_maps::Update::new(self.inner.clone())
20075 }
20076
20077 /// Runs static validation for the UrlMap. In particular, the tests of the
20078 /// provided UrlMap will be run. Calling this method does NOT create the
20079 /// UrlMap.
20080 pub fn validate(&self) -> super::builder::url_maps::Validate {
20081 super::builder::url_maps::Validate::new(self.inner.clone())
20082 }
20083
20084 /// Retrieves the specified Operations resource.
20085 pub fn get_operation(&self) -> super::builder::url_maps::GetOperation {
20086 super::builder::url_maps::GetOperation::new(self.inner.clone())
20087 }
20088}
20089
20090/// Implements a client for the Google Compute Engine API.
20091///
20092/// # Example
20093/// ```
20094/// # use google_cloud_compute_v1::client::VpnGateways;
20095/// async fn sample(
20096/// ) -> anyhow::Result<()> {
20097/// let client = VpnGateways::builder().build().await?;
20098/// // use `client` to make requests to the Google Compute Engine API.
20099/// Ok(())
20100/// }
20101/// ```
20102///
20103/// # Service Description
20104///
20105/// Service for the `vpnGateways` resource.
20106///
20107/// # Configuration
20108///
20109/// To configure `VpnGateways` use the `with_*` methods in the type returned
20110/// by [builder()][VpnGateways::builder]. The default configuration should
20111/// work for most applications. Common configuration changes include
20112///
20113/// * [with_endpoint()]: by default this client uses the global default endpoint
20114/// (`https://compute.googleapis.com`). Applications using regional
20115/// endpoints or running in restricted networks (e.g. a network configured
20116/// with [Private Google Access with VPC Service Controls]) may want to
20117/// override this default.
20118/// * [with_credentials()]: by default this client uses
20119/// [Application Default Credentials]. Applications using custom
20120/// authentication may need to override this default.
20121///
20122/// [with_endpoint()]: super::builder::vpn_gateways::ClientBuilder::with_endpoint
20123/// [with_credentials()]: super::builder::vpn_gateways::ClientBuilder::with_credentials
20124/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20125/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20126///
20127/// # Pooling and Cloning
20128///
20129/// `VpnGateways` holds a connection pool internally, it is advised to
20130/// create one and reuse it. You do not need to wrap `VpnGateways` in
20131/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20132/// already uses an `Arc` internally.
20133#[cfg(feature = "vpn-gateways")]
20134#[cfg_attr(docsrs, doc(cfg(feature = "vpn-gateways")))]
20135#[derive(Clone, Debug)]
20136pub struct VpnGateways {
20137 inner: std::sync::Arc<dyn super::stub::dynamic::VpnGateways>,
20138}
20139
20140#[cfg(feature = "vpn-gateways")]
20141impl VpnGateways {
20142 /// Returns a builder for [VpnGateways].
20143 ///
20144 /// ```
20145 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20146 /// # use google_cloud_compute_v1::client::VpnGateways;
20147 /// let client = VpnGateways::builder().build().await?;
20148 /// # Ok(()) }
20149 /// ```
20150 pub fn builder() -> super::builder::vpn_gateways::ClientBuilder {
20151 crate::new_client_builder(super::builder::vpn_gateways::client::Factory)
20152 }
20153
20154 /// Creates a new client from the provided stub.
20155 ///
20156 /// The most common case for calling this function is in tests mocking the
20157 /// client's behavior.
20158 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20159 where
20160 T: super::stub::VpnGateways + 'static,
20161 {
20162 Self { inner: stub.into() }
20163 }
20164
20165 pub(crate) async fn new(
20166 config: gaxi::options::ClientConfig,
20167 ) -> crate::ClientBuilderResult<Self> {
20168 let inner = Self::build_inner(config).await?;
20169 Ok(Self { inner })
20170 }
20171
20172 async fn build_inner(
20173 conf: gaxi::options::ClientConfig,
20174 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VpnGateways>> {
20175 if gaxi::options::tracing_enabled(&conf) {
20176 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20177 }
20178 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20179 }
20180
20181 async fn build_transport(
20182 conf: gaxi::options::ClientConfig,
20183 ) -> crate::ClientBuilderResult<impl super::stub::VpnGateways> {
20184 super::transport::VpnGateways::new(conf).await
20185 }
20186
20187 async fn build_with_tracing(
20188 conf: gaxi::options::ClientConfig,
20189 ) -> crate::ClientBuilderResult<impl super::stub::VpnGateways> {
20190 Self::build_transport(conf)
20191 .await
20192 .map(super::tracing::VpnGateways::new)
20193 }
20194
20195 /// Retrieves an aggregated list of VPN gateways.
20196 ///
20197 /// To prevent failure, Google recommends that you set the
20198 /// `returnPartialSuccess` parameter to `true`.
20199 pub fn aggregated_list(&self) -> super::builder::vpn_gateways::AggregatedList {
20200 super::builder::vpn_gateways::AggregatedList::new(self.inner.clone())
20201 }
20202
20203 /// Deletes the specified VPN gateway.
20204 pub fn delete(&self) -> super::builder::vpn_gateways::Delete {
20205 super::builder::vpn_gateways::Delete::new(self.inner.clone())
20206 }
20207
20208 /// Returns the specified VPN gateway.
20209 pub fn get(&self) -> super::builder::vpn_gateways::Get {
20210 super::builder::vpn_gateways::Get::new(self.inner.clone())
20211 }
20212
20213 /// Returns the status for the specified VPN gateway.
20214 pub fn get_status(&self) -> super::builder::vpn_gateways::GetStatus {
20215 super::builder::vpn_gateways::GetStatus::new(self.inner.clone())
20216 }
20217
20218 /// Creates a VPN gateway in the specified project and region using
20219 /// the data included in the request.
20220 pub fn insert(&self) -> super::builder::vpn_gateways::Insert {
20221 super::builder::vpn_gateways::Insert::new(self.inner.clone())
20222 }
20223
20224 /// Retrieves a list of VPN gateways available to the specified
20225 /// project and region.
20226 pub fn list(&self) -> super::builder::vpn_gateways::List {
20227 super::builder::vpn_gateways::List::new(self.inner.clone())
20228 }
20229
20230 /// Sets the labels on a VpnGateway. To learn more about labels, read theLabeling
20231 /// Resources documentation.
20232 pub fn set_labels(&self) -> super::builder::vpn_gateways::SetLabels {
20233 super::builder::vpn_gateways::SetLabels::new(self.inner.clone())
20234 }
20235
20236 /// Returns permissions that a caller has on the specified resource.
20237 pub fn test_iam_permissions(&self) -> super::builder::vpn_gateways::TestIamPermissions {
20238 super::builder::vpn_gateways::TestIamPermissions::new(self.inner.clone())
20239 }
20240
20241 /// Retrieves the specified region-specific Operations resource.
20242 pub fn get_operation(&self) -> super::builder::vpn_gateways::GetOperation {
20243 super::builder::vpn_gateways::GetOperation::new(self.inner.clone())
20244 }
20245}
20246
20247/// Implements a client for the Google Compute Engine API.
20248///
20249/// # Example
20250/// ```
20251/// # use google_cloud_compute_v1::client::VpnTunnels;
20252/// async fn sample(
20253/// ) -> anyhow::Result<()> {
20254/// let client = VpnTunnels::builder().build().await?;
20255/// // use `client` to make requests to the Google Compute Engine API.
20256/// Ok(())
20257/// }
20258/// ```
20259///
20260/// # Service Description
20261///
20262/// Service for the `vpnTunnels` resource.
20263///
20264/// # Configuration
20265///
20266/// To configure `VpnTunnels` use the `with_*` methods in the type returned
20267/// by [builder()][VpnTunnels::builder]. The default configuration should
20268/// work for most applications. Common configuration changes include
20269///
20270/// * [with_endpoint()]: by default this client uses the global default endpoint
20271/// (`https://compute.googleapis.com`). Applications using regional
20272/// endpoints or running in restricted networks (e.g. a network configured
20273/// with [Private Google Access with VPC Service Controls]) may want to
20274/// override this default.
20275/// * [with_credentials()]: by default this client uses
20276/// [Application Default Credentials]. Applications using custom
20277/// authentication may need to override this default.
20278///
20279/// [with_endpoint()]: super::builder::vpn_tunnels::ClientBuilder::with_endpoint
20280/// [with_credentials()]: super::builder::vpn_tunnels::ClientBuilder::with_credentials
20281/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20282/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20283///
20284/// # Pooling and Cloning
20285///
20286/// `VpnTunnels` holds a connection pool internally, it is advised to
20287/// create one and reuse it. You do not need to wrap `VpnTunnels` in
20288/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20289/// already uses an `Arc` internally.
20290#[cfg(feature = "vpn-tunnels")]
20291#[cfg_attr(docsrs, doc(cfg(feature = "vpn-tunnels")))]
20292#[derive(Clone, Debug)]
20293pub struct VpnTunnels {
20294 inner: std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>,
20295}
20296
20297#[cfg(feature = "vpn-tunnels")]
20298impl VpnTunnels {
20299 /// Returns a builder for [VpnTunnels].
20300 ///
20301 /// ```
20302 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20303 /// # use google_cloud_compute_v1::client::VpnTunnels;
20304 /// let client = VpnTunnels::builder().build().await?;
20305 /// # Ok(()) }
20306 /// ```
20307 pub fn builder() -> super::builder::vpn_tunnels::ClientBuilder {
20308 crate::new_client_builder(super::builder::vpn_tunnels::client::Factory)
20309 }
20310
20311 /// Creates a new client from the provided stub.
20312 ///
20313 /// The most common case for calling this function is in tests mocking the
20314 /// client's behavior.
20315 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20316 where
20317 T: super::stub::VpnTunnels + 'static,
20318 {
20319 Self { inner: stub.into() }
20320 }
20321
20322 pub(crate) async fn new(
20323 config: gaxi::options::ClientConfig,
20324 ) -> crate::ClientBuilderResult<Self> {
20325 let inner = Self::build_inner(config).await?;
20326 Ok(Self { inner })
20327 }
20328
20329 async fn build_inner(
20330 conf: gaxi::options::ClientConfig,
20331 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::VpnTunnels>> {
20332 if gaxi::options::tracing_enabled(&conf) {
20333 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20334 }
20335 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20336 }
20337
20338 async fn build_transport(
20339 conf: gaxi::options::ClientConfig,
20340 ) -> crate::ClientBuilderResult<impl super::stub::VpnTunnels> {
20341 super::transport::VpnTunnels::new(conf).await
20342 }
20343
20344 async fn build_with_tracing(
20345 conf: gaxi::options::ClientConfig,
20346 ) -> crate::ClientBuilderResult<impl super::stub::VpnTunnels> {
20347 Self::build_transport(conf)
20348 .await
20349 .map(super::tracing::VpnTunnels::new)
20350 }
20351
20352 /// Retrieves an aggregated list of VPN tunnels.
20353 ///
20354 /// To prevent failure, Google recommends that you set the
20355 /// `returnPartialSuccess` parameter to `true`.
20356 pub fn aggregated_list(&self) -> super::builder::vpn_tunnels::AggregatedList {
20357 super::builder::vpn_tunnels::AggregatedList::new(self.inner.clone())
20358 }
20359
20360 /// Deletes the specified VpnTunnel resource.
20361 pub fn delete(&self) -> super::builder::vpn_tunnels::Delete {
20362 super::builder::vpn_tunnels::Delete::new(self.inner.clone())
20363 }
20364
20365 /// Returns the specified VpnTunnel resource.
20366 pub fn get(&self) -> super::builder::vpn_tunnels::Get {
20367 super::builder::vpn_tunnels::Get::new(self.inner.clone())
20368 }
20369
20370 /// Creates a VpnTunnel resource in the specified project and region using
20371 /// the data included in the request.
20372 pub fn insert(&self) -> super::builder::vpn_tunnels::Insert {
20373 super::builder::vpn_tunnels::Insert::new(self.inner.clone())
20374 }
20375
20376 /// Retrieves a list of VpnTunnel resources contained in the specified
20377 /// project and region.
20378 pub fn list(&self) -> super::builder::vpn_tunnels::List {
20379 super::builder::vpn_tunnels::List::new(self.inner.clone())
20380 }
20381
20382 /// Sets the labels on a VpnTunnel. To learn more about labels, read theLabeling
20383 /// Resources documentation.
20384 pub fn set_labels(&self) -> super::builder::vpn_tunnels::SetLabels {
20385 super::builder::vpn_tunnels::SetLabels::new(self.inner.clone())
20386 }
20387
20388 /// Retrieves the specified region-specific Operations resource.
20389 pub fn get_operation(&self) -> super::builder::vpn_tunnels::GetOperation {
20390 super::builder::vpn_tunnels::GetOperation::new(self.inner.clone())
20391 }
20392}
20393
20394/// Implements a client for the Google Compute Engine API.
20395///
20396/// # Example
20397/// ```
20398/// # use google_cloud_compute_v1::client::WireGroups;
20399/// async fn sample(
20400/// ) -> anyhow::Result<()> {
20401/// let client = WireGroups::builder().build().await?;
20402/// // use `client` to make requests to the Google Compute Engine API.
20403/// Ok(())
20404/// }
20405/// ```
20406///
20407/// # Service Description
20408///
20409/// Service for the `wireGroups` resource.
20410///
20411/// # Configuration
20412///
20413/// To configure `WireGroups` use the `with_*` methods in the type returned
20414/// by [builder()][WireGroups::builder]. The default configuration should
20415/// work for most applications. Common configuration changes include
20416///
20417/// * [with_endpoint()]: by default this client uses the global default endpoint
20418/// (`https://compute.googleapis.com`). Applications using regional
20419/// endpoints or running in restricted networks (e.g. a network configured
20420/// with [Private Google Access with VPC Service Controls]) may want to
20421/// override this default.
20422/// * [with_credentials()]: by default this client uses
20423/// [Application Default Credentials]. Applications using custom
20424/// authentication may need to override this default.
20425///
20426/// [with_endpoint()]: super::builder::wire_groups::ClientBuilder::with_endpoint
20427/// [with_credentials()]: super::builder::wire_groups::ClientBuilder::with_credentials
20428/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20429/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20430///
20431/// # Pooling and Cloning
20432///
20433/// `WireGroups` holds a connection pool internally, it is advised to
20434/// create one and reuse it. You do not need to wrap `WireGroups` in
20435/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20436/// already uses an `Arc` internally.
20437#[cfg(feature = "wire-groups")]
20438#[cfg_attr(docsrs, doc(cfg(feature = "wire-groups")))]
20439#[derive(Clone, Debug)]
20440pub struct WireGroups {
20441 inner: std::sync::Arc<dyn super::stub::dynamic::WireGroups>,
20442}
20443
20444#[cfg(feature = "wire-groups")]
20445impl WireGroups {
20446 /// Returns a builder for [WireGroups].
20447 ///
20448 /// ```
20449 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20450 /// # use google_cloud_compute_v1::client::WireGroups;
20451 /// let client = WireGroups::builder().build().await?;
20452 /// # Ok(()) }
20453 /// ```
20454 pub fn builder() -> super::builder::wire_groups::ClientBuilder {
20455 crate::new_client_builder(super::builder::wire_groups::client::Factory)
20456 }
20457
20458 /// Creates a new client from the provided stub.
20459 ///
20460 /// The most common case for calling this function is in tests mocking the
20461 /// client's behavior.
20462 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20463 where
20464 T: super::stub::WireGroups + 'static,
20465 {
20466 Self { inner: stub.into() }
20467 }
20468
20469 pub(crate) async fn new(
20470 config: gaxi::options::ClientConfig,
20471 ) -> crate::ClientBuilderResult<Self> {
20472 let inner = Self::build_inner(config).await?;
20473 Ok(Self { inner })
20474 }
20475
20476 async fn build_inner(
20477 conf: gaxi::options::ClientConfig,
20478 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::WireGroups>> {
20479 if gaxi::options::tracing_enabled(&conf) {
20480 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20481 }
20482 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20483 }
20484
20485 async fn build_transport(
20486 conf: gaxi::options::ClientConfig,
20487 ) -> crate::ClientBuilderResult<impl super::stub::WireGroups> {
20488 super::transport::WireGroups::new(conf).await
20489 }
20490
20491 async fn build_with_tracing(
20492 conf: gaxi::options::ClientConfig,
20493 ) -> crate::ClientBuilderResult<impl super::stub::WireGroups> {
20494 Self::build_transport(conf)
20495 .await
20496 .map(super::tracing::WireGroups::new)
20497 }
20498
20499 /// Deletes the specified wire group in the given scope.
20500 pub fn delete(&self) -> super::builder::wire_groups::Delete {
20501 super::builder::wire_groups::Delete::new(self.inner.clone())
20502 }
20503
20504 /// Gets the specified wire group resource in the given scope.
20505 pub fn get(&self) -> super::builder::wire_groups::Get {
20506 super::builder::wire_groups::Get::new(self.inner.clone())
20507 }
20508
20509 /// Creates a wire group in the specified project in the given scope
20510 /// using the parameters that are included in the request.
20511 pub fn insert(&self) -> super::builder::wire_groups::Insert {
20512 super::builder::wire_groups::Insert::new(self.inner.clone())
20513 }
20514
20515 /// Lists the wire groups for a project in the given scope.
20516 pub fn list(&self) -> super::builder::wire_groups::List {
20517 super::builder::wire_groups::List::new(self.inner.clone())
20518 }
20519
20520 /// Updates the specified wire group resource with the data included in the
20521 /// request. This method supportsPATCH
20522 /// semantics and usesJSON merge
20523 /// patch format and processing rules.
20524 pub fn patch(&self) -> super::builder::wire_groups::Patch {
20525 super::builder::wire_groups::Patch::new(self.inner.clone())
20526 }
20527
20528 /// Retrieves the specified Operations resource.
20529 pub fn get_operation(&self) -> super::builder::wire_groups::GetOperation {
20530 super::builder::wire_groups::GetOperation::new(self.inner.clone())
20531 }
20532}
20533
20534/// Implements a client for the Google Compute Engine API.
20535///
20536/// # Example
20537/// ```
20538/// # use google_cloud_compute_v1::client::ZoneOperations;
20539/// async fn sample(
20540/// ) -> anyhow::Result<()> {
20541/// let client = ZoneOperations::builder().build().await?;
20542/// // use `client` to make requests to the Google Compute Engine API.
20543/// Ok(())
20544/// }
20545/// ```
20546///
20547/// # Service Description
20548///
20549/// Service for the `zoneOperations` resource.
20550///
20551/// # Configuration
20552///
20553/// To configure `ZoneOperations` use the `with_*` methods in the type returned
20554/// by [builder()][ZoneOperations::builder]. The default configuration should
20555/// work for most applications. Common configuration changes include
20556///
20557/// * [with_endpoint()]: by default this client uses the global default endpoint
20558/// (`https://compute.googleapis.com`). Applications using regional
20559/// endpoints or running in restricted networks (e.g. a network configured
20560/// with [Private Google Access with VPC Service Controls]) may want to
20561/// override this default.
20562/// * [with_credentials()]: by default this client uses
20563/// [Application Default Credentials]. Applications using custom
20564/// authentication may need to override this default.
20565///
20566/// [with_endpoint()]: super::builder::zone_operations::ClientBuilder::with_endpoint
20567/// [with_credentials()]: super::builder::zone_operations::ClientBuilder::with_credentials
20568/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20569/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20570///
20571/// # Pooling and Cloning
20572///
20573/// `ZoneOperations` holds a connection pool internally, it is advised to
20574/// create one and reuse it. You do not need to wrap `ZoneOperations` in
20575/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20576/// already uses an `Arc` internally.
20577#[cfg(feature = "zone-operations")]
20578#[cfg_attr(docsrs, doc(cfg(feature = "zone-operations")))]
20579#[derive(Clone, Debug)]
20580pub struct ZoneOperations {
20581 inner: std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>,
20582}
20583
20584#[cfg(feature = "zone-operations")]
20585impl ZoneOperations {
20586 /// Returns a builder for [ZoneOperations].
20587 ///
20588 /// ```
20589 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20590 /// # use google_cloud_compute_v1::client::ZoneOperations;
20591 /// let client = ZoneOperations::builder().build().await?;
20592 /// # Ok(()) }
20593 /// ```
20594 pub fn builder() -> super::builder::zone_operations::ClientBuilder {
20595 crate::new_client_builder(super::builder::zone_operations::client::Factory)
20596 }
20597
20598 /// Creates a new client from the provided stub.
20599 ///
20600 /// The most common case for calling this function is in tests mocking the
20601 /// client's behavior.
20602 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20603 where
20604 T: super::stub::ZoneOperations + 'static,
20605 {
20606 Self { inner: stub.into() }
20607 }
20608
20609 pub(crate) async fn new(
20610 config: gaxi::options::ClientConfig,
20611 ) -> crate::ClientBuilderResult<Self> {
20612 let inner = Self::build_inner(config).await?;
20613 Ok(Self { inner })
20614 }
20615
20616 async fn build_inner(
20617 conf: gaxi::options::ClientConfig,
20618 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ZoneOperations>> {
20619 if gaxi::options::tracing_enabled(&conf) {
20620 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20621 }
20622 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20623 }
20624
20625 async fn build_transport(
20626 conf: gaxi::options::ClientConfig,
20627 ) -> crate::ClientBuilderResult<impl super::stub::ZoneOperations> {
20628 super::transport::ZoneOperations::new(conf).await
20629 }
20630
20631 async fn build_with_tracing(
20632 conf: gaxi::options::ClientConfig,
20633 ) -> crate::ClientBuilderResult<impl super::stub::ZoneOperations> {
20634 Self::build_transport(conf)
20635 .await
20636 .map(super::tracing::ZoneOperations::new)
20637 }
20638
20639 /// Deletes the specified zone-specific Operations resource.
20640 pub fn delete(&self) -> super::builder::zone_operations::Delete {
20641 super::builder::zone_operations::Delete::new(self.inner.clone())
20642 }
20643
20644 /// Retrieves the specified zone-specific Operations resource.
20645 pub fn get(&self) -> super::builder::zone_operations::Get {
20646 super::builder::zone_operations::Get::new(self.inner.clone())
20647 }
20648
20649 /// Retrieves a list of Operation resources contained within
20650 /// the specified zone.
20651 pub fn list(&self) -> super::builder::zone_operations::List {
20652 super::builder::zone_operations::List::new(self.inner.clone())
20653 }
20654
20655 /// Waits for the specified Operation resource to return as `DONE`
20656 /// or for the request to approach the 2 minute deadline, and retrieves the
20657 /// specified Operation resource. This method waits for no more than the
20658 /// 2 minutes and then returns the current state of the
20659 /// operation, which might be `DONE` or still in progress.
20660 ///
20661 /// This method is called on a best-effort basis. Specifically:
20662 ///
20663 /// ```norust
20664 /// - In uncommon cases, when the server is overloaded, the request might
20665 /// return before the default deadline is reached, or might return after zero
20666 /// seconds.
20667 /// ```
20668 ///
20669 /// - If the default deadline is reached, there is no guarantee that the
20670 /// operation is actually done when the method returns. Be prepared to retry
20671 /// if the operation is not `DONE`.
20672 pub fn wait(&self) -> super::builder::zone_operations::Wait {
20673 super::builder::zone_operations::Wait::new(self.inner.clone())
20674 }
20675}
20676
20677/// Implements a client for the Google Compute Engine API.
20678///
20679/// # Example
20680/// ```
20681/// # use google_cloud_compute_v1::client::ZoneVmExtensionPolicies;
20682/// async fn sample(
20683/// ) -> anyhow::Result<()> {
20684/// let client = ZoneVmExtensionPolicies::builder().build().await?;
20685/// // use `client` to make requests to the Google Compute Engine API.
20686/// Ok(())
20687/// }
20688/// ```
20689///
20690/// # Service Description
20691///
20692/// Service for the `zoneVmExtensionPolicies` resource.
20693///
20694/// # Configuration
20695///
20696/// To configure `ZoneVmExtensionPolicies` use the `with_*` methods in the type returned
20697/// by [builder()][ZoneVmExtensionPolicies::builder]. The default configuration should
20698/// work for most applications. Common configuration changes include
20699///
20700/// * [with_endpoint()]: by default this client uses the global default endpoint
20701/// (`https://compute.googleapis.com`). Applications using regional
20702/// endpoints or running in restricted networks (e.g. a network configured
20703/// with [Private Google Access with VPC Service Controls]) may want to
20704/// override this default.
20705/// * [with_credentials()]: by default this client uses
20706/// [Application Default Credentials]. Applications using custom
20707/// authentication may need to override this default.
20708///
20709/// [with_endpoint()]: super::builder::zone_vm_extension_policies::ClientBuilder::with_endpoint
20710/// [with_credentials()]: super::builder::zone_vm_extension_policies::ClientBuilder::with_credentials
20711/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20712/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20713///
20714/// # Pooling and Cloning
20715///
20716/// `ZoneVmExtensionPolicies` holds a connection pool internally, it is advised to
20717/// create one and reuse it. You do not need to wrap `ZoneVmExtensionPolicies` in
20718/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20719/// already uses an `Arc` internally.
20720#[cfg(feature = "zone-vm-extension-policies")]
20721#[cfg_attr(docsrs, doc(cfg(feature = "zone-vm-extension-policies")))]
20722#[derive(Clone, Debug)]
20723pub struct ZoneVmExtensionPolicies {
20724 inner: std::sync::Arc<dyn super::stub::dynamic::ZoneVmExtensionPolicies>,
20725}
20726
20727#[cfg(feature = "zone-vm-extension-policies")]
20728impl ZoneVmExtensionPolicies {
20729 /// Returns a builder for [ZoneVmExtensionPolicies].
20730 ///
20731 /// ```
20732 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20733 /// # use google_cloud_compute_v1::client::ZoneVmExtensionPolicies;
20734 /// let client = ZoneVmExtensionPolicies::builder().build().await?;
20735 /// # Ok(()) }
20736 /// ```
20737 pub fn builder() -> super::builder::zone_vm_extension_policies::ClientBuilder {
20738 crate::new_client_builder(super::builder::zone_vm_extension_policies::client::Factory)
20739 }
20740
20741 /// Creates a new client from the provided stub.
20742 ///
20743 /// The most common case for calling this function is in tests mocking the
20744 /// client's behavior.
20745 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20746 where
20747 T: super::stub::ZoneVmExtensionPolicies + 'static,
20748 {
20749 Self { inner: stub.into() }
20750 }
20751
20752 pub(crate) async fn new(
20753 config: gaxi::options::ClientConfig,
20754 ) -> crate::ClientBuilderResult<Self> {
20755 let inner = Self::build_inner(config).await?;
20756 Ok(Self { inner })
20757 }
20758
20759 async fn build_inner(
20760 conf: gaxi::options::ClientConfig,
20761 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::ZoneVmExtensionPolicies>>
20762 {
20763 if gaxi::options::tracing_enabled(&conf) {
20764 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20765 }
20766 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20767 }
20768
20769 async fn build_transport(
20770 conf: gaxi::options::ClientConfig,
20771 ) -> crate::ClientBuilderResult<impl super::stub::ZoneVmExtensionPolicies> {
20772 super::transport::ZoneVmExtensionPolicies::new(conf).await
20773 }
20774
20775 async fn build_with_tracing(
20776 conf: gaxi::options::ClientConfig,
20777 ) -> crate::ClientBuilderResult<impl super::stub::ZoneVmExtensionPolicies> {
20778 Self::build_transport(conf)
20779 .await
20780 .map(super::tracing::ZoneVmExtensionPolicies::new)
20781 }
20782
20783 /// Deletes a specified zone VM extension policy within a project.
20784 pub fn delete(&self) -> super::builder::zone_vm_extension_policies::Delete {
20785 super::builder::zone_vm_extension_policies::Delete::new(self.inner.clone())
20786 }
20787
20788 /// Retrieves details of a specific zone VM extension policy within a project.
20789 pub fn get(&self) -> super::builder::zone_vm_extension_policies::Get {
20790 super::builder::zone_vm_extension_policies::Get::new(self.inner.clone())
20791 }
20792
20793 /// Creates a new zone-level VM extension policy within a project.
20794 pub fn insert(&self) -> super::builder::zone_vm_extension_policies::Insert {
20795 super::builder::zone_vm_extension_policies::Insert::new(self.inner.clone())
20796 }
20797
20798 /// Lists all VM extension policies within a specific zone for a project.
20799 pub fn list(&self) -> super::builder::zone_vm_extension_policies::List {
20800 super::builder::zone_vm_extension_policies::List::new(self.inner.clone())
20801 }
20802
20803 /// Modifies an existing zone VM extension policy within a project.
20804 pub fn update(&self) -> super::builder::zone_vm_extension_policies::Update {
20805 super::builder::zone_vm_extension_policies::Update::new(self.inner.clone())
20806 }
20807
20808 /// Retrieves the specified zone-specific Operations resource.
20809 pub fn get_operation(&self) -> super::builder::zone_vm_extension_policies::GetOperation {
20810 super::builder::zone_vm_extension_policies::GetOperation::new(self.inner.clone())
20811 }
20812}
20813
20814/// Implements a client for the Google Compute Engine API.
20815///
20816/// # Example
20817/// ```
20818/// # use google_cloud_compute_v1::client::Zones;
20819/// async fn sample(
20820/// ) -> anyhow::Result<()> {
20821/// let client = Zones::builder().build().await?;
20822/// // use `client` to make requests to the Google Compute Engine API.
20823/// Ok(())
20824/// }
20825/// ```
20826///
20827/// # Service Description
20828///
20829/// Service for the `zones` resource.
20830///
20831/// # Configuration
20832///
20833/// To configure `Zones` use the `with_*` methods in the type returned
20834/// by [builder()][Zones::builder]. The default configuration should
20835/// work for most applications. Common configuration changes include
20836///
20837/// * [with_endpoint()]: by default this client uses the global default endpoint
20838/// (`https://compute.googleapis.com`). Applications using regional
20839/// endpoints or running in restricted networks (e.g. a network configured
20840/// with [Private Google Access with VPC Service Controls]) may want to
20841/// override this default.
20842/// * [with_credentials()]: by default this client uses
20843/// [Application Default Credentials]. Applications using custom
20844/// authentication may need to override this default.
20845///
20846/// [with_endpoint()]: super::builder::zones::ClientBuilder::with_endpoint
20847/// [with_credentials()]: super::builder::zones::ClientBuilder::with_credentials
20848/// [Private Google Access with VPC Service Controls]: https://cloud.google.com/vpc-service-controls/docs/private-connectivity
20849/// [Application Default Credentials]: https://cloud.google.com/docs/authentication#adc
20850///
20851/// # Pooling and Cloning
20852///
20853/// `Zones` holds a connection pool internally, it is advised to
20854/// create one and reuse it. You do not need to wrap `Zones` in
20855/// an [Rc](std::rc::Rc) or [Arc](std::sync::Arc) to reuse it, because it
20856/// already uses an `Arc` internally.
20857#[cfg(feature = "zones")]
20858#[cfg_attr(docsrs, doc(cfg(feature = "zones")))]
20859#[derive(Clone, Debug)]
20860pub struct Zones {
20861 inner: std::sync::Arc<dyn super::stub::dynamic::Zones>,
20862}
20863
20864#[cfg(feature = "zones")]
20865impl Zones {
20866 /// Returns a builder for [Zones].
20867 ///
20868 /// ```
20869 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20870 /// # use google_cloud_compute_v1::client::Zones;
20871 /// let client = Zones::builder().build().await?;
20872 /// # Ok(()) }
20873 /// ```
20874 pub fn builder() -> super::builder::zones::ClientBuilder {
20875 crate::new_client_builder(super::builder::zones::client::Factory)
20876 }
20877
20878 /// Creates a new client from the provided stub.
20879 ///
20880 /// The most common case for calling this function is in tests mocking the
20881 /// client's behavior.
20882 pub fn from_stub<T>(stub: impl Into<std::sync::Arc<T>>) -> Self
20883 where
20884 T: super::stub::Zones + 'static,
20885 {
20886 Self { inner: stub.into() }
20887 }
20888
20889 pub(crate) async fn new(
20890 config: gaxi::options::ClientConfig,
20891 ) -> crate::ClientBuilderResult<Self> {
20892 let inner = Self::build_inner(config).await?;
20893 Ok(Self { inner })
20894 }
20895
20896 async fn build_inner(
20897 conf: gaxi::options::ClientConfig,
20898 ) -> crate::ClientBuilderResult<std::sync::Arc<dyn super::stub::dynamic::Zones>> {
20899 if gaxi::options::tracing_enabled(&conf) {
20900 return Ok(std::sync::Arc::new(Self::build_with_tracing(conf).await?));
20901 }
20902 Ok(std::sync::Arc::new(Self::build_transport(conf).await?))
20903 }
20904
20905 async fn build_transport(
20906 conf: gaxi::options::ClientConfig,
20907 ) -> crate::ClientBuilderResult<impl super::stub::Zones> {
20908 super::transport::Zones::new(conf).await
20909 }
20910
20911 async fn build_with_tracing(
20912 conf: gaxi::options::ClientConfig,
20913 ) -> crate::ClientBuilderResult<impl super::stub::Zones> {
20914 Self::build_transport(conf)
20915 .await
20916 .map(super::tracing::Zones::new)
20917 }
20918
20919 /// Returns the specified Zone resource.
20920 pub fn get(&self) -> super::builder::zones::Get {
20921 super::builder::zones::Get::new(self.inner.clone())
20922 }
20923
20924 /// Retrieves the list of Zone resources available to the specified project.
20925 pub fn list(&self) -> super::builder::zones::List {
20926 super::builder::zones::List::new(self.inner.clone())
20927 }
20928}